From 52f3b8186c7ef2ba145ffd9caa29daa2cf9cc752 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 27 Feb 2022 18:30:43 +0200 Subject: [PATCH] [Build] --- .patch-version | 2 +- ....ac23512cbe1955fbc721.css => 133.0e8e598a95d89fe36bff.css} | 2 +- ...cbe1955fbc721.css.map => 133.0e8e598a95d89fe36bff.css.map} | 2 +- ...33.ac23512cbe1955fbc721.js => 133.0e8e598a95d89fe36bff.js} | 2 +- ...12cbe1955fbc721.js.map => 133.0e8e598a95d89fe36bff.js.map} | 2 +- ....2bd8fc859463a252c8a2.css => 176.c9baace07c5f15a8c611.css} | 2 +- ...59463a252c8a2.css.map => 176.c9baace07c5f15a8c611.css.map} | 2 +- ...76.2bd8fc859463a252c8a2.js => 176.c9baace07c5f15a8c611.js} | 2 +- ...c859463a252c8a2.js.map => 176.c9baace07c5f15a8c611.js.map} | 2 +- ...02.317a243801f66d9ed028.js => 302.cf81ea852f516bfc252f.js} | 2 +- ...43801f66d9ed028.js.map => 302.cf81ea852f516bfc252f.js.map} | 2 +- ....595121c92ffb31ae37da.css => 347.b7e411d2828cadec556d.css} | 2 +- ...92ffb31ae37da.css.map => 347.b7e411d2828cadec556d.css.map} | 2 +- ...47.595121c92ffb31ae37da.js => 347.b7e411d2828cadec556d.js} | 2 +- ...1c92ffb31ae37da.js.map => 347.b7e411d2828cadec556d.js.map} | 2 +- ...54.e30ac9a934f7627782aa.js => 354.472e40d0f6d6067cc288.js} | 2 +- ...9a934f7627782aa.js.map => 354.472e40d0f6d6067cc288.js.map} | 2 +- ...7.b422d6da038c24068089.css => 47.9ea2a6fe11cbf65b8511.css} | 2 +- ...da038c24068089.css.map => 47.9ea2a6fe11cbf65b8511.css.map} | 2 +- ...{47.b422d6da038c24068089.js => 47.9ea2a6fe11cbf65b8511.js} | 4 ++-- ....js.LICENSE.txt => 47.9ea2a6fe11cbf65b8511.js.LICENSE.txt} | 0 ...d6da038c24068089.js.map => 47.9ea2a6fe11cbf65b8511.js.map} | 2 +- ...24.08e4e0ac4b22371b853f.js => 524.aa9aa632b1ede321653d.js} | 2 +- ...0ac4b22371b853f.js.map => 524.aa9aa632b1ede321653d.js.map} | 2 +- ...26.6c9310e081bfd315824b.js => 626.80b1f20c070778cd2c89.js} | 4 ++-- ...0e081bfd315824b.js.map => 626.80b1f20c070778cd2c89.js.map} | 2 +- ....b0ad3fcc6328cf70a271.css => 687.2509fbfe3b3556358b45.css} | 2 +- ...c6328cf70a271.css.map => 687.2509fbfe3b3556358b45.css.map} | 2 +- ...87.b0ad3fcc6328cf70a271.js => 687.2509fbfe3b3556358b45.js} | 2 +- ...fcc6328cf70a271.js.map => 687.2509fbfe3b3556358b45.js.map} | 2 +- ...30.3dad49e3bca3c0b28df2.js => 830.743a3bc23208a5ae5b3b.js} | 2 +- ...9e3bca3c0b28df2.js.map => 830.743a3bc23208a5ae5b3b.js.map} | 2 +- ...41.24c93ec02ada9e8159a1.js => 941.4aa7cedc56885a7f52cb.js} | 2 +- ...ec02ada9e8159a1.js.map => 941.4aa7cedc56885a7f52cb.js.map} | 2 +- dist/index.html | 2 +- dist/main.1a136550b3ba581f7752.js | 2 ++ dist/main.1a136550b3ba581f7752.js.map | 1 + dist/main.1badc5f80faa798031b2.css.map | 1 - ...1badc5f80faa798031b2.css => main.fa9fe60109fab1dcd0cb.css} | 4 ++-- dist/main.fa9fe60109fab1dcd0cb.css.map | 1 + dist/main.fe60a7529fd8efae014a.js | 2 -- dist/main.fe60a7529fd8efae014a.js.map | 1 - dist/report.html | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) rename dist/{133.ac23512cbe1955fbc721.css => 133.0e8e598a95d89fe36bff.css} (99%) rename dist/{133.ac23512cbe1955fbc721.css.map => 133.0e8e598a95d89fe36bff.css.map} (99%) rename dist/{133.ac23512cbe1955fbc721.js => 133.0e8e598a95d89fe36bff.js} (99%) rename dist/{133.ac23512cbe1955fbc721.js.map => 133.0e8e598a95d89fe36bff.js.map} (99%) rename dist/{176.2bd8fc859463a252c8a2.css => 176.c9baace07c5f15a8c611.css} (99%) rename dist/{176.2bd8fc859463a252c8a2.css.map => 176.c9baace07c5f15a8c611.css.map} (99%) rename dist/{176.2bd8fc859463a252c8a2.js => 176.c9baace07c5f15a8c611.js} (99%) rename dist/{176.2bd8fc859463a252c8a2.js.map => 176.c9baace07c5f15a8c611.js.map} (99%) rename dist/{302.317a243801f66d9ed028.js => 302.cf81ea852f516bfc252f.js} (99%) rename dist/{302.317a243801f66d9ed028.js.map => 302.cf81ea852f516bfc252f.js.map} (99%) rename dist/{347.595121c92ffb31ae37da.css => 347.b7e411d2828cadec556d.css} (99%) rename dist/{347.595121c92ffb31ae37da.css.map => 347.b7e411d2828cadec556d.css.map} (99%) rename dist/{347.595121c92ffb31ae37da.js => 347.b7e411d2828cadec556d.js} (99%) rename dist/{347.595121c92ffb31ae37da.js.map => 347.b7e411d2828cadec556d.js.map} (99%) rename dist/{354.e30ac9a934f7627782aa.js => 354.472e40d0f6d6067cc288.js} (98%) rename dist/{354.e30ac9a934f7627782aa.js.map => 354.472e40d0f6d6067cc288.js.map} (99%) rename dist/{47.b422d6da038c24068089.css => 47.9ea2a6fe11cbf65b8511.css} (99%) rename dist/{47.b422d6da038c24068089.css.map => 47.9ea2a6fe11cbf65b8511.css.map} (99%) rename dist/{47.b422d6da038c24068089.js => 47.9ea2a6fe11cbf65b8511.js} (99%) rename dist/{47.b422d6da038c24068089.js.LICENSE.txt => 47.9ea2a6fe11cbf65b8511.js.LICENSE.txt} (100%) rename dist/{47.b422d6da038c24068089.js.map => 47.9ea2a6fe11cbf65b8511.js.map} (99%) rename dist/{524.08e4e0ac4b22371b853f.js => 524.aa9aa632b1ede321653d.js} (99%) rename dist/{524.08e4e0ac4b22371b853f.js.map => 524.aa9aa632b1ede321653d.js.map} (99%) rename dist/{626.6c9310e081bfd315824b.js => 626.80b1f20c070778cd2c89.js} (99%) rename dist/{626.6c9310e081bfd315824b.js.map => 626.80b1f20c070778cd2c89.js.map} (99%) rename dist/{687.b0ad3fcc6328cf70a271.css => 687.2509fbfe3b3556358b45.css} (99%) rename dist/{687.b0ad3fcc6328cf70a271.css.map => 687.2509fbfe3b3556358b45.css.map} (99%) rename dist/{687.b0ad3fcc6328cf70a271.js => 687.2509fbfe3b3556358b45.js} (99%) rename dist/{687.b0ad3fcc6328cf70a271.js.map => 687.2509fbfe3b3556358b45.js.map} (99%) rename dist/{830.3dad49e3bca3c0b28df2.js => 830.743a3bc23208a5ae5b3b.js} (99%) rename dist/{830.3dad49e3bca3c0b28df2.js.map => 830.743a3bc23208a5ae5b3b.js.map} (99%) rename dist/{941.24c93ec02ada9e8159a1.js => 941.4aa7cedc56885a7f52cb.js} (99%) rename dist/{941.24c93ec02ada9e8159a1.js.map => 941.4aa7cedc56885a7f52cb.js.map} (99%) create mode 100644 dist/main.1a136550b3ba581f7752.js create mode 100644 dist/main.1a136550b3ba581f7752.js.map delete mode 100644 dist/main.1badc5f80faa798031b2.css.map rename dist/{main.1badc5f80faa798031b2.css => main.fa9fe60109fab1dcd0cb.css} (99%) create mode 100644 dist/main.fa9fe60109fab1dcd0cb.css.map delete mode 100644 dist/main.fe60a7529fd8efae014a.js delete mode 100644 dist/main.fe60a7529fd8efae014a.js.map diff --git a/.patch-version b/.patch-version index d00491fd..0cfbf088 100644 --- a/.patch-version +++ b/.patch-version @@ -1 +1 @@ -1 +2 diff --git a/dist/133.ac23512cbe1955fbc721.css b/dist/133.0e8e598a95d89fe36bff.css similarity index 99% rename from dist/133.ac23512cbe1955fbc721.css rename to dist/133.0e8e598a95d89fe36bff.css index 89d66291..f74e8534 100644 --- a/dist/133.ac23512cbe1955fbc721.css +++ b/dist/133.0e8e598a95d89fe36bff.css @@ -3,4 +3,4 @@ .CropModal .modal-dialog{width:calc(100% - 2rem);max-width:35rem;height:calc(100% - 1rem);max-height:35rem;position:relative}.CropModal .modal-content,.CropModal #avatar-crop{overflow:hidden}.CropModal .confirm-button{position:absolute;bottom:1rem;right:1rem;box-shadow:0 1px 2px var(--color-default-shadow)}.CropModal #avatar-crop{max-width:25rem;margin:0 auto;position:relative}.CropModal #avatar-crop::before{content:"";display:block;padding-top:100%}.CropModal #avatar-crop .cr-boundary{position:absolute;top:0;left:0;border-radius:var(--border-radius-messages-small)}.CropModal #avatar-crop .cr-viewport{border:none;box-shadow:0 0 2000px 2000px rgba(127,127,127,.5)}.CropModal #avatar-crop .cr-slider::-webkit-slider-runnable-track{background:var(--color-borders)}.CropModal #avatar-crop .cr-slider::-moz-range-track{background:var(--color-borders)}.CropModal #avatar-crop .cr-slider::-ms-track{background:var(--color-borders)}.CropModal #avatar-crop .cr-slider::-webkit-slider-thumb{background:var(--color-primary);cursor:pointer;transform:scale(1);-webkit-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.CropModal #avatar-crop .cr-slider::-webkit-slider-thumb:hover{transform:scale(1.2)}.CropModal #avatar-crop .cr-slider::-moz-range-thumb{background:var(--color-primary);cursor:pointer;transform:scale(1);-moz-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.CropModal #avatar-crop .cr-slider::-moz-range-thumb:hover{transform:scale(1.2)}.CropModal #avatar-crop .cr-slider::-ms-thumb{background:var(--color-primary);cursor:pointer;transform:scale(1);-ms-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.CropModal #avatar-crop .cr-slider::-ms-thumb:hover{transform:scale(1.2)} .AvatarEditable label{margin-left:auto;margin-right:auto;width:7.5rem;height:7.5rem;margin-bottom:2rem;display:flex !important;align-items:center;justify-content:center;background-color:var(--color-primary);border-radius:50%;color:#fff;font-size:3rem;cursor:pointer;position:relative;overflow:hidden;outline:none !important}.AvatarEditable label input{display:none}.AvatarEditable label img{position:absolute;top:0;left:0;width:100%;height:100%}.AvatarEditable label i{transform:scale(1);transition:transform .15s linear;z-index:var(--z-register-add-avatar)}.Transition>div:not(.Transition__slide--active) .AvatarEditable label input,.Transition>div:not(.Transition__slide--active) .AvatarEditable label i,.Transition>div:not(.Transition__slide--active) .AvatarEditable label::after,body.animating-right-column .AvatarEditable label input,body.animating-right-column .AvatarEditable label i,body.animating-right-column .AvatarEditable label::after{display:none !important}.Transition>div:not(.Transition__slide--active) .AvatarEditable label img,body.animating-right-column .AvatarEditable label img{position:static !important}.AvatarEditable label:hover i{transform:scale(1.2)}.AvatarEditable label.filled{background-color:var(--color-background)}.AvatarEditable label.filled::after{content:"";display:block;position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,.4)}.AvatarEditable label.disabled{pointer-events:none}.AvatarEditable label.disabled i{display:none}.AvatarEditable label.disabled::after{display:none} -/*# sourceMappingURL=133.ac23512cbe1955fbc721.css.map*/ \ No newline at end of file +/*# sourceMappingURL=133.0e8e598a95d89fe36bff.css.map*/ \ No newline at end of file diff --git a/dist/133.ac23512cbe1955fbc721.css.map b/dist/133.0e8e598a95d89fe36bff.css.map similarity index 99% rename from dist/133.ac23512cbe1955fbc721.css.map rename to dist/133.0e8e598a95d89fe36bff.css.map index 8a9e1ce8..2bd2cfe5 100644 --- a/dist/133.ac23512cbe1955fbc721.css.map +++ b/dist/133.0e8e598a95d89fe36bff.css.map @@ -1 +1 @@ -{"version":3,"file":"133.ac23512cbe1955fbc721.css","mappings":"AAAA,QACE,kBACA,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDATF,QAUI,YACA,aACA,sBAGF,YACE,YACA,aAGF,yBACE,kBACA,OACA,MACA,WACA,YAEA,gCACE,aAIJ,wBACE,WACA,YACA,0DACA,mB;ACpCJ,OACE,kBACA,uBAOE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDAEE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,oBACE,oBACA,4BACA,qBACA,uBACA,gBAGF,mBACE,kCACA,mBACA,gBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;ACnKF,yBACE,wBACA,gBACA,yBACA,iBACA,kBAGF,kDAEE,gBAGF,2BACE,kBACA,YACA,WACA,iDAGF,wBACE,gBACA,cACA,kBAEA,gCACE,WACA,cACA,iBAGF,qCACE,kBACA,MACA,OACA,kDAGF,qCACE,YACA,kDAOA,kEACE,gCAGF,qDACE,gCAGF,8CACE,gCAGF,yDAtEJ,gCACA,eACA,mBACA,oFAEA,+DACE,qBAoEE,qDA1EJ,gCACA,eACA,mBACA,iFAEA,2DACE,qBAwEE,8CA9EJ,gCACA,eACA,mBACA,gFAEA,oDACE,qB;ACJF,sBACE,iBACA,kBACA,aACA,cACA,mBACA,wBACA,mBACA,uBACA,sCACA,kBACA,WACA,eACA,eACA,kBACA,gBACA,wBAEA,4BACE,aAGF,0BACE,kBACA,MACA,OACA,WACA,YAGF,wBACE,mBACA,iCACA,qCAKA,sYAGE,wBAGF,gIACE,2BAKF,8BACE,qBAIJ,6BACE,yCAEA,oCACE,WACA,cACA,kBACA,OACA,MACA,WACA,YACA,gCAIJ,+BACE,oBAEA,iCACE,aAGF,sCACE,a","sources":["webpack://telegram-t/./src/components/common/PasswordMonkey.scss","webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/ui/CropModal.scss","webpack://telegram-t/./src/components/ui/AvatarEditable.scss"],"sourcesContent":["#monkey {\n position: relative;\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n\n &.big {\n width: 10rem;\n height: 10rem;\n }\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n\n .monkey-preview {\n width: 100%;\n height: 100%;\n background: url('../../assets/monkey.svg') center;\n background-size: 100%;\n }\n}\n",".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete,\n &.error,\n &.confirm,\n &.pin,\n &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, 0.25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform 0.2s ease, opacity 0.2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header,\n %modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend %modal-header;\n padding: 0.5rem 1.25rem 0 0.9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n max-height: 90vh;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .modal-about {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .modal-help {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.3;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n","@mixin thumb-styles() {\n background: var(--color-primary);\n cursor: pointer;\n transform: scale(1);\n transition: transform 0.25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.CropModal {\n .modal-dialog {\n width: calc(100% - 2rem);\n max-width: 35rem;\n height: calc(100% - 1rem);\n max-height: 35rem;\n position: relative;\n }\n\n .modal-content,\n #avatar-crop {\n overflow: hidden;\n }\n\n .confirm-button {\n position: absolute;\n bottom: 1rem;\n right: 1rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n #avatar-crop {\n max-width: 25rem;\n margin: 0 auto;\n position: relative;\n\n &::before {\n content: \"\";\n display: block;\n padding-top: 100%;\n }\n\n .cr-boundary {\n position: absolute;\n top: 0;\n left: 0;\n border-radius: var(--border-radius-messages-small);\n }\n\n .cr-viewport {\n border: none;\n box-shadow: 0 0 2000px 2000px rgba(#7f7f7f, 0.5);\n }\n\n .cr-slider {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n\n &::-webkit-slider-runnable-track {\n background: var(--color-borders);\n }\n\n &::-moz-range-track {\n background: var(--color-borders);\n }\n\n &::-ms-track {\n background: var(--color-borders);\n }\n\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n }\n}\n","@import \"../../styles/mixins\";\n\n.AvatarEditable {\n label {\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 2rem;\n display: flex !important;\n align-items: center;\n justify-content: center;\n background-color: var(--color-primary);\n border-radius: 50%;\n color: white;\n font-size: 3rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n outline: none !important;\n\n input {\n display: none;\n }\n\n img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n i {\n transform: scale(1);\n transition: transform 0.15s linear;\n z-index: var(--z-register-add-avatar);\n }\n\n // @optimization The weirdest workaround for screen animation lag\n @include while-transition() {\n input,\n i,\n &::after {\n display: none !important;\n }\n\n img {\n position: static !important;\n }\n }\n\n &:hover {\n i {\n transform: scale(1.2);\n }\n }\n\n &.filled {\n background-color: var(--color-background);\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(black, 0.4);\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n i {\n display: none;\n }\n\n &::after {\n display: none;\n }\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"133.0e8e598a95d89fe36bff.css","mappings":"AAAA,QACE,kBACA,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDATF,QAUI,YACA,aACA,sBAGF,YACE,YACA,aAGF,yBACE,kBACA,OACA,MACA,WACA,YAEA,gCACE,aAIJ,wBACE,WACA,YACA,0DACA,mB;ACpCJ,OACE,kBACA,uBAOE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDAEE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,oBACE,oBACA,4BACA,qBACA,uBACA,gBAGF,mBACE,kCACA,mBACA,gBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;ACnKF,yBACE,wBACA,gBACA,yBACA,iBACA,kBAGF,kDAEE,gBAGF,2BACE,kBACA,YACA,WACA,iDAGF,wBACE,gBACA,cACA,kBAEA,gCACE,WACA,cACA,iBAGF,qCACE,kBACA,MACA,OACA,kDAGF,qCACE,YACA,kDAOA,kEACE,gCAGF,qDACE,gCAGF,8CACE,gCAGF,yDAtEJ,gCACA,eACA,mBACA,oFAEA,+DACE,qBAoEE,qDA1EJ,gCACA,eACA,mBACA,iFAEA,2DACE,qBAwEE,8CA9EJ,gCACA,eACA,mBACA,gFAEA,oDACE,qB;ACJF,sBACE,iBACA,kBACA,aACA,cACA,mBACA,wBACA,mBACA,uBACA,sCACA,kBACA,WACA,eACA,eACA,kBACA,gBACA,wBAEA,4BACE,aAGF,0BACE,kBACA,MACA,OACA,WACA,YAGF,wBACE,mBACA,iCACA,qCAKA,sYAGE,wBAGF,gIACE,2BAKF,8BACE,qBAIJ,6BACE,yCAEA,oCACE,WACA,cACA,kBACA,OACA,MACA,WACA,YACA,gCAIJ,+BACE,oBAEA,iCACE,aAGF,sCACE,a","sources":["webpack://telegram-t/./src/components/common/PasswordMonkey.scss","webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/ui/CropModal.scss","webpack://telegram-t/./src/components/ui/AvatarEditable.scss"],"sourcesContent":["#monkey {\n position: relative;\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n\n &.big {\n width: 10rem;\n height: 10rem;\n }\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n\n .monkey-preview {\n width: 100%;\n height: 100%;\n background: url('../../assets/monkey.svg') center;\n background-size: 100%;\n }\n}\n",".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete,\n &.error,\n &.confirm,\n &.pin,\n &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, 0.25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform 0.2s ease, opacity 0.2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header,\n %modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend %modal-header;\n padding: 0.5rem 1.25rem 0 0.9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n max-height: 90vh;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .modal-about {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .modal-help {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.3;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n","@mixin thumb-styles() {\n background: var(--color-primary);\n cursor: pointer;\n transform: scale(1);\n transition: transform 0.25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.CropModal {\n .modal-dialog {\n width: calc(100% - 2rem);\n max-width: 35rem;\n height: calc(100% - 1rem);\n max-height: 35rem;\n position: relative;\n }\n\n .modal-content,\n #avatar-crop {\n overflow: hidden;\n }\n\n .confirm-button {\n position: absolute;\n bottom: 1rem;\n right: 1rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n #avatar-crop {\n max-width: 25rem;\n margin: 0 auto;\n position: relative;\n\n &::before {\n content: \"\";\n display: block;\n padding-top: 100%;\n }\n\n .cr-boundary {\n position: absolute;\n top: 0;\n left: 0;\n border-radius: var(--border-radius-messages-small);\n }\n\n .cr-viewport {\n border: none;\n box-shadow: 0 0 2000px 2000px rgba(#7f7f7f, 0.5);\n }\n\n .cr-slider {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n\n &::-webkit-slider-runnable-track {\n background: var(--color-borders);\n }\n\n &::-moz-range-track {\n background: var(--color-borders);\n }\n\n &::-ms-track {\n background: var(--color-borders);\n }\n\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n }\n}\n","@import \"../../styles/mixins\";\n\n.AvatarEditable {\n label {\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 2rem;\n display: flex !important;\n align-items: center;\n justify-content: center;\n background-color: var(--color-primary);\n border-radius: 50%;\n color: white;\n font-size: 3rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n outline: none !important;\n\n input {\n display: none;\n }\n\n img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n i {\n transform: scale(1);\n transition: transform 0.15s linear;\n z-index: var(--z-register-add-avatar);\n }\n\n // @optimization The weirdest workaround for screen animation lag\n @include while-transition() {\n input,\n i,\n &::after {\n display: none !important;\n }\n\n img {\n position: static !important;\n }\n }\n\n &:hover {\n i {\n transform: scale(1.2);\n }\n }\n\n &.filled {\n background-color: var(--color-background);\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(black, 0.4);\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n i {\n display: none;\n }\n\n &::after {\n display: none;\n }\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/133.ac23512cbe1955fbc721.js b/dist/133.0e8e598a95d89fe36bff.js similarity index 99% rename from dist/133.ac23512cbe1955fbc721.js rename to dist/133.0e8e598a95d89fe36bff.js index a33563a9..dd41d09b 100644 --- a/dist/133.ac23512cbe1955fbc721.js +++ b/dist/133.0e8e598a95d89fe36bff.js @@ -1,2 +1,2 @@ "use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[133],{1133:(e,t,n)=>{n.r(t),n.d(t,{AuthCode:()=>Z,AuthPassword:()=>P,AuthRegister:()=>w});var a=n(4050),o=n(5116),r=n(7361),s=n(782),l=n(2340),i=n(6590),c=n(9107),d=n(7687),u=n(4288),m=n(3716),p=n(7324),g=n(7799);const h=r.wB?m.qp:m.z7,f=(0,a.X$)((e=>{let{code:t,codeLength:n,trackingDirection:o,isTracking:r,isBig:s}=e;const[l,i]=(0,a.eJ)(),[c,d]=(0,a.eJ)(),[u,f]=(0,a.eJ)(!1),Z=165/n;(0,a.d4)((()=>{l||(0,p.Z)("MonkeyIdle").then(i)}),[l]),(0,a.d4)((()=>{c||(0,p.Z)("MonkeyTracking").then(d)}),[c]);const v=(0,a.I4)((()=>f(!0)),[]);return a.ZP.createElement("div",{id:"monkey",className:s?"big":""},!u&&a.ZP.createElement("div",{className:"monkey-preview"}),l&&a.ZP.createElement(g.Z,{id:"idleMonkey",size:s?m.K2:h,className:r?"hidden":void 0,animationData:l,play:!r,onLoad:v}),c&&a.ZP.createElement(g.Z,{id:"trackingMonkey",size:s?m.K2:h,className:r?"shown":"hidden",animationData:c,playSegment:r?function(){const e=t&&t.length>1||o<0?15+Z*(t.length-1):0,a=t.length===n?180:15+Z*t.length;return o<1?[a,e]:[e,a]}():void 0,speed:2,noLoop:!0}))})),Z=(0,a.X$)((0,o.c$)((e=>(0,s.ei)(e,["authPhoneNumber","authIsCodeViaApp","authIsLoading","authError"])))((e=>{let{authPhoneNumber:t,authIsCodeViaApp:n,authIsLoading:s,authError:m}=e;const{setAuthCode:p,returnToAuthPhoneNumber:g,clearAuthError:h}=(0,o.uC)(),Z=(0,c.Z)(),v=(0,a.sO)(null),[b,P]=(0,a.eJ)(""),[E,y]=(0,a.eJ)(!1),[w,k]=(0,a.eJ)(1);(0,a.d4)((()=>{r.$b||v.current.focus()}),[]),(0,i.ZP)(!0,g);const N=(0,a.I4)((e=>{m&&h();const{currentTarget:t}=e;t.value=t.value.replace(/[^\d]+/,"").substr(0,5),t.value!==b&&(P(t.value),E?t.value.length||y(!1):y(!0),b&&b.length>t.value.length?k(-1):k(1),5===t.value.length&&p({code:t.value}))}),[m,h,b,E,p]);return a.ZP.createElement("div",{id:"auth-code-form",className:"custom-scroll"},a.ZP.createElement("div",{className:"auth-form"},a.ZP.createElement(f,{code:b,codeLength:5,isTracking:E,trackingDirection:w}),a.ZP.createElement("h2",null,t,a.ZP.createElement("div",{className:"auth-number-edit",onClick:g,role:"button",tabIndex:0,title:Z("WrongNumber")},a.ZP.createElement("i",{className:"icon-edit"}))),a.ZP.createElement("p",{className:"note"},(0,l.Z)(Z(n?"SentAppCode":"Login.JustSentSms"),["simple_markdown"])),a.ZP.createElement(d.Z,{ref:v,id:"sign-in-code",label:Z("Code"),onInput:N,value:b,error:m&&Z(m),autoComplete:"one-time-code",inputMode:"numeric"}),s&&a.ZP.createElement(u.Z,null)))})));var v=n(3490),b=n(9364);const P=(0,a.X$)((0,o.c$)((e=>(0,s.ei)(e,["authIsLoading","authError","authHint"])))((e=>{let{authIsLoading:t,authError:n,authHint:r}=e;const{setAuthPassword:s,clearAuthError:l}=(0,o.uC)(),i=(0,c.Z)(),[d,u]=(0,a.eJ)(!1),m=(0,a.I4)((e=>{u(e)}),[]),p=(0,a.I4)((e=>{s({password:e})}),[s]);return a.ZP.createElement("div",{id:"auth-password-form",className:"custom-scroll"},a.ZP.createElement("div",{className:"auth-form"},a.ZP.createElement(v.Z,{isPasswordVisible:d}),a.ZP.createElement("h2",null,i("Login.Header.Password")),a.ZP.createElement("p",{className:"note"},i("Login.EnterPasswordDescription")),a.ZP.createElement(b.Z,{clearError:l,error:n&&i(n),hint:r,isLoading:t,isPasswordVisible:d,onChangePasswordVisibility:m,onSubmit:p})))})));var E=n(231),y=n(710);const w=(0,a.X$)((0,o.c$)((e=>(0,s.ei)(e,["authIsLoading","authError"])))((e=>{let{authIsLoading:t,authError:n}=e;const{signUp:r,clearAuthError:s,uploadProfilePhoto:l}=(0,o.uC)(),i=(0,c.Z)(),[u,m]=(0,a.eJ)(!1),[p,g]=(0,a.eJ)(),[h,f]=(0,a.eJ)(""),[Z,v]=(0,a.eJ)("");return a.ZP.createElement("div",{id:"auth-registration-form",className:"custom-scroll"},a.ZP.createElement("div",{className:"auth-form"},a.ZP.createElement("form",{action:"",method:"post",onSubmit:function(e){e.preventDefault(),r({firstName:h,lastName:Z}),p&&l({file:p})}},a.ZP.createElement(y.Z,{onChange:g}),a.ZP.createElement("h2",null,i("YourName")),a.ZP.createElement("p",{className:"note"},i("Login.Register.Desc")),a.ZP.createElement(d.Z,{id:"registration-first-name",label:i("Login.Register.FirstName.Placeholder"),onChange:function(e){n&&s();const{target:t}=e;f(t.value),m(t.value.length>0)},value:h,error:n&&i(n),autoComplete:"given-name"}),a.ZP.createElement(d.Z,{id:"registration-last-name",label:i("Login.Register.LastName.Placeholder"),onChange:function(e){const{target:t}=e;v(t.value)},value:Z,autoComplete:"family-name"}),u&&a.ZP.createElement(E.Z,{type:"submit",ripple:!0,isLoading:t},i("Next")))))})))},7799:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),o=n(9118),r=n(6752),s=n(8674),l=n(5332);let i,c;async function d(){return i||(i=n.e(941).then(n.bind(n,7941)),c=(await i).default),i}setTimeout(d,3e3);const u=(0,a.X$)((e=>{let{className:t,id:n,animationData:i,play:u,playSegment:m,speed:p,noLoop:g,size:h,quality:f,isLowPriority:Z,color:v,forceOnHeavyAnimation:b,onLoad:P,onEnded:E}=e;const[y,w]=(0,a.eJ)(),k=(0,a.sO)(null),N=(0,a.sO)(!1),C=(0,a.sO)(!1),L=(0,a.sO)(!0),x=(0,a.sO)();x.current=u;const I=(0,a.sO)();I.current=m,(0,a.d4)((()=>{if(y||!i)return;const e=()=>{if(!k.current)return;const e=new c(n,k.current,i,{noLoop:g,size:h,quality:f,isLowPriority:Z},P,v,E);p&&e.setSpeed(p),w(e)};c?e():d().then((()=>{(0,o.T2)((()=>{k.current&&e()}))}))}),[v,y,i,n,Z,g,P,f,h,p,E]),(0,a.d4)((()=>{y&&y.setColor(v)}),[v,y]),(0,a.d4)((()=>()=>{y&&y.destroy()}),[y]);const A=(0,a.I4)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y&&(x.current||I.current)&&(I.current?y.playSegment(I.current):e?y.goToAndPlay(0):y.play())}),[y]),J=(0,a.I4)((()=>{y&&y.pause()}),[y]),M=(0,a.I4)((()=>{C.current=!0,y&&(N.current||(N.current=y.isPlaying()),J())}),[y,J]),S=(0,a.I4)((()=>{N.current&&A(),N.current=!1,C.current=!1}),[A]),T=(0,a.I4)((()=>{(0,o.T2)(S)}),[S]);(0,a.d4)((()=>{y&&(u||m?C.current?N.current=!0:A(g):C.current?N.current=!1:J())}),[y,u,m,g,A,J]),(0,a.d4)((()=>{y&&(L.current?L.current=!1:i&&(y.changeData(i),A()))}),[A,y,i]),(0,s.ZP)(M,S,b),(0,l.Z)(M,T);const O=(0,r.Z)("AnimatedSticker",t),D=h?`width: ${h}px; height: ${h}px;`:void 0;return a.ZP.createElement("div",{ref:k,className:O,style:D})}))},9364:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),o=n(3716),r=n(7361),s=n(6752),l=n(9107),i=n(231);const c=r.wB?550:400,d=(0,a.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:d,hint:u,placeholder:m="Password",submitLabel:p="Next",clearError:g,onChangePasswordVisibility:h,onInputChange:f,onSubmit:Z}=e;const v=(0,a.sO)(null),b=(0,l.Z)(),[P,E]=(0,a.eJ)(""),[y,w]=(0,a.eJ)(!1);return(0,a.d4)((()=>{r.$b||setTimeout((()=>{v.current.focus()}),c)}),[]),(0,a.d4)((()=>{d&&requestAnimationFrame((()=>{v.current.focus(),v.current.select()}))}),[d]),a.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),t||y&&Z(P)},autoComplete:"off"},a.ZP.createElement("div",{className:(0,s.Z)("input-group password-input",P&&"touched",d&&"error"),dir:b.isRtl?"rtl":void 0},a.ZP.createElement("input",{ref:v,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:P||"",autoComplete:"current-password",onChange:function(e){d&&g();const{target:t}=e;E(t.value),w(t.value.length>=o.lo),f&&f(t.value)},dir:"auto"}),a.ZP.createElement("label",null,d||u||m),a.ZP.createElement("div",{className:"toggle-password",onClick:function(){h(!n)},role:"button",tabIndex:0,title:"Toggle password visibility"},a.ZP.createElement("i",{className:n?"icon-eye":"icon-eye-closed"}))),y&&a.ZP.createElement(i.Z,{type:"submit",ripple:!0,isLoading:t},p))}))},3490:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),o=n(3716),r=n(7361),s=n(7324),l=n(7799);const i=[0,50],c=[0,20],d=[20,0],u=r.wB?o.qp:o.z7,m=(0,a.X$)((e=>{let{isPasswordVisible:t,isBig:n}=e;const[r,m]=(0,a.eJ)(),[p,g]=(0,a.eJ)(),[h,f]=(0,a.eJ)(!1),[Z,v]=(0,a.eJ)(!1);(0,a.d4)((()=>{r?setTimeout((()=>v(!0)),2e3):(0,s.Z)("MonkeyClose").then(m)}),[r]),(0,a.d4)((()=>{p||(0,s.Z)("MonkeyPeek").then(g)}),[p]);const b=(0,a.I4)((()=>f(!0)),[]);return a.ZP.createElement("div",{id:"monkey",className:n?"big":""},!h&&a.ZP.createElement("div",{className:"monkey-preview"}),r&&a.ZP.createElement(l.Z,{id:"closeMonkey",size:n?o.K2:u,className:Z?"hidden":"shown",animationData:r,playSegment:i,noLoop:!0,onLoad:b}),p&&a.ZP.createElement(l.Z,{id:"peekMonkey",size:n?o.K2:u,className:Z?"shown":"hidden",animationData:p,playSegment:t?c:d,noLoop:!0}))}))},7324:(e,t,n)=>{n.d(t,{x:()=>r,Z:()=>s});var a=n(6137),o=n(647);const r={MonkeyIdle:n(8760),MonkeyTracking:n(6917),MonkeyClose:n(6257),MonkeyPeek:n(7785),FoldersAll:n(9356),FoldersNew:n(5485),DiscussionGroups:n(6978),CameraFlip:n(5665),HandFilled:n(2456),HandOutline:n(5667),Speaker:n(8763),VoiceAllowTalk:n(401),VoiceMini:n(5106),VoiceMuted:n(487),VoiceOutlined:n(5740),Peach:n(3677),Eggplant:n(5435),Cumshot:n(1879),JoinRequest:n(5095),Invite:n(7879)};function s(e){const t=r[e].replace(window.location.origin,"");return o.he(`file${t}`,a.IU.Lottie)}},710:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),o=n(6752),r=n(3716),s=n(1394),l=n(9107),i=n(231),c=n(3103),d=n(4288);const u={type:"blob",quality:1,format:"jpeg",circle:!1,size:{width:1024,height:1024}};let m,p,g;const h=(0,a.X$)((e=>{let{file:t,onChange:o,onClose:h}=e;const[f,Z]=(0,a.eJ)(!1);(0,a.d4)((()=>{t&&(f?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:n,offsetHeight:a}=t;g=new m(t,{enableZoom:!0,boundary:{width:n,height:a},viewport:{width:n-16,height:a-16,type:"circle"}});const o=await(0,s.YJ)(e);await g.bind({url:o})}catch(e){r.eM&&console.error(e)}}(t):async function(){return p||(p=Promise.all([n.e(99),n.e(472)]).then(n.bind(n,3472)),m=(await p).default),p}().then((()=>Z(!0))))}),[t,f]);const v=(0,l.Z)();return a.ZP.createElement(c.Z,{isOpen:Boolean(t),onClose:h,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},f?a.ZP.createElement("div",{id:"avatar-crop"}):a.ZP.createElement(d.Z,null),a.ZP.createElement(i.Z,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!g)return;const e=await g.result(u),t="string"==typeof e?e:(0,s.hl)(e,"avatar.jpg");o(t)},ariaLabel:v("CropImage")},a.ZP.createElement("i",{className:"icon-check"})))})),f=(0,a.X$)((e=>{let{title:t="Change your profile picture",disabled:n,currentAvatarBlobUrl:r,onChange:s}=e;const[l,i]=(0,a.eJ)(),[c,d]=(0,a.eJ)(r);(0,a.d4)((()=>{d(r)}),[r]);const u=(0,o.Z)(c&&"filled",n&&"disabled");return a.ZP.createElement("div",{className:"AvatarEditable"},a.ZP.createElement("label",{className:u,role:"button",tabIndex:0,title:t},a.ZP.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(i(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),a.ZP.createElement("i",{className:"icon-camera-add"}),c&&a.ZP.createElement("img",{src:c,alt:"Avatar"})),a.ZP.createElement(h,{file:l,onClose:function(){i(void 0)},onChange:function(e){i(void 0),s(e),c&&URL.revokeObjectURL(c),d(URL.createObjectURL(e))}}))}))},3103:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(4050),o=n(517),r=n(6752),s=n(8674),l=n(1212),i=n(274),c=n(9107),d=n(6590),u=n(231),m=n(2898);const p=e=>{let{dialogRef:t,title:n,className:p,isOpen:g,header:h,hasCloseButton:f,noBackdrop:Z,children:v,onClose:b,onCloseAnimationEnd:P,onEnter:E,shouldSkipHistoryAnimations:y}=e;const{shouldRender:w,transitionClassNames:k}=(0,l.Z)(g,P,y,void 0,y),N=(0,a.sO)(null);(0,a.d4)((()=>g?(0,o.Z)({onEsc:b,onEnter:E}):void 0),[g,b,E]),(0,a.d4)((()=>g&&N.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const a=n.findIndex((e=>e.isSameNode(document.activeElement)));let o=0;a>=0&&(o=t.shiftKey?a>0?a-1:n.length-1:a{document.removeEventListener("keydown",t,!1)}}(N.current):void 0),[g]);const{forceClose:C}=(0,d.ZP)(g,b);(0,a.d4)((()=>()=>{g&&C()}),[]),(0,i.Z)((e=>{let[t]=e;return document.body.classList.toggle("has-open-dialog",g),(g||!g&&void 0!==t)&&(0,s.YW)(200),()=>{document.body.classList.remove("has-open-dialog")}}),[g]);const L=(0,c.Z)();if(!w)return;const x=(0,r.Z)("Modal",p,k,Z&&"transparent-backdrop");return a.ZP.createElement(m.Z,null,a.ZP.createElement("div",{ref:N,className:x,tabIndex:-1,role:"dialog"},a.ZP.createElement("div",{className:"modal-container"},a.ZP.createElement("div",{className:"modal-backdrop",onClick:b}),a.ZP.createElement("div",{className:"modal-dialog",ref:t},h||(n?a.ZP.createElement("div",{className:"modal-header"},f&&a.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:L("Close"),onClick:b},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("div",{className:"modal-title"},n)):void 0),a.ZP.createElement("div",{className:"modal-content custom-scroll"},v)))))}},2898:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050),o=n(2916);const r=e=>{let{containerId:t,className:n,children:r}=e;const s=(0,a.sO)();return s.current||(s.current=document.createElement("div")),(0,a.bt)((()=>{const e=document.querySelector(t||"#portals");if(!e)return;const a=s.current;return n&&a.classList.add(n),e.appendChild(a),()=>{o.Z.render(void 0,a),e.removeChild(a)}}),[n,t]),o.Z.render(r,s.current)}},5332:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050);function o(e,t){(0,a.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},1879:(e,t,n)=>{e.exports=n.p+"Cumshot.7a17984a6b80787dab34..tgs"},5435:(e,t,n)=>{e.exports=n.p+"Eggplant.7693d877087b802d04be..tgs"},3677:(e,t,n)=>{e.exports=n.p+"Peach.a289b2c54c563f11208f..tgs"},5665:(e,t,n)=>{e.exports=n.p+"CameraFlip.1a9fe44cf01fcb22347d..tgs"},2456:(e,t,n)=>{e.exports=n.p+"HandFilled.f87939d160f1dc288586..tgs"},5667:(e,t,n)=>{e.exports=n.p+"HandOutline.f9831751ba60df30c484..tgs"},8763:(e,t,n)=>{e.exports=n.p+"Speaker.04bb3743412b41ff83c5..tgs"},401:(e,t,n)=>{e.exports=n.p+"VoiceAllowTalk.a9cc7c39ec438973ddc9..tgs"},5106:(e,t,n)=>{e.exports=n.p+"VoiceMini.bf00ffdf69625c579569..tgs"},487:(e,t,n)=>{e.exports=n.p+"VoiceMuted.a4b4ec6bfd7c6c5fb275..tgs"},5740:(e,t,n)=>{e.exports=n.p+"VoiceOutlined.91b394ab3562cdfad6bc..tgs"},7879:(e,t,n)=>{e.exports=n.p+"Invite.4502ec3aa4249d6e6723..tgs"},5095:(e,t,n)=>{e.exports=n.p+"Requests.af9f19772695a8898810..tgs"},6257:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3e..tgs"},8760:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab..tgs"},7785:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e..tgs"},6917:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12..tgs"},6978:(e,t,n)=>{e.exports=n.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a..tgs"},9356:(e,t,n)=>{e.exports=n.p+"FoldersAll.3f9f9e243d19f0fbf9aa..tgs"},5485:(e,t,n)=>{e.exports=n.p+"FoldersNew.9a40d71c0c8be70f5bd1..tgs"}}]); -//# sourceMappingURL=133.ac23512cbe1955fbc721.js.map \ No newline at end of file +//# sourceMappingURL=133.0e8e598a95d89fe36bff.js.map \ No newline at end of file diff --git a/dist/133.ac23512cbe1955fbc721.js.map b/dist/133.0e8e598a95d89fe36bff.js.map similarity index 99% rename from dist/133.ac23512cbe1955fbc721.js.map rename to dist/133.0e8e598a95d89fe36bff.js.map index 2d5084bd..89d841a9 100644 --- a/dist/133.ac23512cbe1955fbc721.js.map +++ b/dist/133.0e8e598a95d89fe36bff.js.map @@ -1 +1 @@ -{"version":3,"file":"133.ac23512cbe1955fbc721.js","mappings":"uSAoBA,MAEMA,EAAeC,EAAAA,GAA0BC,EAAAA,GAA2BC,EAAAA,GA+E1E,GAAeC,EAAAA,EAAAA,KA7EsB,IAM/B,IANgC,KACpCC,EADoC,WAEpCC,EAFoC,kBAGpCC,EAHoC,WAIpCC,EAJoC,MAKpCC,GACI,EACJ,MAAOC,EAAgBC,IAAqBC,EAAAA,EAAAA,OACrCC,EAAoBC,IAAyBF,EAAAA,EAAAA,OAC7CG,EAAqBC,IAA0BJ,EAAAA,EAAAA,KAAS,GACzDK,EA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C,GAEf,KACLkC,EAAAA,EAAAA,YAAgBpR,EAAWkP,GAC3B7I,EAAUgL,YAAYnC,MAEvB,CAACtP,EAAWiR,IAERO,EAAAA,EAAAA,OAAgB5C,EAA4BsC,EAAWhP,W,8CChCjD,SAAS8F,EACtB0J,EACAC,IAEAjS,EAAAA,EAAAA,KAAU,KACJgS,IAAWxF,SAAS0F,YACtBF,IAGEA,GACF1G,OAAOqF,iBAAiB,OAAQqB,GAG9BC,GACF3G,OAAOqF,iBAAiB,QAASsB,GAG5B,KACDA,GACF3G,OAAOsF,oBAAoB,QAASqB,GAGlCD,GACF1G,OAAOsF,oBAAoB,OAAQoB,MAGtC,CAACA,EAAQC,M","sources":["webpack://telegram-t/./src/components/common/TrackingMonkey.tsx","webpack://telegram-t/./src/components/auth/AuthCode.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.tsx","webpack://telegram-t/./src/components/common/AnimatedSticker.tsx","webpack://telegram-t/./src/components/common/PasswordForm.tsx","webpack://telegram-t/./src/components/common/PasswordMonkey.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/components/ui/CropModal.tsx","webpack://telegram-t/./src/components/ui/AvatarEditable.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Portal.ts","webpack://telegram-t/./src/hooks/useBackgroundMode.ts"],"sourcesContent":["import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n code: string;\n codeLength: number;\n trackingDirection: number;\n isTracking: boolean;\n isBig?: boolean;\n};\n\nconst TRACKING_START_FRAME = 15;\nconst TRACKING_END_FRAME = 180;\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst TrackingMonkey: FC = ({\n code,\n codeLength,\n trackingDirection,\n isTracking,\n isBig,\n}) => {\n const [idleMonkeyData, setIdleMonkeyData] = useState();\n const [trackingMonkeyData, setTrackingMonkeyData] = useState();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const TRACKING_FRAMES_PER_SYMBOL = (TRACKING_END_FRAME - TRACKING_START_FRAME) / codeLength;\n\n useEffect(() => {\n if (!idleMonkeyData) {\n getAnimationData('MonkeyIdle').then(setIdleMonkeyData);\n }\n }, [idleMonkeyData]);\n\n useEffect(() => {\n if (!trackingMonkeyData) {\n getAnimationData('MonkeyTracking').then(setTrackingMonkeyData);\n }\n }, [trackingMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n function getTrackingFrames(): [number, number] {\n const startFrame = (code && code.length > 1) || trackingDirection < 0\n ? TRACKING_START_FRAME + TRACKING_FRAMES_PER_SYMBOL * (code.length - 1)\n : 0;\n const endFrame = code.length === codeLength\n ? TRACKING_END_FRAME\n : TRACKING_START_FRAME + TRACKING_FRAMES_PER_SYMBOL * code.length;\n\n if (trackingDirection < 1) {\n return [\n endFrame,\n startFrame,\n ];\n }\n\n return [\n startFrame,\n endFrame,\n ];\n }\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {idleMonkeyData && (\n \n )}\n {trackingMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(TrackingMonkey);\n","import { FormEvent } from 'react';\nimport React, {\n FC, useState, useEffect, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\nimport { GlobalState } from '../../global/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport TrackingMonkey from '../common/TrackingMonkey';\n\ntype StateProps = Pick;\n\nconst CODE_LENGTH = 5;\n\nconst AuthCode: FC = ({\n authPhoneNumber,\n authIsCodeViaApp,\n authIsLoading,\n authError,\n}) => {\n const {\n setAuthCode,\n returnToAuthPhoneNumber,\n clearAuthError,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [code, setCode] = useState('');\n const [isTracking, setIsTracking] = useState(false);\n const [trackingDirection, setTrackingDirection] = useState(1);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, []);\n\n useHistoryBack(true, returnToAuthPhoneNumber);\n\n const onCodeChange = useCallback((e: FormEvent) => {\n if (authError) {\n clearAuthError();\n }\n\n const { currentTarget: target } = e;\n target.value = target.value.replace(/[^\\d]+/, '').substr(0, CODE_LENGTH);\n\n if (target.value === code) {\n return;\n }\n\n setCode(target.value);\n\n if (!isTracking) {\n setIsTracking(true);\n } else if (!target.value.length) {\n setIsTracking(false);\n }\n\n if (code && code.length > target.value.length) {\n setTrackingDirection(-1);\n } else {\n setTrackingDirection(1);\n }\n\n if (target.value.length === CODE_LENGTH) {\n setAuthCode({ code: target.value });\n }\n }, [authError, clearAuthError, code, isTracking, setAuthCode]);\n\n return (\n
\n
\n \n

\n {authPhoneNumber}\n \n \n

\n \n

\n {renderText(lang(authIsCodeViaApp ? 'SentAppCode' : 'Login.JustSentSms'), ['simple_markdown'])}\n

\n \n {authIsLoading && }\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authPhoneNumber', 'authIsCodeViaApp', 'authIsLoading', 'authError']),\n)(AuthCode));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport MonkeyPassword from '../common/PasswordMonkey';\nimport PasswordForm from '../common/PasswordForm';\n\ntype StateProps = Pick;\n\nconst AuthPassword: FC = ({\n authIsLoading, authError, authHint,\n}) => {\n const { setAuthPassword, clearAuthError } = getDispatch();\n\n const lang = useLang();\n const [showPassword, setShowPassword] = useState(false);\n\n const handleChangePasswordVisibility = useCallback((isVisible) => {\n setShowPassword(isVisible);\n }, []);\n\n const handleSubmit = useCallback((password: string) => {\n setAuthPassword({ password });\n }, [setAuthPassword]);\n\n return (\n
\n
\n \n

{lang('Login.Header.Password')}

\n

{lang('Login.EnterPasswordDescription')}

\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authIsLoading', 'authError', 'authHint']),\n)(AuthPassword));\n","import { ChangeEvent } from 'react';\nimport React, { FC, useState, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport InputText from '../ui/InputText';\nimport AvatarEditable from '../ui/AvatarEditable';\n\ntype StateProps = Pick;\n\nconst AuthRegister: FC = ({\n authIsLoading, authError,\n}) => {\n const { signUp, clearAuthError, uploadProfilePhoto } = getDispatch();\n\n const lang = useLang();\n const [isButtonShown, setIsButtonShown] = useState(false);\n const [croppedFile, setCroppedFile] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n\n function handleFirstNameChange(event: ChangeEvent) {\n if (authError) {\n clearAuthError();\n }\n\n const { target } = event;\n\n setFirstName(target.value);\n setIsButtonShown(target.value.length > 0);\n }\n\n function handleLastNameChange(event: ChangeEvent) {\n const { target } = event;\n\n setLastName(target.value);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n signUp({ firstName, lastName });\n\n if (croppedFile) {\n uploadProfilePhoto({ file: croppedFile });\n }\n }\n\n return (\n
\n
\n
\n \n

{lang('YourName')}

\n

{lang('Login.Register.Desc')}

\n \n \n {isButtonShown && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authIsLoading', 'authError']),\n)(AuthRegister));\n","import React, {\n FC, useEffect, useRef, memo, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\n\ntype OwnProps = {\n className?: string;\n id: string;\n animationData?: string;\n play?: boolean | string;\n playSegment?: [number, number];\n speed?: number;\n noLoop?: boolean;\n size: number;\n quality?: number;\n isLowPriority?: boolean;\n onLoad?: NoneToVoidFunction;\n forceOnHeavyAnimation?: boolean;\n color?: [number, number, number];\n onEnded?: NoneToVoidFunction;\n};\n\ntype RLottieClass = typeof import('../../lib/rlottie/RLottie').default;\ntype RLottieInstance = import('../../lib/rlottie/RLottie').default;\nlet lottiePromise: Promise;\nlet RLottie: RLottieClass;\n\n// Time for the main interface to completely load\nconst LOTTIE_LOAD_DELAY = 3000;\n\nasync function ensureLottie() {\n if (!lottiePromise) {\n lottiePromise = import('../../lib/rlottie/RLottie') as unknown as Promise;\n RLottie = (await lottiePromise as any).default;\n }\n\n return lottiePromise;\n}\n\nsetTimeout(ensureLottie, LOTTIE_LOAD_DELAY);\n\nconst AnimatedSticker: FC = ({\n className,\n id,\n animationData,\n play,\n playSegment,\n speed,\n noLoop,\n size,\n quality,\n isLowPriority,\n color,\n forceOnHeavyAnimation,\n onLoad,\n onEnded,\n}) => {\n const [animation, setAnimation] = useState();\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n const isFirstRender = useRef(true);\n\n const playRef = useRef();\n playRef.current = play;\n const playSegmentRef = useRef<[number, number]>();\n playSegmentRef.current = playSegment;\n\n useEffect(() => {\n if (animation || !animationData) {\n return;\n }\n\n const exec = () => {\n if (!container.current) {\n return;\n }\n\n const newAnimation = new RLottie(\n id,\n container.current,\n animationData,\n {\n noLoop,\n size,\n quality,\n isLowPriority,\n },\n onLoad,\n color,\n onEnded,\n );\n\n if (speed) {\n newAnimation.setSpeed(speed);\n }\n\n setAnimation(newAnimation);\n };\n\n if (RLottie) {\n exec();\n } else {\n ensureLottie().then(() => {\n fastRaf(() => {\n if (container.current) {\n exec();\n }\n });\n });\n }\n }, [color, animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed, onEnded]);\n\n useEffect(() => {\n if (!animation) return;\n\n animation.setColor(color);\n }, [color, animation]);\n\n useEffect(() => {\n return () => {\n if (animation) {\n animation.destroy();\n }\n };\n }, [animation]);\n\n const playAnimation = useCallback((shouldRestart = false) => {\n if (animation && (playRef.current || playSegmentRef.current)) {\n if (playSegmentRef.current) {\n animation.playSegment(playSegmentRef.current);\n } else if (shouldRestart) {\n animation.goToAndPlay(0);\n } else {\n animation.play();\n }\n }\n }, [animation]);\n\n const pauseAnimation = useCallback(() => {\n if (!animation) {\n return;\n }\n\n animation.pause();\n }, [animation]);\n\n const freezeAnimation = useCallback(() => {\n isFrozen.current = true;\n\n if (!animation) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = animation.isPlaying();\n }\n\n pauseAnimation();\n }, [animation, pauseAnimation]);\n\n const unfreezeAnimation = useCallback(() => {\n if (wasPlaying.current) {\n playAnimation();\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [playAnimation]);\n\n const unfreezeAnimationOnRaf = useCallback(() => {\n fastRaf(unfreezeAnimation);\n }, [unfreezeAnimation]);\n\n useEffect(() => {\n if (!animation) {\n return;\n }\n\n if (play || playSegment) {\n if (isFrozen.current) {\n wasPlaying.current = true;\n } else {\n playAnimation(noLoop);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isFrozen.current) {\n wasPlaying.current = false;\n } else {\n pauseAnimation();\n }\n }\n }, [animation, play, playSegment, noLoop, playAnimation, pauseAnimation]);\n\n useEffect(() => {\n if (animation) {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else if (animationData) {\n animation.changeData(animationData);\n playAnimation();\n }\n }\n }, [playAnimation, animation, animationData]);\n\n useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation, forceOnHeavyAnimation);\n // Pausing frame may not happen in background\n // so we need to make sure it happens right after focusing,\n // then we can play again.\n useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf);\n\n const fullClassName = buildClassName('AnimatedSticker', className);\n\n const style = size ? `width: ${size}px; height: ${size}px;` : undefined;\n\n return (\n \n );\n};\n\nexport default memo(AnimatedSticker);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n
\n \n \n \n \n \n \n \n {canSubmit && (\n \n )}\n \n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState();\n const [peekMonkeyData, setPeekMonkeyData] = useState();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {closeMonkeyData && (\n \n )}\n {peekMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(PasswordMonkey);\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nimport MonkeyIdle from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyIdle.tgs';\nimport MonkeyTracking from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyTracking.tgs';\nimport MonkeyClose from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyClose.tgs';\nimport MonkeyPeek from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyPeek.tgs';\n\nimport FoldersAll from '../../../assets/tgs/settings/FoldersAll.tgs';\nimport FoldersNew from '../../../assets/tgs/settings/FoldersNew.tgs';\nimport DiscussionGroups from '../../../assets/tgs/settings/DiscussionGroupsDucks.tgs';\n\nimport CameraFlip from '../../../assets/tgs/calls/CameraFlip.tgs';\nimport HandFilled from '../../../assets/tgs/calls/HandFilled.tgs';\nimport HandOutline from '../../../assets/tgs/calls/HandOutline.tgs';\nimport Speaker from '../../../assets/tgs/calls/Speaker.tgs';\nimport VoiceAllowTalk from '../../../assets/tgs/calls/VoiceAllowTalk.tgs';\nimport VoiceMini from '../../../assets/tgs/calls/VoiceMini.tgs';\nimport VoiceMuted from '../../../assets/tgs/calls/VoiceMuted.tgs';\nimport VoiceOutlined from '../../../assets/tgs/calls/VoiceOutlined.tgs';\n\nimport Peach from '../../../assets/tgs/animatedEmojis/Peach.tgs';\nimport Eggplant from '../../../assets/tgs/animatedEmojis/Eggplant.tgs';\nimport Cumshot from '../../../assets/tgs/animatedEmojis/Cumshot.tgs';\n\nimport JoinRequest from '../../../assets/tgs/invites/Requests.tgs';\nimport Invite from '../../../assets/tgs/invites/Invite.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n CameraFlip,\n HandFilled,\n HandOutline,\n Speaker,\n VoiceAllowTalk,\n VoiceMini,\n VoiceMuted,\n VoiceOutlined,\n Peach,\n Eggplant,\n Cumshot,\n JoinRequest,\n Invite,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","import React, {\n FC, useEffect, useState, memo,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n size: { width: 1024, height: 1024 },\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n async function handleCropClick() {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }\n\n return (\n \n {isCroppieReady ? (\n
\n ) : (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n function handleAvatarCrop(croppedImg: File) {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }\n\n function handleModalClose() {\n setSelectedFile(undefined);\n }\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n
\n \n \n \n {croppedBlobUrl && \"Avatar\"}\n \n \n
\n );\n};\n\nexport default memo(AvatarEditable);\n","import { RefObject } from 'react';\nimport React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: React.ReactNode;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n dialogRef?: RefObject;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\n dialogRef,\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n
\n {hasCloseButton && (\n \n \n \n )}\n
{title}
\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n \n \n
\n
\n
\n {renderHeader()}\n
\n {children}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import { FC, useRef, useLayoutEffect, VirtualElement } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: React.ReactNode;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children as VirtualElement, elementRef.current);\n};\n\nexport default Portal;\n","import { useEffect } from '../lib/teact/teact';\n\nexport default function useBackgroundMode(\n onBlur?: AnyToVoidFunction,\n onFocus?: AnyToVoidFunction,\n) {\n useEffect(() => {\n if (onBlur && !document.hasFocus()) {\n onBlur();\n }\n\n if (onBlur) {\n window.addEventListener('blur', onBlur);\n }\n\n if (onFocus) {\n window.addEventListener('focus', onFocus);\n }\n\n return () => {\n if (onFocus) {\n window.removeEventListener('focus', onFocus);\n }\n\n if (onBlur) {\n window.removeEventListener('blur', onBlur);\n }\n };\n }, [onBlur, onFocus]);\n}\n"],"names":["STICKER_SIZE","IS_SINGLE_COLUMN_LAYOUT","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","memo","code","codeLength","trackingDirection","isTracking","isBig","idleMonkeyData","setIdleMonkeyData","useState","trackingMonkeyData","setTrackingMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","TRACKING_FRAMES_PER_SYMBOL","useEffect","getAnimationData","then","handleFirstMonkeyLoad","useCallback","id","className","AnimatedSticker","size","STICKER_SIZE_TWO_FA","undefined","animationData","play","onLoad","playSegment","startFrame","length","endFrame","getTrackingFrames","speed","noLoop","withGlobal","global","pick","authPhoneNumber","authIsCodeViaApp","authIsLoading","authError","setAuthCode","returnToAuthPhoneNumber","clearAuthError","getDispatch","lang","useLang","inputRef","useRef","setCode","setIsTracking","setTrackingDirection","IS_TOUCH_ENV","current","focus","useHistoryBack","onCodeChange","e","currentTarget","target","value","replace","substr","onClick","role","tabIndex","title","renderText","InputText","ref","label","onInput","error","autoComplete","inputMode","Loading","authHint","setAuthPassword","showPassword","setShowPassword","handleChangePasswordVisibility","isVisible","handleSubmit","password","isPasswordVisible","PasswordForm","clearError","hint","isLoading","onChangePasswordVisibility","onSubmit","signUp","uploadProfilePhoto","isButtonShown","setIsButtonShown","croppedFile","setCroppedFile","firstName","setFirstName","lastName","setLastName","action","method","event","preventDefault","file","AvatarEditable","onChange","Button","type","ripple","lottiePromise","RLottie","async","ensureLottie","default","setTimeout","quality","isLowPriority","color","forceOnHeavyAnimation","onEnded","animation","setAnimation","container","wasPlaying","isFrozen","isFirstRender","playRef","playSegmentRef","exec","newAnimation","setSpeed","fastRaf","setColor","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","changeData","useHeavyAnimationCheck","useBackgroundMode","fullClassName","buildClassName","style","FOCUS_DELAY_TIMEOUT_MS","placeholder","submitLabel","onInputChange","setPassword","canSubmit","setCanSubmit","requestAnimationFrame","select","dir","isRtl","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isPeekShown","setIsPeekShown","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","CameraFlip","HandFilled","HandOutline","Speaker","VoiceAllowTalk","VoiceMini","VoiceMuted","VoiceOutlined","Peach","Eggplant","Cumshot","JoinRequest","Invite","name","path","window","location","origin","mediaLoader","ApiMediaFormat","cropperResultOptions","format","circle","width","height","Croppie","croppiePromise","cropper","onClose","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","document","getElementById","offsetWidth","offsetHeight","enableZoom","boundary","viewport","dataUri","blobToDataUri","bind","url","err","DEBUG","console","initCropper","ensureCroppie","Modal","isOpen","Boolean","hasCloseButton","round","result","croppedImg","blobToFile","ariaLabel","disabled","currentAvatarBlobUrl","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","files","accept","src","alt","URL","revokeObjectURL","createObjectURL","dialogRef","header","noBackdrop","children","onCloseAnimationEnd","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","key","stopPropagation","focusableElements","Array","from","querySelectorAll","currentFocusedIndex","findIndex","em","isSameNode","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","Portal","containerId","elementRef","createElement","useLayoutEffect","querySelector","add","appendChild","TeactDOM","removeChild","onBlur","onFocus","hasFocus"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"133.0e8e598a95d89fe36bff.js","mappings":"uSAoBA,MAEM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EAAf,SAA0B4O,GAAe,EACrE,MAAMsC,GAAarP,EAAAA,EAAAA,MAwBnB,OAvBKqP,EAAWhP,UACdgP,EAAWhP,QAAUgK,SAASiF,cAAc,SAG9CC,EAAAA,EAAAA,KAAgB,KACd,MAAM3K,EAAYyF,SAASmF,cAA8BJ,GAAe,YACxE,IAAKxK,EACH,OAGF,MAAM6I,EAAU4B,EAAWhP,QAO3B,OANIlC,GACFsP,EAAQsB,UAAUU,IAAItR,GAGxByG,EAAU8K,YAAYjC,GAEf,KACLkC,EAAAA,EAAAA,YAAgBpR,EAAWkP,GAC3B7I,EAAUgL,YAAYnC,MAEvB,CAACtP,EAAWiR,IAERO,EAAAA,EAAAA,OAAgB5C,EAA4BsC,EAAWhP,W,8CChCjD,SAAS8F,EACtB0J,EACAC,IAEAjS,EAAAA,EAAAA,KAAU,KACJgS,IAAWxF,SAAS0F,YACtBF,IAGEA,GACF1G,OAAOqF,iBAAiB,OAAQqB,GAG9BC,GACF3G,OAAOqF,iBAAiB,QAASsB,GAG5B,KACDA,GACF3G,OAAOsF,oBAAoB,QAASqB,GAGlCD,GACF1G,OAAOsF,oBAAoB,OAAQoB,MAGtC,CAACA,EAAQC,M","sources":["webpack://telegram-t/./src/components/common/TrackingMonkey.tsx","webpack://telegram-t/./src/components/auth/AuthCode.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.tsx","webpack://telegram-t/./src/components/common/AnimatedSticker.tsx","webpack://telegram-t/./src/components/common/PasswordForm.tsx","webpack://telegram-t/./src/components/common/PasswordMonkey.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/components/ui/CropModal.tsx","webpack://telegram-t/./src/components/ui/AvatarEditable.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Portal.ts","webpack://telegram-t/./src/hooks/useBackgroundMode.ts"],"sourcesContent":["import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n code: string;\n codeLength: number;\n trackingDirection: number;\n isTracking: boolean;\n isBig?: boolean;\n};\n\nconst TRACKING_START_FRAME = 15;\nconst TRACKING_END_FRAME = 180;\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst TrackingMonkey: FC = ({\n code,\n codeLength,\n trackingDirection,\n isTracking,\n isBig,\n}) => {\n const [idleMonkeyData, setIdleMonkeyData] = useState();\n const [trackingMonkeyData, setTrackingMonkeyData] = useState();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const TRACKING_FRAMES_PER_SYMBOL = (TRACKING_END_FRAME - TRACKING_START_FRAME) / codeLength;\n\n useEffect(() => {\n if (!idleMonkeyData) {\n getAnimationData('MonkeyIdle').then(setIdleMonkeyData);\n }\n }, [idleMonkeyData]);\n\n useEffect(() => {\n if (!trackingMonkeyData) {\n getAnimationData('MonkeyTracking').then(setTrackingMonkeyData);\n }\n }, [trackingMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n function getTrackingFrames(): [number, number] {\n const startFrame = (code && code.length > 1) || trackingDirection < 0\n ? TRACKING_START_FRAME + TRACKING_FRAMES_PER_SYMBOL * (code.length - 1)\n : 0;\n const endFrame = code.length === codeLength\n ? TRACKING_END_FRAME\n : TRACKING_START_FRAME + TRACKING_FRAMES_PER_SYMBOL * code.length;\n\n if (trackingDirection < 1) {\n return [\n endFrame,\n startFrame,\n ];\n }\n\n return [\n startFrame,\n endFrame,\n ];\n }\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {idleMonkeyData && (\n \n )}\n {trackingMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(TrackingMonkey);\n","import { FormEvent } from 'react';\nimport React, {\n FC, useState, useEffect, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\nimport { GlobalState } from '../../global/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport TrackingMonkey from '../common/TrackingMonkey';\n\ntype StateProps = Pick;\n\nconst CODE_LENGTH = 5;\n\nconst AuthCode: FC = ({\n authPhoneNumber,\n authIsCodeViaApp,\n authIsLoading,\n authError,\n}) => {\n const {\n setAuthCode,\n returnToAuthPhoneNumber,\n clearAuthError,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [code, setCode] = useState('');\n const [isTracking, setIsTracking] = useState(false);\n const [trackingDirection, setTrackingDirection] = useState(1);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, []);\n\n useHistoryBack(true, returnToAuthPhoneNumber);\n\n const onCodeChange = useCallback((e: FormEvent) => {\n if (authError) {\n clearAuthError();\n }\n\n const { currentTarget: target } = e;\n target.value = target.value.replace(/[^\\d]+/, '').substr(0, CODE_LENGTH);\n\n if (target.value === code) {\n return;\n }\n\n setCode(target.value);\n\n if (!isTracking) {\n setIsTracking(true);\n } else if (!target.value.length) {\n setIsTracking(false);\n }\n\n if (code && code.length > target.value.length) {\n setTrackingDirection(-1);\n } else {\n setTrackingDirection(1);\n }\n\n if (target.value.length === CODE_LENGTH) {\n setAuthCode({ code: target.value });\n }\n }, [authError, clearAuthError, code, isTracking, setAuthCode]);\n\n return (\n
\n
\n \n

\n {authPhoneNumber}\n \n \n

\n \n

\n {renderText(lang(authIsCodeViaApp ? 'SentAppCode' : 'Login.JustSentSms'), ['simple_markdown'])}\n

\n \n {authIsLoading && }\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authPhoneNumber', 'authIsCodeViaApp', 'authIsLoading', 'authError']),\n)(AuthCode));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport MonkeyPassword from '../common/PasswordMonkey';\nimport PasswordForm from '../common/PasswordForm';\n\ntype StateProps = Pick;\n\nconst AuthPassword: FC = ({\n authIsLoading, authError, authHint,\n}) => {\n const { setAuthPassword, clearAuthError } = getDispatch();\n\n const lang = useLang();\n const [showPassword, setShowPassword] = useState(false);\n\n const handleChangePasswordVisibility = useCallback((isVisible) => {\n setShowPassword(isVisible);\n }, []);\n\n const handleSubmit = useCallback((password: string) => {\n setAuthPassword({ password });\n }, [setAuthPassword]);\n\n return (\n
\n
\n \n

{lang('Login.Header.Password')}

\n

{lang('Login.EnterPasswordDescription')}

\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authIsLoading', 'authError', 'authHint']),\n)(AuthPassword));\n","import { ChangeEvent } from 'react';\nimport React, { FC, useState, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport InputText from '../ui/InputText';\nimport AvatarEditable from '../ui/AvatarEditable';\n\ntype StateProps = Pick;\n\nconst AuthRegister: FC = ({\n authIsLoading, authError,\n}) => {\n const { signUp, clearAuthError, uploadProfilePhoto } = getDispatch();\n\n const lang = useLang();\n const [isButtonShown, setIsButtonShown] = useState(false);\n const [croppedFile, setCroppedFile] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n\n function handleFirstNameChange(event: ChangeEvent) {\n if (authError) {\n clearAuthError();\n }\n\n const { target } = event;\n\n setFirstName(target.value);\n setIsButtonShown(target.value.length > 0);\n }\n\n function handleLastNameChange(event: ChangeEvent) {\n const { target } = event;\n\n setLastName(target.value);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n signUp({ firstName, lastName });\n\n if (croppedFile) {\n uploadProfilePhoto({ file: croppedFile });\n }\n }\n\n return (\n
\n
\n
\n \n

{lang('YourName')}

\n

{lang('Login.Register.Desc')}

\n \n \n {isButtonShown && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authIsLoading', 'authError']),\n)(AuthRegister));\n","import React, {\n FC, useEffect, useRef, memo, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\n\ntype OwnProps = {\n className?: string;\n id: string;\n animationData?: string;\n play?: boolean | string;\n playSegment?: [number, number];\n speed?: number;\n noLoop?: boolean;\n size: number;\n quality?: number;\n isLowPriority?: boolean;\n onLoad?: NoneToVoidFunction;\n forceOnHeavyAnimation?: boolean;\n color?: [number, number, number];\n onEnded?: NoneToVoidFunction;\n};\n\ntype RLottieClass = typeof import('../../lib/rlottie/RLottie').default;\ntype RLottieInstance = import('../../lib/rlottie/RLottie').default;\nlet lottiePromise: Promise;\nlet RLottie: RLottieClass;\n\n// Time for the main interface to completely load\nconst LOTTIE_LOAD_DELAY = 3000;\n\nasync function ensureLottie() {\n if (!lottiePromise) {\n lottiePromise = import('../../lib/rlottie/RLottie') as unknown as Promise;\n RLottie = (await lottiePromise as any).default;\n }\n\n return lottiePromise;\n}\n\nsetTimeout(ensureLottie, LOTTIE_LOAD_DELAY);\n\nconst AnimatedSticker: FC = ({\n className,\n id,\n animationData,\n play,\n playSegment,\n speed,\n noLoop,\n size,\n quality,\n isLowPriority,\n color,\n forceOnHeavyAnimation,\n onLoad,\n onEnded,\n}) => {\n const [animation, setAnimation] = useState();\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n const isFirstRender = useRef(true);\n\n const playRef = useRef();\n playRef.current = play;\n const playSegmentRef = useRef<[number, number]>();\n playSegmentRef.current = playSegment;\n\n useEffect(() => {\n if (animation || !animationData) {\n return;\n }\n\n const exec = () => {\n if (!container.current) {\n return;\n }\n\n const newAnimation = new RLottie(\n id,\n container.current,\n animationData,\n {\n noLoop,\n size,\n quality,\n isLowPriority,\n },\n onLoad,\n color,\n onEnded,\n );\n\n if (speed) {\n newAnimation.setSpeed(speed);\n }\n\n setAnimation(newAnimation);\n };\n\n if (RLottie) {\n exec();\n } else {\n ensureLottie().then(() => {\n fastRaf(() => {\n if (container.current) {\n exec();\n }\n });\n });\n }\n }, [color, animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed, onEnded]);\n\n useEffect(() => {\n if (!animation) return;\n\n animation.setColor(color);\n }, [color, animation]);\n\n useEffect(() => {\n return () => {\n if (animation) {\n animation.destroy();\n }\n };\n }, [animation]);\n\n const playAnimation = useCallback((shouldRestart = false) => {\n if (animation && (playRef.current || playSegmentRef.current)) {\n if (playSegmentRef.current) {\n animation.playSegment(playSegmentRef.current);\n } else if (shouldRestart) {\n animation.goToAndPlay(0);\n } else {\n animation.play();\n }\n }\n }, [animation]);\n\n const pauseAnimation = useCallback(() => {\n if (!animation) {\n return;\n }\n\n animation.pause();\n }, [animation]);\n\n const freezeAnimation = useCallback(() => {\n isFrozen.current = true;\n\n if (!animation) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = animation.isPlaying();\n }\n\n pauseAnimation();\n }, [animation, pauseAnimation]);\n\n const unfreezeAnimation = useCallback(() => {\n if (wasPlaying.current) {\n playAnimation();\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [playAnimation]);\n\n const unfreezeAnimationOnRaf = useCallback(() => {\n fastRaf(unfreezeAnimation);\n }, [unfreezeAnimation]);\n\n useEffect(() => {\n if (!animation) {\n return;\n }\n\n if (play || playSegment) {\n if (isFrozen.current) {\n wasPlaying.current = true;\n } else {\n playAnimation(noLoop);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isFrozen.current) {\n wasPlaying.current = false;\n } else {\n pauseAnimation();\n }\n }\n }, [animation, play, playSegment, noLoop, playAnimation, pauseAnimation]);\n\n useEffect(() => {\n if (animation) {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else if (animationData) {\n animation.changeData(animationData);\n playAnimation();\n }\n }\n }, [playAnimation, animation, animationData]);\n\n useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation, forceOnHeavyAnimation);\n // Pausing frame may not happen in background\n // so we need to make sure it happens right after focusing,\n // then we can play again.\n useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf);\n\n const fullClassName = buildClassName('AnimatedSticker', className);\n\n const style = size ? `width: ${size}px; height: ${size}px;` : undefined;\n\n return (\n \n );\n};\n\nexport default memo(AnimatedSticker);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n
\n \n \n \n \n \n
\n
\n {canSubmit && (\n \n )}\n \n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState();\n const [peekMonkeyData, setPeekMonkeyData] = useState();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {closeMonkeyData && (\n \n )}\n {peekMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(PasswordMonkey);\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nimport MonkeyIdle from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyIdle.tgs';\nimport MonkeyTracking from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyTracking.tgs';\nimport MonkeyClose from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyClose.tgs';\nimport MonkeyPeek from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyPeek.tgs';\n\nimport FoldersAll from '../../../assets/tgs/settings/FoldersAll.tgs';\nimport FoldersNew from '../../../assets/tgs/settings/FoldersNew.tgs';\nimport DiscussionGroups from '../../../assets/tgs/settings/DiscussionGroupsDucks.tgs';\n\nimport CameraFlip from '../../../assets/tgs/calls/CameraFlip.tgs';\nimport HandFilled from '../../../assets/tgs/calls/HandFilled.tgs';\nimport HandOutline from '../../../assets/tgs/calls/HandOutline.tgs';\nimport Speaker from '../../../assets/tgs/calls/Speaker.tgs';\nimport VoiceAllowTalk from '../../../assets/tgs/calls/VoiceAllowTalk.tgs';\nimport VoiceMini from '../../../assets/tgs/calls/VoiceMini.tgs';\nimport VoiceMuted from '../../../assets/tgs/calls/VoiceMuted.tgs';\nimport VoiceOutlined from '../../../assets/tgs/calls/VoiceOutlined.tgs';\n\nimport Peach from '../../../assets/tgs/animatedEmojis/Peach.tgs';\nimport Eggplant from '../../../assets/tgs/animatedEmojis/Eggplant.tgs';\nimport Cumshot from '../../../assets/tgs/animatedEmojis/Cumshot.tgs';\n\nimport JoinRequest from '../../../assets/tgs/invites/Requests.tgs';\nimport Invite from '../../../assets/tgs/invites/Invite.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n CameraFlip,\n HandFilled,\n HandOutline,\n Speaker,\n VoiceAllowTalk,\n VoiceMini,\n VoiceMuted,\n VoiceOutlined,\n Peach,\n Eggplant,\n Cumshot,\n JoinRequest,\n Invite,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","import React, {\n FC, useEffect, useState, memo,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n size: { width: 1024, height: 1024 },\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n async function handleCropClick() {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }\n\n return (\n \n {isCroppieReady ? (\n
\n ) : (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n function handleAvatarCrop(croppedImg: File) {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }\n\n function handleModalClose() {\n setSelectedFile(undefined);\n }\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n
\n \n \n \n {croppedBlobUrl && \"Avatar\"}\n \n \n
\n );\n};\n\nexport default memo(AvatarEditable);\n","import { RefObject } from 'react';\nimport React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: React.ReactNode;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n dialogRef?: RefObject;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\n dialogRef,\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n
\n {hasCloseButton && (\n \n \n \n )}\n
{title}
\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n \n \n
\n
\n
\n {renderHeader()}\n
\n {children}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import { FC, useRef, useLayoutEffect, VirtualElement } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: React.ReactNode;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children as VirtualElement, elementRef.current);\n};\n\nexport default Portal;\n","import { useEffect } from '../lib/teact/teact';\n\nexport default function useBackgroundMode(\n onBlur?: AnyToVoidFunction,\n onFocus?: AnyToVoidFunction,\n) {\n useEffect(() => {\n if (onBlur && !document.hasFocus()) {\n onBlur();\n }\n\n if (onBlur) {\n window.addEventListener('blur', onBlur);\n }\n\n if (onFocus) {\n window.addEventListener('focus', onFocus);\n }\n\n return () => {\n if (onFocus) {\n window.removeEventListener('focus', onFocus);\n }\n\n if (onBlur) {\n window.removeEventListener('blur', onBlur);\n }\n };\n }, [onBlur, onFocus]);\n}\n"],"names":["STICKER_SIZE","IS_SINGLE_COLUMN_LAYOUT","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","memo","code","codeLength","trackingDirection","isTracking","isBig","idleMonkeyData","setIdleMonkeyData","useState","trackingMonkeyData","setTrackingMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","TRACKING_FRAMES_PER_SYMBOL","useEffect","getAnimationData","then","handleFirstMonkeyLoad","useCallback","id","className","AnimatedSticker","size","STICKER_SIZE_TWO_FA","undefined","animationData","play","onLoad","playSegment","startFrame","length","endFrame","getTrackingFrames","speed","noLoop","withGlobal","global","pick","authPhoneNumber","authIsCodeViaApp","authIsLoading","authError","setAuthCode","returnToAuthPhoneNumber","clearAuthError","getDispatch","lang","useLang","inputRef","useRef","setCode","setIsTracking","setTrackingDirection","IS_TOUCH_ENV","current","focus","useHistoryBack","onCodeChange","e","currentTarget","target","value","replace","substr","onClick","role","tabIndex","title","renderText","InputText","ref","label","onInput","error","autoComplete","inputMode","Loading","authHint","setAuthPassword","showPassword","setShowPassword","handleChangePasswordVisibility","isVisible","handleSubmit","password","isPasswordVisible","PasswordForm","clearError","hint","isLoading","onChangePasswordVisibility","onSubmit","signUp","uploadProfilePhoto","isButtonShown","setIsButtonShown","croppedFile","setCroppedFile","firstName","setFirstName","lastName","setLastName","action","method","event","preventDefault","file","AvatarEditable","onChange","Button","type","ripple","lottiePromise","RLottie","async","ensureLottie","default","setTimeout","quality","isLowPriority","color","forceOnHeavyAnimation","onEnded","animation","setAnimation","container","wasPlaying","isFrozen","isFirstRender","playRef","playSegmentRef","exec","newAnimation","setSpeed","fastRaf","setColor","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","changeData","useHeavyAnimationCheck","useBackgroundMode","fullClassName","buildClassName","style","FOCUS_DELAY_TIMEOUT_MS","placeholder","submitLabel","onInputChange","setPassword","canSubmit","setCanSubmit","requestAnimationFrame","select","dir","isRtl","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isPeekShown","setIsPeekShown","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","CameraFlip","HandFilled","HandOutline","Speaker","VoiceAllowTalk","VoiceMini","VoiceMuted","VoiceOutlined","Peach","Eggplant","Cumshot","JoinRequest","Invite","name","path","window","location","origin","mediaLoader","ApiMediaFormat","cropperResultOptions","format","circle","width","height","Croppie","croppiePromise","cropper","onClose","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","document","getElementById","offsetWidth","offsetHeight","enableZoom","boundary","viewport","dataUri","blobToDataUri","bind","url","err","DEBUG","console","initCropper","ensureCroppie","Modal","isOpen","Boolean","hasCloseButton","round","result","croppedImg","blobToFile","ariaLabel","disabled","currentAvatarBlobUrl","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","files","accept","src","alt","URL","revokeObjectURL","createObjectURL","dialogRef","header","noBackdrop","children","onCloseAnimationEnd","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","key","stopPropagation","focusableElements","Array","from","querySelectorAll","currentFocusedIndex","findIndex","em","isSameNode","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","Portal","containerId","elementRef","createElement","useLayoutEffect","querySelector","add","appendChild","TeactDOM","removeChild","onBlur","onFocus","hasFocus"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/176.2bd8fc859463a252c8a2.css b/dist/176.c9baace07c5f15a8c611.css similarity index 99% rename from dist/176.2bd8fc859463a252c8a2.css rename to dist/176.c9baace07c5f15a8c611.css index 08529b66..d5ffcae1 100644 --- a/dist/176.2bd8fc859463a252c8a2.css +++ b/dist/176.c9baace07c5f15a8c611.css @@ -37,4 +37,4 @@ #RightColumn{position:absolute;top:0;right:0;width:var(--right-column-width);height:100%;padding-right:env(safe-area-inset-right);transform:translate3d(var(--right-column-width), 0, 0);background:var(--color-background);border-left:1px solid var(--color-borders);z-index:var(--z-right-column);transition:transform var(--layer-transition)}body.animation-level-0 #RightColumn{transition:none}@media(max-width: 1275px){#RightColumn{box-shadow:0 .25rem .5rem .125rem var(--color-default-shadow);border-left:none}}@media(max-width: 600px){#RightColumn{width:100vw;transform:translate3d(110vw, 0, 0)}}#RightColumn>.Transition{height:calc(100% - var(--header-height));overflow:hidden}#RightColumn .Management .section>.ChatInfo{padding:0 1.5rem;margin:1rem 0;text-align:center}#RightColumn .Management .section>.ChatInfo .Avatar{margin:0 auto .5rem}#RightColumn .Management .section>.ChatInfo .Avatar.no-photo{cursor:default !important}#RightColumn .Management .section>.ChatInfo .title{display:flex;justify-content:center;align-items:center}#RightColumn .Management .section>.ChatInfo .title h3{font-weight:500;font-size:1.25rem;line-height:2rem;white-space:pre-wrap;word-break:break-word}#RightColumn .Management .section>.ChatInfo .title .VerifiedIcon{margin-left:.25rem;margin-bottom:.5rem}#RightColumn .Management .section>.ChatInfo .title .emoji{width:1.5rem;height:1.5rem;background-size:1.5rem}#RightColumn .Management .section>.ChatInfo .status{font-size:.875rem;color:#868e96}#RightColumn-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;z-index:var(--z-right-column);overflow:hidden;visibility:hidden;pointer-events:none}@media(max-width: 1275px){#RightColumn-wrapper{position:fixed}}#RightColumn-wrapper.is-hidden{display:none}#RightColumn-wrapper .overlay-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:#000;opacity:0}@media(max-width: 600px){#RightColumn-wrapper .overlay-backdrop{transition:opacity var(--layer-transition)}body.animation-level-0 #RightColumn-wrapper .overlay-backdrop{transition:none}}#Main.right-column-open #RightColumn-wrapper,body.animating-right-column #RightColumn-wrapper{visibility:visible}@media(max-width: 600px){#Main.right-column-open #RightColumn-wrapper .overlay-backdrop{opacity:var(--layer-blackout-opacity)}}#Main.right-column-open #RightColumn-wrapper #RightColumn{pointer-events:auto;transform:translate3d(0, 0, 0)} #Main{height:100%;text-align:left;overflow:hidden}@media(min-width: 1276px){#Main{position:relative}}@media(max-width: 600px){#Main{height:calc(var(--vh, 1vh)*100)}}@media(min-width: 926px){#Main{display:grid;grid-template-columns:auto 1fr;grid-template-rows:100%}}.has-group-call-header{--group-call-header-height: 2rem}.has-group-call-header #LeftColumn,.has-group-call-header #MiddleColumn,.has-group-call-header #RightColumn-wrapper{height:calc(100% - 2rem);margin-top:2rem}#LeftColumn{min-width:12rem;width:33vw;max-width:26.5rem;height:100%;position:relative}#LeftColumn>div{height:100%;overflow:hidden}@media(max-width: 600px){#LeftColumn{height:calc(var(--vh, 1vh)*100)}}@media(min-width: 926px){#LeftColumn{max-width:40vw}}@media(min-width: 1276px){#LeftColumn{width:25vw;max-width:33vw}}@media(max-width: 925px){#LeftColumn{position:fixed;left:0;top:0;height:calc(var(--vh, 1vh)*100);width:26.5rem !important;transform:translate3d(-5rem, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #LeftColumn{transition:none}#LeftColumn::after{content:"";display:block;position:absolute;left:0;top:0;right:0;bottom:0;background:#000;opacity:var(--layer-blackout-opacity);transition:opacity var(--layer-transition);z-index:1}body.animation-level-0 #LeftColumn::after{transition:none}body.is-android #LeftColumn::after{display:none}body.is-android .middle-column-shown #LeftColumn::after{display:block}#Main:not(.middle-column-open) #LeftColumn{transform:translate3d(0, 0, 0)}#Main:not(.middle-column-open) #LeftColumn::after{opacity:0;pointer-events:none}#Main.history-animation-disabled #LeftColumn{transition:none}#Main.history-animation-disabled #LeftColumn:after{transition:none}}@media(max-width: 600px){#LeftColumn{max-width:none;transform:translate3d(-20vw, 0, 0);left:env(safe-area-inset-left) !important;width:calc(100vw - env(safe-area-inset-left)) !important}}@media(max-width: 600px){#RightColumn{height:calc(var(--vh, 1vh)*100 + 1px)}}#Main.history-animation-disabled #RightColumn{transition:none}#Main.history-animation-disabled #RightColumn .overlay-backdrop{transition:none}#Main.history-animation-disabled .overlay-backdrop{transition:none}#MiddleColumn{border-left:1px solid var(--color-borders)}@media(max-width: 925px){#MiddleColumn{max-width:none;position:fixed;left:0;top:0;bottom:0;right:0;transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #MiddleColumn{transition:none}#Main:not(.middle-column-open) #MiddleColumn{transform:translate3d(26.5rem, 0, 0)}}@media(max-width: 600px){#MiddleColumn{border-left:none}#Main:not(.middle-column-open) #MiddleColumn{transform:translate3d(100vw, 0, 0)}#Main.right-column-open #MiddleColumn{transform:translate3d(-20vw, 0, 0)}}#Main.history-animation-disabled #MiddleColumn{transition:none}#Main.history-animation-disabled #MiddleColumn:after{transition:none}body.is-android.animation-level-1{--layer-transition: 250ms ease-in-out}body.is-android.animation-level-1 #LeftColumn,body.is-android.animation-level-1 #MiddleColumn,body.is-android.animation-level-1 #RightColumn{transition:transform var(--layer-transition),opacity var(--layer-transition)}body.is-android.animation-level-1 #Main:not(.middle-column-shown) #MiddleColumn{display:none}body.is-android.animation-level-1 #Main:not(.middle-column-open) #MiddleColumn{transform:translate3d(10vw, 0, 0);opacity:0}body.is-android.animation-level-1 #Main.middle-column-open #LeftColumn{transform:translate3d(0, 0, 0);opacity:0}body.is-android.animation-level-1 #Main:not(.right-column-shown) #RightColumn{display:none}body.is-android.animation-level-1 #Main:not(.right-column-open) #RightColumn{transform:translate3d(10vw, 0, 0);opacity:0}body.is-android.animation-level-1 #Main.right-column-open #MiddleColumn{transform:translate3d(0, 0, 0);opacity:0} -/*# sourceMappingURL=176.2bd8fc859463a252c8a2.css.map*/ \ No newline at end of file +/*# sourceMappingURL=176.c9baace07c5f15a8c611.css.map*/ \ No newline at end of file diff --git a/dist/176.2bd8fc859463a252c8a2.css.map b/dist/176.c9baace07c5f15a8c611.css.map similarity index 99% rename from dist/176.2bd8fc859463a252c8a2.css.map rename to dist/176.c9baace07c5f15a8c611.css.map index 79d7e3d3..45763e25 100644 --- a/dist/176.2bd8fc859463a252c8a2.css.map +++ b/dist/176.c9baace07c5f15a8c611.css.map @@ -1 +1 @@ -{"version":3,"file":"176.2bd8fc859463a252c8a2.css","mappings":"AAAA,0BACE,kBACA,MACA,OACA,WAEA,mDACA,UAEA,qCACE,4BACA,UAGF,sCACE,aAIJ,yBACE,iBACA,cACA,aACA,mBACA,qBACA,iBACA,+BACA,2CAEA,qCACE,eAGF,kCACE,wBAGF,qCACE,OACA,gCACA,mBACA,gBACA,wBACA,6BACA,mBAGF,yBACE,qCACE,6BAIJ,qCACE,WAGA,YAEA,yCACE,aACA,mBACA,W;AC5DN,gBACE,kBAEA,oCACE,kBAEA,2HAGE,eACA,eACA,sBACA,6CACA,0BACA,oBAGF,uFAEE,kBACA,OACA,WAGF,4CACE,eAGF,2CACE,aAGF,+CACE,yBAEA,uDACE,qEAGF,sDACE,qEAIJ,iDACE,gBAEA,iHAEE,gBAKN,gCACE,iBACA,cACA,iBACA,6BACA,qBACA,mBACA,WACA,kBACA,mBACA,gBACA,kBACA,cAGF,kDACE,gBACA,UACA,kCAGF,4CACE,sBAGF,0CACE,cACA,kBAGF,8BACE,gBACA,yCAEA,gBClFF,+BD8EA,8BC7EE,mBAGA,mBDoFA,wIACE,2B;AEjGN,eACE,kBACA,WACA,YACA,2BAEA,4DAEA,sCACE,0BACA,UAEA,wBAEA,+CACE,UAIJ,wBACE,wBAEA,yBAHF,wBAKI,sCACA,6BAKF,gFAEE,kBAIA,0DACE,iCAGF,gDACE,0CAKF,0CACE,iCAGF,oDACE,0C;ACnDR,iBACE,YACA,kBACA,aACA,sBACA,gBACA,UAEA,6BACE,OACA,gBAGF,8BACE,YACA,aACA,sBACA,gBAEA,gDACE,gBACA,6BAEA,2DACE,SAIJ,uCACE,2BACA,sBACA,mBACA,gBACA,UAGF,mCACE,cACA,qBACA,sBAEA,wCACE,mBACA,oBAIJ,0CACE,OACA,gBAIJ,+FAGE,YACA,gBAGF,6BACE,kBACA,YACA,UACA,WACA,c;ACjEJ,SACE,YAGF,aACE,4BACA,oCACA,aACA,mBACA,cACA,yCAEA,gBACE,gBACA,kBACA,gBACA,qBACA,kBAGF,0BACE,oBACA,+BAEA,yBAJF,0BAKI,6BAIJ,yBAzBF,aA0BI,eAGF,6BACE,aACA,cAEA,2CACE,mB;ACtCN,aACE,aACA,iBACA,oBACA,uBAEA,oCACE,2BAGF,qBACE,cACA,eAGF,4BACE,6CACA,2DACA,0CACA,2CAIA,oCACE,WACA,YAEA,sCACE,mBACA,sBAIJ,8BACE,kBACA,oBACA,sBAEA,wCACE,oBAIJ,+EAEE,UACA,mBACA,uEAGF,yLAIE,UACA,qBAIJ,4BACE,kBACA,iBAEA,kDACE,kBACA,2BACA,SACA,YACA,WACA,eACA,kBAGF,gHAEE,mBAGF,2CACE,UACA,kBAEA,kBACA,mCACA,aACA,2BACA,8DACA,WACA,eACA,oBACA,eACA,iDAEA,wDACE,gBACA,0EACE,gBAKN,yKAGE,UACA,mBAKF,sCACE,6CAGF,qDACE,iCACA,iBACA,iBACA,iBACA,sBACA,uBACA,kCAIJ,qBACE,aACA,uBACA,sBACA,cACA,gBACA,kBACA,gBACA,eACA,kDAEA,2BACE,wDAGF,iDAfF,qBAgBI,iBAGF,yCACE,cACA,gBACA,6BACA,iBACA,mBACA,gBACA,uBAEA,qDACE,8BACA,qBAIJ,+BACE,8BACA,kCACA,qBACA,mBACA,gBACA,uBACA,mBAEA,2CACE,8BACA,qB;AC1KR,kBACE,kBACA,SACA,OACA,QACA,gBACA,gBACA,+CACA,aACA,mBACA,8BACA,mBACA,qCACA,mCACA,WACA,eAEA,0BACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,4BACE,aAGF,yBACE,oCACE,2BAIJ,wBACE,aACA,sBAEA,+BACE,kBACA,wBAGF,sCACE,iBACA,kCAIJ,2BACE,aACA,mBACA,mBAEA,mCACE,sBAEA,+CACE,WACA,YAGF,qDACE,cACA,eACA,6CAKN,wBACE,cACA,qBACA,gBACA,kBACA,WAIJ,0BACE,wDACE,8C;ACTJ,cACE,aACA,mBACA,WACA,+CACA,mCACA,kBACA,+BACA,kBACA,qBACA,mDACA,uDAEA,yBAbF,cAcI,kBAEA,kDACA,qDAGF,0BACE,WAGA,YAEA,8BACE,aACA,mBACA,WAIJ,2BACE,oBACA,mBACA,kBAEA,yBALF,2BAMI,eAGF,yCACE,kBACA,eACA,kBACA,sBACA,iBACA,oBACA,gBACA,kBAEA,kBACA,aACA,cAEA,6BACA,WACA,oBAEA,gDACE,gCAKN,iCACE,YACA,gBAGF,kEACE,2BAGF,4BACE,aACA,mBACA,yBACA,iBACA,cAGE,qLAGE,2BAIJ,iDACE,2CACE,+BACA,6CAEA,mEACE,mEAKN,0BA1BF,4BA2BI,+BACA,6CAEA,oDACE,mENpLN,oIM0LI,oBAIJ,iDACE,8GAEE,UAEA,8JACE,WAnMN,4HAEE,kBACA,SACA,OACA,QACA,gBACA,uDAEA,aACA,2BACA,oBACA,uBACA,mDACA,oDACA,mCAEA,4IACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,sKACE,gBACA,sBAIJ,sDACE,mBACA,aACA,qBAEA,8DACE,gBACA,YAGF,8DACE,sBAGF,oEACE,iBAIJ,8DACE,YACA,cACA,iBAEA,sEACE,YACA,eAGF,4EACE,eAIJ,iFACE,aAsIA,0BACE,iEACE,uDAKN,oHAEE,mDAEA,kKACE,eAIJ,iBACE,gBACA,mBACA,qBACA,gBACA,SACA,gBACA,uBACA,uBAEA,4DAEE,oBACA,gBAGF,yBAhBF,iBAiBI,cACA,gBACA,wBAGF,0BACE,yCACE,kDAKN,wBACE,eACA,aACA,mBAEA,8BACE,aACA,sBACA,uBACA,YACA,gBAGF,+BACE,aACA,mBAEA,6CACE,cACA,eACA,mBACA,oBAIJ,uEAEE,eACA,uBAEA,0BACE,uHACE,kDAKN,qCACE,uBACA,gBACA,uBAEA,0BACE,6DACE,kDAMR,sBACE,qBAEA,wBACA,yBACA,oBAGF,mDAEE,kBACA,qBACA,SACA,kCACA,gBACA,mBACA,uBACA,qBAEA,uEACE,oBAGF,iEACE,2BAGF,2EACE,iBAIJ,8BACE,aACA,cAGF,2CACE,aACA,mBACA,iBACA,eACA,2BACA,mCAGE,oFACE,aAIJ,0BAdF,2CAeI,+BACA,+DAEA,mEACE,mEAIJ,gEACE,gBAGF,mDACE,cAGF,sDACE,kBACA,OACA,QACA,SACA,mCACA,oCACA,uDACA,+BACA,+DAEA,8DACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,2EACE,aACA,gBACA,OAEA,yFACE,eAIJ,0BAhCF,sDAiCI,+BACA,+DAEA,8EACE,qDAMR,mCACE,aACA,cACA,oBACA,uBACA,eACA,qBACA,kDACA,kBACA,gBACA,eAEA,yCACE,wDAGF,0DACE,kBACA,eACA,iBACA,cACA,kBACA,gBAEA,2FACE,eACA,cACA,uBACA,gCAGF,yFACE,8CACA,kBACA,sBACA,sCAGF,sFACE,kBACA,OACA,MACA,cACA,gCACA,uBACA,sBACA,sCAIJ,iDACE,gBACA,4BACA,mBACA,gBAEA,iDANF,iDAOI,iBAGF,wDACE,gBACA,kBACA,iBACA,YACA,2BACA,sBACA,gBACA,mBAEA,oEACE,mBAIJ,mDACE,kBACA,qBACA,gBACA,mBACA,gBACA,uBACA,SAEA,+DACE,mBAKN,gDACE,WACA,YAGF,uCACE,cACA,eACA,iBACA,qBACA,4BACA,mBACA,cAEA,qDACE,gBAKN,6BACE,cACA,iBACA,aACA,mBACA,yBAGE,8DACE,2BACA,UAIJ,2CACE,kBACA,iBAGF,oCACE,kBACA,eACA,YACA,gCACA,oBACA,WACA,iBACA,iBACA,gBACA,kBACA,cACA,QACA,MAMF,wFACE,mBAEA,kGACE,qBAKN,yBAtjBA,sEAEE,kBACA,SACA,OACA,QACA,gBACA,uDAEA,aACA,2BACA,oBACA,uBACA,mDACA,oDACA,mCAEA,sFACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,gHACE,gBACA,sBAIJ,2BACE,mBACA,aACA,qBAEA,mCACE,gBACA,YAGF,mCACE,sBAGF,yCACE,iBAIJ,mCACE,YACA,cACA,iBAEA,2CACE,YACA,eAGF,iDACE,eAIJ,sDACE,cAsfJ,mBACE,KACE,UAEF,GACE,W;ACnkBJ,iBACE,aACA,mBACA,yDACA,qBACA,2BACA,0CACA,kDACA,kBACA,gBACA,eACA,cAGE,0DACE,aAIJ,+BACE,gBACA,cACA,SACA,yCACA,iDAEA,uCACE,aACA,YACA,eAGF,+CACE,0BAGF,wCACE,cAIJ,yBACE,WACA,cACA,kBACA,aACA,gBACA,cACA,UACA,+BACA,kBAGF,uBACE,oCAGF,wBACE,qCAGF,gCACE,yDAGF,+BACE,gBACA,0BACA,aACA,8BAEA,8CACE,mBACA,gBACA,uBACA,sBACA,OACA,cAGF,iCACE,mBACA,gBACA,uBACA,gBACA,gBACA,OAEA,wCACE,aACA,aAIJ,sCACE,4DACA,6DACA,sCAIJ,0CACE,0BACA,YAGF,iCACE,WACA,YACA,iBACA,qBACA,mBACA,cAEA,uCACE,mBAIJ,8BACE,8BACA,gCACA,aACA,+BACA,uBACA,WACA,qCACA,sDAEA,sCACE,gBAGF,8CACE,oBAGF,4CACE,4BAGF,6CACE,gBACA,0B;AC/IN,uBACE,kBACA,aACA,mBACA,uBAEA,oCAEE,wBAEA,eAGF,wCACE,eACA,cACA,eACA,oBAEA,+CACE,YACA,aAGF,mDACE,qBAGF,gDACE,qBAKF,gDACE,eACA,gBAEA,uDACE,eACA,gBAIF,uDACE,kB;AC7CR,aACE,kBACA,eACA,SACA,QACA,aACA,mBACA,gCACA,sBACA,iBACA,WACA,eACA,eACA,0CAEA,oCACE,WACA,YACA,oBAGF,uFAGE,iBACA,mBAGF,2BACE,sBAIA,uCACE,oBAIJ,4BACE,6BAGF,gCACE,gBACA,uBACA,qBAGF,gCACE,oBACA,qBACA,mBACA,kBACA,eAGF,mCACE,6CACA,gBAGF,mEAEE,0BACA,0BACA,sBACA,sBACA,UACA,cACA,aACA,UACA,gBACA,6BAEA,qHACE,uBAIJ,qFAEE,sBACA,YACA,6BAGF,+GAEE,cAGF,4CACE,gBACA,eAGF,yBACE,QAGF,gDACE,oCAGF,oCACE,uBACA,oBACA,sBAEA,iDACE,8BAIJ,6DACE,gBAGF,kEACE,iBAIA,qCACE,SAEF,yCACE,QAMJ,6DACE,WACA,cACA,cAGF,6DACE,YAGF,6DACE,YAGF,6DACE,Y;ACnJF,wBACE,eAGF,kBACE,oB;ACNJ,SACE,aACA,mBACA,eAEA,qBACE,eAGF,iBACE,sBAGF,uBACE,cACA,eACA,mBACA,gBAEA,qCACE,eACA,iBACA,qBACA,gBAGF,sCACE,iBACA,6B;AC5BN,YACE,aACA,qBACA,qBAEA,uBACE,gBAGF,8BACE,sBAGF,+BACE,kBACA,mBACA,cACA,wBACA,cACA,gBACA,kBACA,iBAEA,2CACE,oBACA,uBACA,iBAIJ,gCACE,kBACA,QACA,YACA,WACA,YACA,+BACA,8BACA,oBACA,iBACA,kBAEA,sCACE,8BAGF,gDACE,gBAGF,wCACE,UACA,qCACA,qBACA,uBACA,6BAIJ,+BACE,YACA,mBAGF,gCACE,kBAGF,8BACE,kBACA,QACA,cACA,gBACA,sBACA,iBACA,+BAEA,qBACA,yBACA,sBAGF,uBACE,WACA,YACA,kBACA,WACA,YACA,sDACA,oBACA,wBAGF,4BACE,iBACA,qBACA,2BACA,UAIA,qCACE,8BAGF,mCACE,0BAKN,iCACE,GACE,UAEF,KACE,W;ACpHJ,MACE,gBACA,mBAEA,yBAJF,MAKI,gBAGF,qBACE,gBACA,oBACA,iBACA,sBAGF,0CAEE,6BACA,kBAGF,iBACE,oBACA,aACA,mBACA,oBAGF,yBACE,2BACA,kBAGF,oBACE,mBACA,oBAGF,6BAEE,qBAEA,mDACE,qBAGF,+CACE,qBACA,mBAKA,gJACE,aACA,yCAEA,gMACE,4CAGF,oMACE,qCAIJ,4IACE,cACA,qCAMF,wMACE,iCAIJ,+CACE,aAMA,sCACE,aACA,sCAEA,mDACE,qCAMR,mBAEE,0CAEA,+BACE,2CAGF,gCAEE,2CACA,4CACE,2CAKN,0BACE,oBACA,mBACA,2BACA,oBACA,mBACA,gBAEA,kCACE,yCACA,eACA,uBAEA,+CACE,6CAGF,oDACE,iBAKN,sBACE,iBACA,iBACA,qBAEA,+BACE,yBAEA,wDACE,0BAIJ,0BACE,oBAIJ,+BACE,4BACA,iBACA,eACA,qBACA,2CAGF,sBACE,kCACA,yCACE,2BAIJ,wCAEE,mBACA,qBAGF,cACE,oBACA,eAEA,2BACE,0BACA,mDAIJ,cACE,sB;AC3LJ,SACE,kBACA,sBACA,qBACA,yDACA,qBACA,gBACA,kBAEA,iBACE,WACA,cACA,kBACA,MACA,SACA,OACA,cACA,+BACA,sBAGF,cACE,aACA,sBACA,uBAGF,sBACE,oBACA,iCAEA,sFAGE,6DAGF,mCACE,WACA,YACA,aACA,2BAEA,uCACE,WACA,YAKN,iCACE,4BACA,8BAGF,2BACE,aACA,mBAEA,yCACE,QACA,mBAGF,wCACE,QACA,cAIA,kDACE,wBASF,kMACE,WACA,qBACA,iCACA,cACA,YAKN,oEAGE,sBACA,eAGF,oBACE,0BACA,gBACA,sBAGF,qBACE,gBACA,sBAGF,2BACE,iBACA,gBAEA,uCACE,qBAIJ,kBACE,6BAEA,0BACE,UACA,Q;ACzHJ,gBACE,0BACA,gBAGF,sBACE,kBAGE,+CACE,eACA,aAEA,yBAJF,+CAKI,cAIJ,kDACE,kBACA,MACA,qBACA,cACA,oCACA,kDACA,wBACA,gBAEA,uDACE,kB;AC9BV,OACE,kBACA,gBAEA,mCACE,mCAGF,sEACE,6CAGF,0BACE,sBAEA,sDACE,oBACA,qCACA,sCAMF,0HACE,oBAKF,uJAGE,2BACA,iB;AClCN,YACE,kBACA,YACA,aACA,eAEA,+BACE,YACA,aACA,kBACA,gBAGF,2BACE,kBACA,OACA,MACA,kBACA,gBAGF,sBACE,kBACA,MACA,OACA,WACA,YACA,oBAGF,6BACE,YACA,iBACA,eACA,mBACA,qBAGF,kKAGE,a;ACzCJ,eACE,aACA,sBAEA,oBACE,aACA,mBAGF,uBACE,OACA,WACA,eACA,gCACA,kDACA,gBACA,oBAEA,+BACE,WACA,oCACA,UAEA,kBACA,MACA,OACA,QACA,SACA,kDACA,uBACA,yBAGF,6BACE,2CAEA,qCACE,WAIJ,qCACE,cAGF,oCACE,eAGF,yBACE,kBACA,kBACA,eACA,aACA,cAEA,0CACE,iBACA,YACA,cACA,yBAKN,0CACE,6BAGF,yCACE,gBAEA,uDACE,wDAGF,sDACE,yD;AC7EN,eACE,4CACA,uCAEA,aACA,WACA,mBACA,yCACA,6BACA,0BACA,mCACA,6DACA,2DACA,mBACA,gBACA,iBACA,0BACA,mBACA,eACA,4CACA,0CAEA,sCACE,2BAGF,8CACE,WACA,cACA,kBACA,kBACA,gBACA,eACA,eACA,gCACA,yDACA,UACA,oCAEA,gEACE,oBAGF,qEACE,2BAIJ,6BACE,kBACA,YACA,cACA,YACA,gBACA,uBACA,gCACA,uBACA,WACA,gCAEA,UACA,4BAEA,wBAfF,6BAgBI,sBAGF,mCACE,iCAGF,4CACE,UAGF,oCACE,uBACA,kBACA,kBACA,OACA,WACA,kBACA,eACA,cAGF,2CACE,eACA,kDACE,aAIJ,oDACE,cACA,iBACA,cAGF,sKAIE,aAIJ,qBACE,8BAEA,oDACE,UAGF,6BACE,2CAIJ,mHAKE,0CAGF,qDACE,iCAGF,sCACE,sBAGF,sCACE,yBAGF,6OAKE,wBAGF,sCACE,aAGF,8BACE,oBACA,iBACA,0BAGF,0BACE,yBACA,iBAGF,gCACE,oBACA,mBACA,wBACA,8BAEA,wCACE,uBACA,yCACA,oBACA,UACA,gBAEA,+CACE,WACA,qBAGF,gDACE,UAEA,wDACE,UAIJ,0DACE,6BAKN,iCACE,kBAEA,wCACE,WACA,qBACA,YACA,aACA,kBACA,+BACA,2BAIJ,wBACE,eACA,q2B;AClNJ,WACE,aACA,mBACA,WACA,eACA,kBACA,iBAEA,mBACE,6CACA,aACA,mBACA,eACA,mBACA,WACA,eACA,gBACA,6BACA,uDACA,sBACA,gBACA,kCACA,oBACA,0BACA,iBAEA,mFACE,eACA,gBACA,oBAGF,4BACE,aAEA,oCACE,sBACA,iDACA,cACA,eAEA,gDACE,SAKN,0BACE,iCACA,kBACA,UAGF,yBACE,mDAGF,iCACE,cAGF,gCACE,eAIJ,sBACE,mBAGF,2BACE,2BAGF,8BACE,4CACA,WACA,0CACE,0BAGF,qCACE,kBAEA,iDACE,iC;ACrFR,iBACE,kBACA,2BAEA,yBAJF,iBAKI,qCACA,yCACE,qCAEF,8BACE,qCAGF,mCACE,kCACA,2DACE,oCAEF,gDACE,qCAKN,qBACE,2BACA,0CAGF,wBACE,uBACA,0CAGF,+BACE,SACA,sBACA,qBACA,mBACA,mBACA,kBACA,uBAGF,mCACE,uBAKA,sGACE,kBACA,YACA,uBACA,YACA,iBACA,8CACA,qBACA,qBAEA,4KACE,kDACA,gBAGF,0KACE,WAGF,0KACE,aAGF,oVAEE,UAGF,0KACE,aAKF,wHACE,WACA,qBACA,sBAKN,+CACE,kBACA,YACA,uBACA,YACA,cACA,8CACA,iBACA,qBACA,oBAEA,kFACE,kDACA,gBAGF,iFACE,WAGF,iFACE,aAGF,kKAEE,UAGF,iFACE,aAKF,4CACE,WACA,cACA,WAGF,kDACE,oBACA,0BACA,oBAEA,iEACE,oBAMJ,4DACE,qCAEA,kEACE,gCAKN,oCACE,yCAEA,gDACE,8CAGF,mDACE,YAIJ,0CACE,wBACA,mBACA,qBACA,kBAEA,sDACE,mBAIJ,gCACE,mBACA,gBACA,uBACA,yDACA,gBACA,oBACA,0BACA,uBACA,aAEA,6CACE,gBACA,uBAGF,yFAEE,eAEA,qGACE,YAIJ,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,kEACE,0BAGF,sCACE,kBAGF,qCACE,qBACA,gBAGF,0CACE,oBAGF,6CACE,OACA,iBACA,iBACA,gBACA,iBACA,qBACA,6CAEA,0DACE,0BAKN,4BACE,iDAGF,iGAGE,mCAGF,sCACE,+BAEA,yGACE,WACA,qBACA,iCACA,YAIJ,kDACE,wBAGF,+DACE,qBAGF,kDACE,aAGF,+BACE,gBACA,kBACA,kBACA,eACA,gBACA,0BAEA,uCACE,6BAGF,4CAEE,gBAGF,kDAEE,eAKF,iEACE,wBAMA,2DACE,yBACA,UACA,8BAKN,0BACE,yBAGE,4CACE,kDAIJ,8CACE,oBAMF,8IAEE,sBACA,uBAIJ,uBACE,yBAEA,4CACE,iBAIJ,uBACE,gBACA,wCAEA,yBAJF,uBAKI,iBAGF,4CACE,kBAIA,8DACE,yBAKN,2CACE,qBACA,cACA,wBACA,kBACA,sBACA,2BAEA,sDACE,wDACA,kBAIJ,yDACE,gDACA,iDACA,0DAGF,mCACE,4BACA,6BAGF,yCACE,6BAEA,uEACE,oBACA,kBACA,YACA,4BACA,8BACA,gBACA,yCACA,4CAEA,oFACE,kBAIJ,sDACE,mBAOJ,0DACE,aACA,uBACA,mBAEA,kFACE,eAEA,wGACE,yBAKN,8DACE,sBAGF,gdAME,oBACA,qBAEA,4vBACE,sBAIJ,oEACE,sBAGF,sTAIE,mBACA,wBAEA,8fACE,yBAIJ,8EACE,gBAIF,4HAEE,sBAEA,gOACE,sBAIJ,8DACE,aACA,mBACA,uBAEA,oFACE,WACA,mBACA,+CAIJ,gIAEE,kBACA,aACA,mBACA,uBACA,WACA,WACA,yBAEA,wJACE,UAGF,4JACE,aACA,mBACA,uBACA,eACA,gBACA,kBACA,2BAGF,4MACE,6BAEA,wPACE,UAKN,8DACE,iBAGF,kEACE,iBAGF,sKAEE,2BACA,WACA,iBACA,kBACA,cACA,aACA,UACA,kBACA,qBACA,qBACA,0CAGF,wGACE,0BACA,oBACA,oBAIJ,8BACE,gBACA,aACA,eACA,qBAEA,2CACE,mBACA,wBAEA,uDACE,kBAIJ,uCACE,eAGF,6CACE,aACA,uBACA,2BACA,cAEA,+CACE,gBAGF,8DACE,kBACA,4CAEA,yBAJF,8DAKI,8BAGF,yBARF,8DASI,kBACA,UACA,8BAKN,4CACE,mBAGF,2CACE,cACA,eACA,cAEA,uDACE,MACA,OACA,SACA,QAIJ,qCACE,qBACA,kBAEA,gDACE,wDACA,kBAKF,uDACE,gBACA,4EACA,iEACE,+HAIF,oEACE,iBAKN,2CACE,eACA,iBAEA,0DACE,YAGF,yDACE,gBACA,kBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,2CACE,eACA,iBACA,gBACA,yBAJF,2CAKI,oBAGF,wDACE,mBAGF,+DACE,gBAGF,kDACE,WACA,YACA,qBAIJ,2CACE,eACA,mBACA,gBAEA,wDACE,kBAGF,+DACE,gBAGF,kDACE,WACA,YACA,qBAIJ,iDACE,wCACA,0CAGF,2CACE,4CACA,8CAEA,0DACE,mBAEA,2EACE,mBAEA,yBAHF,2EAII,cACA,UACA,gCAOV,mBAmCE,8DACA,+DACA,iEACA,kEArCA,+HAIE,oBAGF,uDACE,kBACA,kBACA,qBAEA,+DACE,WACA,cACA,kBACA,MACA,SACA,cACA,UACA,+BACA,kBAGF,gEACE,6BAEA,wEACE,UACA,eAUN,gCACE,oBACA,gCAIJ,qBACE,qBAGF,kBACE,oCACA,gCACA,sBACA,eACA,qBAEA,2EAGE,qCAIJ,mCAEE,wBACA,gCACA,qBACA,SACA,gBACA,kBACA,0DCnzBF,SACE,aACA,qBACA,sBACA,kBAEA,4CACA,wCACA,gDACA,4DACA,0CACA,mBACA,qCACA,iDACA,+CACA,+BACA,8BACA,kCACA,8HAGA,6BACA,4BAEA,wDACA,yDACA,2DACA,4DAEA,0BA7BF,SA8BI,gCAEF,yBAhCF,SAiCI,sBAGF,mBACE,yCAGF,sBACE,0CAGF,mDAEE,UACA,iCACA,8CAEA,iGACE,2BAIJ,iBACE,kBACA,SACA,OAEA,yBALF,iBAMI,aACA,eAIJ,yBACE,eACA,kBACA,cACA,iBACA,aACA,mBACA,uBACA,mBACA,UACA,uDACA,qBAEA,iCACE,qBAGF,+BACE,uBACA,qBAGF,8CACE,eAIJ,4CACE,4CAGF,6BACE,WACA,aAGF,uBACE,sBACA,yBAFF,uBAGI,wBAIJ,sBAGE,sBAKE,+DACE,wCAIF,2DACE,oBAMJ,6CACE,+DAKF,sDACE,UAIJ,mBACE,oBAEA,gEAEE,eAGF,yBARF,mBASI,sBAEA,gEAEE,qBAIJ,sDACE,iEAGF,4DACE,8DACA,iEAGF,sDACE,8DAGF,iCACE,iEAEA,+DACE,+BAKN,aACE,2BACA,gDACA,4CACA,oDACA,gEACA,8CACA,mBACA,wCACA,yCACA,2CACA,oCACA,0CACA,sCACA,8BACA,4BACA,4CAEA,0BAlBF,aAmBI,mBAGF,oDAEE,0DACA,4DACA,8DAGF,yBA7BF,aA8BI,sBAGF,gDACE,kEAGF,sDACE,+DACA,kEAGF,gDACE,+DAGF,2BACE,kEAEA,yDACE,gCACA,6BAMJ,2EAEE,kDACA,UACA,6DACA,wBAIJ,mBACE,mCAGF,oBACE,qCAEA,8BACE,qCAGF,kCACE,qCAEA,4CACE,qCAKN,6BACE,eAEA,yBAHF,6BAII,2CAIA,+GAEE,6BAIJ,mDACE,WACA,kBACA,aACA,gBACA,WACA,YACA,qCAKA,wIACE,qBAIJ,qDACE,UAKF,6CACE,8BAEA,0DACE,uBAEA,sEACE,8BAON,wDACE,8BAIJ,6HAEE,qDAGF,qIAEE,yDAGF,wCACE,eACA,aAIA,kGACE,yDACA,2BACA,qBAEA,yGACE,+BAKN,eACE,kBAEA,uCACE,kBACA,SACA,UACA,UAIJ,oCACE,kBACA,iDACE,uCAGF,4DACE,kBACA,UACA,aACA,eACA,WAGF,kFAEE,iEAIA,wEACE,8BAGF,0GAEE,6CAOJ,4FACE,8BAGF,wEACE,2BAKF,wDACE,gCAIA,+EACE,gCAKF,gFACE,6BAKF,oEACE,iBAGF,6EACE,gBACA,oCACA,qCAGF,uFACE,YAIJ,2DACE,gBAEA,mEACE,oBAGF,4EACE,uCACA,wCAOA,wPACE,gBAEA,sQACE,WACA,cACA,eACA,uBACA,gBACA,oCACA,kBASA,kSACE,mCACA,qCAEA,gTACE,mCACA,2CAYV,4OACE,4CAIA,4PACE,yDACA,gDAKN,uDACE,iBAGF,+CACE,qDAIA,2DACE,aACA,yBAEA,4EACE,WAMR,iCACE,kBACA,OACA,cACA,aACA,cACA,sBACA,kBACA,wCAEA,aACA,mBACA,uBAEA,WACA,eAEA,UACA,oBACA,4CAEA,8CACE,kBACA,UACA,SACA,mBAGF,6CACE,uBAIJ,iBACE,sBAIA,8GACE,gCAKA,wNAEE,+BACA,gCAKF,gLAGE,mBAIJ,+QAIE,4BACA,6BAGF,qEACE,qBAIJ,gCACE,kBACA,SACA,WACA,gCAEA,UACA,4BAEA,wBATF,gCAUI,sBAGF,mHAGE,4CAMF,oGACE,UAIJ,oCACE,WAGF,0CACE,YAGF,wBACE,WACA,UACA,kBAKJ,sKAME,qDACA,uDACA,2DACA,6DAGF,8BACE,kCAGF,aACE,gBAEA,6BACE,2BAIJ,8CACE,0e;ACtpBF,kBACE,mEACA,sEAEA,mBACA,oBAEA,0BACE,aAGF,oCACE,iBACA,sCACA,gDACA,2B;ACfJ,iBACE,WACA,YACA,aACA,mBACA,uBACA,kBAEA,0BACE,oBACA,sBACA,mBACA,gCACA,cACA,oBACA,qBACA,WAGF,wBACE,gBACA,gBAGF,8BACE,mBACA,gBAGF,0BACE,mBACA,aACA,YACA,eAEA,qCACE,aACA,Y;ACrCN,sBACE,YACA,aACA,mBACA,uBACA,mBAEA,cACE,mBACA,sBAGF,mBACE,sBACA,gCACA,gBACA,oBACA,qBACA,WACA,+BAEA,gBACE,oBAIJ,eACE,eACA,qBACA,kBACA,uBACA,0BAGF,kBACE,SACA,UACA,gBACA,uBACA,8BAGF,kBACE,kBACA,UACA,gBACA,uBACA,gBACA,yCAEA,WACE,wBACA,C;AClDN,aACE,OACA,WACA,oBAEA,gBACA,kBACA,gBAGA,6CAoBA,mE1BxBA,+B0BNF,a1BOI,mBAGA,mB0BEF,oCACE,2BAGF,iCACE,sIAGF,wBApBF,aAqBI,0CACA,2BAEA,gCACE,0CACA,+BAKJ,mCACE,kBACA,+CAEA,2EACE,2BAIJ,yCACE,aAGF,iCACE,WACA,0CACA,gBACA,cACA,aACA,yBACA,sBACA,6BAEA,wDACE,4BAGF,yBAdF,iCAeI,YACA,wBAEA,UAIJ,yBACE,gBAEA,uCACE,mBAIJ,yDAEE,gBAEA,qFACE,uBAEA,yBAHF,qFAII,uBAGF,iHACE,uBAKN,yBACE,+BACE,gBACA,6CACE,sBAEA,yEACE,2DAMR,kDAEE,kBAEA,UACA,mBACA,+CAEA,wEACE,qBACA,UAKF,wEACE,eAGF,kEACE,WACA,kBACA,eACA,kBACA,WACA,YACA,gBACA,WAEA,UACA,4CAEA,gHACE,2BAKF,0GACE,kBAKF,4GACE,eAIJ,kFAEE,2BAOA,wWACE,WAEA,wcACE,WAMR,oBACE,WACA,YACA,aACA,mBACA,uBAEA,yBACE,cACA,gBAGF,sCACE,yBACA,0BAEA,wFAEE,qBAKN,6GAIE,kBACA,0CAEA,iIACE,qBACA,gCACA,WACA,0DACA,gBACA,iBACA,gBACA,4CACA,sBAEA,0WAEE,yDACA,yDAGF,qLACE,2BACA,gDACA,iDACA,0DAKN,0BACE,gBACA,mBACA,6BACA,oBACA,UACA,4BAEA,yBARF,0BASI,iBACA,sBAGF,iEACE,UAEA,sEACE,oBAIJ,iDACE,gBAGF,sCACE,eAGF,+BACE,oBAIJ,sDACE,gBACA,YAGF,0BACE,gBAGF,kDACE,wBAGF,4CACE,uBAGF,+DAEE,iBACA,oBAIA,yCACE,eAEA,+CACE,0BAKN,yCACE,mBAGF,0BA3SF,aA4SI,WACA,+BACA,6CAEA,iCACE,6CAGF,oCACE,gBAGF,qCACE,kEAGF,0NAGE,6CAEA,sRACE,YAKN,yBAvUF,aAwUI,6CAEA,gDACE,+BAGF,sCACE,wGAKF,+CACE,QAIF,iCANF,4BAOI,uBACA,sB;AC7VN,kBACE,wBAEA,kBACA,8BACA,2CACA,UACA,6BACA,6EACA,oCACA,oBAEA,yCACE,0BAEA,wBAGF,yBAlBF,kBAmBI,YACA,cAEA,8CACE,mDAIJ,wBACE,aACA,sBACA,mBAEA,gCACE,iDACA,mCAEA,kCACE,kBAIJ,0BAdF,wBAeI,wBAEA,6CAEA,+CACE,2BAGF,gDACE,4DAIJ,yBACE,gCACE,eACA,iBAKN,2BACE,wBACA,UACA,mBAEA,8DACE,2BAIJ,gCACE,iBACA,cACA,mBACA,qBACA,kBACA,mBACA,gBACA,kBAEA,kBACA,eACA,iBAEA,8BACA,WAEA,oBAEA,yBAnBF,gCAoBI,eACA,YAIJ,yBACE,2CACE,oG;ACnGJ,yBACE,sBACA,gBACA,iDAGF,0BACE,aACA,sBACA,yBACA,gBACA,cAEA,yBAPF,0BAQI,iBAGF,+BACE,aACA,mBAGF,oCACE,mBAGF,kCACE,OACA,WACA,YACA,qBACA,kDACA,sCACA,mCACA,2BACA,gBACA,oBAEA,wCACE,WACA,wCACA,sCAIJ,0CACE,oB;AC/CN,yBACE,gBACA,wDAEA,mEACE,aAGF,oCACE,oBAGF,g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A,cACA,SACA,UACA,oBAEA,2DACE,mCAGF,uCACE,kBAGF,yBAjBF,+BAkBI,eACA,gBAEA,uCACE,wBAIJ,4CACE,sCAGA,0GACE,yCAIJ,yDACE,WACA,kBACA,WACA,cACA,8CACA,uBACA,YACA,aACA,kBACA,qCACA,mEACA,yBAZF,yDAaI,UACA,aAKN,oCACE,YACA,gBAGF,wCACE,qBACA,kBACA,mBACA,cACA,0BACA,sGAEA,+CACE,WACA,aACA,cACA,8BACA,sBACA,kBACA,QACA,qBACA,gBACA,mDAGF,yBArBF,wCAsBI,gBACA,sBAKN,wCAEE,kBAEA,oEACE,+HAEA,gBACA,kBACA,iFACA,uBACA,mBACA,0CAEA,4LAEE,gHAIF,wFACE,gBACA,kBAKA,4OACE,aAIJ,kGACE,oBAIJ,4JAEE,kBACA,gCACA,oBACA,uBACA,mBACA,mBACA,0CACA,8DACA,YACA,mBACA,gBACA,uBACA,eAGF,gFACE,uBACA,OAGF,8FACE,QAGF,4EACE,oCACA,eACA,qBAEA,8QAGE,qCAIJ,0DACE,yDACA,wCACA,oBACA,oCACA,wJAIF,0FACE,yDAGF,sDACE,kBACA,MACA,OACA,UACA,oBACA,YACA,uBACA,mBAIJ,oBACE,YAEA,kCACE,gBACA,kCACA,uBACA,2BACA,2BACA,8BACA,kBACA,iBACA,mBACA,oEACA,qBAUA,6BARA,yBAbF,kCAcI,gBACA,oBACA,iBACA,sEACA,eAKF,yDACE,2BAIJ,8EAEE,8DAEA,yBAJF,8EAKI,iEAKF,mDACE,eACA,gBAMF,+KACE,kBAIJ,2BACE,cACA,eACA,kBACA,iBACA,oBAKF,kCACE,eACA,mBACA,iBAGF,sCACE,gBACA,cAIJ,kBACE,kBACA,0BACA,OACA,WACA,mCACA,4CACA,gBACA,iBAEA,kBACA,gBAGA,iDAEA,UACA,6BACA,wBACA,6E/B5gBA,+B+ByfF,kB/BxfI,mBAGA,mB+B0gBF,8BACE,aAGF,uBACE,UACA,wBAGF,2BACE,cAIJ,sCACE,KACE,UAEF,GACE,gC;ACziBJ,kBACE,kBACA,MACA,OACA,SACA,QACA,gBACA,WACA,+CAEA,yBACE,WACA,kBACA,MACA,OACA,SACA,QACA,+CACA,2BACA,4BACA,sBAEA,4DACE,uEAGF,gDACE,gBAGF,sCACE,yDAEA,yBAHF,sCAII,0DAKN,gEACE,UAGF,0CACE,qDACA,YACA,qBAGF,kDACE,kBAGF,sCACE,gDACE,6BACA,gBACA,mBACA,6BACA,6CAGF,4GACE,kCAKF,sCADF,4GAEI,iCAGF,sCALF,4GAMI,kCAKN,cACE,aACA,uBACA,YACA,kBACA,UACA,YAEA,yBARF,cASI,iBAGF,+BACE,wDAEA,aACA,sBACA,mBACA,WACA,YACA,kBACA,gBAEA,2CACE,WACA,YACA,gBAEA,+CACE,aACA,sBACA,mBAMJ,yCACE,kCACA,kGAEA,iDACE,mCACA,8CAIA,wIAEE,2BAKN,+EAEE,UACA,4CAEA,6HACE,2BAIJ,gCACE,UACA,mBACA,gHAGA,uDACE,2BAIJ,2EAEE,oBAIA,6DACE,SAGF,qDACE,6FACA,yDAEA,6DACE,sCAIJ,2DACE,yBAEA,yBAHF,2DAII,0BAIJ,uGAEE,UAGF,4CACE,qBACA,qBAKN,kCACE,oBACA,8CAEA,iEACE,UACA,4CAEA,wFACE,2BAIJ,yDACE,2BAGF,8CACE,kDACA,oBAEA,6EACE,UAIJ,wCACE,WACA,aACA,4CACA,mCACA,kCACA,kBACA,iDAIJ,oCACE,WACA,0CACA,eACA,kBACA,aACA,qBACA,+BAEA,+BACA,uDAEA,2DACE,2BAGF,0BAhBF,oCAiBI,6CAEA,4DACE,mEAIJ,yBAxBF,oCAyBI,gBAEA,6DACE,wGAIJ,sDACE,2CACA,MAEA,4EACE,gCAIJ,4CACE,WACA,kBACA,eACA,OACA,QACA,WACA,qJAOA,UACA,8BAEA,yBAjBF,4CAkBI,SACA,WAIJ,uDACE,UAGF,4DACE,qJAYN,oDAGE,sBAEA,yBALF,oDAMI,qBAIJ,6FAK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ACA,kBAEA,oDACE,oBAEA,6DACE,0BAIJ,mDACE,aACA,uBACA,mBAEA,sDACE,gBACA,kBACA,iBACA,qBACA,sBAGF,iEACE,mBACA,oBAGF,0DACE,aACA,cACA,uBAIJ,oDACE,kBACA,cAKN,qBACE,kBACA,MACA,OACA,QACA,SACA,8BACA,gBACA,kBACA,oBAEA,0BAXF,qBAYI,gBAGF,+BACE,aAGF,uCACE,kBACA,MACA,QACA,SACA,OACA,WACA,gBACA,UAEA,yBAVF,uCAWI,2CAEA,8DACE,iBAKN,8FAEE,mBAIA,yBACE,+DACE,uCAIJ,0DACE,oBACA,+B;AClIN,MACE,YACA,gBACA,gBAEA,0BALF,MAMI,mBAGF,yBATF,MAUI,iCAGF,yBAbF,MAcI,aACA,+BACA,yBAIJ,uBACE,iCACA,oHACE,yBACA,gBAIJ,YACE,gBACA,WACA,kBACA,YACA,kBAEA,gBACE,YACA,gBAGF,yBAZF,YAaI,iCAGF,yBAhBF,YAiBI,gBAGF,0BApBF,YAqBI,WACA,gBAGF,yBAzBF,YA0BI,eACA,OACA,MACA,gCACA,yBAEA,mCACA,6CAEA,mCACE,gBAGF,mBACE,WACA,cACA,kBACA,OACA,MACA,QACA,SACA,gBACA,sCACA,2CACA,UAEA,0CACE,gBAIF,mCACE,aAGF,wDACE,cAIJ,2CACE,+BAEA,kDACE,UACA,oBAIJ,6CACE,gBAEA,mDACE,iBAKN,yBApFF,YAqFI,eACA,mCACA,0CACA,0DAKF,yBADF,aAEI,uCAGF,8CACE,gBAEA,gEACE,gBAKN,mDACE,gBAGF,cACE,2CAEA,yBAHF,cAII,eACA,eACA,OACA,MACA,SACA,QAEA,+BACA,6CAEA,qCACE,gBAGF,6CACE,sCAIJ,yBAvBF,cAwBI,iBAEA,6CACE,mCAGF,sCACE,oCAIJ,+CACE,gBAEA,qDACE,gBAKN,kCACE,sCAEA,6IACE,6EAIA,gFACE,aAKF,+EACE,kCACA,UAKF,uEACE,+BACA,UAKF,8EACE,aAKF,6EACE,kCACA,UAKF,wEACE,+BACA,U","sources":["webpack://telegram-t/./src/components/left/ConnectionStatusOverlay.scss","webpack://telegram-t/./src/components/left/main/LeftMainHeader.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/left/NewChatButton.scss","webpack://telegram-t/./src/components/left/main/LeftMain.scss","webpack://telegram-t/./src/components/left/LeftColumn.scss","webpack://telegram-t/./src/components/middle/AudioPlayer.scss","webpack://telegram-t/./src/components/calls/group/GroupCallTopPane.scss","webpack://telegram-t/./src/components/middle/MiddleHeader.scss","webpack://telegram-t/./src/components/common/EmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/message/ReactionAnimatedEmoji.scss","webpack://telegram-t/./src/components/middle/message/MessageMeta.scss","webpack://telegram-t/./src/components/middle/message/Sticker.scss","webpack://telegram-t/./src/components/middle/message/Contact.scss","webpack://telegram-t/./src/components/middle/message/PollOption.scss","webpack://telegram-t/./src/components/middle/message/Poll.scss","webpack://telegram-t/./src/components/middle/message/WebPage.scss","webpack://telegram-t/./src/components/middle/message/Invoice.scss","webpack://telegram-t/./src/components/middle/message/Album.scss","webpack://telegram-t/./src/components/middle/message/RoundVideo.scss","webpack://telegram-t/./src/components/middle/message/InlineButtons.scss","webpack://telegram-t/./src/components/middle/message/CommentButton.scss","webpack://telegram-t/./src/components/middle/message/Reactions.scss","webpack://telegram-t/./src/components/middle/message/_message-content.scss","webpack://telegram-t/./src/components/middle/message/Message.scss","webpack://telegram-t/./src/components/middle/message/SponsoredMessage.scss","webpack://telegram-t/./src/components/middle/ContactGreeting.scss","webpack://telegram-t/./src/components/middle/NoMessages.scss","webpack://telegram-t/./src/components/middle/MessageList.scss","webpack://telegram-t/./src/components/middle/ScrollDownButton.scss","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.scss","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.scss","webpack://telegram-t/./src/components/middle/composer/Composer.scss","webpack://telegram-t/./src/components/middle/MiddleColumn.scss","webpack://telegram-t/./src/components/right/RightHeader.scss","webpack://telegram-t/./src/components/right/Profile.scss","webpack://telegram-t/./src/components/right/AddChatMembers.scss","webpack://telegram-t/./src/components/right/RightColumn.scss","webpack://telegram-t/./src/components/main/Main.scss"],"sourcesContent":[".connection-state-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n\n transition: transform 300ms ease, opacity 300ms ease;\n opacity: 1;\n\n &:not(.open) {\n transform: translateY(-3rem);\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n}\n\n#ConnectionStatusOverlay {\n height: 2.9375rem;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin: 0.375rem 0.5rem;\n padding: 0 0.75rem;\n background: var(--color-yellow);\n border-radius: var(--border-radius-default);\n\n &.interactive {\n cursor: pointer;\n }\n\n > .Spinner {\n --spinner-size: 1.75rem;\n }\n\n > .state-text {\n flex: 1;\n color: var(--color-text-lighter);\n font-size: 0.9375rem;\n font-weight: 500;\n padding-bottom: 0.0625rem;\n margin-inline-start: 1.875rem;\n white-space: nowrap;\n }\n\n @media (max-width: 950px) {\n > .state-text {\n margin-inline-start: 1.25rem;\n }\n }\n\n .Transition {\n width: 100%;\n // https://dfmcphee.com/flex-items-and-min-width-0/\n // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size\n min-width: 0;\n\n > div {\n display: flex;\n align-items: center;\n width: 100%;\n }\n }\n}\n","@import \"../../../styles/mixins\";\n\n#LeftMainHeader {\n position: relative;\n\n .animated-menu-icon {\n position: absolute;\n\n &,\n &::before,\n &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform 0.25s;\n transform: rotate(0);\n }\n\n &::before,\n &::after {\n position: absolute;\n left: 0;\n content: \"\";\n }\n\n &::before {\n top: -0.3125rem;\n }\n\n &::after {\n top: 0.3125rem;\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0.375rem, -0.1875rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0.375rem, 0.1875rem);\n }\n }\n\n &.no-animation {\n transition: none;\n\n &::before,\n &::after {\n transition: none;\n }\n }\n }\n\n .archived-badge {\n min-width: 1.5rem;\n height: 1.5rem;\n margin-left: auto;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 0.4375rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n }\n\n .MenuItem.compact .archived-badge {\n background: none;\n padding: 0;\n color: var(--color-text-secondary);\n }\n\n .MenuItem.compact .Switcher {\n transform: scale(0.75);\n }\n\n [dir=\"rtl\"] .archived-badge {\n margin-left: 0;\n margin-right: auto;\n }\n\n .Menu .bubble {\n min-width: 17rem;\n max-height: calc(100 * var(--vh) - 3.75rem);\n\n overflow-y: auto;\n @include overflow-y-overlay();\n }\n\n // @optimization\n @include while-transition() {\n .Menu .bubble {\n transition: none !important;\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n",".NewChatButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(5rem);\n\n transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transform: none !important;\n opacity: 0;\n\n transition: opacity 0.15s;\n\n &.revealed {\n opacity: 1;\n }\n }\n\n &.revealed {\n transform: translateY(0);\n\n @media (max-width: 600px) {\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0, 0, 0.625rem);\n transform-style: preserve-3d;\n }\n }\n\n > .Button {\n .icon-new-chat-filled,\n .icon-close {\n position: absolute;\n }\n\n &:not(.active) {\n .icon-new-chat-filled {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-close {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.active {\n .icon-close {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-new-chat-filled {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n }\n}\n","#LeftColumn-main {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n z-index: 1;\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n }\n\n .ChatFolders {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .tabs-placeholder {\n height: 2.625rem;\n transition: height 150ms ease;\n\n &:not(.open) {\n height: 0;\n }\n }\n\n .TabList {\n justify-content: flex-start;\n padding-left: 0.5625rem;\n padding-bottom: 1px;\n border-bottom: 0;\n z-index: 1;\n }\n\n .Tab {\n flex: 0 0 auto;\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n\n > span {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n }\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n }\n }\n\n .RecentContacts,\n .LeftSearch,\n .search-content {\n height: 100%;\n overflow-y: auto;\n }\n\n .btn-update {\n position: absolute;\n bottom: 1rem;\n left: 1rem;\n right: 1rem;\n margin: 0 auto;\n }\n}\n","#NewChat {\n height: 100%;\n}\n\n.left-header {\n height: var(--header-height);\n padding: 0.375rem 1rem 0.5rem 0.8125rem;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n background-color: var(--color-background);\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n margin-right: auto;\n }\n\n .SearchInput {\n margin-left: 0.875rem;\n max-width: calc(100% - 3.25rem);\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3rem);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n\n + .DropdownMenu {\n margin-left: 0.25rem;\n }\n }\n}\n",".AudioPlayer {\n display: flex;\n margin-left: auto;\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n > .Button {\n flex-shrink: 0;\n margin: 0.125rem;\n }\n\n > .player-button {\n --color-text-secondary: var(--color-primary);\n --color-text-secondary-rgb: var(--color-primary-shade-rgb);\n --color-primary-shade: var(--color-green);\n --color-white: var(--color-background-own);\n }\n\n .player-button {\n &.smaller {\n width: 3rem;\n height: 3rem;\n\n i {\n font-size: 1.625rem;\n margin-top: -0.0625rem;\n }\n }\n\n i {\n position: absolute;\n font-size: 1.9375rem;\n margin-top: -0.0625rem;\n\n &.icon-play {\n margin-left: 0.125rem;\n }\n }\n\n .icon-play,\n .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.4s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(0.5);\n }\n }\n\n .volume-button {\n position: relative;\n overflow: visible;\n\n .volume-slider-spacer {\n position: absolute;\n transform: translateY(100%);\n bottom: 0;\n height: 1rem;\n width: 8rem;\n cursor: default;\n visibility: hidden;\n }\n\n &:hover .volume-slider-spacer,\n .volume-slider-spacer:hover {\n visibility: visible;\n }\n\n .volume-slider {\n opacity: 0;\n visibility: hidden;\n\n position: absolute;\n background: var(--color-background);\n bottom: -1rem;\n transform: translateY(100%);\n transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;\n width: 8rem;\n padding: 0.75rem;\n border-radius: 0.5rem;\n cursor: default;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n .RangeSlider {\n margin-bottom: 0;\n input[type=\"range\"] {\n margin-bottom: 0;\n }\n }\n }\n\n &:hover .volume-slider,\n .volume-slider:hover,\n .volume-slider-spacer:hover + .volume-slider {\n opacity: 1;\n visibility: visible;\n }\n }\n\n .playback-button {\n &.applied {\n --color-text-secondary: var(--color-primary);\n }\n\n .playback-button-inner {\n transition: 0.2s color ease-in-out;\n font-size: 0.75rem;\n font-weight: bold;\n border: 2px solid;\n border-radius: 0.375rem;\n padding: 0.125rem 0.25rem;\n font-variant-numeric: tabular-nums;\n }\n }\n\n &-content {\n display: flex;\n justify-content: center;\n flex-direction: column;\n flex-shrink: 1;\n padding: 0 0.5rem;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n border-radius: var(--border-radius-messages-small);\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .AudioPlayer & .title {\n display: block;\n font-weight: 500;\n font-size: 0.875rem !important;\n line-height: 1rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n body.is-ios & {\n font-size: 0.9375rem !important;\n line-height: 1.125rem;\n }\n }\n\n .subtitle {\n font-size: 0.8125rem !important;\n color: var(--color-text-secondary);\n line-height: 0.8125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0.125rem 0 0;\n\n body.is-ios & {\n font-size: 0.9375rem !important;\n line-height: 1.125rem;\n }\n }\n }\n}\n",".GroupCallTopPane {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 2.875rem;\n overflow: hidden;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 0.375rem 0.5rem 0.375rem 0.75rem;\n background: var(--color-background);\n z-index: -1;\n cursor: pointer;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -0.1875rem;\n left: 0;\n right: 0;\n height: 0.125rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n }\n\n &.is-hidden {\n display: none;\n }\n\n @media (max-width: 600px) {\n &.has-pinned-offset {\n top: calc(100% + 2.875rem);\n }\n }\n\n .info {\n display: flex;\n flex-direction: column;\n\n .title {\n font-size: 0.875rem;\n color: var(--color-text);\n }\n\n .participants {\n font-size: 0.75rem;\n color: var(--color-text-secondary);\n }\n }\n\n .avatars {\n display: flex;\n flex-direction: row;\n align-items: center;\n\n .Avatar {\n margin: 0 0 0 -0.75rem;\n\n &:first-child {\n width: 2rem;\n height: 2rem;\n }\n\n &:not(:first-child) {\n width: 2.25rem;\n height: 2.25rem;\n border: 0.125rem solid var(--color-background);\n }\n }\n }\n\n .join {\n height: 1.5rem;\n border-radius: 1.5rem;\n font-weight: 500;\n padding: 1rem 1rem;\n width: auto;\n }\n}\n\n@media (min-width: 1440px) {\n #Main.right-column-open .MiddleHeader .GroupCallTopPane {\n width: calc(100% - var(--right-column-width));\n }\n}\n","@import \"../../styles/mixins\";\n\n@mixin mobile-header-styles() {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 2.875rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n\n display: flex;\n flex-direction: row-reverse;\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n padding-left: max(0.75rem, env(safe-area-inset-left));\n padding-right: max(0.5rem, env(safe-area-inset-right));\n background: var(--color-background);\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -0.1875rem;\n left: 0;\n right: 0;\n height: 0.125rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n }\n\n .HeaderPinnedMessage {\n max-width: unset;\n margin-top: -0.1875rem;\n }\n }\n\n .AudioPlayer {\n flex-direction: row;\n margin-top: 0;\n padding: 0.25rem 0.5rem;\n\n &-content {\n padding: 0 0.5rem;\n flex-grow: 1;\n }\n\n > .Button {\n margin: -0.0625rem 0 0;\n }\n\n > .player-close {\n margin-left: auto;\n }\n }\n\n .HeaderPinnedMessage {\n flex-grow: 1;\n padding-top: 0;\n padding-bottom: 0;\n\n &::before {\n top: 0.125rem;\n bottom: 0.125rem;\n }\n\n .message-text {\n max-width: none;\n }\n }\n\n .HeaderPinnedMessage-wrapper.full-width {\n display: none;\n }\n}\n\n.MiddleHeader {\n display: flex;\n align-items: center;\n width: 100%;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background: var(--color-background);\n position: relative;\n z-index: var(--z-middle-header);\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: max(1.5rem, env(safe-area-inset-left));\n padding-right: max(0.8125rem, env(safe-area-inset-right));\n\n @media (max-width: 600px) {\n position: relative;\n\n padding-left: max(0.5rem, env(safe-area-inset-left));\n padding-right: max(0.5rem, env(safe-area-inset-right));\n }\n\n .Transition {\n width: 100%;\n // https://dfmcphee.com/flex-items-and-min-width-0/\n // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size\n min-width: 0;\n\n > div {\n display: flex;\n align-items: center;\n width: 100%;\n }\n }\n\n .back-button {\n margin-left: -0.5rem;\n margin-right: 0.5rem;\n position: relative;\n\n @media (max-width: 600px) {\n margin-left: 0;\n }\n\n .unread-count {\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.375rem;\n border-radius: 0.625rem;\n font-size: 0.75rem;\n line-height: 1.25rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.25rem;\n right: -0.5rem;\n\n background: var(--color-gray);\n color: white;\n pointer-events: none;\n\n &.active {\n background: var(--color-primary);\n }\n }\n }\n\n .chat-info-wrapper {\n flex-grow: 1;\n overflow: hidden;\n }\n\n body.animation-level-0 & .HeaderPinnedMessage-wrapper {\n transition: none !important;\n }\n\n .header-tools {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-left: auto;\n flex-shrink: 0;\n\n body.animation-level-0 & {\n &,\n .AudioPlayer,\n .HeaderActions {\n transition: none !important;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n .HeaderActions {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n }\n\n @media (min-width: 1440px) {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n\n // @optimization\n @include while-transition() {\n pointer-events: none;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n &:not(.tools-stacked) .HeaderPinnedMessage-wrapper,\n &:not(.tools-stacked) .AudioPlayer {\n opacity: 1;\n\n #Main.right-column-open & {\n opacity: 0;\n }\n }\n }\n\n &.tools-stacked .AudioPlayer {\n @include mobile-header-styles();\n\n @media (min-width: 1150px) {\n #Main.right-column-open & {\n padding-right: calc(0.5rem + var(--right-column-width));\n }\n }\n }\n\n &.tools-stacked.animated .HeaderPinnedMessage-wrapper,\n &.tools-stacked.animated .AudioPlayer {\n animation: fade-in var(--layer-transition) forwards;\n\n body.animation-level-0 & {\n animation: none;\n }\n }\n\n h3 {\n font-weight: 500;\n font-size: 1.125rem;\n line-height: 1.375rem;\n white-space: pre;\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n unicode-bidi: plaintext;\n\n body.is-ios &,\n body.is-macos & {\n font-size: 1.0625rem;\n font-weight: 600;\n }\n\n @media (max-width: 600px) {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n\n .ChatInfo {\n cursor: pointer;\n display: flex;\n align-items: center;\n\n .info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title {\n display: flex;\n align-items: center;\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n margin-top: 0.0625rem;\n }\n }\n\n .status,\n .typing-status {\n display: inline;\n unicode-bidi: plaintext;\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n\n .user-status {\n unicode-bidi: plaintext;\n overflow: hidden;\n text-overflow: ellipsis;\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n }\n\n .Avatar {\n margin-right: 0.625rem;\n // TODO For some reason webpack imports `Audio.scss` second time when loading calls bundle\n width: 2.5rem !important;\n height: 2.5rem !important;\n font-size: 1.0625rem;\n }\n\n .status,\n .typing-status {\n font-size: 0.875rem;\n line-height: 1.125rem;\n margin: 0;\n color: var(--color-text-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n\n .ellipsis {\n display: inline-flex;\n }\n\n &.online {\n color: var(--color-primary);\n }\n\n .font-emoji {\n line-height: 1rem;\n }\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n .HeaderPinnedMessage-wrapper {\n display: flex;\n align-items: center;\n margin-left: auto;\n cursor: default;\n flex-direction: row-reverse;\n background: var(--color-background);\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translate3d(0, 0, 0);\n transition: opacity 0.15s ease, transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n\n .HeaderPinnedMessage {\n min-width: 16rem;\n }\n\n > .Button {\n flex-shrink: 0;\n }\n\n &.full-width {\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n background: var(--color-background);\n padding: 0.25rem 0.8125rem 0.25rem 1rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n transform: translate3d(0, 0, 0);\n transition: opacity 0.15s ease, transform var(--layer-transition);\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -0.1875rem;\n left: 0;\n right: 0;\n height: 0.125rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n }\n\n .HeaderPinnedMessage {\n margin-top: 0;\n margin-bottom: 0;\n flex: 1;\n\n .message-text {\n max-width: none;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translate3d(0, 0, 0);\n transition: opacity 0.15s ease, transform var(--layer-transition);\n\n #Main.right-column-open & {\n padding-left: calc(var(--right-column-width) + 1rem);\n }\n }\n }\n }\n\n .HeaderPinnedMessage {\n display: flex;\n flex-shrink: 1;\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n padding: 0.25rem;\n padding-left: 0.375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n .pinned-message-border {\n position: relative;\n height: 2.25rem;\n margin: 0.125rem 0;\n width: 0.125rem;\n min-width: 0.125rem;\n overflow: hidden;\n\n .pinned-message-border-wrapper-1 {\n height: 2.25rem;\n width: 0.125rem;\n border-radius: 0.0625rem;\n background: var(--color-primary);\n }\n\n .pinned-message-border-wrapper {\n background-color: var(--color-primary-opacity);\n position: relative;\n will-change: transform;\n transition: transform 0.25s ease-in-out;\n }\n\n .pinned-message-border-mark {\n position: absolute;\n left: 0;\n top: 0;\n width: 0.125rem;\n background: var(--color-primary);\n border-radius: 0.0625rem;\n will-change: transform;\n transition: transform 0.25s ease-in-out;\n }\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n max-width: 15rem;\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .title {\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 1rem;\n color: var(--color-primary);\n margin-bottom: 0.125rem;\n white-space: pre;\n text-align: initial;\n\n body.is-ios & {\n font-size: 0.9375rem;\n }\n }\n\n p {\n font-size: 0.875rem;\n line-height: 1.125rem;\n height: 1.125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n\n body.is-ios & {\n font-size: 0.9375rem;\n }\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n }\n\n & > img {\n width: 2.25rem;\n height: 2.25rem;\n object-fit: cover;\n border-radius: 0.25rem;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n flex-shrink: 0;\n\n & + .message-text {\n max-width: 12rem;\n }\n }\n }\n\n .HeaderActions {\n flex-shrink: 0;\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n .toggle-right-pane-button {\n &.active {\n color: var(--color-primary);\n opacity: 1;\n }\n }\n\n .badge-button {\n position: relative;\n overflow: visible;\n }\n\n .badge {\n position: absolute;\n min-width: 1rem;\n height: 1rem;\n background: var(--color-primary);\n border-radius: 0.5rem;\n color: white;\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n right: 0;\n top: 0;\n }\n }\n\n .HeaderPinnedMessage-wrapper,\n .HeaderActions {\n .Button {\n margin-left: 0.25rem;\n\n &.tiny {\n margin-right: 0.625rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n @include mobile-header-styles();\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".EmbeddedMessage {\n display: flex;\n align-items: center;\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n line-height: 1.125rem;\n margin: 0 -0.25rem 0.0625rem;\n padding: 0.1875rem 0.25rem 0.1875rem 0.4375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n direction: ltr;\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n .custom-shape & {\n max-width: 15rem;\n padding: 0.5rem;\n margin: 0;\n background-color: var(--background-color);\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n &::before {\n left: 0.625rem;\n top: 0.625rem;\n bottom: 0.625rem;\n }\n\n img:not(.emoji) {\n margin-inline-start: 0.5rem;\n }\n\n &:dir(rtl) {\n padding: 0.5rem;\n }\n }\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0.3125rem;\n bottom: 0.3125rem;\n left: 0.3125rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:hover {\n background-color: var(--hover-color);\n }\n\n &:active {\n background-color: var(--active-color);\n }\n\n .message-title {\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.5rem;\n display: flex;\n flex-direction: column-reverse;\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.125rem;\n flex: 1;\n display: block;\n }\n\n p {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n height: 1.125rem;\n margin-bottom: 0;\n flex: 1;\n\n &::after {\n content: none;\n display: none;\n }\n }\n\n .emoji {\n width: calc(1.125 * var(--message-text-size, 1rem)) !important;\n height: calc(1.125 * var(--message-text-size, 1rem)) !important;\n vertical-align: text-bottom !important;\n }\n }\n\n .embedded-action-message {\n color: var(--accent-color);\n opacity: 0.75;\n }\n\n img:not(.emoji) {\n width: 2rem;\n height: 2rem;\n object-fit: cover;\n border-radius: 0.25rem;\n margin-left: 0.25rem;\n flex-shrink: 0;\n\n &.round {\n border-radius: 1rem;\n }\n }\n\n &.inside-input {\n padding-inline-start: 0.5625rem;\n margin: 0 0 -0.125rem -0.1875rem;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr;\n width: 100%;\n --accent-color: var(--color-primary);\n --hover-color: var(--color-interactive-element-hover);\n\n &::before {\n bottom: 0.3125rem;\n }\n\n img:not(.emoji) {\n margin-left: 0.125rem;\n }\n\n .message-text {\n margin-inline-start: 0.375rem;\n }\n\n .message-title {\n font-weight: 500;\n color: var(--accent-color);\n }\n }\n}\n",".ReactionAnimatedEmoji {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &.is-animating {\n // Fix for redundant scroll on iOS\n transform: translateZ(0);\n // Fix for redundant scroll in Firefox\n contain: layout;\n }\n\n .AnimatedSticker {\n position: fixed;\n top: -0.375rem;\n left: -0.375rem;\n pointer-events: none;\n\n &.effect {\n top: -2.5rem;\n left: -2.5rem;\n }\n\n &:not(.open) {\n opacity: 1 !important;\n }\n\n &.closing {\n opacity: 0 !important;\n }\n }\n\n &.in-meta {\n .AnimatedSticker {\n top: -0.4375rem;\n left: -0.4375rem;\n\n &.effect {\n top: -2.5625rem;\n left: -2.5625rem;\n }\n\n // Fix for weird positioning in Chrome\n canvas {\n position: absolute;\n }\n }\n }\n}\n",".MessageMeta {\n position: absolute;\n height: 1.25rem;\n bottom: 0;\n right: 0;\n display: flex;\n align-items: center;\n background: rgba(#999999, 0.6);\n border-radius: 0.625rem;\n padding: 0 0.25rem;\n color: white;\n cursor: pointer;\n max-width: 100%;\n user-select: none;\n\n .ReactionAnimatedEmoji {\n width: 1rem;\n height: 1rem;\n margin-right: 0.25rem;\n }\n\n .message-time,\n .message-signature,\n .message-views {\n font-size: 0.75rem;\n white-space: nowrap;\n }\n\n .message-time {\n margin-right: 0.1875rem;\n }\n\n body.is-ios & {\n .message-time {\n margin-right: 0.25rem;\n }\n }\n\n .message-views {\n margin-inline-start: 0.1875rem;\n }\n\n .message-signature {\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 0.375rem;\n }\n\n .icon-channelviews {\n margin-left: 0.125rem;\n margin-right: 0.375rem;\n font-size: 1.125rem;\n position: relative;\n top: -0.0625rem;\n }\n\n .has-solid-background & {\n color: rgba(var(--color-text-meta-rgb), 0.75);\n background: none;\n }\n\n .media:not(.text) &,\n .Message .custom-shape & {\n background: rgba(0, 0, 0, 0.2);\n --color-accent-own: white;\n --color-accent: white;\n color: white !important;\n opacity: 1;\n bottom: 0.25rem;\n right: 0.25rem;\n left: auto;\n height: 1.125rem;\n padding: 0 0.3125rem 0 0.375rem;\n\n .MessageOutgoingStatus i {\n background: transparent;\n }\n }\n\n .media:not(.text):dir(rtl) &,\n .Message .custom-shape:dir(rtl) & {\n right: auto !important;\n left: 0.25rem;\n padding: 0 0.375rem 0 0.3125rem;\n }\n\n .is-forwarded.media:not(.text):dir(rtl) &,\n .Message .is-forwarded.custom-shape:dir(rtl) & {\n left: 0.8125rem;\n }\n\n .is-forwarded.media:not(.text) & {\n bottom: 0.9375rem;\n right: 0.8125rem;\n }\n\n .emoji-only & {\n right: 0;\n }\n\n .Message.own .has-solid-background & {\n color: var(--color-message-meta-own);\n }\n\n .MessageOutgoingStatus {\n margin-left: -0.1875rem;\n font-size: 1.1875rem;\n border-radius: 0.625rem;\n\n .Message.own & {\n color: var(--color-accent-own);\n }\n }\n\n .message-content.has-replies:not(.custom-shape) & {\n bottom: 3.375rem;\n }\n\n .message-content.has-replies.text:not(.custom-shape) & {\n bottom: 3.4375rem;\n }\n\n &[dir=\"rtl\"] {\n .message-views {\n order: 10;\n }\n .icon-channelviews {\n order: 9;\n }\n }\n}\n\n.Message:not(.own) {\n .custom-shape .reply-message + .MessageMeta {\n right: auto;\n left: 13.25rem;\n bottom: 0.25rem;\n }\n\n .emoji-only-1 .reply-message + .MessageMeta {\n left: 2.5rem;\n }\n\n .emoji-only-2 .reply-message + .MessageMeta {\n left: 5.5rem;\n }\n\n .emoji-only-3 .reply-message + .MessageMeta {\n left: 6.5rem;\n }\n}\n",".Sticker {\n &:not(.inactive) {\n cursor: pointer;\n }\n\n &.inactive {\n pointer-events: none;\n }\n}\n",".Contact {\n display: flex;\n align-items: center;\n padding: 0.25rem;\n\n &.interactive {\n cursor: pointer;\n }\n\n .Avatar {\n margin-right: 0.8125rem;\n }\n\n .contact-info {\n padding: 0.5rem;\n padding-left: 0;\n white-space: nowrap;\n overflow: hidden;\n\n .contact-name {\n font-size: 1rem;\n line-height: 1rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n }\n\n .contact-phone {\n line-height: 1rem;\n color: var(--secondary-color);\n }\n }\n}\n\n\n",".PollOption {\n display: flex;\n flex-flow: row nowrap;\n margin-bottom: 0.75rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .poll-option-text {\n word-break: break-word;\n }\n\n .poll-option-share {\n position: relative;\n margin-top: 0.125rem;\n width: 1.75rem;\n margin-inline-end: 0.5rem;\n flex-shrink: 0;\n font-weight: 500;\n font-size: 0.875rem;\n text-align: right;\n\n &.limit-width {\n display: inline-flex;\n justify-content: center;\n font-size: 0.75rem;\n }\n }\n\n .poll-option-chosen {\n position: absolute;\n right: 0;\n bottom: -5px;\n width: 1rem;\n height: 1rem;\n background: var(--accent-color);\n color: var(--background-color);\n border-radius: 0.5rem;\n font-size: 0.75rem;\n text-align: center;\n\n &.wrong {\n background: var(--color-error);\n }\n\n .is-forwarded & > i {\n margin-left: 1px;\n }\n\n &.animate {\n opacity: 0;\n animation-name: PollOptionIconAnimate;\n animation-delay: 0.09s;\n animation-duration: 0.3s;\n animation-fill-mode: forwards;\n }\n }\n\n .poll-option-right {\n flex-grow: 1;\n line-height: 1.5rem;\n }\n\n .poll-option-answer {\n position: relative;\n }\n\n .poll-option-line {\n position: relative;\n width: 0;\n height: 0.25rem;\n min-width: 0.5rem;\n border-radius: 0.125rem;\n margin-top: 0.5rem;\n background: var(--accent-color);\n\n transform-origin: 0 0;\n transition: transform 0.3s;\n transition-delay: 0.09s;\n }\n\n .poll-line {\n width: 30px;\n height: 35px;\n position: absolute;\n left: -27px;\n bottom: -5px;\n transition: stroke-dashoffset 0.3s, stroke-dasharray 0.3s;\n stroke-dashoffset: 0;\n stroke-dasharray: 0, 200%;\n }\n\n .poll-line path {\n stroke-width: 4px;\n stroke-linecap: round;\n stroke: var(--accent-color);\n fill: none;\n }\n\n .wrong {\n .poll-option-line {\n background: var(--color-error);\n }\n\n .poll-line path {\n stroke: var(--color-error);\n }\n }\n}\n\n@keyframes PollOptionIconAnimate {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n",".Poll {\n min-width: 15rem;\n text-align: initial;\n\n @media (max-width: 600px) {\n min-width: 50vw;\n }\n\n .poll-question {\n font-weight: 500;\n line-height: 1.25rem;\n margin: 0.125rem 0;\n word-break: break-word;\n }\n\n .poll-type,\n .poll-voters-count {\n color: var(--secondary-color);\n font-size: 0.875rem;\n }\n\n .poll-type {\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n min-height: 1.375rem;\n }\n\n .poll-voters-count {\n margin: 0.4375rem 0 1.125rem;\n text-align: center;\n }\n\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 1rem;\n }\n\n .Checkbox,\n .Radio {\n padding-left: 2.25rem;\n\n &:last-child {\n margin-bottom: 0.75rem;\n }\n\n &.disabled {\n opacity: 1 !important;\n cursor: not-allowed;\n }\n\n .Checkbox-main,\n .Radio-main {\n &::before {\n left: 0.125rem;\n background-color: var(--background-color);\n\n .theme-dark & {\n --color-borders: var(--color-borders-input);\n }\n\n .Message.own & {\n --color-borders: var(--accent-color);\n }\n }\n\n &::after {\n left: 0.4375rem;\n background-color: var(--accent-color);\n }\n }\n\n input:checked ~ .Radio-main,\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--accent-color);\n }\n }\n\n .Spinner {\n left: 0.125rem;\n }\n }\n\n .Checkbox {\n .Checkbox-main {\n &::after {\n left: 0.125rem;\n background-color: var(--color-primary);\n\n .Message.own & {\n background-color: var(--accent-color);\n }\n }\n }\n }\n\n .Spinner > div {\n // gray spinner\n background-image: var(--spinner-gray-data);\n\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n\n .Message.own & {\n // green spinner\n background-image: var(--spinner-green-data);\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n }\n }\n\n .poll-recent-voters {\n display: inline-flex;\n align-items: center;\n vertical-align: text-bottom;\n margin-left: 0.875rem;\n margin-right: 0.5rem;\n margin-top: -2px;\n\n .Avatar {\n border: 0.0625rem solid var(--color-white);\n margin-right: 0;\n box-sizing: content-box;\n\n .Message.own & {\n border: 0.0625rem solid var(--secondary-color);\n }\n\n &:not(:first-child) {\n margin-left: -3px;\n }\n }\n }\n\n .poll-countdown {\n margin-left: auto;\n font-size: 0.75rem;\n transition: color 0.2s;\n\n &.hurry-up {\n color: var(--color-error);\n\n .poll-countdown-progress {\n stroke: var(--color-error);\n }\n }\n\n svg {\n vertical-align: -3px;\n }\n }\n\n .poll-countdown-progress {\n stroke: var(--color-primary);\n fill: transparent;\n stroke-width: 2;\n stroke-linecap: round;\n transition: stroke-dashoffset 2s, stroke 0.2s;\n }\n\n .poll-quiz-help {\n margin: -0.625rem 0 -0.625rem auto;\n .Message:not(.own) & {\n color: var(--color-primary);\n }\n }\n\n .poll-results,\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 0.5rem;\n }\n\n .Button {\n text-transform: none;\n font-size: 1rem;\n\n .Message.own & {\n color: var(--accent-color);\n --color-primary-shade-rgb: var(--color-accent-own);\n }\n }\n\n > .Button {\n margin-bottom: 0.625rem;\n }\n}\n",".WebPage {\n margin-top: 0.25rem;\n margin-bottom: 0.125rem;\n padding-left: 0.625rem;\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n line-height: 1.125rem;\n max-width: 29rem;\n position: relative;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 0.125rem;\n background: var(--accent-color);\n border-radius: 0.125rem;\n }\n\n &-text {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .media-inner {\n margin: 0 !important;\n margin-bottom: 0.375rem !important;\n\n &,\n & img,\n &.small-image img {\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n &.square-image {\n width: 5rem;\n height: 5rem;\n min-height: 0;\n margin-bottom: 0 !important;\n\n img {\n width: 100%;\n height: 100%;\n }\n }\n }\n\n &.with-video .media-inner {\n margin-top: 0.5rem !important;\n margin-bottom: 1rem !important;\n }\n\n &.with-square-photo {\n display: flex;\n margin-bottom: 1rem;\n\n .WebPage-text {\n order: 1;\n padding-right: 1rem;\n }\n\n .media-inner {\n order: 2;\n flex-shrink: 0;\n }\n\n &:dir(rtl) {\n .WebPage-text {\n padding-inline-end: 1rem;\n }\n }\n }\n\n &:not(.with-square-photo) {\n .site-name,\n .site-title,\n .site-description {\n &:last-child::after {\n content: \"\";\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 0.75rem;\n float: right;\n }\n }\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n max-width: 100%;\n }\n\n .site-name {\n color: var(--accent-color);\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-title {\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-description {\n line-height: 1.25;\n margin-bottom: 0;\n\n body.is-ios & {\n line-height: 1.125rem;\n }\n }\n\n &:dir(rtl) {\n padding-inline-start: 0.625rem;\n\n &::before {\n left: auto;\n right: 0;\n }\n }\n}\n",".Invoice {\n .title {\n color: var(--accent-color);\n font-weight: 500;\n }\n\n .description {\n position: relative;\n\n &.has-image {\n .invoice-image {\n max-width: 100%;\n height: 20rem;\n\n @media (max-width: 600px) {\n height: 10rem;\n }\n }\n\n .description-text {\n position: absolute;\n top: 0;\n padding: 0.25rem 0.5rem;\n margin: 0.25rem;\n background-color: rgba(90, 110, 70, 0.6);\n border-radius: var(--border-radius-messages-small);\n color: var(--color-text);\n font-weight: 500;\n\n span {\n margin-left: 0.5rem;\n }\n }\n }\n }\n}\n",".Album {\n position: relative;\n overflow: hidden;\n\n .message-content.media.text & {\n margin: -0.3125rem -0.5rem 0.3125rem;\n }\n\n body.is-ios .Message.own .message-content.has-solid-background & {\n margin: -0.3125rem -0.5rem 0.3125rem -0.625rem;\n }\n\n .forwarded-message & {\n margin-bottom: 0.125rem;\n\n .message-content.media.text & {\n margin: 0 0 0.3125rem;\n --border-bottom-left-radius: inherit;\n --border-bottom-right-radius: inherit;\n }\n }\n\n &,\n .message-content.media.text & {\n > .album-item-select-wrapper .media-inner {\n margin: 0 !important;\n }\n }\n\n > .album-item-select-wrapper .media-inner {\n &,\n & img,\n & video {\n border-radius: 0 !important;\n object-fit: cover;\n }\n }\n}\n",".RoundVideo {\n position: relative;\n width: 15rem;\n height: 15rem;\n cursor: pointer;\n\n .thumbnail-wrapper {\n width: 15rem;\n height: 15rem;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .video-wrapper {\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .progress {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n\n .progress-circle {\n stroke: white;\n fill: transparent;\n stroke-width: 4;\n stroke-opacity: 0.35;\n stroke-linecap: round;\n }\n\n video::-internal-media-controls-cast-button,\n video::-webkit-media-controls,\n video::-webkit-media-controls-start-playback-button {\n display: none;\n }\n}\n",".InlineButtons {\n display: flex;\n flex-direction: column;\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .Button {\n flex: 1;\n width: auto;\n margin: 0.125rem;\n background: var(--pattern-color);\n border-radius: var(--border-radius-messages-small);\n font-weight: 500;\n text-transform: none;\n\n &::before {\n content: \"\";\n background-color: var(--color-white);\n opacity: 0;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--border-radius-messages-small);\n z-index: var(--z-below);\n transition: opacity 200ms;\n }\n\n &:hover {\n background: var(--pattern-color) !important;\n\n &::before {\n opacity: 0.4;\n }\n }\n\n &:first-of-type {\n margin-left: 0;\n }\n\n &:last-of-type {\n margin-right: 0;\n }\n\n i {\n font-size: 0.875rem;\n position: absolute;\n right: 0.1875rem;\n top: 0.1875rem;\n display: block;\n\n &.icon-arrow-right {\n font-size: 0.75rem;\n top: 0.125rem;\n right: 0.125rem;\n transform: rotate(-45deg);\n }\n }\n }\n\n .row:first-of-type .Button {\n margin-top: 0.25rem !important;\n }\n\n .row:last-of-type .Button {\n margin-bottom: 0;\n\n &:first-of-type {\n border-bottom-left-radius: var(--border-radius-messages);\n }\n\n &:last-of-type {\n border-bottom-right-radius: var(--border-radius-messages);\n }\n }\n}\n",".CommentButton {\n --background-color: var(--color-background);\n --hover-color: var(--color-chat-hover);\n\n display: flex;\n width: 100%;\n align-items: center;\n padding: 0.5625rem 0.25rem 0.5625rem 0.625rem;\n padding-inline-start: 0.625rem;\n padding-inline-end: 0.25rem;\n background: var(--background-color);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n font-size: 0.9375rem;\n font-weight: 500;\n line-height: 2rem;\n color: var(--accent-color);\n white-space: nowrap;\n cursor: pointer;\n transition: background-color 0.15s, color 0.15s;\n user-select: none;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .Message .has-appendix &::before {\n content: \"\";\n display: block;\n position: absolute;\n bottom: -0.1875rem;\n left: -0.5625rem;\n width: 0.5625rem;\n height: 1.25rem;\n background-position: bottom left;\n background-image: url('data:image/svg+xml,%3Csvg width=\"9\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"%3E%3Cdefs%3E%3Cfilter x=\"-50%25\" y=\"-14.7%25\" width=\"200%25\" height=\"141.2%25\" filterUnits=\"objectBoundingBox\" id=\"a\"%3E%3CfeOffset dy=\"1\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\"/%3E%3CfeGaussianBlur stdDeviation=\"1\" in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\"/%3E%3CfeColorMatrix values=\"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0\" in=\"shadowBlurOuter1\"/%3E%3C/filter%3E%3Cpath d=\"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z\" id=\"b\"/%3E%3C/defs%3E%3Cg fill=\"none\" fill-rule=\"evenodd\"%3E%3Cuse fill=\"%23000\" filter=\"url(%23a)\" xlink:href=\"%23b\"/%3E%3Cuse fill=\"%23FFF\" xlink:href=\"%23b\"/%3E%3C/g%3E%3C/svg%3E');\n opacity: 0;\n transition: opacity 0.15s, filter 0.15s;\n\n .theme-dark #root & {\n filter: invert(0.83);\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .custom-shape & {\n position: absolute;\n right: -3rem;\n width: 2.25rem;\n bottom: 3rem;\n height: 3.375rem;\n border-radius: 1.375rem;\n padding: 0.375rem 0.3125rem 0.25rem;\n align-items: flex-start;\n color: white;\n background-color: rgba(0, 0, 0, 0.2);\n\n opacity: 0;\n transition: opacity 0.2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover {\n background-color: rgba(0, 0, 0, 0.28);\n }\n\n .Message:hover & {\n opacity: 1;\n }\n\n &::after {\n content: attr(data-cnt);\n position: absolute;\n bottom: -0.0625rem;\n left: 0;\n width: 100%;\n text-align: center;\n font-size: 12px;\n display: block;\n }\n\n &[data-cnt=\"0\"] {\n height: 2.25rem;\n &::after {\n display: none;\n }\n }\n\n .icon-comments-sticker {\n display: block;\n font-size: 1.5rem;\n margin: 0 auto;\n }\n\n .recent-repliers,\n .icon-comments,\n .label,\n .icon-next {\n display: none;\n }\n }\n\n &:hover {\n background: var(--hover-color);\n\n .Message .has-appendix &::before {\n opacity: 1;\n }\n\n .Avatar {\n border-color: var(--hover-color) !important;\n }\n }\n\n .is-forwarded &,\n .audio &,\n .voice &,\n .poll &,\n .text & {\n border-top: 1px solid var(--color-borders);\n }\n\n .message-content.has-solid-background & {\n margin: 0.375rem -0.5rem -0.375rem;\n }\n\n .message-content.voice & {\n margin-bottom: -0.5rem;\n }\n\n .message-content.audio & {\n margin-bottom: -0.8125rem;\n }\n\n .message-content.audio &,\n .message-content.voice &,\n .message-content.poll &,\n .message-content.has-solid-background.text &,\n .message-content.has-solid-background.is-forwarded & {\n width: calc(100% + 1rem);\n }\n\n .icon-comments-sticker {\n display: none;\n }\n\n .icon-comments {\n font-size: 1.5625rem;\n line-height: 2rem;\n margin-inline-end: 0.875rem;\n }\n\n .icon-next {\n margin-inline-start: auto;\n font-size: 1.5rem;\n }\n\n .recent-repliers {\n display: inline-flex;\n align-items: center;\n margin-inline-end: 0.5rem;\n margin-inline-start: -0.125rem;\n\n .Avatar {\n transition: border 0.15s;\n border: 2px solid var(--color-background);\n margin-inline-end: 0;\n z-index: 3;\n overflow: hidden;\n\n .emoji {\n width: 1rem;\n background-size: 1rem;\n }\n\n + .Avatar {\n z-index: 2;\n\n + .Avatar {\n z-index: 1;\n }\n }\n\n &:not(:first-child) {\n margin-inline-start: -0.75rem;\n }\n }\n }\n\n &.has-unread .label {\n position: relative;\n\n &::after {\n content: \"\";\n display: inline-block;\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 50%;\n background: var(--accent-color);\n margin-inline-start: 0.75rem;\n }\n }\n\n &.disabled {\n cursor: default;\n pointer-events: none;\n }\n}\n",".Reactions {\n display: flex;\n flex-direction: row;\n width: 100%;\n flex-wrap: wrap;\n margin-top: 0.25rem;\n overflow: visible;\n\n .Button {\n --reaction-background: var(--color-reaction);\n display: flex;\n flex-direction: row;\n height: 1.75rem;\n white-space: nowrap;\n width: auto;\n margin: 0.125rem;\n padding: 0 0.5rem;\n border: 2px solid transparent;\n background-color: var(--reaction-background) !important;\n border-radius: 1.75rem;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n text-transform: none;\n color: var(--accent-color);\n overflow: visible;\n\n .ReactionAnimatedEmoji, .icon-reaction-filled {\n width: 1.125rem;\n height: 1.125rem;\n margin-right: 0.25rem;\n }\n\n .avatars {\n display: flex;\n\n .Avatar {\n margin: 0 0 0 -0.25rem;\n border: 0.0625rem solid var(--reaction-background);\n width: 1.25rem;\n height: 1.25rem;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n\n &.chosen {\n border-color: var(--accent-color);\n position: relative;\n z-index: 1;\n }\n\n &:hover {\n --reaction-background: var(--hover-color-reaction);\n }\n\n &:first-of-type {\n margin-left: 0;\n }\n\n &:last-of-type {\n margin-right: 0;\n }\n }\n\n &.is-outside {\n margin-top: 0.125rem;\n }\n\n .own &.is-outside {\n flex-direction: row-reverse;\n }\n\n &.is-outside .Button {\n --reaction-background: var(--pattern-color);\n color: white;\n .theme-dark & {\n color: var(--accent-color);\n }\n\n &.chosen {\n border-color: white;\n\n .theme-dark & {\n border-color: var(--accent-color);\n }\n }\n }\n}\n",".message-content {\n position: relative;\n max-width: var(--max-width);\n\n @media (max-width: 600px) {\n max-width: min(29rem, calc(100vw - 6.25rem));\n .MessageList.no-avatars & {\n max-width: min(29rem, calc(100vw - 3.75rem));\n }\n .Message.own & {\n max-width: min(30rem, calc(100vw - 3.75rem));\n }\n\n &.has-action-button {\n max-width: min(29rem, calc(100vw - 7rem));\n .MessageList.no-avatars & {\n max-width: min(29rem, calc(100vw - 4.5rem));\n }\n .Message.own & {\n max-width: min(30rem, calc(100vw - 4.5rem));\n }\n }\n }\n\n img {\n -webkit-touch-callout: none;\n user-select: none;\n }\n\n .emoji {\n -webkit-user-drag: none;\n user-select: text;\n }\n\n .text-content {\n margin: 0;\n word-break: break-word;\n white-space: pre-wrap;\n line-height: 1.3125;\n text-align: initial;\n display: flow-root;\n unicode-bidi: plaintext;\n }\n\n .text-entity-link {\n unicode-bidi: plaintext;\n }\n\n &:not(.custom-shape) .text-content,\n &.document {\n & > .MessageMeta {\n position: relative;\n top: 0.375rem;\n bottom: auto !important;\n float: right;\n line-height: 1.35;\n height: calc(var(--message-meta-height, 1rem));\n margin-left: 0.4375rem;\n margin-right: -0.5rem;\n\n .MessageOutgoingStatus .Transition {\n max-height: calc(var(--message-meta-height, 1rem));\n overflow: hidden;\n }\n\n html[data-message-text-size=\"12\"] & {\n top: 0.25rem;\n }\n\n html[data-message-text-size=\"17\"] & {\n top: 0.4375rem;\n }\n\n html[data-message-text-size=\"18\"] &,\n html[data-message-text-size=\"19\"] & {\n top: 0.5rem;\n }\n\n html[data-message-text-size=\"20\"] & {\n top: 0.5625rem;\n }\n }\n\n &:dir(rtl) {\n & > .MessageMeta {\n float: left;\n margin-left: -0.25rem;\n margin-right: 0.4375rem;\n }\n }\n }\n\n .MessageMeta.reactions-offset {\n position: relative;\n top: 0.375rem;\n bottom: auto !important;\n float: right;\n line-height: 1;\n height: calc(var(--message-meta-height, 1rem));\n margin-left: auto;\n margin-right: -0.5rem;\n align-self: flex-end;\n\n .MessageOutgoingStatus .Transition {\n max-height: calc(var(--message-meta-height, 1rem));\n overflow: hidden;\n }\n\n html[data-message-text-size=\"12\"] & {\n top: 0.25rem;\n }\n\n html[data-message-text-size=\"17\"] & {\n top: 0.4375rem;\n }\n\n html[data-message-text-size=\"18\"] &,\n html[data-message-text-size=\"19\"] & {\n top: 0.5rem;\n }\n\n html[data-message-text-size=\"20\"] & {\n top: 0.5625rem;\n }\n }\n\n &.document:not(.text) {\n &::after {\n content: \"\";\n display: block;\n clear: both;\n }\n\n & > .MessageMeta {\n top: auto !important;\n bottom: -0.5rem !important;\n margin-top: -0.25rem;\n\n &:not([dir=\"rtl\"]) {\n margin-top: -1.25rem;\n }\n }\n }\n\n .theme-dark .Message.own & {\n .text-entity-link {\n text-decoration: underline !important;\n\n &:hover {\n text-decoration: none !important;\n }\n }\n }\n\n &:not(.custom-shape) {\n font-size: var(--message-text-size, 1rem);\n\n body.is-ios & {\n font-size: var(--message-text-size, 1.0625rem);\n }\n\n & > .content-inner {\n min-width: 0;\n }\n }\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #cae3f7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n\n .theme-dark & {\n --color-text: #000;\n }\n }\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n font-weight: 500;\n line-height: 1.25rem;\n color: var(--accent-color);\n unicode-bidi: plaintext;\n display: flex;\n\n & > .interactive {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.interactive,\n & > .interactive {\n cursor: pointer;\n\n &:hover {\n opacity: 0.85;\n }\n }\n\n & > .color-1 {\n color: var(--color-user-1);\n }\n\n & > .color-2 {\n color: var(--color-user-2);\n }\n\n & > .color-4 {\n color: var(--color-user-4);\n }\n\n & > .color-5 {\n color: var(--color-user-5);\n }\n\n & > .color-6 {\n color: var(--color-user-6);\n }\n\n & > .color-7 {\n color: var(--color-user-7);\n }\n\n & > .color-8 {\n color: var(--color-user-8);\n }\n\n .theme-dark .Message.own & > .color-1 {\n color: var(--accent-color);\n }\n\n & + .File {\n margin-top: 0.25rem;\n }\n\n .via {\n padding-right: 0.25rem;\n font-weight: 400;\n }\n\n span + .via {\n padding-left: 0.25rem;\n }\n\n .admin-title {\n flex: 1;\n margin-left: 1rem;\n text-align: right;\n font-weight: 400;\n font-size: 0.75rem;\n margin-top: -0.125rem;\n color: rgba(var(--color-text-meta-rgb), 0.75);\n\n .Message.own & {\n color: var(--accent-color);\n }\n }\n }\n\n &.has-shadow {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &.has-solid-background,\n &.has-background,\n .is-album & {\n background: var(--background-color);\n }\n\n &.has-solid-background {\n padding: 0.3125rem 0.5rem 0.375rem;\n\n .forwarded-message > .text-content:not(.with-meta):last-child::after {\n content: \"\";\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 1rem;\n }\n }\n\n body.is-ios &.has-solid-background {\n padding-bottom: 0.4375rem;\n }\n\n body.is-ios .Message.own &.has-solid-background {\n padding-left: 0.625rem;\n }\n\n &:not(.has-appendix) .svg-appendix {\n display: none;\n }\n\n .svg-appendix {\n overflow: hidden;\n position: absolute;\n bottom: -0.0625rem;\n width: 0.5625rem;\n height: 1.125rem;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--background-color);\n }\n\n .Message.own & {\n /* stylelint-disable-next-line plugin/whole-pixel */\n right: -0.551rem; // This value is correct. Safari fix\n }\n\n .Message:not(.own) & {\n /* stylelint-disable-next-line plugin/whole-pixel */\n left: -0.562rem; // This value is correct. Safari fix\n }\n }\n\n &[data-has-custom-appendix] {\n .svg-appendix .corner {\n fill: var(--appendix-bg);\n }\n }\n\n &.has-appendix-thumb {\n .Message & {\n .svg-appendix {\n --background-color: #ccc;\n opacity: 1;\n transition: opacity 500ms ease;\n }\n }\n }\n\n &.document {\n padding: 0.5rem !important;\n\n .File {\n .theme-dark & {\n --color-primary: var(--color-selection-highlight);\n }\n }\n\n .File + .text-content {\n margin-top: 0.3125rem;\n }\n }\n\n &.voice,\n &.audio {\n .message-title,\n .Embedded {\n margin-top: -0.1875rem;\n margin-bottom: 0.1875rem;\n }\n }\n\n &.voice {\n padding: 0.5rem !important;\n\n .Voice + .text-content {\n margin-top: 0.5rem;\n }\n }\n\n &.audio {\n min-width: 20rem;\n padding: 0.5rem 0.5rem 0.8125rem !important;\n\n @media (max-width: 600px) {\n min-width: 17rem;\n }\n\n .Audio + .text-content {\n margin-top: 0.25rem;\n }\n\n &:not(.has-replies) {\n .Audio + .text-content {\n margin-bottom: -0.4375rem;\n }\n }\n }\n\n &:not(.custom-shape) .emoji {\n display: inline-block;\n width: 1.25rem;\n background-size: 1.25rem;\n color: transparent;\n margin-inline-end: 1px;\n vertical-align: text-bottom;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &:not(.custom-shape) .text-content .emoji {\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n\n .no-media-corners {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.custom-shape.is-via-bot {\n font-size: inherit !important;\n\n .content-inner > .message-title {\n display: inline-flex;\n position: relative;\n top: 0.125rem;\n max-width: calc(100% - 3rem);\n margin-left: calc(100% - 3rem);\n padding: 0 0.5rem;\n background-color: var(--background-color);\n border-radius: var(--border-radius-messages);\n\n .Message.own & {\n margin-left: -3rem;\n }\n }\n\n .media-inner {\n margin-top: 0.375rem;\n }\n }\n}\n\n.message-content.media,\n.WebPage {\n .media-inner {\n display: flex;\n justify-content: center;\n align-items: center;\n\n &.interactive {\n cursor: pointer;\n\n &.dark video {\n background-color: #232323;\n }\n }\n }\n\n &.round.is-reply {\n width: auto !important;\n }\n\n &.force-sender-name .media-inner,\n &.force-sender-name .Album,\n &.text .media-inner,\n &.is-via-bot .media-inner,\n &.is-reply .media-inner,\n &.is-reply .Album {\n margin-left: -0.5rem;\n margin-right: -0.5rem;\n\n body.is-ios .Message.own & {\n margin-left: -0.625rem;\n }\n }\n\n &.text .media-inner {\n margin-top: -0.3125rem;\n }\n\n &.is-reply .media-inner,\n &.force-sender-name .Album,\n &.is-reply .Album,\n .message-title ~ .media-inner {\n margin-top: 0.375rem;\n margin-bottom: -0.375rem;\n\n body.is-ios .Message.own & {\n margin-bottom: -0.4375rem;\n }\n }\n\n &:not(.text) .RoundVideo {\n margin-bottom: 0;\n }\n\n // Moved below .is-reply to overwrite its styles\n &.text .media-inner,\n &.text .Album {\n margin-bottom: 0.375rem;\n\n body.is-ios .Message.own & {\n margin-bottom: 0.375rem;\n }\n }\n\n .media-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:not(.open) {\n opacity: 0.5;\n transform: scale(0);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n }\n\n .icon-large-play,\n .icon-download {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n opacity: 0.7;\n transition: opacity 150ms;\n\n &:hover {\n opacity: 1;\n }\n\n &:before {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: rgba(black, 0.25);\n }\n\n &.opacity-transition {\n transition: opacity 0.15s ease;\n\n &:not(.open) {\n opacity: 0;\n }\n }\n }\n\n .icon-download {\n font-size: 1.5rem;\n }\n\n .icon-large-play {\n font-size: 2.5rem;\n }\n\n .message-media-duration,\n .message-transfer-progress {\n background: rgba(0, 0, 0, 0.25);\n color: #fff;\n font-size: 0.75rem;\n position: absolute;\n left: 0.1875rem;\n top: 0.1875rem;\n z-index: 1;\n padding: 0 0.375rem;\n border-radius: 0.75rem;\n line-height: 1.125rem;\n user-select: none;\n }\n\n .message-media-duration .icon-muted {\n vertical-align: -0.1875rem;\n margin-left: 0.375rem;\n font-size: 1.0625rem;\n }\n}\n\n.message-content.custom-shape {\n line-height: 1.2;\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n\n &.has-comments {\n min-height: 5.25rem;\n margin-top: 0 !important;\n\n &.has-replies {\n min-height: 6.5rem;\n }\n }\n\n &.is-reply {\n max-width: 100%;\n }\n\n .reply-message {\n display: flex;\n align-items: flex-start;\n flex-direction: row-reverse;\n direction: ltr;\n\n > p {\n margin-bottom: 0;\n }\n\n .EmbeddedMessage {\n margin-left: 0.5rem;\n border-radius: var(--border-radius-messages);\n\n @media (max-width: 600px) {\n max-width: calc(90vw - 13rem);\n }\n\n @media (max-width: 340px) {\n margin-left: -1rem;\n z-index: 1;\n max-width: calc(90vw - 12rem);\n }\n }\n }\n\n .text-content {\n margin-bottom: 1rem;\n }\n\n .media-inner {\n line-height: 1;\n font-size: 1rem;\n flex-shrink: 0;\n\n .full-media {\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n }\n }\n\n .emoji {\n display: inline-block;\n color: transparent;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &.emoji-only {\n .text-content {\n margin-bottom: 0;\n text-shadow: 1px 1px 0 white, -1px -1px 0 white, -1px 1px 0 white, 1px -1px 0 white;\n img.emoji {\n filter: drop-shadow(1px 1px 0 white) drop-shadow(-1px 1px 0 white) drop-shadow(1px -1px 0 white)\n drop-shadow(-1px -1px 0 white);\n }\n\n .MessageMeta {\n text-shadow: none;\n }\n }\n }\n\n &.emoji-only-1 {\n min-width: 8rem;\n font-size: 4.5rem;\n\n .content-inner {\n height: 7rem;\n }\n\n .text-content {\n line-height: 1.5;\n text-align: center;\n }\n\n .Message.was-edited & {\n min-width: 10rem;\n }\n\n .emoji {\n width: 5rem;\n height: 5rem;\n }\n }\n\n &.emoji-only-2 {\n font-size: 4rem;\n margin-top: 0.5rem;\n min-width: 10rem;\n @media (max-width: 600px) {\n margin-top: 0.375rem;\n }\n\n &.has-comments {\n margin-top: 1.25rem;\n }\n\n .Message.was-edited & {\n min-width: 12rem;\n }\n\n .emoji {\n width: 4rem;\n height: 4rem;\n margin-right: 0.375rem;\n }\n }\n\n &.emoji-only-3 {\n font-size: 3rem;\n margin-top: 1.75rem;\n min-width: 12rem;\n\n &.has-comments {\n margin-top: 2.5rem;\n }\n\n .Message.was-edited & {\n min-width: 14rem;\n }\n\n .emoji {\n width: 3rem;\n height: 3rem;\n margin-right: 0.375rem;\n }\n }\n\n .Message:not(.own) & {\n --hover-color: var(--color-reply-hover);\n --active-color: var(--color-reply-active);\n }\n\n .Message.own & {\n --hover-color: var(--color-reply-own-hover);\n --active-color: var(--color-reply-own-active);\n\n .reply-message {\n flex-direction: row;\n\n .EmbeddedMessage {\n margin-right: 0.5rem;\n\n @media (max-width: 340px) {\n margin-left: 0;\n z-index: 1;\n max-width: calc(90vw - 11.5rem);\n }\n }\n }\n }\n}\n\n.forwarded-message {\n .message-content.contact &,\n .message-content.voice &,\n .message-content.poll & {\n // MessageOutgoingStatus's icon needs more space\n margin-bottom: 0.5rem;\n }\n\n .message-content:not(.custom-shape) & {\n position: relative;\n margin-top: 0.25rem;\n padding-left: 0.625rem;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0.0625rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:dir(rtl) {\n padding-inline-start: 0.625rem;\n\n &::before {\n left: auto;\n right: 0.0625rem;\n }\n }\n }\n\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n > .media-inner {\n margin: 0 !important;\n margin-bottom: 0.25rem !important;\n }\n}\n\n.long-word-break-all {\n word-break: break-all;\n}\n\n.text-entity-link {\n color: var(--color-links) !important;\n text-decoration: none !important;\n word-break: break-word;\n cursor: pointer;\n unicode-bidi: initial;\n\n &:hover,\n &:active,\n &:visited {\n text-decoration: underline !important;\n }\n}\n\n.text-entity-code,\n.text-entity-pre {\n color: var(--color-code);\n background: var(--color-code-bg);\n white-space: pre-wrap;\n margin: 0;\n padding: 1px 2px;\n border-radius: 4px;\n font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);\n}\n","@import \"message-content\";\n\n// General styles\n.Message {\n display: flex;\n align-items: flex-end;\n margin-bottom: 0.375rem;\n position: relative;\n\n --background-color: var(--color-background);\n --hover-color: var(--color-reply-hover);\n --color-reaction: var(--color-message-reaction);\n --hover-color-reaction: var(--color-message-reaction-hover);\n --active-color: var(--color-reply-active);\n --max-width: 29rem;\n --accent-color: var(--color-primary);\n --accent-shade-color: var(--color-primary-shade);\n --secondary-color: var(--color-text-secondary);\n --meta-safe-area-base: 2.25rem;\n --meta-safe-author-width: 0px;\n --meta-safe-area-extra-width: 0px;\n --meta-safe-area-size: calc(\n var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width)\n );\n --deleting-translate-x: -50%;\n --select-message-scale: 0.9;\n\n --border-top-left-radius: var(--border-radius-messages);\n --border-top-right-radius: var(--border-radius-messages);\n --border-bottom-left-radius: var(--border-radius-messages);\n --border-bottom-right-radius: var(--border-radius-messages);\n\n @media (min-width: 1921px) {\n --max-width: calc(30vw - 1rem);\n }\n @media (max-width: 600px) {\n margin-bottom: 0.25rem;\n }\n\n &.is-swiped {\n transform: translateX(-2.5rem) !important;\n }\n\n &.is-protected {\n user-select: none;\n }\n\n > .Avatar,\n > .message-content-wrapper {\n opacity: 1;\n transform: scale(1) translateX(0);\n transition: transform var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Avatar {\n position: absolute;\n bottom: 0;\n left: 0;\n\n @media (max-width: 600px) {\n width: 2.5rem;\n height: 2.5rem;\n }\n }\n\n .quick-reaction {\n cursor: pointer;\n position: absolute;\n right: -0.5rem;\n bottom: -0.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: scale(1);\n opacity: 0;\n transition: transform 0.2s ease-out, opacity 0.2s ease-out;\n transition-delay: 0.2s;\n\n &.visible {\n opacity: 1 !important;\n }\n\n &:hover {\n transition-delay: unset;\n transform: scale(1.4);\n }\n\n .ReactionStaticEmoji {\n width: 1.125rem;\n }\n }\n\n &.last-in-list .quick-reaction:hover {\n transform: translateY(-0.1875rem) scale(1.4);\n }\n\n &.own .quick-reaction {\n right: auto;\n left: -0.5rem;\n }\n\n &.last-in-group {\n margin-bottom: 0.625rem;\n @media (max-width: 600px) {\n margin-bottom: 0.4375rem;\n }\n }\n\n &.last-in-list {\n // Forcing extra space which is taken by the appendix and causes incorrect container height calculation.\n // This value is accurately crafted as a minimum possible.\n margin-bottom: 0.375rem;\n }\n\n &.is-in-selection-mode {\n body.is-android & {\n .can-select-text {\n z-index: var(--z-message-select-control);\n }\n\n // Prevent media viewer from opening\n .media-inner {\n pointer-events: none;\n }\n }\n }\n\n &.has-inline-buttons {\n .message-content {\n border-bottom-right-radius: var(--border-radius-messages-small);\n }\n }\n\n &.has-active-reaction {\n .message-content-wrapper {\n z-index: 1;\n }\n }\n\n &:not(.own) {\n padding-left: 2.5rem;\n\n .no-avatars &,\n &.is-thread-top {\n padding-left: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 2.875rem;\n\n .no-avatars &,\n &.is-thread-top {\n padding-left: 0.25rem;\n }\n }\n\n &.first-in-group:not(.last-in-group) {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-left-radius: 0;\n }\n }\n }\n\n &.own {\n flex-direction: row-reverse;\n --background-color: var(--color-background-own);\n --hover-color: var(--color-reply-own-hover);\n --color-reaction: var(--color-message-reaction-own);\n --hover-color-reaction: var(--color-message-reaction-hover-own);\n --active-color: var(--color-reply-own-active);\n --max-width: 30rem;\n --accent-color: var(--color-accent-own);\n --accent-shade-color: var(--color-green);\n --secondary-color: var(--color-accent-own);\n --color-code: var(--color-code-own);\n --color-code-bg: var(--color-code-own-bg);\n --color-links: var(--color-own-links);\n --meta-safe-area-base: 3.5rem;\n --deleting-translate-x: 50%;\n --color-text-green: var(--color-accent-own);\n\n @media (min-width: 1921px) {\n --max-width: 30vw;\n }\n\n body.is-ios &,\n body.is-macos & {\n --color-background-own: var(--color-background-own-apple);\n --color-reply-own-hover: var(--color-reply-own-hover-apple);\n --color-reply-own-active: var(--color-reply-own-active-apple);\n }\n\n @media (max-width: 600px) {\n padding-right: 0.25rem;\n }\n\n &.first-in-group:not(.last-in-group) {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n }\n\n &.is-deleting {\n > .Avatar,\n > .message-content-wrapper {\n transition: opacity 0.2s ease, transform 0.2s ease-in;\n opacity: 0;\n transform: scale(0.3) translateX(var(--deleting-translate-x));\n transform-origin: bottom;\n }\n }\n\n &.has-views {\n --meta-safe-area-extra-width: 4rem;\n }\n\n &.was-edited {\n --meta-safe-area-extra-width: 2.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 7.5rem;\n }\n\n html[lang=\"ru\"] & {\n --meta-safe-area-extra-width: 3.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 8.5rem;\n }\n }\n }\n\n .select-mode-active & {\n cursor: pointer;\n\n @media (min-width: 600px) {\n user-select: none;\n }\n\n &:not(.own) {\n > .Avatar,\n > .message-content-wrapper {\n transform: translateX(2.5rem);\n }\n }\n\n &:not(.is-album)::after {\n content: \"\";\n position: absolute;\n top: -0.25rem;\n bottom: -0.25rem;\n left: -4rem;\n right: -4rem;\n z-index: var(--z-message-select-area);\n }\n\n &.is-album,\n &.is-in-document-group {\n .message-select-control {\n pointer-events: unset;\n }\n }\n\n .message-select-control {\n opacity: 1;\n }\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n\n &.group-select {\n background: transparent;\n\n &.is-selected {\n background: var(--color-green);\n }\n }\n }\n }\n\n .File.file-is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n }\n\n &.is-in-document-group .File.file-is-selected .file-icon,\n &.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-selected);\n }\n\n &.own.is-in-document-group .File.file-is-selected .file-icon,\n &.own.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-own-selected);\n }\n\n .Audio .message-select-control {\n left: 1.0625rem;\n top: 1.375rem;\n }\n\n html.theme-dark &.own .Audio .toggle-play:not(.with-image) + .media-loading {\n .ProgressSpinner {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);\n background-position: center;\n background-size: 1rem;\n\n circle {\n stroke: var(--background-color);\n }\n }\n }\n\n .File {\n position: relative;\n\n .message-select-control {\n position: absolute;\n top: 2rem;\n left: 2rem;\n z-index: 2;\n }\n }\n\n .album-item-select-wrapper {\n position: absolute;\n .Message.own & {\n background: var(--color-background-own);\n }\n\n .message-select-control {\n position: absolute;\n z-index: 2;\n top: 0.4375rem;\n right: 0.4375rem;\n left: unset;\n }\n\n img,\n video {\n transition: transform var(--select-transition), opacity ease 300ms;\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n\n img,\n video {\n transform: scale(var(--select-message-scale));\n }\n }\n }\n\n &.is-selected,\n &.is-forwarding {\n .message-select-control {\n background: var(--color-green);\n }\n\n .Menu .bubble {\n transition: none !important;\n }\n }\n\n &.is-in-document-group {\n .message-content.document {\n padding: 0.25rem 0.5rem !important;\n }\n\n &.last-in-document-group {\n .message-content.document {\n padding-bottom: 0.5rem !important;\n }\n }\n\n &.first-in-document-group {\n .message-content.document {\n padding-top: 0.5rem !important;\n }\n }\n\n &:not(.first-in-document-group) {\n &::before {\n top: 0 !important;\n }\n\n .message-content {\n box-shadow: none;\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n }\n\n .forwarded-message::before {\n top: -1.5rem;\n }\n }\n\n &:not(.last-in-document-group) {\n margin-bottom: 0;\n\n &::before {\n bottom: 0 !important;\n }\n\n .message-content {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n &.is-in-selection-mode {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: white;\n\n &::after {\n content: \"\";\n width: 1.25rem;\n height: 1.25rem;\n border-radius: 0.6875rem;\n background: white;\n border: 0.125rem rgba(0, 0, 0, 0.2) solid;\n position: absolute;\n }\n }\n }\n\n &.own {\n .message-content {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: var(--background-color);\n border-color: var(--background-color);\n\n &::after {\n background: var(--background-color);\n border-color: var(--color-message-meta-own);\n }\n }\n }\n }\n }\n }\n\n &.focused,\n &.has-menu-open,\n &.is-forwarding,\n &.is-selected {\n .message-content {\n background: var(--color-background-selected);\n }\n\n &.own {\n .message-content {\n --background-color: var(--color-background-own-selected);\n background: var(--color-background-own-selected);\n }\n }\n }\n\n .message-content-wrapper {\n width: 17.1875rem;\n }\n\n .message-content {\n transition: background-color var(--select-transition);\n }\n\n &.own {\n .message-content-wrapper {\n display: flex;\n justify-content: flex-end;\n\n .message-content {\n width: 100%;\n }\n }\n }\n }\n\n .message-select-control {\n position: absolute;\n left: 0;\n bottom: 0.25rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 2px solid white;\n border-radius: 50%;\n z-index: var(--z-message-select-control);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: white;\n font-size: 1rem;\n\n opacity: 0;\n pointer-events: none;\n transition: opacity var(--select-transition);\n\n .icon-select {\n position: absolute;\n left: -3px;\n top: -3px;\n font-size: 1.625rem;\n }\n\n .theme-dark & {\n border-color: #ffffff80;\n }\n }\n\n .Avatar {\n margin-right: 0.3125rem;\n }\n\n .message-content {\n &.has-replies:not(.custom-shape):not(.has-reactions) .WebPage.with-video .media-inner {\n margin-bottom: 1.5rem !important;\n }\n\n &.has-replies:not(.custom-shape),\n &.text {\n .media-inner,\n .Album {\n --border-bottom-left-radius: 0;\n --border-bottom-right-radius: 0;\n }\n }\n\n &.is-reply .EmbeddedMessage {\n & + .Album,\n & + .Audio,\n & + .File {\n margin-top: 0.375rem;\n }\n }\n\n &:not(.custom-shape).is-reply .media-inner,\n &:not(.custom-shape).is-reply .Album,\n &:not(.custom-shape).force-sender-name .Album,\n &:not(.is-forwarded) .message-title ~ .media-inner {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.is-forwarded .content-inner .message-title {\n margin-bottom: 0.25rem;\n }\n }\n\n .message-action-button {\n position: absolute;\n bottom: 0;\n color: white;\n background-color: rgba(0, 0, 0, 0.2);\n\n opacity: 0;\n transition: opacity 0.2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover,\n &:active,\n &:focus {\n background-color: rgba(0, 0, 0, 0.28) !important;\n }\n }\n\n &:hover,\n &[data-is-document-group-hover] {\n .message-action-button {\n opacity: 1;\n }\n }\n\n &.own .message-action-button {\n left: -3rem;\n }\n\n &:not(.own) .message-action-button {\n right: -3rem;\n }\n\n .bottom-marker {\n height: 1px;\n width: 1px;\n visibility: hidden;\n }\n}\n\n// Border-radius styles\n.message-content,\n.Album,\n.media-inner,\n.message-content.media .media-inner img,\n.message-content.media .media-inner video,\n.message-content.custom-shape .media-inner img {\n border-top-left-radius: var(--border-top-left-radius);\n border-top-right-radius: var(--border-top-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n}\n\n.media-inner video.full-media {\n background: transparent !important;\n}\n\n.media-inner {\n overflow: hidden;\n\n &.small-image img {\n border-radius: 0 !important;\n }\n}\n\n.Message .custom-shape .message-action-button {\n bottom: 0.25rem;\n}\n",".SponsoredMessage {\n --border-top-left-radius: var(--border-radius-messages) !important;\n --border-bottom-left-radius: var(--border-radius-messages) !important;\n\n margin-top: -0.5rem;\n margin-bottom: 0.5rem;\n\n &::before {\n display: none;\n }\n\n &__button.secondary {\n margin-top: 0.5rem;\n border: 1px solid var(--color-primary);\n border-radius: var(--border-radius-default-tiny);\n color: var(--color-primary);\n }\n}\n",".ContactGreeting {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n background: var(--pattern-color);\n width: 14.5rem;\n padding: 0.75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n }\n\n .title {\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .description {\n font-size: 0.9375rem;\n margin-bottom: 0;\n }\n\n .sticker {\n margin: 2rem 0 1rem;\n height: 10rem;\n width: 10rem;\n cursor: pointer;\n\n .thumbnail {\n height: 10rem;\n width: 10rem;\n }\n }\n}\n",".NoMessages {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .icon {\n font-size: 5rem;\n margin: 0 auto 1rem;\n }\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n background: var(--pattern-color);\n max-width: 20rem;\n padding: 0.75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n\n &[dir=\"rtl\"] {\n text-align: right;\n }\n }\n\n .title {\n font-weight: 500;\n font-size: 1rem;\n margin-bottom: 0.25rem;\n text-align: center;\n unicode-bidi: plaintext;\n }\n\n .description {\n font-size: 0.9375rem;\n margin: 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n }\n\n .list-checkmarks {\n font-size: 0.9375rem;\n margin: 0.25rem 0 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n line-height: 1.8;\n\n li::before {\n content: \"✓\";\n margin-inline-end: 0.5rem;\n }\n }\n}\n","@import \"../../styles/mixins\";\n\n.MessageList {\n flex: 1;\n width: 100%;\n margin-bottom: 0.5rem;\n\n overflow: scroll;\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .mask-image-enabled & {\n mask-image: linear-gradient(to top, transparent 0, #000 0.5rem);\n }\n\n @media (pointer: coarse) {\n user-select: none;\n -webkit-touch-callout: none;\n\n &.select-mode-active {\n user-select: auto;\n -webkit-touch-callout: default;\n }\n }\n\n transition: bottom 150ms ease-out, transform var(--layer-transition);\n body.keyboard-visible & {\n position: relative;\n bottom: calc(0px - env(safe-area-inset-bottom));\n\n body.keyboard-visible.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &.no-avatars .Message > .Avatar {\n display: none;\n }\n\n .messages-container {\n width: 100%;\n max-width: var(--messages-container-width);\n min-height: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: flex-end;\n flex-direction: column;\n padding: 1rem 1rem 0 1.125rem;\n\n .force-messages-scroll & {\n margin-top: 100vh !important;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n padding: 2.75rem 0.5rem 0;\n // Patch for an issue on Android when rotating device\n margin: 0;\n }\n }\n\n &.no-composer {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 1rem;\n }\n }\n\n &.select-mode-active,\n &.type-pinned {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 5.625rem;\n\n @media (max-width: 600px) {\n margin-bottom: 4.25rem;\n }\n\n &.ActionMessage {\n padding-bottom: 0.125rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n &.with-bottom-shift {\n margin-bottom: 0;\n .last-in-list {\n margin-bottom: 4.25rem;\n\n body:not(.keyboard-visible) & {\n margin-bottom: calc(4.25rem + env(safe-area-inset-bottom));\n }\n }\n }\n }\n\n .Message,\n .ActionMessage {\n position: relative;\n\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.2s ease, transform 0.2s ease;\n\n &:not(.open) {\n transform: scale(0.8);\n opacity: 0;\n }\n\n // Restore stacking context\n // https://developer.mozilla.org/ru/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n &.open.shown {\n transform: none;\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -0.1875rem;\n bottom: -0.1875rem;\n left: -50vw;\n right: -50vw;\n background: black;\n z-index: -1;\n\n opacity: 0;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &:not(.last-in-group) {\n &::before {\n bottom: -0.1875rem;\n }\n }\n\n &:not(.first-in-group) {\n &::before {\n top: -0.1875rem;\n }\n }\n\n &.focused::before {\n // @optimization\n transition: none !important;\n }\n\n &.focused,\n &.is-forwarding,\n &.is-selected,\n &.has-menu-open {\n &::before {\n opacity: 0.1;\n\n .theme-dark & {\n opacity: 0.6;\n }\n }\n }\n }\n\n > .empty {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > span {\n max-width: 80%;\n text-align: left;\n }\n\n .text-entity-link {\n color: inherit !important;\n text-decoration: underline;\n\n &:hover,\n &:focus {\n text-decoration: none;\n }\n }\n }\n\n .sticky-date,\n .local-action-message,\n .ActionMessage,\n .empty {\n text-align: center;\n user-select: none;\n\n > span {\n display: inline-block;\n background: var(--pattern-color);\n color: white;\n font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);\n font-weight: 500;\n line-height: 1.75;\n padding: 0 0.5rem;\n border-radius: var(--border-radius-messages);\n word-break: break-word;\n\n body.is-ios &,\n body.is-macos & {\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n line-height: calc(var(--message-text-size, 1rem) + 0.5rem);\n }\n\n .emoji-small {\n vertical-align: text-bottom;\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n }\n }\n\n .sticky-date {\n margin-top: 1rem;\n margin-bottom: 1rem;\n z-index: var(--z-sticky-date);\n pointer-events: none;\n opacity: 1;\n transition: opacity 0.3s ease;\n\n @media (max-width: 600px) {\n margin-top: 0.5rem;\n margin-bottom: 0.75rem;\n }\n\n body:not(.is-scrolling-messages) &.stuck {\n opacity: 0;\n\n span {\n pointer-events: none;\n }\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &.interactive {\n cursor: pointer;\n }\n\n span {\n pointer-events: auto;\n }\n }\n\n &.scrolled:not(.is-animating) .sticky-date {\n position: sticky;\n top: 0.625rem;\n }\n\n &.is-animating {\n overflow: hidden;\n }\n\n &.is-animating .message-select-control {\n display: none !important;\n }\n\n .has-header-tools & .sticky-date {\n top: 3.75rem !important;\n }\n\n .local-action-message,\n .ActionMessage {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .ActionMessage {\n .action-link {\n cursor: pointer;\n\n &:hover {\n text-decoration: underline;\n }\n }\n }\n\n .sticky-date + .ActionMessage {\n margin-top: -0.5rem;\n }\n\n @media (min-width: 1276px) {\n width: 100%;\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n .messages-container {\n width: calc(100% - var(--right-column-width));\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n\n body:not(.animating-right-column) #Main.right-column-open &.select-mode-active,\n #Main.right-column-open &:not(.select-mode-active),\n body.animating-right-column &:not(.select-mode-active) {\n width: calc(100% - var(--right-column-width));\n\n .messages-container {\n width: 100%;\n }\n }\n }\n\n @media (max-width: 600px) {\n transition: transform var(--layer-transition);\n\n body.enable-symbol-menu-transforms & {\n transform: translate3d(0, 0, 0);\n }\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n .animating > div > & {\n &::-webkit-scrollbar {\n width: 0;\n }\n\n /* Styles for Firefox */\n @supports (scrollbar-width: none) {\n padding-right: 0.6875rem;\n scrollbar-width: none;\n }\n }\n}\n",".ScrollDownButton {\n --base-bottom-pos: 6rem;\n\n position: absolute;\n bottom: var(--base-bottom-pos);\n right: max(1rem, env(safe-area-inset-right));\n opacity: 0;\n transform: translateY(4.5rem);\n transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;\n z-index: var(--z-scroll-down-button);\n pointer-events: none;\n\n body.animation-level-0 & {\n transform: none !important;\n\n transition: opacity 0.15s;\n }\n\n @media (max-width: 600px) {\n right: 0.5rem;\n bottom: 4.5rem;\n\n body:not(.keyboard-visible) & {\n bottom: calc(4.5rem + env(safe-area-inset-bottom));\n }\n }\n\n &-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n > .Button {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n color: var(--color-composer-button);\n\n i {\n font-size: 1.75rem;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translateX(0);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n #Main.right-column-open & {\n transform: translateX(calc(-1 * var(--right-column-width)));\n }\n }\n\n @media (max-width: 600px) {\n > .Button {\n width: 2.875rem;\n height: 2.875rem;\n }\n }\n }\n\n &.revealed {\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n\n &.no-composer:not(.with-extra-shift) {\n transform: translateY(4rem);\n }\n }\n\n .unread-count {\n min-width: 1.5rem;\n height: 1.5rem;\n padding: 0 0.4375rem;\n border-radius: 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.3125rem;\n right: -0.3125rem;\n\n background: var(--color-green);\n color: white;\n\n pointer-events: none;\n\n @media (max-width: 600px) {\n top: -0.6875rem;\n right: auto;\n }\n }\n\n @media (max-width: 600px) {\n body.is-symbol-menu-open & {\n bottom: calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height));\n }\n }\n}\n",".BotKeyboardMenu {\n .bubble {\n width: 100% !important;\n max-width: 27rem;\n border-radius: var(--border-radius-default-small);\n }\n\n .content {\n display: flex;\n flex-direction: column;\n padding: 0.1875rem 0.625rem;\n max-height: 80vh;\n overflow: auto;\n\n @media (max-width: 600px) {\n max-height: 75vh;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .row + .row {\n margin-top: 0.375rem;\n }\n\n .Button {\n flex: 1;\n width: auto;\n height: auto;\n min-height: 3.0625rem;\n border-radius: var(--border-radius-messages-small);\n border: 2px solid var(--color-primary);\n background: var(--color-background);\n color: var(--color-primary);\n font-weight: 500;\n text-transform: none;\n\n &:hover {\n color: #fff;\n border-color: var(--color-primary-shade);\n background: var(--color-primary-shade);\n }\n }\n\n .Button + .Button {\n margin-left: 0.375rem;\n }\n }\n}\n",".ComposerEmbeddedMessage {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n}\n",".WebPagePreview {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n // TODO Remove duplication with `.ComposerEmbeddedMessage`\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n --accent-color: var(--color-primary);\n\n .ComposerEmbeddedMessage + & {\n margin-top: 0.75rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n\n .WebPage {\n flex-grow: 1;\n margin: 0.1875rem 0 0.1875rem 0.125rem;\n max-width: calc(100% - 3.375rem);\n\n &::before {\n top: 0.125rem;\n bottom: 0.0625rem;\n }\n\n &.with-video .media-inner {\n display: none;\n }\n\n .site-title,\n .site-description {\n flex: 1;\n max-width: 100%;\n max-height: 1rem;\n }\n\n .site-title {\n margin-top: 0.125rem;\n margin-bottom: 0.1875rem;\n }\n\n .site-description {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n}\n","@import \"../../../styles/mixins\";\n\n.Composer {\n align-items: flex-end;\n\n .select-mode-active + .middle-column-footer & {\n position: absolute;\n padding-right: 2rem;\n bottom: env(safe-area-inset-bottom);\n\n @media (max-width: 600px) {\n padding-right: 1rem;\n }\n\n &::before {\n right: 2.125rem;\n\n @media (max-width: 600px) {\n right: 1rem;\n }\n }\n\n .svg-appendix {\n opacity: 0;\n }\n }\n\n .form-control {\n --border-width: 0;\n }\n\n @keyframes show-send-as-button {\n from {\n width: 1rem;\n transform: scale(0);\n }\n\n to {\n width: 3.5rem;\n transform: scale(1);\n }\n }\n\n > .Button {\n flex-shrink: 0;\n margin-left: 0.5rem;\n\n &:not(.danger) {\n color: var(--color-composer-button);\n }\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n }\n\n .icon-send,\n .icon-schedule,\n .icon-microphone-alt,\n .icon-check {\n position: absolute;\n }\n\n &:not(:active):not(:focus):not(:hover) {\n .icon-send,\n .icon-schedule,\n .icon-check {\n color: var(--color-primary);\n }\n }\n\n &.cancel {\n position: relative;\n z-index: 1;\n\n &:hover,\n &.active {\n background: var(--color-chat-hover);\n }\n }\n\n &.recording {\n position: relative;\n z-index: 0;\n transition: box-shadow 0.1s;\n }\n\n &.send {\n .icon-send {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-microphone-alt,\n .icon-check,\n .icon-schedule {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.schedule {\n .icon-schedule {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-microphone-alt,\n .icon-check,\n .icon-send {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.record {\n .icon-microphone-alt {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-send,\n .icon-check,\n .icon-schedule {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.edit {\n .icon-check {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-send,\n .icon-microphone-alt,\n .icon-schedule {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n body.animation-level-0 &,\n body.animation-level-1 & {\n .icon-send,\n .icon-microphone-alt,\n .icon-check,\n .icon-schedule {\n animation-duration: 0ms !important;\n }\n }\n }\n\n .send-as-button {\n z-index: 1;\n }\n\n body:not(.animation-level-0) & .send-as-button.appear-animation {\n animation: 0.25s ease-in-out forwards show-send-as-button;\n transform-origin: right;\n }\n\n .mobile-symbol-menu-button {\n width: 2.875rem;\n height: 2.875rem;\n position: relative;\n\n .icon-smile,\n .icon-keyboard,\n .Spinner {\n position: absolute;\n }\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n\n .icon-smile {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-keyboard,\n .Spinner {\n animation: hide-icon 0.4s forwards ease-out;\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n &.is-loading {\n .Spinner {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-keyboard,\n .icon-smile {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.menu-opened {\n .icon-keyboard {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-smile,\n .Spinner {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n }\n}\n\n#message-compose {\n flex-grow: 1;\n max-width: calc(100% - 4rem);\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n border-bottom-right-radius: 0;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n position: relative;\n z-index: 1;\n\n .svg-appendix {\n position: absolute;\n bottom: -0.1875rem;\n /* stylelint-disable-next-line plugin/whole-pixel */\n right: -0.551rem; // This value is correct. Safari fix\n width: 0.5625rem;\n height: 1.25rem;\n transition: opacity 200ms;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--color-background);\n }\n }\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3.375rem);\n }\n}\n\n.message-input-wrapper {\n display: flex;\n\n > .Spinner {\n align-self: center;\n --spinner-size: 1.5rem;\n margin-right: -0.5rem;\n }\n\n > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 3.5rem;\n margin: 0;\n padding: 0;\n align-self: flex-end;\n\n &:not(.faded):not(.activated) {\n color: var(--color-composer-button);\n }\n\n + .Button {\n margin-left: -1rem;\n }\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n\n + .Button {\n margin-left: -0.6875rem;\n }\n }\n\n &.bot-commands {\n color: var(--color-primary) !important;\n\n // SymbolMenu button should be accessible if BotCommandsMenu opened\n body.is-touch-env &.activated + .Button.mobile-symbol-menu-button {\n z-index: calc(var(--z-menu-backdrop) + 1);\n }\n }\n\n &.scheduled-button i::after {\n content: \"\";\n position: absolute;\n top: 0.75rem;\n right: 0.875rem;\n border: 0.1875rem solid var(--color-background);\n box-sizing: content-box;\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 50%;\n background: var(--color-green-darker);\n box-shadow: -0.375rem -0.25rem 0 -0.1875rem var(--color-background);\n @media (max-width: 600px) {\n top: 0.5rem;\n right: 0.5rem;\n }\n }\n }\n\n > .input-group {\n flex-grow: 1;\n margin-bottom: 0;\n }\n\n .recording-state {\n display: inline-block;\n position: relative;\n line-height: 3.5rem;\n height: 3.5rem;\n padding: 0 3.125rem 0 1rem;\n font-family: \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n\n &::after {\n content: \"\";\n width: 0.75rem;\n height: 0.75rem;\n background: var(--color-error);\n border-radius: 0.375rem;\n position: absolute;\n top: 50%;\n margin-top: -0.375rem;\n right: 1.3125rem;\n animation: recording-blink-like-macos 1.5s infinite;\n }\n\n @media (max-width: 600px) {\n height: 2.875rem;\n line-height: 2.875rem;\n }\n }\n}\n\n#message-input-text,\n#caption-input-text {\n position: relative;\n\n .form-control {\n padding: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2)\n calc(0.9rem - var(--border-width));\n overflow: hidden;\n line-height: 1.375;\n font-family: Roboto, -apple-system, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n unicode-bidi: plaintext;\n text-align: initial;\n font-size: var(--composer-text-size, 1rem);\n\n body.is-ios &,\n body.is-macos & {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\",\n sans-serif;\n }\n\n &.overflown {\n overflow-y: auto;\n overflow-x: hidden;\n }\n\n &.touched,\n &:focus {\n & + .placeholder-text {\n display: none;\n }\n }\n\n &.focus-disabled {\n pointer-events: none;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n position: absolute;\n color: var(--color-placeholders);\n pointer-events: none;\n unicode-bidi: plaintext;\n text-align: initial;\n line-height: 1.3125;\n font-size: var(--composer-text-size, 1rem);\n top: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);\n bottom: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .forced-placeholder {\n z-index: var(--z-below);\n left: 0;\n }\n\n &[dir=\"rtl\"] .placeholder-text {\n right: 0;\n }\n\n .text-entity-link {\n color: var(--color-links) !important;\n cursor: default;\n text-decoration: none;\n\n &:hover,\n &:active,\n &:visited {\n text-decoration: underline !important;\n }\n }\n\n .spoiler {\n background-image: url(\"../../../assets/spoiler-dots-black.png\");\n background-size: auto min(100%, 1.125rem);\n border-radius: 0.5rem;\n padding: 0 0.3125rem 0.125rem 0.3125rem;\n text-shadow: -2px -2px 0 var(--color-background), 2px -2px 0 var(--color-background),\n -2px 2px 0 var(--color-background), 2px 2px 0 var(--color-background);\n }\n\n html.theme-dark & .spoiler {\n background-image: url(\"../../../assets/spoiler-dots-white.png\");\n }\n\n .clone {\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n pointer-events: none;\n z-index: -10;\n unicode-bidi: plaintext;\n text-align: initial;\n }\n}\n\n#message-input-text {\n flex-grow: 1;\n\n .form-control {\n margin-bottom: 0;\n background: transparent !important;\n border: none !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n caret-color: var(--color-text);\n min-height: 3.5rem;\n max-height: 26rem;\n line-height: 1.3125;\n padding: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n white-space: pre-wrap;\n\n @media (max-width: 600px) {\n height: 2.875rem;\n min-height: 2.875rem;\n max-height: 16rem;\n padding: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n overflow: auto;\n }\n\n transition: height 100ms ease;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n top: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n\n @media (max-width: 600px) {\n top: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n }\n }\n\n &:not(:only-child) {\n .form-control {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n .ComposerEmbeddedMessage + .message-input-wrapper &,\n .WebPagePreview + .message-input-wrapper & {\n .form-control.overflown {\n margin-top: 0.75rem;\n }\n }\n\n .emoji {\n width: 1.25rem;\n height: 1.25rem;\n margin: 0 1px -5px;\n vertical-align: 0;\n pointer-events: none;\n }\n}\n\n#caption-input-text {\n .form-control {\n height: 3.25rem;\n min-height: 3.25rem;\n max-height: 15rem;\n }\n\n .placeholder-text {\n bottom: 0.8125rem;\n left: 0.9375rem;\n }\n}\n\n.composer-tooltip {\n position: absolute;\n bottom: calc(100% + 0.5rem);\n left: 0;\n width: 100%;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0;\n max-height: 15rem;\n\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n opacity: 0;\n transform: translateY(1.5rem);\n transform-origin: bottom;\n transition: opacity var(--layer-transition), transform var(--layer-transition);\n\n &:not(.shown) {\n display: none;\n }\n\n &.open {\n opacity: 1;\n transform: translateY(0);\n }\n\n .Loading {\n margin: 1rem 0;\n }\n}\n\n@keyframes recording-blink-like-macos {\n from {\n opacity: 1;\n }\n to {\n opacity: 0.3;\n }\n}\n","#middle-column-bg {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: -1;\n background-color: var(--theme-background-color);\n\n &::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background-color: var(--theme-background-color);\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n\n body:not(.animation-level-0) #root & {\n transition: transform var(--layer-transition), background 0.2s !important;\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n .theme-light & {\n background-image: url(\"../../assets/chat-bg.jpg\");\n\n @media (max-width: 600px) {\n background-image: url(\"../../assets/chat-bg-mobile.jpg\");\n }\n }\n }\n\n .custom-bg-color:not(.custom-bg-image) &::after {\n opacity: 0;\n }\n\n .custom-bg-image &::after {\n background-image: var(--custom-background) !important;\n filter: none;\n transform: scale(1.1);\n }\n\n .custom-bg-image.blurred &::after {\n filter: blur(12px);\n }\n\n @media screen and (min-width: 1276px) {\n body.animation-level-2 &::after {\n margin: -16rem -5rem -20rem 0;\n overflow: hidden;\n transform: scale(1);\n transform-origin: left center;\n transition: transform var(--layer-transition);\n }\n\n body.animation-level-2 #Main.right-column-open #MiddleColumn:not(.custom-bg-image) &::after {\n transform: scale(0.67) !important;\n }\n }\n\n body.animation-level-2 #Main.right-column-open #MiddleColumn:not(.custom-bg-image) &::after {\n @media screen and (min-width: 1921px) {\n transform: scale(0.8) !important;\n }\n\n @media screen and (min-width: 2600px) {\n transform: scale(0.95) !important;\n }\n }\n}\n\n#MiddleColumn {\n display: flex;\n justify-content: center;\n height: 100%;\n position: relative;\n z-index: 1;\n min-width: 0;\n\n @media (max-width: 600px) {\n overflow: hidden;\n }\n\n .messages-layout {\n --slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n > .Transition {\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n > div {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n }\n\n .Composer {\n #message-compose {\n transform: scaleX(1) translateX(0);\n transition: transform var(--select-transition), border-bottom-right-radius var(--select-transition);\n\n &::before {\n transform: scaleX(-1) translateX(0);\n transition: transform var(--select-transition);\n }\n\n body.animation-level-0 & {\n &,\n &::before {\n transition: none !important;\n }\n }\n }\n\n .message-input-wrapper,\n &::before {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Button {\n opacity: 1;\n transform: scale(1);\n transition: opacity var(--select-transition), transform var(--select-transition), background-color 0.15s,\n color 0.15s;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &.hover-disabled,\n &:not(.shown) {\n pointer-events: none;\n }\n\n &:not(.shown) {\n .ComposerEmbeddedMessage {\n height: 0;\n }\n\n #message-compose {\n transform: scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));\n border-bottom-right-radius: var(--border-radius-messages);\n\n &::before {\n transform: scaleX(-1) translateX(200%);\n }\n }\n\n #editable-message-text {\n height: 3.5rem !important;\n\n @media (max-width: 600px) {\n height: 2.5rem !important;\n }\n }\n\n .message-input-wrapper,\n &::before {\n opacity: 0;\n }\n\n > .Button {\n opacity: 0 !important;\n transform: scale(0.5);\n }\n }\n }\n\n .messaging-disabled {\n transform: scaleX(1);\n transition: transform var(--select-transition);\n\n .messaging-disabled-inner span {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &:not(.shown) {\n transform: scaleX(var(--composer-hidden-scale, 1));\n pointer-events: none;\n\n .messaging-disabled-inner span {\n opacity: 0;\n }\n }\n\n &-inner {\n width: 100%;\n padding: 1rem;\n border-radius: var(--border-radius-messages);\n background: var(--color-background);\n color: var(--color-text-secondary);\n text-align: center;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n }\n\n .middle-column-footer {\n width: 100%;\n max-width: var(--messages-container-width);\n padding: 0 1rem;\n position: relative;\n display: flex;\n align-items: flex-end;\n z-index: var(--z-middle-footer);\n\n transform: translate3d(0, 0, 0);\n transition: top 200ms, transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n @media (min-width: 1276px) {\n width: calc(100% - var(--right-column-width));\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0 0.5rem;\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n &:not(.no-composer) {\n padding-bottom: env(safe-area-inset-bottom);\n top: 0;\n\n body.keyboard-visible & {\n top: env(safe-area-inset-bottom);\n }\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -0.5625rem;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 0%,\n rgba(255, 255, 255, 0.4) 2%,\n rgba(255, 255, 255, 0.4) 98%,\n rgba(255, 255, 255, 0) 100%\n );\n opacity: 0;\n transition: opacity 350ms ease;\n\n @media (max-width: 600px) {\n left: -2%;\n right: -2%;\n }\n }\n\n &.with-notch::before {\n opacity: 1;\n }\n\n html.theme-dark &::before {\n background: linear-gradient(\n 90deg,\n rgba(127, 127, 127, 0) 0%,\n rgba(127, 127, 127, 0.4) 2%,\n rgba(127, 127, 127, 0.4) 98%,\n rgba(127, 127, 127, 0) 100%\n );\n }\n }\n}\n\n/* Common styles for message list fade-out shadow */\n.Composer,\n.MessageSelectToolbar,\n.messaging-disabled {\n margin-bottom: 1.25rem;\n\n @media (max-width: 600px) {\n margin-bottom: 0.5rem;\n }\n}\n\n.Composer,\n.MessageSelectToolbar,\n.unpin-all-button,\n.join-subscribe-button,\n.messaging-disabled {\n width: 100%;\n display: flex;\n justify-content: center;\n position: relative;\n}\n\n.MessageSelectToolbar-inner,\n.unpin-all-button,\n.join-subscribe-button,\n.messaging-disabled {\n .mask-image-disabled & {\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-messages);\n }\n}\n\n.middle-column-footer-button-container {\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n padding-bottom: 1.25rem;\n\n .unpin-all-button {\n text-transform: capitalize;\n color: var(--color-black);\n\n @media (hover: hover) {\n &:hover {\n .icon-unpin {\n color: var(--color-white);\n }\n }\n }\n\n @media (max-width: 600px) {\n &:active,\n &:focus {\n .icon-unpin {\n color: var(--color-white);\n }\n }\n }\n\n .icon-unpin {\n margin-inline-start: -0.4375rem;\n margin-inline-end: 0.75rem;\n color: var(--color-text-secondary);\n font-size: 1.5rem;\n transition: color 0.15s;\n }\n }\n\n .join-subscribe-button,\n .unpin-all-button {\n height: 3.5rem;\n transform: scaleX(1);\n transition: transform var(--select-transition), background-color 0.15s, color 0.15s;\n\n .select-mode-active + .middle-column-footer & {\n box-shadow: none;\n transform: scaleX(var(--unpin-hidden-scale));\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n }\n }\n\n @media (max-width: 600px) {\n padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));\n }\n\n .mask-image-disabled &::before {\n background: unset;\n }\n}\n",".RightHeader {\n display: flex;\n align-items: center;\n height: var(--header-height);\n padding: 0.5rem 0.8125rem;\n pointer-events: auto;\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .close-button {\n flex-shrink: 0;\n }\n\n > .Transition {\n flex: 1;\n height: 100%;\n\n > div {\n display: flex;\n align-items: center;\n }\n }\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n }\n\n .tools {\n display: flex;\n margin-left: auto;\n }\n\n .SearchInput {\n margin-left: 1rem;\n\n @media (min-width: 600px) {\n margin-right: 1rem;\n }\n }\n\n .DropdownMenu {\n margin-left: auto;\n }\n}\n","@import \"../../styles/mixins\";\n\n.Profile {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n overflow-x: hidden;\n overflow-y: scroll;\n @include overflow-y-overlay();\n\n > .profile-info > .ChatInfo {\n grid-area: chat_info;\n\n .status.online {\n color: var(--color-primary);\n }\n }\n\n > .profile-info > .ChatExtra {\n padding: 0.875rem 0.5rem 0.5rem;\n box-shadow: inset 0 -0.0625rem 0 0 var(--color-background-secondary-accent);\n border-bottom: 0.625rem solid var(--color-background-secondary);\n\n .narrow {\n margin-bottom: 0;\n }\n\n .inactive.no-selection {\n user-select: auto;\n -webkit-user-select: auto !important;\n }\n\n .Switcher {\n margin-left: auto;\n }\n [dir=\"rtl\"] {\n .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n }\n\n .FloatingActionButton {\n z-index: 1;\n }\n}\n\n.shared-media {\n display: flex;\n flex-direction: column-reverse;\n\n .TabList {\n background: var(--color-background);\n top: -1px;\n z-index: 1;\n\n .Tab {\n padding: 1rem 0.75rem;\n\n span {\n white-space: nowrap;\n }\n\n i {\n bottom: -1rem;\n }\n }\n }\n\n .Transition {\n flex: 1;\n }\n\n .content {\n &.empty-list {\n height: 100%;\n padding-top: 5rem;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n }\n\n &.media-list {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: 0.0625rem;\n }\n\n &.documents-list {\n padding: 1.25rem;\n\n & .File + .File {\n margin-top: 1.25rem;\n }\n }\n\n &.links-list {\n padding: 1.25rem;\n\n .ProgressSpinner,\n .message-transfer-progress {\n display: none;\n }\n }\n\n &.audio-list,\n &.voice-list {\n padding: 1.25rem;\n\n & .Audio {\n .media-loading {\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n & + .Audio {\n margin-top: 1.6875rem;\n }\n }\n }\n\n &.commonChats-list,\n &.members-list {\n padding: 0.5rem 1rem;\n\n @media (max-width: 600px) {\n padding: 0.5rem 0;\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n }\n }\n }\n}\n",".AddChatMembers {\n height: 100%;\n overflow: hidden;\n position: relative;\n\n &-inner {\n height: 100%;\n overflow: hidden;\n }\n}\n","#RightColumn {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--right-column-width);\n height: 100%;\n padding-right: env(safe-area-inset-right);\n transform: translate3d(var(--right-column-width), 0, 0);\n background: var(--color-background);\n border-left: 1px solid var(--color-borders);\n z-index: var(--z-right-column);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n @media (max-width: 1275px) {\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-left: none;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n transform: translate3d(110vw, 0, 0);\n }\n\n > .Transition {\n height: calc(100% - var(--header-height));\n overflow: hidden;\n }\n\n .Management .section > .ChatInfo {\n padding: 0 1.5rem;\n margin: 1rem 0;\n text-align: center;\n\n .Avatar {\n margin: 0 auto 0.5rem;\n\n &.no-photo {\n cursor: default !important;\n }\n }\n\n .title {\n display: flex;\n justify-content: center;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 2rem;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-bottom: 0.5rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n color: #868e96;\n }\n }\n}\n\n#RightColumn-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--z-right-column);\n overflow: hidden;\n visibility: hidden;\n pointer-events: none;\n\n @media (max-width: 1275px) {\n position: fixed;\n }\n\n &.is-hidden {\n display: none;\n }\n\n .overlay-backdrop {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background: black;\n opacity: 0;\n\n @media (max-width: 600px) {\n transition: opacity var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n }\n }\n\n #Main.right-column-open &,\n body.animating-right-column & {\n visibility: visible;\n }\n\n #Main.right-column-open & {\n @media (max-width: 600px) {\n .overlay-backdrop {\n opacity: var(--layer-blackout-opacity);\n }\n }\n\n #RightColumn {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n }\n }\n}\n","#Main {\n height: 100%;\n text-align: left;\n overflow: hidden;\n\n @media (min-width: 1276px) {\n position: relative;\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n @media (min-width: 926px) {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 100%;\n }\n}\n\n.has-group-call-header {\n --group-call-header-height: 2rem;\n #LeftColumn, #MiddleColumn, #RightColumn-wrapper {\n height: calc(100% - 2rem);\n margin-top: 2rem;\n }\n}\n\n#LeftColumn {\n min-width: 12rem;\n width: 33vw;\n max-width: 26.5rem;\n height: 100%;\n position: relative;\n\n & > div {\n height: 100%;\n overflow: hidden;\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n @media (min-width: 926px) {\n max-width: 40vw;\n }\n\n @media (min-width: 1276px) {\n width: 25vw;\n max-width: 33vw;\n }\n\n @media (max-width: 925px) {\n position: fixed;\n left: 0;\n top: 0;\n height: calc(var(--vh, 1vh) * 100);\n width: 26.5rem !important;\n\n transform: translate3d(-5rem, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background: black;\n opacity: var(--layer-blackout-opacity);\n transition: opacity var(--layer-transition);\n z-index: 1;\n\n body.animation-level-0 & {\n transition: none;\n }\n\n // @optimization\n body.is-android & {\n display: none;\n }\n\n body.is-android .middle-column-shown & {\n display: block;\n }\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(0, 0, 0);\n\n &::after {\n opacity: 0;\n pointer-events: none;\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n }\n\n @media (max-width: 600px) {\n max-width: none;\n transform: translate3d(-20vw, 0, 0);\n left: env(safe-area-inset-left) !important;\n width: calc(100vw - env(safe-area-inset-left)) !important;\n }\n}\n\n#RightColumn {\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100 + 1px);\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n .overlay-backdrop {\n transition: none;\n }\n }\n}\n\n#Main.history-animation-disabled .overlay-backdrop {\n transition: none;\n}\n\n#MiddleColumn {\n border-left: 1px solid var(--color-borders);\n\n @media (max-width: 925px) {\n max-width: none;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(26.5rem, 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n border-left: none;\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(100vw, 0, 0);\n }\n\n #Main.right-column-open & {\n transform: translate3d(-20vw, 0, 0);\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n}\n\nbody.is-android.animation-level-1 {\n --layer-transition: 250ms ease-in-out;\n\n #LeftColumn, #MiddleColumn, #RightColumn {\n transition: transform var(--layer-transition), opacity var(--layer-transition);\n }\n\n #Main:not(.middle-column-shown) {\n #MiddleColumn {\n display: none;\n }\n }\n\n #Main:not(.middle-column-open) {\n #MiddleColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.middle-column-open {\n #LeftColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n\n #Main:not(.right-column-shown) {\n #RightColumn {\n display: none;\n }\n }\n\n #Main:not(.right-column-open) {\n #RightColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.right-column-open {\n #MiddleColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"176.c9baace07c5f15a8c611.css","mappings":"AAAA,0BACE,kBACA,MACA,OACA,WAEA,mDACA,UAEA,qCACE,4BACA,UAGF,sCACE,aAIJ,yBACE,iBACA,cACA,aACA,mBACA,qBACA,iBACA,+BACA,2CAEA,qCACE,eAGF,kCACE,wBAGF,qCACE,OACA,gCACA,mBACA,gBACA,wBACA,6BACA,mBAGF,yBACE,qCACE,6BAIJ,qCACE,WAGA,YAEA,yCACE,aACA,mBACA,W;AC5DN,gBACE,kBAEA,oCACE,kBAEA,2HAGE,eACA,eACA,sBACA,6CACA,0BACA,oBAGF,uFAEE,kBACA,OACA,WAGF,4CACE,eAGF,2CACE,aAGF,+CACE,yBAEA,uDACE,qEAGF,sDACE,qEAIJ,iDACE,gBAEA,iHAEE,gBAKN,gCACE,iBACA,cACA,iBACA,6BACA,qBACA,mBACA,WACA,kBACA,mBACA,gBACA,kBACA,cAGF,kDACE,gBACA,UACA,kCAGF,4CACE,sBAGF,0CACE,cACA,kBAGF,8BACE,gBACA,yCAEA,gBClFF,+BD8EA,8BC7EE,mBAGA,mBDoFA,wIACE,2B;AEjGN,eACE,kBACA,WACA,YACA,2BAEA,4DAEA,sCACE,0BACA,UAEA,wBAEA,+CACE,UAIJ,wBACE,wBAEA,yBAHF,wBAKI,sCACA,6BAKF,gFAEE,kBAIA,0DACE,iCAGF,gDACE,0CAKF,0CACE,iCAGF,oDACE,0C;ACnDR,iBACE,YACA,kBACA,aACA,sBACA,gBACA,UAEA,6BACE,OACA,gBAGF,8BACE,YACA,aACA,sBACA,gBAEA,gDACE,gBACA,6BAEA,2DACE,SAIJ,uCACE,2BACA,sBACA,mBACA,gBACA,UAGF,mCACE,cACA,qBACA,sBAEA,wCACE,mBACA,oBAIJ,0CACE,OACA,gBAIJ,+FAGE,YACA,gBAGF,6BACE,kBACA,YACA,UACA,WACA,c;ACjEJ,SACE,YAGF,aACE,4BACA,oCACA,aACA,mBACA,cACA,yCAEA,gBACE,gBACA,kBACA,gBACA,qBACA,kBAGF,0BACE,oBACA,+BAEA,yBAJF,0BAKI,6BAIJ,yBAzBF,aA0BI,eAGF,6BACE,aACA,cAEA,2CACE,mB;ACtCN,aACE,aACA,iBACA,oBACA,uBAEA,oCACE,2BAGF,qBACE,cACA,eAGF,4BACE,6CACA,2DACA,0CACA,2CAIA,oCACE,WACA,YAEA,sCACE,mBACA,sBAIJ,8BACE,kBACA,oBACA,sBAEA,wCACE,oBAIJ,+EAEE,UACA,mBACA,uEAGF,yLAIE,UACA,qBAIJ,4BACE,kBACA,iBAEA,kDACE,kBACA,2BACA,SACA,YACA,WACA,eACA,kBAGF,gHAEE,mBAGF,2CACE,UACA,kBAEA,kBACA,mCACA,aACA,2BACA,8DACA,WACA,eACA,oBACA,eACA,iDAEA,wDACE,gBACA,0EACE,gBAKN,yKAGE,UACA,mBAKF,sCACE,6CAGF,qDACE,iCACA,iBACA,iBACA,iBACA,sBACA,uBACA,kCAIJ,qBACE,aACA,uBACA,sBACA,cACA,gBACA,kBACA,gBACA,eACA,kDAEA,2BACE,wDAGF,iDAfF,qBAgBI,iBAGF,yCACE,cACA,gBACA,6BACA,iBACA,mBACA,gBACA,uBAEA,qDACE,8BACA,qBAIJ,+BACE,8BACA,kCACA,qBACA,mBACA,gBACA,uBACA,mBAEA,2CACE,8BACA,qB;AC1KR,kBACE,kBACA,SACA,OACA,QACA,gBACA,gBACA,+CACA,aACA,mBACA,8BACA,mBACA,qCACA,mCACA,WACA,eAEA,0BACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,4BACE,aAGF,yBACE,oCACE,2BAIJ,wBACE,aACA,sBAEA,+BACE,kBACA,wBAGF,sCACE,iBACA,kCAIJ,2BACE,aACA,mBACA,mBAEA,mCACE,sBAEA,+CACE,WACA,YAGF,qDACE,cACA,eACA,6CAKN,wBACE,cACA,qBACA,gBACA,kBACA,WAIJ,0BACE,wDACE,8C;ACTJ,cACE,aACA,mBACA,WACA,+CACA,mCACA,kBACA,+BACA,kBACA,qBACA,mDACA,uDAEA,yBAbF,cAcI,kBAEA,kDACA,qDAGF,0BACE,WAGA,YAEA,8BACE,aACA,mBACA,WAIJ,2BACE,oBACA,mBACA,kBAEA,yBALF,2BAMI,eAGF,yCACE,kBACA,eACA,kBACA,sBACA,iBACA,oBACA,gBACA,kBAEA,kBACA,aACA,cAEA,6BACA,WACA,oBAEA,gDACE,gCAKN,iCACE,YACA,gBAGF,kEACE,2BAGF,4BACE,aACA,mBACA,yBACA,iBACA,cAGE,qLAGE,2BAIJ,iDACE,2CACE,+BACA,6CAEA,mEACE,mEAKN,0BA1BF,4BA2BI,+BACA,6CAEA,oDACE,mENpLN,oIM0LI,oBAIJ,iDACE,8GAEE,UAEA,8JACE,WAnMN,4HAEE,kBACA,SACA,OACA,QACA,gBACA,uDAEA,aACA,2BACA,oBACA,uBACA,mDACA,oDACA,mCAEA,4IACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,sKACE,gBACA,sBAIJ,sDACE,mBACA,aACA,qBAEA,8DACE,gBACA,YAGF,8DACE,sBAGF,oEACE,iBAIJ,8DACE,YACA,cACA,iBAEA,sEACE,YACA,eAGF,4EACE,eAIJ,iFACE,aAsIA,0BACE,iEACE,uDAKN,oHAEE,mDAEA,kKACE,eAIJ,iBACE,gBACA,mBACA,qBACA,gBACA,SACA,gBACA,uBACA,uBAEA,4DAEE,oBACA,gBAGF,yBAhBF,iBAiBI,cACA,gBACA,wBAGF,0BACE,yCACE,kDAKN,wBACE,eACA,aACA,mBAEA,8BACE,aACA,sBACA,uBACA,YACA,gBAGF,+BACE,aACA,mBAEA,6CACE,cACA,eACA,mBACA,oBAIJ,uEAEE,eACA,uBAEA,0BACE,uHACE,kDAKN,qCACE,uBACA,gBACA,uBAEA,0BACE,6DACE,kDAMR,sBACE,qBAEA,wBACA,yBACA,oBAGF,mDAEE,kBACA,qBACA,SACA,kCACA,gBACA,mBACA,uBACA,qBAEA,uEACE,oBAGF,iEACE,2BAGF,2EACE,iBAIJ,8BACE,aACA,cAGF,2CACE,aACA,mBACA,iBACA,eACA,2BACA,mCAGE,oFACE,aAIJ,0BAdF,2CAeI,+BACA,+DAEA,mEACE,mEAIJ,gEACE,gBAGF,mDACE,cAGF,sDACE,kBACA,OACA,QACA,SACA,mCACA,oCACA,uDACA,+BACA,+DAEA,8DACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,2EACE,aACA,gBACA,OAEA,yFACE,eAIJ,0BAhCF,sDAiCI,+BACA,+DAEA,8EACE,qDAMR,mCACE,aACA,cACA,oBACA,uBACA,eACA,qBACA,kDACA,kBACA,gBACA,eAEA,yCACE,wDAGF,0DACE,kBACA,eACA,iBACA,cACA,kBACA,gBAEA,2FACE,eACA,cACA,uBACA,gCAGF,yFACE,8CACA,kBACA,sBACA,sCAGF,sFACE,kBACA,OACA,MACA,cACA,gCACA,uBACA,sBACA,sCAIJ,iDACE,gBACA,4BACA,mBACA,gBAEA,iDANF,iDAOI,iBAGF,wDACE,gBACA,kBACA,iBACA,YACA,2BACA,sBACA,gBACA,mBAEA,oEACE,mBAIJ,mDACE,kBACA,qBACA,gBACA,mBACA,gBACA,uBACA,SAEA,+DACE,mBAKN,gDACE,WACA,YAGF,uCACE,cACA,eACA,iBACA,qBACA,4BACA,mBACA,cAEA,qDACE,gBAKN,6BACE,cACA,iBACA,aACA,mBACA,yBAGE,8DACE,2BACA,UAIJ,2CACE,kBACA,iBAGF,oCACE,kBACA,eACA,YACA,gCACA,oBACA,WACA,iBACA,iBACA,gBACA,kBACA,cACA,QACA,MAMF,wFACE,mBAEA,kGACE,qBAKN,yBAtjBA,sEAEE,kBACA,SACA,OACA,QACA,gBACA,uDAEA,aACA,2BACA,oBACA,uBACA,mDACA,oDACA,mCAEA,sFACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,gHACE,gBACA,sBAIJ,2BACE,mBACA,aACA,qBAEA,mCACE,gBACA,YAGF,mCACE,sBAGF,yCACE,iBAIJ,mCACE,YACA,cACA,iBAEA,2CACE,YACA,eAGF,iDACE,eAIJ,sDACE,cAsfJ,mBACE,KACE,UAEF,GACE,W;ACnkBJ,iBACE,aACA,mBACA,yDACA,qBACA,2BACA,0CACA,kDACA,kBACA,gBACA,eACA,cAGE,0DACE,aAIJ,+BACE,gBACA,cACA,SACA,yCACA,iDAEA,uCACE,aACA,YACA,eAGF,+CACE,0BAGF,wCACE,cAIJ,yBACE,WACA,cACA,kBACA,aACA,gBACA,cACA,UACA,+BACA,kBAGF,uBACE,oCAGF,wBACE,qCAGF,gCACE,yDAGF,+BACE,gBACA,0BACA,aACA,8BAEA,8CACE,mBACA,gBACA,uBACA,sBACA,OACA,cAGF,iCACE,mBACA,gBACA,uBACA,gBACA,gBACA,OAEA,wCACE,aACA,aAIJ,sCACE,4DACA,6DACA,sCAIJ,0CACE,0BACA,YAGF,iCACE,WACA,YACA,iBACA,qBACA,mBACA,cAEA,uCACE,mBAIJ,8BACE,8BACA,gCACA,aACA,+BACA,uBACA,WACA,qCACA,sDAEA,sCACE,gBAGF,8CACE,oBAGF,4CACE,4BAGF,6CACE,gBACA,0B;AC/IN,uBACE,kBACA,aACA,mBACA,uBAEA,oCAEE,wBAEA,eAGF,wCACE,eACA,cACA,eACA,oBAEA,+CACE,YACA,aAGF,mDACE,qBAGF,gDACE,qBAKF,gDACE,eACA,gBAEA,uDACE,eACA,gBAIF,uDACE,kB;AC7CR,aACE,kBACA,eACA,SACA,QACA,aACA,mBACA,gCACA,sBACA,iBACA,WACA,eACA,eACA,0CAEA,oCACE,WACA,YACA,oBAGF,uFAGE,iBACA,mBAGF,2BACE,sBAIA,uCACE,oBAIJ,4BACE,6BAGF,gCACE,gBACA,uBACA,qBAGF,gCACE,oBACA,qBACA,mBACA,kBACA,eAGF,mCACE,6CACA,gBAGF,mEAEE,0BACA,0BACA,sBACA,sBACA,UACA,cACA,aACA,UACA,gBACA,6BAEA,qHACE,uBAIJ,qFAEE,sBACA,YACA,6BAGF,+GAEE,cAGF,4CACE,gBACA,eAGF,yBACE,QAGF,gDACE,oCAGF,oCACE,uBACA,oBACA,sBAEA,iDACE,8BAIJ,6DACE,gBAGF,kEACE,iBAIA,qCACE,SAEF,yCACE,QAMJ,6DACE,WACA,cACA,cAGF,6DACE,YAGF,6DACE,YAGF,6DACE,Y;ACnJF,wBACE,eAGF,kBACE,oB;ACNJ,SACE,aACA,mBACA,eAEA,qBACE,eAGF,iBACE,sBAGF,uBACE,cACA,eACA,mBACA,gBAEA,qCACE,eACA,iBACA,qBACA,gBAGF,sCACE,iBACA,6B;AC5BN,YACE,aACA,qBACA,qBAEA,uBACE,gBAGF,8BACE,sBAGF,+BACE,kBACA,mBACA,cACA,wBACA,cACA,gBACA,kBACA,iBAEA,2CACE,oBACA,uBACA,iBAIJ,gCACE,kBACA,QACA,YACA,WACA,YACA,+BACA,8BACA,oBACA,iBACA,kBAEA,sCACE,8BAGF,gDACE,gBAGF,wCACE,UACA,qCACA,qBACA,uBACA,6BAIJ,+BACE,YACA,mBAGF,gCACE,kBAGF,8BACE,kBACA,QACA,cACA,gBACA,sBACA,iBACA,+BAEA,qBACA,yBACA,sBAGF,uBACE,WACA,YACA,kBACA,WACA,YACA,sDACA,oBACA,wBAGF,4BACE,iBACA,qBACA,2BACA,UAIA,qCACE,8BAGF,mCACE,0BAKN,iCACE,GACE,UAEF,KACE,W;ACpHJ,MACE,gBACA,mBAEA,yBAJF,MAKI,gBAGF,qBACE,gBACA,oBACA,iBACA,sBAGF,0CAEE,6BACA,kBAGF,iBACE,oBACA,aACA,mBACA,oBAGF,yBACE,2BACA,kBAGF,oBACE,mBACA,oBAGF,6BAEE,qBAEA,mDACE,qBAGF,+CACE,qBACA,mBAKA,gJACE,aACA,yCAEA,gMACE,4CAGF,oMACE,qCAIJ,4IACE,cACA,qCAMF,wMACE,iCAIJ,+CACE,aAMA,sCACE,aACA,sCAEA,mDACE,qCAMR,mBAEE,0CAEA,+BACE,2CAGF,gCAEE,2CACA,4CACE,2CAKN,0BACE,oBACA,mBACA,2BACA,oBACA,mBACA,gBAEA,kCACE,yCACA,eACA,uBAEA,+CACE,6CAGF,oDACE,iBAKN,sBACE,iBACA,iBACA,qBAEA,+BACE,yBAEA,wDACE,0BAIJ,0BACE,oBAIJ,+BACE,4BACA,iBACA,eACA,qBACA,2CAGF,sBACE,kCACA,yCACE,2BAIJ,wCAEE,mBACA,qBAGF,cACE,oBACA,eAEA,2BACE,0BACA,mDAIJ,cACE,sB;AC3LJ,SACE,kBACA,sBACA,qBACA,yDACA,qBACA,gBACA,kBAEA,iBACE,WACA,cACA,kBACA,MACA,SACA,OACA,cACA,+BACA,sBAGF,cACE,aACA,sBACA,uBAGF,sBACE,oBACA,iCAEA,sFAGE,6DAGF,mCACE,WACA,YACA,aACA,2BAEA,uCACE,WACA,YAKN,iCACE,4BACA,8BAGF,2BACE,aACA,mBAEA,yCACE,QACA,mBAGF,wCACE,QACA,cAIA,kDACE,wBASF,kMACE,WACA,qBACA,iCACA,cACA,YAKN,oEAGE,sBACA,eAGF,oBACE,0BACA,gBACA,sBAGF,qBACE,gBACA,sBAGF,2BACE,iBACA,gBAEA,uCACE,qBAIJ,kBACE,6BAEA,0BACE,UACA,Q;ACzHJ,gBACE,0BACA,gBAGF,sBACE,kBAGE,+CACE,eACA,aAEA,yBAJF,+CAKI,cAIJ,kDACE,kBACA,MACA,qBACA,cACA,oCACA,kDACA,wBACA,gBAEA,uDACE,kB;AC9BV,OACE,kBACA,gBAEA,mCACE,mCAGF,sEACE,6CAGF,0BACE,sBAEA,sDACE,oBACA,qCACA,sCAMF,0HACE,oBAKF,uJAGE,2BACA,iB;AClCN,YACE,kBACA,YACA,aACA,eAEA,+BACE,YACA,aACA,kBACA,gBAGF,2BACE,kBACA,OACA,MACA,kBACA,gBAGF,sBACE,kBACA,MACA,OACA,WACA,YACA,oBAGF,6BACE,YACA,iBACA,eACA,mBACA,qBAGF,kKAGE,a;ACzCJ,eACE,aACA,sBAEA,oBACE,aACA,mBAGF,uBACE,OACA,WACA,eACA,gCACA,kDACA,gBACA,oBAEA,+BACE,WACA,oCACA,UAEA,kBACA,MACA,OACA,QACA,SACA,kDACA,uBACA,yBAGF,6BACE,2CAEA,qCACE,WAIJ,qCACE,cAGF,oCACE,eAGF,yBACE,kBACA,kBACA,eACA,aACA,cAEA,0CACE,iBACA,YACA,cACA,yBAKN,0CACE,6BAGF,yCACE,gBAEA,uDACE,wDAGF,sDACE,yD;AC7EN,eACE,4CACA,uCAEA,aACA,WACA,mBACA,yCACA,6BACA,0BACA,mCACA,6DACA,2DACA,mBACA,gBACA,iBACA,0BACA,mBACA,eACA,4CACA,0CAEA,sCACE,2BAGF,8CACE,WACA,cACA,kBACA,kBACA,gBACA,eACA,eACA,gCACA,yDACA,UACA,oCAEA,gEACE,oBAGF,qEACE,2BAIJ,6BACE,kBACA,YACA,cACA,YACA,gBACA,uBACA,gCACA,uBACA,WACA,gCAEA,UACA,4BAEA,wBAfF,6BAgBI,sBAGF,mCACE,iCAGF,4CACE,UAGF,oCACE,uBACA,kBACA,kBACA,OACA,WACA,kBACA,eACA,cAGF,2CACE,eACA,kDACE,aAIJ,oDACE,cACA,iBACA,cAGF,sKAIE,aAIJ,qBACE,8BAEA,oDACE,UAGF,6BACE,2CAIJ,mHAKE,0CAGF,qDACE,iCAGF,sCACE,sBAGF,sCACE,yBAGF,6OAKE,wBAGF,sCACE,aAGF,8BACE,oBACA,iBACA,0BAGF,0BACE,yBACA,iBAGF,gCACE,oBACA,mBACA,wBACA,8BAEA,wCACE,uBACA,yCACA,oBACA,UACA,gBAEA,+CACE,WACA,qBAGF,gDACE,UAEA,wDACE,UAIJ,0DACE,6BAKN,iCACE,kBAEA,wCACE,WACA,qBACA,YACA,aACA,kBACA,+BACA,2BAIJ,wBACE,eACA,q2B;AClNJ,WACE,aACA,mBACA,WACA,eACA,kBACA,iBAEA,mBACE,6CACA,aACA,mBACA,eACA,mBACA,WACA,eACA,gBACA,6BACA,uDACA,sBACA,gBACA,kCACA,oBACA,0BACA,iBAEA,mFACE,eACA,gBACA,oBAGF,4BACE,aAEA,oCACE,sBACA,iDACA,cACA,eAEA,gDACE,SAKN,0BACE,iCACA,kBACA,UAGF,yBACE,mDAGF,iCACE,cAGF,gCACE,eAIJ,sBACE,mBAGF,2BACE,2BAGF,8BACE,4CACA,WACA,0CACE,0BAGF,qCACE,kBAEA,iDACE,iC;ACrFR,iBACE,kBACA,2BAEA,yBAJF,iBAKI,qCACA,yCACE,qCAEF,8BACE,qCAGF,mCACE,kCACA,2DACE,oCAEF,gDACE,qCAKN,qBACE,2BACA,0CAGF,wBACE,uBACA,0CAGF,+BACE,SACA,sBACA,qBACA,mBACA,mBACA,kBACA,uBAGF,mCACE,uBAKA,sGACE,kBACA,YACA,uBACA,YACA,iBACA,8CACA,qBACA,qBAEA,4KACE,kDACA,gBAGF,0KACE,WAGF,0KACE,aAGF,oVAEE,UAGF,0KACE,aAKF,wHACE,WACA,qBACA,sBAKN,+CACE,kBACA,YACA,uBACA,YACA,cACA,8CACA,iBACA,qBACA,oBAEA,kFACE,kDACA,gBAGF,iFACE,WAGF,iFACE,aAGF,kKAEE,UAGF,iFACE,aAKF,4CACE,WACA,cACA,WAGF,kDACE,oBACA,0BACA,oBAEA,iEACE,oBAMJ,4DACE,qCAEA,kEACE,gCAKN,oCACE,yCAEA,gDACE,8CAGF,mDACE,YAIJ,0CACE,wBACA,mBACA,qBACA,kBAEA,sDACE,mBAIJ,gCACE,mBACA,gBACA,uBACA,yDACA,gBACA,oBACA,0BACA,uBACA,aAEA,6CACE,gBACA,uBAGF,yFAEE,eAEA,qGACE,YAIJ,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,kEACE,0BAGF,sCACE,kBAGF,qCACE,qBACA,gBAGF,0CACE,oBAGF,6CACE,OACA,iBACA,iBACA,gBACA,iBACA,qBACA,6CAEA,0DACE,0BAKN,4BACE,iDAGF,iGAGE,mCAGF,sCACE,+BAEA,yGACE,WACA,qBACA,iCACA,YAIJ,kDACE,wBAGF,+DACE,qBAGF,kDACE,aAGF,+BACE,gBACA,kBACA,kBACA,eACA,gBACA,0BAEA,uCACE,6BAGF,4CAEE,gBAGF,kDAEE,eAKF,iEACE,wBAMA,2DACE,yBACA,UACA,8BAKN,0BACE,yBAGE,4CACE,kDAIJ,8CACE,oBAMF,8IAEE,sBACA,uBAIJ,uBACE,yBAEA,4CACE,iBAIJ,uBACE,gBACA,wCAEA,yBAJF,uBAKI,iBAGF,4CACE,kBAIA,8DACE,yBAKN,2CACE,qBACA,cACA,wBACA,kBACA,sBACA,2BAEA,sDACE,wDACA,kBAIJ,yDACE,gDACA,iDACA,0DAGF,mCACE,4BACA,6BAGF,yCACE,6BAEA,uEACE,oBACA,kBACA,YACA,4BACA,8BACA,gBACA,yCACA,4CAEA,oFACE,kBAIJ,sDACE,mBAOJ,0DACE,aACA,uBACA,mBAEA,kFACE,eAEA,wGACE,yBAKN,8DACE,sBAGF,gdAME,oBACA,qBAEA,4vBACE,sBAIJ,oEACE,sBAGF,sTAIE,mBACA,wBAEA,8fACE,yBAIJ,8EACE,gBAIF,4HAEE,sBAEA,gOACE,sBAIJ,8DACE,aACA,mBACA,uBAEA,oFACE,WACA,mBACA,+CAIJ,gIAEE,kBACA,aACA,mBACA,uBACA,WACA,WACA,yBAEA,wJACE,UAGF,4JACE,aACA,mBACA,uBACA,eACA,gBACA,kBACA,2BAGF,4MACE,6BAEA,wPACE,UAKN,8DACE,iBAGF,kEACE,iBAGF,sKAEE,2BACA,WACA,iBACA,kBACA,cACA,aACA,UACA,kBACA,qBACA,qBACA,0CAGF,wGACE,0BACA,oBACA,oBAIJ,8BACE,gBACA,aACA,eACA,qBAEA,2CACE,mBACA,wBAEA,uDACE,kBAIJ,uCACE,eAGF,6CACE,aACA,uBACA,2BACA,cAEA,+CACE,gBAGF,8DACE,kBACA,4CAEA,yBAJF,8DAKI,8BAGF,yBARF,8DASI,kBACA,UACA,8BAKN,4CACE,mBAGF,2CACE,cACA,eACA,cAEA,uDACE,MACA,OACA,SACA,QAIJ,qCACE,qBACA,kBAEA,gDACE,wDACA,kBAKF,uDACE,gBACA,4EACA,iEACE,+HAIF,oEACE,iBAKN,2CACE,eACA,iBAEA,0DACE,YAGF,yDACE,gBACA,kBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,2CACE,eACA,iBACA,gBACA,yBAJF,2CAKI,oBAGF,wDACE,mBAGF,+DACE,gBAGF,kDACE,WACA,YACA,qBAIJ,2CACE,eACA,mBACA,gBAEA,wDACE,kBAGF,+DACE,gBAGF,kDACE,WACA,YACA,qBAIJ,iDACE,wCACA,0CAGF,2CACE,4CACA,8CAEA,0DACE,mBAEA,2EACE,mBAEA,yBAHF,2EAII,cACA,UACA,gCAOV,mBAmCE,8DACA,+DACA,iEACA,kEArCA,+HAIE,oBAGF,uDACE,kBACA,kBACA,qBAEA,+DACE,WACA,cACA,kBACA,MACA,SACA,cACA,UACA,+BACA,kBAGF,gEACE,6BAEA,wEACE,UACA,eAUN,gCACE,oBACA,gCAIJ,qBACE,qBAGF,kBACE,oCACA,gCACA,sBACA,eACA,qBAEA,2EAGE,qCAIJ,mCAEE,wBACA,gCACA,qBACA,SACA,gBACA,kBACA,0DCnzBF,SACE,aACA,qBACA,sBACA,kBAEA,4CACA,wCACA,gDACA,4DACA,0CACA,mBACA,qCACA,iDACA,+CACA,+BACA,8BACA,kCACA,8HAGA,6BACA,4BAEA,wDACA,yDACA,2DACA,4DAEA,0BA7BF,SA8BI,gCAEF,yBAhCF,SAiCI,sBAGF,mBACE,yCAGF,sBACE,0CAGF,mDAEE,UACA,iCACA,8CAEA,iGACE,2BAIJ,iBACE,kBACA,SACA,OAEA,yBALF,iBAMI,aACA,eAIJ,yBACE,eACA,kBACA,cACA,iBACA,aACA,mBACA,uBACA,mBACA,UACA,uDACA,qBAEA,iCACE,qBAGF,+BACE,uBACA,qBAGF,8CACE,eAIJ,4CACE,4CAGF,6BACE,WACA,aAGF,uBACE,sBACA,yBAFF,uBAGI,wBAIJ,sBAGE,sBAKE,+DACE,wCAIF,2DACE,oBAMJ,6CACE,+DAKF,sDACE,UAIJ,mBACE,oBAEA,gEAEE,eAGF,yBARF,mBASI,sBAEA,gEAEE,qBAIJ,sDACE,iEAGF,4DACE,8DACA,iEAGF,sDACE,8DAGF,iCACE,iEAEA,+DACE,+BAKN,aACE,2BACA,gDACA,4CACA,oDACA,gEACA,8CACA,mBACA,wCACA,yCACA,2CACA,oCACA,0CACA,sCACA,8BACA,4BACA,4CAEA,0BAlBF,aAmBI,mBAGF,oDAEE,0DACA,4DACA,8DAGF,yBA7BF,aA8BI,sBAGF,gDACE,kEAGF,sDACE,+DACA,kEAGF,gDACE,+DAGF,2BACE,kEAEA,yDACE,gCACA,6BAMJ,2EAEE,kDACA,UACA,6DACA,wBAIJ,mBACE,mCAGF,oBACE,qCAEA,8BACE,qCAGF,kCACE,qCAEA,4CACE,qCAKN,6BACE,eAEA,yBAHF,6BAII,2CAIA,+GAEE,6BAIJ,mDACE,WACA,kBACA,aACA,gBACA,WACA,YACA,qCAKA,wIACE,qBAIJ,qDACE,UAKF,6CACE,8BAEA,0DACE,uBAEA,sEACE,8BAON,wDACE,8BAIJ,6HAEE,qDAGF,qIAEE,yDAGF,wCACE,eACA,aAIA,kGACE,yDACA,2BACA,qBAEA,yGACE,+BAKN,eACE,kBAEA,uCACE,kBACA,SACA,UACA,UAIJ,oCACE,kBACA,iDACE,uCAGF,4DACE,kBACA,UACA,aACA,eACA,WAGF,kFAEE,iEAIA,wEACE,8BAGF,0GAEE,6CAOJ,4FACE,8BAGF,wEACE,2BAKF,wDACE,gCAIA,+EACE,gCAKF,gFACE,6BAKF,oEACE,iBAGF,6EACE,gBACA,oCACA,qCAGF,uFACE,YAIJ,2DACE,gBAEA,mEACE,oBAGF,4EACE,uCACA,wCAOA,wPACE,gBAEA,sQACE,WACA,cACA,eACA,uBACA,gBACA,oCACA,kBASA,kSACE,mCACA,qCAEA,gTACE,mCACA,2CAYV,4OACE,4CAIA,4PACE,yDACA,gDAKN,uDACE,iBAGF,+CACE,qDAIA,2DACE,aACA,yBAEA,4EACE,WAMR,iCACE,kBACA,OACA,cACA,aACA,cACA,sBACA,kBACA,wCAEA,aACA,mBACA,uBAEA,WACA,eAEA,UACA,oBACA,4CAEA,8CACE,kBACA,UACA,SACA,mBAGF,6CACE,uBAIJ,iBACE,sBAIA,8GACE,gCAKA,wNAEE,+BACA,gCAKF,gLAGE,mBAIJ,+QAIE,4BACA,6BAGF,qEACE,qBAIJ,gCACE,kBACA,SACA,WACA,gCAEA,UACA,4BAEA,wBATF,gCAUI,sBAGF,mHAGE,4CAMF,oGACE,UAIJ,oCACE,WAGF,0CACE,YAGF,wBACE,WACA,UACA,kBAKJ,sKAME,qDACA,uDACA,2DACA,6DAGF,8BACE,kCAGF,aACE,gBAEA,6BACE,2BAIJ,8CACE,0e;ACtpBF,kBACE,mEACA,sEAEA,mBACA,oBAEA,0BACE,aAGF,oCACE,iBACA,sCACA,gDACA,2B;ACfJ,iBACE,WACA,YACA,aACA,mBACA,uBACA,kBAEA,0BACE,oBACA,sBACA,mBACA,gCACA,cACA,oBACA,qBACA,WAGF,wBACE,gBACA,gBAGF,8BACE,mBACA,gBAGF,0BACE,mBACA,aACA,YACA,eAEA,qCACE,aACA,Y;ACrCN,sBACE,YACA,aACA,mBACA,uBACA,mBAEA,cACE,mBACA,sBAGF,mBACE,sBACA,gCACA,gBACA,oBACA,qBACA,WACA,+BAEA,gBACE,oBAIJ,eACE,eACA,qBACA,kBACA,uBACA,0BAGF,kBACE,SACA,UACA,gBACA,uBACA,8BAGF,kBACE,kBACA,UACA,gBACA,uBACA,gBACA,yCAEA,WACE,wBACA,C;AClDN,aACE,OACA,WACA,oBAEA,gBACA,kBACA,gBAGA,6CAoBA,mE1BxBA,+B0BNF,a1BOI,mBAGA,mB0BEF,oCACE,2BAGF,iCACE,sIAGF,wBApBF,aAqBI,0CACA,2BAEA,gCACE,0CACA,+BAKJ,mCACE,kBACA,+CAEA,2EACE,2BAIJ,yCACE,aAGF,iCACE,WACA,0CACA,gBACA,cACA,aACA,yBACA,sBACA,6BAEA,wDACE,4BAGF,yBAdF,iCAeI,YACA,wBAEA,UAIJ,yBACE,gBAEA,uCACE,mBAIJ,yDAEE,gBAEA,qFACE,uBAEA,yBAHF,qFAII,uBAGF,iHACE,uBAKN,yBACE,+BACE,gBACA,6CACE,sBAEA,yEACE,2DAMR,kDAEE,kBAEA,UACA,mBACA,+CAEA,wEACE,qBACA,UAKF,wEACE,eAGF,kEACE,WACA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,yBACE,sBACA,gBACA,iDAGF,0BACE,aACA,sBACA,yBACA,gBACA,cAEA,yBAPF,0BAQI,iBAGF,+BACE,aACA,mBAGF,oCACE,mBAGF,kCACE,OACA,WACA,YACA,qBACA,kDACA,sCACA,mCACA,2BACA,gBACA,oBAEA,wCACE,WACA,wCACA,sCAIJ,0CACE,oB;AC/CN,yBACE,gBACA,wDAEA,mEACE,aAGF,oCACE,oBAGF,gDACE,2BAGF,6BACE,aACA,mBACA,sBACA,qBAGF,qCACE,cACA,2BACA,aACA,gBACA,wBACA,UACA,kBAEA,yBATF,qCAUI,gB;ACjCN,gBACE,gBACA,wDAsBA,qCApBA,uCACE,2BAGF,0DACE,aAGF,2BACE,oBAIF,oBACE,aACA,mBACA,sBACA,qBAKF,yCACE,kBAGF,4BACE,cACA,2BACA,aACA,gBACA,wBACA,UACA,kBAEA,yBATF,4BAUI,gBAIJ,yBACE,YACA,mCACA,gCAEA,iCACE,YACA,gBAGF,iDACE,aAGF,gFAEE,OACA,eACA,gBAGF,qCACE,mBACA,uBAGF,2CACE,gBACA,mBACA,uB;ACvEN,UACE,qBAEA,oDACE,kBACA,mBACA,mCAEA,yBALF,oDAMI,oBAGF,4DACE,eAEA,yBAHF,4DAII,YAIJ,kEACE,UAIJ,wBACE,kBAGF,+BACE,KACE,WACA,mBAGF,GACE,aACA,oBAIJ,kBACE,cACA,kBAEA,+BACE,mCAGF,yBARF,kBASI,eACA,iBAGF,mIAIE,kBAIA,2MAGE,2BAIJ,yBACE,kBACA,UAEA,+DAEE,mCAIJ,4BACE,kBACA,UACA,0BAIA,kCACE,iCAGF,qHAGE,0CAKF,0CACE,iCAGF,6HAGE,0CAKF,8CACE,iCAGF,iHAGE,0CAKF,mCACE,iCAGF,oHAGE,0CAIJ,8BACE,kCAKA,8bAIE,kCAKN,0BACE,UAGF,wEACE,wDACA,uBAGF,qCACE,eACA,gBACA,kBAEA,mJAGE,kBAGF,8CACE,uBAGF,iDACE,iCAGF,kGAEE,0CAGF,iDACE,kCAIA,yDACE,iCAGF,2HAEE,0CAKF,gEACE,iCAGF,uHAEE,0CAMR,iBACE,YACA,4BACA,mCACA,4CACA,6BACA,iDACA,kBACA,UAEA,+BACE,kBACA,kBAEA,gBACA,eACA,eACA,yBACA,0BAEA,uCACE,6BAIJ,yBAzBF,iBA0BI,iCAIJ,uBACE,aAEA,gCACE,kBACA,uBACA,qBAGF,+BACE,cACA,2BACA,aACA,cACA,SACA,UACA,oBAEA,2DACE,mCAGF,uCACE,kBAGF,yBAjBF,+BAkBI,eACA,gBAEA,uCACE,wBAIJ,4CACE,sCAGA,0GACE,yCAIJ,yDACE,WACA,kBACA,WACA,cACA,8CACA,uBACA,YACA,aACA,kBACA,qCACA,mEACA,yBAZF,yDAaI,UACA,aAKN,oCACE,YACA,gBAGF,wCACE,qBACA,kBACA,mBACA,cACA,0BACA,sGAEA,+CACE,WACA,aACA,cACA,8BACA,sBACA,kBACA,QACA,qBACA,gBACA,mDAGF,yBArBF,wCAsBI,gBACA,sBAKN,wCAEE,kBAEA,oEACE,+HAEA,gBACA,kBACA,iFACA,uBACA,mBACA,0CAEA,4LAEE,gHAIF,wFACE,gBACA,kBAKA,4OACE,aAIJ,kGACE,oBAIJ,4JAEE,kBACA,gCACA,oBACA,uBACA,mBACA,mBACA,0CACA,8DACA,YACA,mBACA,gBACA,uBACA,eAGF,gFACE,uBACA,OAGF,8FACE,QAGF,4EACE,oCACA,eACA,qBAEA,8QAGE,qCAIJ,0DACE,yDACA,wCACA,oBACA,oCACA,wJAIF,0FACE,yDAGF,sDACE,kBACA,MACA,OACA,UACA,oBACA,YACA,uBACA,mBAIJ,oBACE,YAEA,kCACE,gBACA,kCACA,uBACA,2BACA,2BACA,8BACA,kBACA,iBACA,mBACA,oEACA,qBAUA,6BARA,yBAbF,kCAcI,gBACA,oBACA,iBACA,sEACA,eAKF,yDACE,2BAIJ,8EAEE,8DAEA,yBAJF,8EAKI,iEAKF,mDACE,eACA,gBAMF,+KACE,kBAIJ,2BACE,cACA,eACA,kBACA,iBACA,oBAKF,kCACE,eACA,mBACA,iBAGF,sCACE,gBACA,cAIJ,kBACE,kBACA,0BACA,OACA,WACA,mCACA,4CACA,gBACA,iBAEA,kBACA,gBAGA,iDAEA,UACA,6BACA,wBACA,6E/B5gBA,+B+ByfF,kB/BxfI,mBAGA,mB+B0gBF,8BACE,aAGF,uBACE,UACA,wBAGF,2BACE,cAIJ,sCACE,KACE,UAEF,GACE,gC;ACziBJ,kBACE,kBACA,MACA,OACA,SACA,QACA,gBACA,WACA,+CAEA,yBACE,WACA,kBACA,MACA,OACA,SACA,QACA,+CACA,2BACA,4BACA,sBAEA,4DACE,uEAGF,gDACE,gBAGF,sCACE,yDAEA,yBAHF,sCAII,0DAKN,gEACE,UAGF,0CACE,qDACA,YACA,qBAGF,kDACE,kBAGF,sCACE,gDACE,6BACA,gBACA,mBACA,6BACA,6CAGF,4GACE,kCAKF,sCADF,4GAEI,iCAGF,sCALF,4GAMI,kCAKN,cACE,aACA,uBACA,YACA,kBACA,UACA,YAEA,yBARF,cASI,iBAGF,+BACE,wDAEA,aACA,sBACA,mBACA,WACA,YACA,kBACA,gBAEA,2CACE,WACA,YACA,gBAEA,+CACE,aACA,sBACA,mBAMJ,yCACE,kCACA,kGAEA,iDACE,mCACA,8CAIA,wIAEE,2BAKN,+EAEE,UACA,4CAEA,6HACE,2BAIJ,gCACE,UACA,mBACA,gHAGA,uDACE,2BAIJ,2EAEE,oBAIA,6DACE,SAGF,qDACE,6FACA,yDAEA,6DACE,sCAIJ,2DACE,yBAEA,yBAHF,2DAII,0BAIJ,uGAEE,UAGF,4CACE,qBACA,qBAKN,kCACE,oBACA,8CAEA,iEACE,UACA,4CAEA,wFACE,2BAIJ,yDACE,2BAGF,8CACE,kDACA,oBAEA,6EACE,UAIJ,wCACE,WACA,aACA,4CACA,mCACA,kCACA,kBACA,iDAIJ,oCACE,WACA,0CACA,eACA,kBACA,aACA,qBACA,+BAEA,+BACA,uDAEA,2DACE,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EAEE,mBAEA,yBAJF,4EAKI,gBACA,wIACE,U;AC1IV,gBACE,YACA,gBACA,kBAEA,sBACE,YACA,gB;ACPJ,aACE,kBACA,MACA,QACA,gCACA,YACA,yCACA,uDACA,mCACA,2CACA,8BAEA,6CAEA,oCACE,gBAGF,0BAlBF,aAmBI,8DACA,kBAGF,yBAvBF,aAwBI,YACA,oCAGF,yBACE,yCACA,gBAGF,4CACE,iBACA,cACA,kBAEA,oDACE,oBAEA,6DACE,0BAIJ,mDACE,aACA,uBACA,mBAEA,sDACE,gBACA,kBACA,iBACA,qBACA,sBAGF,iEACE,mBACA,oBAGF,0DACE,aACA,cACA,uBAIJ,oDACE,kBACA,cAKN,qBACE,kBACA,MACA,OACA,QACA,SACA,8BACA,gBACA,kBACA,oBAEA,0BAXF,qBAYI,gBAGF,+BACE,aAGF,uCACE,kBACA,MACA,QACA,SACA,OACA,WACA,gBACA,UAEA,yBAVF,uCAWI,2CAEA,8DACE,iBAKN,8FAEE,mBAIA,yBACE,+DACE,uCAIJ,0DACE,oBACA,+B;AClIN,MACE,YACA,gBACA,gBAEA,0BALF,MAMI,mBAGF,yBATF,MAUI,iCAGF,yBAbF,MAcI,aACA,+BACA,yBAIJ,uBACE,iCACA,oHACE,yBACA,gBAIJ,YACE,gBACA,WACA,kBACA,YACA,kBAEA,gBACE,YACA,gBAGF,yBAZF,YAaI,iCAGF,yBAhBF,YAiBI,gBAGF,0BApBF,YAqBI,WACA,gBAGF,yBAzBF,YA0BI,eACA,OACA,MACA,gCACA,yBAEA,mCACA,6CAEA,mCACE,gBAGF,mBACE,WACA,cACA,kBACA,OACA,MACA,QACA,SACA,gBACA,sCACA,2CACA,UAEA,0CACE,gBAIF,mCACE,aAGF,wDACE,cAIJ,2CACE,+BAEA,kDACE,UACA,oBAIJ,6CACE,gBAEA,mDACE,iBAKN,yBApFF,YAqFI,eACA,mCACA,0CACA,0DAKF,yBADF,aAEI,uCAGF,8CACE,gBAEA,gEACE,gBAKN,mDACE,gBAGF,cACE,2CAEA,yBAHF,cAII,eACA,eACA,OACA,MACA,SACA,QAEA,+BACA,6CAEA,qCACE,gBAGF,6CACE,sCAIJ,yBAvBF,cAwBI,iBAEA,6CACE,mCAGF,sCACE,oCAIJ,+CACE,gBAEA,qDACE,gBAKN,kCACE,sCAEA,6IACE,6EAIA,gFACE,aAKF,+EACE,kCACA,UAKF,uEACE,+BACA,UAKF,8EACE,aAKF,6EACE,kCACA,UAKF,wEACE,+BACA,U","sources":["webpack://telegram-t/./src/components/left/ConnectionStatusOverlay.scss","webpack://telegram-t/./src/components/left/main/LeftMainHeader.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/left/NewChatButton.scss","webpack://telegram-t/./src/components/left/main/LeftMain.scss","webpack://telegram-t/./src/components/left/LeftColumn.scss","webpack://telegram-t/./src/components/middle/AudioPlayer.scss","webpack://telegram-t/./src/components/calls/group/GroupCallTopPane.scss","webpack://telegram-t/./src/components/middle/MiddleHeader.scss","webpack://telegram-t/./src/components/common/EmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/message/ReactionAnimatedEmoji.scss","webpack://telegram-t/./src/components/middle/message/MessageMeta.scss","webpack://telegram-t/./src/components/middle/message/Sticker.scss","webpack://telegram-t/./src/components/middle/message/Contact.scss","webpack://telegram-t/./src/components/middle/message/PollOption.scss","webpack://telegram-t/./src/components/middle/message/Poll.scss","webpack://telegram-t/./src/components/middle/message/WebPage.scss","webpack://telegram-t/./src/components/middle/message/Invoice.scss","webpack://telegram-t/./src/components/middle/message/Album.scss","webpack://telegram-t/./src/components/middle/message/RoundVideo.scss","webpack://telegram-t/./src/components/middle/message/InlineButtons.scss","webpack://telegram-t/./src/components/middle/message/CommentButton.scss","webpack://telegram-t/./src/components/middle/message/Reactions.scss","webpack://telegram-t/./src/components/middle/message/_message-content.scss","webpack://telegram-t/./src/components/middle/message/Message.scss","webpack://telegram-t/./src/components/middle/message/SponsoredMessage.scss","webpack://telegram-t/./src/components/middle/ContactGreeting.scss","webpack://telegram-t/./src/components/middle/NoMessages.scss","webpack://telegram-t/./src/components/middle/MessageList.scss","webpack://telegram-t/./src/components/middle/ScrollDownButton.scss","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.scss","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.scss","webpack://telegram-t/./src/components/middle/composer/Composer.scss","webpack://telegram-t/./src/components/middle/MiddleColumn.scss","webpack://telegram-t/./src/components/right/RightHeader.scss","webpack://telegram-t/./src/components/right/Profile.scss","webpack://telegram-t/./src/components/right/AddChatMembers.scss","webpack://telegram-t/./src/components/right/RightColumn.scss","webpack://telegram-t/./src/components/main/Main.scss"],"sourcesContent":[".connection-state-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n\n transition: transform 300ms ease, opacity 300ms ease;\n opacity: 1;\n\n &:not(.open) {\n transform: translateY(-3rem);\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n}\n\n#ConnectionStatusOverlay {\n height: 2.9375rem;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin: 0.375rem 0.5rem;\n padding: 0 0.75rem;\n background: var(--color-yellow);\n border-radius: var(--border-radius-default);\n\n &.interactive {\n cursor: pointer;\n }\n\n > .Spinner {\n --spinner-size: 1.75rem;\n }\n\n > .state-text {\n flex: 1;\n color: var(--color-text-lighter);\n font-size: 0.9375rem;\n font-weight: 500;\n padding-bottom: 0.0625rem;\n margin-inline-start: 1.875rem;\n white-space: nowrap;\n }\n\n @media (max-width: 950px) {\n > .state-text {\n margin-inline-start: 1.25rem;\n }\n }\n\n .Transition {\n width: 100%;\n // https://dfmcphee.com/flex-items-and-min-width-0/\n // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size\n min-width: 0;\n\n > div {\n display: flex;\n align-items: center;\n width: 100%;\n }\n }\n}\n","@import \"../../../styles/mixins\";\n\n#LeftMainHeader {\n position: relative;\n\n .animated-menu-icon {\n position: absolute;\n\n &,\n &::before,\n &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform 0.25s;\n transform: rotate(0);\n }\n\n &::before,\n &::after {\n position: absolute;\n left: 0;\n content: \"\";\n }\n\n &::before {\n top: -0.3125rem;\n }\n\n &::after {\n top: 0.3125rem;\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0.375rem, -0.1875rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0.375rem, 0.1875rem);\n }\n }\n\n &.no-animation {\n transition: none;\n\n &::before,\n &::after {\n transition: none;\n }\n }\n }\n\n .archived-badge {\n min-width: 1.5rem;\n height: 1.5rem;\n margin-left: auto;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 0.4375rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n }\n\n .MenuItem.compact .archived-badge {\n background: none;\n padding: 0;\n color: var(--color-text-secondary);\n }\n\n .MenuItem.compact .Switcher {\n transform: scale(0.75);\n }\n\n [dir=\"rtl\"] .archived-badge {\n margin-left: 0;\n margin-right: auto;\n }\n\n .Menu .bubble {\n min-width: 17rem;\n max-height: calc(100 * var(--vh) - 3.75rem);\n\n overflow-y: auto;\n @include overflow-y-overlay();\n }\n\n // @optimization\n @include while-transition() {\n .Menu .bubble {\n transition: none !important;\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n",".NewChatButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(5rem);\n\n transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transform: none !important;\n opacity: 0;\n\n transition: opacity 0.15s;\n\n &.revealed {\n opacity: 1;\n }\n }\n\n &.revealed {\n transform: translateY(0);\n\n @media (max-width: 600px) {\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0, 0, 0.625rem);\n transform-style: preserve-3d;\n }\n }\n\n > .Button {\n .icon-new-chat-filled,\n .icon-close {\n position: absolute;\n }\n\n &:not(.active) {\n .icon-new-chat-filled {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-close {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.active {\n .icon-close {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-new-chat-filled {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n }\n}\n","#LeftColumn-main {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n z-index: 1;\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n }\n\n .ChatFolders {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .tabs-placeholder {\n height: 2.625rem;\n transition: height 150ms ease;\n\n &:not(.open) {\n height: 0;\n }\n }\n\n .TabList {\n justify-content: flex-start;\n padding-left: 0.5625rem;\n padding-bottom: 1px;\n border-bottom: 0;\n z-index: 1;\n }\n\n .Tab {\n flex: 0 0 auto;\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n\n > span {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n }\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n }\n }\n\n .RecentContacts,\n .LeftSearch,\n .search-content {\n height: 100%;\n overflow-y: auto;\n }\n\n .btn-update {\n position: absolute;\n bottom: 1rem;\n left: 1rem;\n right: 1rem;\n margin: 0 auto;\n }\n}\n","#NewChat {\n height: 100%;\n}\n\n.left-header {\n height: var(--header-height);\n padding: 0.375rem 1rem 0.5rem 0.8125rem;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n background-color: var(--color-background);\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n margin-right: auto;\n }\n\n .SearchInput {\n margin-left: 0.875rem;\n max-width: calc(100% - 3.25rem);\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3rem);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n\n + .DropdownMenu {\n margin-left: 0.25rem;\n }\n }\n}\n",".AudioPlayer {\n display: flex;\n margin-left: auto;\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n > .Button {\n flex-shrink: 0;\n margin: 0.125rem;\n }\n\n > .player-button {\n --color-text-secondary: var(--color-primary);\n --color-text-secondary-rgb: var(--color-primary-shade-rgb);\n --color-primary-shade: var(--color-green);\n --color-white: var(--color-background-own);\n }\n\n .player-button {\n &.smaller {\n width: 3rem;\n height: 3rem;\n\n i {\n font-size: 1.625rem;\n margin-top: -0.0625rem;\n }\n }\n\n i {\n position: absolute;\n font-size: 1.9375rem;\n margin-top: -0.0625rem;\n\n &.icon-play {\n margin-left: 0.125rem;\n }\n }\n\n .icon-play,\n .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.4s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(0.5);\n }\n }\n\n .volume-button {\n position: relative;\n overflow: visible;\n\n .volume-slider-spacer {\n position: absolute;\n transform: translateY(100%);\n bottom: 0;\n height: 1rem;\n width: 8rem;\n cursor: default;\n visibility: hidden;\n }\n\n &:hover .volume-slider-spacer,\n .volume-slider-spacer:hover {\n visibility: visible;\n }\n\n .volume-slider {\n opacity: 0;\n visibility: hidden;\n\n position: absolute;\n background: var(--color-background);\n bottom: -1rem;\n transform: translateY(100%);\n transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;\n width: 8rem;\n padding: 0.75rem;\n border-radius: 0.5rem;\n cursor: default;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n .RangeSlider {\n margin-bottom: 0;\n input[type=\"range\"] {\n margin-bottom: 0;\n }\n }\n }\n\n &:hover .volume-slider,\n .volume-slider:hover,\n .volume-slider-spacer:hover + .volume-slider {\n opacity: 1;\n visibility: visible;\n }\n }\n\n .playback-button {\n &.applied {\n --color-text-secondary: var(--color-primary);\n }\n\n .playback-button-inner {\n transition: 0.2s color ease-in-out;\n font-size: 0.75rem;\n font-weight: bold;\n border: 2px solid;\n border-radius: 0.375rem;\n padding: 0.125rem 0.25rem;\n font-variant-numeric: tabular-nums;\n }\n }\n\n &-content {\n display: flex;\n justify-content: center;\n flex-direction: column;\n flex-shrink: 1;\n padding: 0 0.5rem;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n border-radius: var(--border-radius-messages-small);\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .AudioPlayer & .title {\n display: block;\n font-weight: 500;\n font-size: 0.875rem !important;\n line-height: 1rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n body.is-ios & {\n font-size: 0.9375rem !important;\n line-height: 1.125rem;\n }\n }\n\n .subtitle {\n font-size: 0.8125rem !important;\n color: var(--color-text-secondary);\n line-height: 0.8125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0.125rem 0 0;\n\n body.is-ios & {\n font-size: 0.9375rem !important;\n line-height: 1.125rem;\n }\n }\n }\n}\n",".GroupCallTopPane {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 2.875rem;\n overflow: hidden;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 0.375rem 0.5rem 0.375rem 0.75rem;\n background: var(--color-background);\n z-index: -1;\n cursor: pointer;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -0.1875rem;\n left: 0;\n right: 0;\n height: 0.125rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n }\n\n &.is-hidden {\n display: none;\n }\n\n @media (max-width: 600px) {\n &.has-pinned-offset {\n top: calc(100% + 2.875rem);\n }\n }\n\n .info {\n display: flex;\n flex-direction: column;\n\n .title {\n font-size: 0.875rem;\n color: var(--color-text);\n }\n\n .participants {\n font-size: 0.75rem;\n color: var(--color-text-secondary);\n }\n }\n\n .avatars {\n display: flex;\n flex-direction: row;\n align-items: center;\n\n .Avatar {\n margin: 0 0 0 -0.75rem;\n\n &:first-child {\n width: 2rem;\n height: 2rem;\n }\n\n &:not(:first-child) {\n width: 2.25rem;\n height: 2.25rem;\n border: 0.125rem solid var(--color-background);\n }\n }\n }\n\n .join {\n height: 1.5rem;\n border-radius: 1.5rem;\n font-weight: 500;\n padding: 1rem 1rem;\n width: auto;\n }\n}\n\n@media (min-width: 1440px) {\n #Main.right-column-open .MiddleHeader .GroupCallTopPane {\n width: calc(100% - var(--right-column-width));\n }\n}\n","@import \"../../styles/mixins\";\n\n@mixin mobile-header-styles() {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 2.875rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n\n display: flex;\n flex-direction: row-reverse;\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n padding-left: max(0.75rem, env(safe-area-inset-left));\n padding-right: max(0.5rem, env(safe-area-inset-right));\n background: var(--color-background);\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -0.1875rem;\n left: 0;\n right: 0;\n height: 0.125rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n }\n\n .HeaderPinnedMessage {\n max-width: unset;\n margin-top: -0.1875rem;\n }\n }\n\n .AudioPlayer {\n flex-direction: row;\n margin-top: 0;\n padding: 0.25rem 0.5rem;\n\n &-content {\n padding: 0 0.5rem;\n flex-grow: 1;\n }\n\n > .Button {\n margin: -0.0625rem 0 0;\n }\n\n > .player-close {\n margin-left: auto;\n }\n }\n\n .HeaderPinnedMessage {\n flex-grow: 1;\n padding-top: 0;\n padding-bottom: 0;\n\n &::before {\n top: 0.125rem;\n bottom: 0.125rem;\n }\n\n .message-text {\n max-width: none;\n }\n }\n\n .HeaderPinnedMessage-wrapper.full-width {\n display: none;\n }\n}\n\n.MiddleHeader {\n display: flex;\n align-items: center;\n width: 100%;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background: var(--color-background);\n position: relative;\n z-index: var(--z-middle-header);\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: max(1.5rem, env(safe-area-inset-left));\n padding-right: max(0.8125rem, env(safe-area-inset-right));\n\n @media (max-width: 600px) {\n position: relative;\n\n padding-left: max(0.5rem, env(safe-area-inset-left));\n padding-right: max(0.5rem, env(safe-area-inset-right));\n }\n\n .Transition {\n width: 100%;\n // https://dfmcphee.com/flex-items-and-min-width-0/\n // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size\n min-width: 0;\n\n > div {\n display: flex;\n align-items: center;\n width: 100%;\n }\n }\n\n .back-button {\n margin-left: -0.5rem;\n margin-right: 0.5rem;\n position: relative;\n\n @media (max-width: 600px) {\n margin-left: 0;\n }\n\n .unread-count {\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.375rem;\n border-radius: 0.625rem;\n font-size: 0.75rem;\n line-height: 1.25rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.25rem;\n right: -0.5rem;\n\n background: var(--color-gray);\n color: white;\n pointer-events: none;\n\n &.active {\n background: var(--color-primary);\n }\n }\n }\n\n .chat-info-wrapper {\n flex-grow: 1;\n overflow: hidden;\n }\n\n body.animation-level-0 & .HeaderPinnedMessage-wrapper {\n transition: none !important;\n }\n\n .header-tools {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-left: auto;\n flex-shrink: 0;\n\n body.animation-level-0 & {\n &,\n .AudioPlayer,\n .HeaderActions {\n transition: none !important;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n .HeaderActions {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n }\n\n @media (min-width: 1440px) {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n\n // @optimization\n @include while-transition() {\n pointer-events: none;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n &:not(.tools-stacked) .HeaderPinnedMessage-wrapper,\n &:not(.tools-stacked) .AudioPlayer {\n opacity: 1;\n\n #Main.right-column-open & {\n opacity: 0;\n }\n }\n }\n\n &.tools-stacked .AudioPlayer {\n @include mobile-header-styles();\n\n @media (min-width: 1150px) {\n #Main.right-column-open & {\n padding-right: calc(0.5rem + var(--right-column-width));\n }\n }\n }\n\n &.tools-stacked.animated .HeaderPinnedMessage-wrapper,\n &.tools-stacked.animated .AudioPlayer {\n animation: fade-in var(--layer-transition) forwards;\n\n body.animation-level-0 & {\n animation: none;\n }\n }\n\n h3 {\n font-weight: 500;\n font-size: 1.125rem;\n line-height: 1.375rem;\n white-space: pre;\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n unicode-bidi: plaintext;\n\n body.is-ios &,\n body.is-macos & {\n font-size: 1.0625rem;\n font-weight: 600;\n }\n\n @media (max-width: 600px) {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n\n .ChatInfo {\n cursor: pointer;\n display: flex;\n align-items: center;\n\n .info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title {\n display: flex;\n align-items: center;\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n margin-top: 0.0625rem;\n }\n }\n\n .status,\n .typing-status {\n display: inline;\n unicode-bidi: plaintext;\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n\n .user-status {\n unicode-bidi: plaintext;\n overflow: hidden;\n text-overflow: ellipsis;\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n }\n\n .Avatar {\n margin-right: 0.625rem;\n // TODO For some reason webpack imports `Audio.scss` second time when loading calls bundle\n width: 2.5rem !important;\n height: 2.5rem !important;\n font-size: 1.0625rem;\n }\n\n .status,\n .typing-status {\n font-size: 0.875rem;\n line-height: 1.125rem;\n margin: 0;\n color: var(--color-text-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n\n .ellipsis {\n display: inline-flex;\n }\n\n &.online {\n color: var(--color-primary);\n }\n\n .font-emoji {\n line-height: 1rem;\n }\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n .HeaderPinnedMessage-wrapper {\n display: flex;\n align-items: center;\n margin-left: auto;\n cursor: default;\n flex-direction: row-reverse;\n background: var(--color-background);\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translate3d(0, 0, 0);\n transition: opacity 0.15s ease, transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n\n .HeaderPinnedMessage {\n min-width: 16rem;\n }\n\n > .Button {\n flex-shrink: 0;\n }\n\n &.full-width {\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n background: var(--color-background);\n padding: 0.25rem 0.8125rem 0.25rem 1rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n transform: translate3d(0, 0, 0);\n transition: opacity 0.15s ease, transform var(--layer-transition);\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -0.1875rem;\n left: 0;\n right: 0;\n height: 0.125rem;\n box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow);\n }\n\n .HeaderPinnedMessage {\n margin-top: 0;\n margin-bottom: 0;\n flex: 1;\n\n .message-text {\n max-width: none;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translate3d(0, 0, 0);\n transition: opacity 0.15s ease, transform var(--layer-transition);\n\n #Main.right-column-open & {\n padding-left: calc(var(--right-column-width) + 1rem);\n }\n }\n }\n }\n\n .HeaderPinnedMessage {\n display: flex;\n flex-shrink: 1;\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n padding: 0.25rem;\n padding-left: 0.375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n .pinned-message-border {\n position: relative;\n height: 2.25rem;\n margin: 0.125rem 0;\n width: 0.125rem;\n min-width: 0.125rem;\n overflow: hidden;\n\n .pinned-message-border-wrapper-1 {\n height: 2.25rem;\n width: 0.125rem;\n border-radius: 0.0625rem;\n background: var(--color-primary);\n }\n\n .pinned-message-border-wrapper {\n background-color: var(--color-primary-opacity);\n position: relative;\n will-change: transform;\n transition: transform 0.25s ease-in-out;\n }\n\n .pinned-message-border-mark {\n position: absolute;\n left: 0;\n top: 0;\n width: 0.125rem;\n background: var(--color-primary);\n border-radius: 0.0625rem;\n will-change: transform;\n transition: transform 0.25s ease-in-out;\n }\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n max-width: 15rem;\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .title {\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 1rem;\n color: var(--color-primary);\n margin-bottom: 0.125rem;\n white-space: pre;\n text-align: initial;\n\n body.is-ios & {\n font-size: 0.9375rem;\n }\n }\n\n p {\n font-size: 0.875rem;\n line-height: 1.125rem;\n height: 1.125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n\n body.is-ios & {\n font-size: 0.9375rem;\n }\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n }\n\n & > img {\n width: 2.25rem;\n height: 2.25rem;\n object-fit: cover;\n border-radius: 0.25rem;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n flex-shrink: 0;\n\n & + .message-text {\n max-width: 12rem;\n }\n }\n }\n\n .HeaderActions {\n flex-shrink: 0;\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n .toggle-right-pane-button {\n &.active {\n color: var(--color-primary);\n opacity: 1;\n }\n }\n\n .badge-button {\n position: relative;\n overflow: visible;\n }\n\n .badge {\n position: absolute;\n min-width: 1rem;\n height: 1rem;\n background: var(--color-primary);\n border-radius: 0.5rem;\n color: white;\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n right: 0;\n top: 0;\n }\n }\n\n .HeaderPinnedMessage-wrapper,\n .HeaderActions {\n .Button {\n margin-left: 0.25rem;\n\n &.tiny {\n margin-right: 0.625rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n @include mobile-header-styles();\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".EmbeddedMessage {\n display: flex;\n align-items: center;\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n line-height: 1.125rem;\n margin: 0 -0.25rem 0.0625rem;\n padding: 0.1875rem 0.25rem 0.1875rem 0.4375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n direction: ltr;\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n .custom-shape & {\n max-width: 15rem;\n padding: 0.5rem;\n margin: 0;\n background-color: var(--background-color);\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n &::before {\n left: 0.625rem;\n top: 0.625rem;\n bottom: 0.625rem;\n }\n\n img:not(.emoji) {\n margin-inline-start: 0.5rem;\n }\n\n &:dir(rtl) {\n padding: 0.5rem;\n }\n }\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0.3125rem;\n bottom: 0.3125rem;\n left: 0.3125rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:hover {\n background-color: var(--hover-color);\n }\n\n &:active {\n background-color: var(--active-color);\n }\n\n .message-title {\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.5rem;\n display: flex;\n flex-direction: column-reverse;\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.125rem;\n flex: 1;\n display: block;\n }\n\n p {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n height: 1.125rem;\n margin-bottom: 0;\n flex: 1;\n\n &::after {\n content: none;\n display: none;\n }\n }\n\n .emoji {\n width: calc(1.125 * var(--message-text-size, 1rem)) !important;\n height: calc(1.125 * var(--message-text-size, 1rem)) !important;\n vertical-align: text-bottom !important;\n }\n }\n\n .embedded-action-message {\n color: var(--accent-color);\n opacity: 0.75;\n }\n\n img:not(.emoji) {\n width: 2rem;\n height: 2rem;\n object-fit: cover;\n border-radius: 0.25rem;\n margin-left: 0.25rem;\n flex-shrink: 0;\n\n &.round {\n border-radius: 1rem;\n }\n }\n\n &.inside-input {\n padding-inline-start: 0.5625rem;\n margin: 0 0 -0.125rem -0.1875rem;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr;\n width: 100%;\n --accent-color: var(--color-primary);\n --hover-color: var(--color-interactive-element-hover);\n\n &::before {\n bottom: 0.3125rem;\n }\n\n img:not(.emoji) {\n margin-left: 0.125rem;\n }\n\n .message-text {\n margin-inline-start: 0.375rem;\n }\n\n .message-title {\n font-weight: 500;\n color: var(--accent-color);\n }\n }\n}\n",".ReactionAnimatedEmoji {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &.is-animating {\n // Fix for redundant scroll on iOS\n transform: translateZ(0);\n // Fix for redundant scroll in Firefox\n contain: layout;\n }\n\n .AnimatedSticker {\n position: fixed;\n top: -0.375rem;\n left: -0.375rem;\n pointer-events: none;\n\n &.effect {\n top: -2.5rem;\n left: -2.5rem;\n }\n\n &:not(.open) {\n opacity: 1 !important;\n }\n\n &.closing {\n opacity: 0 !important;\n }\n }\n\n &.in-meta {\n .AnimatedSticker {\n top: -0.4375rem;\n left: -0.4375rem;\n\n &.effect {\n top: -2.5625rem;\n left: -2.5625rem;\n }\n\n // Fix for weird positioning in Chrome\n canvas {\n position: absolute;\n }\n }\n }\n}\n",".MessageMeta {\n position: absolute;\n height: 1.25rem;\n bottom: 0;\n right: 0;\n display: flex;\n align-items: center;\n background: rgba(#999999, 0.6);\n border-radius: 0.625rem;\n padding: 0 0.25rem;\n color: white;\n cursor: pointer;\n max-width: 100%;\n user-select: none;\n\n .ReactionAnimatedEmoji {\n width: 1rem;\n height: 1rem;\n margin-right: 0.25rem;\n }\n\n .message-time,\n .message-signature,\n .message-views {\n font-size: 0.75rem;\n white-space: nowrap;\n }\n\n .message-time {\n margin-right: 0.1875rem;\n }\n\n body.is-ios & {\n .message-time {\n margin-right: 0.25rem;\n }\n }\n\n .message-views {\n margin-inline-start: 0.1875rem;\n }\n\n .message-signature {\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 0.375rem;\n }\n\n .icon-channelviews {\n margin-left: 0.125rem;\n margin-right: 0.375rem;\n font-size: 1.125rem;\n position: relative;\n top: -0.0625rem;\n }\n\n .has-solid-background & {\n color: rgba(var(--color-text-meta-rgb), 0.75);\n background: none;\n }\n\n .media:not(.text) &,\n .Message .custom-shape & {\n background: rgba(0, 0, 0, 0.2);\n --color-accent-own: white;\n --color-accent: white;\n color: white !important;\n opacity: 1;\n bottom: 0.25rem;\n right: 0.25rem;\n left: auto;\n height: 1.125rem;\n padding: 0 0.3125rem 0 0.375rem;\n\n .MessageOutgoingStatus i {\n background: transparent;\n }\n }\n\n .media:not(.text):dir(rtl) &,\n .Message .custom-shape:dir(rtl) & {\n right: auto !important;\n left: 0.25rem;\n padding: 0 0.375rem 0 0.3125rem;\n }\n\n .is-forwarded.media:not(.text):dir(rtl) &,\n .Message .is-forwarded.custom-shape:dir(rtl) & {\n left: 0.8125rem;\n }\n\n .is-forwarded.media:not(.text) & {\n bottom: 0.9375rem;\n right: 0.8125rem;\n }\n\n .emoji-only & {\n right: 0;\n }\n\n .Message.own .has-solid-background & {\n color: var(--color-message-meta-own);\n }\n\n .MessageOutgoingStatus {\n margin-left: -0.1875rem;\n font-size: 1.1875rem;\n border-radius: 0.625rem;\n\n .Message.own & {\n color: var(--color-accent-own);\n }\n }\n\n .message-content.has-replies:not(.custom-shape) & {\n bottom: 3.375rem;\n }\n\n .message-content.has-replies.text:not(.custom-shape) & {\n bottom: 3.4375rem;\n }\n\n &[dir=\"rtl\"] {\n .message-views {\n order: 10;\n }\n .icon-channelviews {\n order: 9;\n }\n }\n}\n\n.Message:not(.own) {\n .custom-shape .reply-message + .MessageMeta {\n right: auto;\n left: 13.25rem;\n bottom: 0.25rem;\n }\n\n .emoji-only-1 .reply-message + .MessageMeta {\n left: 2.5rem;\n }\n\n .emoji-only-2 .reply-message + .MessageMeta {\n left: 5.5rem;\n }\n\n .emoji-only-3 .reply-message + .MessageMeta {\n left: 6.5rem;\n }\n}\n",".Sticker {\n &:not(.inactive) {\n cursor: pointer;\n }\n\n &.inactive {\n pointer-events: none;\n }\n}\n",".Contact {\n display: flex;\n align-items: center;\n padding: 0.25rem;\n\n &.interactive {\n cursor: pointer;\n }\n\n .Avatar {\n margin-right: 0.8125rem;\n }\n\n .contact-info {\n padding: 0.5rem;\n padding-left: 0;\n white-space: nowrap;\n overflow: hidden;\n\n .contact-name {\n font-size: 1rem;\n line-height: 1rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n }\n\n .contact-phone {\n line-height: 1rem;\n color: var(--secondary-color);\n }\n }\n}\n\n\n",".PollOption {\n display: flex;\n flex-flow: row nowrap;\n margin-bottom: 0.75rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .poll-option-text {\n word-break: break-word;\n }\n\n .poll-option-share {\n position: relative;\n margin-top: 0.125rem;\n width: 1.75rem;\n margin-inline-end: 0.5rem;\n flex-shrink: 0;\n font-weight: 500;\n font-size: 0.875rem;\n text-align: right;\n\n &.limit-width {\n display: inline-flex;\n justify-content: center;\n font-size: 0.75rem;\n }\n }\n\n .poll-option-chosen {\n position: absolute;\n right: 0;\n bottom: -5px;\n width: 1rem;\n height: 1rem;\n background: var(--accent-color);\n color: var(--background-color);\n border-radius: 0.5rem;\n font-size: 0.75rem;\n text-align: center;\n\n &.wrong {\n background: var(--color-error);\n }\n\n .is-forwarded & > i {\n margin-left: 1px;\n }\n\n &.animate {\n opacity: 0;\n animation-name: PollOptionIconAnimate;\n animation-delay: 0.09s;\n animation-duration: 0.3s;\n animation-fill-mode: forwards;\n }\n }\n\n .poll-option-right {\n flex-grow: 1;\n line-height: 1.5rem;\n }\n\n .poll-option-answer {\n position: relative;\n }\n\n .poll-option-line {\n position: relative;\n width: 0;\n height: 0.25rem;\n min-width: 0.5rem;\n border-radius: 0.125rem;\n margin-top: 0.5rem;\n background: var(--accent-color);\n\n transform-origin: 0 0;\n transition: transform 0.3s;\n transition-delay: 0.09s;\n }\n\n .poll-line {\n width: 30px;\n height: 35px;\n position: absolute;\n left: -27px;\n bottom: -5px;\n transition: stroke-dashoffset 0.3s, stroke-dasharray 0.3s;\n stroke-dashoffset: 0;\n stroke-dasharray: 0, 200%;\n }\n\n .poll-line path {\n stroke-width: 4px;\n stroke-linecap: round;\n stroke: var(--accent-color);\n fill: none;\n }\n\n .wrong {\n .poll-option-line {\n background: var(--color-error);\n }\n\n .poll-line path {\n stroke: var(--color-error);\n }\n }\n}\n\n@keyframes PollOptionIconAnimate {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n",".Poll {\n min-width: 15rem;\n text-align: initial;\n\n @media (max-width: 600px) {\n min-width: 50vw;\n }\n\n .poll-question {\n font-weight: 500;\n line-height: 1.25rem;\n margin: 0.125rem 0;\n word-break: break-word;\n }\n\n .poll-type,\n .poll-voters-count {\n color: var(--secondary-color);\n font-size: 0.875rem;\n }\n\n .poll-type {\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n min-height: 1.375rem;\n }\n\n .poll-voters-count {\n margin: 0.4375rem 0 1.125rem;\n text-align: center;\n }\n\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 1rem;\n }\n\n .Checkbox,\n .Radio {\n padding-left: 2.25rem;\n\n &:last-child {\n margin-bottom: 0.75rem;\n }\n\n &.disabled {\n opacity: 1 !important;\n cursor: not-allowed;\n }\n\n .Checkbox-main,\n .Radio-main {\n &::before {\n left: 0.125rem;\n background-color: var(--background-color);\n\n .theme-dark & {\n --color-borders: var(--color-borders-input);\n }\n\n .Message.own & {\n --color-borders: var(--accent-color);\n }\n }\n\n &::after {\n left: 0.4375rem;\n background-color: var(--accent-color);\n }\n }\n\n input:checked ~ .Radio-main,\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--accent-color);\n }\n }\n\n .Spinner {\n left: 0.125rem;\n }\n }\n\n .Checkbox {\n .Checkbox-main {\n &::after {\n left: 0.125rem;\n background-color: var(--color-primary);\n\n .Message.own & {\n background-color: var(--accent-color);\n }\n }\n }\n }\n\n .Spinner > div {\n // gray spinner\n background-image: var(--spinner-gray-data);\n\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n\n .Message.own & {\n // green spinner\n background-image: var(--spinner-green-data);\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n }\n }\n\n .poll-recent-voters {\n display: inline-flex;\n align-items: center;\n vertical-align: text-bottom;\n margin-left: 0.875rem;\n margin-right: 0.5rem;\n margin-top: -2px;\n\n .Avatar {\n border: 0.0625rem solid var(--color-white);\n margin-right: 0;\n box-sizing: content-box;\n\n .Message.own & {\n border: 0.0625rem solid var(--secondary-color);\n }\n\n &:not(:first-child) {\n margin-left: -3px;\n }\n }\n }\n\n .poll-countdown {\n margin-left: auto;\n font-size: 0.75rem;\n transition: color 0.2s;\n\n &.hurry-up {\n color: var(--color-error);\n\n .poll-countdown-progress {\n stroke: var(--color-error);\n }\n }\n\n svg {\n vertical-align: -3px;\n }\n }\n\n .poll-countdown-progress {\n stroke: var(--color-primary);\n fill: transparent;\n stroke-width: 2;\n stroke-linecap: round;\n transition: stroke-dashoffset 2s, stroke 0.2s;\n }\n\n .poll-quiz-help {\n margin: -0.625rem 0 -0.625rem auto;\n .Message:not(.own) & {\n color: var(--color-primary);\n }\n }\n\n .poll-results,\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 0.5rem;\n }\n\n .Button {\n text-transform: none;\n font-size: 1rem;\n\n .Message.own & {\n color: var(--accent-color);\n --color-primary-shade-rgb: var(--color-accent-own);\n }\n }\n\n > .Button {\n margin-bottom: 0.625rem;\n }\n}\n",".WebPage {\n margin-top: 0.25rem;\n margin-bottom: 0.125rem;\n padding-left: 0.625rem;\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n line-height: 1.125rem;\n max-width: 29rem;\n position: relative;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 0.125rem;\n background: var(--accent-color);\n border-radius: 0.125rem;\n }\n\n &-text {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .media-inner {\n margin: 0 !important;\n margin-bottom: 0.375rem !important;\n\n &,\n & img,\n &.small-image img {\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n &.square-image {\n width: 5rem;\n height: 5rem;\n min-height: 0;\n margin-bottom: 0 !important;\n\n img {\n width: 100%;\n height: 100%;\n }\n }\n }\n\n &.with-video .media-inner {\n margin-top: 0.5rem !important;\n margin-bottom: 1rem !important;\n }\n\n &.with-square-photo {\n display: flex;\n margin-bottom: 1rem;\n\n .WebPage-text {\n order: 1;\n padding-right: 1rem;\n }\n\n .media-inner {\n order: 2;\n flex-shrink: 0;\n }\n\n &:dir(rtl) {\n .WebPage-text {\n padding-inline-end: 1rem;\n }\n }\n }\n\n &:not(.with-square-photo) {\n .site-name,\n .site-title,\n .site-description {\n &:last-child::after {\n content: \"\";\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 0.75rem;\n float: right;\n }\n }\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n max-width: 100%;\n }\n\n .site-name {\n color: var(--accent-color);\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-title {\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-description {\n line-height: 1.25;\n margin-bottom: 0;\n\n body.is-ios & {\n line-height: 1.125rem;\n }\n }\n\n &:dir(rtl) {\n padding-inline-start: 0.625rem;\n\n &::before {\n left: auto;\n right: 0;\n }\n }\n}\n",".Invoice {\n .title {\n color: var(--accent-color);\n font-weight: 500;\n }\n\n .description {\n position: relative;\n\n &.has-image {\n .invoice-image {\n max-width: 100%;\n height: 20rem;\n\n @media (max-width: 600px) {\n height: 10rem;\n }\n }\n\n .description-text {\n position: absolute;\n top: 0;\n padding: 0.25rem 0.5rem;\n margin: 0.25rem;\n background-color: rgba(90, 110, 70, 0.6);\n border-radius: var(--border-radius-messages-small);\n color: var(--color-text);\n font-weight: 500;\n\n span {\n margin-left: 0.5rem;\n }\n }\n }\n }\n}\n",".Album {\n position: relative;\n overflow: hidden;\n\n .message-content.media.text & {\n margin: -0.3125rem -0.5rem 0.3125rem;\n }\n\n body.is-ios .Message.own .message-content.has-solid-background & {\n margin: -0.3125rem -0.5rem 0.3125rem -0.625rem;\n }\n\n .forwarded-message & {\n margin-bottom: 0.125rem;\n\n .message-content.media.text & {\n margin: 0 0 0.3125rem;\n --border-bottom-left-radius: inherit;\n --border-bottom-right-radius: inherit;\n }\n }\n\n &,\n .message-content.media.text & {\n > .album-item-select-wrapper .media-inner {\n margin: 0 !important;\n }\n }\n\n > .album-item-select-wrapper .media-inner {\n &,\n & img,\n & video {\n border-radius: 0 !important;\n object-fit: cover;\n }\n }\n}\n",".RoundVideo {\n position: relative;\n width: 15rem;\n height: 15rem;\n cursor: pointer;\n\n .thumbnail-wrapper {\n width: 15rem;\n height: 15rem;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .video-wrapper {\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .progress {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n\n .progress-circle {\n stroke: white;\n fill: transparent;\n stroke-width: 4;\n stroke-opacity: 0.35;\n stroke-linecap: round;\n }\n\n video::-internal-media-controls-cast-button,\n video::-webkit-media-controls,\n video::-webkit-media-controls-start-playback-button {\n display: none;\n }\n}\n",".InlineButtons {\n display: flex;\n flex-direction: column;\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .Button {\n flex: 1;\n width: auto;\n margin: 0.125rem;\n background: var(--pattern-color);\n border-radius: var(--border-radius-messages-small);\n font-weight: 500;\n text-transform: none;\n\n &::before {\n content: \"\";\n background-color: var(--color-white);\n opacity: 0;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--border-radius-messages-small);\n z-index: var(--z-below);\n transition: opacity 200ms;\n }\n\n &:hover {\n background: var(--pattern-color) !important;\n\n &::before {\n opacity: 0.4;\n }\n }\n\n &:first-of-type {\n margin-left: 0;\n }\n\n &:last-of-type {\n margin-right: 0;\n }\n\n i {\n font-size: 0.875rem;\n position: absolute;\n right: 0.1875rem;\n top: 0.1875rem;\n display: block;\n\n &.icon-arrow-right {\n font-size: 0.75rem;\n top: 0.125rem;\n right: 0.125rem;\n transform: rotate(-45deg);\n }\n }\n }\n\n .row:first-of-type .Button {\n margin-top: 0.25rem !important;\n }\n\n .row:last-of-type .Button {\n margin-bottom: 0;\n\n &:first-of-type {\n border-bottom-left-radius: var(--border-radius-messages);\n }\n\n &:last-of-type {\n border-bottom-right-radius: var(--border-radius-messages);\n }\n }\n}\n",".CommentButton {\n --background-color: var(--color-background);\n --hover-color: var(--color-chat-hover);\n\n display: flex;\n width: 100%;\n align-items: center;\n padding: 0.5625rem 0.25rem 0.5625rem 0.625rem;\n padding-inline-start: 0.625rem;\n padding-inline-end: 0.25rem;\n background: var(--background-color);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n font-size: 0.9375rem;\n font-weight: 500;\n line-height: 2rem;\n color: var(--accent-color);\n white-space: nowrap;\n cursor: pointer;\n transition: background-color 0.15s, color 0.15s;\n user-select: none;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .Message .has-appendix &::before {\n content: \"\";\n display: block;\n position: absolute;\n bottom: -0.1875rem;\n left: -0.5625rem;\n width: 0.5625rem;\n height: 1.25rem;\n background-position: bottom left;\n background-image: url('data:image/svg+xml,%3Csvg width=\"9\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"%3E%3Cdefs%3E%3Cfilter x=\"-50%25\" y=\"-14.7%25\" width=\"200%25\" height=\"141.2%25\" filterUnits=\"objectBoundingBox\" id=\"a\"%3E%3CfeOffset dy=\"1\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\"/%3E%3CfeGaussianBlur stdDeviation=\"1\" in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\"/%3E%3CfeColorMatrix values=\"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0\" in=\"shadowBlurOuter1\"/%3E%3C/filter%3E%3Cpath d=\"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z\" id=\"b\"/%3E%3C/defs%3E%3Cg fill=\"none\" fill-rule=\"evenodd\"%3E%3Cuse fill=\"%23000\" filter=\"url(%23a)\" xlink:href=\"%23b\"/%3E%3Cuse fill=\"%23FFF\" xlink:href=\"%23b\"/%3E%3C/g%3E%3C/svg%3E');\n opacity: 0;\n transition: opacity 0.15s, filter 0.15s;\n\n .theme-dark #root & {\n filter: invert(0.83);\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .custom-shape & {\n position: absolute;\n right: -3rem;\n width: 2.25rem;\n bottom: 3rem;\n height: 3.375rem;\n border-radius: 1.375rem;\n padding: 0.375rem 0.3125rem 0.25rem;\n align-items: flex-start;\n color: white;\n background-color: rgba(0, 0, 0, 0.2);\n\n opacity: 0;\n transition: opacity 0.2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover {\n background-color: rgba(0, 0, 0, 0.28);\n }\n\n .Message:hover & {\n opacity: 1;\n }\n\n &::after {\n content: attr(data-cnt);\n position: absolute;\n bottom: -0.0625rem;\n left: 0;\n width: 100%;\n text-align: center;\n font-size: 12px;\n display: block;\n }\n\n &[data-cnt=\"0\"] {\n height: 2.25rem;\n &::after {\n display: none;\n }\n }\n\n .icon-comments-sticker {\n display: block;\n font-size: 1.5rem;\n margin: 0 auto;\n }\n\n .recent-repliers,\n .icon-comments,\n .label,\n .icon-next {\n display: none;\n }\n }\n\n &:hover {\n background: var(--hover-color);\n\n .Message .has-appendix &::before {\n opacity: 1;\n }\n\n .Avatar {\n border-color: var(--hover-color) !important;\n }\n }\n\n .is-forwarded &,\n .audio &,\n .voice &,\n .poll &,\n .text & {\n border-top: 1px solid var(--color-borders);\n }\n\n .message-content.has-solid-background & {\n margin: 0.375rem -0.5rem -0.375rem;\n }\n\n .message-content.voice & {\n margin-bottom: -0.5rem;\n }\n\n .message-content.audio & {\n margin-bottom: -0.8125rem;\n }\n\n .message-content.audio &,\n .message-content.voice &,\n .message-content.poll &,\n .message-content.has-solid-background.text &,\n .message-content.has-solid-background.is-forwarded & {\n width: calc(100% + 1rem);\n }\n\n .icon-comments-sticker {\n display: none;\n }\n\n .icon-comments {\n font-size: 1.5625rem;\n line-height: 2rem;\n margin-inline-end: 0.875rem;\n }\n\n .icon-next {\n margin-inline-start: auto;\n font-size: 1.5rem;\n }\n\n .recent-repliers {\n display: inline-flex;\n align-items: center;\n margin-inline-end: 0.5rem;\n margin-inline-start: -0.125rem;\n\n .Avatar {\n transition: border 0.15s;\n border: 2px solid var(--color-background);\n margin-inline-end: 0;\n z-index: 3;\n overflow: hidden;\n\n .emoji {\n width: 1rem;\n background-size: 1rem;\n }\n\n + .Avatar {\n z-index: 2;\n\n + .Avatar {\n z-index: 1;\n }\n }\n\n &:not(:first-child) {\n margin-inline-start: -0.75rem;\n }\n }\n }\n\n &.has-unread .label {\n position: relative;\n\n &::after {\n content: \"\";\n display: inline-block;\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 50%;\n background: var(--accent-color);\n margin-inline-start: 0.75rem;\n }\n }\n\n &.disabled {\n cursor: default;\n pointer-events: none;\n }\n}\n",".Reactions {\n display: flex;\n flex-direction: row;\n width: 100%;\n flex-wrap: wrap;\n margin-top: 0.25rem;\n overflow: visible;\n\n .Button {\n --reaction-background: var(--color-reaction);\n display: flex;\n flex-direction: row;\n height: 1.75rem;\n white-space: nowrap;\n width: auto;\n margin: 0.125rem;\n padding: 0 0.5rem;\n border: 2px solid transparent;\n background-color: var(--reaction-background) !important;\n border-radius: 1.75rem;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n text-transform: none;\n color: var(--accent-color);\n overflow: visible;\n\n .ReactionAnimatedEmoji, .icon-reaction-filled {\n width: 1.125rem;\n height: 1.125rem;\n margin-right: 0.25rem;\n }\n\n .avatars {\n display: flex;\n\n .Avatar {\n margin: 0 0 0 -0.25rem;\n border: 0.0625rem solid var(--reaction-background);\n width: 1.25rem;\n height: 1.25rem;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n\n &.chosen {\n border-color: var(--accent-color);\n position: relative;\n z-index: 1;\n }\n\n &:hover {\n --reaction-background: var(--hover-color-reaction);\n }\n\n &:first-of-type {\n margin-left: 0;\n }\n\n &:last-of-type {\n margin-right: 0;\n }\n }\n\n &.is-outside {\n margin-top: 0.125rem;\n }\n\n .own &.is-outside {\n flex-direction: row-reverse;\n }\n\n &.is-outside .Button {\n --reaction-background: var(--pattern-color);\n color: white;\n .theme-dark & {\n color: var(--accent-color);\n }\n\n &.chosen {\n border-color: white;\n\n .theme-dark & {\n border-color: var(--accent-color);\n }\n }\n }\n}\n",".message-content {\n position: relative;\n max-width: var(--max-width);\n\n @media (max-width: 600px) {\n max-width: min(29rem, calc(100vw - 6.25rem));\n .MessageList.no-avatars & {\n max-width: min(29rem, calc(100vw - 3.75rem));\n }\n .Message.own & {\n max-width: min(30rem, calc(100vw - 3.75rem));\n }\n\n &.has-action-button {\n max-width: min(29rem, calc(100vw - 7rem));\n .MessageList.no-avatars & {\n max-width: min(29rem, calc(100vw - 4.5rem));\n }\n .Message.own & {\n max-width: min(30rem, calc(100vw - 4.5rem));\n }\n }\n }\n\n img {\n -webkit-touch-callout: none;\n user-select: none;\n }\n\n .emoji {\n -webkit-user-drag: none;\n user-select: text;\n }\n\n .text-content {\n margin: 0;\n word-break: break-word;\n white-space: pre-wrap;\n line-height: 1.3125;\n text-align: initial;\n display: flow-root;\n unicode-bidi: plaintext;\n }\n\n .text-entity-link {\n unicode-bidi: plaintext;\n }\n\n &:not(.custom-shape) .text-content,\n &.document {\n & > .MessageMeta {\n position: relative;\n top: 0.375rem;\n bottom: auto !important;\n float: right;\n line-height: 1.35;\n height: calc(var(--message-meta-height, 1rem));\n margin-left: 0.4375rem;\n margin-right: -0.5rem;\n\n .MessageOutgoingStatus .Transition {\n max-height: calc(var(--message-meta-height, 1rem));\n overflow: hidden;\n }\n\n html[data-message-text-size=\"12\"] & {\n top: 0.25rem;\n }\n\n html[data-message-text-size=\"17\"] & {\n top: 0.4375rem;\n }\n\n html[data-message-text-size=\"18\"] &,\n html[data-message-text-size=\"19\"] & {\n top: 0.5rem;\n }\n\n html[data-message-text-size=\"20\"] & {\n top: 0.5625rem;\n }\n }\n\n &:dir(rtl) {\n & > .MessageMeta {\n float: left;\n margin-left: -0.25rem;\n margin-right: 0.4375rem;\n }\n }\n }\n\n .MessageMeta.reactions-offset {\n position: relative;\n top: 0.375rem;\n bottom: auto !important;\n float: right;\n line-height: 1;\n height: calc(var(--message-meta-height, 1rem));\n margin-left: auto;\n margin-right: -0.5rem;\n align-self: flex-end;\n\n .MessageOutgoingStatus .Transition {\n max-height: calc(var(--message-meta-height, 1rem));\n overflow: hidden;\n }\n\n html[data-message-text-size=\"12\"] & {\n top: 0.25rem;\n }\n\n html[data-message-text-size=\"17\"] & {\n top: 0.4375rem;\n }\n\n html[data-message-text-size=\"18\"] &,\n html[data-message-text-size=\"19\"] & {\n top: 0.5rem;\n }\n\n html[data-message-text-size=\"20\"] & {\n top: 0.5625rem;\n }\n }\n\n &.document:not(.text) {\n &::after {\n content: \"\";\n display: block;\n clear: both;\n }\n\n & > .MessageMeta {\n top: auto !important;\n bottom: -0.5rem !important;\n margin-top: -0.25rem;\n\n &:not([dir=\"rtl\"]) {\n margin-top: -1.25rem;\n }\n }\n }\n\n .theme-dark .Message.own & {\n .text-entity-link {\n text-decoration: underline !important;\n\n &:hover {\n text-decoration: none !important;\n }\n }\n }\n\n &:not(.custom-shape) {\n font-size: var(--message-text-size, 1rem);\n\n body.is-ios & {\n font-size: var(--message-text-size, 1.0625rem);\n }\n\n & > .content-inner {\n min-width: 0;\n }\n }\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #cae3f7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n\n .theme-dark & {\n --color-text: #000;\n }\n }\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n font-weight: 500;\n line-height: 1.25rem;\n color: var(--accent-color);\n unicode-bidi: plaintext;\n display: flex;\n\n & > .interactive {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.interactive,\n & > .interactive {\n cursor: pointer;\n\n &:hover {\n opacity: 0.85;\n }\n }\n\n & > .color-1 {\n color: var(--color-user-1);\n }\n\n & > .color-2 {\n color: var(--color-user-2);\n }\n\n & > .color-4 {\n color: var(--color-user-4);\n }\n\n & > .color-5 {\n color: var(--color-user-5);\n }\n\n & > .color-6 {\n color: var(--color-user-6);\n }\n\n & > .color-7 {\n color: var(--color-user-7);\n }\n\n & > .color-8 {\n color: var(--color-user-8);\n }\n\n .theme-dark .Message.own & > .color-1 {\n color: var(--accent-color);\n }\n\n & + .File {\n margin-top: 0.25rem;\n }\n\n .via {\n padding-right: 0.25rem;\n font-weight: 400;\n }\n\n span + .via {\n padding-left: 0.25rem;\n }\n\n .admin-title {\n flex: 1;\n margin-left: 1rem;\n text-align: right;\n font-weight: 400;\n font-size: 0.75rem;\n margin-top: -0.125rem;\n color: rgba(var(--color-text-meta-rgb), 0.75);\n\n .Message.own & {\n color: var(--accent-color);\n }\n }\n }\n\n &.has-shadow {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &.has-solid-background,\n &.has-background,\n .is-album & {\n background: var(--background-color);\n }\n\n &.has-solid-background {\n padding: 0.3125rem 0.5rem 0.375rem;\n\n .forwarded-message > .text-content:not(.with-meta):last-child::after {\n content: \"\";\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 1rem;\n }\n }\n\n body.is-ios &.has-solid-background {\n padding-bottom: 0.4375rem;\n }\n\n body.is-ios .Message.own &.has-solid-background {\n padding-left: 0.625rem;\n }\n\n &:not(.has-appendix) .svg-appendix {\n display: none;\n }\n\n .svg-appendix {\n overflow: hidden;\n position: absolute;\n bottom: -0.0625rem;\n width: 0.5625rem;\n height: 1.125rem;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--background-color);\n }\n\n .Message.own & {\n /* stylelint-disable-next-line plugin/whole-pixel */\n right: -0.551rem; // This value is correct. Safari fix\n }\n\n .Message:not(.own) & {\n /* stylelint-disable-next-line plugin/whole-pixel */\n left: -0.562rem; // This value is correct. Safari fix\n }\n }\n\n &[data-has-custom-appendix] {\n .svg-appendix .corner {\n fill: var(--appendix-bg);\n }\n }\n\n &.has-appendix-thumb {\n .Message & {\n .svg-appendix {\n --background-color: #ccc;\n opacity: 1;\n transition: opacity 500ms ease;\n }\n }\n }\n\n &.document {\n padding: 0.5rem !important;\n\n .File {\n .theme-dark & {\n --color-primary: var(--color-selection-highlight);\n }\n }\n\n .File + .text-content {\n margin-top: 0.3125rem;\n }\n }\n\n &.voice,\n &.audio {\n .message-title,\n .Embedded {\n margin-top: -0.1875rem;\n margin-bottom: 0.1875rem;\n }\n }\n\n &.voice {\n padding: 0.5rem !important;\n\n .Voice + .text-content {\n margin-top: 0.5rem;\n }\n }\n\n &.audio {\n min-width: 20rem;\n padding: 0.5rem 0.5rem 0.8125rem !important;\n\n @media (max-width: 600px) {\n min-width: 17rem;\n }\n\n .Audio + .text-content {\n margin-top: 0.25rem;\n }\n\n &:not(.has-replies) {\n .Audio + .text-content {\n margin-bottom: -0.4375rem;\n }\n }\n }\n\n &:not(.custom-shape) .emoji {\n display: inline-block;\n width: 1.25rem;\n background-size: 1.25rem;\n color: transparent;\n margin-inline-end: 1px;\n vertical-align: text-bottom;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &:not(.custom-shape) .text-content .emoji {\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n\n .no-media-corners {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.custom-shape.is-via-bot {\n font-size: inherit !important;\n\n .content-inner > .message-title {\n display: inline-flex;\n position: relative;\n top: 0.125rem;\n max-width: calc(100% - 3rem);\n margin-left: calc(100% - 3rem);\n padding: 0 0.5rem;\n background-color: var(--background-color);\n border-radius: var(--border-radius-messages);\n\n .Message.own & {\n margin-left: -3rem;\n }\n }\n\n .media-inner {\n margin-top: 0.375rem;\n }\n }\n}\n\n.message-content.media,\n.WebPage {\n .media-inner {\n display: flex;\n justify-content: center;\n align-items: center;\n\n &.interactive {\n cursor: pointer;\n\n &.dark video {\n background-color: #232323;\n }\n }\n }\n\n &.round.is-reply {\n width: auto !important;\n }\n\n &.force-sender-name .media-inner,\n &.force-sender-name .Album,\n &.text .media-inner,\n &.is-via-bot .media-inner,\n &.is-reply .media-inner,\n &.is-reply .Album {\n margin-left: -0.5rem;\n margin-right: -0.5rem;\n\n body.is-ios .Message.own & {\n margin-left: -0.625rem;\n }\n }\n\n &.text .media-inner {\n margin-top: -0.3125rem;\n }\n\n &.is-reply .media-inner,\n &.force-sender-name .Album,\n &.is-reply .Album,\n .message-title ~ .media-inner {\n margin-top: 0.375rem;\n margin-bottom: -0.375rem;\n\n body.is-ios .Message.own & {\n margin-bottom: -0.4375rem;\n }\n }\n\n &:not(.text) .RoundVideo {\n margin-bottom: 0;\n }\n\n // Moved below .is-reply to overwrite its styles\n &.text .media-inner,\n &.text .Album {\n margin-bottom: 0.375rem;\n\n body.is-ios .Message.own & {\n margin-bottom: 0.375rem;\n }\n }\n\n .media-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:not(.open) {\n opacity: 0.5;\n transform: scale(0);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n }\n\n .icon-large-play,\n .icon-download {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n opacity: 0.7;\n transition: opacity 150ms;\n\n &:hover {\n opacity: 1;\n }\n\n &:before {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: rgba(black, 0.25);\n }\n\n &.opacity-transition {\n transition: opacity 0.15s ease;\n\n &:not(.open) {\n opacity: 0;\n }\n }\n }\n\n .icon-download {\n font-size: 1.5rem;\n }\n\n .icon-large-play {\n font-size: 2.5rem;\n }\n\n .message-media-duration,\n .message-transfer-progress {\n background: rgba(0, 0, 0, 0.25);\n color: #fff;\n font-size: 0.75rem;\n position: absolute;\n left: 0.1875rem;\n top: 0.1875rem;\n z-index: 1;\n padding: 0 0.375rem;\n border-radius: 0.75rem;\n line-height: 1.125rem;\n user-select: none;\n }\n\n .message-media-duration .icon-muted {\n vertical-align: -0.1875rem;\n margin-left: 0.375rem;\n font-size: 1.0625rem;\n }\n}\n\n.message-content.custom-shape {\n line-height: 1.2;\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n\n &.has-comments {\n min-height: 5.25rem;\n margin-top: 0 !important;\n\n &.has-replies {\n min-height: 6.5rem;\n }\n }\n\n &.is-reply {\n max-width: 100%;\n }\n\n .reply-message {\n display: flex;\n align-items: flex-start;\n flex-direction: row-reverse;\n direction: ltr;\n\n > p {\n margin-bottom: 0;\n }\n\n .EmbeddedMessage {\n margin-left: 0.5rem;\n border-radius: var(--border-radius-messages);\n\n @media (max-width: 600px) {\n max-width: calc(90vw - 13rem);\n }\n\n @media (max-width: 340px) {\n margin-left: -1rem;\n z-index: 1;\n max-width: calc(90vw - 12rem);\n }\n }\n }\n\n .text-content {\n margin-bottom: 1rem;\n }\n\n .media-inner {\n line-height: 1;\n font-size: 1rem;\n flex-shrink: 0;\n\n .full-media {\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n }\n }\n\n .emoji {\n display: inline-block;\n color: transparent;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &.emoji-only {\n .text-content {\n margin-bottom: 0;\n text-shadow: 1px 1px 0 white, -1px -1px 0 white, -1px 1px 0 white, 1px -1px 0 white;\n img.emoji {\n filter: drop-shadow(1px 1px 0 white) drop-shadow(-1px 1px 0 white) drop-shadow(1px -1px 0 white)\n drop-shadow(-1px -1px 0 white);\n }\n\n .MessageMeta {\n text-shadow: none;\n }\n }\n }\n\n &.emoji-only-1 {\n min-width: 8rem;\n font-size: 4.5rem;\n\n .content-inner {\n height: 7rem;\n }\n\n .text-content {\n line-height: 1.5;\n text-align: center;\n }\n\n .Message.was-edited & {\n min-width: 10rem;\n }\n\n .emoji {\n width: 5rem;\n height: 5rem;\n }\n }\n\n &.emoji-only-2 {\n font-size: 4rem;\n margin-top: 0.5rem;\n min-width: 10rem;\n @media (max-width: 600px) {\n margin-top: 0.375rem;\n }\n\n &.has-comments {\n margin-top: 1.25rem;\n }\n\n .Message.was-edited & {\n min-width: 12rem;\n }\n\n .emoji {\n width: 4rem;\n height: 4rem;\n margin-right: 0.375rem;\n }\n }\n\n &.emoji-only-3 {\n font-size: 3rem;\n margin-top: 1.75rem;\n min-width: 12rem;\n\n &.has-comments {\n margin-top: 2.5rem;\n }\n\n .Message.was-edited & {\n min-width: 14rem;\n }\n\n .emoji {\n width: 3rem;\n height: 3rem;\n margin-right: 0.375rem;\n }\n }\n\n .Message:not(.own) & {\n --hover-color: var(--color-reply-hover);\n --active-color: var(--color-reply-active);\n }\n\n .Message.own & {\n --hover-color: var(--color-reply-own-hover);\n --active-color: var(--color-reply-own-active);\n\n .reply-message {\n flex-direction: row;\n\n .EmbeddedMessage {\n margin-right: 0.5rem;\n\n @media (max-width: 340px) {\n margin-left: 0;\n z-index: 1;\n max-width: calc(90vw - 11.5rem);\n }\n }\n }\n }\n}\n\n.forwarded-message {\n .message-content.contact &,\n .message-content.voice &,\n .message-content.poll & {\n // MessageOutgoingStatus's icon needs more space\n margin-bottom: 0.5rem;\n }\n\n .message-content:not(.custom-shape) & {\n position: relative;\n margin-top: 0.25rem;\n padding-left: 0.625rem;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0.0625rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:dir(rtl) {\n padding-inline-start: 0.625rem;\n\n &::before {\n left: auto;\n right: 0.0625rem;\n }\n }\n }\n\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n > .media-inner {\n margin: 0 !important;\n margin-bottom: 0.25rem !important;\n }\n}\n\n.long-word-break-all {\n word-break: break-all;\n}\n\n.text-entity-link {\n color: var(--color-links) !important;\n text-decoration: none !important;\n word-break: break-word;\n cursor: pointer;\n unicode-bidi: initial;\n\n &:hover,\n &:active,\n &:visited {\n text-decoration: underline !important;\n }\n}\n\n.text-entity-code,\n.text-entity-pre {\n color: var(--color-code);\n background: var(--color-code-bg);\n white-space: pre-wrap;\n margin: 0;\n padding: 1px 2px;\n border-radius: 4px;\n font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);\n}\n","@import \"message-content\";\n\n// General styles\n.Message {\n display: flex;\n align-items: flex-end;\n margin-bottom: 0.375rem;\n position: relative;\n\n --background-color: var(--color-background);\n --hover-color: var(--color-reply-hover);\n --color-reaction: var(--color-message-reaction);\n --hover-color-reaction: var(--color-message-reaction-hover);\n --active-color: var(--color-reply-active);\n --max-width: 29rem;\n --accent-color: var(--color-primary);\n --accent-shade-color: var(--color-primary-shade);\n --secondary-color: var(--color-text-secondary);\n --meta-safe-area-base: 2.25rem;\n --meta-safe-author-width: 0px;\n --meta-safe-area-extra-width: 0px;\n --meta-safe-area-size: calc(\n var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width)\n );\n --deleting-translate-x: -50%;\n --select-message-scale: 0.9;\n\n --border-top-left-radius: var(--border-radius-messages);\n --border-top-right-radius: var(--border-radius-messages);\n --border-bottom-left-radius: var(--border-radius-messages);\n --border-bottom-right-radius: var(--border-radius-messages);\n\n @media (min-width: 1921px) {\n --max-width: calc(30vw - 1rem);\n }\n @media (max-width: 600px) {\n margin-bottom: 0.25rem;\n }\n\n &.is-swiped {\n transform: translateX(-2.5rem) !important;\n }\n\n &.is-protected {\n user-select: none;\n }\n\n > .Avatar,\n > .message-content-wrapper {\n opacity: 1;\n transform: scale(1) translateX(0);\n transition: transform var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Avatar {\n position: absolute;\n bottom: 0;\n left: 0;\n\n @media (max-width: 600px) {\n width: 2.5rem;\n height: 2.5rem;\n }\n }\n\n .quick-reaction {\n cursor: pointer;\n position: absolute;\n right: -0.5rem;\n bottom: -0.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: scale(1);\n opacity: 0;\n transition: transform 0.2s ease-out, opacity 0.2s ease-out;\n transition-delay: 0.2s;\n\n &.visible {\n opacity: 1 !important;\n }\n\n &:hover {\n transition-delay: unset;\n transform: scale(1.4);\n }\n\n .ReactionStaticEmoji {\n width: 1.125rem;\n }\n }\n\n &.last-in-list .quick-reaction:hover {\n transform: translateY(-0.1875rem) scale(1.4);\n }\n\n &.own .quick-reaction {\n right: auto;\n left: -0.5rem;\n }\n\n &.last-in-group {\n margin-bottom: 0.625rem;\n @media (max-width: 600px) {\n margin-bottom: 0.4375rem;\n }\n }\n\n &.last-in-list {\n // Forcing extra space which is taken by the appendix and causes incorrect container height calculation.\n // This value is accurately crafted as a minimum possible.\n margin-bottom: 0.375rem;\n }\n\n &.is-in-selection-mode {\n body.is-android & {\n .can-select-text {\n z-index: var(--z-message-select-control);\n }\n\n // Prevent media viewer from opening\n .media-inner {\n pointer-events: none;\n }\n }\n }\n\n &.has-inline-buttons {\n .message-content {\n border-bottom-right-radius: var(--border-radius-messages-small);\n }\n }\n\n &.has-active-reaction {\n .message-content-wrapper {\n z-index: 1;\n }\n }\n\n &:not(.own) {\n padding-left: 2.5rem;\n\n .no-avatars &,\n &.is-thread-top {\n padding-left: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 2.875rem;\n\n .no-avatars &,\n &.is-thread-top {\n padding-left: 0.25rem;\n }\n }\n\n &.first-in-group:not(.last-in-group) {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-left-radius: 0;\n }\n }\n }\n\n &.own {\n flex-direction: row-reverse;\n --background-color: var(--color-background-own);\n --hover-color: var(--color-reply-own-hover);\n --color-reaction: var(--color-message-reaction-own);\n --hover-color-reaction: var(--color-message-reaction-hover-own);\n --active-color: var(--color-reply-own-active);\n --max-width: 30rem;\n --accent-color: var(--color-accent-own);\n --accent-shade-color: var(--color-green);\n --secondary-color: var(--color-accent-own);\n --color-code: var(--color-code-own);\n --color-code-bg: var(--color-code-own-bg);\n --color-links: var(--color-own-links);\n --meta-safe-area-base: 3.5rem;\n --deleting-translate-x: 50%;\n --color-text-green: var(--color-accent-own);\n\n @media (min-width: 1921px) {\n --max-width: 30vw;\n }\n\n body.is-ios &,\n body.is-macos & {\n --color-background-own: var(--color-background-own-apple);\n --color-reply-own-hover: var(--color-reply-own-hover-apple);\n --color-reply-own-active: var(--color-reply-own-active-apple);\n }\n\n @media (max-width: 600px) {\n padding-right: 0.25rem;\n }\n\n &.first-in-group:not(.last-in-group) {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n }\n\n &.is-deleting {\n > .Avatar,\n > .message-content-wrapper {\n transition: opacity 0.2s ease, transform 0.2s ease-in;\n opacity: 0;\n transform: scale(0.3) translateX(var(--deleting-translate-x));\n transform-origin: bottom;\n }\n }\n\n &.has-views {\n --meta-safe-area-extra-width: 4rem;\n }\n\n &.was-edited {\n --meta-safe-area-extra-width: 2.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 7.5rem;\n }\n\n html[lang=\"ru\"] & {\n --meta-safe-area-extra-width: 3.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 8.5rem;\n }\n }\n }\n\n .select-mode-active & {\n cursor: pointer;\n\n @media (min-width: 600px) {\n user-select: none;\n }\n\n &:not(.own) {\n > .Avatar,\n > .message-content-wrapper {\n transform: translateX(2.5rem);\n }\n }\n\n &:not(.is-album)::after {\n content: \"\";\n position: absolute;\n top: -0.25rem;\n bottom: -0.25rem;\n left: -4rem;\n right: -4rem;\n z-index: var(--z-message-select-area);\n }\n\n &.is-album,\n &.is-in-document-group {\n .message-select-control {\n pointer-events: unset;\n }\n }\n\n .message-select-control {\n opacity: 1;\n }\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n\n &.group-select {\n background: transparent;\n\n &.is-selected {\n background: var(--color-green);\n }\n }\n }\n }\n\n .File.file-is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n }\n\n &.is-in-document-group .File.file-is-selected .file-icon,\n &.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-selected);\n }\n\n &.own.is-in-document-group .File.file-is-selected .file-icon,\n &.own.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-own-selected);\n }\n\n .Audio .message-select-control {\n left: 1.0625rem;\n top: 1.375rem;\n }\n\n html.theme-dark &.own .Audio .toggle-play:not(.with-image) + .media-loading {\n .ProgressSpinner {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);\n background-position: center;\n background-size: 1rem;\n\n circle {\n stroke: var(--background-color);\n }\n }\n }\n\n .File {\n position: relative;\n\n .message-select-control {\n position: absolute;\n top: 2rem;\n left: 2rem;\n z-index: 2;\n }\n }\n\n .album-item-select-wrapper {\n position: absolute;\n .Message.own & {\n background: var(--color-background-own);\n }\n\n .message-select-control {\n position: absolute;\n z-index: 2;\n top: 0.4375rem;\n right: 0.4375rem;\n left: unset;\n }\n\n img,\n video {\n transition: transform var(--select-transition), opacity ease 300ms;\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n\n img,\n video {\n transform: scale(var(--select-message-scale));\n }\n }\n }\n\n &.is-selected,\n &.is-forwarding {\n .message-select-control {\n background: var(--color-green);\n }\n\n .Menu .bubble {\n transition: none !important;\n }\n }\n\n &.is-in-document-group {\n .message-content.document {\n padding: 0.25rem 0.5rem !important;\n }\n\n &.last-in-document-group {\n .message-content.document {\n padding-bottom: 0.5rem !important;\n }\n }\n\n &.first-in-document-group {\n .message-content.document {\n padding-top: 0.5rem !important;\n }\n }\n\n &:not(.first-in-document-group) {\n &::before {\n top: 0 !important;\n }\n\n .message-content {\n box-shadow: none;\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n }\n\n .forwarded-message::before {\n top: -1.5rem;\n }\n }\n\n &:not(.last-in-document-group) {\n margin-bottom: 0;\n\n &::before {\n bottom: 0 !important;\n }\n\n .message-content {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n &.is-in-selection-mode {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: white;\n\n &::after {\n content: \"\";\n width: 1.25rem;\n height: 1.25rem;\n border-radius: 0.6875rem;\n background: white;\n border: 0.125rem rgba(0, 0, 0, 0.2) solid;\n position: absolute;\n }\n }\n }\n\n &.own {\n .message-content {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: var(--background-color);\n border-color: var(--background-color);\n\n &::after {\n background: var(--background-color);\n border-color: var(--color-message-meta-own);\n }\n }\n }\n }\n }\n }\n\n &.focused,\n &.has-menu-open,\n &.is-forwarding,\n &.is-selected {\n .message-content {\n background: var(--color-background-selected);\n }\n\n &.own {\n .message-content {\n --background-color: var(--color-background-own-selected);\n background: var(--color-background-own-selected);\n }\n }\n }\n\n .message-content-wrapper {\n width: 17.1875rem;\n }\n\n .message-content {\n transition: background-color var(--select-transition);\n }\n\n &.own {\n .message-content-wrapper {\n display: flex;\n justify-content: flex-end;\n\n .message-content {\n width: 100%;\n }\n }\n }\n }\n\n .message-select-control {\n position: absolute;\n left: 0;\n bottom: 0.25rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 2px solid white;\n border-radius: 50%;\n z-index: var(--z-message-select-control);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: white;\n font-size: 1rem;\n\n opacity: 0;\n pointer-events: none;\n transition: opacity var(--select-transition);\n\n .icon-select {\n position: absolute;\n left: -3px;\n top: -3px;\n font-size: 1.625rem;\n }\n\n .theme-dark & {\n border-color: #ffffff80;\n }\n }\n\n .Avatar {\n margin-right: 0.3125rem;\n }\n\n .message-content {\n &.has-replies:not(.custom-shape):not(.has-reactions) .WebPage.with-video .media-inner {\n margin-bottom: 1.5rem !important;\n }\n\n &.has-replies:not(.custom-shape),\n &.text {\n .media-inner,\n .Album {\n --border-bottom-left-radius: 0;\n --border-bottom-right-radius: 0;\n }\n }\n\n &.is-reply .EmbeddedMessage {\n & + .Album,\n & + .Audio,\n & + .File {\n margin-top: 0.375rem;\n }\n }\n\n &:not(.custom-shape).is-reply .media-inner,\n &:not(.custom-shape).is-reply .Album,\n &:not(.custom-shape).force-sender-name .Album,\n &:not(.is-forwarded) .message-title ~ .media-inner {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.is-forwarded .content-inner .message-title {\n margin-bottom: 0.25rem;\n }\n }\n\n .message-action-button {\n position: absolute;\n bottom: 0;\n color: white;\n background-color: rgba(0, 0, 0, 0.2);\n\n opacity: 0;\n transition: opacity 0.2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover,\n &:active,\n &:focus {\n background-color: rgba(0, 0, 0, 0.28) !important;\n }\n }\n\n &:hover,\n &[data-is-document-group-hover] {\n .message-action-button {\n opacity: 1;\n }\n }\n\n &.own .message-action-button {\n left: -3rem;\n }\n\n &:not(.own) .message-action-button {\n right: -3rem;\n }\n\n .bottom-marker {\n height: 1px;\n width: 1px;\n visibility: hidden;\n }\n}\n\n// Border-radius styles\n.message-content,\n.Album,\n.media-inner,\n.message-content.media .media-inner img,\n.message-content.media .media-inner video,\n.message-content.custom-shape .media-inner img {\n border-top-left-radius: var(--border-top-left-radius);\n border-top-right-radius: var(--border-top-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n}\n\n.media-inner video.full-media {\n background: transparent !important;\n}\n\n.media-inner {\n overflow: hidden;\n\n &.small-image img {\n border-radius: 0 !important;\n }\n}\n\n.Message .custom-shape .message-action-button {\n bottom: 0.25rem;\n}\n",".SponsoredMessage {\n --border-top-left-radius: var(--border-radius-messages) !important;\n --border-bottom-left-radius: var(--border-radius-messages) !important;\n\n margin-top: -0.5rem;\n margin-bottom: 0.5rem;\n\n &::before {\n display: none;\n }\n\n &__button.secondary {\n margin-top: 0.5rem;\n border: 1px solid var(--color-primary);\n border-radius: var(--border-radius-default-tiny);\n color: var(--color-primary);\n }\n}\n",".ContactGreeting {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n background: var(--pattern-color);\n width: 14.5rem;\n padding: 0.75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n }\n\n .title {\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .description {\n font-size: 0.9375rem;\n margin-bottom: 0;\n }\n\n .sticker {\n margin: 2rem 0 1rem;\n height: 10rem;\n width: 10rem;\n cursor: pointer;\n\n .thumbnail {\n height: 10rem;\n width: 10rem;\n }\n }\n}\n",".NoMessages {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .icon {\n font-size: 5rem;\n margin: 0 auto 1rem;\n }\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n background: var(--pattern-color);\n max-width: 20rem;\n padding: 0.75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n\n &[dir=\"rtl\"] {\n text-align: right;\n }\n }\n\n .title {\n font-weight: 500;\n font-size: 1rem;\n margin-bottom: 0.25rem;\n text-align: center;\n unicode-bidi: plaintext;\n }\n\n .description {\n font-size: 0.9375rem;\n margin: 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n }\n\n .list-checkmarks {\n font-size: 0.9375rem;\n margin: 0.25rem 0 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n line-height: 1.8;\n\n li::before {\n content: \"✓\";\n margin-inline-end: 0.5rem;\n }\n }\n}\n","@import \"../../styles/mixins\";\n\n.MessageList {\n flex: 1;\n width: 100%;\n margin-bottom: 0.5rem;\n\n overflow: scroll;\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .mask-image-enabled & {\n mask-image: linear-gradient(to top, transparent 0, #000 0.5rem);\n }\n\n @media (pointer: coarse) {\n user-select: none;\n -webkit-touch-callout: none;\n\n &.select-mode-active {\n user-select: auto;\n -webkit-touch-callout: default;\n }\n }\n\n transition: bottom 150ms ease-out, transform var(--layer-transition);\n body.keyboard-visible & {\n position: relative;\n bottom: calc(0px - env(safe-area-inset-bottom));\n\n body.keyboard-visible.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &.no-avatars .Message > .Avatar {\n display: none;\n }\n\n .messages-container {\n width: 100%;\n max-width: var(--messages-container-width);\n min-height: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: flex-end;\n flex-direction: column;\n padding: 1rem 1rem 0 1.125rem;\n\n .force-messages-scroll & {\n margin-top: 100vh !important;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n padding: 2.75rem 0.5rem 0;\n // Patch for an issue on Android when rotating device\n margin: 0;\n }\n }\n\n &.no-composer {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 1rem;\n }\n }\n\n &.select-mode-active,\n &.type-pinned {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 5.625rem;\n\n @media (max-width: 600px) {\n margin-bottom: 4.25rem;\n }\n\n &.ActionMessage {\n padding-bottom: 0.125rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n &.with-bottom-shift {\n margin-bottom: 0;\n .last-in-list {\n margin-bottom: 4.25rem;\n\n body:not(.keyboard-visible) & {\n margin-bottom: calc(4.25rem + env(safe-area-inset-bottom));\n }\n }\n }\n }\n\n .Message,\n .ActionMessage {\n position: relative;\n\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.2s ease, transform 0.2s ease;\n\n &:not(.open) {\n transform: scale(0.8);\n opacity: 0;\n }\n\n // Restore stacking context\n // https://developer.mozilla.org/ru/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n &.open.shown {\n transform: none;\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -0.1875rem;\n bottom: -0.1875rem;\n left: -50vw;\n right: -50vw;\n background: black;\n z-index: -1;\n\n opacity: 0;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &:not(.last-in-group) {\n &::before {\n bottom: -0.1875rem;\n }\n }\n\n &:not(.first-in-group) {\n &::before {\n top: -0.1875rem;\n }\n }\n\n &.focused::before {\n // @optimization\n transition: none !important;\n }\n\n &.focused,\n &.is-forwarding,\n &.is-selected,\n &.has-menu-open {\n &::before {\n opacity: 0.1;\n\n .theme-dark & {\n opacity: 0.6;\n }\n }\n }\n }\n\n > .empty {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > span {\n max-width: 80%;\n text-align: left;\n }\n\n .text-entity-link {\n color: inherit !important;\n text-decoration: underline;\n\n &:hover,\n &:focus {\n text-decoration: none;\n }\n }\n }\n\n .sticky-date,\n .local-action-message,\n .ActionMessage,\n .empty {\n text-align: center;\n user-select: none;\n\n > span {\n display: inline-block;\n background: var(--pattern-color);\n color: white;\n font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);\n font-weight: 500;\n line-height: 1.75;\n padding: 0 0.5rem;\n border-radius: var(--border-radius-messages);\n word-break: break-word;\n\n body.is-ios &,\n body.is-macos & {\n font-size: calc(var(--message-text-size, 1rem) - 0.125rem);\n line-height: calc(var(--message-text-size, 1rem) + 0.5rem);\n }\n\n .emoji-small {\n vertical-align: text-bottom;\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n }\n }\n\n .sticky-date {\n margin-top: 1rem;\n margin-bottom: 1rem;\n z-index: var(--z-sticky-date);\n pointer-events: none;\n opacity: 1;\n transition: opacity 0.3s ease;\n\n @media (max-width: 600px) {\n margin-top: 0.5rem;\n margin-bottom: 0.75rem;\n }\n\n body:not(.is-scrolling-messages) &.stuck {\n opacity: 0;\n\n span {\n pointer-events: none;\n }\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &.interactive {\n cursor: pointer;\n }\n\n span {\n pointer-events: auto;\n }\n }\n\n &.scrolled:not(.is-animating) .sticky-date {\n position: sticky;\n top: 0.625rem;\n }\n\n &.is-animating {\n overflow: hidden;\n }\n\n &.is-animating .message-select-control {\n display: none !important;\n }\n\n .has-header-tools & .sticky-date {\n top: 3.75rem !important;\n }\n\n .local-action-message,\n .ActionMessage {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .ActionMessage {\n .action-link {\n cursor: pointer;\n\n &:hover {\n text-decoration: underline;\n }\n }\n }\n\n .sticky-date + .ActionMessage {\n margin-top: -0.5rem;\n }\n\n @media (min-width: 1276px) {\n width: 100%;\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n .messages-container {\n width: calc(100% - var(--right-column-width));\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n\n body:not(.animating-right-column) #Main.right-column-open &.select-mode-active,\n #Main.right-column-open &:not(.select-mode-active),\n body.animating-right-column &:not(.select-mode-active) {\n width: calc(100% - var(--right-column-width));\n\n .messages-container {\n width: 100%;\n }\n }\n }\n\n @media (max-width: 600px) {\n transition: transform var(--layer-transition);\n\n body.enable-symbol-menu-transforms & {\n transform: translate3d(0, 0, 0);\n }\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n .animating > div > & {\n &::-webkit-scrollbar {\n width: 0;\n }\n\n /* Styles for Firefox */\n @supports (scrollbar-width: none) {\n padding-right: 0.6875rem;\n scrollbar-width: none;\n }\n }\n}\n",".ScrollDownButton {\n --base-bottom-pos: 6rem;\n\n position: absolute;\n bottom: var(--base-bottom-pos);\n right: max(1rem, env(safe-area-inset-right));\n opacity: 0;\n transform: translateY(4.5rem);\n transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;\n z-index: var(--z-scroll-down-button);\n pointer-events: none;\n\n body.animation-level-0 & {\n transform: none !important;\n\n transition: opacity 0.15s;\n }\n\n @media (max-width: 600px) {\n right: 0.5rem;\n bottom: 4.5rem;\n\n body:not(.keyboard-visible) & {\n bottom: calc(4.5rem + env(safe-area-inset-bottom));\n }\n }\n\n &-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n > .Button {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n color: var(--color-composer-button);\n\n i {\n font-size: 1.75rem;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translateX(0);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n #Main.right-column-open & {\n transform: translateX(calc(-1 * var(--right-column-width)));\n }\n }\n\n @media (max-width: 600px) {\n > .Button {\n width: 2.875rem;\n height: 2.875rem;\n }\n }\n }\n\n &.revealed {\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n\n &.no-composer:not(.with-extra-shift) {\n transform: translateY(4rem);\n }\n }\n\n .unread-count {\n min-width: 1.5rem;\n height: 1.5rem;\n padding: 0 0.4375rem;\n border-radius: 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.3125rem;\n right: -0.3125rem;\n\n background: var(--color-green);\n color: white;\n\n pointer-events: none;\n\n @media (max-width: 600px) {\n top: -0.6875rem;\n right: auto;\n }\n }\n\n @media (max-width: 600px) {\n body.is-symbol-menu-open & {\n bottom: calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height));\n }\n }\n}\n",".BotKeyboardMenu {\n .bubble {\n width: 100% !important;\n max-width: 27rem;\n border-radius: var(--border-radius-default-small);\n }\n\n .content {\n display: flex;\n flex-direction: column;\n padding: 0.1875rem 0.625rem;\n max-height: 80vh;\n overflow: auto;\n\n @media (max-width: 600px) {\n max-height: 75vh;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .row + .row {\n margin-top: 0.375rem;\n }\n\n .Button {\n flex: 1;\n width: auto;\n height: auto;\n min-height: 3.0625rem;\n border-radius: var(--border-radius-messages-small);\n border: 2px solid var(--color-primary);\n background: var(--color-background);\n color: var(--color-primary);\n font-weight: 500;\n text-transform: none;\n\n &:hover {\n color: #fff;\n border-color: var(--color-primary-shade);\n background: var(--color-primary-shade);\n }\n }\n\n .Button + .Button {\n margin-left: 0.375rem;\n }\n }\n}\n",".ComposerEmbeddedMessage {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n}\n",".WebPagePreview {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n // TODO Remove duplication with `.ComposerEmbeddedMessage`\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n --accent-color: var(--color-primary);\n\n .ComposerEmbeddedMessage + & {\n margin-top: 0.75rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n\n .WebPage {\n flex-grow: 1;\n margin: 0.1875rem 0 0.1875rem 0.125rem;\n max-width: calc(100% - 3.375rem);\n\n &::before {\n top: 0.125rem;\n bottom: 0.0625rem;\n }\n\n &.with-video .media-inner {\n display: none;\n }\n\n .site-title,\n .site-description {\n flex: 1;\n max-width: 100%;\n max-height: 1rem;\n }\n\n .site-title {\n margin-top: 0.125rem;\n margin-bottom: 0.1875rem;\n }\n\n .site-description {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n}\n","@import \"../../../styles/mixins\";\n\n.Composer {\n align-items: flex-end;\n\n .select-mode-active + .middle-column-footer & {\n position: absolute;\n padding-right: 2rem;\n bottom: env(safe-area-inset-bottom);\n\n @media (max-width: 600px) {\n padding-right: 1rem;\n }\n\n &::before {\n right: 2.125rem;\n\n @media (max-width: 600px) {\n right: 1rem;\n }\n }\n\n .svg-appendix {\n opacity: 0;\n }\n }\n\n .form-control {\n --border-width: 0;\n }\n\n @keyframes show-send-as-button {\n from {\n width: 1rem;\n transform: scale(0);\n }\n\n to {\n width: 3.5rem;\n transform: scale(1);\n }\n }\n\n > .Button {\n flex-shrink: 0;\n margin-left: 0.5rem;\n\n &:not(.danger) {\n color: var(--color-composer-button);\n }\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n }\n\n .icon-send,\n .icon-schedule,\n .icon-microphone-alt,\n .icon-check {\n position: absolute;\n }\n\n &:not(:active):not(:focus):not(:hover) {\n .icon-send,\n .icon-schedule,\n .icon-check {\n color: var(--color-primary);\n }\n }\n\n &.cancel {\n position: relative;\n z-index: 1;\n\n &:hover,\n &.active {\n background: var(--color-chat-hover);\n }\n }\n\n &.recording {\n position: relative;\n z-index: 0;\n transition: box-shadow 0.1s;\n }\n\n &.send {\n .icon-send {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-microphone-alt,\n .icon-check,\n .icon-schedule {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.schedule {\n .icon-schedule {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-microphone-alt,\n .icon-check,\n .icon-send {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.record {\n .icon-microphone-alt {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-send,\n .icon-check,\n .icon-schedule {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.edit {\n .icon-check {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-send,\n .icon-microphone-alt,\n .icon-schedule {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n body.animation-level-0 &,\n body.animation-level-1 & {\n .icon-send,\n .icon-microphone-alt,\n .icon-check,\n .icon-schedule {\n animation-duration: 0ms !important;\n }\n }\n }\n\n .send-as-button {\n z-index: 1;\n }\n\n body:not(.animation-level-0) & .send-as-button.appear-animation {\n animation: 0.25s ease-in-out forwards show-send-as-button;\n transform-origin: right;\n }\n\n .mobile-symbol-menu-button {\n width: 2.875rem;\n height: 2.875rem;\n position: relative;\n\n .icon-smile,\n .icon-keyboard,\n .Spinner {\n position: absolute;\n }\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n\n .icon-smile {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-keyboard,\n .Spinner {\n animation: hide-icon 0.4s forwards ease-out;\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n &.is-loading {\n .Spinner {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-keyboard,\n .icon-smile {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n\n &.menu-opened {\n .icon-keyboard {\n animation: grow-icon 0.4s ease-out;\n }\n\n .icon-smile,\n .Spinner {\n animation: hide-icon 0.4s forwards ease-out;\n }\n }\n }\n}\n\n#message-compose {\n flex-grow: 1;\n max-width: calc(100% - 4rem);\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n border-bottom-right-radius: 0;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n position: relative;\n z-index: 1;\n\n .svg-appendix {\n position: absolute;\n bottom: -0.1875rem;\n /* stylelint-disable-next-line plugin/whole-pixel */\n right: -0.551rem; // This value is correct. Safari fix\n width: 0.5625rem;\n height: 1.25rem;\n transition: opacity 200ms;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--color-background);\n }\n }\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3.375rem);\n }\n}\n\n.message-input-wrapper {\n display: flex;\n\n > .Spinner {\n align-self: center;\n --spinner-size: 1.5rem;\n margin-right: -0.5rem;\n }\n\n > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 3.5rem;\n margin: 0;\n padding: 0;\n align-self: flex-end;\n\n &:not(.faded):not(.activated) {\n color: var(--color-composer-button);\n }\n\n + .Button {\n margin-left: -1rem;\n }\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n\n + .Button {\n margin-left: -0.6875rem;\n }\n }\n\n &.bot-commands {\n color: var(--color-primary) !important;\n\n // SymbolMenu button should be accessible if BotCommandsMenu opened\n body.is-touch-env &.activated + .Button.mobile-symbol-menu-button {\n z-index: calc(var(--z-menu-backdrop) + 1);\n }\n }\n\n &.scheduled-button i::after {\n content: \"\";\n position: absolute;\n top: 0.75rem;\n right: 0.875rem;\n border: 0.1875rem solid var(--color-background);\n box-sizing: content-box;\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 50%;\n background: var(--color-green-darker);\n box-shadow: -0.375rem -0.25rem 0 -0.1875rem var(--color-background);\n @media (max-width: 600px) {\n top: 0.5rem;\n right: 0.5rem;\n }\n }\n }\n\n > .input-group {\n flex-grow: 1;\n margin-bottom: 0;\n }\n\n .recording-state {\n display: inline-block;\n position: relative;\n line-height: 3.5rem;\n height: 3.5rem;\n padding: 0 3.125rem 0 1rem;\n font-family: \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n\n &::after {\n content: \"\";\n width: 0.75rem;\n height: 0.75rem;\n background: var(--color-error);\n border-radius: 0.375rem;\n position: absolute;\n top: 50%;\n margin-top: -0.375rem;\n right: 1.3125rem;\n animation: recording-blink-like-macos 1.5s infinite;\n }\n\n @media (max-width: 600px) {\n height: 2.875rem;\n line-height: 2.875rem;\n }\n }\n}\n\n#message-input-text,\n#caption-input-text {\n position: relative;\n\n .form-control {\n padding: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2)\n calc(0.9rem - var(--border-width));\n overflow: hidden;\n line-height: 1.375;\n font-family: Roboto, -apple-system, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n unicode-bidi: plaintext;\n text-align: initial;\n font-size: var(--composer-text-size, 1rem);\n\n body.is-ios &,\n body.is-macos & {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\",\n sans-serif;\n }\n\n &.overflown {\n overflow-y: auto;\n overflow-x: hidden;\n }\n\n &.touched,\n &:focus {\n & + .placeholder-text {\n display: none;\n }\n }\n\n &.focus-disabled {\n pointer-events: none;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n position: absolute;\n color: var(--color-placeholders);\n pointer-events: none;\n unicode-bidi: plaintext;\n text-align: initial;\n line-height: 1.3125;\n font-size: var(--composer-text-size, 1rem);\n top: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);\n bottom: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .forced-placeholder {\n z-index: var(--z-below);\n left: 0;\n }\n\n &[dir=\"rtl\"] .placeholder-text {\n right: 0;\n }\n\n .text-entity-link {\n color: var(--color-links) !important;\n cursor: default;\n text-decoration: none;\n\n &:hover,\n &:active,\n &:visited {\n text-decoration: underline !important;\n }\n }\n\n .spoiler {\n background-image: url(\"../../../assets/spoiler-dots-black.png\");\n background-size: auto min(100%, 1.125rem);\n border-radius: 0.5rem;\n padding: 0 0.3125rem 0.125rem 0.3125rem;\n text-shadow: -2px -2px 0 var(--color-background), 2px -2px 0 var(--color-background),\n -2px 2px 0 var(--color-background), 2px 2px 0 var(--color-background);\n }\n\n html.theme-dark & .spoiler {\n background-image: url(\"../../../assets/spoiler-dots-white.png\");\n }\n\n .clone {\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n pointer-events: none;\n z-index: -10;\n unicode-bidi: plaintext;\n text-align: initial;\n }\n}\n\n#message-input-text {\n flex-grow: 1;\n\n .form-control {\n margin-bottom: 0;\n background: transparent !important;\n border: none !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n caret-color: var(--color-text);\n min-height: 3.5rem;\n max-height: 26rem;\n line-height: 1.3125;\n padding: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n white-space: pre-wrap;\n\n @media (max-width: 600px) {\n height: 2.875rem;\n min-height: 2.875rem;\n max-height: 16rem;\n padding: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n overflow: auto;\n }\n\n transition: height 100ms ease;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n top: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n\n @media (max-width: 600px) {\n top: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n }\n }\n\n &:not(:only-child) {\n .form-control {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n .ComposerEmbeddedMessage + .message-input-wrapper &,\n .WebPagePreview + .message-input-wrapper & {\n .form-control.overflown {\n margin-top: 0.75rem;\n }\n }\n\n .emoji {\n width: 1.25rem;\n height: 1.25rem;\n margin: 0 1px -5px;\n vertical-align: 0;\n pointer-events: none;\n }\n}\n\n#caption-input-text {\n .form-control {\n height: 3.25rem;\n min-height: 3.25rem;\n max-height: 15rem;\n }\n\n .placeholder-text {\n bottom: 0.8125rem;\n left: 0.9375rem;\n }\n}\n\n.composer-tooltip {\n position: absolute;\n bottom: calc(100% + 0.5rem);\n left: 0;\n width: 100%;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0;\n max-height: 15rem;\n\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n opacity: 0;\n transform: translateY(1.5rem);\n transform-origin: bottom;\n transition: opacity var(--layer-transition), transform var(--layer-transition);\n\n &:not(.shown) {\n display: none;\n }\n\n &.open {\n opacity: 1;\n transform: translateY(0);\n }\n\n .Loading {\n margin: 1rem 0;\n }\n}\n\n@keyframes recording-blink-like-macos {\n from {\n opacity: 1;\n }\n to {\n opacity: 0.3;\n }\n}\n","#middle-column-bg {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: -1;\n background-color: var(--theme-background-color);\n\n &::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background-color: var(--theme-background-color);\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n\n body:not(.animation-level-0) #root & {\n transition: transform var(--layer-transition), background 0.2s !important;\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n .theme-light & {\n background-image: url(\"../../assets/chat-bg.jpg\");\n\n @media (max-width: 600px) {\n background-image: url(\"../../assets/chat-bg-mobile.jpg\");\n }\n }\n }\n\n .custom-bg-color:not(.custom-bg-image) &::after {\n opacity: 0;\n }\n\n .custom-bg-image &::after {\n background-image: var(--custom-background) !important;\n filter: none;\n transform: scale(1.1);\n }\n\n .custom-bg-image.blurred &::after {\n filter: blur(12px);\n }\n\n @media screen and (min-width: 1276px) {\n body.animation-level-2 &::after {\n margin: -16rem -5rem -20rem 0;\n overflow: hidden;\n transform: scale(1);\n transform-origin: left center;\n transition: transform var(--layer-transition);\n }\n\n body.animation-level-2 #Main.right-column-open #MiddleColumn:not(.custom-bg-image) &::after {\n transform: scale(0.67) !important;\n }\n }\n\n body.animation-level-2 #Main.right-column-open #MiddleColumn:not(.custom-bg-image) &::after {\n @media screen and (min-width: 1921px) {\n transform: scale(0.8) !important;\n }\n\n @media screen and (min-width: 2600px) {\n transform: scale(0.95) !important;\n }\n }\n}\n\n#MiddleColumn {\n display: flex;\n justify-content: center;\n height: 100%;\n position: relative;\n z-index: 1;\n min-width: 0;\n\n @media (max-width: 600px) {\n overflow: hidden;\n }\n\n .messages-layout {\n --slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n > .Transition {\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n > div {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n }\n\n .Composer {\n #message-compose {\n transform: scaleX(1) translateX(0);\n transition: transform var(--select-transition), border-bottom-right-radius var(--select-transition);\n\n &::before {\n transform: scaleX(-1) translateX(0);\n transition: transform var(--select-transition);\n }\n\n body.animation-level-0 & {\n &,\n &::before {\n transition: none !important;\n }\n }\n }\n\n .message-input-wrapper,\n &::before {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Button {\n opacity: 1;\n transform: scale(1);\n transition: opacity var(--select-transition), transform var(--select-transition), background-color 0.15s,\n color 0.15s;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &.hover-disabled,\n &:not(.shown) {\n pointer-events: none;\n }\n\n &:not(.shown) {\n .ComposerEmbeddedMessage {\n height: 0;\n }\n\n #message-compose {\n transform: scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));\n border-bottom-right-radius: var(--border-radius-messages);\n\n &::before {\n transform: scaleX(-1) translateX(200%);\n }\n }\n\n #editable-message-text {\n height: 3.5rem !important;\n\n @media (max-width: 600px) {\n height: 2.5rem !important;\n }\n }\n\n .message-input-wrapper,\n &::before {\n opacity: 0;\n }\n\n > .Button {\n opacity: 0 !important;\n transform: scale(0.5);\n }\n }\n }\n\n .messaging-disabled {\n transform: scaleX(1);\n transition: transform var(--select-transition);\n\n .messaging-disabled-inner span {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &:not(.shown) {\n transform: scaleX(var(--composer-hidden-scale, 1));\n pointer-events: none;\n\n .messaging-disabled-inner span {\n opacity: 0;\n }\n }\n\n &-inner {\n width: 100%;\n padding: 1rem;\n border-radius: var(--border-radius-messages);\n background: var(--color-background);\n color: var(--color-text-secondary);\n text-align: center;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n }\n\n .middle-column-footer {\n width: 100%;\n max-width: var(--messages-container-width);\n padding: 0 1rem;\n position: relative;\n display: flex;\n align-items: flex-end;\n z-index: var(--z-middle-footer);\n\n transform: translate3d(0, 0, 0);\n transition: top 200ms, transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n @media (min-width: 1276px) {\n width: calc(100% - var(--right-column-width));\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0 0.5rem;\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n &:not(.no-composer) {\n padding-bottom: env(safe-area-inset-bottom);\n top: 0;\n\n body.keyboard-visible & {\n top: env(safe-area-inset-bottom);\n }\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -0.5625rem;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 0%,\n rgba(255, 255, 255, 0.4) 2%,\n rgba(255, 255, 255, 0.4) 98%,\n rgba(255, 255, 255, 0) 100%\n );\n opacity: 0;\n transition: opacity 350ms ease;\n\n @media (max-width: 600px) {\n left: -2%;\n right: -2%;\n }\n }\n\n &.with-notch::before {\n opacity: 1;\n }\n\n html.theme-dark &::before {\n background: linear-gradient(\n 90deg,\n rgba(127, 127, 127, 0) 0%,\n rgba(127, 127, 127, 0.4) 2%,\n rgba(127, 127, 127, 0.4) 98%,\n rgba(127, 127, 127, 0) 100%\n );\n }\n }\n}\n\n/* Common styles for message list fade-out shadow */\n.Composer,\n.MessageSelectToolbar,\n.messaging-disabled {\n margin-bottom: 1.25rem;\n\n @media (max-width: 600px) {\n margin-bottom: 0.5rem;\n }\n}\n\n.Composer,\n.MessageSelectToolbar,\n.unpin-all-button,\n.join-subscribe-button,\n.messaging-disabled {\n width: 100%;\n display: flex;\n justify-content: center;\n position: relative;\n}\n\n.MessageSelectToolbar-inner,\n.unpin-all-button,\n.join-subscribe-button,\n.messaging-disabled {\n .mask-image-disabled & {\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-messages);\n }\n}\n\n.middle-column-footer-button-container {\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n padding-bottom: 1.25rem;\n\n .unpin-all-button {\n text-transform: capitalize;\n color: var(--color-black);\n\n @media (hover: hover) {\n &:hover {\n .icon-unpin {\n color: var(--color-white);\n }\n }\n }\n\n @media (max-width: 600px) {\n &:active,\n &:focus {\n .icon-unpin {\n color: var(--color-white);\n }\n }\n }\n\n .icon-unpin {\n margin-inline-start: -0.4375rem;\n margin-inline-end: 0.75rem;\n color: var(--color-text-secondary);\n font-size: 1.5rem;\n transition: color 0.15s;\n }\n }\n\n .join-subscribe-button,\n .unpin-all-button {\n height: 3.5rem;\n transform: scaleX(1);\n transition: transform var(--select-transition), background-color 0.15s, color 0.15s;\n\n .select-mode-active + .middle-column-footer & {\n box-shadow: none;\n transform: scaleX(var(--unpin-hidden-scale));\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n }\n }\n\n @media (max-width: 600px) {\n padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));\n }\n\n .mask-image-disabled &::before {\n background: unset;\n }\n}\n",".RightHeader {\n display: flex;\n align-items: center;\n height: var(--header-height);\n padding: 0.5rem 0.8125rem;\n pointer-events: auto;\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .close-button {\n flex-shrink: 0;\n }\n\n > .Transition {\n flex: 1;\n height: 100%;\n\n > div {\n display: flex;\n align-items: center;\n }\n }\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n }\n\n .tools {\n display: flex;\n margin-left: auto;\n }\n\n .SearchInput {\n margin-left: 1rem;\n\n @media (min-width: 600px) {\n margin-right: 1rem;\n }\n }\n\n .DropdownMenu {\n margin-left: auto;\n }\n}\n","@import \"../../styles/mixins\";\n\n.Profile {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n overflow-x: hidden;\n overflow-y: scroll;\n @include overflow-y-overlay();\n\n > .profile-info > .ChatInfo {\n grid-area: chat_info;\n\n .status.online {\n color: var(--color-primary);\n }\n }\n\n > .profile-info > .ChatExtra {\n padding: 0.875rem 0.5rem 0.5rem;\n box-shadow: inset 0 -0.0625rem 0 0 var(--color-background-secondary-accent);\n border-bottom: 0.625rem solid var(--color-background-secondary);\n\n .narrow {\n margin-bottom: 0;\n }\n\n .inactive.no-selection {\n user-select: auto;\n -webkit-user-select: auto !important;\n }\n\n .Switcher {\n margin-left: auto;\n }\n [dir=\"rtl\"] {\n .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n }\n\n .FloatingActionButton {\n z-index: 1;\n }\n}\n\n.shared-media {\n display: flex;\n flex-direction: column-reverse;\n\n .TabList {\n background: var(--color-background);\n top: -1px;\n z-index: 1;\n\n .Tab {\n padding: 1rem 0.75rem;\n\n span {\n white-space: nowrap;\n }\n\n i {\n bottom: -1rem;\n }\n }\n }\n\n .Transition {\n flex: 1;\n }\n\n .content {\n &.empty-list {\n height: 100%;\n padding-top: 5rem;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n }\n\n &.media-list {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: 0.0625rem;\n }\n\n &.documents-list {\n padding: 1.25rem;\n\n & .File + .File {\n margin-top: 1.25rem;\n }\n }\n\n &.links-list {\n padding: 1.25rem;\n\n .ProgressSpinner,\n .message-transfer-progress {\n display: none;\n }\n }\n\n &.audio-list,\n &.voice-list {\n padding: 1.25rem;\n\n & .Audio {\n .media-loading {\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n & + .Audio {\n margin-top: 1.6875rem;\n }\n }\n }\n\n &.commonChats-list,\n &.members-list {\n padding: 0.5rem 1rem;\n\n @media (max-width: 600px) {\n padding: 0.5rem 0;\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n }\n }\n }\n}\n",".AddChatMembers {\n height: 100%;\n overflow: hidden;\n position: relative;\n\n &-inner {\n height: 100%;\n overflow: hidden;\n }\n}\n","#RightColumn {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--right-column-width);\n height: 100%;\n padding-right: env(safe-area-inset-right);\n transform: translate3d(var(--right-column-width), 0, 0);\n background: var(--color-background);\n border-left: 1px solid var(--color-borders);\n z-index: var(--z-right-column);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n @media (max-width: 1275px) {\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-left: none;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n transform: translate3d(110vw, 0, 0);\n }\n\n > .Transition {\n height: calc(100% - var(--header-height));\n overflow: hidden;\n }\n\n .Management .section > .ChatInfo {\n padding: 0 1.5rem;\n margin: 1rem 0;\n text-align: center;\n\n .Avatar {\n margin: 0 auto 0.5rem;\n\n &.no-photo {\n cursor: default !important;\n }\n }\n\n .title {\n display: flex;\n justify-content: center;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 2rem;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-bottom: 0.5rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n color: #868e96;\n }\n }\n}\n\n#RightColumn-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--z-right-column);\n overflow: hidden;\n visibility: hidden;\n pointer-events: none;\n\n @media (max-width: 1275px) {\n position: fixed;\n }\n\n &.is-hidden {\n display: none;\n }\n\n .overlay-backdrop {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background: black;\n opacity: 0;\n\n @media (max-width: 600px) {\n transition: opacity var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n }\n }\n\n #Main.right-column-open &,\n body.animating-right-column & {\n visibility: visible;\n }\n\n #Main.right-column-open & {\n @media (max-width: 600px) {\n .overlay-backdrop {\n opacity: var(--layer-blackout-opacity);\n }\n }\n\n #RightColumn {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n }\n }\n}\n","#Main {\n height: 100%;\n text-align: left;\n overflow: hidden;\n\n @media (min-width: 1276px) {\n position: relative;\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n @media (min-width: 926px) {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 100%;\n }\n}\n\n.has-group-call-header {\n --group-call-header-height: 2rem;\n #LeftColumn, #MiddleColumn, #RightColumn-wrapper {\n height: calc(100% - 2rem);\n margin-top: 2rem;\n }\n}\n\n#LeftColumn {\n min-width: 12rem;\n width: 33vw;\n max-width: 26.5rem;\n height: 100%;\n position: relative;\n\n & > div {\n height: 100%;\n overflow: hidden;\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n @media (min-width: 926px) {\n max-width: 40vw;\n }\n\n @media (min-width: 1276px) {\n width: 25vw;\n max-width: 33vw;\n }\n\n @media (max-width: 925px) {\n position: fixed;\n left: 0;\n top: 0;\n height: calc(var(--vh, 1vh) * 100);\n width: 26.5rem !important;\n\n transform: translate3d(-5rem, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background: black;\n opacity: var(--layer-blackout-opacity);\n transition: opacity var(--layer-transition);\n z-index: 1;\n\n body.animation-level-0 & {\n transition: none;\n }\n\n // @optimization\n body.is-android & {\n display: none;\n }\n\n body.is-android .middle-column-shown & {\n display: block;\n }\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(0, 0, 0);\n\n &::after {\n opacity: 0;\n pointer-events: none;\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n }\n\n @media (max-width: 600px) {\n max-width: none;\n transform: translate3d(-20vw, 0, 0);\n left: env(safe-area-inset-left) !important;\n width: calc(100vw - env(safe-area-inset-left)) !important;\n }\n}\n\n#RightColumn {\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100 + 1px);\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n .overlay-backdrop {\n transition: none;\n }\n }\n}\n\n#Main.history-animation-disabled .overlay-backdrop {\n transition: none;\n}\n\n#MiddleColumn {\n border-left: 1px solid var(--color-borders);\n\n @media (max-width: 925px) {\n max-width: none;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(26.5rem, 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n border-left: none;\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(100vw, 0, 0);\n }\n\n #Main.right-column-open & {\n transform: translate3d(-20vw, 0, 0);\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n}\n\nbody.is-android.animation-level-1 {\n --layer-transition: 250ms ease-in-out;\n\n #LeftColumn, #MiddleColumn, #RightColumn {\n transition: transform var(--layer-transition), opacity var(--layer-transition);\n }\n\n #Main:not(.middle-column-shown) {\n #MiddleColumn {\n display: none;\n }\n }\n\n #Main:not(.middle-column-open) {\n #MiddleColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.middle-column-open {\n #LeftColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n\n #Main:not(.right-column-shown) {\n #RightColumn {\n display: none;\n }\n }\n\n #Main:not(.right-column-open) {\n #RightColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.right-column-open {\n #MiddleColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/176.2bd8fc859463a252c8a2.js b/dist/176.c9baace07c5f15a8c611.js similarity index 99% rename from dist/176.2bd8fc859463a252c8a2.js rename to dist/176.c9baace07c5f15a8c611.js index 10c9ebcd..0758d386 100644 --- a/dist/176.2bd8fc859463a252c8a2.js +++ b/dist/176.c9baace07c5f15a8c611.js @@ -1,2 +1,2 @@ "use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[176],{3176:(e,t,n)=>{n.r(t),n.d(t,{Main:()=>ui});var a=n(5116),s=n(3716),o=n(4050),i=(n(7895),n(9959)),r=n(9066),c=n(735),l=n(8415);function d(e){const{chatId:t,threadId:n}=(0,r.Bt)(e)||{};return t&&n?(e=(0,i.qr)(e,t,n,!1),e=(0,i.Pb)(e,t,n,void 0)):e}(0,a.Q6)("openLocalTextSearch",(e=>{const{chatId:t,threadId:n}=(0,r.Bt)(e)||{};if(t&&n)return(0,i.qr)(e,t,n,!0)})),(0,a.Q6)("closeLocalTextSearch",d),(0,a.Q6)("setLocalTextSearchQuery",((e,t,n)=>{const{chatId:a,threadId:s}=(0,r.Bt)(e)||{};if(!a||!s)return;const{query:o}=n,d=(0,l.uw)(a,s),{query:u}=e.localTextSearch.byChatThreadKey[d]||{};return o!==u&&(e=(0,i.Pb)(e,a,s,c.D)),(0,i.qr)(e,a,s,!0,o)})),(0,a.Q6)("setLocalMediaSearchType",((e,t,n)=>{const{chatId:a}=(0,r.Bt)(e)||{};if(!a)return;const{mediaType:s}=n;return(0,i.z5)(e,a,s)})),(0,a.Q6)("openChat",((e,t,n)=>{const{id:s,threadId:o=-1,type:c="thread",shouldReplaceHistory:l=!1}=n,u=(0,r.Bt)(e);return u&&u.chatId===s&&u.threadId===o&&u.type===c||(e=(0,i.pf)(e,s,o,"replyStack",[]),e=d(e=(0,i.i9)(e)),e={...e,messages:{...e.messages,contentToBeScheduled:void 0},...s!==e.forwardMessages.toChatId&&{forwardMessages:{}}},(0,a.R3)(e)),(0,i.Wy)(e,s,o,c,l)})),(0,a.Q6)("openPreviousChat",(e=>(0,i.Wy)(e,void 0))),(0,a.Q6)("openChatWithInfo",((e,t,n)=>{(0,a.R3)({...e,isChatInfoShown:!0}),t.openChat(n)})),(0,a.Q6)("resetChatCreation",(e=>({...e,chatCreation:void 0}))),(0,a.Q6)("setNewChatMembersDialogState",((e,t,n)=>({...e,newChatMembersProgress:n}))),(0,a.Q6)("openNextChat",((e,t,n)=>{const{targetIndexDelta:a,orderedIds:s}=n,{chatId:o}=(0,r.Bt)(e)||{};if(!o)return void t.openChat({id:s[0]});const i=s.indexOf(o);if(-1===i)return;const c=s[i+a];t.openChat({id:c,shouldReplaceHistory:!0})}));var u=n(6137),m=n(1713),h=n(7361),g=n(782),p=n(2267),f=n(257),v=n(3099),I=n(711),y=n(4319);const Z=s.ck+s.fK;let P;function C(e,t,n){const{threadId:a}=(0,r.Bt)(e)||{},s=I.i0,o=(0,r.Zw)(e,t);if(!o||!a)return;const i=n.map((e=>o[e])).filter((t=>(0,r._k)(e,t,a).canCopy)).sort(((e,t)=>e.id-t.id)).reduce(((t,n)=>{const a=(0,r.Ur)(e,n);return t.push(`> ${a?(0,l.OU)(s,a):""}:`),t.push((0,l.MK)(s,n,!1,0,void 0,!0)+"\n"),t}),[]);(0,y.TE)(i.join("\n"))}(0,a.Q6)("setScrollOffset",((e,t,n)=>{const{chatId:a,threadId:s,scrollOffset:o}=n;return(0,i.pf)(e,a,s,"scrollOffset",o)})),(0,a.Q6)("setReplyingToId",((e,t,n)=>{const{messageId:a}=n,s=(0,r.Bt)(e);if(!s)return;const{chatId:o,threadId:c}=s;return(0,i.pf)(e,o,c,"replyingToId",a)})),(0,a.Q6)("setEditingId",((e,t,n)=>{const{messageId:a}=n,s=(0,r.Bt)(e);if(!s)return;const{chatId:o,threadId:c,type:l}=s,d="scheduled"===l?"editingScheduledId":"editingId";return(0,i.pf)(e,o,c,d,a)})),(0,a.Q6)("editLastMessage",(e=>{const{chatId:t,threadId:n}=(0,r.Bt)(e)||{};if(!t||!n)return;const a=(0,r.Zw)(e,t),s=(0,r.Cb)(e,t,n);if(!a||!s)return;const o=(0,g.dF)(s,(t=>Boolean(a[t]&&(0,r._k)(e,a[t],n).canEdit)));return o?(0,i.pf)(e,t,n,"editingId",o):void 0})),(0,a.Q6)("replyToNextMessage",((e,t,n)=>{const{targetIndexDelta:a}=n,{chatId:s,threadId:o}=(0,r.Bt)(e)||{};if(!s||!o)return;const i=(0,r.Zw)(e,s),c=(0,r.Cb)(e,s,o);if(!i||!c)return;const l=(0,r.Yy)(e,s,o);let d;if((0,r.b9)(e,s,o)&&l){const e=Object.keys(i),t=e.indexOf(l.toString())+a;d=t<=e.length+1&&t>=0?Number(e[t]):void 0}else if(o===u._f){var m;const t=(0,r.Z1)(e,s);d=null==t||null===(m=t.lastMessage)||void 0===m?void 0:m.id}else{const t=(0,r.tZ)(e,s,o);d=null==t?void 0:t.lastMessageId}t.setReplyingToId({messageId:d}),t.focusMessage({chatId:s,threadId:o,messageId:d})})),(0,a.Q6)("openMediaViewer",((e,t,n)=>{const{chatId:a,threadId:s,messageId:o,avatarOwnerId:i,profilePhotoIndex:r,origin:c}=n;return{...e,mediaViewer:{chatId:a,threadId:s,messageId:o,avatarOwnerId:i,profilePhotoIndex:r,origin:c},forwardMessages:{}}})),(0,a.Q6)("closeMediaViewer",(e=>({...e,mediaViewer:{}}))),(0,a.Q6)("openAudioPlayer",((e,t,n)=>{const{chatId:a,threadId:s,messageId:o,origin:i,volume:r,playbackRate:c,isMuted:l}=n;return{...e,audioPlayer:{chatId:a,threadId:s,messageId:o,origin:null!=i?i:e.audioPlayer.origin,volume:null!=r?r:e.audioPlayer.volume,playbackRate:c||e.audioPlayer.playbackRate,isMuted:l||e.audioPlayer.isMuted}}})),(0,a.Q6)("setAudioPlayerVolume",((e,t,n)=>{const{volume:a}=n;return{...e,audioPlayer:{...e.audioPlayer,volume:a}}})),(0,a.Q6)("setAudioPlayerPlaybackRate",((e,t,n)=>{const{playbackRate:a}=n;return{...e,audioPlayer:{...e.audioPlayer,playbackRate:a}}})),(0,a.Q6)("setAudioPlayerMuted",((e,t,n)=>{const{isMuted:a}=n;return{...e,audioPlayer:{...e.audioPlayer,isMuted:a}}})),(0,a.Q6)("setAudioPlayerOrigin",((e,t,n)=>{const{origin:a}=n;return{...e,audioPlayer:{...e.audioPlayer,origin:a}}})),(0,a.Q6)("closeAudioPlayer",(e=>({...e,audioPlayer:{volume:e.audioPlayer.volume,playbackRate:e.audioPlayer.playbackRate,isMuted:e.audioPlayer.isMuted}}))),(0,a.Q6)("openPollResults",((e,t,n)=>{const{chatId:s,messageId:o}=n;(0,r.Jf)(e)?s===e.pollResults.chatId&&o===e.pollResults.messageId||(0,a.R3)({...e,pollResults:{chatId:s,messageId:o,voters:{}}}):window.setTimeout((()=>{const e=(0,a.Rd)();(0,a.R3)({...e,pollResults:{chatId:s,messageId:o,voters:{}}})}),450)})),(0,a.Q6)("closePollResults",(e=>{(0,a.R3)({...e,pollResults:{}})})),(0,a.Q6)("focusLastMessage",((e,t)=>{const n=(0,r.Bt)(e);if(!n)return;const{chatId:a,threadId:s}=n;let o;if(s===u._f){var i;const t=(0,r.Z1)(e,a);o=null==t||null===(i=t.lastMessage)||void 0===i?void 0:i.id}else{const t=(0,r.tZ)(e,a,s);o=null==t?void 0:t.lastMessageId}o&&t.focusMessage({chatId:a,threadId:s,messageId:o,noHighlight:!0})})),(0,a.Q6)("focusNextReply",((e,t)=>{const n=(0,r.Bt)(e);if(!n)return;const{chatId:s,threadId:o}=n,c=(0,r.p9)(e,s,o);if(c&&0!==c.length){const n=c.pop();e=(0,i.pf)(e,s,o,"replyStack",[...c]),(0,a.R3)(e),t.focusMessage({chatId:s,threadId:o,messageId:n})}else t.focusLastMessage()})),(0,a.Q6)("focusMessage",((e,t,n)=>{const{chatId:s,threadId:o=u._f,messageListType:c="thread",noHighlight:l,groupedId:d,groupedChatId:h,replyMessageId:g,isResizingContainer:p}=n;let{messageId:f}=n;if(void 0!==d){const t=(0,r.y8)(e,h,d);null!=t&&t.length&&([f]=t)}const v=(0,r.Bt)(e),I=!v||s!==v.chatId||o!==v.threadId||c!==v.type;if(P&&(clearTimeout(P),P=void 0),P=window.setTimeout((()=>{let e=(0,a.Rd)();e=(0,i.cq)(e),e=(0,i.wV)(e),(0,a.R3)(e)}),l?Z:1500),e=(0,i.cq)(e,s,f,l,p),e=(0,i.wV)(e,void 0),g){const t=(0,r.p9)(e,s,o)||[];e=(0,i.pf)(e,s,o,"replyStack",[...t,g])}I&&(e=(0,i.wV)(e,m.fo.Static));const y=(0,r.Cb)(e,s,o);if(y&&y.includes(f))return(0,a.R3)(e),void t.openChat({id:s,threadId:o});if(I&&(e=(0,i.pf)(e,s,o,"viewportIds",void 0)),e=(0,i.pf)(e,s,o,"outlyingIds",void 0),y&&!I){const t=f>y[0]?m.fo.Down:m.fo.Up;e=(0,i.wV)(e,t)}(0,a.R3)(e),t.openChat({id:s,threadId:o}),t.loadViewportMessages()})),(0,a.Q6)("openForwardMenu",((e,t,n)=>{const{fromChatId:a,messageIds:s,groupedId:o}=n;let i;return o&&(i=(0,r.xH)(e,a,o)),{...e,forwardMessages:{fromChatId:a,messageIds:i||s,isModalShown:!0}}})),(0,a.Q6)("exitForwardMode",(e=>{(0,a.R3)({...e,forwardMessages:{}})})),(0,a.Q6)("setForwardChatId",((e,t,n)=>{const{id:s}=n;(0,a.R3)({...e,forwardMessages:{...e.forwardMessages,toChatId:s,isModalShown:!1}}),t.openChat({id:s}),t.closeMediaViewer(),t.exitMessageSelectMode()})),(0,a.Q6)("openForwardMenuForSelectedMessages",((e,t)=>{if(!e.selectedMessages)return;const{chatId:n,messageIds:a}=e.selectedMessages;t.openForwardMenu({fromChatId:n,messageIds:a})})),(0,a.Q6)("cancelMessageMediaDownload",((e,t,n)=>{const{message:s}=n,o=e.activeDownloads.byChatId[s.chatId];o&&o.length&&(0,a.R3)({...e,activeDownloads:{byChatId:{...e.activeDownloads.byChatId,[s.chatId]:o.filter((e=>e!==s.id))}}})})),(0,a.Q6)("downloadMessageMedia",((e,t,n)=>{const{message:s}=n;s&&(0,a.R3)({...e,activeDownloads:{byChatId:{...e.activeDownloads.byChatId,[s.chatId]:[...e.activeDownloads.byChatId[s.chatId]||[],s.id]}}})})),(0,a.Q6)("downloadSelectedMessages",((e,t)=>{if(!e.selectedMessages)return;const{chatId:n,messageIds:a}=e.selectedMessages,{threadId:s}=(0,r.Bt)(e)||{},o=(0,r.Zw)(e,n);o&&s&&a.map((e=>o[e])).filter((t=>(0,r._k)(e,t,s).canDownload)).forEach((e=>t.downloadMessageMedia({message:e})))})),(0,a.Q6)("enterMessageSelectMode",((e,t,n)=>{const{messageId:a}=n||{},s=(0,r.jr)(e);return s?(0,i.M6)(e,s.id,a):e})),(0,a.Q6)("toggleMessageSelection",((e,t,n)=>{const{messageId:s,groupedId:o,childMessageIds:c,withShift:l}=n,d=(0,r.Bt)(e);if(!d)return;const{chatId:u,threadId:m,type:g}=d;e=(0,i.Ob)(e,u,m,g,s,o,c,l),(0,a.R3)(e),e.shouldShowContextMenuHint&&(t.disableContextMenuHint(),t.showNotification({message:`To **edit** or **reply**, close this menu. Then ${h.$b?"long tap":"right click"} on a message.`}))})),(0,a.Q6)("disableContextMenuHint",(e=>{if(e.shouldShowContextMenuHint)return{...e,shouldShowContextMenuHint:!1}})),(0,a.Q6)("exitMessageSelectMode",i.i9),(0,a.Q6)("openPollModal",(e=>({...e,isPollModalOpen:!0}))),(0,a.Q6)("closePollModal",(e=>({...e,isPollModalOpen:!1}))),(0,a.Q6)("checkVersionNotification",((e,t)=>{const n=s.Ji.split(".").slice(0,2).join("."),{serviceNotifications:a}=e;if(a.find((e=>{let{version:t}=e;return t===n})))return;const o={chatId:s.aw,date:(0,p.b)(e.serverTimeOffset),content:{text:(0,v.Z)(f)},isOutgoing:!1};t.createServiceNotification({message:o,version:n})})),(0,a.Q6)("createServiceNotification",((e,t,n)=>{var o;const{message:i,version:c}=n,{serviceNotifications:l}=e,d=(0,r.Z1)(e,s.aw),u=Math.max((null===(o=d.lastMessage)||void 0===o?void 0:o.id)||0,...l.map((e=>{let{id:t}=e;return t}))),m=(l.length+1)/1e3,h=Math.floor(u)+m;i.id=h;const g={id:h,message:i,version:c,isUnread:!0};(0,a.R3)({...e,serviceNotifications:[...l.slice(-1e3),g]}),t.apiUpdate({"@type":"newMessage",id:i.id,chatId:i.chatId,message:i})})),(0,a.Q6)("openReactorListModal",((e,t,n)=>{const{chatId:a,messageId:s}=n;return{...e,reactorModal:{chatId:a,messageId:s}}})),(0,a.Q6)("closeReactorListModal",(e=>({...e,reactorModal:void 0}))),(0,a.Q6)("openSeenByModal",((e,t,n)=>{const{chatId:a,messageId:s}=n;return{...e,seenByModal:{chatId:a,messageId:s}}})),(0,a.Q6)("closeSeenByModal",(e=>({...e,seenByModal:void 0}))),(0,a.Q6)("copySelectedMessages",(e=>{if(!e.selectedMessages)return;const{chatId:t,messageIds:n}=e.selectedMessages;C(e,t,n)})),(0,a.Q6)("copyMessagesByIds",((e,t,n)=>{const{messageIds:a}=n,s=(0,r.jr)(e);a&&0!==a.length&&s&&C(e,s.id,a)})),(0,a.Q6)("setGlobalSearchQuery",((e,t,n)=>{const{query:a}=n,{chatId:s}=e.globalSearch;return(0,i.No)(e,{globalResults:{},localResults:{},resultsByType:void 0,...a?{fetchingStatus:{chats:!s,messages:!0}}:{fetchingStatus:void 0},query:a})})),(0,a.Q6)("addRecentlyFoundChatId",((e,t,n)=>{const{id:a}=n,{recentlyFoundChatIds:s}=e.globalSearch;if(!s)return(0,i.No)(e,{recentlyFoundChatIds:[a]});const o=s.filter((e=>e!==a));return o.unshift(a),o.length>10&&o.pop(),(0,i.No)(e,{recentlyFoundChatIds:o})})),(0,a.Q6)("clearRecentlyFoundChats",(e=>(0,i.No)(e,{recentlyFoundChatIds:void 0}))),(0,a.Q6)("setGlobalSearchContent",((e,t,n)=>{const{content:a}=n;return(0,i.Og)(e,a)})),(0,a.Q6)("setGlobalSearchChatId",((e,t,n)=>{const{id:a}=n;return(0,i.No)(e,{chatId:a,query:void 0,resultsByType:void 0})})),(0,a.Q6)("setStickerSearchQuery",((e,t,n)=>{const{query:a}=n;return{...e,stickers:{...e.stickers,search:{query:a,resultIds:void 0}}}})),(0,a.Q6)("setGifSearchQuery",((e,t,n)=>{const{query:a}=n;return{...e,gifs:{...e.gifs,search:{query:a,offsetId:void 0,results:void 0}}}})),(0,a.Q6)("setUserSearchQuery",((e,t,n)=>{const{query:a}=n;return(0,i.Lm)(e,{globalUserIds:void 0,localUserIds:void 0,fetchingStatus:Boolean(a),query:a})})),n(3781);var w=n(1947),b=n(6926);(0,a.Q6)("toggleChatInfo",((e,t,n)=>({...e,isChatInfoShown:void 0!==n?n:!e.isChatInfoShown}))),(0,a.Q6)("setLeftColumnWidth",((e,t,n)=>({...e,leftColumnWidth:n}))),(0,a.Q6)("resetLeftColumnWidth",(e=>({...e,leftColumnWidth:void 0}))),(0,a.Q6)("toggleManagement",(e=>{const{chatId:t}=(0,r.Bt)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!(e.management.byChatId[t]||{}).isActive}}}}})),(0,a.Q6)("requestNextManagementScreen",((e,t,n)=>{const{screen:a}=n||{},{chatId:s}=(0,r.Bt)(e)||{};if(s)return{...e,management:{byChatId:{...e.management.byChatId,[s]:{...e.management.byChatId[s],isActive:!0,nextScreen:a}}}}})),(0,a.Q6)("closeManagement",(e=>{const{chatId:t}=(0,r.Bt)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!1}}}}})),(0,a.Q6)("openChat",(e=>{if(h.wB||h.p7)return{...e,isLeftColumnShown:0===e.messages.messageLists.length}})),(0,a.Q6)("toggleLeftColumn",(e=>({...e,isLeftColumnShown:!e.isLeftColumnShown}))),(0,a.Q6)("addRecentEmoji",((e,t,n)=>{const{emoji:a}=n,{recentEmojis:s}=e;if(!s)return{...e,recentEmojis:[a]};const o=s.filter((e=>e!==a));return o.unshift(a),o.length>18&&o.pop(),{...e,recentEmojis:o}})),(0,a.Q6)("addRecentSticker",((e,t,n)=>{const{sticker:a}=n,{recent:s}=e.stickers;if(!s)return{...e,stickers:{...e.stickers,recent:{hash:"0",stickers:[a]}}};const o=s.stickers.filter((e=>e.id!==a.id));return o.unshift(a),{...e,stickers:{...e.stickers,recent:{...s,stickers:o}}}})),(0,a.Q6)("showNotification",((e,t,n)=>{const a=n;a.localId=(0,b.Z)({});const s=[...e.notifications],o=s.findIndex((e=>e.message===a.message));return-1!==o&&s.splice(o,1),s.push(a),{...e,notifications:s}})),(0,a.Q6)("dismissNotification",((e,t,n)=>{const a=e.notifications.filter((e=>{let{localId:t}=e;return t!==n.localId}));return{...e,notifications:a}})),(0,a.Q6)("showDialog",((e,t,n)=>{const{data:a}=n;if("message"in a&&a.hasErrorKey&&!(0,w.ZP)(a))return e;const s=[...e.dialogs];if("message"in a){const e=s.findIndex((e=>e.message===a.message));-1!==e&&s.splice(e,1)}return s.push(a),{...e,dialogs:s}})),(0,a.Q6)("dismissDialog",(e=>{const t=[...e.dialogs];return t.pop(),{...e,dialogs:t}})),(0,a.Q6)("toggleSafeLinkModal",((e,t,n)=>{const{url:a}=n;return{...e,safeLinkModalUrl:a}})),(0,a.Q6)("openHistoryCalendar",((e,t,n)=>{const{selectedAt:a}=n;return{...e,historyCalendarSelectedAt:a}})),(0,a.Q6)("closeHistoryCalendar",(e=>({...e,historyCalendarSelectedAt:void 0}))),(0,a.Q6)("openPaymentModal",((e,t,n)=>{const{chatId:a,messageId:s}=n;return{...e,payment:{...e.payment,chatId:a,messageId:s,isPaymentModalOpen:!0}}})),(0,a.Q6)("closePaymentModal",(e=>{const t=(0,i.bp)(e);return(0,i.WY)(t)})),(0,a.Q6)("addPaymentError",((e,t,n)=>{const{error:a}=n;return{...e,payment:{...e.payment,error:a}}})),n(1689),n(1363),n(6204);var E=n(1226),M=n(9118);const S=new Map,R=(0,M.Ds)((e=>e()),500,!1);async function k(e,t,n,o){let c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const d=e.id;let u;switch(o){case m.Uq.Backwards:u=void 0;break;case m.Uq.Around:u=-(Math.round(s.hT/2)+1);break;case m.Uq.Forwards:u=-(s.hT+1)}const h=await(0,E.t9)("fetchMessages",{chat:(0,r.Cm)((0,a.Rd)(),d,t),offsetId:n,addOffset:u,limit:s.hT,threadId:t});if(!h)return;const{messages:p,users:f,chats:v,threadInfos:I}=h;let y=(0,a.Rd)();const Z=d===s.aw?y.serviceNotifications.map((e=>{let{message:t}=e;return t})):[],P=[].concat(p,Z),C=(0,g.ee)(P,"id"),w=Object.keys(C).map(Number);y=(0,i.c_)(y,d,C),y=c?(0,i.ff)(y,d,t,w):(0,i.xj)(y,d,t,w),y=(0,i.Sh)(y,(0,g.ee)(f,"id")),y=(0,i.fZ)(y,(0,g.ee)(v,"id")),y=(0,i.j6)(y,d,I);let b=(0,r.gb)(y,d,t);const M=(0,r.qC)(y,d,t);if(c&&b&&M&&(M.length&&!(0,g.YE)(b,M)||(y=(0,i.xj)(y,d,t,M),b=(0,r.gb)(y,d,t),y=(0,i.pf)(y,d,t,"outlyingIds",void 0),c=!1)),!l){const e=c?M:b,{newViewportIds:a}=T(e,n,o);y=(0,i.y9)(y,d,t,a)}(0,a.R3)(y)}function T(e,t,n){const{length:a}=e,o=t?function(e,t){return te[e.length-1]?e.length-1:e.findIndex(((n,a)=>n===t||nt))}(e,t):-1,i=n===m.Uq.Backwards?o:o+1||a,r=i-s.hT,c=i+s.hT-1,l=e.slice(Math.max(0,r),c+1);let d,u;switch(n){case m.Uq.Backwards:d=i>0,u=r>=0;break;case m.Uq.Forwards:d=i0,u=l.length===s.hT}return{newViewportIds:l,areSomeLocal:d,areAllLocal:u}}async function N(e){let t;const n=e.attachment?(e,s)=>{S.has(s)||(t=s,S.set(s,n));const o=(0,a.Rd)();(0,a.R3)({...o,fileUploads:{byMessageLocalId:{...o.fileUploads.byMessageLocalId,[s]:{progress:e}}}})}:void 0;(e.replyingTo||h.cj)&&await(0,M.Pn)();const s=(0,a.Rd)();e.serverTimeOffset=s.serverTimeOffset;const o=(0,r.Bt)(s);if(!o)return;const{threadId:i}=o;e.replyingTo||i===u._f||(e.replyingTo=(0,r.qS)(s,e.chat.id,i)),await(0,E.t9)("sendMessage",e,n),n&&t&&S.delete(t)}(0,a.Q6)("loadViewportMessages",((e,t,n)=>{const{direction:a=m.Uq.Around,isBudgetPreload:o=!1}=n||{};let{chatId:c,threadId:l}=n||{};if(!c){const t=(0,r.Bt)(e);if(!t)return;c=t.chatId,l=t.threadId}const d=(0,r.Z1)(e,c);if(!d||d.isRestricted)return;const u=(0,r.Cb)(e,c,l),h=(0,r.gb)(e,c,l),g=(0,r.qC)(e,c,l);if(u&&u.length&&a!==m.Uq.Around){const n=a===m.Uq.Backwards?u[0]:u[u.length-1],s=Boolean(g),r=s?g:h,{newViewportIds:p,areSomeLocal:f,areAllLocal:v}=T(r,n,a);if(f&&(e=(0,i.y9)(e,c,l,p)),async function(e,t,n,a,s,o,i,r){t||await k(s,o,r,i,n,a),a||(await Promise.resolve(),e.loadViewportMessages({chatId:s.id,threadId:o,direction:i,isBudgetPreload:!0}))}(t,v,s,o,d,l,a,n),o)return}else{const t=(0,r.G$)(e,c)||(0,r.rd)(e,c,l),n=Boolean(t&&h&&!h.includes(t)),a=(n?g:h)||[],{newViewportIds:u,areSomeLocal:p,areAllLocal:f}=T(a,t,m.Uq.Around);p&&u.length>=s.hT&&(e=(0,i.y9)(e,c,l,u)),f||k(d,l,t,m.Uq.Around,n,o)}return e})),(0,a.Q6)("loadMessage",((e,t,n)=>{const{chatId:s,messageId:o,replyOriginForId:c,threadUpdate:l}=n,d=(0,r.Z1)(e,s);d&&(async()=>{const e=await async function(e,t,n){const s=await(0,E.t9)("fetchMessage",{chat:e,messageId:t});if(!s)return;if(s===u._Q){if(n){let t=(0,a.Rd)();const s=(0,r.hj)(t,e.id,n);t=(0,i.cY)(t,e.id,n,{...s,replyToMessageId:void 0}),(0,a.R3)(t)}return}let o=(0,a.Rd)();return o=(0,i.cY)(o,e.id,t,s.message),o=(0,i.Sh)(o,(0,g.ee)(s.users,"id")),(0,a.R3)(o),s.message}(d,o,c);if(e&&l){const{lastMessageId:t,isDeleting:n}=l;(0,a.R3)((0,i.lG)((0,a.Rd)(),e,s,t,n))}})()})),(0,a.Q6)("sendMessage",((e,t,n)=>{const a=(0,r.Bt)(e);if(!a)return;const{chatId:o,threadId:i,type:c}=a;if("scheduled"===c&&!n.scheduledAt)return{...e,messages:{...e.messages,contentToBeScheduled:n}};const l=(0,r.Z1)(e,o),d={...n,chat:l,replyingTo:(0,r.Yy)(e,o,i),noWebPage:(0,r.tV)(e,o,i),sendAs:(0,r._5)(e,o)};t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:o,threadId:i,value:!1});const u=!n.attachments||n.attachments.length<=1,m=!u&&n.attachments&&n.attachments.length>1;if(u){const{attachments:e,...t}=d;N({...t,attachment:e?e[0]:void 0})}else if(m){const{text:e,entities:t,attachments:n,...a}=d,o=(0,g.Vl)(n,s.DU);for(let n=0;n0?r:void 0}),i.forEach((e=>{N({...a,attachment:e,groupedId:r})}))}}else{const{text:e,entities:t,attachments:n,replyingTo:a,...s}=d;e&&N({...s,text:e,entities:t,replyingTo:a}),n.forEach((e=>{N({...s,attachment:e})}))}})),(0,a.Q6)("editMessage",((e,t,n)=>{const{serverTimeOffset:a}=e,{text:s,entities:o}=n,i=(0,r.Bt)(e);if(!i)return;const{chatId:c,threadId:l,type:d}=i,u=(0,r.Z1)(e,c),m=(0,r.kK)(e,c,l,d);u&&m&&((0,E.t9)("editMessage",{chat:u,message:m,text:s,entities:o,noWebPage:(0,r.tV)(e,c,l),serverTimeOffset:a}),t.setEditingId({messageId:void 0}))})),(0,a.Q6)("cancelSendingMessage",((e,t,n)=>{const{chatId:a,messageId:s}=n,o=(0,r.hj)(e,a,s),i=o&&S.get(o.previousLocalId||o.id);i&&(0,E.u3)(i),t.apiUpdate({"@type":"deleteMessages",ids:[s],chatId:a})})),(0,a.Q6)("saveDraft",((e,t,n)=>{const{chatId:a,threadId:s,draft:o}=n;if(!o)return;const{text:c,entities:l}=o,d=(0,r.Z1)(e,a);return s===u._f&&(0,E.t9)("saveDraft",{chat:d,text:c,entities:l,replyToMsgId:(0,r.Yy)(e,a,s)}),e=(0,i.pf)(e,a,s,"draft",o),(0,i.a4)(e,a,{draftDate:Math.round(Date.now()/1e3)})})),(0,a.Q6)("clearDraft",((e,t,n)=>{const{chatId:a,threadId:s,localOnly:o}=n;if(!(0,r.Ms)(e,a,s))return;const c=(0,r.Z1)(e,a);return o||s!==u._f||(0,E.t9)("clearDraft",c),e=(0,i.pf)(e,a,s,"draft",void 0),(0,i.a4)(e,a,{draftDate:void 0})})),(0,a.Q6)("toggleMessageWebPage",((e,t,n)=>{const{chatId:a,threadId:s,noWebPage:o}=n;return(0,i.pf)(e,a,s,"noWebPage",o)})),(0,a.Q6)("pinMessage",((e,t,n)=>{const a=(0,r.jr)(e);if(!a)return;const{messageId:s,isUnpin:o,isOneSide:i,isSilent:c}=n;(0,E.t9)("pinMessage",{chat:a,messageId:s,isUnpin:o,isOneSide:i,isSilent:c})})),(0,a.Q6)("unpinAllMessages",((e,t,n)=>{const s=(0,r.Z1)(e,n.chatId);s&&async function(e){await(0,E.t9)("unpinAllMessages",{chat:e});let t=(0,a.Rd)();t=(0,i.pf)(t,e.id,u._f,"pinnedIds",[]),(0,a.R3)(t)}(s)})),(0,a.Q6)("deleteMessages",((e,t,n)=>{const{messageIds:a,shouldDeleteForAll:s}=n,o=(0,r.Bt)(e);if(!o)return;const{chatId:i,threadId:c}=o,l=(0,r.Z1)(e,i);(0,E.t9)("deleteMessages",{chat:l,messageIds:a,shouldDeleteForAll:s});const d=(0,r._$)(e,i,c);a.includes(d)&&t.setEditingId({messageId:void 0})})),(0,a.Q6)("deleteScheduledMessages",((e,t,n)=>{const{messageIds:a}=n,s=(0,r.Bt)(e);if(!s)return;const{chatId:o}=s,i=(0,r.Z1)(e,o);(0,E.t9)("deleteScheduledMessages",{chat:i,messageIds:a});const c=(0,r.wU)(e,o);a.includes(c)&&t.setEditingId({messageId:void 0})})),(0,a.Q6)("deleteHistory",((e,t,n)=>{(async()=>{var a;const{chatId:s,shouldDeleteForAll:o}=n,i=(0,r.Z1)(e,s);if(!i)return;const c=null===(a=i.lastMessage)||void 0===a?void 0:a.id;await(0,E.t9)("deleteHistory",{chat:i,shouldDeleteForAll:o,maxId:c});const l=(0,r.Bt)(e);l&&l.chatId===s&&t.openChat({id:void 0})})()})),(0,a.Q6)("reportMessages",((e,t,n)=>{(async()=>{const{messageIds:a,reason:s,description:o}=n,i=(0,r.Bt)(e);if(!i)return;const{chatId:c}=i,l=(0,r.Z1)(e,c),d=await(0,E.t9)("reportMessages",{peer:l,messageIds:a,reason:s,description:o});t.showNotification({message:d?"Thank you! Your report will be reviewed by our team.":"Error occured while submiting report. Please, try again later."})})()})),(0,a.Q6)("sendMessageAction",((e,t,n)=>{(async()=>{const{action:t,chatId:a,threadId:s}=n;if(a===e.currentUserId)return;const o=(0,r.Z1)(e,a);o&&await(0,E.t9)("sendMessageAction",{peer:o,threadId:s,action:t})})()})),(0,a.Q6)("markMessageListRead",((e,t,n)=>{const{serverTimeOffset:a}=e,o=(0,r.Bt)(e);if(!o)return;const{chatId:c,threadId:l}=o,d=(0,r.Cm)(e,c,l);if(!d)return;const{maxId:m}=n;if(R((()=>{(0,E.t9)("markMessageListRead",{serverTimeOffset:a,chat:d,threadId:l,maxId:m})})),l!==u._f)return;c===s.aw&&(e={...e,serviceNotifications:e.serviceNotifications.map((e=>e.isUnread&&e.id<=m?{...e,isUnread:!1}:e))});const h=(0,r.Cb)(e,c,l),g=(0,r.It)(e,c,l);if(!h||!g||!d.unreadCount)return e;const p=function(e,t,n){let a=0;for(let s=0,o=e.length;s=t&&e[s]<=n&&a++,!(e[s]>=n));s++);return a}(h,g,m);return p?(0,i.a4)(e,c,{lastReadInboxMessageId:m,unreadCount:Math.max(0,d.unreadCount-p)}):e})),(0,a.Q6)("markMessagesRead",((e,t,n)=>{const a=(0,r.jr)(e);if(!a)return;const{messageIds:s}=n;(0,E.t9)("markMessagesRead",{chat:a,messageIds:s})})),(0,a.Q6)("loadWebPagePreview",((e,t,n)=>{const{text:s}=n;!async function(e){const t=await(0,E.t9)("fetchWebPagePreview",{message:e});(0,a.R3)({...(0,a.Rd)(),webPagePreview:t})}(s)})),(0,a.Q6)("clearWebPagePreview",(e=>{if(e.webPagePreview)return{...e,webPagePreview:void 0}})),(0,a.Q6)("sendPollVote",((e,t,n)=>{const{chatId:a,messageId:s,options:o}=n,i=(0,r.Z1)(e,a);i&&(0,E.t9)("sendPollVote",{chat:i,messageId:s,options:o})})),(0,a.Q6)("loadPollOptionResults",((e,t,n)=>{const{chat:s,messageId:o,option:r,offset:c,limit:l,shouldResetVoters:d}=n;!async function(e,t,n,s,o,r){const c=await(0,E.t9)("loadPollOptionResults",{chat:e,messageId:t,option:n,offset:s,limit:o});if(!c)return;let l=(0,a.Rd)();l=(0,i.Sh)(l,(0,g.ee)(c.users,"id"));const{voters:d}=l.pollResults;(0,a.R3)({...l,pollResults:{...l.pollResults,voters:{...d,[n]:(0,g.Tw)([...!r&&d&&d[n]?d[n]:[],...c&&c.users.map((e=>e.id))])},offsets:{...l.pollResults.offsets?l.pollResults.offsets:{},[n]:c.nextOffset||""}}})}(s,o,r,c,l,d)})),(0,a.Q6)("forwardMessages",((e,t,n)=>{const{fromChatId:s,messageIds:o,toChatId:i}=e.forwardMessages,c=s?(0,r.Z1)(e,s):void 0,d=i?(0,r.Z1)(e,i):void 0,u=s&&o?o.sort(((e,t)=>e-t)).map((t=>(0,r.hj)(e,s,t))).filter(Boolean):void 0;if(!c||!d||!u)return;const{isSilent:m,scheduledAt:h}=n,g=(0,r._5)(e,i),p=u.filter((e=>!(0,l.jM)(e)));p.length&&(0,E.t9)("forwardMessages",{fromChat:c,toChat:d,messages:p,serverTimeOffset:(0,a.Rd)().serverTimeOffset,isSilent:m,scheduledAt:h,sendAs:g}),u.filter((e=>(0,l.jM)(e))).forEach((e=>{const{text:t,entities:n}=e.content.text||{},{sticker:a,poll:s}=e.content;N({chat:d,text:t,entities:n,sticker:a,poll:s,isSilent:m,scheduledAt:h,sendAs:g})})),(0,a.R3)({...(0,a.Rd)(),forwardMessages:{}})})),(0,a.Q6)("loadScheduledHistory",((e,t,n)=>{const{chatId:s}=n,o=(0,r.Z1)(e,s);o&&async function(e){const t=await(0,E.t9)("fetchScheduledHistory",{chat:e});if(!t)return;const{messages:n}=t,s=(0,g.ee)(n,"id"),o=Object.keys(s).map(Number).sort(((e,t)=>t-e));let r=(0,a.Rd)();r=(0,i.w3)(r,e.id,s),r=(0,i.pf)(r,e.id,u._f,"scheduledIds",o),(0,a.R3)(r)}(o)})),(0,a.Q6)("sendScheduledMessages",((e,t,n)=>{const{chatId:a,id:s}=n,o=(0,r.Z1)(e,a);o&&(0,E.t9)("sendScheduledMessages",{chat:o,ids:[s]})})),(0,a.Q6)("rescheduleMessage",((e,t,n)=>{const{chatId:a,messageId:s,scheduledAt:o}=n,i=(0,r.Z1)(e,a),c=i&&(0,r.Tm)(e,i.id,s);i&&c&&(0,E.t9)("rescheduleMessage",{chat:i,message:c,scheduledAt:o})})),(0,a.Q6)("requestThreadInfoUpdate",((e,t,n)=>{const{chatId:a,threadId:s}=n,o=(0,r.Cm)(e,a,s);o&&(0,E.t9)("requestThreadInfoUpdate",{chat:o,threadId:s})})),(0,a.Q6)("loadPinnedMessages",((e,t,n)=>{const{chatId:s}=n,o=(0,r.Z1)(e,s);o&&async function(e){const t=await(0,E.t9)("fetchPinnedMessages",{chat:e});if(!t)return;const{messages:n,chats:s,users:o}=t,r=(0,g.ee)(n,"id"),c=Object.keys(r).map(Number).sort(((e,t)=>t-e));let l=(0,a.Rd)();l=(0,i.c_)(l,e.id,r),l=(0,i.pf)(l,e.id,u._f,"pinnedIds",c),l=(0,i.Sh)(l,(0,g.ee)(o,"id")),l=(0,i.fZ)(l,(0,g.ee)(s,"id")),(0,a.R3)(l)}(o)})),(0,a.Q6)("loadSeenBy",((e,t,n)=>{const{chatId:s,messageId:o}=n,c=(0,r.Z1)(e,s);c&&(async()=>{const e=await(0,E.t9)("fetchSeenBy",{chat:c,messageId:o});e&&(0,a.R3)((0,i.cY)((0,a.Rd)(),s,o,{seenByUserIds:e}))})()})),(0,a.Q6)("saveDefaultSendAs",((e,t,n)=>{const{chatId:a,sendAsId:s}=n,o=(0,r.Z1)(e,a),c=(0,r.Z1)(e,s)||(0,r.dy)(e,s);if(o&&c)return(0,E.t9)("saveDefaultSendAs",{sendAs:c,chat:o}),(0,i.a4)(e,a,{fullInfo:{...o.fullInfo,sendAsId:s}})})),(0,a.Q6)("loadSendAs",((e,t,n)=>{const{chatId:s}=n,o=(0,r.Z1)(e,s);o&&(async()=>{const t=await(0,E.t9)("fetchSendAs",{chat:o});if(!t)return e=(0,i.a4)(e,s,{sendAsIds:[]}),void(0,a.R3)(e);e=(0,a.Rd)(),e=(0,i.Sh)(e,(0,g.ee)(t.users,"id")),e=(0,i.fZ)(e,(0,g.ee)(t.chats,"id")),e=(0,i.a4)(e,s,{sendAsIds:t.ids}),(0,a.R3)(e)})()})),(0,a.Q6)("loadSponsoredMessages",((e,t,n)=>{const{chatId:s}=n,o=(0,r.Z1)(e,s);o&&(async()=>{const e=await(0,E.t9)("fetchSponsoredMessages",{chat:o});if(!e)return;let t=(0,i.Fn)((0,a.Rd)(),s,e.messages[0]);t=(0,i.Sh)(t,(0,g.ee)(e.users,"id")),t=(0,i.fZ)(t,(0,g.ee)(e.chats,"id")),(0,a.R3)(t)})()})),(0,a.Q6)("viewSponsoredMessage",((e,t,n)=>{const{chatId:a}=n,s=(0,r.Z1)(e,a),o=(0,r.fS)(e,a);s&&o&&(0,E.t9)("viewSponsoredMessage",{chat:s,random:o.randomId})}));var B=n(5765);const x=(0,M.P2)((e=>e()),500,!1);async function A(e,t){const n=await(0,E.t9)("searchGifs",{query:e,offset:t});n&&(0,a.R3)((0,i.rq)((0,a.Rd)(),!t,n.gifs,n.nextOffset))}(0,a.Q6)("loadStickerSets",(e=>{const{hash:t}=e.stickers.added||{};!async function(e){const t=await(0,E.t9)("fetchStickerSets",{hash:e});t&&(0,a.R3)((0,i.z3)((0,a.Rd)(),"added",t.hash,t.sets))}(t)})),(0,a.Q6)("loadAddedStickers",((e,t)=>{const{setIds:n}=e.stickers.added,a=e.stickers.setsById;n&&n.length&&(async()=>{for(let e=0;e0&&await(0,M.wO)(200))}})()})),(0,a.Q6)("loadRecentStickers",(e=>{const{hash:t}=e.stickers.recent||{};!async function(e){const t=await(0,E.t9)("fetchRecentStickers",{hash:e});if(!t)return;const n=(0,a.Rd)();(0,a.R3)({...n,stickers:{...n.stickers,recent:t}})}(t)})),(0,a.Q6)("loadFavoriteStickers",(e=>{const{hash:t}=e.stickers.favorite||{};!async function(e){const t=await(0,E.t9)("fetchFavoriteStickers",{hash:e});if(!t)return;const n=(0,a.Rd)();(0,a.R3)({...n,stickers:{...n.stickers,favorite:t}})}(t)})),(0,a.Q6)("loadGreetingStickers",(e=>{const{hash:t}=e.stickers.greeting||{};(async()=>{const e=await(0,E.t9)("fetchStickersForEmoji",{emoji:"👋⭐️",hash:t});if(!e)return;const n=(0,a.Rd)();(0,a.R3)({...n,stickers:{...n.stickers,greeting:{hash:e.hash,stickers:e.stickers.filter((e=>"👋"===e.emoji))}}})})()})),(0,a.Q6)("loadFeaturedStickers",(e=>{const{hash:t}=e.stickers.featured||{};!async function(e){const t=await(0,E.t9)("fetchFeaturedStickers",{hash:e});t&&(0,a.R3)((0,i.z3)((0,a.Rd)(),"featured",t.hash,t.sets))}(t)})),(0,a.Q6)("loadStickers",((e,t,n)=>{const{stickerSetId:s,stickerSetShortName:o}=n;let{stickerSetAccessHash:c}=n;if(!c&&!o){const t=(0,r.Ny)(e,s);if(!t)return;c=t.accessHash}!async function(e,t,n){const s=await(0,E.t9)("fetchStickers",{stickerSetShortName:n,stickerSetId:e,accessHash:t});if(!s)return;const{set:o,stickers:r,packs:c}=s;let l=(0,a.Rd)();l=(0,i.Rg)(l,o.id,{...o,stickers:r,packs:c});const d=l.stickers.forEmoji.emoji;d&&c[d]&&(l=(0,i.vy)(l)),(0,a.R3)(l)}(s,c,o)})),(0,a.Q6)("loadAnimatedEmojis",(()=>{!async function(){const e=await(0,E.t9)("fetchAnimatedEmojis");if(!e)return;const{set:t,stickers:n}=e;(0,a.R3)((0,i.g_)((0,a.Rd)(),{...t,stickers:n}))}(),async function(){const e=await(0,E.t9)("fetchAnimatedEmojiEffects");if(!e)return;const{set:t,stickers:n}=e;(0,a.R3)({...(0,a.Rd)(),animatedEmojiEffects:{...t,stickers:n}})}()})),(0,a.Q6)("loadSavedGifs",(e=>{const{hash:t}=e.gifs.saved;!async function(e){const t=await(0,E.t9)("fetchSavedGifs",{hash:e});if(!t)return;const n=(0,a.Rd)();(0,a.R3)({...n,gifs:{...n.gifs,saved:t}})}(t)})),(0,a.Q6)("faveSticker",((e,t,n)=>{const{sticker:a}=n;a&&(0,E.t9)("faveSticker",{sticker:a})})),(0,a.Q6)("unfaveSticker",((e,t,n)=>{const{sticker:s}=n;s&&function(e){const t=(0,a.Rd)();(0,a.R3)({...t,stickers:{...t.stickers,favorite:{...t.stickers.favorite,stickers:t.stickers.favorite.stickers.filter((t=>{let{id:n}=t;return n!==e.id}))}}}),(0,E.t9)("faveSticker",{sticker:e,unfave:!0})}(s)})),(0,a.Q6)("toggleStickerSet",((e,t,n)=>{const{stickerSetId:a}=n,s=(0,r.Ny)(e,a);if(!s)return;const{accessHash:o,installedDate:i}=s;(0,E.t9)(i?"uninstallStickerSet":"installStickerSet",{stickerSetId:a,accessHash:o})})),(0,a.Q6)("loadEmojiKeywords",((e,t,n)=>{var s;const{language:o}=n;let i=e.emojiKeywords[o];null!==(s=i)&&void 0!==s&&s.isLoading||((0,a.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{...i,isLoading:!0}}}),(async()=>{var t;const n=await(0,E.t9)("fetchEmojiKeywords",{language:o,fromVersion:i?i.version:0});e=(0,a.Rd)(),i=e.emojiKeywords[o],n?(0,a.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{isLoading:!1,version:n.version,keywords:{...null===(t=i)||void 0===t?void 0:t.keywords,...n.keywords}}}}):(0,a.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{...i,isLoading:!1}}})})())})),(0,a.Q6)("setStickerSearchQuery",((e,t,n)=>{const{query:s}=n;s&&x((()=>{!async function(e,t){const n=await(0,E.t9)("searchStickers",{query:e,hash:void 0});if(!n)return;const s=(0,a.Rd)(),{setsById:o,added:r}=s.stickers,c=n.sets.map((e=>{let{id:t}=e;return t}));r.setIds&&r.setIds.forEach((t=>{if(!c.includes(t)){const{title:n}=o[t]||{};n&&(0,B.Z)(n,e)&&c.unshift(t)}})),(0,a.R3)((0,i.z3)(s,"search",n.hash,n.sets,c))}(s)}))})),(0,a.Q6)("setGifSearchQuery",((e,t,n)=>{const{query:a}=n;"string"==typeof a&&x((()=>{A(a)}))})),(0,a.Q6)("searchMoreGifs",(e=>{const{query:t,offset:n}=e.gifs.search;"string"==typeof t&&x((()=>{A(t,n)}))})),(0,a.Q6)("loadStickersForEmoji",((e,t,n)=>{const{emoji:s}=n,{hash:o}=e.stickers.forEmoji;x((()=>{!async function(e,t){let n=(0,a.Rd)();(0,a.R3)({...n,stickers:{...n.stickers,forEmoji:{...n.stickers.forEmoji,emoji:e}}});const s=await(0,E.t9)("fetchStickersForEmoji",{emoji:e,hash:t});n=(0,a.Rd)(),s&&n.stickers.forEmoji.emoji===e&&(n=(0,i.IM)(n,e,s.stickers,s.hash),(0,a.R3)(n))}(s,o)}))})),(0,a.Q6)("clearStickersForEmoji",(e=>({...e,stickers:{...e.stickers,forEmoji:{}}}))),(0,a.Q6)("openStickerSetShortName",((e,t,n)=>{const{stickerSetShortName:a}=n;return{...e,openedStickerSetShortName:a}}));var L=n(790);const O=(0,M.P2)((e=>e()),500,!1);async function U(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,c=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0,d=arguments.length>5?arguments[5]:void 0;if(c){const a=await(0,E.t9)("searchMessagesLocal",{chat:c,query:t,type:n,limit:s.Hk,offsetId:o,minDate:d,maxDate:l});if(a){const{messages:t,users:n,totalCount:s,nextOffsetId:o}=a;e={messages:t,users:n,chats:[],totalCount:s,nextRate:o}}}else e=await(0,E.t9)("searchMessagesGlobal",{query:t,offsetRate:o,limit:s.Hk,type:n,maxDate:l,minDate:d});let u=(0,a.Rd)();const m=(0,r.JX)(u);if(!e||""!==t&&t!==m)return void(0,a.R3)((0,i.xv)(u,{messages:!1}));const{messages:h,users:p,chats:f,totalCount:v,nextRate:I}=e;f.length&&(u=(0,i.fZ)(u,(0,g.ee)(f,"id"))),p.length&&(u=(0,i.Sh)(u,(0,g.ee)(p,"id"))),h.length&&(u=(0,i.m6)(u,h)),u=(0,i.px)(u,h,v,n,I),(0,a.R3)(u)}async function F(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const c=await(0,E.t9)("searchMessagesLocal",{chat:e,type:t,limit:2*s.EN,offsetId:n});if(!c)return;const{chats:l,users:d,messages:u,totalCount:m,nextOffsetId:h}=c,p=(0,g.ee)(u,"id"),f=Object.keys(p).map(Number);let v=(0,a.Rd)();const I=(0,r.we)(v);I&&(v=(0,i.fZ)(v,(0,g.ee)(l,"id")),v=(0,i.Sh)(v,(0,g.ee)(d,"id")),v=(0,i.c_)(v,e.id,p),v=(0,i.c1)(v,e.id,t,f,m,h),(0,a.R3)(v),o||F(e,t,h,!0))}(0,a.Q6)("setGlobalSearchQuery",((e,t,n)=>{const{chatId:s}=e.globalSearch,{query:o}=n;o&&!s&&O((()=>{!async function(e){const t=await(0,E.t9)("searchChats",{query:e});let n=(0,a.Rd)();const s=(0,r.JX)(n);if(!t||!s||e!==s)return void(0,a.R3)((0,i.xv)(n,{chats:!1}));const{localChats:o,localUsers:c,globalChats:l,globalUsers:d}=t;(o.length||l.length)&&(n=(0,i.fZ)(n,(0,g.ee)([...o,...l],"id"))),(c.length||d.length)&&(n=(0,i.Sh)(n,(0,g.ee)([...c,...d],"id"))),n=(0,i.xv)(n,{chats:!1}),n=(0,i.No)(n,{localResults:{chatIds:o.map((e=>{let{id:t}=e;return t})),userIds:c.map((e=>{let{id:t}=e;return t}))},globalResults:{...n.globalSearch.globalResults,chatIds:l.map((e=>{let{id:t}=e;return t})),userIds:d.map((e=>{let{id:t}=e;return t}))}}),(0,a.R3)(n)}(o)}))})),(0,a.Q6)("setGlobalSearchDate",((e,t,n)=>{const{date:s}=n,o=s?(0,L.IS)(s):s,c=(0,i.No)(e,{date:s,query:"",resultsByType:{...e.globalSearch.resultsByType,text:{totalCount:void 0,foundIds:[],nextOffsetId:0}}});(0,a.R3)(c);const{chatId:l}=e.globalSearch;U("","text",void 0,l?(0,r.Z1)(e,l):void 0,o,s)})),(0,a.Q6)("searchMessagesGlobal",((e,t,n)=>{var a;const{query:s,resultsByType:o,chatId:i,date:c}=e.globalSearch,l=c?(0,L.IS)(c):c,{type:d}=n;U(s,d,null==o||null===(a=o[d])||void 0===a?void 0:a.nextOffsetId,i?(0,r.Z1)(e,i):void 0,l,c)})),(0,a.Q6)("searchTextMessagesLocal",(e=>{const{chatId:t,threadId:n}=(0,r.Bt)(e)||{},o=t?(0,r.Z1)(e,t):void 0,c=(0,r.n5)(e);if(!o||!c||!n)return;const{query:l,results:d}=c,m=null==d?void 0:d.nextOffsetId;let h;if(n!==u._f){const a=(0,r.tZ)(e,t,n);h=null==a?void 0:a.topMessageId}!async function(e,t,n,o,c){if(!o)return;const l=await(0,E.t9)("searchMessagesLocal",{chat:e,type:"text",query:o,topMessageId:n,limit:s.pn,offsetId:c});if(!l)return;const{chats:d,users:u,messages:m,totalCount:h,nextOffsetId:p}=l,f=(0,g.ee)(m,"id"),v=Object.keys(f).map(Number);let I=(0,a.Rd)();const y=(0,r.n5)(I);y&&o===y.query&&(I=(0,i.fZ)(I,(0,g.ee)(d,"id")),I=(0,i.Sh)(I,(0,g.ee)(u,"id")),I=(0,i.c_)(I,e.id,f),I=(0,i.dx)(I,e.id,t,v,h,p),(0,a.R3)(I))}(o,n,h,l,m)})),(0,a.Q6)("searchMediaMessagesLocal",(e=>{const{chatId:t}=(0,r.Bt)(e)||{};if(!t)return;const n=(0,r.Z1)(e,t),a=(0,r.we)(e);if(!n||!a)return;const{currentType:s,resultsByType:o}=a,i=s&&o&&o[s],c=null==i?void 0:i.nextOffsetId;s&&F(n,s,c)})),(0,a.Q6)("searchMessagesByDate",((e,t,n)=>{const{timestamp:s}=n,{chatId:o}=(0,r.Bt)(e)||{};if(!o)return;const i=(0,r.Z1)(e,o);i&&async function(e,t){const n=await(0,E.t9)("findFirstMessageIdAfterDate",{chat:e,timestamp:t});n&&(0,a.uC)().focusMessage({chatId:e.id,messageId:n})}(i,s)})),(0,a.Q6)("checkPublicLink",((e,t,n)=>{const{chatId:s}=(0,r.Bt)(e)||{};if(!s)return;if(e.management.progress===m.wv.InProgress)return;const{username:o}=n;(async()=>{e=(0,i.H9)(e,m.wv.InProgress),e=(0,i.fw)(e,s,{isUsernameAvailable:void 0}),(0,a.R3)(e);const t=await(0,E.t9)("checkChatUsername",{username:o});e=(0,a.Rd)(),e=(0,i.H9)(e,t?m.wv.Complete:m.wv.Error),e=(0,i.fw)(e,s,{isUsernameAvailable:t}),(0,a.R3)(e)})()})),(0,a.Q6)("updatePublicLink",((e,t,n)=>{const{chatId:s}=(0,r.Bt)(e)||{};let o=s&&(0,r.Z1)(e,s);if(!s||!o)return;const{username:c}=n;(async()=>{if(e=(0,i.H9)(e,m.wv.InProgress),(0,a.R3)(e),(0,l.G9)(o)){if(o=await(0,E.t9)("migrateChat",o),!o)return;t.openChat({id:o.id})}const n=await(0,E.t9)("setChatUsername",{chat:o,username:c});e=(0,a.Rd)(),e=(0,i.H9)(e,n?m.wv.Complete:m.wv.Error),e=(0,i.fw)(e,s,{isUsernameAvailable:void 0}),(0,a.R3)(e)})()})),(0,a.Q6)("updatePrivateLink",(e=>{const{chatId:t}=(0,r.Bt)(e)||{},n=t&&(0,r.Z1)(e,t);t&&n&&(0,E.t9)("updatePrivateLink",{chat:n})})),(0,a.Q6)("setEditingExportedInvite",((e,t,n)=>{const{chatId:s,invite:o}=n;(0,a.R3)((0,i.fw)(e,s,{editingInvite:o}))})),(0,a.Q6)("setOpenedInviteInfo",((e,t,n)=>{const{chatId:s,invite:o}=n,r=o?{inviteInfo:{invite:o}}:{inviteInfo:void 0};(0,a.R3)((0,i.fw)(e,s,r))})),(0,a.Q6)("loadExportedChatInvites",((e,t,n)=>{const{chatId:s,adminId:o,isRevoked:c,limit:l}=n,d=(0,r.Z1)(e,s),u=(0,r.dy)(e,o||e.currentUserId);d&&u&&(async()=>{const e=await(0,E.t9)("fetchExportedChatInvites",{peer:d,admin:u,isRevoked:c,limit:l});if(!e)return;const t=c?{revokedInvites:e}:{invites:e};(0,a.R3)((0,i.fw)((0,a.Rd)(),s,t))})()})),(0,a.Q6)("editExportedChatInvite",((e,t,n)=>{const{chatId:s,link:o,isRevoked:c,expireDate:l,usageLimit:d,isRequestNeeded:u,title:m}=n,h=(0,r.Z1)(e,s);h&&(async()=>{const t=await(0,E.t9)("editExportedChatInvite",{peer:h,link:o,isRevoked:c,expireDate:l,usageLimit:d,isRequestNeeded:u,title:m});if(!t)return;let n=(e=(0,a.Rd)()).management.byChatId[s].invites||[];const r=e.management.byChatId[s].revokedInvites||[],{oldInvite:g,newInvite:p}=t;n=n.filter((e=>e.link!==g.link)),p.isRevoked?r.unshift(p):n.push(p),(0,a.R3)((0,i.fw)(e,s,{invites:n,revokedInvites:r}))})()})),(0,a.Q6)("exportChatInvite",((e,t,n)=>{const{chatId:s,expireDate:o,usageLimit:c,isRequestNeeded:l,title:d}=n,u=(0,r.Z1)(e,s);u&&(async()=>{const t=await(0,E.t9)("exportChatInvite",{peer:u,expireDate:o,usageLimit:c,isRequestNeeded:l,title:d});if(!t)return;const n=(e=(0,a.Rd)()).management.byChatId[s].invites||[];(0,a.R3)((0,i.fw)(e,s,{invites:[...n,t]}))})()})),(0,a.Q6)("deleteExportedChatInvite",((e,t,n)=>{const{chatId:s,link:o}=n,c=(0,r.Z1)(e,s);c&&(async()=>{var t,n;if(!await(0,E.t9)("deleteExportedChatInvite",{peer:c,link:o}))return;const r=(e=(0,a.Rd)()).management.byChatId[s];(0,a.R3)((0,i.fw)(e,s,{invites:null==r||null===(t=r.invites)||void 0===t?void 0:t.filter((e=>e.link!==o)),revokedInvites:null==r||null===(n=r.revokedInvites)||void 0===n?void 0:n.filter((e=>e.link!==o))}))})()})),(0,a.Q6)("deleteRevokedExportedChatInvites",((e,t,n)=>{const{chatId:s,adminId:o}=n,c=(0,r.Z1)(e,s),l=(0,r.dy)(e,o||e.currentUserId);c&&l&&(async()=>{await(0,E.t9)("deleteRevokedExportedChatInvites",{peer:c,admin:l})&&(e=(0,a.Rd)(),(0,a.R3)((0,i.fw)(e,s,{revokedInvites:[]})))})()})),(0,a.Q6)("loadChatInviteImporters",((e,t,n)=>{const{chatId:s,link:o,offsetDate:c,offsetUserId:l,limit:d}=n,u=(0,r.Z1)(e,s),m=(0,r.dy)(e,l);!u||l&&!m||(async()=>{var t;const n=await(0,E.t9)("fetchChatInviteImporters",{peer:u,link:o,offsetDate:c,offsetUser:m,limit:d});if(!n)return;const r=null===(t=(e=(0,a.Rd)()).management.byChatId[s])||void 0===t?void 0:t.inviteInfo;null!=r&&r.invite&&r.invite.link===o&&(0,a.R3)((0,i.fw)(e,s,{inviteInfo:{...r,importers:n}}))})()})),(0,a.Q6)("loadChatInviteRequesters",((e,t,n)=>{const{chatId:s,link:o,offsetDate:c,offsetUserId:l,limit:d}=n,u=(0,r.Z1)(e,s),m=(0,r.dy)(e,l);!u||l&&!m||(async()=>{var t;const n=await(0,E.t9)("fetchChatInviteImporters",{peer:u,link:o,offsetDate:c,offsetUser:m,limit:d,isRequested:!0});if(!n)return;const r=null===(t=(e=(0,a.Rd)()).management.byChatId[s])||void 0===t?void 0:t.inviteInfo;null!=r&&r.invite&&r.invite.link===o&&(0,a.R3)((0,i.fw)(e,s,{inviteInfo:{...r,requesters:n}}))})()})),(0,a.Q6)("loadChatJoinRequests",((e,t,n)=>{const{chatId:s,offsetDate:o,offsetUserId:c,limit:l}=n,d=(0,r.Z1)(e,s),u=(0,r.dy)(e,c);!d||c&&!u||(async()=>{const t=await(0,E.t9)("fetchChatInviteImporters",{peer:d,offsetDate:o,offsetUser:u,limit:l,isRequested:!0});t&&(e=(0,a.Rd)(),(0,a.R3)((0,i.a4)(e,s,{joinRequests:t})))})()})),(0,a.Q6)("hideChatJoinRequest",((e,t,n)=>{const{chatId:s,userId:o,isApproved:c}=n,l=(0,r.Z1)(e,s),d=(0,r.dy)(e,o);l&&d&&(async()=>{var t;if(!await(0,E.t9)("hideChatJoinRequest",{peer:l,user:d,isApproved:c}))return;e=(0,a.Rd)();const n=(0,r.Z1)(e,s);n&&(0,a.R3)((0,i.a4)(e,s,{joinRequests:null===(t=n.joinRequests)||void 0===t?void 0:t.filter((e=>e.userId!==o))}))})()})),(0,a.Q6)("hideAllChatJoinRequests",((e,t,n)=>{const{chatId:s,isApproved:o,link:c}=n,l=(0,r.Z1)(e,s);l&&(async()=>{if(!await(0,E.t9)("hideAllChatJoinRequests",{peer:l,isApproved:o,link:c}))return;e=(0,a.Rd)();const t=(0,r.Z1)(e,s);t&&(0,a.R3)((0,i.a4)(e,s,{joinRequests:[],fullInfo:{...t.fullInfo,recentRequesterIds:[],requestsPending:0}}))})()}));var $=n(6974);let D;function j(e){return(0,E.t9)("fetchMessages",{chat:e,threadId:u._f,offsetId:e.lastReadInboxMessageId,addOffset:-(Math.round(s.hT/2)+1),limit:s.hT})}(0,a.Q6)("sync",(()=>{s.eM&&console.log(">>> START SYNC"),D&&clearTimeout(D),(0,a.R3)({...(0,a.Rd)(),isSyncing:!0}),D=window.setTimeout((()=>{(0,a.R3)({...(0,a.Rd)(),isSyncing:!1}),D=void 0}),15e3);const{loadAllChats:e,preloadTopChatMessages:t}=(0,a.uC)();e({listType:"active",shouldReplace:!0,onReplace:async()=>{await async function(){let e=!1,t=(0,a.Rd)();const n=Object.keys(t.messages.byChatId).reduce(((e,n)=>{const a=(0,r.Ms)(t,n,u._f);return a&&(e[n]=a),e}),{}),{chatId:o,threadId:c}=(0,r.Bt)(t)||{},l=o?t.chats.byId[o]:void 0;if(o&&l){const n=await j(l);t=(0,a.Rd)();const{chatId:d}=(0,r.Bt)(t)||{},m=c&&(0,r.tZ)(t,o,c);if(n&&d===o){const a=t.messages.byChatId[o],r=o===s.aw?t.serviceNotifications.map((e=>{let{message:t}=e;return t})):[],l=[].concat(n.messages,r),d=(0,g.ee)(l,"id"),h=Object.keys(d).map(Number);if(t={...t,messages:{...t.messages,byChatId:{}}},t=(0,i.c_)(t,o,d),t=(0,i.xj)(t,o,u._f,h),t=(0,i.y9)(t,o,u._f,h),c&&m&&m.originChannelId){const{originChannelId:e}=m,n=t.messages.byChatId[e],s=await j(t.chats.byId[e]);if(s){const e=(0,g.ee)(s.messages,"id"),i=Object.keys(e).map(Number);t={...t,messages:{...t.messages,byChatId:{...t.messages.byChatId,[m.originChannelId]:{byId:e,threadsById:{[u._f]:{...null==n?void 0:n.threadsById[u._f],listedIds:i,viewportIds:i,outlyingIds:void 0}}},[o]:{...t.messages.byChatId[o],threadsById:{...t.messages.byChatId[o].threadsById,[c]:{...null==a?void 0:a.threadsById[c],outlyingIds:void 0}}}}}}}}t=(0,i.GL)(t,(0,g.ee)(n.chats,"id")),t=(0,i.eD)(t,(0,g.ee)(n.users,"id")),t=(0,i.j6)(t,o,n.threadInfos),e=!0}}e||(t={...t,messages:{...t.messages,byChatId:{}}}),Object.keys(n).forEach((e=>{t=(0,i.pf)(t,e,u._f,"draft",n[e])})),(0,a.R3)(t);const{chatId:d,messageId:m}=t.audioPlayer;d&&m&&!(0,r.hj)(t,d,m)&&(0,a.uC)().closeAudioPlayer()}(),(0,a.R3)({...(0,a.Rd)(),lastSyncTime:Date.now(),isSyncing:!1}),s.eM&&console.log(">>> FINISH SYNC"),(0,$.S1)(),e({listType:"archived",shouldReplace:!0}),(0,E.t9)("fetchCurrentUser"),t()}})}));const Q=(0,M.Ds)((e=>e()),500,!1,!0),q=(0,M.P2)((e=>e()),500,!1);function G(e,t,n){return{...e,inlineBots:{...e.inlineBots,byUsername:{...e.inlineBots.byUsername,[t]:n}}}}function H(e,t){return{...e,inlineBots:{...e.inlineBots,isLoading:t}}}(0,a.Q6)("loadFullUser",((e,t,n)=>{const{userId:a}=n,s=(0,r.dy)(e,a);if(!s)return;const{id:o,accessHash:i}=s;Q((()=>(0,E.t9)("fetchFullUser",{id:o,accessHash:i})))})),(0,a.Q6)("loadUser",((e,t,n)=>{const{userId:s}=n,o=(0,r.dy)(e,s);o&&(async()=>{const t=await(0,E.t9)("fetchUsers",{users:[o]});if(!t)return;const{users:n,userStatusesById:s}=t;e=(0,a.Rd)(),e=(0,i.eD)(e,(0,g.ee)(n,"id")),(0,a.R3)((0,i.ps)(e,{...e.users.statusesById,...s})),(0,a.R3)(e)})()})),(0,a.Q6)("loadTopUsers",(e=>{const{topPeers:{lastRequestedAt:t}}=e;(!t||(0,p.b)(e.serverTimeOffset)-t>60)&&async function(){const e=await(0,E.t9)("fetchTopUsers");if(!e)return;const{ids:t,users:n}=e;let s=(0,a.Rd)();s=(0,i.Sh)(s,(0,g.ee)(n,"id")),s={...s,topPeers:{...s.topPeers,userIds:t,lastRequestedAt:(0,p.b)(s.serverTimeOffset)}},(0,a.R3)(s)}()})),(0,a.Q6)("loadContactList",(()=>{!async function(){const e=await(0,E.t9)("fetchContactList");if(!e)return;let t=(0,i.Sh)((0,a.Rd)(),(0,g.ee)(e.users,"id"));t=(0,i.fZ)(t,(0,g.ee)(e.chats,"id"));const n=e=>e.lastName||e.firstName||"",s=new Intl.Collator("en-US"),o=e.users.sort(((e,t)=>s.compare(n(e),n(t)))).filter((e=>!e.isSelf));(0,a.R3)({...t,contactList:{userIds:o.map((e=>e.id))}})}()})),(0,a.Q6)("loadCurrentUser",(()=>{(0,E.t9)("fetchCurrentUser")})),(0,a.Q6)("loadCommonChats",(e=>{var t;const{chatId:n}=(0,r.Bt)(e)||{},s=n?(0,r.dy)(e,n):void 0;!s||(0,l.cS)(s)||null!==(t=s.commonChats)&&void 0!==t&&t.isFullyLoaded||(async()=>{var t,n;const o=null===(t=s.commonChats)||void 0===t?void 0:t.maxId,r=await(0,E.t9)("fetchCommonChats",s.id,s.accessHash,o);if(!r)return;const{chats:c,chatIds:l,isFullyLoaded:d}=r;e=(0,a.Rd)(),c.length&&(e=(0,i.fZ)(e,(0,g.ee)(c,"id"))),e=(0,i.Nq)(e,s.id,{commonChats:{maxId:l.length?l[l.length-1]:"0",ids:(0,g.Tw)(((null===(n=s.commonChats)||void 0===n?void 0:n.ids)||[]).concat(l)),isFullyLoaded:d}}),(0,a.R3)(e)})()})),(0,a.Q6)("updateContact",((e,t,n)=>{const{userId:s,isMuted:o,firstName:c,lastName:l}=n;!async function(e,t,n,s){const o=(0,a.Rd)(),c=(0,r.dy)(o,e);if(!c)return;let l;if((0,a.uC)().updateChatMutedState({chatId:e,isMuted:t}),(0,a.R3)((0,i.H9)((0,a.Rd)(),m.wv.InProgress)),c.phoneNumber)l=await(0,E.t9)("updateContact",{phone:c.phoneNumber,firstName:n,lastName:s});else{const{id:e,accessHash:t}=c;l=await(0,E.t9)("addContact",{id:e,accessHash:t,phoneNumber:"",firstName:n,lastName:s})}l&&(0,a.R3)((0,i.Nq)((0,a.Rd)(),c.id,{firstName:n,lastName:s})),(0,a.R3)((0,i.H9)((0,a.Rd)(),m.wv.Complete))}(s,o,c,l)})),(0,a.Q6)("deleteContact",((e,t,n)=>{const{userId:s}=n;!async function(e){const t=(0,a.Rd)(),n=(0,r.dy)(t,e);if(!n)return;const{id:s,accessHash:o}=n;await(0,E.t9)("deleteContact",{id:s,accessHash:o})}(s)})),(0,a.Q6)("loadProfilePhotos",((e,t,n)=>{const{profileId:s}=n,o=(0,l.YC)(s),c=o?(0,r.dy)(e,s):void 0,d=o?void 0:(0,r.Z1)(e,s);(c||d)&&(async()=>{const e=await(0,E.t9)("fetchProfilePhotos",c,d);if(!e||!e.photos)return;let t=(0,a.Rd)();o?t=(0,i.Nq)(t,s,{photos:e.photos}):(t=(0,i.Sh)(t,(0,g.ee)(e.users,"id")),t=(0,i.a4)(t,s,{photos:e.photos})),(0,a.R3)(t)})()})),(0,a.Q6)("setUserSearchQuery",((e,t,n)=>{const{query:s}=n;s&&q((()=>{!async function(e){const t=await(0,E.t9)("searchChats",{query:e});let n=(0,a.Rd)();const s=n.userSearch.query;if(!t||!s||e!==s)return void(0,a.R3)((0,i.Q3)(n,!1));const{localUsers:o,globalUsers:r}=t;let c,l;o.length&&(n=(0,i.Sh)(n,(0,g.ee)(o,"id")),c=o.map((e=>{let{id:t}=e;return t}))),r.length&&(n=(0,i.Sh)(n,(0,g.ee)(r,"id")),l=r.map((e=>{let{id:t}=e;return t}))),n=(0,i.Q3)(n,!1),n=(0,i.Lm)(n,{localUserIds:c,globalUserIds:l}),(0,a.R3)(n)}(s)}))})),(0,a.Q6)("addContact",((e,t,n)=>{const{userId:a}=n,s=(0,r.dy)(e,a);s&&(0,E.t9)("addContact",(0,g.ei)(s,["id","accessHash","firstName","lastName","phoneNumber"]))}));const _=(0,M.Ds)((e=>e()),500,!1);async function z(e,t,n,a,s){await(0,E.t9)("sendMessage",{chat:e,text:n,replyingTo:a,sendAs:s})}(0,a.Q6)("clickInlineButton",((e,t,n)=>{const{button:o}=n;switch(o.type){case"command":t.sendBotCommand({command:o.value});break;case"url":o.value.match(s.FS)||o.value.match(s.g$)?t.openTelegramLink({url:o.value}):t.toggleSafeLinkModal({url:o.value});break;case"callback":{const t=(0,r.jr)(e);if(!t)return;!async function(e,t,n){const s=await(0,E.t9)("answerCallbackButton",{chatId:e.id,accessHash:e.accessHash,messageId:t,data:n});if(!s)return;const{showDialog:o,showNotification:i,toggleSafeLinkModal:r}=(0,a.uC)(),{message:c,alert:l,url:d}=s;l?o({data:{message:c||"Error"}}):c?i({message:c}):d&&r({url:d})}(t,o.messageId,o.value);break}case"requestPoll":t.openPollModal();break;case"requestSelfContact":{const n=e.currentUserId?(0,r.dy)(e,e.currentUserId):void 0;if(!n)return;t.showDialog({data:{phoneNumber:n.phoneNumber,firstName:n.firstName,lastName:n.lastName,userId:n.id}});break}case"buy":{const n=(0,r.jr)(e),{messageId:a,value:s}=o;if(!n)return;s?t.getReceipt({receiptMessageId:s,chatId:n.id,messageId:a}):(t.getPaymentForm({chat:n,messageId:a}),t.setInvoiceMessageInfo((0,r.hj)(e,n.id,a)),t.openPaymentModal({chatId:n.id,messageId:a}));break}}})),(0,a.Q6)("sendBotCommand",((e,t,n)=>{const{command:a,chatId:s}=n,{currentUserId:o}=e,i=s?(0,r.Z1)(e,s):(0,r.jr)(e),c=(0,r.Bt)(e);if(!o||!i||!c)return;const{threadId:l}=c;t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:i.id,threadId:l,value:!1}),z(i,0,a,(0,r.Yy)(e,i.id,l),(0,r._5)(e,s))})),(0,a.Q6)("restartBot",((e,t,n)=>{const{chatId:s}=n,{currentUserId:o}=e,c=(0,r.jr)(e),l=o&&(0,r.IK)(e,s);o&&c&&l&&(async()=>{await(0,E.t9)("unblockContact",l.id,l.accessHash)&&((0,a.R3)((0,i.rB)((0,a.Rd)(),l.id)),z(c,0,"/start",void 0,(0,r._5)(e,s)))})()})),(0,a.Q6)("loadTopInlineBots",(e=>{const{lastRequestedAt:t}=e.topInlineBots;t&&(0,p.b)(e.serverTimeOffset)-t<60||(async()=>{const t=await(0,E.t9)("fetchTopInlineBots");if(!t)return;const{ids:n,users:s}=t;let o=(0,a.Rd)();o=(0,i.Sh)(o,(0,g.ee)(s,"id")),o={...o,topInlineBots:{...o.topInlineBots,userIds:n,lastRequestedAt:(0,p.b)(e.serverTimeOffset)}},(0,a.R3)(o)})()})),(0,a.Q6)("queryInlineBot",((e,t,n)=>{const{chatId:s,username:o,query:c,offset:l}=n;(async()=>{let t=e.inlineBots.byUsername[o];if(!1!==t){if(void 0===t){const{user:n,chat:s}=await(0,E.t9)("fetchInlineBot",{username:o})||{};if(e=(0,a.Rd)(),!n||!s)return void(0,a.R3)(G(e,o,!1));e=(0,i.Sh)(e,{[n.id]:n}),e=(0,i.fZ)(e,{[s.id]:s}),t={id:n.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},e=G(e,o,t),(0,a.R3)(e)}(c!==t.query||t.canLoadMore)&&_((()=>{!async function(e){let{username:t,inlineBotData:n,chatId:s,query:o,offset:i}=e,c=(0,a.Rd)();const l=(0,r.dy)(c,n.id),d=(0,r.Z1)(c,s);if(!l||!d)return;const u=n.query!==o;c=H(c,!0),c=G(c,t,{...n,query:o,...u&&{offset:void 0,results:[]}}),(0,a.R3)(c);const m=await(0,E.t9)("fetchInlineBotResults",{bot:l,chat:d,query:o,offset:u?void 0:i}),h=c.inlineBots.byUsername[t];if(c=H((0,a.Rd)(),!1),!m||!h||o!==h.query)return void(0,a.R3)(c);const g=new Set((h.results||[]).map((e=>e.id))),p=m.results.filter((e=>!g.has(e.id)));c=G(c,t,{...h,help:m.help,...p.length&&{isGallery:m.isGallery},...m.switchPm&&{switchPm:m.switchPm},canLoadMore:m.results.length>0&&Boolean(m.nextOffset),results:""===h.offset||h.offset===m.nextOffset?m.results:(h.results||[]).concat(p),offset:p.length?m.nextOffset:""}),(0,a.R3)(c)}({username:o,inlineBotData:t,chatId:s,query:c,offset:l})}))}})()})),(0,a.Q6)("sendInlineBotResult",((e,t,n)=>{const{id:a,queryId:s}=n,o=(0,r.Bt)(e);if(!o||!a)return;const{chatId:i,threadId:c}=o,l=(0,r.Z1)(e,i);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:i,threadId:c,value:!1}),(0,E.t9)("sendInlineBotResult",{chat:l,resultId:a,queryId:s,replyingTo:(0,r.Yy)(e,i,c),sendAs:(0,r._5)(e,i)})})),(0,a.Q6)("resetInlineBot",((e,t,n)=>{const{username:s}=n;let o=e.inlineBots.byUsername[s];o&&(o={id:o.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},(0,a.R3)(G(e,s,o)))})),(0,a.Q6)("startBot",((e,t,n)=>{const{botId:a,param:s}=n,o=(0,r.dy)(e,a);o&&(async()=>{await(0,E.t9)("startBot",{bot:o,startParam:s})})()})),n(9667),(0,a.Q6)("loadPasswordInfo",(()=>{(async()=>{const e=await(0,E.t9)("getPasswordInfo");if(!e)return;let t=(0,a.Rd)();t=(0,i.BI)(t,{hasPassword:e.hasPassword}),t=(0,i.IE)(t,{hint:e.hint}),(0,a.R3)(t)})()})),(0,a.Q6)("checkPassword",((e,t,n)=>{const{currentPassword:s,onSuccess:o}=n;(0,a.R3)((0,i.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,E.t9)("checkPassword",s);(0,a.R3)((0,i.IE)((0,a.Rd)(),{isLoading:!1})),e&&o()})()})),(0,a.Q6)("clearPassword",((e,t,n)=>{const{currentPassword:s,onSuccess:o}=n;(0,a.R3)((0,i.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,E.t9)("clearPassword",s);(0,a.R3)((0,i.IE)((0,a.Rd)(),{isLoading:!1})),e&&o()})()})),(0,a.Q6)("updatePassword",((e,t,n)=>{const{currentPassword:s,password:o,hint:r,email:c,onSuccess:l}=n;(0,a.R3)((0,i.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,E.t9)("updatePassword",s,o,r,c);(0,a.R3)((0,i.IE)((0,a.Rd)(),{isLoading:!1})),e&&l()})()})),(0,a.Q6)("updateRecoveryEmail",((e,t,n)=>{const{currentPassword:s,email:o,onSuccess:r}=n;(0,a.R3)((0,i.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,E.t9)("updateRecoveryEmail",s,o);(0,a.R3)((0,i.IE)((0,a.Rd)(),{isLoading:!1,waitingEmailCodeLength:void 0})),e&&r()})()})),(0,a.Q6)("provideTwoFaEmailCode",((e,t,n)=>{const{code:a}=n;(0,E.t9)("provideRecoveryEmailCode",a)})),(0,a.Q6)("clearTwoFaError",(e=>(0,i.IE)(e,{error:void 0}))),(0,a.Q6)("validateRequestedInfo",((e,t,n)=>{const{requestInfo:s,saveInfo:o}=n,c=(0,r.gx)(e),l=c&&(0,r.Z1)(e,c),d=(0,r.Mz)(e);l&&d&&async function(e,t,n,s){const o=await(0,E.t9)("validateRequestedInfo",{chat:e,messageId:t,requestInfo:n,shouldSave:s});if(!o)return;const{id:r,shippingOptions:c}=o;if(!r)return;let l=(0,i.vT)((0,a.Rd)(),r);c?(l=(0,i.TM)(l,c),l=(0,i.Q$)(l,m.KB.Shipping)):l=(0,i.Q$)(l,m.KB.PaymentInfo),(0,a.R3)(l)}(l,d,s,o)})),(0,a.Q6)("getPaymentForm",((e,t,n)=>{const{chat:s,messageId:o}=n;s&&o&&async function(e,t){const n=await(0,E.t9)("getPaymentForm",{chat:e,messageId:t});if(!n)return;let s=(0,i._7)((0,a.Rd)(),n),o=m.KB.PaymentInfo;s.payment.invoice&&(s.payment.invoice.shippingAddressRequested||s.payment.invoice.nameRequested||s.payment.invoice.phoneRequested||s.payment.invoice.emailRequested)&&(o=m.KB.ShippingInfo),s=(0,i.Q$)(s,o),(0,a.R3)(s)}(s,o)})),(0,a.Q6)("getReceipt",((e,t,n)=>{const{receiptMessageId:s,chatId:o,messageId:c}=n,l=o&&(0,r.Z1)(e,o);c&&s&&l&&async function(e,t,n){const s=await(0,E.t9)("getReceipt",e,n);if(!s)return;let o=(0,a.Rd)();const c=(0,r.hj)(o,e.id,t);o=(0,i.Dq)(o,s,c),(0,a.R3)(o)}(l,c,s)})),(0,a.Q6)("clearPaymentError",(e=>{(0,a.R3)({...e,payment:{...e.payment,error:void 0}})})),(0,a.Q6)("clearReceipt",(e=>{(0,a.R3)({...e,payment:{...e.payment,receipt:void 0}})})),(0,a.Q6)("sendCredentialsInfo",((e,t,n)=>{const{nativeProvider:o}=e.payment,{credentials:c}=n,{data:d}=c;if("stripe"===o){const t=(0,r.$$)(e);if(!t)return;!async function(e,t){const n=function(e){const t=Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&");return t.length>0?`?${t}`:""}({"card[number]":e.cardNumber,"card[exp_month]":e.expiryMonth,"card[exp_year]":e.expiryYear,"card[cvc]":e.cvv,"card[address_zip]":e.zip,"card[address_country]":e.country}),s=await fetch(`https://api.stripe.com/v1/tokens${n}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${t}`}}),o=await s.json();if(o.error){const e=(0,l.Ow)(o.error),t=(0,a.Rd)();return void(0,a.R3)({...t,payment:{...t.payment,error:{...e}}})}let r=(0,i.QH)((0,a.Rd)(),{type:o.type,id:o.id});r=(0,i.Q$)(r,m.KB.Checkout),(0,a.R3)(r)}(d,t)}else if("smartglocal"===o){const t=(0,r.EB)(e);if(!t)return;!async function(e,t){const n={card:{number:e.cardNumber.replace(/[^\d]+/g,""),expiration_month:e.expiryMonth,expiration_year:e.expiryYear,security_code:e.cvv.replace(/[^\d]+/g,"")}},o=s.eA?"https://tgb-playground.smart-glocal.com/cds/v1/tokenize/card":"https://tgb.smart-glocal.com/cds/v1/tokenize/card",r=await fetch(o,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-PUBLIC-TOKEN":t},body:JSON.stringify(n)}),c=await r.json();if("ok"!==c.status){const e={description:"payment error"},t=(0,a.Rd)();return void(0,a.R3)({...t,payment:{...t.payment,error:{...e}}})}let l=(0,i.QD)((0,a.Rd)(),{type:"card",token:c.data.token});l=(0,i.Q$)(l,m.KB.Checkout),(0,a.R3)(l)}(d,t)}})),(0,a.Q6)("sendPaymentForm",((e,t,n)=>{const{shippingOptionId:s,saveCredentials:o}=n,c=(0,r.gx)(e),l=c&&(0,r.Z1)(e,c),d=(0,r.Mz)(e),u=(0,r.eh)(e),m=(0,r.sp)(e),{nativeProvider:h}=e.payment,g="stripe"===h?(0,r.$$)(e):(0,r.EB)(e);l&&d&&g&&u&&h&&async function(e,t,n,s,o,r,c){if(!0===await(0,E.t9)("sendPaymentForm",{chat:e,messageId:t,formId:s,credentials:o,requestedInfoId:r,shippingOptionId:c})){const e=(0,i.bp)((0,a.Rd)());(0,a.R3)((0,i.WY)(e))}}(l,d,0,u,{save:o,data:"stripe"===h?(0,r.i3)(e):(0,r.Jg)(e)},m,s)})),(0,a.Q6)("setPaymentStep",(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,i.Q$)(e,n.step||m.KB.ShippingInfo)})),(0,a.Q6)("setInvoiceMessageInfo",((e,t,n)=>(0,i.nA)(e,n)));var V=n(647),X=n(3495);const K=728,W=424,Y=288;var J=n(3858);function ee(e,t){return t-(e.isLeftColumnShown&&!h.wB?e.leftColumnWidth||((n=J.Z.get().width)>s._m?Math.min(Math.max(.25*n,Y),.33*n):n>s.ks?Math.min(Math.max(.33*n,Y),.4*n):W):0);var n}let te=0;(0,a.Q6)("loadAvailableReactions",(()=>{(async()=>{const e=await(0,E.t9)("getAvailableReactions");e&&(e.forEach((e=>{e.aroundAnimation&&V.he(`sticker${e.aroundAnimation.id}`,u.IU.Lottie),e.centerIcon&&V.he(`sticker${e.centerIcon.id}`,u.IU.Lottie)})),(0,a.R3)({...(0,a.Rd)(),availableReactions:e}))})()})),(0,a.Q6)("interactWithAnimatedEmoji",((e,t,n)=>{const{emoji:a,x:s,y:o,localEffect:i,startSize:r,isReversed:c}=n,l={id:te++,animatedEffect:a||i,x:ee(e,s)+40*Math.random()-20,y:o+40*Math.random()-20,startSize:r,isReversed:c};return{...e,activeEmojiInteractions:[...e.activeEmojiInteractions||[],l]}})),(0,a.Q6)("sendEmojiInteraction",((e,t,n)=>{const{messageId:a,chatId:s,emoji:o,interactions:i,localEffect:c}=n,l=(0,r.Z1)(e,s);l&&(o||c)&&s!==e.currentUserId&&(0,E.t9)("sendEmojiInteraction",{chat:l,messageId:a,emoticon:o||(0,r.ji)(c),timestamps:i})})),(0,a.Q6)("sendDefaultReaction",((e,t,n)=>{const{chatId:a,messageId:s,x:o,y:i}=n,c=(0,r.q6)(e,a),d=(0,r.hj)(e,a,s);c&&d&&!(0,l.CI)(d)&&t.sendReaction({chatId:a,messageId:s,reaction:c,x:o,y:i})})),(0,a.Q6)("sendReaction",((e,t,n)=>{var a,o,i;const{chatId:c}=n;let{messageId:l}=n,{reaction:d}=n;const u=(0,r.Z1)(e,c);let m=(0,r.hj)(e,c,l);if(!u||!m)return;const h=Boolean(m.groupedId)&&!m.isInAlbum,p=h?(0,r.xH)(e,c,m.groupedId)[0]:void 0;m=h&&(0,r.hj)(e,c,p)||m,l=(null===(a=m)||void 0===a?void 0:a.id)||l,null!==(o=m.reactions)&&void 0!==o&&null!==(i=o.results)&&void 0!==i&&i.some((e=>e.reaction===d&&e.isChosen))&&(d=void 0),(0,E.t9)("sendReaction",{chat:u,messageId:l,reaction:d});const{animationLevel:f}=e.settings.byKey;return f===s.zy&&(e={...e,activeReactions:{...d?e.activeReactions:(0,g.CE)(e.activeReactions,[l]),...d&&{[l]:{reaction:d,messageId:l}}}}),function(e,t,n,a){const{reactions:s}=(0,r.hj)(e,t,n)||{};if(!s)return e;let o=s.results.map((e=>e.reaction===a?{...e,count:e.isChosen?e.count:e.count+1,isChosen:!0}:e.isChosen?{...e,isChosen:!1,count:e.count-1}:e)).filter((e=>e.count>0)),{recentReactions:i}=s;if(a&&!o.some((e=>e.reaction===a))){const{currentUserId:t}=e;o=[...o,{reaction:a,isChosen:!0,count:1}],s.canSeeList&&(i=[...i||[],{userId:t,reaction:a}])}return(0,X.cY)(e,t,n,{reactions:{...s,results:o,recentReactions:i}})}(e,c,l,d)})),(0,a.Q6)("openChat",(e=>({...e,activeReactions:{}}))),(0,a.Q6)("startActiveReaction",((e,t,n)=>{var a;const{messageId:o,reaction:i}=n,{animationLevel:r}=e.settings.byKey;return r!==s.zy||(null===(a=e.activeReactions[o])||void 0===a?void 0:a.reaction)===i?e:{...e,activeReactions:{...i?e.activeReactions:(0,g.CE)(e.activeReactions,[o]),...i&&{[o]:{reaction:i,messageId:o}}}}})),(0,a.Q6)("stopActiveReaction",((e,t,n)=>{var a;const{messageId:s,reaction:o}=n;return(null===(a=e.activeReactions[s])||void 0===a?void 0:a.reaction)!==o?e:{...e,activeReactions:(0,g.CE)(e.activeReactions,[s])}})),(0,a.Q6)("setDefaultReaction",((e,t,n)=>{const{reaction:s}=n;(async()=>{await(0,E.t9)("setDefaultReaction",{reaction:s})&&(e=(0,a.Rd)(),(0,a.R3)({...e,appConfig:{...e.appConfig,defaultReaction:s}}))})()})),(0,a.Q6)("stopActiveEmojiInteraction",((e,t,n)=>{var a;const{id:s}=n;return{...e,activeEmojiInteractions:null===(a=e.activeEmojiInteractions)||void 0===a?void 0:a.filter((e=>e.id!==s))}})),(0,a.Q6)("loadReactors",((e,t,n)=>{var s;const{chatId:o,messageId:c,reaction:l}=n,d=(0,r.Z1)(e,o),u=(0,r.hj)(e,o,c);if(!d||!u)return;const m=null===(s=u.reactors)||void 0===s?void 0:s.nextOffset;(async()=>{var t,n;const s=await(0,E.t9)("fetchMessageReactionsList",{reaction:l,chat:d,messageId:c,offset:m});if(!s)return;e=(0,a.Rd)(),null!==(t=s.users)&&void 0!==t&&t.length&&(e=(0,i.Sh)(e,(0,g.ee)(s.users,"id")));const{nextOffset:r,count:h,reactions:p}=s;(0,a.R3)((0,i.cY)(e,o,c,{reactors:{nextOffset:r,count:h,reactions:[...(null===(n=u.reactors)||void 0===n?void 0:n.reactions)||[],...p]}}))})()})),(0,a.Q6)("loadMessageReactions",((e,t,n)=>{const{ids:a,chatId:s}=n,o=(0,r.Z1)(e,s);o&&(0,E.t9)("fetchMessageReactions",{ids:a,chat:o})})),(0,a.Q6)("sendWatchingEmojiInteraction",((e,t,n)=>{var a;const{chatId:s,emoticon:o,x:i,y:c,startSize:l,isReversed:d,id:u}=n,m=(0,r.Z1)(e,s);if(m&&null!==(a=e.activeEmojiInteractions)&&void 0!==a&&a.some((e=>e.id===u))&&s!==e.currentUserId)return(0,E.t9)("sendWatchingEmojiInteraction",{chat:m,emoticon:o}),{...e,activeEmojiInteractions:e.activeEmojiInteractions.map((t=>t.id===u?{...t,x:ee(e,i),y:c,startSize:l,isReversed:d}:t))}})),n(4907);var ne=n(8406);function ae(e,t){const n=typeof e;if(n!==typeof t)return!1;if("object"!==n)return e===t;const a=Array.isArray(e);if(a!==Array.isArray(t))return!1;if(a){const n=e,a=t;return n.length===a.length&&n.every(((e,t)=>ae(e,a[t])))}const s=e,o=t;return Object.keys(s).every((e=>ae(s[e],o[e])))}(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"updateChat":{n.noTopChatsRequest||(0,r.N)(e,n.id)||t.loadTopChats();const s=(0,i.a4)(e,n.id,n.chat,n.newProfilePhoto);(0,a.R3)(s),n.chat.id&&(0,ne.Vr)({chatId:n.chat.id,lastReadInboxMessageId:n.chat.lastReadInboxMessageId});break}case"updateChatJoin":{const s=(0,r.Ek)(e,n.id);if(!s)break;e=(0,i.B1)(e,s,[n.id]),e=(0,i.a4)(e,n.id,{isNotJoined:!1}),(0,a.R3)(e);const o=(0,r.Z1)(e,n.id);o&&t.requestChatUpdate({chatId:o.id});break}case"updateChatLeave":(0,a.R3)((0,i.Dd)(e,n.id));break;case"updateChatInbox":(0,a.R3)((0,i.a4)(e,n.id,n.chat));break;case"updateChatTypingStatus":{const{id:t,typingStatus:s}=n;(0,a.R3)((0,i.a4)(e,t,{typingStatus:s})),setTimeout((()=>{const e=(0,a.Rd)(),n=(0,r.Z1)(e,t);n&&s&&n.typingStatus&&n.typingStatus.timestamp===s.timestamp&&(0,a.R3)((0,i.a4)(e,t,{typingStatus:void 0}))}),6e3);break}case"newMessage":{const{message:s}=n,{chatId:o,threadId:c,type:l}=(0,r.Bt)(e)||{};if(s.senderId===e.currentUserId&&!s.isFromScheduled)return;const d=(0,r.Z1)(e,n.chatId);if(!d)return;"thread"===l&&c===u._f&&n.chatId===o?setTimeout((()=>{t.requestChatUpdate({chatId:n.chatId})}),1500):(0,a.R3)((0,i.a4)(e,n.chatId,{unreadCount:d.unreadCount?d.unreadCount+1:1,...n.message.hasUnreadMention&&{unreadMentionsCount:d.unreadMentionsCount?d.unreadMentionsCount+1:1}})),(0,ne.rh)({chat:d,message:s});break}case"updateMessage":{const{message:t}=n,a=(0,r.Z1)(e,n.chatId);if(!a)return;(0,l.dT)(t)&&(0,ne.rh)({chat:a,message:t});break}case"updateCommonBoxMessages":case"updateChannelMessages":{const{ids:t,messageUpdate:s}=n;if(!1!==s.hasUnreadMention)return;t.forEach((t=>{const a="channelId"in n?n.channelId:(0,r.X5)(e,t),s=(0,r.Z1)(e,a);null!=s&&s.unreadMentionsCount&&(e=(0,i.a4)(e,a,{unreadMentionsCount:s.unreadMentionsCount-1}))})),(0,a.R3)(e);break}case"updateChatFullInfo":{const{fullInfo:t}=n,s=e.chats.byId[n.id];if(!s)return;(0,a.R3)((0,i.a4)(e,n.id,{fullInfo:{...s.fullInfo,...t}}));break}case"updatePinnedChatIds":{const{ids:t,folderId:o}=n,i=o===s.WS?"archived":"active";e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[i]:t.length?t:void 0}}},(0,a.R3)(e);break}case"updateChatPinned":{const{id:t,isPinned:o}=n,i=(0,r.Ek)(e,t);if(i){const{[i]:n}=e.chats.orderedPinnedIds;let a=n||[];if(o){if(!a.includes(t)){if("active"===i&&a.length>=s.EG){const t=e.chats.listIds.active;a=a.filter((e=>t&&t.includes(e)))}a=[t,...a]}}else a=a.filter((e=>e!==t));e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[i]:a.length?a:void 0}}}}(0,a.R3)(e);break}case"updateChatListType":{const{id:t,folderId:s}=n;(0,a.R3)((0,i.Pi)(e,t,s));break}case"updateChatFolder":{const{id:t,folder:s}=n,{byId:o,orderedIds:i}=e.chatFolders,r=s?{...o,[t]:s}:(0,g.ei)(o,Object.keys(o).map(Number).filter((e=>e!==t))),c=s?i&&i.includes(t)?i:[...i||[],t]:i?i.filter((e=>e!==t)):void 0;(0,a.R3)({...e,chatFolders:{...e.chatFolders,byId:r,orderedIds:c}});break}case"updateChatFoldersOrder":{const{orderedIds:t}=n;(0,a.R3)({...e,chatFolders:{...e.chatFolders,orderedIds:t}});break}case"updateRecommendedChatFolders":{const{folders:t}=n;(0,a.R3)({...e,chatFolders:{...e.chatFolders,recommended:t}});break}case"updateChatMembers":{var o;const t=e.chats.byId[n.id],{replacedMembers:s,addedMember:r,deletedMemberId:c}=n;if(!t)return;let l=!1,d=null!==(o=t.fullInfo)&&void 0!==o&&o.members?[...t.fullInfo.members]:[];if(s)d=s,l=!0;else if(r)d.length&&d.some((e=>e.userId===r.userId))||(d.push(r),l=!0);else if(d.length&&c){const e=d.findIndex((e=>e.userId===c));e>-1&&(d.slice(e,1),l=!0)}if(l){const s=d.filter((e=>{let{isOwner:t,isAdmin:n}=e;return t||n}));(0,a.R3)((0,i.a4)(e,n.id,{membersCount:d.length,fullInfo:{...t.fullInfo,members:d,adminMembers:s}}))}break}case"deleteProfilePhotos":{const{chatId:t,ids:s}=n,o=e.chats.byId[t];null!=o&&o.photos&&(0,a.R3)((0,i.a4)(e,t,{photos:o.photos.filter((e=>!s.includes(e.id)))}));break}case"draftMessage":{const{chatId:t,formattedText:s,date:o,replyingToId:r}=n;e.chats.byId[t]&&(e=(0,i.pf)(e,t,u._f,"draft",s),e=(0,i.pf)(e,t,u._f,"replyingToId",r),e=(0,i.a4)(e,t,{draftDate:o}),(0,a.R3)(e));break}case"showInvite":{const{data:e}=n;t.showDialog({data:e});break}case"updatePendingJoinRequests":{const{chatId:s,requestsPending:o,recentRequesterIds:r}=n,c=e.chats.byId[s];c&&(e=(0,i.a4)(e,s,{fullInfo:{...c.fullInfo,requestsPending:o,recentRequesterIds:r}}),(0,a.R3)(e),t.loadChatJoinRequests({chatId:s}))}}}));var se=n(3995);const oe=350;function ie(e,t,n,a){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const o=s?(0,r.Tm)(e,t,n):(0,r.hj)(e,t,n);if(o&&a.content){const{photo:e,video:t,sticker:n,document:s}=(0,l.qp)(o);e&&a.content.photo?(a.content.photo.blobUrl=e.blobUrl,a.content.photo.thumbnail=e.thumbnail):t&&a.content.video?a.content.video.blobUrl=t.blobUrl:n&&a.content.sticker?a.content.sticker.isPreloadedGlobally=n.isPreloadedGlobally:s&&a.content.document&&(a.content.document.previewBlobUrl=s.previewBlobUrl)}return s?(0,i.P4)(e,t,n,a):(0,i.cY)(e,t,n,a)}function re(e,t,n,a){const{chatId:s}=n,{threadInfo:o}=(0,r.Db)(e,s,n)||{};if(!o&&n.replyToMessageId){const o=(0,r.hj)(e,s,n.replyToMessageId);o?e=(0,i.lG)(e,o,s,n.id,a):t.loadMessage({chatId:s,messageId:n.replyToMessageId,threadUpdate:{isDeleting:a,lastMessageId:n.id}})}return e}function ce(e,t,n){const{id:a,chatId:s}=n,{threadInfo:o,firstMessageId:c}=(0,r.Db)(e,s,n)||{},d=(0,r.Z1)(e,s),m=(null==d?void 0:d.unreadCount)&&!(0,r.gb)(e,s,u._f);if(e=re(e,t,n),o&&(!c&&(0,l.CI)(n)||(e=(0,i.xj)(e,s,o.threadId,[a]),(0,r.b9)(e,s,o.threadId)&&(e=(0,i.$S)(e,s,o.threadId,a),c||(e=(0,i.pf)(e,s,o.threadId,"firstMessageId",n.id)))),e=(0,i.pf)(e,s,o.threadId,"threadInfo",{...o,lastMessageId:n.id,messagesCount:o.messagesCount+1})),m)return e;if(e=(0,i.xj)(e,s,u._f,[a]),(0,r.b9)(e,s,u._f)){const t=(0,r.It)(e,s,u._f),n=(0,i.$S)(e,s,u._f,a),o=(0,r.Cb)(n,s,u._f);t&&!o.includes(t)||(e=n)}return e}function le(e,t,n){var a;let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{chats:o}=e,r=null===(a=o.byId[t])||void 0===a?void 0:a.lastMessage;return!r||s||r.id===n.id||r.id===n.previousLocalId||n.id>r.id?(0,i.a4)(e,t,{lastMessage:n}):e}function de(e,t){const n=(0,r.Zw)(e,t),a=(0,r.gb)(e,t,u._f);if(!n||!a)return;let s=a.length;for(;s--;){const e=n[a[s]];if(!e.isDeleting)return e}}function ue(e,t,n,s){if(e){t.forEach((t=>{const n=de(s=(0,i.cY)(s,e,t,{isDeleting:!0}),e);n&&(s=le(s,e,n,!0))})),(0,a.R3)(s),n.requestChatUpdate({chatId:e});const o=[];return t.forEach((t=>{const a=(0,r.hj)(s,e,t);if(!a)return;s=re(s,n,a,!0);const{threadInfo:i}=(0,r.Db)(s,e,a)||{};i&&o.push(i.threadId)})),(0,a.R3)(s),void setTimeout((()=>{(0,a.R3)((0,i.K4)((0,a.Rd)(),e,t)),(0,g.Tw)(o).forEach((t=>{n.requestThreadInfoUpdate({chatId:e,threadId:t})}))}),oe)}const o=[];t.forEach((e=>{const t=(0,r.X5)(s,e);if(t){o.push(t);const n=de(s=(0,i.cY)(s,t,e,{isDeleting:!0}),t);n&&(s=le(s,t,n,!0)),setTimeout((()=>{(0,a.R3)((0,i.K4)((0,a.Rd)(),t,[e]))}),oe)}})),(0,a.R3)(s),(0,g.Tw)(o).forEach((e=>{n.requestChatUpdate({chatId:e})}))}(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"newMessage":{const{chatId:o,id:c,message:d,shouldForceReply:m}=n;e=ce(e=ie(e,o,c,d),t,d),d.threadInfo&&(e=(0,i.Xg)(e,d.threadInfo.chatId,d.threadInfo.threadId,d.threadInfo)),(0,a.R3)(e);const h=(0,r.hj)(e,o,c);if((0,r.hg)(e,o,d)){var s;if(d.isOutgoing&&(null===(s=d.content)||void 0===s||!s.action)){const n=(0,r.Bt)(e);n&&t.focusMessage({chatId:o,threadId:n.threadId,messageId:d.id,noHighlight:!0,isResizingContainer:!0})}const{threadInfo:n}=(0,r.Db)(e,o,d)||{};n&&t.requestThreadInfoUpdate({chatId:o,threadId:n.threadId}),(0,l.CI)(d)||setTimeout((()=>{let e=(0,a.Rd)();m&&(e=(0,i.pf)(e,o,u._f,"replyingToId",c)),(0,a.R3)(le(e,o,h))}),oe)}else(0,a.R3)(le((0,a.Rd)(),o,h));(0,r.N)(e,o)||t.loadTopChats();break}case"updateStartEmojiInteraction":{var o;const{chatId:t}=(0,r.Bt)(e)||{};if(t!==n.id)return;const s=(0,r.hj)(e,t,n.messageId);if(!s)return;if((0,l.UD)(s)!==n.emoji)return;const i=(0,r.CP)(e,n.emoji);e={...e,activeEmojiInteractions:[...e.activeEmojiInteractions||[],{id:(null===(o=e.activeEmojiInteractions)||void 0===o?void 0:o.length)||0,animatedEffect:i?(0,r.cu)(i):n.emoji,messageId:n.messageId}]},(0,a.R3)(e);break}case"newScheduledMessage":{const{chatId:t,id:s,message:o}=n;e=ie(e,t,s,o,!0);const c=(0,r.qy)(e,t)||[];e=(0,i.pf)(e,t,u._f,"scheduledIds",(0,g.Tw)([...c,s])),(0,a.R3)(e);break}case"updateMessage":{var c,d;const{chatId:s,id:o,message:l}=n;if(!(0,r.hj)(e,s,o))return;e=ie(e,s,o,l);const m=(0,r.hj)(e,s,o);l.threadInfo&&(e=(0,i.Xg)(e,l.threadInfo.chatId,l.threadInfo.threadId,l.threadInfo)),e=le(e,s,m),(0,a.R3)(e);const h=(0,r.Z1)(e,s);h&&!l.isOutgoing&&(null===(c=h.lastMessage)||void 0===c?void 0:c.id)===l.id&&(0,r.xo)(e,h)&&(0,r.hg)(e,s,l)&&(0,r.b9)(e,s,(null===(d=l.threadInfo)||void 0===d?void 0:d.threadId)||u._f)&&t.focusLastMessage();break}case"updateScheduledMessage":{const{chatId:t,id:s,message:o}=n;if(!(0,r.Tm)(e,t,s))return;e=ie(e,t,s,o,!0);const c=Object.keys((0,r.Fn)(e,t)||{}).map(Number).sort(((e,t)=>t-e));e=(0,i.pf)(e,t,u._f,"scheduledIds",c),(0,a.R3)(e);break}case"updateMessageSendSucceeded":{const{chatId:s,localId:o,message:c}=n;e=ce(e,t,c);const l=(0,r.hj)(e,s,o);e=(0,i.K4)(e,s,[o]),c.isScheduled&&(e=(0,i.bV)(e,s,[o])),e=(0,i.cY)(e,s,c.id,{...l,...c,previousLocalId:o});const d=(0,r.hj)(e,s,c.id);e=le(e,s,d);const u=(0,r.Db)(e,s,c);null!=u&&u.threadInfo&&(t.markMessageListRead({maxId:c.id}),e=(0,i.pf)(e,s,u.threadInfo.threadId,"threadInfo",{...u.threadInfo,lastMessageId:c.id,lastReadInboxMessageId:c.id})),(0,a.R3)(e);break}case"updateScheduledMessageSendSucceeded":{const{chatId:t,localId:s,message:o}=n,c=(0,r.qy)(e,t)||[];e=(0,i.pf)(e,t,u._f,"scheduledIds",[...c,o.id]);const l=(0,r.Tm)(e,t,s);e=(0,i.bV)(e,t,[s]),e=(0,i.P4)(e,t,o.id,{...l,...o,previousLocalId:s}),(0,a.R3)(e);break}case"updatePinnedIds":{const{chatId:t,isPinned:s,messageIds:o}=n,c=(0,r.KB)(e,t)||[],l=s?[...c,...o].sort(((e,t)=>t-e)):c.filter((e=>!o.includes(e)));(0,a.R3)((0,i.pf)(e,t,u._f,"pinnedIds",l));break}case"updateThreadInfo":{const{chatId:t,threadId:s,threadInfo:o,firstMessageId:c}=n,l={...(0,r.tZ)(e,t,s),...o};if(!l.threadId)return;e=(0,i.Xg)(e,t,s,l),c&&(e=(0,i.pf)(e,t,s,"firstMessageId",c)),(0,a.R3)(e);break}case"resetMessages":{const{id:s}=n,o=(0,r.Zw)(e,s);o&&!(0,l.YC)(s)&&(e=(0,i.K4)(e,s,Object.keys(o).map(Number)),(0,a.R3)(e),t.loadFullChat({chatId:s,force:!0}));break}case"deleteMessages":{const{ids:a,chatId:s}=n;ue(s,a,t,e);break}case"deleteScheduledMessages":{const{ids:t,chatId:s}=n;!function(e,t,n,s){e&&(t.forEach((t=>{s=(0,i.P4)(s,e,t,{isDeleting:!0})})),(0,a.R3)(s),setTimeout((()=>{s=(0,i.bV)((0,a.Rd)(),e,t);const n=(0,r.Fn)(s,e);s=(0,i.pf)(s,e,u._f,"scheduledIds",Object.keys(n||{}).map(Number)),(0,a.R3)(s)}),oe))}(s,t,0,e);break}case"deleteHistory":{const{chatId:a}=n,s=e.messages.byChatId[a];s?ue(a,Object.keys(s.byId).map(Number),t,e):t.requestChatUpdate({chatId:a});break}case"updateCommonBoxMessages":{const{ids:t,messageUpdate:s}=n;t.forEach((t=>{const n=(0,r.X5)(e,t);n&&(e=(0,i.cY)(e,n,t,s))})),(0,a.R3)(e);break}case"updateChannelMessages":{const{channelId:t,ids:s,messageUpdate:o}=n;s.forEach((n=>{e=(0,i.cY)(e,t,n,o)})),(0,a.R3)(e);break}case"updateMessagePoll":{const{pollId:t,pollUpdate:s}=n,o=(0,r.ZB)(e,t);if(null!=o&&o.content.poll){const t={...o.content.poll,...s},{results:n}=t.results||{};if(n&&!n.some((e=>e.isChosen))){const{results:e}=o.content.poll.results,a=e&&e.filter((e=>e.isChosen));a&&a.forEach((e=>{const a=n.findIndex((t=>t.option===e.option));a>=0&&(t.results.results[a].isChosen=!0)}))}(0,a.R3)((0,i.cY)(e,o.chatId,o.id,{content:{...o.content,poll:t}}))}break}case"updateMessagePollVote":{const{pollId:t,userId:s,options:o}=n,c=(0,r.ZB)(e,t);if(!c||!c.content.poll||!c.content.poll.results)break;const{poll:l}=c.content,{recentVoterIds:d,totalVoters:u,results:m}=l.results,h=d?[...d]:[],g=u?u+1:1,p=m?[...m]:[];h.push(s),o.forEach((t=>{const n=p.find((e=>e.option===t)),a=p.findIndex((e=>e.option===t)),o=n?{...n}:{option:t,votersCount:0};o.votersCount+=1,s===e.currentUserId&&(o.isChosen=!0),a?p[a]=o:p.push(o)})),(0,a.R3)((0,i.cY)(e,c.chatId,c.id,{content:{...c.content,poll:{...l,results:{...l.results,recentVoterIds:h,totalVoters:g,results:p}}}}));break}case"updateServiceNotification":{const{message:a}=n;(0,r.UW)(e)&&t.createServiceNotification({message:a});break}case"updateMessageReactions":{const{chatId:t,id:s,reactions:o}=n,c=(0,r.hj)(e,t,s),l=(0,r.Z1)(e,n.chatId),d=null==c?void 0:c.reactions;if(d&&ae(o,d))return;const u=(0,se.l)(d,o);if(e=(0,i.cY)(e,t,s,{reactions:n.reactions}),u){const n=(0,r.hj)(e,t,s);if(!l||!n)return;(0,ne.rh)({chat:l,message:n})}(0,a.R3)(e);break}}}));const me=(0,M.P2)((function(){const e=(0,a.Rd)();(0,a.R3)((0,i.ps)(e,{...e.users.statusesById,...he})),he={}}),3e3,!0);let he={};(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"deleteContact":return(0,i.GK)(e,n.id);case"updateUser":return(0,i.Nq)(e,n.id,n.user);case"updateUserStatus":return a=n.userId,s=n.status,he[a]=s,void me();case"updateUserFullInfo":{const{id:t,fullInfo:a}=n,s=e.users.byId[t];if(!s)return;return(0,i.Nq)(e,t,{fullInfo:{...s.fullInfo,...a}})}}var a,s})),(0,a.Q6)("apiUpdate",((e,t,n)=>{if("updateStickerSet"===n["@type"])return(0,i.Rg)(e,n.id,n.stickerSet)})),(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"updatePeerBlocked":return n.isBlocked?(0,i.O4)((0,a.Rd)(),n.id):(0,i.rB)((0,a.Rd)(),n.id);case"updateResetContactList":(0,a.R3)({...(0,a.Rd)(),contactList:{userIds:[]}});break;case"updateFavoriteStickers":t.loadFavoriteStickers();break;case"updatePrivacy":e.settings.privacy[n.key]=n.rules;break;case"updatePaymentVerificationNeeded":e=(0,i.fS)((0,a.Rd)(),n.url),e=(0,i.Q$)(e,m.KB.ConfirmPayment),(0,a.R3)(e)}})),(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"updateNotifySettings":return(0,i.HN)(e,n.peerType,n.isSilent,n.shouldShowPreviews);case"updateNotifyExceptions":{const{chatId:t,isMuted:s,isSilent:o,shouldShowPreviews:r}=n;e.chats.byId[t]&&(e=(0,i.a4)(e,t,{isMuted:s})),(0,a.R3)((0,i.aK)(e,t,{isMuted:s,isSilent:o,shouldShowPreviews:r}));break}}})),(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"updateTwoFaStateWaitCode":return{...e,twoFaSettings:{...e.twoFaSettings,isLoading:!1,waitingEmailCodeLength:n.length}};case"updateTwoFaError":return{...e,twoFaSettings:{...e.twoFaSettings,error:n.message}}}}));var ge=n(4446);(0,a.Q6)("apiUpdate",((e,t,n)=>{switch(n["@type"]){case"updateGroupCall":return"discarded"===n.call.connectionState?e.groupCalls.activeGroupCallId?void t.leaveGroupCall({shouldRemove:!0}):(0,ge.dc)(e,n.call.id):(0,ge.AH)(e,n.call.id,(0,g.CE)(n.call,["connectionState"]),void 0,n.call.participantsCount);case"updateGroupCallChatId":{const t=(0,r.Z1)(e,n.chatId);return t&&(e=(0,i.a4)(e,n.chatId,{fullInfo:{...t.fullInfo,groupCallId:n.call.id}})),e}case"updateGroupCallParticipants":{const{groupCallId:t,participants:s,nextOffset:o}=n,{currentUserId:i}=e;return e=(0,a.Rd)(),s.forEach((n=>{n.id&&(e=(0,ge.B6)(e,t,n.id,n,Boolean(o)||i===n.id))})),o&&(e=(0,ge.AH)(e,t,{nextOffset:o})),e}}})),(0,a.Q6)("apiUpdate",((e,t,n)=>{if("updatePaymentStateCompleted"===n["@type"])return(0,i.bp)(e)}));var pe=n(8674),fe=n(6752),ve=n(1279),Ie=n(3551),ye=n(3227),Ze=n(1212),Pe=n(5332);function Ce(e){(0,o.d4)((()=>(0,M.Gq)(e)),[e])}var we=n(9290);const be=document.querySelector('meta[name="viewport"]'),Ee=(null==be?void 0:be.getAttribute("content"))||"",Me="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover";function Se(e){e.preventDefault()}var Re=n(6590),ke=n(4851),Te=n(2155),Ne=n(5616),Be=n(7358);const xe=(0,o.X$)((e=>{let{isForAppBadge:t}=e;(0,Ne.yi)();const n=(0,$.xW)();if((0,o.d4)((()=>{t&&(0,Be.w)(n)}),[t,n]),!t&&n)return o.ZP.createElement("div",{className:"unread-count active"},(0,Te.bi)(n))}));var Ae=n(3989),Le=n(7529),Oe=n(3455),Ue=n(706),Fe=n(2255),$e=n(9107),De=n(7370),je=n(7926),Qe=n(1622);let qe;function Ge(e,t,n,a,s,i){let r,c,l;return r=function(){const[e,t]=(0,o.eJ)(window.navigator.onLine);return(0,o.d4)((()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}}),[]),e}()&&"connectionStateConnecting"!==t?n?qe.syncing:qe.online:qe.waitingForNetwork,c=r===qe.online||i?"none":a?"middleHeader":s?"minimized":"overlay",r===qe.waitingForNetwork?l=e("WaitingForNetwork"):r===qe.syncing&&(l=e("Updating")),"middleHeader"===c&&(l=l.toLowerCase().replace(/\.+$/,"")),{connectionStatus:r,connectionStatusPosition:c,connectionStatusText:l}}!function(e){e[e.waitingForNetwork=0]="waitingForNetwork",e[e.syncing=1]="syncing",e[e.online=2]="online"}(qe||(qe={}));var He=n(3106),_e=n(8964),ze=n(231),Ve=n(9589),Xe=n(9187),Ke=n(3321),We=n(126),Ye=n(9204);const Je=(0,o.X$)((e=>{let{connectionStatus:t,connectionStatusText:n,onClick:a}=e;const s=(0,$e.Z)();return o.ZP.createElement("div",{id:"ConnectionStatusOverlay",dir:s.isRtl?"rtl":void 0,onClick:a},o.ZP.createElement(Ye.Z,{color:"black"}),o.ZP.createElement("div",{className:"state-text"},o.ZP.createElement(Fe.Z,{activeKey:t,name:"slide-fade"},n)),o.ZP.createElement(ze.Z,{round:!0,size:"tiny",color:"translucent-black"},o.ZP.createElement("span",{className:"icon-close"})))})),et=[0,1,2],tt=(0,o.X$)((0,a.c$)((e=>{const{query:t,fetchingStatus:n,chatId:a,date:s}=e.globalSearch,{currentUserId:o,connectionState:i,isSyncing:c}=e,{byId:l}=e.chats,{isConnectionStatusMinimized:d,animationLevel:u}=e.settings.byKey;return{searchQuery:t,isLoading:!!n&&Boolean(n.chats||n.messages),currentUserId:o,chatsById:l,globalSearchChatId:a,searchDate:s,theme:(0,r.Pu)(e),animationLevel:u,connectionState:i,isSyncing:c,isMessageListOpen:Boolean((0,r.Bt)(e)),isConnectionStatusMinimized:d,areChatsLoaded:Boolean(e.chats.listIds.active)}}))((e=>{let{content:t,contactsFilter:n,onSearchQuery:i,onSelectSettings:r,onSelectContacts:c,onSelectArchived:d,onReset:u,searchQuery:g,isLoading:p,shouldSkipTransition:f,currentUserId:v,globalSearchChatId:I,searchDate:y,theme:Z,animationLevel:P,chatsById:C,connectionState:w,isSyncing:b,isMessageListOpen:E,isConnectionStatusMinimized:M,areChatsLoaded:S}=e;const{openChat:R,openTipsChat:k,setGlobalSearchDate:T,setSettingOption:N,setGlobalSearchChatId:B}=(0,a.uC)(),x=(0,$e.Z)(),A=t===m.du.ChatList,O=(0,o.Ye)((()=>y?(0,L.xH)(new Date(1e3*y)):void 0),[y]),U=(0,o.Ye)((()=>A&&C?Object.values(C).reduce(((e,t)=>(0,l.pE)(t)&&t.unreadCount?e+1:e),0):0),[A,C]),{connectionStatus:F,connectionStatusText:$,connectionStatusPosition:D}=Ge(x,w,b,E,M,!S),j="web.telegram.org"===window.location.hostname,Q=(0,o.Ye)((()=>e=>{let{onTrigger:t,isOpen:n}=e;return o.ZP.createElement(ze.Z,{round:!0,ripple:A&&!h.wB,size:"smaller",color:"translucent",className:n?"active":"",onClick:A?t:()=>u(),ariaLabel:A?x("AccDescrOpenMenu2"):"Return to chat list"},o.ZP.createElement("div",{className:(0,fe.Z)("animated-menu-icon",!A&&"state-back",f&&"no-animation")}))}),[A,x,u,f]),q=(0,o.I4)((()=>{g||i("")}),[g,i]),G=(0,o.I4)((()=>{N({isConnectionStatusMinimized:!M})}),[M,N]),H=(0,o.I4)((()=>{R({id:v,shouldReplaceHistory:!0})}),[v,R]),_=(0,o.I4)((e=>{e.stopPropagation();const t="light"===Z?"dark":"light";N({theme:t}),N({shouldUseSystemTheme:!1}),(0,De.Z)(t,P===s.zy)}),[P,N,Z]),z=(0,o.I4)((e=>{e.stopPropagation();const t=0===P?2:0;et.forEach(((e,n)=>{document.body.classList.toggle(`animation-level-${n}`,t===n)})),N({animationLevel:t})}),[P,N]),V=Boolean(I)||t===m.du.GlobalSearch||t===m.du.Contacts,X=t===m.du.Contacts?x("SearchFriends"):x("Search");return o.ZP.createElement("div",{className:"LeftMainHeader"},o.ZP.createElement("div",{id:"LeftMainHeader",className:"left-header"},o.ZP.createElement(He.Z,{trigger:Q,footer:`${s.iC} ${s.eM?"master":s.Ji}`},o.ZP.createElement(_e.Z,{icon:"saved-messages",onClick:H},x("SavedMessages")),o.ZP.createElement(_e.Z,{icon:"archive",onClick:d},o.ZP.createElement("span",{className:"menu-item-name"},x("ArchivedChats")),U>0&&o.ZP.createElement("div",{className:"archived-badge"},U)),o.ZP.createElement(_e.Z,{icon:"user",onClick:c},x("Contacts")),o.ZP.createElement(_e.Z,{icon:"settings",onClick:r},x("Settings")),o.ZP.createElement(_e.Z,{icon:"darkmode",onClick:_},o.ZP.createElement("span",{className:"menu-item-name"},x("lng_menu_night_mode")),o.ZP.createElement(Ke.Z,{id:"darkmode",label:x("dark"===Z?"lng_settings_disable_night_theme":"lng_settings_enable_night_theme"),checked:"dark"===Z,noAnimation:!0})),o.ZP.createElement(_e.Z,{icon:"animations",onClick:z},o.ZP.createElement("span",{className:"menu-item-name capitalize"},x("Appearance.Animations").toLowerCase()),o.ZP.createElement(Ke.Z,{id:"animations",label:"Toggle Animations",checked:P>0})),o.ZP.createElement(_e.Z,{icon:"help",onClick:()=>{k({langCode:x.code})}},x("TelegramFeatures")),o.ZP.createElement(_e.Z,{icon:"bug",href:s.mU},"Report Bug"),j&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(_e.Z,{icon:"char-K",href:"https://web.telegram.org/k/",onClick:()=>{(0,je.L)("K"),(0,Qe.W8)(),(0,Re.Wv)()}},"Switch to K Version"),o.ZP.createElement(_e.Z,{icon:"char-W",href:"https://web.telegram.org/?legacy=1",onClick:Re.Wv},"Switch to Old Version"))),o.ZP.createElement(Ve.Z,{inputId:"telegram-search-input",parentContainerClassName:"LeftSearch",className:I||y?"with-picker-item":"",value:n||g,focused:V,isLoading:p||"minimized"===D,spinnerColor:"minimized"===D?"yellow":void 0,spinnerBackgroundColor:"minimized"===D&&"light"===Z?"light":void 0,placeholder:X,autoComplete:"off",canClose:Boolean(I||y),onChange:i,onReset:u,onFocus:q,onSpinnerClick:"minimized"===D?G:void 0},O&&o.ZP.createElement(Xe.Z,{icon:"calendar",title:O,canClose:!0,isMinimized:Boolean(I),className:"search-date",onClick:T,clickArg:{date:void 0}}),I&&o.ZP.createElement(Xe.Z,{chatOrUserId:I,onClick:B,canClose:!0,clickArg:{id:void 0}})),o.ZP.createElement(We.Z,{isOpen:"overlay"===D,isCustom:!0,className:"connection-state-wrapper"},o.ZP.createElement(Je,{connectionStatus:F,connectionStatusText:$,onClick:G}))))})));var nt=n(1174),at=n(3133),st=n(1080);const ot=(0,o.X$)((0,a.c$)((e=>{const{chatFolders:{byId:t,orderedIds:n,activeChatFolder:a},currentUserId:s,lastSyncTime:o,shouldSkipHistoryAnimations:i}=e;return{chatFoldersById:t,orderedFolderIds:n,activeChatFolder:a,currentUserId:s,lastSyncTime:o,shouldSkipHistoryAnimations:i}}))((e=>{let{foldersDispatch:t,onScreenSelect:n,chatFoldersById:i,orderedFolderIds:r,activeChatFolder:c,currentUserId:l,lastSyncTime:d,shouldSkipHistoryAnimations:u}=e;const{loadChatFolders:m,setActiveChatFolder:g,openChat:p}=(0,a.uC)(),f=(0,o.sO)(null),v=(0,$e.Z)();(0,o.d4)((()=>{d&&m()}),[d,m]);const I=(0,o.Ye)((()=>r?r.map((e=>i[e]||{})).filter(Boolean):void 0),[i,r]),y=(0,Ne.yi)(),Z=(0,o.Ye)((()=>{if(I&&I.length)return[{id:s.Nf,title:"en"===v.code?"All":v("FilterAllChats")},...I.map((e=>{var t,n;let{id:a,title:s}=e;return{id:a,title:s,badgeCount:null===(t=y[a])||void 0===t?void 0:t.chatsCount,isBadgeActive:Boolean(null===(n=y[a])||void 0===n?void 0:n.notificationsCount)}}))]}),[I,y,v]),P=(0,o.I4)((e=>{g(e,{forceOnHeavyAnimation:!0})}),[g]);(0,o.d4)((()=>{Z&&Z.length&&c>=Z.length&&g(0)}),[c,Z,g]),(0,o.d4)((()=>{if(f.current&&h.$b&&Z&&Z.length)return(0,nt.sf)(f.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===nt.eM.Left?(g(Math.min(c+1,Z.length-1),{forceOnHeavyAnimation:!0}),!0):t===nt.eM.Right&&(g(Math.max(0,c-1),{forceOnHeavyAnimation:!0}),!0)})}),[c,Z,g]);const C=(0,o.sO)();C.current=0!==c,(0,o.d4)((()=>C.current?(0,Ae.Z)((()=>{C.current&&g(0)})):void 0),[c,g]),(0,Re.ZP)(0!==c,(()=>g(0,{forceOnHeavyAnimation:!0}))),(0,o.d4)((()=>{const e=e=>{if(e.ctrlKey&&e.shiftKey&&e.code.startsWith("Digit")&&Z){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;if("0"===t)return void p({id:l,shouldReplaceHistory:!0});const n=Number(t)-1;if(n>Z.length-1)return;g(n,{forceOnHeavyAnimation:!0}),e.preventDefault()}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}));const{shouldRender:w,transitionClassNames:b}=(0,Ze.Z)(!r,void 0,!0);function E(e){const a=Object.values(i).find((e=>{let{id:t}=e;return t===Z[c].id}));return a&&0!==c?o.ZP.createElement(st.Z,{folderType:"folder",folderId:a.id,isActive:e,lastSyncTime:d,onScreenSelect:n,foldersDispatch:t}):o.ZP.createElement(st.Z,{folderType:"all",isActive:e,lastSyncTime:d,foldersDispatch:t,onScreenSelect:n})}return o.ZP.createElement("div",{className:"ChatFolders"},null!=Z&&Z.length?o.ZP.createElement(at.Z,{tabs:Z,activeTab:c,onSwitchTab:P}):w?o.ZP.createElement("div",{className:(0,fe.Z)("tabs-placeholder",b)}):void 0,o.ZP.createElement(Fe.Z,{ref:f,name:u?"none":v.isRtl?"slide-optimized-rtl":"slide-optimized",activeKey:c,renderCount:Z?Z.length:void 0},E))})));var it=n(9203),rt=n(8778),ct=n(4288);const lt=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"LeftSearch");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)})),dt=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"ContactList");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)}));var ut=n(2328);const mt=(0,o.X$)((e=>{let{isShown:t,onNewPrivateChat:n,onNewChannel:a,onNewGroup:s}=e;const[i,r]=(0,o.eJ)(!1);(0,o.d4)((()=>{t||r(!1)}),[t]);const c=(0,$e.Z)(),l=(0,fe.Z)("NewChatButton",t&&"revealed",i&&"menu-is-open");return o.ZP.createElement("div",{className:l},o.ZP.createElement(ze.Z,{round:!0,color:"primary",className:i?"active":"",onClick:()=>{r(!i)},ariaLabel:c(i?"Close":"NewMessageTitle"),tabIndex:-1},o.ZP.createElement("i",{className:"icon-new-chat-filled"}),o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(ut.Z,{isOpen:i,positionX:"right",positionY:"bottom",autoClose:!0,onClose:()=>{r(!1)}},o.ZP.createElement(_e.Z,{icon:"channel",onClick:a},c("NewChannel")),o.ZP.createElement(_e.Z,{icon:"group",onClick:s},c("NewGroup")),o.ZP.createElement(_e.Z,{icon:"user",onClick:n},c("NewMessageTitle"))))})),ht=Object.keys(m.du).length/2;let gt;const pt=(0,o.X$)((e=>{let{content:t,searchQuery:n,searchDate:a,contactsFilter:s,shouldSkipTransition:i,foldersDispatch:r,onSearchQuery:c,onContentChange:l,onScreenSelect:d,onReset:u}=e;const[g,p]=(0,o.eJ)(h.$b),f=(0,o.sO)(!1),v=(0,o.I4)((()=>{l(m.du.Settings)}),[l]),I=(0,o.I4)((()=>{l(m.du.Contacts)}),[l]),y=(0,o.I4)((()=>{l(m.du.NewChannelStep1)}),[l]),Z=(0,o.I4)((()=>{l(m.du.NewGroupStep1)}),[l]),P=(0,o.I4)((()=>{l(m.du.Archived)}),[l]),C=(0,o.I4)((()=>{t===m.du.ChatList&&(f.current=!0,p(!0))}),[t]),w=(0,o.I4)((()=>{f.current=!1,gt&&(clearTimeout(gt),gt=void 0),gt=window.setTimeout((()=>{f.current||p(!1)}),250)}),[]);(0,o.d4)((()=>{let e;return t!==m.du.ChatList?e=window.setTimeout((()=>{p(!1)}),250):(f.current||h.$b)&&p(!0),()=>{e&&(clearTimeout(e),e=void 0)}}),[t]);const[b,E,M]=function(){const[e,t]=(0,Ue.Z)(!1);(0,o.d4)((()=>{const e=window.setTimeout(t,2592e5);return()=>{clearTimeout(e)}}),[t]);const{shouldRender:n,transitionClassNames:a}=(0,Ze.Z)(e);return[n,a,()=>{window.location.reload()}]}(),S=(0,$e.Z)();return o.ZP.createElement("div",{id:"LeftColumn-main",onMouseEnter:h.$b?void 0:C,onMouseLeave:h.$b?void 0:w},o.ZP.createElement(tt,{content:t,contactsFilter:s,onSearchQuery:c,onSelectSettings:v,onSelectContacts:I,onSelectArchived:P,onReset:u,shouldSkipTransition:i}),o.ZP.createElement(Fe.Z,{name:i?"none":"zoom-fade",renderCount:ht,activeKey:t,shouldCleanup:!0,cleanupExceptionKey:m.du.ChatList},(e=>{switch(t){case m.du.ChatList:return o.ZP.createElement(ot,{onScreenSelect:d,foldersDispatch:r});case m.du.GlobalSearch:return o.ZP.createElement(lt,{searchQuery:n,searchDate:a,isActive:e,onReset:u});case m.du.Contacts:return o.ZP.createElement(dt,{filter:s,isActive:e,onReset:u});default:return}})),b&&o.ZP.createElement(ze.Z,{fluid:!0,pill:!0,className:(0,fe.Z)("btn-update",E),onClick:M},S("lng_update_telegram")),o.ZP.createElement(mt,{isShown:g,onNewPrivateChat:I,onNewChannel:y,onNewGroup:Z}))})),ft=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"Settings");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)})),vt=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"NewChat");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)})),It=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"ArchivedChats");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)}));var yt;!function(e){e[e.Main=0]="Main",e[e.Settings=1]="Settings",e[e.Archived=2]="Archived",e[e.NewGroup=3]="NewGroup",e[e.NewChannel=4]="NewChannel"}(yt||(yt={}));const Zt=Object.keys(yt).length/2,Pt=(0,o.X$)((0,a.c$)((e=>{const{globalSearch:{query:t,date:n},chatFolders:{activeChatFolder:a},shouldSkipHistoryAnimations:s,leftColumnWidth:o}=e;return{searchQuery:t,searchDate:n,activeChatFolder:a,shouldSkipHistoryAnimations:s,leftColumnWidth:o}}))((e=>{let{searchQuery:t,searchDate:n,activeChatFolder:s,shouldSkipHistoryAnimations:i,leftColumnWidth:r}=e;const{setGlobalSearchQuery:c,setGlobalSearchChatId:l,resetChatCreation:d,setGlobalSearchDate:u,loadPasswordInfo:g,clearTwoFaError:p,setLeftColumnWidth:f,resetLeftColumnWidth:v}=(0,a.uC)(),I=(0,o.sO)(null),[y,Z]=(0,o.eJ)(m.du.ChatList),[P,C]=(0,o.eJ)(m.MT.Main),[w,b]=(0,o.eJ)(""),[E,M]=(0,Oe.ZP)(),[S,R]=(0,o.eJ)(0);let k=yt.Main;switch(y){case m.du.Archived:k=yt.Archived;break;case m.du.Settings:k=yt.Settings;break;case m.du.NewChannelStep1:case m.du.NewChannelStep2:k=yt.NewChannel;break;case m.du.NewGroupStep1:case m.du.NewGroupStep2:k=yt.NewGroup}const T=(0,o.I4)((e=>{if(y!==m.du.NewGroupStep2||e)if(y!==m.du.NewChannelStep2||e){if(y===m.du.NewGroupStep1){const e=document.getElementById("new-group-picker-search");e&&e.blur()}if(y===m.du.Settings)switch(P){case m.MT.EditProfile:case m.MT.Folders:case m.MT.General:case m.MT.Notifications:case m.MT.DataStorage:case m.MT.Privacy:case m.MT.Language:return void C(m.MT.Main);case m.MT.GeneralChatBackground:case m.MT.QuickReaction:return void C(m.MT.General);case m.MT.GeneralChatBackgroundColor:return void C(m.MT.GeneralChatBackground);case m.MT.PrivacyPhoneNumber:case m.MT.PrivacyLastSeen:case m.MT.PrivacyProfilePhoto:case m.MT.PrivacyForwarding:case m.MT.PrivacyGroupChats:case m.MT.PrivacyActiveSessions:case m.MT.PrivacyBlockedUsers:case m.MT.TwoFaDisabled:case m.MT.TwoFaEnabled:case m.MT.TwoFaCongratulations:return void C(m.MT.Privacy);case m.MT.PrivacyPhoneNumberAllowedContacts:case m.MT.PrivacyPhoneNumberDeniedContacts:return void C(m.MT.PrivacyPhoneNumber);case m.MT.PrivacyLastSeenAllowedContacts:case m.MT.PrivacyLastSeenDeniedContacts:return void C(m.MT.PrivacyLastSeen);case m.MT.PrivacyProfilePhotoAllowedContacts:case m.MT.PrivacyProfilePhotoDeniedContacts:return void C(m.MT.PrivacyProfilePhoto);case m.MT.PrivacyForwardingAllowedContacts:case m.MT.PrivacyForwardingDeniedContacts:return void C(m.MT.PrivacyForwarding);case m.MT.PrivacyGroupChatsAllowedContacts:case m.MT.PrivacyGroupChatsDeniedContacts:return void C(m.MT.PrivacyGroupChats);case m.MT.TwoFaNewPassword:return void C(m.MT.TwoFaDisabled);case m.MT.TwoFaNewPasswordConfirm:return void C(m.MT.TwoFaNewPassword);case m.MT.TwoFaNewPasswordHint:return void C(m.MT.TwoFaNewPasswordConfirm);case m.MT.TwoFaNewPasswordEmail:return void C(m.MT.TwoFaNewPasswordHint);case m.MT.TwoFaNewPasswordEmailCode:return void C(m.MT.TwoFaNewPasswordEmail);case m.MT.TwoFaChangePasswordCurrent:case m.MT.TwoFaTurnOff:case m.MT.TwoFaRecoveryEmailCurrentPassword:return void C(m.MT.TwoFaEnabled);case m.MT.TwoFaChangePasswordNew:return void C(m.MT.TwoFaChangePasswordCurrent);case m.MT.TwoFaChangePasswordConfirm:return void C(m.MT.TwoFaChangePasswordNew);case m.MT.TwoFaChangePasswordHint:return void C(m.MT.TwoFaChangePasswordConfirm);case m.MT.TwoFaRecoveryEmail:return void C(m.MT.TwoFaRecoveryEmailCurrentPassword);case m.MT.TwoFaRecoveryEmailCode:return void C(m.MT.TwoFaRecoveryEmail);case m.MT.FoldersCreateFolder:case m.MT.FoldersEditFolder:return void C(m.MT.Folders);case m.MT.FoldersIncludedChatsFromChatList:case m.MT.FoldersExcludedChatsFromChatList:return void C(m.MT.FoldersEditFolderFromChatList);case m.MT.FoldersEditFolderFromChatList:return Z(m.du.ChatList),void C(m.MT.Main)}y!==m.du.ChatList||0!==s?(Z(m.du.ChatList),b(""),c({query:""}),u({date:void 0}),l({id:void 0}),d(),setTimeout((()=>{R(Date.now())}),250)):Z(m.du.GlobalSearch)}else Z(m.du.NewChannelStep1);else Z(m.du.NewGroupStep1)}),[y,s,P,c,u,l,d]),N=(0,o.I4)((e=>{y!==m.du.Contacts?(Z(m.du.GlobalSearch),e!==t&&c({query:e})):b(e)}),[y,t,c]);(0,o.d4)((()=>y!==m.du.ChatList||0===s?(0,Ae.Z)((()=>T())):void 0),[s,y,T]),(0,o.d4)((()=>{if(y!==m.du.GlobalSearch)return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)};function e(e){(h.jm&&e.metaKey||!h.jm&&e.ctrlKey)&&e.shiftKey&&"f"===(0,Le.Z)(e)&&(e.preventDefault(),Z(m.du.GlobalSearch))}}),[y]),(0,o.d4)((()=>{p(),P===m.MT.Privacy&&g()}),[p,g,P]);const{initResize:B,resetResize:x,handleMouseUp:A}=((e,t,n,a)=>{const[s,i,r]=(0,Ue.Z)(),[c,l]=(0,o.eJ)(),[d,u]=(0,o.eJ)();function m(){document.body.classList.remove("no-selection","cursor-ew-resize")}return(0,o.d4)((()=>{e.current&&a&&(e.current.style.width=`${a}px`)}),[e,a]),(0,o.d4)((()=>{if(!s)return;const n=t=>{const n=Math.ceil(d+t.clientX-c);e.current.style.width=`${n}px`};function a(){o(),t(e.current.offsetWidth)}function o(){m(),document.removeEventListener("mousemove",n,!1),document.removeEventListener("mouseup",a,!1),document.removeEventListener("blur",a,!1),r()}return document.addEventListener("mousemove",n,!1),document.addEventListener("mouseup",a,!1),document.addEventListener("blur",a,!1),o}),[d,c,e,t,s,r]),{initResize:function(t){document.body.classList.add("no-selection","cursor-ew-resize"),l(t.clientX),u(e.current.offsetWidth),i()},resetResize:function(t){t.preventDefault(),e.current.style.width="",n()},handleMouseUp:m}})(I,f,v,r),L=e=>{Z(m.du.Settings),C(e)};return o.ZP.createElement("div",{id:"LeftColumn",ref:I},o.ZP.createElement(Fe.Z,{name:i?"none":h.s0,renderCount:Zt,activeKey:k,shouldCleanup:!0,cleanupExceptionKey:yt.Main},(e=>{switch(k){case yt.Archived:return o.ZP.createElement(It,{isActive:e,onReset:T,onContentChange:Z});case yt.Settings:return o.ZP.createElement(ft,{isActive:e,currentScreen:P,foldersState:E,foldersDispatch:M,onScreenSelect:L,onReset:T,shouldSkipTransition:i});case yt.NewChannel:return o.ZP.createElement(vt,{key:S,isActive:e,isChannel:!0,content:y,onContentChange:Z,onReset:T});case yt.NewGroup:return o.ZP.createElement(vt,{key:S,isActive:e,content:y,onContentChange:Z,onReset:T});default:return o.ZP.createElement(pt,{content:y,searchQuery:t,searchDate:n,contactsFilter:w,foldersDispatch:M,onContentChange:Z,onSearchQuery:N,onScreenSelect:L,onReset:T,shouldSkipTransition:i})}})),o.ZP.createElement("div",{className:"resize-handle",onMouseDown:B,onMouseUp:A,onDoubleClick:x}))})));var Ct=n(2420),wt=n(5780),bt=n(9524),Et=n(1394);const Mt=()=>{const[e,t]=(0,o.eJ)(J.Z.get());return(0,o.d4)((()=>{const e=(0,M.P2)((()=>{t(J.Z.get())}),250,!1);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e};var St=n(2678),Rt=n(7204),kt=n(5326),Tt=n(3570),Nt=n(5790),Bt=n(8360),xt=n(6058),At=n(8799);const Lt=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"HeaderMenuContainer",!t);return n?o.ZP.createElement(n,e):void 0})),Ot=(0,o.X$)((0,a.c$)(((e,t)=>{var n,a;let{chatId:s,threadId:o,messageListType:i}=t;const c=(0,r.Z1)(e,s),d=Boolean(c&&(0,l.eA)(c));if(!c||c.isRestricted||(0,r.CA)(e))return{noMenu:!0};const m=(0,r.IK)(e,s),g=(0,r.FM)(e,s),p="thread"===i&&o===u._f,f="thread"===i&&o!==u._f,v=(0,r.Jf)(e),I=Boolean(m&&(0,r.s4)(e,m.id)),y=!I&&Boolean((0,r.pk)(e,s)),Z=Boolean(p&&(d||(0,l.ZV)(c))&&c.isNotJoined);return{noMenu:!1,isChannel:d,isRightColumnShown:v,canStartBot:y,canRestartBot:I,canSubscribe:Z,canSearch:p||f,canCall:h.Bi&&(0,l.YC)(c.id)&&!g&&!m,canMute:p&&!g&&!Z,canLeave:p&&!Z,canEnterVoiceChat:h.Bi&&c.isCallActive,canCreateVoiceChat:h.Bi&&!c.isCallActive&&((null===(n=c.adminRights)||void 0===n?void 0:n.manageCall)||c.isCreator&&(0,l.G9)(c)),pendingJoinRequests:null===(a=c.fullInfo)||void 0===a?void 0:a.requestsPending}}))((e=>{let{chatId:t,threadId:n,noMenu:s,isChannel:i,canStartBot:r,canRestartBot:c,canSubscribe:l,canSearch:d,canCall:u,canMute:g,canLeave:p,canEnterVoiceChat:f,canCreateVoiceChat:v,pendingJoinRequests:I,isRightColumnShown:y,canExpandActions:Z}=e;const{joinChannel:P,sendBotCommand:C,openLocalTextSearch:w,restartBot:b,openCallFallbackConfirm:E,requestNextManagementScreen:M}=(0,a.uC)(),S=(0,o.sO)(null),[R,k]=(0,o.eJ)(!1),[T,N]=(0,o.eJ)(void 0),B=(0,o.I4)((()=>{k(!0);const e=S.current.getBoundingClientRect();N({x:e.right,y:e.bottom})}),[]),x=(0,o.I4)((()=>{k(!1)}),[]),A=(0,o.I4)((()=>{N(void 0)}),[]),L=(0,o.I4)((()=>{P({chatId:t})}),[P,t]),O=(0,o.I4)((()=>{C({command:"/start"})}),[C]),U=(0,o.I4)((()=>{b({chatId:t})}),[t,b]),F=(0,o.I4)((()=>{M({screen:m.u1.JoinRequests})}),[M]),$=(0,o.I4)((()=>{w(),h.wB?document.querySelector("#MobileSearch input").focus():setTimeout((()=>{const e=document.querySelector(".RightHeader .SearchInput input");e&&e.focus()}),400)}),[w]);(0,o.d4)((()=>{if(d)return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)};function e(e){h.fl&&(h.jm&&e.metaKey||!h.jm&&e.ctrlKey)&&!e.shiftKey&&"f"===(0,Le.Z)(e)&&(e.preventDefault(),$())}}),[d,$]);const D=(0,$e.Z)();return o.ZP.createElement("div",{className:"HeaderActions"},!h.wB&&o.ZP.createElement(o.ZP.Fragment,null,Z&&l&&o.ZP.createElement(ze.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:L},D(i?"ProfileJoinChannel":"ProfileJoinGroup")),Z&&r&&o.ZP.createElement(ze.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:O},D("BotStart")),Z&&c&&o.ZP.createElement(ze.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:U},D("BotRestart")),d&&o.ZP.createElement(ze.Z,{round:!0,ripple:y,color:"translucent",size:"smaller",onClick:$,ariaLabel:"Search in this chat"},o.ZP.createElement("i",{className:"icon-search"})),u&&o.ZP.createElement(ze.Z,{round:!0,color:"translucent",size:"smaller",onClick:E,ariaLabel:"Call"},o.ZP.createElement("i",{className:"icon-phone"}))),Boolean(I)&&o.ZP.createElement(ze.Z,{round:!0,className:"badge-button",ripple:y,color:"translucent",size:"smaller",onClick:F,ariaLabel:D(i?"SubscribeRequests":"MemberRequests")},o.ZP.createElement("i",{className:"icon-user"}),o.ZP.createElement("div",{className:"badge"},I)),o.ZP.createElement(ze.Z,{ref:S,className:R?"active":"",round:!0,ripple:!h.wB,size:"smaller",color:"translucent",disabled:s,ariaLabel:"More actions",onClick:B},o.ZP.createElement("i",{className:"icon-more"})),T&&o.ZP.createElement(Lt,{chatId:t,threadId:n,isOpen:R,anchor:T,withExtraActions:h.wB||!Z,isChannel:i,canStartBot:r,canRestartBot:c,canSubscribe:l,canSearch:d,canCall:u,canMute:g,canLeave:p,canEnterVoiceChat:f,canCreateVoiceChat:v,onSubscribeChannel:L,onSearchClick:$,onClose:x,onCloseAnimationEnd:A}))})));var Ut=n(4399),Ft=n(6202),$t=n(862);function Dt(e){var t;const n=e&&(0,l.DH)(e),a=null==e||null===(t=e.content)||void 0===t?void 0:t.sticker,i=n&&a&&!(0,h.on)()&&n.includes("image/webp"),[r,c]=(0,o.eJ)($t.Hu),d=null==e?void 0:e.id;return(0,o.bt)((()=>{i&&(0,$t.p6)(`b64-${d}`,n).then(c).catch((e=>{s.eM&&console.error(e)}))}),[d,i,n]),i?r:n}var jt=n(7551),Qt=n(8512),qt=n(996);function Gt(e,t,n,a,s){return`M${e},${t+s}a${s},${s},0,0,1,\n ${n},0v${a-2*s}a${s},${s},0,0,1,${-n},0Z`}const Ht=(0,o.X$)((e=>{let{count:t,index:n}=e;const a=(0,o.sO)(null),s=(0,o.Ye)((()=>function(e,t){const n=e-t-1,a=function(e){let t=8;return 1===e?t=36:2===e?t=17:3===e?t=11:(4===e||e>3)&&(t=7.5),t}(e),s=function(e,t){let n=36;return 1===e?n=36:2===e?n=17:3===e?n=1===t?12:11:(4===e||e>3)&&(n=7.5),n}(e,n),o=function(e,t){return e<=3?36:t*e+2*(e-1)}(e,a),i=`clipPath${e}`,r=function(e,t,n){let a="";if(3===n)a=Gt(0,0,2,t,1)+Gt(0,12,2,t+1,1)+Gt(0,25,2,t,1);else for(let e=0;e\n \n `}(i,a,e),c=function(e,t,n){return 1===n?0:2===n?0===e?0:t+2:3===n?0===e?0:1===e?12:25:(t+2)*e}(n,a,e),l=function(e,t,n,a){return t<=4||e<=1?0:e>=t-2?a-36:(n+4)/2+(e-2)*(n+2)}(n,e,a,o);return{markHeight:s,clipPath:r,markTranslateY:c,trackTranslateY:l,trackHeight:o,clipPathId:i}}(t,n)),[t,n]);if((0,o.d4)((()=>{if(!a.current)return;const{trackHeight:e,trackTranslateY:t,markHeight:n,markTranslateY:o,clipPathId:i,clipPath:r}=s,c=a.current.firstElementChild;if(null!=a&&a.current){const s=a.current,{style:l}=s;l.height=`${e}px`,l.transform=`translateY(-${t}px)`,l.clipPath=`url("#${i}")`;const d=s.querySelector("svg"),u=s.querySelector("div"),m=s.querySelector("defs");d||c&&(c.innerHTML=` ${r} `),m&&(m.innerHTML=r),u&&(u.style.height=`${n}px`,u.style.transform=`translateY(${o}px)`)}}),[s]),1===t)return o.ZP.createElement("div",{className:"pinned-message-border"},o.ZP.createElement("div",{className:"pinned-message-border-wrapper-1",ref:a}));const{trackHeight:i,trackTranslateY:r,markHeight:c,markTranslateY:l,clipPathId:d}=s;return o.ZP.createElement("div",{className:(0,fe.Z)("pinned-message-border",t>4&&"pinned-message-border-mask")},o.ZP.createElement("div",{className:"pinned-message-border-wrapper",ref:a,style:`clip-path: url("#${d}"); width: 2px;\n height: ${i}px; transform: translateY(-${r}px);`},o.ZP.createElement("span",null),o.ZP.createElement("div",{className:"pinned-message-border-mark",style:`height: ${c}px; transform: translateY(${l}px);`})))})),_t=(0,o.X$)((e=>{let{message:t,count:n,index:a,customTitle:s,className:i,onUnpinMessage:r,onClick:c,onAllPinnedClick:d}=e;const u=(0,$e.Z)(),m=Dt(t),h=(0,Ft.Z)((0,l.Ti)(t,"pictogram")),g=(0,qt.e)(u,t,Boolean(m)),[p,f,v]=(0,Ue.Z)(),I=(0,o.I4)((()=>{v(),r&&r(t.id)}),[v,r,t.id]);return o.ZP.createElement("div",{className:(0,fe.Z)("HeaderPinnedMessage-wrapper",i)},n>1&&o.ZP.createElement(ze.Z,{round:!0,size:"smaller",color:"translucent",className:"pin-list-button",ariaLabel:u("EventLogFilterPinnedMessages"),onClick:d},o.ZP.createElement("i",{className:"icon-pin-list"})),r&&o.ZP.createElement(ze.Z,{round:!0,size:"smaller",color:"translucent",ariaLabel:u("UnpinMessageAlertTitle"),className:"unpin-button",onClick:f},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(jt.Z,{isOpen:p,onClose:v,text:"Would you like to unpin this message?",confirmLabel:"Unpin",confirmHandler:I}),o.ZP.createElement("div",{className:"HeaderPinnedMessage",onClick:c,dir:u.isRtl?"rtl":void 0},o.ZP.createElement(Ht,{count:n,index:a}),m&&function(e,t){const{width:n,height:a}=(0,Ut.W7)();return o.ZP.createElement("img",{src:t||e,width:n,height:a,alt:""})}(m,h),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("div",{className:"title",dir:"auto"},s||`${u("PinnedMessage")} ${a>0?"#"+(n-a):""}`),o.ZP.createElement("p",{dir:"auto"},g)),o.ZP.createElement(Qt.Z,null)))}));var zt=n(396),Vt=n(4532),Xt=n(3186);function Kt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png";const a=e instanceof Blob?URL.createObjectURL(e):e,s=new Image;return new Promise((o=>{s.onload=()=>{Wt(s,s.width*t,s.height*t,n).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(o).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(a)}))},s.src=a}))}async function Wt(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(!("createImageBitmap"in window))return Yt(e,t,n,void 0,a);try{const s=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(s.height!==n||s.width!==t)throw new Error("Image bitmap resize not supported!");return await new Promise((e=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const n=t.getContext("bitmaprenderer");n?n.transferFromImageBitmap(s):t.getContext("2d").drawImage(s,0,0),t.toBlob(e,a)}))}catch(s){return Yt(e,t,n,void 0,a)}}function Yt(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"image/png";const o=document.createElement("canvas"),i=o.getContext("2d"),r=document.createElement("canvas"),c=r.getContext("2d");if(o.width=t,o.height=n,e.width*a>t){const n=1/a;let s={width:Math.floor(e.width*a),height:Math.floor(e.height*a)};for(r.width=s.width,r.height=s.height,c.drawImage(e,0,0,s.width,s.height);s.width*a>t;)s={width:Math.floor(s.width*a),height:Math.floor(s.height*a)},c.drawImage(r,0,0,s.width*n,s.height*n,0,0,s.width,s.height);i.drawImage(r,0,0,s.width,s.height,0,0,o.width,o.height)}else i.drawImage(e,0,0,o.width,o.height);return new Promise((e=>{o.toBlob(e,s)}))}var Jt=n(4524);const en={width:200,height:200},tn=115,nn=(e,t,n)=>{const{audio:a,voice:s}=(0,l.qp)(e),i=a?a.title||a.fileName:s?"Voice message":"",r=a&&a.performer||t&&(0,l.OU)(I.i0,t),c=n&&(0,l.U)(I.i0,n)||"Telegram",d=a&&(0,l.MR)(a)&&(0,l.Ti)(e,"pictogram"),u=t&&(0,l.RT)(t,"big"),m=a&&d||s&&u,h=(0,Ft.Z)(m),g=(0,o.Ye)((()=>function(e,t,n){if(!n)return en;if(e){if(!e.thumbnailSizes||0===e.thumbnailSizes.length)return;const t=e.thumbnailSizes.find((e=>"m"===e.type));return t||e.thumbnailSizes[0]}return t?Ut.vY:void 0}(a,s,h)),[a,h,s]),{result:p}=((e,t,n)=>{const[a,s]=(0,o.eJ)(!1),[i,r]=(0,o.eJ)(),[c,l]=(0,o.eJ)(n);return(0,o.d4)((()=>{s(!0);let e=!1;return function(e,t){if(!e)return Promise.resolve(Jt);if(!t)return function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";const s=e instanceof Blob?URL.createObjectURL(e):e,o=new Image;return new Promise((i=>{o.onload=()=>{Wt(o,t,n,a).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(i).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(s)}))},o.src=s}))}(e,tn,tn);const n=Math.min(t.width,t.height);return n{e||(s(!1),l(t))}),(t=>{e||(s(!1),r(t))})),()=>{e=!0}}),t),{isLoading:a,error:i,result:c}})(0,[h,g],Jt);return(0,o.Ye)((()=>(0,Vt.Of)({title:i,artist:r,album:c,artwork:[{src:p}]})),[c,r,i,p])};var an=n(2340),sn=n(8051);const on=(0,a.c$)(((e,t)=>{let{message:n}=t;const a=(0,r.Ur)(e,n),s=(0,r.Z1)(e,n.chatId),{volume:o,playbackRate:i,isMuted:c}=e.audioPlayer;return{sender:a,chat:s,volume:o,playbackRate:i,isMuted:c}}))((e=>{let{message:t,className:n,noUi:s,sender:i,chat:r,volume:c,playbackRate:d,isMuted:u}=e;const{setAudioPlayerVolume:m,setAudioPlayerPlaybackRate:g,setAudioPlayerMuted:p,focusMessage:f,closeAudioPlayer:v}=(0,a.uC)(),I=(0,$e.Z)(),{audio:y,voice:Z,video:P}=(0,l.qp)(t),C=Boolean(Z||P),w=i?(0,l.OU)(I,i):void 0,b=V.UV((0,l.Ti)(t,"inline")),E=nn(t,i,r),{playPause:M,stop:S,isPlaying:R,requestNextTrack:k,requestPreviousTrack:T,isFirst:N,isLast:B,setVolume:x,toggleMuted:A,setPlaybackRate:L}=(0,Xt.Z)((0,zt.An)(t),(0,l.XV)(t),C?"voice":"audio",b,void 0,E,void 0,!0,void 0,void 0,(0,l.CI)(t),!0),O=C&&R;(0,o.d4)((()=>{if(O)return J.Z.disableRefresh(),()=>{J.Z.enableRefresh()}}),[O]);const U=(0,o.I4)((()=>{f({chatId:t.chatId,messageId:t.id})}),[f,t.chatId,t.id]),F=(0,o.I4)((()=>{R&&M(),v(),(0,Vt.Ay)(),S()}),[v,R,M,S]),$=(0,o.I4)((e=>{m({volume:e/100}),p({isMuted:!1}),x(e/100)}),[p,m,x]),D=(0,o.I4)((()=>{h.$b&&!h.cj||(A(),p({isMuted:!u}))}),[u,p,A]),j=(0,o.I4)((()=>{1===d?(L(1.8),g({playbackRate:1.8})):(L(1),g({playbackRate:1}))}),[d,g,L]),Q=(0,o.Ye)((()=>0===c||u?"icon-muted":c<.3?"icon-volume-1":c<.6?"icon-volume-2":"icon-volume-3"),[c,u]);if(!s)return o.ZP.createElement("div",{className:(0,fe.Z)("AudioPlayer",n),dir:I.isRtl?"rtl":void 0},o.ZP.createElement(ze.Z,{round:!0,ripple:!h.wB,color:"translucent",size:"smaller",className:"player-button",disabled:N(),onClick:T,ariaLabel:"Previous track"},o.ZP.createElement("i",{className:"icon-skip-previous"})),o.ZP.createElement(ze.Z,{round:!0,ripple:!h.wB,color:"translucent",size:"smaller",className:(0,fe.Z)("toggle-play","player-button",R?"pause":"play"),onClick:M,ariaLabel:R?"Pause audio":"Play audio"},o.ZP.createElement("i",{className:"icon-play"}),o.ZP.createElement("i",{className:"icon-pause"})),o.ZP.createElement(ze.Z,{round:!0,ripple:!h.wB,color:"translucent",size:"smaller",className:"player-button",disabled:B(),onClick:k,ariaLabel:"Next track"},o.ZP.createElement("i",{className:"icon-skip-next"})),o.ZP.createElement("div",{className:"AudioPlayer-content",onClick:U},y?function(e){const{title:t,performer:n,fileName:a}=e;return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"title",dir:"auto"},(0,an.Z)(t||a)),n&&o.ZP.createElement("div",{className:"subtitle",dir:"auto"},(0,an.Z)(n)))}(y):function(e,t){return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"title",dir:"auto"},t&&(0,an.Z)(t)),o.ZP.createElement("div",{className:"subtitle",dir:"auto"},e))}(I("AttachAudio"),w),o.ZP.createElement(Qt.Z,null)),o.ZP.createElement(ze.Z,{round:!0,className:"player-button volume-button",color:"translucent",size:"smaller",ariaLabel:"Volume",withClickPropagation:!0},o.ZP.createElement("i",{className:Q,onClick:D}),!h.cj&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"volume-slider-spacer"}),o.ZP.createElement("div",{className:"volume-slider"},o.ZP.createElement(sn.Z,{value:u?0:100*c,onChange:$})))),C&&o.ZP.createElement(ze.Z,{round:!0,className:(0,fe.Z)("playback-button",1!==d&&"applied"),color:"translucent",size:"smaller",ariaLabel:"Playback Rate",ripple:!h.wB,onClick:j},o.ZP.createElement("span",{className:"playback-button-inner"},"2Х")),o.ZP.createElement(ze.Z,{round:!0,className:"player-close",color:"translucent",size:"smaller",onClick:F,ariaLabel:"Close player"},o.ZP.createElement("i",{className:"icon-close"})))}));var rn=n(2607),cn=n(172);const ln=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const a=(0,r.Z1)(e,n),s=(0,rn.Bj)(e,n);return{groupCall:s,usersById:e.users.byId,chatsById:e.chats.byId,activeGroupCallId:e.groupCalls.activeGroupCallId,isActive:(s?s.participantsCount>0&&s.isLoaded:a&&a.isCallNotEmpty&&a.isCallActive)&&e.groupCalls.activeGroupCallId!==(null==s?void 0:s.id)}}))((e=>{let{chatId:t,isActive:n,groupCall:s,hasPinnedOffset:i,usersById:r,chatsById:c}=e;const{joinGroupCall:l,subscribeToGroupCallUpdates:d}=(0,a.uC)(),u=(0,$e.Z)(),m=(0,o.I4)((()=>{l({chatId:t})}),[l,t]),h=null==s?void 0:s.participants,g=(0,o.Ye)((()=>h?Object.values(h).filter(((e,t)=>t<3)).map((e=>{let{id:t,isUser:n}=e;if(n){if(!r[t])return;return{user:r[t]}}if(c[t])return{chat:c[t]}})).filter(Boolean):[]),[c,h,r]);if((0,o.d4)((()=>{if(null!=s&&s.id&&(n||!s.isLoaded))return d({id:s.id,subscribed:!0}),()=>{d({id:s.id,subscribed:!1})}}),[null==s?void 0:s.id,null==s?void 0:s.isLoaded,n,d]),s)return o.ZP.createElement("div",{className:(0,fe.Z)("GroupCallTopPane",i&&"has-pinned-offset",!n&&"is-hidden"),onClick:m},o.ZP.createElement("div",{className:"info"},o.ZP.createElement("span",{className:"title"},u("VoipGroupVoiceChat")),o.ZP.createElement("span",{className:"participants"},u("Participants",s.participantsCount||0,"i"))),o.ZP.createElement("div",{className:"avatars"},g.map((e=>{if(e)return e.user?o.ZP.createElement(cn.Z,{key:e.user.id,user:e.user}):o.ZP.createElement(cn.Z,{key:e.chat.id,chat:e.chat})}))),o.ZP.createElement(ze.Z,{round:!0,className:"join"},u("VoipChatJoin")))}))),dn=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:a,messageListType:s}=t;const{isLeftColumnShown:o,lastSyncTime:i,shouldSkipHistoryAnimations:c}=e,l=(0,r.Z1)(e,n),{typingStatus:d}=l||{},{chatId:m,messageId:h}=e.audioPlayer,g=m&&h?(0,r.hj)(e,m,h):void 0;let p;if("pinned"===s){const t=(0,r.KB)(e,n);p=null==t?void 0:t.length}else if("scheduled"===s){const t=(0,r.qy)(e,n);p=null==t?void 0:t.length}else if("thread"===s&&a!==u._f){const t=(0,r.tZ)(e,n,a);p=(null==t?void 0:t.messagesCount)||0}const f={typingStatus:d,isLeftColumnShown:o,isRightColumnShown:(0,r.Jf)(e),isSelectModeActive:(0,r.CA)(e),audioMessage:g,chat:l,messagesCount:p,isChatWithSelf:(0,r.FM)(e,n),isChatWithBot:l&&(0,r.xo)(e,l),lastSyncTime:i,shouldSkipHistoryAnimations:c,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1),connectionState:e.connectionState,isSyncing:e.isSyncing},v=(0,r.Zw)(e,n);if("thread"!==s||!v)return f;if(Object.assign(f,{messagesById:v}),a!==u._f){const t=(0,r.qS)(e,n,a),s=t?(0,r.hj)(e,n,t):void 0,o=s?(0,r.cv)(e,s):void 0;return{...f,pinnedMessageIds:t,canUnpin:!1,topMessageSender:o}}const I=(0,r.KB)(e,n);if(null!=I&&I.length){const t=v[I[0]],{canUnpin:n}=t&&(0,r._k)(e,t,a)||{};return{...f,pinnedMessageIds:I,canUnpin:n}}return f}))((e=>{let{chatId:t,threadId:n,messageListType:i,isReady:r,pinnedMessageIds:c,messagesById:d,canUnpin:m,topMessageSender:g,typingStatus:p,isSelectModeActive:f,isLeftColumnShown:v,isRightColumnShown:I,audioMessage:y,chat:Z,messagesCount:P,isChatWithSelf:C,isChatWithBot:w,lastSyncTime:b,shouldSkipHistoryAnimations:E,currentTransitionKey:M,connectionState:S,isSyncing:R}=e;const{openChatWithInfo:k,pinMessage:T,focusMessage:N,openChat:B,openPreviousChat:x,loadPinnedMessages:A,toggleLeftColumn:L,exitMessageSelectMode:O}=(0,a.uC)(),U=(0,$e.Z)(),F=(0,o.sO)(!0),[$,D]=(0,o.eJ)(0),j=Array.isArray(c)?c[$]:c,Q=d&&j?d[j]:void 0,q=Array.isArray(c)?c.length:c?1:void 0,G=Z&&(0,l.U)(U,Z).length,H=g?(0,l.OU)(U,g):void 0;(0,o.d4)((()=>{n===u._f&&b&&r&&A({chatId:t})}),[t,A,b,n,r]),(0,o.d4)((()=>{D(0)}),[c]),(0,Nt.Z)(t,j,Q);const{width:_}=Mt(),z=_<=s.ks,V=h.p7&&v,X=(0,o.sO)(null),K=(0,o.sO)(!0),W=(0,o.I4)((()=>{k({id:t})}),[k,t]),Y=(0,o.I4)((e=>{T({chatId:t,messageId:e,isUnpin:!0})}),[T,t]),J=(0,o.I4)((()=>{if(Q){N({chatId:Q.chatId,threadId:n,messageId:Q.id});const e=(0,Tt.Z)(q||1,$+1);D(e)}}),[Q,N,n,q,$]),ee=(0,o.I4)((()=>{B({id:t,threadId:u._f,type:"pinned"})}),[B,t]),te=(0,o.I4)((()=>{setTimeout((()=>{F.current=!0}),450)}),[]),ne=(0,o.I4)((e=>{if(F.current){if(F.current=!1,h.wB){const e=document.getElementById(s.R2);e&&e.blur()}if(f)return O(),void te();if(n===u._f&&"thread"===i&&0===M)return h.wB||V?(e.stopPropagation(),B({id:void 0})):L(),void te();x(),te()}}),[n,i,M,f,x,V,B,L,O,te]),ae=_>=s.ks&&_s.l3&&_30),se=ae||_>s._m&&_{const e=X.current;if(e)return se&&ge?void(I||ae?(K.current&&(e.classList.add("tools-stacked","animated"),K.current=!1),setTimeout((()=>{e.classList.remove("animated")}),350)):(e.classList.remove("tools-stacked"),K.current=!0)):(e.classList.remove("tools-stacked","animated"),void(K.current=!0))}),[se,ge,ae,I]);const{connectionStatusText:pe}=Ge(U,S,R,!0);function ve(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o.ZP.createElement("div",{className:"back-button"},o.ZP.createElement(ze.Z,{round:!0,size:"smaller",color:"translucent",onClick:ne,ariaLabel:U(e?"Close":"Back")},o.ZP.createElement("div",{className:(0,fe.Z)("animated-close-icon",!e&&"state-back")})),t&&o.ZP.createElement(xe,null))}const Ie=Boolean(oe&&re);return o.ZP.createElement("div",{className:"MiddleHeader",ref:X},o.ZP.createElement(Fe.Z,{name:E?"none":"slide-fade",activeKey:M},"thread"===i&&n===u._f?o.ZP.createElement(o.ZP.Fragment,null,(z||M>0)&&ve(V,!0),o.ZP.createElement("div",{className:"chat-info-wrapper",onClick:W},(0,l.YC)(t)?o.ZP.createElement(xt.Z,{userId:t,typingStatus:p,status:pe,withDots:Boolean(pe),withFullInfo:w,withMediaViewer:!0,withUpdatingStatus:!0,noRtl:!0}):o.ZP.createElement(At.Z,{chatId:t,typingStatus:p,status:pe,withDots:Boolean(pe),withMediaViewer:!0,withFullInfo:!0,withUpdatingStatus:!0,noRtl:!0}))):"thread"===i?o.ZP.createElement(o.ZP.Fragment,null,ve(),o.ZP.createElement("h3",null,U("CommentsCount",P,"i"))):"pinned"===i?o.ZP.createElement(o.ZP.Fragment,null,ve(),o.ZP.createElement("h3",null,U("PinnedMessagesCount",P,"i"))):"scheduled"===i?o.ZP.createElement(o.ZP.Fragment,null,ve(),o.ZP.createElement("h3",null,C?U("Reminders"):U("messages",P,"i"))):void 0),o.ZP.createElement(ln,{hasPinnedOffset:ce&&Boolean(de)||oe&&Boolean(re),chatId:t}),ce&&de&&o.ZP.createElement(_t,{key:t,message:de,count:ue||0,index:$,customTitle:he,className:(0,fe.Z)(le,Ie&&"full-width"),onUnpinMessage:me?Y:void 0,onClick:J,onAllPinnedClick:ee}),o.ZP.createElement("div",{className:"header-tools"},Ie&&o.ZP.createElement(on,{key:(0,l.Tp)(re),message:re,className:ie}),o.ZP.createElement(Ot,{chatId:t,threadId:n,messageListType:i,canExpandActions:!Ie})))})));var un=n(2645),mn=n(274);function hn(e){return"albumId"in e}function gn(e,t){let n,a=[],s={originalDate:e[0].date,datetime:Number((0,L.$Y)(1e3*e[0].date)),senderGroups:[a]};const o=[s];return e.forEach(((i,r)=>{i.isInAlbum?n?(n.messages.push(i),i.content.text&&(n.mainMessage=i)):n={albumId:i.groupedId,messages:[i],mainMessage:i}:a.push(i);const c=e[r+1];if(!n||c&&c.groupedId&&c.groupedId===n.albumId||(a.push(n),n=void 0),c){const e=Number((0,L.$Y)(1e3*c.date));s.datetime!==e?(s={originalDate:c.date,datetime:e,senderGroups:[]},o.push(s),a=[],s.senderGroups.push(a)):(c.id===t||i.senderId!==c.senderId||i.isOutgoing!==c.isOutgoing||(0,l.Lo)(i)||(0,l.Lo)(c)||i.forwardInfo&&c.forwardInfo&&(i.forwardInfo.senderUserId!==c.forwardInfo.senderUserId||i.forwardInfo.fromChatId!==c.forwardInfo.fromChatId||i.forwardInfo.hiddenUserName!==c.forwardInfo.hiddenUserName)||i.inlineButtons||c.inlineButtons||c.date-i.date>600)&&(a=[],s.senderGroups.push(a))}})),o}var pn=n(386),fn=n(2202);var vn=n(7675),In=n(539),yn=n(2357),Zn=n(998);var Pn=n(3657);const Cn=h.wZ?1e3:350,wn=h.wB?300:500;var bn=n(7240);function En(e){return"number"==typeof e}function Mn(e,t){return e?t?238:175:t?238:100}function Sn(e,t){const n=(0,l.B4)(e),a=(0,l.MF)(e),s=(0,l.O$)(e)||(0,l.F$)(e),o=(0,l.b7)(e),i=Boolean((0,l.F$)(e)),{width:r,height:c}=s?(0,Ut.Eh)(s,n,a,i,t):(0,Ut.GC)(o,n,a,t),d=Mn(Boolean((0,l.UD)(e)));let u=1;re+t),t)}function kn(e,t,n){return en?n:e}function Tn(e){const t={width:0,height:0};return e.forEach((e=>{let{dimensions:n,sides:a}=e;2&a&&(t.width=n.width+n.x),4&a&&(t.height=n.height+n.y)})),t}function Nn(e,t,n,a){const s=function(e){return e.map((e=>{const t=Sn(e);return t.width/t.height}))}(a.messages),o=function(e){return e.map((e=>e>1.2?"w":e<.8?"n":"q")).join("")}(s),i=function(e){return e.reduce(((e,t)=>t+e),1)/e.length}(s),r=s.length,c=s.some((e=>e>2)),l=(0,Ut.kc)(e,t,!1,n)-(t?2.5:0)*Ut.Gw;let d;const u={ratios:s,proportions:o,averageRatio:i,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return d=r>=5||c?function(e){let{ratios:t,averageRatio:n,maxWidth:a,minWidth:s,spacing:o,maxHeight:i=4*a/3}=e;const r=function(e,t){return e.map((e=>t>1.1?kn(e,1,2.75):kn(e,.6667,1)))}(t,n),c=t.length,l=new Array(c),d=[],u=e=>{const t=[];let n=0;e.forEach((e=>{t.push(((e,t)=>{const n=Rn(r.slice(e,e+t),0);return(a-(t-1)*o)/n})(n,e)),n+=e})),d.push({lineCounts:e,heights:t})};for(let e=1;e!==c;++e){const t=c-e;e<=3&&t<=3&&u([e,t])}for(let e=1;e!==c-1;++e)for(let t=1;t!==c-e;++t){const a=c-e-t;e<=3&&t<=(n<.85?4:3)&&a<=3&&u([e,t,a])}for(let e=1;e!==c-1;++e)for(let t=1;t!==c-e;++t)for(let n=1;n!==c-e-t;++n){const a=c-e-t-n;e<=3&&t<=3&&n<=3&&a<=4&&u([e,t,n,a])}let m,h=0;for(let e=0;e{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),u=Math.abs(r-i)*c*l;(!m||u1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:a,maxHeight:s}=e,o=Math.round(Math.min(n/t[0],Math.min(n/t[1],(s-a)/2)));return[{dimensions:{x:0,y:0,width:n,height:o},sides:11},{dimensions:{x:0,y:o+a,width:n,height:o},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:a,maxHeight:s}=e,o=(n-a)/2,i=Math.round(Math.min(o/t[0],Math.min(o/t[1],s)));return[{dimensions:{x:0,y:0,width:o,height:i},sides:13},{dimensions:{x:o+a,y:0,width:o,height:i},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:a,spacing:s,maxHeight:o}=e,i=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(a-s),(a-s)/t[0]/(1/t[0]+1/t[1]))),a-s-i),c=a-r-s,l=Math.min(o,Math.round(Math.min(c/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:c,height:l},sides:13},{dimensions:{x:c+s,y:0,width:r,height:l},sides:7}]}(e)}(u):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:a,maxWidth:s,minWidth:o}=e,i=t,r=Math.round(Math.min((t-n)/2,a[1]*(s-n)/(a[2]+a[1]))),c=i-r-n,l=Math.max(o,Math.round(Math.min((s-n)/2,Math.min(r*a[2],c*a[1])))),d=Math.min(Math.round(i*a[0]),s-n-l);return[{dimensions:{x:0,y:0,width:d,height:i},sides:13},{dimensions:{x:d+n,y:0,width:l,height:c},sides:3},{dimensions:{x:d+n,y:c+n,width:l,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:a,spacing:s}=e,o=t,i=Math.round(Math.min(o/n[0],.66*(a-s))),r=(t-s)/2,c=Math.min(a-i-s,Math.round(Math.min(r/n[1],r/n[2])));return[{dimensions:{x:0,y:0,width:o,height:i},sides:11},{dimensions:{x:0,y:i+s,width:r,height:c},sides:12},{dimensions:{x:r+s,y:i+s,width:o-r-s,height:c},sides:6}]}(e)}(u):function(e){const{proportions:t}=e;return"w"===t[0]?function(e){let{maxWidth:t,ratios:n,spacing:a,maxHeight:s,minWidth:o}=e;const i=t,r=Math.round(Math.min(i/n[0],.66*(s-a))),c=Math.round((t-2*a)/(n[1]+n[2]+n[3])),l=Math.max(o,Math.round(Math.min(.4*(t-2*a),c*n[1]))),d=Math.round(Math.max(Math.max(o,.33*(t-2*a)),c*n[3])),u=i-l-d-2*a,m=Math.min(s-r-a,c);return[{dimensions:{x:0,y:0,width:i,height:r},sides:11},{dimensions:{x:0,y:r+a,width:l,height:m},sides:12},{dimensions:{x:l+a,y:r+a,width:u,height:m},sides:4},{dimensions:{x:l+a+u+a,y:r+a,width:d,height:m},sides:6}]}(e):function(e){let{maxHeight:t,ratios:n,maxWidth:a,spacing:s,minWidth:o}=e;const i=t,r=Math.round(Math.min(i*n[0],.6*(a-s))),c=Math.round((t-2*s)/(1/n[1]+1/n[2]+1/n[3])),l=Math.round(c/n[1]),d=Math.round(c/n[2]),u=i-l-d-2*s,m=Math.max(o,Math.min(a-r-s,c));return[{dimensions:{x:0,y:0,width:r,height:i},sides:13},{dimensions:{x:r+s,y:0,width:m,height:l},sides:3},{dimensions:{x:r+s,y:l+s,width:m,height:d},sides:2},{dimensions:{x:r+s,y:l+d+2*s,width:m,height:u},sides:6}]}(e)}(u),{layout:d,containerStyle:Tn(d)}}let Bn;function xn(e){return Bn||(Bn=document.createElement("span"),Bn.style.font=h.cj?'400 12px system-ui, -apple-system, BlinkMacSystemFont, "Roboto", "Apple Color Emoji", "Helvetica Neue", sans-serif':'400 12px "Roboto", -apple-system, "Apple Color Emoji", BlinkMacSystemFont, "Helvetica Neue", sans-serif',Bn.style.whiteSpace="nowrap",Bn.style.position="absolute",Bn.style.left="-999px",Bn.style.opacity=".01",document.body.appendChild(Bn)),Bn.innerHTML=e,Bn.offsetWidth}function An(e,t,n,a,s,i){(0,o.bt)((()=>{if(n&&e.current){const t=e.current.closest(".MessageList");(0,In.Z)(t,e.current,s?"end":"centerOrTop",20,void 0!==a?1e3:void 0,a,void 0,i)}}),[e,t,n,a,s,i])}const Ln=3*Ut.Gw,On=Number(Ut.Gw),Un="data-is-document-group-hover";function Fn(e,t,n,s,i,r,c,l,d,u,m,g,p,f){const{setReplyingToId:v,sendDefaultReaction:I}=(0,a.uC)(),[y,Z,P]=(0,Ue.Z)(),[C,w,b]=(0,Ue.Z)(),E=(0,o.sO)();return(0,o.d4)((()=>{if(!h.$b||i||!r||m)return;let e;return(0,nt.sf)(t.current,{selectorToPreventScroll:".MessageList",onSwipe:(t,n)=>n===nt.eM.Left&&(e||(e=Date.now()),w(),!0),onRelease:()=>{e&&(v({messageId:n}),setTimeout(b,Math.max(0,150-(Date.now()-e))),e=void 0)}})}),[t,i,n,v,w,b,r,m]),{handleMouseDown:i?void 0:function(e){(0,pn.q)(e),d(e)},handleClick:function(t){if(i)e(t);else if(h.$b)return E.current?(clearInterval(E.current),E.current=void 0,void function(e){const{pageX:t,pageY:a}=e;I({chatId:u,messageId:n,x:t,y:a})}(t)):void(E.current=setTimeout((()=>{E.current=void 0,function(e){if(h.wZ){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;J.Z.getIsKeyboardVisible()?setTimeout((()=>{l(e)}),350):l(e)}}(t)}),200))},handleContextMenu:i?c?ye.Z:void 0:function(t){if(h.wZ){if(t.target.matches("a[href]")||m)return;t.preventDefault(),e()}else l(t)},handleDoubleClick:i?void 0:function(){h.$b||v({messageId:n})},handleContentDoubleClick:h.$b?void 0:function(e){e.stopPropagation()},handleMouseMove:function(e){const t=g.current;if(!t)return;const{clientX:n,clientY:a}=e,{x:s,width:o,y:i,height:r}=t.getBoundingClientRect(),c=Math.abs(p?n-s:s+o-n){const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"ContextMenuContainer",!t);return n?o.ZP.createElement(n,e):void 0})),qn=(0,o.X$)((0,a.c$)(((e,t)=>{let{message:n}=t;const{byId:a}=e.users,s=n.senderId,{targetUserIds:o,targetChatId:i}=n.content.action||{},c=n.replyToMessageId,d=c?(0,r.hj)(e,n.chatId,c):void 0,u=(0,r._X)(e,n),{direction:m,noHighlight:h}=u&&e.focusedMessage||{},g=(0,r.Z1)(e,n.chatId),p=g&&((0,l.eA)(g)||s===n.chatId);return{usersById:a,senderUser:!p&&s?(0,r.dy)(e,s):void 0,senderChat:p?g:void 0,targetChatId:i,targetUserIds:o,targetMessage:d,isFocused:u,...u&&{focusDirection:m,noFocusHighlight:h}}}))((e=>{let{message:t,observeIntersection:n,isEmbedded:a,appearanceOrder:s=0,isLastInList:i,usersById:r,senderUser:c,senderChat:l,targetUserIds:d,targetMessage:u,targetChatId:m,isFocused:h,focusDirection:g,noFocusHighlight:p}=e;const f=(0,o.sO)(null);(0,Pn._N)(f,n),(0,Nt.Z)(t.chatId,t.replyToMessageId,u),An(f,t.chatId,h,g,p);const v=(0,$e.Z)(),I=s<=0,[y,Z]=(0,Ue.Z)(I);(0,o.d4)((()=>{I||setTimeout(Z,10*s)}),[s,Z,I]);const{transitionClassNames:P}=(0,Ze.Z)(y,void 0,I,!1),C=(0,o.Ye)((()=>d?d.map((e=>null==r?void 0:r[e])).filter(Boolean):void 0),[d,r]),w=(0,jn.D)(v,t,c,l,C,u,m,{asTextWithSpoilers:a}),{isContextMenuOpen:b,contextMenuPosition:E,handleBeforeContextMenu:M,handleContextMenu:S,handleContextMenuClose:R,handleContextMenuHide:k}=(0,bn.Z)(f),T=void 0!==E;if(a)return o.ZP.createElement("span",{className:"embedded-action-message"},w);const N=(0,fe.Z)("ActionMessage message-list-item",h&&!p&&"focused",T&&"has-menu-open",i&&"last-in-list",P);return o.ZP.createElement("div",{ref:f,id:`message${t.id}`,className:N,"data-message-id":t.id,onMouseDown:e=>{(0,pn.q)(e),M(e)},onContextMenu:S},o.ZP.createElement("span",null,w),E&&o.ZP.createElement(Qn,{isOpen:b,anchor:E,message:t,messageListType:"thread",onClose:R,onCloseAnimationEnd:k}))}))),Gn=e=>{let{className:t,message:n,sender:a,title:s,customText:i,isProtected:r,observeIntersection:c,onClick:d}=e;const u=(0,o.sO)(null),m=(0,Pn.Op)(u,c),h=(0,Ft.Z)(n&&(0,l.Ti)(n,"pictogram"),!m),g=n&&`sticker-reply-thumb${n.id}`,p=Dt(n),f=Boolean(n&&(0,l.Y5)(n)),v=(0,$e.Z)(),I=a&&(0,l.OU)(v,a);return o.ZP.createElement("div",{ref:u,className:(0,fe.Z)("EmbeddedMessage",t),onClick:n?d:void 0},p&&function(e,t,n,a,s){const{width:i,height:r}=(0,Ut.W7)();return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("img",{id:e,src:n||t,width:i,height:r,alt:"",className:a?"round":"",draggable:!s}),s&&o.ZP.createElement("span",{className:"protector"}))}(g,p,h,f,r),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("p",{dir:"auto"},n?(0,l.Lo)(n)?o.ZP.createElement(qn,{message:n,isEmbedded:!0}):(0,qt.e)(v,n,Boolean(p)):i||" "),o.ZP.createElement("div",{className:"message-title",dir:"auto"},(0,an.Z)(I||s||" "))))};var Hn=n(2535),_n=n(4752),zn=n(8018),Vn=n(8198),Xn=n(7799);const Kn=(0,o.X$)((e=>{var t,n;let{reaction:s,activeReaction:i,isInMeta:r,availableReactions:c}=e;const{stopActiveReaction:l}=(0,a.uC)(),d=null==c?void 0:c.find((e=>e.reaction===s)),m=null==d||null===(t=d.centerIcon)||void 0===t?void 0:t.id,h=null==d||null===(n=d.aroundAnimation)||void 0===n?void 0:n.id,g=(0,Ft.Z)(`sticker${m}`,!m,u.IU.Lottie),p=(0,Ft.Z)(`sticker${h}`,!h,u.IU.Lottie),f=Boolean((null==i?void 0:i.reaction)===s&&g&&p),{shouldRender:v,transitionClassNames:I}=(0,Ze.Z)(f,void 0,!0,"slow"),y=(0,o.I4)((()=>{l({messageId:null==i?void 0:i.messageId,reaction:s})}),[null==i?void 0:i.messageId,s,l]),[Z,P,C]=(0,Ue.Z)(),w=!f||!Z,b=(0,fe.Z)("ReactionAnimatedEmoji",r&&"in-meta",v&&"is-animating");return o.ZP.createElement("div",{className:b},w&&o.ZP.createElement(Vn.Z,{reaction:s}),v&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Xn.Z,{key:m,id:`reaction_emoji_${m}`,className:I,size:30,animationData:g,play:!0,noLoop:!0,forceOnHeavyAnimation:!0,onLoad:P,onEnded:C}),o.ZP.createElement(Xn.Z,{key:h,id:`reaction_effect_${h}`,className:(0,fe.Z)("effect",I),size:100,animationData:p,play:!0,noLoop:!0,forceOnHeavyAnimation:!0,onEnded:y})))})),Wn=(0,o.X$)((e=>{var t;let{message:n,outgoingStatus:a,signature:s,onClick:i,withReactions:r,activeReaction:c,withReactionOffset:l,availableReactions:d,reactionMessage:u}=e;const m=(0,$e.Z)(),[h,g]=(0,Ue.Z)(),p=r&&(null==u||null===(t=u.reactions)||void 0===t?void 0:t.results.filter((e=>e.count>0))),f=(0,o.Ye)((()=>{if(!h)return;const e=(0,L.SA)(1e3*n.date,m.code),t=n.isEdited&&(0,L.SA)(1e3*n.editDate,m.code),a=n.forwardInfo&&(0,L.SA)(1e3*n.forwardInfo.date,m.code);let s=e;return t&&(s+="\n",s+=m("lng_edited_date").replace("{date}",t)),a&&(s+="\n",s+=m("lng_forwarded_date").replace("{date}",a)),s}),[h,m,n]);return o.ZP.createElement("span",{className:(0,fe.Z)("MessageMeta",l&&"reactions-offset"),dir:m.isRtl?"rtl":"ltr",onClick:i},p&&p.map((e=>o.ZP.createElement(Kn,{activeReaction:c,reaction:e.reaction,isInMeta:!0,availableReactions:d}))),Boolean(n.views)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"message-views"},(0,Te.bi)(n.views)),o.ZP.createElement("i",{className:"icon-channelviews"})),s&&o.ZP.createElement("span",{className:"message-signature"},(0,an.Z)(s)),o.ZP.createElement("span",{className:"message-time",title:f,onMouseEnter:g},n.isEdited&&`${m("EditedMessage")} `,(0,L.mr)(m,1e3*n.date)),a&&o.ZP.createElement(zn.Z,{status:a}))}));var Yn=n(692),Jn=n(4753);const ea=e=>{let{message:t,observeIntersection:n,observeIntersectionForPlaying:a,shouldLoop:i,lastSyncTime:r}=e;const c=(0,o.sO)(null),[d,u,m]=(0,Ue.Z)(),g=t.content.sticker,{isLottie:p,stickerSetId:f,isGif:v}=g,I=h.Hh,y=f===s.$E,Z=(0,Pn.Op)(c,n),P=(0,Pn.Op)(c,a),C=g.isPreloadedGlobally?`sticker${g.id}`:(0,l.Ti)(t,"inline"),w=v&&!I&&(g.isPreloadedGlobally?`sticker${g.id}?size=m`:(0,l.Ti)(t,"pictogram")),b=(0,Ft.Z)(w),E=Dt(t),M=b||E,S=(0,Ft.Z)(C,!Z,(0,l.kG)(t,"inline"),r),R=Boolean(S),[k,T]=(0,Ue.Z)(R),N=p?k:R,B=(0,Yn.Z)(N),{width:x,height:A}=(0,Ut.Wr)(g),L=(0,fe.Z)("thumbnail",!E&&"empty"),O=(0,fe.Z)("Sticker media-inner",y&&"inactive");return(0,o.d4)((()=>{if(!v||!c.current)return;const e=c.current.querySelector("video");e&&(P?(0,Jn.Z)(e):e.pause())}),[v,P]),o.ZP.createElement("div",{ref:c,className:O,onClick:y?void 0:u},(!N||v&&!I)&&o.ZP.createElement("img",{id:`sticker-thumb-${t.id}`,src:M,width:x,height:A,alt:"",className:L}),!p&&!v&&o.ZP.createElement("img",{id:`sticker-${t.id}`,src:S,width:x,height:A,alt:"",className:(0,fe.Z)("full-media",B)}),v&&I&&N&&o.ZP.createElement("video",{id:`sticker-${t.id}`,src:S,width:x,height:A,autoPlay:P,playsInline:!0,loop:i,muted:!0}),p&&R&&o.ZP.createElement(Xn.Z,{key:C,className:(0,fe.Z)("full-media",B),id:C,animationData:S,size:x,play:P,noLoop:!i,onLoad:T}),o.ZP.createElement(ke.Z,{isOpen:d,fromSticker:g,onClose:m}))};var ta=n(7854),na=n(2566),aa=n(5866);function sa(e,t){return(0,aa.Z)((0,l.DH)(e),Boolean(t),h.wB&&!h.vX)}const oa={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};var ia=n(9196);const ra=e=>{let{id:t,message:n,observeIntersection:a,noAvatars:s,canAutoLoad:i,isInSelectMode:r,isSelected:c,uploadProgress:d,size:u="inline",dimensions:m,nonInteractive:h,shouldAffectAppendix:g,isDownloading:p,isProtected:f,theme:v,onClick:I,onCancelUpload:y}=e;const Z=(0,o.sO)(null),P=((0,l.O$)(n)||(0,l.F$)(n)).blobUrl,C=(0,Pn.Op)(Z,a),[w,b]=(0,o.eJ)(i),E=w&&C,{mediaData:M,loadProgress:S}=(0,na.Z)((0,l.Ti)(n,u),!E),R=P||M,k=sa(n,R),{loadProgress:T}=(0,na.Z)((0,l.Ti)(n,"download"),!p),{isUploading:N,isTransferring:B,transferProgress:x}=(0,l.Sc)(n,d||(p?T:S),E&&!R),A=!1===(0,Rt.Z)(w),L=(0,Yn.Z)(R),{shouldRender:O,transitionClassNames:U}=(0,Ze.Z)(B,void 0,A,"slow"),{shouldRender:F,transitionClassNames:$}=(0,Ze.Z)(!R&&!w),D=(0,o.I4)((()=>{N?y&&y(n):R?I&&I(n.id):b((e=>!e))}),[R,N,n,y,I]),j=(0,l.B4)(n);(0,o.bt)((()=>{if(!g)return;const e=Z.current.closest(".message-content");R?function(e,t,n,a,s){return a?Promise.resolve(oa[s||"light"][t?"outgoing":"incoming"]):async function(e,t){const n=new Image;n.src=e,n.width||await new Promise((e=>{n.onload=e}));const a=document.createElement("canvas"),s=a.getContext("2d");a.width=n.width,a.height=n.height,s.drawImage(n,0,0,n.width,n.height);const o=t?n.width-1:0,i=n.height-1;return`rgba(${Array.from(s.getImageData(o,i,1,1).data).join(",")})`}(e,t)}(R,j,0,c,v).then((t=>{e.style.setProperty("--appendix-bg",t),e.setAttribute("data-has-custom-appendix","")})):e.classList.add("has-appendix-thumb")}),[R,j,g,r,c,v]);const{width:Q,height:q,isSmall:G}=m||Sn(n,s),H=(0,fe.Z)("media-inner",!N&&!h&&"interactive",G&&"small-image",Q===q&&"square-image"),_=m?`width: ${Q}px; height: ${q}px; left: ${m.x}px; top: ${m.y}px;`:"";return o.ZP.createElement("div",{id:t,ref:Z,className:H,style:_,onClick:N?void 0:D},o.ZP.createElement("canvas",{ref:k,className:"thumbnail",style:`width: ${Q}px; height: ${q}px`}),o.ZP.createElement("img",{src:R,className:`full-media ${L}`,width:Q,height:q,alt:"",draggable:!f}),f&&o.ZP.createElement("span",{className:"protector"}),O&&!F&&o.ZP.createElement("div",{className:`media-loading ${U}`},o.ZP.createElement(ia.Z,{progress:x,onClick:N?D:void 0})),F&&o.ZP.createElement("i",{className:(0,fe.Z)("icon-download",$)}),B&&o.ZP.createElement("span",{className:"message-transfer-progress"},Math.round(100*x),"%"))};var ca=n(2019),la=n(6898);function da(e,t){var n;const a=(0,o.sO)(null===(n=e.current)||void 0===n?void 0:n.paused),s=(0,o.sO)();s.current=t;const i=(0,o.I4)((()=>{e.current&&(a.current=!e.current.paused,a.current&&e.current.pause())}),[e]),r=(0,o.I4)((()=>{e.current&&a.current&&s.current&&document.body.contains(e.current)&&(0,Jn.Z)(e.current)}),[e]),c=(0,o.I4)((()=>{(0,M.T2)(r)}),[r]);(0,Pe.Z)(i,c),(0,pe.ZP)(i,r)}function ua(){return ua=Object.assign||function(e){for(var t=1;t{var t;let{id:n,message:s,observeIntersection:i,noAvatars:r,canAutoLoad:c,canAutoPlay:d,uploadProgress:m,lastSyncTime:h,dimensions:g,onClick:p,onCancelUpload:f,isDownloading:v,isProtected:I}=e;const y=(0,o.sO)(null),Z=(0,o.sO)(null),P=(0,l.b7)(s)||(0,l.Cg)(s),C=P.blobUrl,w=(0,Pn.Op)(y,i),[b,E]=(0,o.eJ)(c),M=Boolean(b&&w&&h),[S,R]=(0,o.eJ)(d),k=(0,Ft.Z)((0,l.Ti)(s,"pictogram"),!(w&&h),(0,l.kG)(s,"pictogram"),h),T=(0,Yn.Z)(k),{mediaData:N,loadProgress:B}=(0,na.Z)((0,l.Ti)(s,"inline"),!M,(0,l.kG)(s,"inline"),h),x=C||N,A=Boolean(w&&x),O=sa(s,k),{loadProgress:U}=(0,na.Z)((0,l.Ti)(s,"download"),!v,u.IU.BlobUrl,h),{isBuffered:F,bufferingHandlers:$}=(0,ca.Z)(!c),{isUploading:D,isTransferring:j,transferProgress:Q}=(0,l.Sc)(s,m||(v?U:B),M&&!F||v),q=!1===(0,Rt.Z)(b),{shouldRender:G,transitionClassNames:H}=(0,Ze.Z)(j,void 0,q),{shouldRender:_,transitionClassNames:z}=(0,Ze.Z)(b&&!S&&!G),[V,X]=(0,o.eJ)(0),K=(0,o.I4)((e=>{X(Math.max(0,e.currentTarget.currentTime-1))}),[]),W=(null===(t=Z.current)||void 0===t?void 0:t.duration)||P.duration||0,Y=(0,l.B4)(s),J=(0,l.MF)(s),{width:ee,height:te}=g||(0,Ut.GC)(P,Y,J,r);da(Z,A),(0,la.Z)(Z,[A]);const ne=(0,o.I4)((()=>{D?f&&f(s):v?(0,a.uC)().cancelMessageMediaDownload({message:s}):x?x&&!S?(R(!0),Z.current.play()):p&&p(s.id):E((e=>!e))}),[D,v,x,S,p,f,s]),ae=(0,fe.Z)("media-inner dark",!D&&"interactive"),se=g?`width: ${ee}px; height: ${te}px; left: ${g.x}px; top: ${g.y}px;`:"";return o.ZP.createElement("div",{ref:y,id:n,className:ae,style:se,onClick:D?void 0:ne},o.ZP.createElement("canvas",{ref:O,className:"thumbnail",style:`width: ${ee}px; height: ${te}px;`}),o.ZP.createElement("img",{src:k,className:(0,fe.Z)("thumbnail",T),style:`width: ${ee}px; height: ${te}px;`,alt:"",draggable:!I}),A&&o.ZP.createElement("video",ua({ref:Z,className:"full-media",width:ee,height:te,autoPlay:S,muted:!0,loop:!0,playsInline:!0},$,{draggable:!I,onTimeUpdate:K}),o.ZP.createElement("source",{src:x})),I&&o.ZP.createElement("span",{className:"protector"}),_&&o.ZP.createElement("i",{className:(0,fe.Z)("icon-large-play",z)}),G&&o.ZP.createElement("div",{className:(0,fe.Z)("media-loading",H)},o.ZP.createElement(ia.Z,{progress:Q,onClick:ne})),!b&&o.ZP.createElement("i",{className:"icon-download"}),j?o.ZP.createElement("span",{className:"message-transfer-progress"},D||v?`${Math.round(100*Q)}%`:"..."):o.ZP.createElement("div",{className:"message-media-duration"},P.isGif?"GIF":(0,L.k9)(Math.max(W-V,0))))};var ha=n(6272);const ga=(0,a.c$)(((e,t)=>{let{contact:n}=t;const{countryList:{phoneCodes:a}}=e;return{user:(0,r.dy)(e,n.userId),phoneCodeList:a}}))((e=>{let{contact:t,user:n,phoneCodeList:s}=e;const{openChat:i}=(0,a.uC)(),{firstName:r,lastName:c,phoneNumber:l,userId:d}=t,u=(0,o.I4)((()=>{i({id:d})}),[i,d]);return o.ZP.createElement("div",{className:(0,fe.Z)("Contact",Boolean(d)&&"interactive"),onClick:d?u:void 0},o.ZP.createElement(cn.Z,{size:"large",user:n,text:r||c}),o.ZP.createElement("div",{className:"contact-info"},o.ZP.createElement("div",{className:"contact-name"},r," ",c),o.ZP.createElement("div",{className:"contact-phone"},(0,ha.WZ)(s,l))))}));var pa=n(8974),fa=n(1218),va=n(4434),Ia=n(6937);function ya(e,t){return t>0?(e/t*100).toFixed():0}const Za=e=>{let{answer:t,voteResults:n,totalVoters:a,maxVotersCount:s,correctResults:i,shouldAnimate:r}=e;const c=n&&n.find((e=>e.option===t.option)),l=0===i.length||-1!==i.indexOf(t.option),d=i.length>0&&l||(null==c?void 0:c.isChosen),u=c?ya(c.votersCount,a||0):0,[m,h]=(0,o.eJ)(r?0:u),g=(0,o.sO)(null),p=c?ya(c.votersCount,s||0):0,f=m{r&&h(u)}),[r,u]),(0,o.d4)((()=>{const e=g.current;if(e&&r){const t=e.firstElementChild,n=f?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44";t?t.setAttribute("style",n):e.innerHTML=`\n \n \n `}}),[f,r]),!n||!c)return;const v=`width: ${p}%; transform:scaleX(${f?0:1})`;return o.ZP.createElement("div",{className:"PollOption",dir:"ltr"},o.ZP.createElement("div",{className:"poll-option-share "+("100"===u?"limit-width":"")},u,"%",d&&o.ZP.createElement("span",{className:(0,fe.Z)("poll-option-chosen",!l&&"wrong",r&&"animate")},o.ZP.createElement("i",{className:l?"icon-check":"icon-close"}))),o.ZP.createElement("div",{className:"poll-option-right"},o.ZP.createElement("div",{className:"poll-option-text",dir:"auto"},(0,an.Z)(t.text)),o.ZP.createElement("div",{className:(0,fe.Z)("poll-option-answer",d&&!l&&"wrong")},o.ZP.createElement("div",{className:"poll-option-corner",ref:g}),o.ZP.createElement("div",{className:"poll-option-line",style:v}))))},Pa=(0,o.X$)((0,a.c$)(((e,t)=>{let{poll:n}=t;const{recentVoterIds:a}=n.results,{serverTimeOffset:s,users:{byId:o}}=e;return a&&0!==a.length?{recentVoterIds:a,usersById:o,serverTimeOffset:s}:{}}))((e=>{let{message:t,poll:n,recentVoterIds:s,usersById:i,onSendVote:r,serverTimeOffset:c}=e;const{loadMessage:l,openPollResults:d}=(0,a.uC)(),{id:u,chatId:m}=t,{summary:h,results:g}=n,[p,f]=(0,o.eJ)(!1),[v,I]=(0,o.eJ)([]),[y,Z]=(0,o.eJ)(!1),[P,C]=(0,o.eJ)(!1),[w,b]=(0,o.eJ)(!h.closed&&h.closeDate&&h.closeDate>0?Math.min(h.closeDate-Math.floor(Date.now()/1e3)+c,h.closePeriod):0),E=(0,o.sO)(null),{results:M,totalVoters:S}=g,R=M&&M.some((e=>e.isChosen)),k=!h.closed&&!R,T=!k&&h.isPublic&&Number(g.totalVoters)>0,N=k&&h.multipleChoice,B=M?Math.max(...M.map((e=>e.votersCount))):S,x=M?M.reduce(((e,t)=>(t.isCorrect&&e.push(t.option),e)),[]):[],A=h.answers.map((e=>({label:e.text,value:e.option,hidden:Boolean(h.quiz&&h.closePeriod&&w<=0)})));(0,o.d4)((()=>{p&&n.results.results&&n.results.results.some((e=>e.isChosen))&&f(!1)}),[p,n.results.results]),(0,o.d4)((()=>{w>0&&setTimeout((()=>b(w-1)),1e3);const e=E.current;if(e){const t=12*Math.PI,n=e.lastElementChild,a=e.firstElementChild;if(w<=5&&e.classList.add("hurry-up"),n&&a){const e=(h.closePeriod-w)/h.closePeriod*t;a.textContent=(0,L.k9)(w),n.firstElementChild.setAttribute("stroke-dashoffset",`-${e}`)}else e.innerHTML=`\n ${(0,L.k9)(w)}\n \n \n `}}),[w,h.closePeriod]),(0,o.d4)((()=>{h.quiz&&(w<=0||R&&!h.closed)&&l({chatId:m,messageId:u})}),[m,w,R,l,u,h.closed,h.quiz]),(0,o.d4)((()=>{let e;return h.quiz&&!h.closed&&h.closePeriod&&h.closePeriod>0&&(e=window.setTimeout((()=>{l({chatId:m,messageId:u})}),1e3*h.closePeriod)),()=>{e&&window.clearTimeout(e)}}),[k,m,l,u,h.closePeriod,h.closed,h.quiz]);const O=(0,o.Ye)((()=>s?s.reduce(((e,t)=>{const n=i[t];return n&&e.push(n),e}),[]):[]),[i,s]),U=(0,o.I4)((e=>{I([e]),f(!0),C(!0),r([e])}),[r]),F=(0,o.I4)((e=>{I(e)}),[]),$=(0,o.I4)((()=>{f(!0),C(!0),r(v)}),[r,v]),D=(0,o.I4)((()=>{d({chatId:m,messageId:u})}),[m,u,d]),j=(0,o.I4)((()=>{Z(!0)}),[]),Q=(0,o.I4)((()=>{Z(!1),C(!1)}),[]);(0,o.d4)((()=>{P&&R&&h.quiz&&g.results&&n.results.solution&&(g.results.find((e=>e.isChosen&&e.isCorrect))||Z(!0))}),[R,P,g.results,h.quiz,n.results.solution]);const q=(0,$e.Z)();return o.ZP.createElement("div",{className:"Poll",dir:q.isRtl?"auto":"ltr"},y&&n.results.solution&&o.ZP.createElement(Ia.Z,{message:(0,pa.H)(n.results.solution,n.results.solutionEntities),duration:5e3,onDismiss:Q,containerId:"#middle-column-portals"}),o.ZP.createElement("div",{className:"poll-question"},(0,an.Z)(h.question,["emoji","br"])),o.ZP.createElement("div",{className:"poll-type"},q(function(e){return void 0===e.isPublic?" ":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.closed?"FinalResults":e.isPublic?"PublicPoll":"AnonymousPoll"}(h)),O.length>0&&o.ZP.createElement("div",{className:"poll-recent-voters"},O.map((e=>o.ZP.createElement(cn.Z,{size:"micro",user:e})))),w>0&&k&&o.ZP.createElement("div",{ref:E,className:"poll-countdown"}),h.quiz&&n.results.solution&&!k&&o.ZP.createElement(ze.Z,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",disabled:y,onClick:j,ariaLabel:"Show Solution"},o.ZP.createElement("i",{className:"icon-lamp"}))),k&&o.ZP.createElement("div",{className:"poll-answers"},N?o.ZP.createElement(fa.Z,{options:A,onChange:F,disabled:t.isScheduled||p,loadingOptions:p?v:void 0,round:!0}):o.ZP.createElement(va.Z,{name:`poll-${u}`,options:A,onChange:U,disabled:t.isScheduled||p,loadingOption:p?v[0]:void 0})),!k&&o.ZP.createElement("div",{className:"poll-results"},h.answers.map((function(e){return o.ZP.createElement(Za,{key:e.option,shouldAnimate:P,answer:e,voteResults:M,totalVoters:S,maxVotersCount:B,correctResults:x})}))),!T&&!N&&o.ZP.createElement("div",{className:"poll-voters-count"},function(e,t,n){return n?e(t?"Answer":"Vote",n,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}(q,h.quiz,g.totalVoters)),N&&o.ZP.createElement(ze.Z,{isText:!0,disabled:0===v.length,size:"tiny",onClick:$},q("PollSubmitVotes")),T&&o.ZP.createElement(ze.Z,{isText:!0,size:"tiny",onClick:D},q("PollViewResults")))})));var Ca=n(8035),wa=n(88);const ba=(0,o.X$)((e=>{let{message:t,observeIntersection:n,noAvatars:a,canAutoLoad:s,canAutoPlay:i,inPreview:r,lastSyncTime:c,isDownloading:d=!1,isProtected:u,theme:m,onMediaClick:h,onCancelMediaTransfer:g}=e;const p=(0,l.s1)(t);let f=!1;if(null!=p&&p.photo&&!p.video){const{width:e,height:n}=Sn(t);f=e===n}const v=(0,o.I4)((()=>{h()}),[h]);if(!p)return;const{siteName:I,url:y,displayUrl:Z,title:P,description:C,photo:w,video:b}=p,E=(w||b)&&h&&!f,M=(0,Ca.Z)(C,170),S=(0,fe.Z)("WebPage",f&&"with-square-photo",!w&&!b&&!r&&"without-media",b&&"with-video");return o.ZP.createElement("div",{className:S,"data-initial":(I||Z)[0],dir:"auto"},w&&!b&&o.ZP.createElement(ra,{message:t,observeIntersection:n,noAvatars:a,canAutoLoad:s,size:f?"pictogram":"inline",nonInteractive:!E,onClick:E?v:void 0,onCancelUpload:g,isDownloading:d,isProtected:u,theme:m}),o.ZP.createElement("div",{className:"WebPage-text"},o.ZP.createElement(wa.Z,{className:"site-name",url:y,text:I||Z}),!r&&P&&o.ZP.createElement("p",{className:"site-title"},(0,an.Z)(P)),M&&o.ZP.createElement("p",{className:"site-description"},(0,an.Z)(M,["emoji","br"]))),!r&&b&&o.ZP.createElement(ma,{message:t,observeIntersection:n,noAvatars:a,canAutoLoad:s,canAutoPlay:i,lastSyncTime:c,onClick:E?v:void 0,onCancelUpload:g,isDownloading:d,isProtected:u}))}));var Ea=n(9937);const Ma=(0,o.X$)((e=>{let{message:t}=e;const n=(0,$e.Z)(),a=(0,l.eO)(t),{title:s,text:i,amount:r,currency:c,isTest:d,photoUrl:u}=a;return o.ZP.createElement("div",{className:"Invoice"},s&&o.ZP.createElement("p",{className:"title"},(0,an.Z)(s)),i&&o.ZP.createElement("p",null,(0,an.Z)(i,["emoji","br"])),o.ZP.createElement("div",{className:"description "+(u?"has-image":"")},u&&o.ZP.createElement("img",{className:"invoice-image",src:u,alt:""}),o.ZP.createElement("p",{className:"description-text"},(0,Ea.x)(r,c,n.code),d&&o.ZP.createElement("span",null,n("PaymentTestInvoice")))))}));function Sa(e){return(0,o.X$)((0,a.c$)(((e,t)=>{const{message:n}=t;return{isInSelectMode:(0,r.CA)(e),isSelected:(0,r.vk)(e,n.id)}}))((t=>{const{isInSelectMode:n,isSelected:s,message:i,dimensions:r}=t,{toggleMessageSelection:c}=(0,a.uC)(),l=(0,o.I4)((e=>{e.stopPropagation(),c({messageId:i.id,withShift:null==e?void 0:e.shiftKey})}),[c,i]),d=(0,o.Ye)((()=>({...t,isInSelectMode:n,isSelected:s,dimensions:{...t.dimensions,x:0,y:0},onClick:n?void 0:t.onClick})),[t,n,s]);return o.ZP.createElement("div",{className:(0,fe.Z)("album-item-select-wrapper",s&&"is-selected"),style:r?`left: ${r.x}px; top: ${r.y}px;`:"",onClick:n?l:void 0},n&&o.ZP.createElement("div",{className:"message-select-control"},s&&o.ZP.createElement("i",{className:"icon-select"})),o.ZP.createElement(e,d))})))}const Ra=Sa(ra),ka=Sa(ma),Ta=(0,a.c$)(((e,t)=>{let{album:n}=t;const{chatId:a}=n.mainMessage,s=(0,r.Pu)(e),o=(0,r.xs)(e,a);return{theme:s,uploadsById:e.fileUploads.byMessageLocalId,activeDownloadIds:o}}))((e=>{let{album:t,observeIntersection:n,hasCustomAppendix:s,lastSyncTime:i,isOwn:c,isProtected:d,albumLayout:u,onMediaClick:m,uploadsById:h,activeDownloadIds:g,theme:p}=e;const{cancelSendingMessage:f}=(0,a.uC)(),v=t.messages.length,I=(0,o.I4)((e=>{f({chatId:e.chatId,messageId:e.id})}),[f]),{width:y,height:Z}=u.containerStyle;return o.ZP.createElement("div",{className:"Album",style:`width: ${y}px; height: ${Z}px;`},t.messages.map((function(e,t){const{photo:f,video:y}=(0,l.qp)(e),Z=h[e.previousLocalId||e.id],P=null==Z?void 0:Z.progress,{dimensions:C,sides:w}=u.layout[t],b=(0,r.bH)((0,a.Rd)(),e),E=(0,r.__)((0,a.Rd)(),e);if(f){const a=s&&(c?t===v-1:Boolean(8&w&&4&w));return o.ZP.createElement(Ra,{id:`album-media-${e.id}`,message:e,observeIntersection:n,canAutoLoad:b,shouldAffectAppendix:a,uploadProgress:P,dimensions:C,isProtected:d,onClick:m,onCancelUpload:I,isDownloading:g.includes(e.id),theme:p})}if(y)return o.ZP.createElement(ka,{id:`album-media-${e.id}`,message:e,observeIntersection:n,canAutoLoad:b,canAutoPlay:E,uploadProgress:P,lastSyncTime:i,dimensions:C,isProtected:d,onClick:m,onCancelUpload:I,isDownloading:g.includes(e.id),theme:p})})))}));function Na(){return Na=Object.assign||function(e){for(var t=1;t{let{message:t,observeIntersection:n,canAutoLoad:s,lastSyncTime:i,isDownloading:r}=e;const c=(0,o.sO)(null),d=(0,o.sO)(null),m=(0,o.sO)(null),h=t.content.video,g=(0,Pn.Op)(c,n),[p,f]=(0,o.eJ)(s),v=Boolean(p&&g&&i),{mediaData:I,loadProgress:y}=(0,na.Z)((0,l.Ti)(t,"inline"),!v,(0,l.kG)(t,"inline"),i),{loadProgress:Z}=(0,na.Z)((0,l.Ti)(t,"download"),!r,u.IU.BlobUrl,i),P=sa(t,I),{isBuffered:C,bufferingHandlers:w}=(0,ca.Z)(),b=p&&!C||r,E=!1===(0,Rt.Z)(p),S=(0,Yn.Z)(I),{shouldRender:R,transitionClassNames:k}=(0,Ze.Z)(b||!C,void 0,E),[T,N]=(0,o.eJ)(!1),[B,x]=(0,o.eJ)(0);(0,o.d4)((()=>{if(!T)return;const e=Ut.Rj/2,t=2*(e-6)*Math.PI,n=t-B*t,a=m.current,s=d.current,o=s.firstElementChild;o?o.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):s.innerHTML=`\n \n \n `,x(a.currentTime/a.duration)}),[T,B]);const A=Boolean(I&&g),O=(0,o.I4)((()=>{m.current&&(N(!1),x(0),(0,Jn.Z)(m.current),(0,M.T2)((()=>{d.current.innerHTML=""})))}),[]),U=(0,o.I4)((()=>{var e;null===(e=Ba)||void 0===e||e(),Ba=O}),[O]);(0,o.d4)((()=>{m.current&&(A?(0,Jn.Z)(m.current):m.current.pause())}),[A]),da(m,A),(0,la.Z)(m,[I]);const F=(0,o.I4)((()=>{if(!I)return void f((e=>!e));if(r)return void(0,a.uC)().cancelMessageMediaDownload({message:t});const e=m.current;T?e.paused?((0,Jn.Z)(e),(0,zt.Es)()):e.pause():(U(),e.pause(),e.currentTime=0,(0,Jn.Z)(e),(0,zt.Es)(),N(!0))}),[U,T,r,I,t]),$=(0,o.I4)((e=>{const t=e.currentTarget;x(t.currentTime/t.duration)}),[]),D=(0,fe.Z)("full-media",S);return o.ZP.createElement("div",{ref:c,className:"RoundVideo media-inner",onClick:F},o.ZP.createElement("div",{className:"thumbnail-wrapper"},o.ZP.createElement("canvas",{ref:P,className:"thumbnail",style:`width: ${Ut.Rj}px; height: ${Ut.Rj}px`})),I&&o.ZP.createElement("div",{className:"video-wrapper"},o.ZP.createElement("video",Na({ref:m,className:D,width:Ut.Rj,height:Ut.Rj,autoPlay:!0,muted:!T,loop:!T,playsInline:!0,onEnded:T?O:void 0},w,{onTimeUpdate:T?$:void 0}),o.ZP.createElement("source",{src:I}))),o.ZP.createElement("div",{className:"progress",ref:d}),R&&o.ZP.createElement("div",{className:`media-loading ${k}`},o.ZP.createElement(ia.Z,{progress:r?Z:y})),!I&&!p&&o.ZP.createElement("i",{className:"icon-download"}),o.ZP.createElement("div",{className:"message-media-duration"},T?(0,L.k9)(m.current.currentTime):(0,L.k9)(h.duration),(!T||m.current.paused)&&o.ZP.createElement("i",{className:"icon-muted"})))},Aa=e=>{let{message:t,onClick:n}=e;const a=(0,$e.Z)();return o.ZP.createElement("div",{className:"InlineButtons"},t.inlineButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(ze.Z,{size:"tiny",ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>n({button:e})},(0,an.Z)(a(e.text)),"buy"===e.type&&o.ZP.createElement("i",{className:"icon-card"}),"url"===e.type&&!e.value.match(s.FS)&&o.ZP.createElement("i",{className:"icon-arrow-right"}))))))))},La=(0,o.X$)((e=>{let{threadInfo:t,disabled:n}=e;const{openChat:s}=(0,a.uC)(),i=(0,$e.Z)(),{threadId:r,chatId:c,messagesCount:d,lastMessageId:u,lastReadInboxMessageId:m,recentReplierIds:h}=t,g=(0,o.I4)((()=>{s({id:c,threadId:r})}),[s,c,r]),p=(0,o.Ye)((()=>{if(null==h||!h.length)return;const{users:{byId:e},chats:{byId:t}}=(0,a.Rd)();return h.map((n=>(0,l.YC)(n)?e[n]:t[n])).filter(Boolean)}),[h]);if(void 0===d)return;const f=Boolean(m&&u&&m0&&o.ZP.createElement("div",{className:"recent-repliers",dir:i.isRtl?"rtl":"ltr"},p.map((e=>o.ZP.createElement(cn.Z,{key:e.id,size:"small",user:(0,l.YC)(e.id)?e:void 0,chat:(0,l.YC)(e.id)?void 0:e})))),o.ZP.createElement("div",{className:"label",dir:"auto"},d?i("Comments",d,"i"):i("LeaveAComment")),o.ZP.createElement("i",{className:"icon-next"}))})),Oa=(0,o.X$)((e=>{let{reaction:t,message:n,activeReaction:s,availableReactions:i}=e;const{sendReaction:r}=(0,a.uC)(),{recentReactions:c}=n.reactions,l=(0,o.Ye)((()=>{if(!c||t.count>3)return;const e=(0,a.Rd)().users.byId;return c.filter((e=>e.reaction===t.reaction)).map((t=>e[t.userId])).filter(Boolean)}),[t,c]),d=(0,o.I4)((()=>{r({reaction:t.isChosen?void 0:t.reaction,chatId:n.chatId,messageId:n.id})}),[n,t,r]);return o.ZP.createElement(ze.Z,{className:(0,fe.Z)(t.isChosen&&"chosen"),size:"tiny",onClick:d},o.ZP.createElement(Kn,{activeReaction:s,reaction:t.reaction,availableReactions:i}),null!=l&&l.length?o.ZP.createElement("div",{className:"avatars"},l.map((e=>o.ZP.createElement(cn.Z,{user:e,size:"micro"})))):(0,Te.bi)(t.count))})),Ua=(0,o.X$)((e=>{let{message:t,isOutside:n,activeReaction:a,availableReactions:s,metaChildren:i}=e;return o.ZP.createElement("div",{className:(0,fe.Z)("Reactions",n&&"is-outside")},t.reactions.results.map((e=>o.ZP.createElement(Oa,{key:e.reaction,reaction:e,message:t,activeReaction:a,availableReactions:s}))),i)}));var Fa=n(7324),$a=n(5296);const Da=(0,o.X$)((e=>{let{localSticker:t,localEffect:n,isOwn:a,soundId:s,size:i="medium",observeIntersection:r,messageId:c,chatId:l,activeEmojiInteractions:d}=e;const{playKey:u,ref:m,style:h,width:g,handleClick:p,markAnimationLoaded:f}=(0,$a.Z)(i,l,c,s,d,a,n),v=`local_emoji_${t}`,I=(0,Pn.Op)(m,r),[y,Z]=(0,o.eJ)();return(0,o.d4)((()=>{t&&(0,Fa.Z)(t).then((e=>{Z(e)}))}),[t]),o.ZP.createElement("div",{ref:m,className:"AnimatedEmoji media-inner",style:h,onClick:p},y&&o.ZP.createElement(Xn.Z,{key:v,id:v,animationData:y,size:g,quality:1,play:I&&u,forceOnHeavyAnimation:!0,noLoop:!0,onLoad:f}))})),ja={__html:''},Qa={__html:''},qa=(0,o.X$)((0,a.c$)(((e,t)=>{const{focusedMessage:n,forwardMessages:a,lastSyncTime:s}=e,{message:o,album:i,withSenderName:c,withAvatar:d,threadId:u,messageListType:m,isLastInDocumentGroup:h}=t,{id:g,chatId:p,viaBotId:f,replyToChatId:v,replyToMessageId:I,isOutgoing:y,threadInfo:Z}=o,P=(0,r.Z1)(e,p),C=(0,r.FM)(e,p),w=(0,l.pK)(p),b=P&&(0,l.eA)(P),E=null==P?void 0:P.username,M=!C&&(0,l.Ul)(o),S=c||d||M,R=(0,r.Ur)(e,o),k=(0,r.cv)(e,o),T=f?(0,r.dy)(e,f):void 0,N=u?(0,r.qS)(e,p,u):void 0,B=o.id===N,x=I===N,A=I&&!x?(0,r.hj)(e,w&&v?v:p,I):void 0,L=A&&(0,r.Ur)(e,A),O=(0,r.uZ)(e,o),U="thread"===m&&(i?i.messages.some((t=>(0,r._X)(e,t))):(0,r._X)(e,o)),{direction:F,noHighlight:$,isResizingContainer:D}=U&&n||{},j=a.messageIds&&a.messageIds.includes(g),{query:Q}=(0,r.n5)(e)||{},q=(0,l._O)(o);let G;G=null!=i&&i.messages?i.messages.every((t=>{let{id:n}=t;return(0,r.vk)(e,n)})):(0,r.vk)(e,g);const{canReply:H}="thread"===m&&(0,r._k)(e,o,u)||{},_=(0,r.te)(e,o),z=Z?(0,r.tZ)(e,Z.chatId,Z.threadId)||Z:void 0,V=Boolean(o.groupedId)&&!o.isInAlbum,X=V?(0,r.xH)(e,p,o.groupedId)[0]:void 0,K=V?h?(0,r.hj)(e,p,X):void 0:o,W=q?(0,r.CP)(e,q):void 0;return{theme:(0,r.Pu)(e),chatUsername:E,forceSenderName:M,sender:S?R:void 0,originSender:k,botSender:T,shouldHideReply:x,isThreadTop:B,replyMessage:A,replyMessageSender:L,isInDocumentGroup:V,isProtected:(0,r.EV)(e,o),isFocused:U,isForwarding:j,reactionMessage:K,isChatWithSelf:C,isRepliesChat:w,isChannel:b,canReply:H,lastSyncTime:s,highlight:Q,isSingleEmoji:Boolean(q),animatedEmoji:q?(0,r.zB)(e,q):void 0,animatedEmojiEffect:q&&(0,l.YC)(p)?(0,r.tH)(e,q):void 0,animatedEmojiSoundId:q?(0,r.Oh)(e,q):void 0,localSticker:W,localEffect:W&&(0,l.YC)(p)?(0,r.cu)(W):void 0,isInSelectMode:(0,r.CA)(e),isSelected:G,isGroupSelected:Boolean(o.groupedId)&&!o.isInAlbum&&(0,r.a6)(e,p,o.groupedId),threadId:u,isDownloading:_,isPinnedList:"pinned"===m,canAutoLoadMedia:(0,r.bH)(e,o),canAutoPlayMedia:(0,r.__)(e,o),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,r.yB)(e),threadInfo:z,availableReactions:e.availableReactions,defaultReaction:(0,l.CI)(o)?void 0:(0,r.q6)(e,p),activeReaction:K&&e.activeReactions[K.id],activeEmojiInteractions:e.activeEmojiInteractions,...y&&{outgoingStatus:(0,r.dT)(e,o,"scheduled"===m)},..."number"==typeof O&&{uploadProgress:O},...U&&{focusDirection:F,noFocusHighlight:$,isResizingContainer:D}}}))((e=>{let{message:t,chatUsername:n,observeIntersectionForBottom:s,observeIntersectionForMedia:i,observeIntersectionForAnimatedStickers:r,album:c,noAvatars:d,withAvatar:g,withSenderName:p,areReactionsInMeta:f,noComments:v,appearanceOrder:I,isFirstInGroup:y,isLastInGroup:Z,isFirstInDocumentGroup:P,isLastInDocumentGroup:C,isLastInList:w,theme:b,forceSenderName:E,sender:M,originSender:S,botSender:R,isThreadTop:k,shouldHideReply:T,replyMessage:N,replyMessageSender:B,outgoingStatus:x,uploadProgress:A,isInDocumentGroup:L,isProtected:O,isFocused:U,focusDirection:F,noFocusHighlight:$,isResizingContainer:D,isForwarding:j,isChatWithSelf:Q,isRepliesChat:q,isChannel:G,canReply:H,lastSyncTime:_,highlight:z,animatedEmoji:V,localSticker:X,localEffect:K,animatedEmojiEffect:W,animatedEmojiSoundId:Y,isInSelectMode:J,isSelected:ee,isGroupSelected:te,threadId:ne,reactionMessage:ae,availableReactions:se,defaultReaction:oe,activeReaction:ie,activeEmojiInteractions:re,messageListType:ce,isPinnedList:le,isDownloading:de,canAutoLoadMedia:ue,canAutoPlayMedia:me,shouldLoopStickers:he,autoLoadFileMaxSizeMb:ge,threadInfo:pe}=e;const{toggleMessageSelection:ve,clickInlineButton:Ie,disableContextMenuHint:ye}=(0,a.uC)(),Pe=(0,o.sO)(null),Ce=(0,o.sO)(null),we=(0,o.sO)(null),be=(0,$e.Z)();(0,Pn._N)(Ce,s);const{isContextMenuOpen:Ee,contextMenuPosition:Me,handleBeforeContextMenu:Se,handleContextMenu:Re,handleContextMenuClose:ke,handleContextMenuHide:Te}=(0,bn.Z)(Pe,h.$b&&J,!0,h.wZ);(0,o.d4)((()=>{Ee&&ye()}),[Ee,ye]);const Ne=I<=0,[Be,xe]=(0,Ue.Z)(Ne);(0,o.d4)((()=>{Ne||setTimeout(xe,10*I)}),[I,xe,Ne]);const{transitionClassNames:Ae}=(0,Ze.Z)(Be,void 0,Ne,!1),{id:Le,chatId:Oe,forwardInfo:Fe,viaBotId:De}=t,je=(0,l.CI)(t),Qe=(0,l.B4)(t),qe="scheduled"===ce||t.isScheduled,Ge=(0,l.ss)(t)&&!T,He=Boolean(pe)&&"thread"===ce,_e=(0,l.$D)(t),Ve=X||V,Xe=(null==ae?void 0:ae.reactions)&&!(0,l.JE)(ae.reactions),Ke=Fe&&(!Q||qe)&&!q&&!Fe.isLinkedChannelPost&&!_e,We=Boolean(c)&&c.messages.length>1,Ye=L&&!P,Je=L&&!C,et=void 0!==Me,tt=!(et||J||j||Je),nt=G&&!qe,at=Boolean(le||Fe&&(Fe.isChannelPost||Q&&!Qe||q)&&Fe.fromMessageId),st=pe&&!Je&&"thread"===ce&&!v,ot=!h.$b&&!J&&oe&&!Je,it=(0,o.I4)(((e,t)=>{ve({messageId:Le,groupedId:t,...(null==e?void 0:e.shiftKey)&&{withShift:!0},...We&&{childMessageIds:c.messages.map((e=>{let{id:t}=e;return t}))}})}),[ve,Le,We,c]),rt=Fe&&(Q||q||!M)?S:M,ct=Fe?S:M,{handleMouseDown:lt,handleClick:dt,handleContextMenu:ut,handleDoubleClick:mt,handleContentDoubleClick:ht,handleMouseMove:gt,handleSendQuickReaction:pt,handleMouseLeave:ft,isSwiped:vt,isQuickReactionVisible:It,handleDocumentGroupMouseEnter:yt}=Fn(it,Pe,Le,0,Boolean(J),Boolean(H),Boolean(O),Re,Se,Oe,et,we,Qe,Je),{handleAvatarClick:Zt,handleSenderClick:Pt,handleViaBotClick:Ct,handleReplyClick:wt,handleMediaClick:bt,handleAudioPlay:Et,handleAlbumMediaClick:Mt,handleMetaClick:St,handleReadMedia:Rt,handleCancelUpload:kt,handleVoteSend:Tt,handleGroupForward:Bt,handleForward:xt,handleFocus:At,handleFocusForwarded:Lt,handleDocumentGroupSelectAll:Ot}=function(e,t,n,s,i,r,c,l,d,h,g,p,f){const{openChat:v,showNotification:I,focusMessage:y,openMediaViewer:Z,openAudioPlayer:P,markMessagesRead:C,cancelSendingMessage:w,sendPollVote:b,openForwardMenu:E,focusMessageInComments:M}=(0,a.uC)(),{id:S,forwardInfo:R,replyToMessageId:k,replyToChatId:T,replyToTopMessageId:N,groupedId:B}=n,x=(0,o.I4)((()=>{g&&v({id:g.id})}),[g,v]),A=(0,o.I4)((()=>{p?c&&null!=R&&R.channelPostId?y({chatId:p.id,messageId:R.channelPostId}):v({id:p.id}):I({message:e("HidAccount")})}),[c,y,R,e,v,p,I]),L=(0,o.I4)((()=>{f&&v({id:f.id})}),[f,v]),O=(0,o.I4)((()=>{y({chatId:d&&T?T:s,threadId:i,messageId:k,replyMessageId:d&&T?void 0:S})}),[y,d,T,s,i,k,S]),U=(0,o.I4)((()=>{Z({chatId:s,threadId:i,messageId:S,origin:l?m.bZ.ScheduledInline:m.bZ.Inline})}),[s,i,S,Z,l]),F=(0,o.I4)((()=>{P({chatId:s,messageId:S})}),[s,S,P]),$=(0,o.I4)((e=>{Z({chatId:s,threadId:i,messageId:e,origin:l?m.bZ.ScheduledAlbum:m.bZ.Album})}),[s,i,Z,l]),D=(0,o.I4)((()=>{C({messageIds:[S]})}),[S,C]),j=(0,o.I4)((()=>{w({chatId:s,messageId:S})}),[w,s,S]),Q=(0,o.I4)((e=>{b({chatId:s,messageId:S,options:e})}),[s,S,b]),q=(0,o.I4)((()=>{E({fromChatId:s,groupedId:B})}),[E,s,B]),G=(0,o.I4)((()=>{if(h&&h.messages){const e=h.messages.map((e=>{let{id:t}=e;return t}));E({fromChatId:s,messageIds:e})}else E({fromChatId:s,messageIds:[S]})}),[h,E,s,S]),H=(0,o.I4)((()=>{y({chatId:s,threadId:u._f,messageId:S})}),[y,s,S]),_=(0,o.I4)((()=>{r?y({chatId:R.fromChatId,groupedId:B,groupedChatId:s}):d&&T?M({chatId:T,threadId:N,messageId:R.fromMessageId}):y({chatId:R.fromChatId,messageId:R.fromMessageId})}),[r,d,T,y,R,B,s,M,N]),z=(0,o.I4)((e=>{e.stopPropagation(),t(e,B)}),[t,B]);return{handleAvatarClick:x,handleSenderClick:A,handleViaBotClick:L,handleReplyClick:O,handleMediaClick:U,handleAudioPlay:F,handleAlbumMediaClick:$,handleMetaClick:z,handleReadMedia:D,handleCancelUpload:j,handleVoteSend:Q,handleGroupForward:q,handleForward:G,handleFocus:H,handleFocusForwarded:_,handleDocumentGroupSelectAll:z}}(be,it,t,Oe,ne,L,Ke,qe,q,c,rt,ct,R),Ft=(0,fe.Z)("Message message-list-item",y&&"first-in-group",O&&"is-protected",Z&&"last-in-group",P&&"first-in-document-group",C&&"last-in-document-group",w&&"last-in-list",Qe&&"own",Boolean(t.views)&&"has-views",t.isEdited&&"was-edited",Ge&&"has-reply",et&&"has-menu-open",U&&!$&&"focused",j&&"is-forwarding",t.isDeleting&&"is-deleting",L&&"is-in-document-group",We&&"is-album",t.hasUnreadMention&&"has-unread-mention",ee&&"is-selected",J&&"is-in-selection-mode",k&&"is-thread-top",Boolean(t.inlineButtons)&&"has-inline-buttons",vt&&"is-swiped",Ae,Boolean(ie)&&"has-active-reaction"),$t=function(e){let{hasReply:t,customShape:n,isLastInGroup:a,asForwarded:s,hasThread:o,forceSenderName:i,hasComments:r,hasActionButton:c,hasReactions:d}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{text:u,photo:m,video:h,audio:g,voice:p,document:f,poll:v,webPage:I,contact:y}=(0,l.qp)(e),Z=["message-content"],P=m||h,C=P&&!u,w=Boolean(e.viaBotId);return En(n)?Z.push(`emoji-only emoji-only-${n}`):u&&Z.push("text"),c&&Z.push("has-action-button"),n&&(Z.push("custom-shape"),null!=h&&h.isRound&&Z.push("round"),r&&Z.push("has-comments")),m||h?Z.push("media"):g?Z.push("audio"):p?Z.push("voice"):f?Z.push("document"):y?Z.push("contact"):v?Z.push("poll"):I&&(Z.push("web-page"),(I.photo||I.video)&&Z.push("media")),s&&Z.push("is-forwarded"),t&&Z.push("is-reply"),o&&Z.push("has-replies"),d&&Z.push("has-reactions"),w&&Z.push("is-via-bot"),i&&Z.push("force-sender-name"),n||(Z.push("has-shadow"),P&&r&&Z.push("has-background"),(t||s||!C||w||i)&&Z.push("has-solid-background"),!a||!m&&C||Z.push("has-appendix")),Z.join(" ")}(t,{hasReply:Ge,customShape:_e,isLastInGroup:Z,asForwarded:Ke,hasThread:He,forceSenderName:E,hasComments:pe&&(null==pe?void 0:pe.messagesCount)>0,hasActionButton:nt||at,hasReactions:Xe}),Dt=$t.includes("has-appendix"),jt=(0,qt.X)(t,z,En(_e)),{text:Qt,photo:Gt,video:Ht,audio:_t,voice:zt,document:Vt,sticker:Xt,contact:Kt,poll:Wt,webPage:Yt,invoice:Jt}=(0,l.qp)(t);let en,tn;en=Je?"none":!jt||Ve||Yt?"standalone":"in-text",f?tn="in-meta":Xe?_e||(Gt||Ht||Ve)&&!jt?tn="outside":Ke?(en="standalone",tn="inside"):tn="inside":tn="none",(0,Nt.Z)(q&&t.replyToChatId?t.replyToChatId:Oe,Ge?t.replyToMessageId:void 0,N,t.id),An(Pe,Oe,U,F,$,D);let nn,sn="",on=!1;const rn=(0,o.Ye)((()=>We?Nn(Qe,Boolean(Ke),Boolean(d),c):void 0),[We,Qe,Ke,d,c]),ln=Ke?28:0;if(We||!Gt&&!Ht)rn&&(nn=Math.max(Mn(Boolean(Qt),st),rn.containerStyle.width),nn-rn.containerStyle.width>18&&(on=!0));else{let e;Gt?e=Sn(t,d).width:Ht&&(e=Ht.isRound?Ut.Rj:Sn(t,d).width),e&&(nn=Math.max(Mn(Boolean(Qt),st),e),nn-e>18&&(on=!0))}nn&&(sn=`width: ${nn+ln}px`);const dn=G&&t.adminTitle||!Ke&&(null==Fe?void 0:Fe.adminTitle)||void 0,un=(0,o.Ye)((()=>dn?xn(dn):void 0),[dn]);function mn(){const e=o.ZP.createElement(Wn,{message:t,reactionMessage:ae,outgoingStatus:x,signature:dn,withReactions:"in-meta"===tn,withReactionOffset:"inside"===tn,availableReactions:se,activeReaction:ie,onClick:St});return"inside"!==tn?e:o.ZP.createElement(Ua,{activeReaction:ie,message:ae,metaChildren:e,availableReactions:se})}return o.ZP.createElement("div",{ref:Pe,id:`message${Le}`,className:Ft,style:un?`--meta-safe-author-width: ${un}px`:void 0,"data-message-id":Le,onMouseDown:lt,onClick:dt,onContextMenu:ut,onDoubleClick:mt,onMouseEnter:Je?yt:void 0,onMouseMove:ot?gt:void 0,onMouseLeave:ot||Je?ft:void 0},o.ZP.createElement("div",{ref:Ce,className:"bottom-marker","data-message-id":Le,"data-last-message-id":c?c.messages[c.messages.length-1].id:void 0,"data-has-unread-mention":t.hasUnreadMention}),!L&&o.ZP.createElement("div",{className:"message-select-control"},ee&&o.ZP.createElement("i",{className:"icon-select"})),C&&o.ZP.createElement("div",{className:(0,fe.Z)("message-select-control group-select",te&&"is-selected"),onClick:Ot},te&&o.ZP.createElement("i",{className:"icon-select"})),g&&function(){const e=rt&&(0,l.YC)(rt.id),t=rt&&e?rt:void 0,n=rt&&!e?rt:void 0,a=!rt&&Fe?Fe.hiddenUserName:void 0;return o.ZP.createElement(cn.Z,{size:"small",user:t,chat:n,text:a,lastSyncTime:_,onClick:t||n?Zt:void 0})}(),o.ZP.createElement("div",{className:(0,fe.Z)("message-content-wrapper",$t.includes("text")&&"can-select-text")},o.ZP.createElement("div",{ref:we,className:$t,style:sn,dir:"auto"},Ke&&!Ye&&o.ZP.createElement("div",{className:"message-title"},be("ForwardedMessage")),function(){const e=(0,fe.Z)("content-inner",Ke&&"forwarded-message",Ge&&"reply-message",on&&"no-media-corners"),n=Z&&!jt&&!Ke&&!He,a=(0,fe.Z)("text-content","in-text"===en&&"with-meta",x&&"with-outgoing-icon");return o.ZP.createElement("div",{className:e,onDoubleClick:ht,dir:"auto"},function(){if(_e&&!De||!(p&&!Gt&&!Ht||Ke||De||E)||Ye||Ge&&_e)return;let e,n;return!ct||_e&&De?null!=Fe&&Fe.hiddenUserName&&(e=Fe.hiddenUserName):(e=(0,l.OU)(be,ct),Ke||(n=`color-${(0,l.Rs)(ct)}`)),o.ZP.createElement("div",{className:"message-title",dir:"ltr"},e?o.ZP.createElement("span",{className:(0,fe.Z)("interactive",n),onClick:Pt,dir:"auto"},(0,an.Z)(e)):R?void 0:" ",R&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"via"},be("ViaBot")),o.ZP.createElement("span",{className:"interactive",onClick:Ct},(0,an.Z)(`@${R.username}`))),null!=Fe&&Fe.isLinkedChannelPost?o.ZP.createElement("span",{className:"admin-title",dir:"auto"},be("DiscussChannel")):t.adminTitle&&!G?o.ZP.createElement("span",{className:"admin-title",dir:"auto"},t.adminTitle):void 0)}(),Ge&&o.ZP.createElement(Gn,{message:N,isProtected:O,sender:B,observeIntersection:i,onClick:wt}),Xt&&o.ZP.createElement(ea,{message:t,observeIntersection:i,observeIntersectionForPlaying:r,shouldLoop:he,lastSyncTime:_}),V&&o.ZP.createElement(ta.Z,{size:"small",isOwn:Qe,sticker:V,effect:W,soundId:Y,observeIntersection:i,lastSyncTime:_,forceLoadPreview:je,messageId:Le,chatId:Oe,activeEmojiInteractions:re}),X&&o.ZP.createElement(Da,{size:"small",isOwn:Qe,localSticker:X,localEffect:K,soundId:Y,observeIntersection:i,lastSyncTime:_,forceLoadPreview:je,messageId:Le,chatId:Oe,activeEmojiInteractions:re}),We&&o.ZP.createElement(Ta,{album:c,albumLayout:rn,observeIntersection:i,isOwn:Qe,isProtected:O,hasCustomAppendix:n,lastSyncTime:_,onMediaClick:Mt}),!We&&Gt&&o.ZP.createElement(ra,{message:t,observeIntersection:i,noAvatars:d,canAutoLoad:ue,uploadProgress:A,shouldAffectAppendix:n,onClick:bt,onCancelUpload:kt,isDownloading:de,isProtected:O,theme:b}),!We&&Ht&&Ht.isRound&&o.ZP.createElement(xa,{message:t,observeIntersection:i,canAutoLoad:ue,lastSyncTime:_,isDownloading:de}),!We&&Ht&&!Ht.isRound&&o.ZP.createElement(ma,{message:t,observeIntersection:i,noAvatars:d,canAutoLoad:ue,canAutoPlay:me,uploadProgress:A,lastSyncTime:_,onClick:bt,onCancelUpload:kt,isDownloading:de,isProtected:O}),(_t||zt)&&o.ZP.createElement(_n.Z,{theme:b,message:t,origin:m.Cr.Inline,uploadProgress:A,lastSyncTime:_,isSelectable:L,isSelected:ee,onPlay:Et,onReadMedia:!zt||Qe&&!Q?void 0:Rt,onCancelUpload:kt,isDownloading:de}),Vt&&o.ZP.createElement(Hn.Z,{message:t,observeIntersection:i,canAutoLoad:ue,autoLoadFileMaxSizeMb:ge,uploadProgress:A,isSelectable:L,isSelected:ee,onMediaClick:bt,onCancelUpload:kt,isDownloading:de}),Kt&&o.ZP.createElement(ga,{contact:Kt}),Wt&&o.ZP.createElement(Pa,{message:t,poll:Wt,onSendVote:Tt}),!Ve&&jt&&o.ZP.createElement("p",{className:a,dir:"auto"},jt,"in-text"===en&&mn()),Yt&&o.ZP.createElement(ba,{message:t,observeIntersection:i,noAvatars:d,canAutoLoad:ue,canAutoPlay:me,lastSyncTime:_,onMediaClick:bt,onCancelMediaTransfer:kt,isDownloading:de,isProtected:O,theme:b}),Jt&&o.ZP.createElement(Ma,{message:t}))}(),!Je&&"standalone"===en&&mn(),tt&&nt?o.ZP.createElement(ze.Z,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:be("lng_context_forward_msg"),onClick:C?Bt:xt},o.ZP.createElement("i",{className:"icon-share-filled"})):tt&&at?o.ZP.createElement(ze.Z,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:le?At:Lt},o.ZP.createElement("i",{className:"icon-arrow-right"})):void 0,st&&o.ZP.createElement(La,{threadInfo:pe,disabled:v}),Dt&&o.ZP.createElement("div",{className:"svg-appendix",dangerouslySetInnerHTML:Qe?ja:Qa}),ot&&o.ZP.createElement("div",{className:(0,fe.Z)("quick-reaction",It&&!ie&&"visible"),onClick:pt},o.ZP.createElement(Vn.Z,{reaction:oe}))),t.inlineButtons&&o.ZP.createElement(Aa,{message:t,onClick:Ie}),"outside"===tn&&o.ZP.createElement(Ua,{message:ae,isOutside:!0,activeReaction:ie,availableReactions:se})),Me&&o.ZP.createElement(Qn,{isOpen:Ee,anchor:Me,message:t,album:c,chatUsername:n,messageListType:ce,onClose:ke,onCloseAnimationEnd:Te}))}))),Ga=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const a=(0,r.fS)(e,n),{chatId:s,isBot:o}=a||{};return{message:a,bot:s&&o?(0,r.dy)(e,s):void 0,channel:!o&&s?(0,r.Z1)(e,s):void 0}}))((e=>{let{chatId:t,message:n,containerRef:s,bot:i,channel:r}=e;const{viewSponsoredMessage:c,openChat:d,openChatByInvite:u,startBot:m,focusMessage:h}=(0,a.uC)(),g=(0,$e.Z)(),p=(0,o.sO)(null),f=Boolean(n),{observe:v}=(0,Pn.S1)({rootRef:s,debounceMs:200,threshold:1});if((0,o.d4)((()=>f?v(p.current,(e=>{e.isIntersecting&&c({chatId:t})})):void 0),[t,f,v,c]),n)return o.ZP.createElement("div",{className:"SponsoredMessage Message open",key:"sponsored-message"},o.ZP.createElement("div",{className:"message-content has-shadow has-solid-background",dir:"auto"},o.ZP.createElement("div",{className:"content-inner",dir:"auto"},o.ZP.createElement("div",{className:"message-title",dir:"ltr"},i&&(0,an.Z)((0,l.Js)(i)||""),r&&(0,an.Z)(n.chatInviteTitle||(0,l.U)(g,r,i)||"")),o.ZP.createElement("p",{className:"text-content with-meta",dir:"auto",ref:p},o.ZP.createElement("span",{className:"text-content-inner",dir:"auto"},(0,pa.H)(n.text.text,n.text.entities)),o.ZP.createElement("span",{className:"MessageMeta",dir:"ltr"},o.ZP.createElement("span",{className:"message-signature"},g("SponsoredMessage")))),o.ZP.createElement(ze.Z,{color:"secondary",size:"tiny",ripple:!0,onClick:()=>{n.chatInviteHash?u({hash:n.chatInviteHash}):n.channelPostId?h({chatId:n.chatId,messageId:n.channelPostId}):(d({id:n.chatId}),n.startParam&&m({botId:n.chatId,param:n.startParam}))},className:"SponsoredMessage__button"},g(n.isBot?"Conversation.ViewBot":n.channelPostId?"Conversation.ViewPost":"Conversation.ViewChannel")))))}))),Ha=(0,o.X$)((e=>{let{chatId:t,messageIds:n,messageGroups:i,isViewportNewest:r,isUnread:c,withUsers:d,areReactionsInMeta:u,noAvatars:p,containerRef:f,anchorIdRef:v,memoUnreadDividerBeforeIdRef:I,memoFirstUnreadIdRef:y,threadId:Z,type:P,isReady:C,isScrollingRef:w,isScrollPatchNeededRef:b,threadTopMessageId:E,hasLinkedChat:S,isSchedule:R,noAppearanceAnimation:k,onFabToggle:T,onNotchToggle:N}=e;const{openHistoryCalendar:B}=(0,a.uC)(),{observeIntersectionForMedia:x,observeIntersectionForReading:A,observeIntersectionForAnimatedStickers:O}=function(e,t,n){const{markMessageListRead:s,markMessagesRead:o}=(0,a.uC)(),{observe:i}=(0,Pn.S1)({rootRef:t,throttleMs:Cn,margin:wn}),{observe:r,freeze:c,unfreeze:l}=(0,Pn.S1)({rootRef:t,throttleMs:150},(t=>{if("thread"!==e)return;let a=0;const i=[];t.forEach((e=>{const{isIntersecting:t,target:n}=e;if(!t)return;const{dataset:s}=n,o=Number(s.lastMessageId||s.messageId);o>a&&(a=o),s.hasUnreadMention&&i.push(o)})),n.current&&a>=n.current&&s({maxId:a}),i.length&&o({messageIds:i})}));(0,Pe.Z)(c,l);const{observe:d}=(0,Pn.S1)({rootRef:t,throttleMs:Cn});return{observeIntersectionForMedia:i,observeIntersectionForReading:r,observeIntersectionForAnimatedStickers:d}}(P,f,y),{backwardsTriggerRef:U,forwardsTriggerRef:F,fabTriggerRef:$}=function(e,t,n,i,r,c,l,d,u,g){const{loadViewportMessages:p}=(0,a.uC)(),[f,v]=(0,o.Ye)((()=>"thread"===e?[(0,M.Ds)((()=>p({direction:m.Uq.Backwards})),1e3,!0,!1),(0,M.Ds)((()=>p({direction:m.Uq.Forwards})),1e3,!0,!1)]:[]),[p,n]),I=(0,o.sO)(null),y=(0,o.sO)(null),Z=(0,o.sO)(null);function P(){if(!d)return;if(!n||!n.length)return c(!1),void l(!1);if(!i)return c(!0),void l(!0);if(!t.current)return;const{offsetHeight:e,scrollHeight:a,scrollTop:s}=t.current,o=Math.round(a-s-e),u=o<=1;c(r?!u:!(o<=50)),l(!u)}const{observe:C}=(0,Pn.S1)({rootRef:t,margin:h.gZ},(e=>{if(!v||!f)return;if(n[0]>=s.AE)return;const t=e.find((e=>{let{isIntersecting:t}=e;return t}));if(!t)return;const{target:a}=t;"backwards-trigger"===a.className?(h.i4&&u.current&&n.length<=s.hT&&(g.current=!0),f()):"forwards-trigger"===a.className&&v()}));(0,Pn._N)(I,C),(0,Pn._N)(y,C);const{observe:w,freeze:b,unfreeze:E}=(0,Pn.S1)({rootRef:t,margin:100},P);(0,Pn._N)(Z,w);const{observe:S,freeze:R,unfreeze:k}=(0,Pn.S1)({rootRef:t,margin:1},P);return(0,Pn._N)(Z,S),(0,we.Z)((()=>{d&&P()}),[d]),(0,we.Z)((()=>{b(),R(),setTimeout((()=>{k(),E()}),250)}),[n]),{backwardsTriggerRef:I,forwardsTriggerRef:y,fabTriggerRef:Z}}(P,f,n,r,c,T,N,C,w,b),D=(0,$e.Z)(),j=o.ZP.createElement("div",{className:(0,fe.Z)("unread-divider","local-action-message"),key:"unread-messages"},o.ZP.createElement("span",null,D("UnreadMessages"))),Q=k?0:i.reduce(((e,t)=>e+(0,g.xH)(t.senderGroups).length),0);let q=0;const G=i.map(((e,t,n)=>{const a=e.senderGroups.map(((e,a,s)=>{if(1===e.length&&!hn(e[0])&&(0,l.Lo)(e[0])){const i=e[0],r=a===s.length-1&&t===n.length-1;return(0,g.oA)([i.id===I.current&&j,o.ZP.createElement(qn,{key:i.id,message:i,observeIntersection:A,appearanceOrder:Q-++q,isLastInList:r})])}let i;return(0,g.xH)(e.map(((r,c)=>{const m=hn(r)?r.mainMessage:r,h=hn(r)?r:void 0,f=(0,l.B4)(m),y=hn(r),C=e[c+1];m.previousLocalId&&v.current===`message${m.previousLocalId}`&&(v.current=`message${m.id}`);const w=!y&&m.groupedId?m.groupedId:void 0,b=C&&!hn(C)?C.groupedId:void 0,M={isFirstInGroup:0===c,isLastInGroup:c===e.length-1,isFirstInDocumentGroup:Boolean(w&&w!==i),isLastInDocumentGroup:Boolean(w&&w!==b),isLastInList:c===e.length-1&&a===s.length-1&&t===n.length-1};i=w;const R=(0,l.KK)(m),k="scheduled"!==P?R:`${m.date}_${R}`;return(0,g.oA)([m.id===I.current&&j,o.ZP.createElement(qa,{key:k,message:m,observeIntersectionForBottom:A,observeIntersectionForMedia:x,observeIntersectionForAnimatedStickers:O,album:h,noAvatars:p,withAvatar:M.isLastInGroup&&d&&!f&&!(m.id===E),withSenderName:M.isFirstInGroup&&d&&!f,areReactionsInMeta:u,threadId:Z,messageListType:P,noComments:!1===S,appearanceOrder:Q-++q,isFirstInGroup:M.isFirstInGroup,isLastInGroup:M.isLastInGroup,isFirstInDocumentGroup:M.isFirstInDocumentGroup,isLastInDocumentGroup:M.isLastInDocumentGroup,isLastInList:M.isLastInList}),m.id===E&&o.ZP.createElement("div",{className:"local-action-message",key:"discussion-started"},o.ZP.createElement("span",null,D("DiscussionStarted")))])})))}));return o.ZP.createElement("div",{className:"message-date-group",key:e.datetime,onMouseDown:pn.q,teactFastList:!0},o.ZP.createElement("div",{className:(0,fe.Z)("sticky-date",!R&&"interactive"),key:"date-header",onMouseDown:pn.q,onClick:R?void 0:()=>B({selectedAt:e.datetime})},o.ZP.createElement("span",{dir:"auto"},R&&e.originalDate===s.t4&&D("MessageScheduledUntilOnline"),R&&e.originalDate!==s.t4&&D("MessageScheduledOn",(0,L.j1)(D,e.datetime,void 0,!0)),!R&&(0,L.j1)(D,e.datetime))),(0,g.xH)(a))}));return o.ZP.createElement("div",{className:"messages-container",teactFastList:!0},o.ZP.createElement("div",{ref:U,key:"backwards-trigger",className:"backwards-trigger"}),(0,g.xH)(G),r&&o.ZP.createElement(Ga,{key:t,chatId:t,containerRef:f}),o.ZP.createElement("div",{ref:F,key:"forwards-trigger",className:"forwards-trigger"}),o.ZP.createElement("div",{ref:$,key:"fab-trigger",className:"fab-trigger"}))}));var _a=n(3547);const za=(0,o.X$)((0,a.c$)(((e,t)=>{let{userId:n}=t;const{stickers:a}=e.stickers.greeting,s=(0,l.db)(n)+(0,l.db)(e.currentUserId),o=null!=a&&a.length?a[s%a.length]:void 0,i=(0,r.Z1)(e,n);return i?{sticker:o,lastUnreadMessageId:i.lastMessage&&i.lastMessage.id!==i.lastReadInboxMessageId?i.lastMessage.id:void 0,connectionState:e.connectionState}:{}}))((e=>{let{sticker:t,connectionState:n,lastUnreadMessageId:s}=e;const{loadGreetingStickers:i,sendMessage:r,markMessageListRead:c}=(0,a.uC)(),l=(0,$e.Z)(),d=(0,o.sO)(null),{observe:u}=(0,Pn.S1)({rootRef:d,debounceMs:200});(0,o.d4)((()=>{t||"connectionStateReady"!==n||i()}),[n,i,t]),(0,o.d4)((()=>{"connectionStateReady"===n&&s&&c({maxId:s})}),[n,c,s]);const m=(0,o.I4)((e=>{e={...e,isPreloadedGlobally:!0},r({sticker:e})}),[r]);return o.ZP.createElement("div",{className:"ContactGreeting",ref:d},o.ZP.createElement("div",{className:"wrapper"},o.ZP.createElement("p",{className:"title",dir:"auto"},l("Conversation.EmptyPlaceholder")),o.ZP.createElement("p",{className:"description",dir:"auto"},l("Conversation.GreetingText")),o.ZP.createElement("div",{className:"sticker"},t&&o.ZP.createElement(_a.Z,{sticker:t,onClick:m,clickArg:t,observeIntersection:u,size:160,className:"large"}))))}))),Va=(0,o.X$)((e=>{let{isChatWithSelf:t,type:n,isGroupChatJustCreated:a}=e;const s=(0,$e.Z)();return"scheduled"===n?function(e){return o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,e("ScheduledMessages.EmptyPlaceholder")))}(s):t?function(e){return o.ZP.createElement("div",{className:"NoMessages"},o.ZP.createElement("div",{className:"wrapper"},o.ZP.createElement("i",{className:"icon icon-cloud-download"}),o.ZP.createElement("h3",{className:"title"},e("Conversation.CloudStorageInfo.Title")),o.ZP.createElement("ul",{className:"description"},o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description1")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description2")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description3")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description4")))))}(s):a?function(e){return o.ZP.createElement("div",{className:"NoMessages"},o.ZP.createElement("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0},o.ZP.createElement("h3",{className:"title"},e("EmptyGroupInfo.Title")),o.ZP.createElement("p",{className:"description"},e("EmptyGroupInfo.Subtitle")),o.ZP.createElement("ul",{className:"list-checkmarks"},o.ZP.createElement("li",null,e("EmptyGroupInfo.Line1")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line2")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line3")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line4")))))}(s):o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,s("NoMessages")))})),Xa=(0,M.Ds)((e=>e()),200,!1),Ka=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:a,type:s}=t;const o=(0,r.Z1)(e,n);if(!o)return{};const i=(0,r.$W)(e,n,a,s),c="scheduled"===s?(0,r.Fn)(e,n):(0,r.Zw)(e,n),d=(0,r.qS)(e,n,a);if(a!==u._f&&!(c&&d&&c[d]))return{};const{isRestricted:m,restrictionReason:h,lastMessage:g}=o,p=(0,r.G$)(e,n),f=a===u._f&&!i&&!o.unreadCount&&!p&&g&&!g.groupedId,v=(0,r.IK)(e,n);let I;return(0,r.pk)(e,n)&&(I=v.fullInfo?v.fullInfo.botDescription||"NoMessages":"Updating bot info..."),{isChatLoaded:!0,isRestricted:m,restrictionReason:h,isChannelChat:(0,l.eA)(o),isGroupChat:(0,l.Bf)(o),isCreator:o.isCreator,isChatWithSelf:(0,r.FM)(e,n),isRepliesChat:(0,l.pK)(n),isBot:Boolean(v),messageIds:i,messagesById:c,firstUnreadId:(0,r.It)(e,n,a),isViewportNewest:"thread"!==s||(0,r.b9)(e,n,a),threadFirstMessageId:(0,r.yZ)(e,n,a),focusingId:p,isSelectModeActive:(0,r.CA)(e),botDescription:I,threadTopMessageId:d,hasLinkedChat:o.fullInfo&&"linkedChatId"in o.fullInfo?Boolean(o.fullInfo.linkedChatId):void 0,lastSyncTime:e.lastSyncTime,...f&&{lastMessage:g}}}))((e=>{var t,n,i,c,d,u;let{chatId:p,threadId:f,type:v,hasTools:I,onFabToggle:y,onNotchToggle:Z,isChatLoaded:P,isChannelChat:C,isGroupChat:w,canPost:b,isReady:E,isChatWithSelf:S,isRepliesChat:R,isCreator:k,isBot:T,messageIds:N,messagesById:B,firstUnreadId:x,isViewportNewest:A,threadFirstMessageId:L,isRestricted:O,restrictionReason:U,focusingId:F,isSelectModeActive:$,lastMessage:D,botDescription:j,threadTopMessageId:Q,hasLinkedChat:q,lastSyncTime:G,withBottomShift:H}=e;const{loadViewportMessages:_,setScrollOffset:z,loadSponsoredMessages:V,loadMessageReactions:X,copyMessagesByIds:K}=(0,a.uC)(),W=(0,o.sO)(null),Y=(0,o.sO)("thread"===v&&(0,r.Vt)((0,a.Rd)(),p,f)||0),J=(0,o.sO)(),ee=(0,o.sO)(),te=(0,o.sO)(),ne=(0,o.sO)(),ae=(0,o.sO)(),se=(0,o.sO)(),oe=(0,o.sO)(!1),ie=(0,o.sO)(Boolean(D)),[re,ce]=(0,o.eJ)(),le=Boolean(N);(0,we.Z)((()=>{le&&(0,M.R3)((()=>{ie.current=!1}))}),[le]),(0,we.Z)((()=>{ne.current=x}),[x]),(0,we.Z)((()=>{C&&E&&G&&V({chatId:p})}),[p,E,C,G]),(0,we.Z)((()=>{le&&(ae.current=ne.current)}),[le]),(0,we.Z)((()=>{se.current=F}),[F]),(e=>{(0,o.d4)((()=>{function t(t){if((h.jm&&t.metaKey||!h.jm&&t.ctrlKey)&&"c"===(0,Le.Z)(t)){const n=(0,Zn.Z)();n&&n.length>0&&(t.preventDefault(),e({messageIds:n}))}}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}),[e])})(K);const de=(0,o.Ye)((()=>{if(!N||!B)return;const e=!Q||N[0]&&L!==N[0]?N:[Q,...N];if(!e.length)return;const t=e.map((e=>B[e])).filter(Boolean);return gn((0,g.Xo)(t,["date","id"]),ae.current)}),[N,B,L,Q]);(0,yn.Z)((()=>{if(!N||!B)return;const e=N.filter((e=>{var t;return null===(t=B[e])||void 0===t?void 0:t.reactions}));e.length&&X({chatId:p,ids:e})}),15e3);const ue=(0,o.Ye)((()=>{if("thread"===v)return(0,M.Ds)((()=>_({direction:m.Uq.Around})),1e3,!0,!1)}),[_,N]),{isScrolled:me,updateStickyDates:he}=function(){const[e,t]=(0,Ue.Z)(!1),n=(0,fn.Z)(1e3,!0);return{isScrolled:e,updateStickyDates:(0,o.I4)(((e,a)=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,M.T2)((()=>{document.body.classList.add("is-scrolling-messages")})),n((()=>{(0,M.T2)((()=>{const t=document.querySelector(".stuck");t&&t.classList.remove("stuck");const n=function(e,t){const n=e.querySelectorAll(".sticky-date"),a=e.scrollTop;return Array.from(n).find((e=>{const{offsetTop:n,offsetHeight:s}=e,o=n-a;return-s<=o&&o<=(t?60:10)}))}(e,a);n&&n.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")}))}))}),[t,n])}}(),ge=(0,o.sO)(),ve=(0,o.sO)(),Ie=(0,o.I4)((()=>{if(oe.current)return void(oe.current=!1);ge.current=!0;const e=W.current;se.current||he(e,I),Xa((()=>{ge.current=!1,(0,M.T2)((()=>{e.parentElement&&(Y.current=e.scrollHeight-e.scrollTop,"thread"===v&&z({chatId:p,threadId:f,scrollOffset:Y.current}))}))}))}),[he,I,v,z,p,f]);(0,o.d4)((()=>{if(!("ResizeObserver"in window))return;const e=new ResizeObserver((e=>{let[t]=e;t.target.offsetParent&&ce(t.contentRect.height)}));return e.observe(W.current),()=>{e.disconnect()}}),[]);const{height:ye}=Mt();(0,o.d4)((()=>{W.current.dataset.normalHeight=String(W.current.offsetHeight)}),[ye,b]),(0,o.d4)((()=>{if(!ue||!P||O||F)return;if(N&&N[N.length-1]>=s.AE)return;const e=W.current;(!N||N.length{if(!N||!te.current)return;const e=te.current.filter((e=>N.includes(Number(e.dataset.messageId)))),t=e[1]||e[0];t&&(J.current=t.id,ee.current=t.getBoundingClientRect().top)}),[N,A,re,I]),(0,un.Z)((e=>{let[t,n,a]=e;const o=W.current;te.current=Array.from(o.querySelectorAll(".message-list-item"));const i=N&&t&&N[N.length-1]!==t[t.length-1],r=(null==N?void 0:N[0])!==(null==t?void 0:t[0])&&(null==N?void 0:N.length)===s.hT/2+1,c=i&&!r,l=N&&se.current===N[N.length-1],d=A&&c&&N&&N.length{o.parentElement&&o.parentElement.classList.remove("force-messages-scroll")}),500));const{scrollTop:u,scrollHeight:m,offsetHeight:h}=o,g=Y.current,p=te.current[te.current.length-1];let f=g-(a||h);c&&(f-=p?p.offsetHeight:0);const v=A&&n&&f<=20;let y;if(c&&v&&!l&&(p&&(0,M.T2)((()=>{(0,In.Z)(o,p,"end",20)})),y=m-h,Y.current=Math.max(Math.ceil(m-y),h),!d))return;const Z=void 0!==a&&a!==re,P=J.current&&o.querySelector(`#${J.current}`),C=!P&&ae.current&&o.querySelector(".unread-divider");if(v&&Z){if((0,In.N)())return;y=m-h}else P?(ve.current&&(ve.current=!1,(0,vn.z)(o)),y=u+(P.getBoundingClientRect().top-(ee.current||0))):y=C?Math.min(C.offsetTop-(I?60:10),m-g):m-g;(0,vn.Z)(o,Math.ceil(y)),se.current||(oe.current=!0,(0,M.T2)((()=>{oe.current=!1}))),Y.current=Math.max(Math.ceil(m-y),h)}),[N,A,re,I]),(0,mn.Z)((e=>{let[t]=e;void 0!==t&&(0,pe.YW)(200+s.fK)}),[$]);const Ze=(0,$e.Z)(),Pe=Boolean(p&&(0,l.YC)(p)),Ce=Boolean(!Pe&&!C||S||R),be=Boolean(!Ce||C),Ee=(0,l.YC)(p)&&!S&&!T&&(!de&&!D&&N&&(!te.current||0===te.current.length)||1===(null==N?void 0:N.length)&&"contactSignUp"===(null==B||null===(t=B[N[0]])||void 0===t||null===(n=t.content.action)||void 0===n?void 0:n.type)||"contactSignUp"===(null==D||null===(i=D.content)||void 0===i||null===(c=i.action)||void 0===c?void 0:c.type)),Me=w&&k&&1===(null==N?void 0:N.length)&&"chatCreate"===(null==B||null===(d=B[N[0]])||void 0===d||null===(u=d.content.action)||void 0===u?void 0:u.type),Se=(0,fe.Z)("MessageList custom-scroll",be&&"no-avatars",!b&&"no-composer","pinned"===v&&"type-pinned",H&&"with-bottom-shift",$&&"select-mode-active",me&&"scrolled",!E&&"is-animating");return o.ZP.createElement("div",{ref:W,className:Se,onScroll:Ie,onMouseDown:pn.q},O?o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,U?U.text:"This is a private "+(C?"channel":"chat"))):j?o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,(0,an.Z)(Ze(j),["br","emoji","links"]))):Ee?o.ZP.createElement(za,{userId:p}):!N||de&&!Me?N&&de||D?o.ZP.createElement(Ha,{chatId:p,messageIds:N||[D.id],messageGroups:de||gn([D]),isViewportNewest:Boolean(A),isUnread:Boolean(x),withUsers:Ce,areReactionsInMeta:Pe,noAvatars:be,containerRef:W,anchorIdRef:J,memoUnreadDividerBeforeIdRef:ae,memoFirstUnreadIdRef:ne,threadId:f,type:v,isReady:E,isScrollingRef:ge,isScrollPatchNeededRef:ve,threadTopMessageId:Q,hasLinkedChat:q,isSchedule:!!de&&"scheduled"===v,noAppearanceAnimation:!de||!ie.current,onFabToggle:y,onNotchToggle:Z}):o.ZP.createElement(ct.Z,{color:"white",backgroundColor:"dark"}):o.ZP.createElement(Va,{chatId:p,type:v,isChatWithSelf:S,isGroupChatJustCreated:Me}))}))),Wa=(0,o.X$)((0,a.c$)((e=>{const t=(0,r.Bt)(e);if(!t)return{};const{chatId:n,threadId:a,type:s}=t,o=(0,r.Z1)(e,n);return{messageListType:s,unreadCount:o&&a===u._f&&"thread"===s?o.unreadCount:void 0}}))((e=>{let{isShown:t,canPost:n,messageListType:s,unreadCount:i,withExtraShift:r}=e;const{focusNextReply:c}=(0,a.uC)(),l=(0,$e.Z)(),d=(0,o.sO)(null),u=(0,o.I4)((()=>{if(t)if("thread"===s)c();else{const e=d.current.parentElement.querySelector(".MessageList"),t=e.querySelectorAll(".message-list-item"),n=t[t.length-1];if(!n)return;(0,In.Z)(e,n,"end",20)}}),[t,s,c]),m=(0,fe.Z)("ScrollDownButton",t&&"revealed",!n&&"no-composer",r&&"with-extra-shift");return o.ZP.createElement("div",{ref:d,className:m},o.ZP.createElement("div",{className:"ScrollDownButton-inner"},o.ZP.createElement(ze.Z,{color:"secondary",round:!0,onClick:u,ariaLabel:l("AccDescrPageDown")},o.ZP.createElement("i",{className:"icon-arrow-down"})),Boolean(i)&&o.ZP.createElement("div",{className:"unread-count"},(0,Te.bi)(i))))})));var Ya=n(5723);const Ja=1280,es=/\.[^/.]+$/;async function ts(e,t,n,a){const o=URL.createObjectURL(t),{type:i,size:r}=t;let c,l;if(s.oG.has(i))if(n){const t=await(0,Et.pt)(o),{width:n,height:s}=t;if(n>Ja||s>Ja||"image/jpeg"!==i){const t=await Kt(o,Ja/Math.max(n,s),"image/jpeg");return URL.revokeObjectURL(o),ts(e,await(0,Et.gm)(t),!0,a)}"image/jpeg"===i&&(e=e.replace(es,".jpg")),c={width:n,height:s}}else l=o;else if(s.wG.has(i)){const{videoWidth:e,videoHeight:t,duration:n}=await(0,Et.jj)(o);c={width:e,height:t,duration:n},l=await(0,Et.ud)(o)}return{blobUrl:o,filename:e,mimeType:i,size:r,quick:c,previewBlobUrl:l,...a}}function ns(e){const t=window.getSelection();if(null!=t&&t.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const a=n.createContextualFragment(e),s=a.lastChild;n.insertNode(a),s?(n.setStartAfter(s),n.setEndAfter(s)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}var as=n(6391);let ss;function os(e){ss.focus(),e.focus()}h.cj&&(ss=document.createElement("input"),ss.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(ss));var is=n(4784),rs=n(2400),cs=n(6389),ls=n(971);const ds={encoderPath:new URL(n(8973),n.b).href,reuseWorker:!0},us={type:"audio/ogg"};let ms,hs,gs;async function ps(){return ms||(ms=n.e(161).then(n.t.bind(n,1161,23)),hs=(await ms).default,gs=new hs(ds)),ms}async function fs(e){await async function(){await ps(),await gs.start()}();const t=Date.now();let n;const a=[],s=[];gs.ondataavailable=e=>{a.push(e)};const o=function(t,n){const a=t.sourceNode,o=a.context.createAnalyser();o.fftSize=64,a.connect(o);const i=o.frequencyBinCount,r=new Uint8Array(i);let c=!1;return function t(){if(c)return;o.getByteFrequencyData(r);const n=r.reduce(((e,t)=>e+t),0)/i/255;(t=>{s.push(255*t),e(t)})(n<.1?0:n),requestAnimationFrame(t)}(),()=>{c=!0}}(gs);return{stop:()=>new Promise(((e,i)=>{gs.onstop=()=>{e({blob:new Blob(a,us),duration:Math.round(((n||Date.now())-t)/1e3),waveform:s})},gs.onerror=i;const r=Math.max(0,t+1e3-Date.now());setTimeout((()=>{gs.stop(),o()}),r)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{gs.pause(),n=Date.now(),o()}),e)}}}var vs=n(1262);const Is=["image/png","image/jpeg","image/gif"];let ys,Zs;var Ps=n(3575),Cs=n(9295);function ws(e,t,n){const a=(0,fn.Z)(t,!0),[s,i]=(0,o.eJ)(),[r,c,l]=(0,Ue.Z)();return(0,pe.ZP)(c,l),(0,we.Z)((()=>{r||a((()=>{i(e())}))}),[...n,r]),s}const bs=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,Es=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Ms={username:"",query:"",canShowHelp:!1,usernameLowered:""},Ss=document.createElement("div");const Rs=(0,M.P2)((e=>e()),500,!0),ks=/^[\w@]{1,32}\s?/i,Ts=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"DeleteMessageModal",!t);return n?o.ZP.createElement(n,e):void 0}));function Ns(){return Ns=Object.assign||function(e){for(var t=1;t{let{onActivate:t,...n}=e;const a=(0,o.sO)(!1),s=(0,o.I4)((()=>{if(a.current=!0,xs)return xs=!1,void t();Bs&&(clearTimeout(Bs),Bs=void 0),Bs=window.setTimeout((()=>{a.current&&t()}),200)}),[t]),i=(0,o.I4)((()=>{a.current=!1}),[]);return o.ZP.createElement(ze.Z,Ns({},n,{onMouseEnter:h.$b?void 0:s,onMouseLeave:h.$b?void 0:i,onClick:h.$b?t:void 0}))})),Ls=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"CalendarModal",!t);return n?o.ZP.createElement(n,e):void 0})),Os=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"AttachMenu",!t);return n?o.ZP.createElement(n,e):void 0})),Us=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"SymbolMenu",!t);return n?o.ZP.createElement(n,e):void 0})),Fs=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"InlineBotTooltip",!t);return n?o.ZP.createElement(n,e):void 0})),$s=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"MentionTooltip",!t);return n?o.ZP.createElement(n,e):void 0})),Ds=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"CustomSendMenu",!t);return n?o.ZP.createElement(n,e):void 0})),js=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"StickerTooltip",!t);return n?o.ZP.createElement(n,e):void 0}));var Qs=n(9830);const qs=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"BotCommandTooltip",!t);return n?o.ZP.createElement(n,e):void 0}));var Gs=n(6503);const Hs=(0,o.X$)((0,a.c$)(((e,t)=>{let{messageId:n}=t;const{chatId:a}=(0,r.Bt)(e)||{};return a?{message:(0,r.hj)(e,a,n)}:{}}))((e=>{let{isOpen:t,message:n,onClose:s}=e;const{clickInlineButton:i}=(0,a.uC)(),[r,c]=(0,Gs.Z)(t,s),{isKeyboardSingleUse:l}=n||{},[d,u,m]=(0,Ue.Z)(!0),g=()=>{m(),s()};if((0,o.d4)((()=>{u()}),[u,null==n?void 0:n.keyboardButtons]),n&&n.keyboardButtons)return o.ZP.createElement(ut.Z,{isOpen:t||d,autoClose:l,positionX:"right",positionY:"bottom",onClose:g,className:"BotKeyboardMenu",onCloseAnimationEnd:g,onMouseEnter:h.$b?void 0:r,onMouseLeave:h.$b?void 0:c,noCompact:!0},o.ZP.createElement("div",{className:"content"},n.keyboardButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(ze.Z,{ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>i({button:e})},e.text))))))))})));var _s=n(3616),zs=n(7891);const Vs=(0,o.X$)((0,a.c$)((e=>{const{chatId:t,threadId:n,type:a}=(0,r.Bt)(e)||{};if(!t||!n||!a)return{};const{currentUserId:s,forwardMessages:{fromChatId:o,toChatId:i,messageIds:c}}=e,d=(0,r.Yy)(e,t,n),u="scheduled"===a?(0,r.wU)(e,t):(0,r._$)(e,t,n),m=e.settings.byKey.animationLevel>=1,h=i===t;let g,p;if(d?g=(0,r.hj)(e,t,d):u?g=(0,r.kK)(e,t,n,a):h&&1===c.length&&(g=(0,r.hj)(e,o,c[0])),d&&g){const{forwardInfo:n}=g,a=t===s;n&&(n.isChannelPost||a)&&(p=(0,r.cv)(e,g)),p||(p=(0,r.Ur)(e,g))}else h&&(p=(0,l.YC)(o)?(0,r.dy)(e,o):(0,r.Z1)(e,o));return{replyingToId:d,editingId:u,message:g,sender:p,shouldAnimate:m,forwardedMessagesCount:h?c.length:void 0}}))((e=>{let{replyingToId:t,editingId:n,message:s,sender:i,shouldAnimate:r,forwardedMessagesCount:c}=e;const{setReplyingToId:l,setEditingId:d,focusMessage:u,exitForwardMode:m}=(0,a.uC)(),h=Boolean((t||n)&&s||i&&c),g=(0,zs.Z)([c],c?300:void 0),{shouldRender:p,transitionClassNames:f}=(0,Ze.Z)(g&&h,void 0,!r,void 0,!r),v=(0,o.I4)((()=>{t?l({messageId:void 0}):n?d({messageId:void 0}):c&&m()}),[t,n,c,l,d,m]);(0,o.d4)((()=>h?(0,Ae.Z)(v):void 0),[h,v]);const I=(0,o.I4)((()=>{u({chatId:s.chatId,messageId:s.id})}),[u,s]),y=(0,fe.Z)("ComposerEmbeddedMessage",f),Z=c&&c>1?`${c} forwarded messages`:void 0;if(p)return o.ZP.createElement("div",{className:y},o.ZP.createElement("div",null,o.ZP.createElement(ze.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:"Cancel replying",onClick:v},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(Gn,{className:"inside-input",message:s,sender:i,customText:Z,title:n?"Edit Message":void 0,onClick:I})))}))),Xs=(0,o.X$)((e=>{const{attachments:t}=e,n=(0,rt.Z)(it.gl.Extra,"AttachmentModal",!t.length);return n?o.ZP.createElement(n,e):void 0})),Ks=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"BotCommandMenu",!t);return n?o.ZP.createElement(n,e):void 0})),Ws=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"PollModal",!t);return n?o.ZP.createElement(n,e):void 0})),Ys=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"DropArea",!t);return n?o.ZP.createElement(n,e):void 0})),Js=new RegExp(s.FM,"i"),eo=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:a}=t;const s=(0,r.tV)(e,n,a);return{theme:(0,r.Pu)(e),webPagePreview:e.webPagePreview,noWebPage:s}}))((e=>{let{chatId:t,threadId:n,messageText:s,disabled:i,webPagePreview:r,noWebPage:c,theme:l}=e;const{loadWebPagePreview:d,clearWebPagePreview:m,toggleMessageWebPage:h}=(0,a.uC)(),g=ws((()=>{const{text:e,entities:t}=(0,v.Z)(s),n=t&&t.find((e=>{let{type:t}=e;return t===u.Vv.TextUrl}));if(n)return n.url;const a=e.match(Js);return a?a[0]:void 0}),300,[s]);(0,o.d4)((()=>{g?d({text:g}):(m(),h({chatId:t,threadId:n}))}),[t,h,m,g,d,n]),(0,we.Z)((()=>{m(),h({chatId:t,threadId:n})}),[t]);const p=Boolean(r&&s.length&&!c&&!i),{shouldRender:f,transitionClassNames:I}=(0,Ze.Z)(p),y=(0,Bt.Z)(r,!0);if(!f||!y)return;const{photo:Z,...P}=y,C={content:{webPage:P}};return o.ZP.createElement("div",{className:(0,fe.Z)("WebPagePreview",I)},o.ZP.createElement("div",null,o.ZP.createElement(ze.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:()=>{h({chatId:t,threadId:n,noWebPage:!0})}},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(ba,{message:C,inPreview:!0,theme:l})))}))),to=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"SendAsMenu",!t);return n?o.ZP.createElement(n,e):void 0}));var no;!function(e){e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule"}(no||(no={}));const ao="wonderful-voice-message.ogg",so=(0,o.X$)((0,a.c$)(((e,t)=>{var n,a,o,i,c;let{chatId:d,threadId:m,messageListType:h}=t;const g=(0,r.Z1)(e,d),p=g&&(0,r.Dg)(e,g),f=d!==s.FV?(0,r.IK)(e,d):void 0,v=Boolean(f),I=(0,r.FM)(e,d),y=v&&(0,r.FT)(e,d),Z=(0,r.qy)(e,d),{language:P,shouldSuggestStickers:C}=e.settings.byKey,w=e.emojiKeywords[s.pR],b=P!==s.pR?e.emojiKeywords[P]:void 0,E=y?y.id:void 0,M=E?(0,r.hj)(e,d,E):void 0,{currentUserId:S}=e,R=null!=g&&g.fullInfo?(null==g||null===(n=g.fullInfo)||void 0===n?void 0:n.sendAsId)||S:void 0,k=null!=g&&g.sendAsIds&&R&&g.sendAsIds.includes(R)?R:null!=g&&null!==(a=g.adminRights)&&void 0!==a&&a.anonymous?null==g?void 0:g.id:void 0,T=k?(0,r.dy)(e,k):void 0,N=!T&&k?(0,r.Z1)(e,k):void 0;return{editingMessage:(0,r.kK)(e,d,m,h),connectionState:e.connectionState,draft:(0,r.Ms)(e,d,m),chat:g,isChatWithBot:v,isChatWithSelf:I,canScheduleUntilOnline:Boolean(!I&&!v&&g&&p&&(0,l.YC)(d)&&(null===(o=(0,r.ss)(e,d))||void 0===o?void 0:o.wasOnline)),isRightColumnShown:(0,r.Jf)(e),isSelectModeActive:(0,r.CA)(e),withScheduledButton:m===u._f&&"thread"===h&&Boolean(null==Z?void 0:Z.length),shouldSchedule:"scheduled"===h,botKeyboardMessageId:E,botKeyboardPlaceholder:null==M?void 0:M.keyboardPlaceholder,isForwarding:d===e.forwardMessages.toChatId,isPollModalOpen:e.isPollModalOpen,stickersForEmoji:e.stickers.forEmoji.stickers,groupChatMembers:null==g||null===(i=g.fullInfo)||void 0===i?void 0:i.members,topInlineBotIds:null===(c=e.topInlineBots)||void 0===c?void 0:c.userIds,currentUserId:S,lastSyncTime:e.lastSyncTime,contentToBeScheduled:e.messages.contentToBeScheduled,shouldSuggestStickers:C,recentEmojis:e.recentEmojis,baseEmojiKeywords:null==w?void 0:w.keywords,emojiKeywords:null==b?void 0:b.keywords,serverTimeOffset:e.serverTimeOffset,inlineBots:e.inlineBots.byUsername,isInlineBotLoading:e.inlineBots.isLoading,chatBotCommands:g&&g.fullInfo&&g.fullInfo.botCommands,botCommands:f&&f.fullInfo?f.fullInfo.botCommands||!1:void 0,sendAsUser:T,sendAsChat:N,sendAsId:k}}))((e=>{let{dropAreaState:t,shouldSchedule:n,canScheduleUntilOnline:i,isReady:r,onDropHide:d,editingMessage:m,chatId:g,threadId:f,messageListType:I,draft:y,chat:Z,connectionState:P,isChatWithBot:C,isChatWithSelf:w,isRightColumnShown:b,isSelectModeActive:E,isForwarding:S,isPollModalOpen:R,botKeyboardMessageId:k,botKeyboardPlaceholder:T,withScheduledButton:N,stickersForEmoji:B,groupChatMembers:x,topInlineBotIds:A,currentUserId:O,lastSyncTime:U,contentToBeScheduled:F,shouldSuggestStickers:$,baseEmojiKeywords:D,emojiKeywords:j,serverTimeOffset:Q,recentEmojis:q,inlineBots:G,isInlineBotLoading:H,botCommands:_,chatBotCommands:z,sendAsUser:V,sendAsChat:X,sendAsId:K}=e;const{sendMessage:W,clearDraft:Y,showDialog:ee,setStickerSearchQuery:te,setGifSearchQuery:ne,forwardMessages:ae,openPollModal:se,closePollModal:oe,loadScheduledHistory:ie,openChat:re,addRecentEmoji:ce,sendInlineBotResult:le,loadSendAs:de,loadFullChat:ue}=(0,a.uC)(),me=(0,$e.Z)(),he=(0,o.sO)(null),[ge,pe]=(0,o.eJ)(""),ve=(0,ls.Y)(ge),Ie=(0,o.sO)(),ye=(0,Rt.Z)(t),[Ze,be,Ee]=(0,Ue.Z)(),[Me,Se]=(0,o.eJ)(),{width:Re}=J.Z.get(),ke=null==Z?void 0:Z.sendAsIds,Te=ke&&(ke.length>1||!ke.includes(O)),Ne=(0,cs.Z)(g,f);(0,o.d4)((()=>{Ie.current=void 0}),[g]),(0,o.d4)((()=>{g&&U&&f===u._f&&r&&ie({chatId:g})}),[r,g,ie,U,f]),(0,o.d4)((()=>{g&&Z&&U&&!ke&&r&&(0,l.ZV)(Z)&&de({chatId:g})}),[Z,g,r,U,de,ke]),(0,o.d4)((()=>{g&&Z&&U&&!Z.fullInfo&&r&&(0,l.ZV)(Z)&&ue({chatId:g})}),[Z,g,r,U,ue]);const Be=(0,o.sO)(!1);(0,we.Z)((e=>{let[t,n]=e;Be.current=Boolean(g===t&&ke&&!n)}),[g,ke]),(0,o.bt)((()=>{he.current&&(he.current.innerHTML='')}),[]),(0,o.d4)((()=>{F&&(Se(F),be())}),[F,be]);const[xe,Le]=(0,o.eJ)([]),[Oe,Fe,De]=(0,Ue.Z)(),[je,Qe,qe]=(0,Ue.Z)(),[Ge,He,_e]=(0,Ue.Z)(),[Ve,Xe,Ke]=(0,Ue.Z)(),[We,Je,et]=(0,Ue.Z)(),[tt,nt,at]=(0,Ue.Z)(),[st,ot]=(0,Ue.Z)(),[it,rt,ct]=(0,Ue.Z)(),{startRecordingVoice:lt,stopRecordingVoice:dt,pauseRecordingVoice:ut,activeVoiceRecording:mt,currentRecordTime:ht,recordButtonRef:gt,startRecordTimeRef:pt}=(()=>{const e=(0,o.sO)(null),[t,n]=(0,o.eJ)(),a=(0,o.sO)(),[s,i]=(0,o.eJ)();(0,o.d4)((()=>{h.s$&&h.mh&&ps()}),[]);const r=(0,o.I4)((async()=>{try{const{stop:t,pause:s}=await fs((t=>{e.current&&(a.current&&Date.now()%4==0&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`),i(Date.now()))}));a.current=Date.now(),i(Date.now()),n({stop:t,pause:s})}catch(e){console.error(e)}}),[]),c=(0,o.I4)((()=>{if(t){e.current&&(e.current.style.boxShadow="none");try{return t.pause()}catch(e){return void console.error(e)}}}),[t]),l=(0,o.I4)((()=>{if(t){n(void 0),a.current=void 0,i(void 0),e.current&&(e.current.style.boxShadow="none");try{return t.stop()}catch(e){return void console.error(e)}}}),[t]);return(0,o.d4)((()=>t?(0,Ae.Z)(l):void 0),[t,l]),{startRecordingVoice:r,pauseRecordingVoice:c,stopRecordingVoice:l,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:a}})();(0,yn.Z)((()=>{Ne({type:"recordAudio"})}),mt&&s.o_),(0,o.d4)((()=>{mt||Ne({type:"cancel"})}),[mt,Ne]);const ft=m?no.Edit:!h.mh||mt||ge&&!xe.length||S?n?no.Schedule:no.Send:no.Record,vt=!n,{isMentionTooltipOpen:It,closeMentionTooltip:yt,insertMention:Zt,mentionFilteredUsers:Pt}=(0,Cs.Z)(!xe.length,ve,pe,void 0,x,A,O),{isOpen:wt,id:bt,isGallery:Et,switchPm:Mt,results:St,closeTooltip:kt,help:Tt,loadMore:Nt}=function(e,t,n,s){const{queryInlineBot:i,resetInlineBot:r}=(0,a.uC)(),[c,l,d]=(0,Ue.Z)(),{username:u,query:m,canShowHelp:h,usernameLowered:g}=ws((()=>function(e){const t=function(e){return Ss.innerHTML=e.replace(/
/g,"\n"),Ss.innerText}(e),n=t.match(bs);return n?{username:n[1],query:n[2],canShowHelp:""===n[2]&&!t.match(Es),usernameLowered:n[1].toLowerCase()}:Ms}(n)),300,[n])||{},p=(0,Rt.Z)(m),f=(0,Rt.Z)(u),v=g?null==s?void 0:s[g]:void 0,{id:I,switchPm:y,offset:Z,results:P,isGallery:C,help:w}=v||{};(0,o.d4)((()=>{p!==m&&d()}),[p,m,d]),(0,o.d4)((()=>{e&&g&&t&&i({chatId:t,username:g,query:m})}),[m,e,i,t,g]);const b=(0,o.I4)((()=>{i({chatId:t,username:g,query:m,offset:Z})}),[Z,t,m,i,g]);return(0,o.d4)((()=>{e&&I&&(y||null!=P&&P.length)?l():d()}),[I,e,l,P,y,d]),f!==u&&r({username:f}),{isOpen:c,id:I,isGallery:C,switchPm:y,results:P,closeTooltip:d,help:h&&w?`@${u} ${w}`:void 0,loadMore:b}}(Boolean(!xe.length&&U),g,ge,G),{isOpen:Bt,close:xt,filteredBotCommands:At}=function(e,t,n,a){const[s,i,r]=(0,Ue.Z)(),[c,l]=(0,o.eJ)(),d=(0,o.I4)((e=>{n||a?Rs((()=>{const t=(n||a||[]).filter((t=>{let{command:n}=t;return!e||n.includes(e)}));l(t&&t.length?t:void 0)})):l(void 0)}),[n,a]);return(0,o.d4)((()=>{if(e&&t.length)if(t.startsWith("/")){const e=(0,rs._)(t.substr(1)).match(ks);d(e?e[0]:"")}else r();else r()}),[d,t,e,r]),(0,o.d4)((()=>{c&&c.length?i():r()}),[c,i,r]),{isOpen:s,close:r,filteredBotCommands:c}}(Boolean(_&&_.length||z&&z.length),ge,_,z),{isContextMenuOpen:Lt,handleContextMenu:Ot,handleContextMenuClose:Ut,handleContextMenuHide:Ft}=(0,bn.Z)(gt,!(ft===no.Send&&vt)),{canSendStickers:$t,canSendGifs:Dt,canAttachMedia:jt,canAttachPolls:Qt,canAttachEmbedLinks:qt}=(0,o.Ye)((()=>(0,l.H5)(Z,C)),[Z,C]),Gt=Z&&(0,l.Nl)(Z),Ht=(0,l.Hd)(Z),{isStickerTooltipOpen:_t,closeStickerTooltip:zt}=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=(0,o.Ye)((()=>(0,rs._)(t).trim()),[t]),{loadStickersForEmoji:r,clearStickersForEmoji:c}=(0,a.uC)(),l=h.op&&1===(0,is.Z)(i)||!h.op&&Boolean(t.match(/^]*?>$/g)),d=Boolean(n)&&l;return(0,o.d4)((()=>{var t;s||(e&&l?r({emoji:h.op?i:null===(t=i.match(/alt="(.+)"/))||void 0===t?void 0:t[1]}):!d&&l||c())}),[t,l,c,r,e,s]),{isStickerTooltipOpen:d,closeStickerTooltip:c}}(Boolean($&&$t&&!xe.length),ge,B,!r),{isEmojiTooltipOpen:Vt,closeEmojiTooltip:Xt,filteredEmojis:Kt,insertEmoji:Wt}=(0,Ps.Z)(Boolean($&&$t&&!xe.length),ve,q,void 0,pe,D,j,!r),Yt=(0,o.I4)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.R2;const n=window.getSelection(),a=document.getElementById(t),o=(0,an.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"​");if(n.rangeCount){const e=n.getRangeAt(0);if((0,as.R)(e,t))return ns(o),void a.dispatchEvent(new Event("input",{bubbles:!0}))}pe(`${ve.current}${o}`),requestAnimationFrame((()=>{(0,Ya.Z)(a)}))}),[ve]),Jt=(0,o.I4)((()=>{const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if((0,as.R)(t,s.R2))return void document.execCommand("delete",!1)}pe(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const a=n.textContent.length,s=document.createRange(),o=window.getSelection();s.setStart(n,a),s.setEnd(n,a),o.removeAllRanges(),o.addRange(s),document.execCommand("delete",!1);const i=t.innerHTML;return document.body.removeChild(t),i}(ve.current))}),[ve]),en=(0,o.I4)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||pe(""),Le(c.D),zt(),Ee(),Se(void 0),yt(),Xt(),h.wB?setTimeout((()=>Ke()),350):Ke()}),[zt,Ee,yt,Xt,Ke]),tn=(0,o.sO)();tn.current=dt,(0,o.d4)((()=>()=>{tn.current(),en()}),[g,en,tn]);const nn=((e,t,n,i,r)=>{const{editMessage:c}=(0,a.uC)();return(0,o.d4)((()=>{n?(t((0,pa.z)(n.content.text)),requestAnimationFrame((()=>{const e=document.getElementById(s.R2);(0,Ya.Z)(e,!0)}))):t("")}),[n,t]),(0,o.I4)((()=>{const{text:t,entities:a}=(0,v.Z)(e.current);n&&(t||(0,l.u8)(n)?(c({messageId:n.id,text:t,entities:a}),i()):r())}),[c,n,e,r,i])})(ve,pe,m,en,nt);((e,t,n,i,r,c)=>{const{saveDraft:l,clearDraft:d}=(0,a.uC)(),u=(0,o.I4)(((e,t)=>{const n=i.current;n.length&&!c?l({chatId:e,threadId:t,draft:(0,v.Z)(n)}):d({chatId:e,threadId:t})}),[d,c,i,l]),m=(0,o.Ye)((()=>(0,M.Ds)((e=>e()),s.r_,!1)),[t]),g=(0,Rt.Z)(t),p=(0,Rt.Z)(n);(0,o.d4)((()=>(ys=t,Zs=n,()=>{ys=void 0,Zs=void 0,u(t,n)})),[t,n,u]),(0,o.d4)((()=>{t===g&&n===p||e&&(r((0,pa.z)(e)),h.$b||requestAnimationFrame((()=>{const e=document.getElementById(s.R2);(0,Ya.Z)(e,!0)})))}),[t,n,e,r,u,g,p]);const f=i.current,I=(0,Rt.Z)(f);(0,o.d4)((()=>{t&&n&&g===t&&p===n&&I!==f&&(f.length?m((()=>{ys===t&&Zs===n&&u(t,n)})):u(t,n))}),[t,f,g,I,p,m,n,u]);const y=(0,o.I4)((()=>{t&&n&&u(t,n)}),[t,n,u]);(0,Pe.Z)(y),Ce(y)})(y,g,f,ve,pe,m),((e,t,n)=>{(0,o.d4)((()=>{async function a(a){if(!a.clipboardData)return;const o=document.activeElement;if(o&&![s.R2,s.nY].includes(o.id))return;const i=a.clipboardData.getData("text").substring(0,4096),{items:r}=a.clipboardData;let c=[];if(a.preventDefault(),r.length>0&&(c=await(0,vs.Z)(r)),0!==c.length||i){if(c.length>0&&!n){const e=await Promise.all(c.map((e=>ts(e.name,e,1===c.length&&Is.includes(e.type)))));t((t=>t.concat(e)))}i&&e(i,null==o?void 0:o.id)}}return document.addEventListener("paste",a,!1),()=>{document.removeEventListener("paste",a,!1)}}),[e,n,t])})(Yt,Le,m);const sn=(0,o.I4)((async(e,t)=>{Le(await Promise.all(e.map((e=>ts(e.name,e,t)))))}),[]),on=(0,o.I4)((async(e,t)=>{Le([...xe,...await Promise.all(e.map((e=>ts(e.name,e,t))))])}),[xe]),rn=(0,o.I4)((()=>{Le(c.D)}),[]),ln=(0,o.I4)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if("connectionStateReady"!==P)return;let n=xe;if(mt){const e=await dt();if(e){const{blob:t,duration:a,waveform:s}=e;n=[await ts(ao,t,!1,{voice:{duration:a,waveform:s}})]}}const{text:a,entities:o}=(0,v.Z)(ve.current);if(!n.length&&!a&&!S)return;const i=n.length?1024:4096;if((null==a?void 0:a.length)>i){const e=a.length-i;return void ee({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":e,"{PLURAL_S}":e>1?"s":""},hasErrorKey:!0}})}const r=document.getElementById(s.R2);if(n.length||a){if(Ht&&!Gt){const e=(0,p.b)(Q),t=Ie.current&&Math.floor(e-Ie.current),n=Ht.nextSendDate&&Ht.nextSendDate>e;if(t&&t{en()}))}),[P,xe,mt,S,Y,g,Q,en,dt,ee,Ht,Gt,W,ae,me,ve]),dn=(0,o.I4)((()=>{Ke(),Qe()}),[Ke,Qe]),un=(0,o.I4)((()=>{qe(),et(),Xe()}),[qe,et,Xe]),mn=(0,o.I4)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e={...e,isPreloadedGlobally:!0},n?(Se({sticker:e}),be()):(W({sticker:e}),requestAnimationFrame((()=>{en(t)})))}),[n,be,W,en]),hn=(0,o.I4)((e=>{n?(Se({gif:e}),be()):(W({gif:e}),requestAnimationFrame((()=>{en(!0)})))}),[n,be,W,en]),gn=(0,o.I4)((e=>{if("connectionStateReady"!==P)return;le({id:e.id,queryId:e.queryId});const t=document.getElementById(s.R2);h.cj&&t===document.activeElement&&os(t),Y({chatId:g,localOnly:!0}),requestAnimationFrame((()=>{en()}))}),[g,Y,P,en,le]),pn=(0,o.I4)((()=>{Y({chatId:g,localOnly:!0}),requestAnimationFrame((()=>{en()}))}),[g,Y,en]),fn=(0,o.I4)((e=>{n?(Se({poll:e}),oe(),be()):(W({poll:e}),oe())}),[oe,be,W,n]),vn=(0,o.I4)((()=>{n?(Se({isSilent:!0}),be()):ln(!0)}),[ln,be,n]),In=(0,o.I4)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{isSilent:n,...a}=Me||{},s=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:Q);Me&&0!==Object.keys(a).length?(W({...Me,scheduledAt:s}),requestAnimationFrame((()=>{en()}))):ln(Boolean(n),s),Ee()}),[Ee,ln,en,Me,W,Q]),Zn=(0,o.I4)((()=>{In(new Date(1e3*s.t4),!0)}),[In]),Pn=(0,o.I4)((()=>{Ee(),Se(void 0)}),[Ee]),Cn=(0,o.I4)((e=>{"stickers"===e?(te({query:""}),ne({query:void 0})):(ne({query:""}),te({query:void 0}))}),[te,ne]),wn=(0,o.I4)((()=>{const e=document.getElementById(s.R2);h.wB&&e===document.activeElement?(e.blur(),setTimeout((()=>{qe(),Xe()}),100)):Xe()}),[Xe,qe]),En=(0,o.I4)((()=>{const e=document.getElementById(s.R2);if(!h.wB||e!==document.activeElement)return qe(),Ke(),void Je();e.blur(),setTimeout((()=>{qe(),Ke(),Je()}),100)}),[qe,Ke,Je]),Mn=(0,o.I4)((()=>{re({id:g,threadId:f,type:"scheduled"})}),[re,g,f]);(0,o.d4)((()=>{b&&h.wB&&Ke()}),[b,Ke]),(0,o.d4)((()=>{r&&(E?rt():setTimeout((()=>{ct()}),200))}),[E,ct,rt,r]);const Sn=(0,o.I4)((()=>{switch(ft){case no.Send:ln();break;case no.Record:lt();break;case no.Edit:nn();break;case no.Schedule:mt&&ut(),be()}}),[ft,ln,lt,nn,mt,be,ut]),Rn=ft===no.Record&&!jt,kn=(0,Rt.Z)(m,!0),Tn=m||kn,Nn=new Date;Nn.setSeconds(0),Nn.setMilliseconds(0);const Bn=new Date;Bn.setFullYear(Bn.getFullYear()+1);let xn="SendMessage";switch(ft){case no.Edit:xn="Save edited message";break;case no.Record:xn=Rn?"Conversation.DefaultRestrictedMedia":"AccDescrVoiceMessage"}const An=(0,fe.Z)("Composer",!E&&"shown",it&&"hover-disabled"),Ln=(0,fe.Z)("mobile-symbol-menu-button",!r&&"not-ready",st?Ve&&"menu-opened":Ve&&"is-loading"),On=ft===no.Edit?nn:ft===no.Schedule?be:ln;return o.ZP.createElement("div",{className:An},jt&&r&&o.ZP.createElement(Ys,{isOpen:t!==Ct.t.None,withQuick:t===Ct.t.QuickFile||ye===Ct.t.QuickFile,onHide:d,onFileSelect:sn}),o.ZP.createElement(Xs,{chatId:g,threadId:f,attachments:xe,caption:xe.length?ge:"",groupChatMembers:x,currentUserId:O,recentEmojis:q,isReady:r,onCaptionUpdate:pe,baseEmojiKeywords:D,emojiKeywords:j,addRecentEmoji:ce,onSend:n?be:ln,onFileAppend:on,onClear:rn}),o.ZP.createElement(Ws,{isOpen:Boolean(R),onClear:oe,onSend:fn}),Tn&&o.ZP.createElement(Ts,{isOpen:tt,isSchedule:"scheduled"===I,onClose:at,message:Tn}),o.ZP.createElement(to,{isOpen:We,onClose:et,chatId:g,selectedSendAsId:K,sendAsIds:ke}),o.ZP.createElement($s,{isOpen:It,onClose:yt,onInsertUserName:Zt,filteredUsers:Pt}),o.ZP.createElement(Fs,{isOpen:wt,botId:bt,isGallery:Et,inlineBotResults:St,switchPm:Mt,onSelectResult:gn,loadMore:Nt,onClose:kt}),o.ZP.createElement(qs,{isOpen:Bt,withUsername:Boolean(z),botCommands:At,onClick:pn,onClose:xt}),o.ZP.createElement("div",{id:"message-compose"},o.ZP.createElement("div",{className:"svg-appendix",ref:he}),o.ZP.createElement(Vs,null),o.ZP.createElement(eo,{chatId:g,threadId:f,messageText:xe.length?"":ge,disabled:!qt}),o.ZP.createElement("div",{className:"message-input-wrapper"},C&&!1!==_&&!mt&&!m&&o.ZP.createElement(As,{className:(0,fe.Z)("bot-commands",je&&"activated"),round:!0,disabled:void 0===_,color:"translucent",onActivate:dn,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon-bot-commands-filled"})),Te&&(V||X)&&o.ZP.createElement(ze.Z,{round:!0,color:"translucent",onClick:We?et:En,ariaLabel:me("SendMessageAsTitle"),className:(0,fe.Z)("send-as-button",Be.current&&"appear-animation")},o.ZP.createElement(cn.Z,{user:V,chat:X,size:"tiny"})),h.wB?o.ZP.createElement(ze.Z,{className:Ln,round:!0,color:"translucent",onClick:Ve?Ke:wn,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon-smile"}),o.ZP.createElement("i",{className:"icon-keyboard"}),Ve&&!st&&o.ZP.createElement(Ye.Z,{color:"gray"})):o.ZP.createElement(As,{className:Ve?"activated":"",round:!0,color:"translucent",onActivate:un,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon-smile"})),o.ZP.createElement(_s.Z,{id:"message-input-text",chatId:g,threadId:f,html:xe.length?"":ge,placeholder:mt&&Re<=600?"":T||me("Message"),forcedPlaceholder:Tt,canAutoFocus:r&&!xe.length,shouldSuppressFocus:h.wB&&Ve,shouldSuppressTextFormatter:Vt||It||wt,onUpdate:pe,onSend:On,onSuppressedFocus:Ke}),H&&Boolean(bt)&&o.ZP.createElement(Ye.Z,{color:"gray"}),N&&o.ZP.createElement(ze.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Mn,ariaLabel:"Open scheduled messages"},o.ZP.createElement("i",{className:"icon-schedule"})),k&&!mt&&!m&&o.ZP.createElement(As,{className:Oe?"activated":"",round:!0,color:"translucent",onActivate:Fe,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon-bot-command"})),!mt&&!m&&o.ZP.createElement(As,{className:Ge?"activated":"",round:!0,color:"translucent",onActivate:He,ariaLabel:"Add an attachment"},o.ZP.createElement("i",{className:"icon-attach"})),mt&&ht&&o.ZP.createElement("span",{className:"recording-state"},(0,L.rM)(ht-pt.current)),o.ZP.createElement(js,{chatId:g,threadId:f,isOpen:_t,onStickerSelect:mn}),o.ZP.createElement(Qs.Z,{isOpen:Vt,emojis:Kt,onClose:Xt,onEmojiSelect:Wt,addRecentEmoji:ce}),o.ZP.createElement(Os,{isOpen:Ge,canAttachMedia:jt,canAttachPolls:Qt,onFileSelect:sn,onPollCreate:se,onClose:_e}),k&&o.ZP.createElement(Hs,{messageId:k,isOpen:Oe,onClose:De}),_&&o.ZP.createElement(Ks,{isOpen:je,botCommands:_,onClose:qe}),o.ZP.createElement(Us,{chatId:g,threadId:f,isOpen:Ve,canSendGifs:Dt,canSendStickers:$t,onLoad:ot,onClose:Ke,onEmojiSelect:Yt,onStickerSelect:mn,onGifSelect:hn,onRemoveSymbol:Jt,onSearchOpen:Cn,addRecentEmoji:ce}))),mt&&o.ZP.createElement(ze.Z,{round:!0,color:"danger",className:"cancel",onClick:dt,ariaLabel:"Cancel voice recording"},o.ZP.createElement("i",{className:"icon-delete"})),o.ZP.createElement(ze.Z,{ref:gt,round:!0,color:"secondary",className:(0,fe.Z)(ft,!r&&"not-ready",mt&&"recording"),disabled:Rn,ariaLabel:me(xn),onClick:Sn,onContextMenu:ft===no.Send&&vt?Ot:void 0},o.ZP.createElement("i",{className:"icon-send"}),o.ZP.createElement("i",{className:"icon-schedule"}),o.ZP.createElement("i",{className:"icon-microphone-alt"}),o.ZP.createElement("i",{className:"icon-check"})),vt&&o.ZP.createElement(Ds,{isOpen:Lt,onSilentSend:w?void 0:vn,onScheduleSend:n?void 0:be,onClose:Ut,onCloseAnimationEnd:Ft}),o.ZP.createElement(Ls,{isOpen:Ze,withTimePicker:!0,selectedAt:Nn.getTime(),maxAt:(0,L._F)(Bn),isFutureMode:!0,secondButtonLabel:i?me("Schedule.SendWhenOnline"):void 0,onClose:Pn,onSubmit:In,onSecondButtonClick:i?Zn:void 0}))}))),oo=(0,o.X$)((e=>{const{isActive:t}=e,n=(0,rt.Z)(it.gl.Extra,"MobileSearch",!t,!0);return n?o.ZP.createElement(n,e):void 0})),io=(0,o.X$)((e=>{const{isActive:t}=e,n=(0,rt.Z)(it.gl.Extra,"MessageSelectToolbar",!t);return n?o.ZP.createElement(n,e):void 0})),ro=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"UnpinAllMessagesModal",!t);return n?o.ZP.createElement(n,e):void 0})),co=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"PaymentModal",!t);return n?o.ZP.createElement(n,e):void 0})),lo=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"ReceiptModal",!t);return n?o.ZP.createElement(n,e):void 0})),uo=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"SeenByModal",!t);return n?o.ZP.createElement(n,e):void 0})),mo=(0,o.X$)((e=>{const{activeEmojiInteraction:t}=e,n=(0,rt.Z)(it.gl.Extra,"EmojiInteractionAnimation",!t);return n?o.ZP.createElement(n,e):void 0})),ho=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"ReactorListModal",!t);return n?o.ZP.createElement(n,e):void 0})),go=h.wB?450+s.fK:void 0;function po(e){return"file"===e.kind&&e.type&&s.oG.has(e.type)}const fo=(0,o.X$)((0,a.c$)((e=>{const t=(0,r.Pu)(e),{isBlurred:n,background:a,backgroundColor:s,patternColor:o}=e.settings.themes[t]||{},{messageLists:i}=e.messages,c=(0,r.Bt)(e),{isLeftColumnShown:d,chats:{listIds:m},activeEmojiInteractions:g}=e,p={theme:t,customBackground:a,backgroundColor:s,patternColor:o,isLeftColumnShown:d,isRightColumnShown:(0,r.Jf)(e),isBackgroundBlurred:n,isMobileSearchActive:Boolean(h.wB&&(0,r.n5)(e)),isSelectModeActive:(0,r.CA)(e),isPaymentModalOpen:e.payment.isPaymentModalOpen,isReceiptModalOpen:Boolean(e.payment.receipt),isSeenByModalOpen:Boolean(e.seenByModal),isReactorListModalOpen:Boolean(e.reactorModal),animationLevel:e.settings.byKey.animationLevel,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1),activeEmojiInteractions:g};if(!c||!m.active)return p;const{chatId:f,threadId:v,type:I}=c,y=(0,r.Z1)(e,f),Z=(0,r.IK)(e,f),P=(0,r.KB)(e,f),{chatId:C,messageId:w}=e.audioPlayer,b=y&&(0,l.Qm)(y,v),E=(0,r.pk)(e,f),M="pinned"===I,S="scheduled"===I,R="thread"===I&&v===u._f,k=Boolean(y&&(0,l.eA)(y)),T=Boolean(y&&R&&(k||(0,l.ZV)(y))&&y.isNotJoined),N=Boolean(Z&&(0,r.s4)(e,Z.id)),B=!N&&E;return{...p,chatId:f,threadId:v,messageListType:I,isPrivate:(0,l.YC)(f),canPost:!M&&(!y||b)&&!E,isPinnedMessageList:M,isScheduledMessageList:S,currentUserBannedRights:null==y?void 0:y.currentUserBannedRights,defaultBannedRights:null==y?void 0:y.defaultBannedRights,hasPinnedOrAudioPlayer:v!==u._f||Boolean(!M&&(null==P?void 0:P.length))||Boolean(C&&w),pinnedMessagesCount:P?P.length:0,shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,messageLists:i,isChannel:k,canSubscribe:T,canStartBot:B,canRestartBot:N}}))((e=>{let{chatId:t,threadId:n,messageListType:i,isPrivate:r,isPinnedMessageList:c,messageLists:d,canPost:u,currentUserBannedRights:m,defaultBannedRights:g,hasPinnedOrAudioPlayer:p,pinnedMessagesCount:f,customBackground:v,theme:I,backgroundColor:y,patternColor:Z,isLeftColumnShown:P,isRightColumnShown:C,isBackgroundBlurred:w,isMobileSearchActive:b,isSelectModeActive:E,isPaymentModalOpen:M,isReceiptModalOpen:S,isSeenByModalOpen:R,isReactorListModalOpen:k,animationLevel:T,shouldSkipHistoryAnimations:N,currentTransitionKey:B,isChannel:x,canSubscribe:A,canStartBot:L,canRestartBot:O,activeEmojiInteractions:U}=e;const{openChat:F,unpinAllMessages:$,loadUser:D,closeLocalTextSearch:j,exitMessageSelectMode:Q,closePaymentModal:q,clearReceipt:G,joinChannel:H,sendBotCommand:_,restartBot:z}=(0,a.uC)(),{width:V}=Mt(),X=(0,$e.Z)(),[J,ee]=(0,o.eJ)(Ct.t.None),[te,ne]=(0,o.eJ)(),[ae,se]=(0,o.eJ)(),[oe,ie]=(0,o.eJ)(!1),re=p&&(Vs._m&&V=s.ks&&V{e||i(!0)}),[e]),{isReady:s&&!c,handleOpenEnd:e?function(e){"transform"===e.propertyName&&e.target===e.currentTarget&&i(Boolean(a))}:void 0,handleSlideStop:e?function(){i(!0)}:void 0}}(!N&&T!==s.oB,B,ye,t);(0,o.d4)((()=>t?(0,Ae.Z)((()=>{F({id:void 0})})):void 0),[t,F]),(0,we.Z)((()=>{ee(Ct.t.None),ne(void 0),se(void 0)}),[t]),(0,o.d4)((()=>{const{visualViewport:e}=window;if(!e)return;const t=()=>{window.visualViewport.height!==document.documentElement.clientHeight?document.body.classList.add("keyboard-visible"):document.body.classList.remove("keyboard-visible")};return e.addEventListener("resize",t),()=>{e.removeEventListener("resize",t)}}),[]),(0,o.d4)((()=>{r&&D({userId:t})}),[t,r,D]);const Ee=(0,o.I4)((e=>{if(h.$b)return;const{items:t}=e.dataTransfer||{},n=t&&t.length>0&&Array.from(t).filter((e=>"text/uri-list"!==e.type)).every(po);ee(n?Ct.t.QuickFile:Ct.t.Document)}),[]),Me=(0,o.I4)((()=>{ee(Ct.t.None)}),[]),Se=(0,o.I4)((()=>{ie(!0)}),[]),ke=(0,o.I4)((()=>{ie(!1)}),[]),Te=(0,o.I4)((()=>{$({chatId:t}),ke(),F({id:t})}),[$,F,ke,t]),Ne=(0,o.I4)((()=>{F({id:t})}),[F,t]),Be=(0,o.I4)((()=>{H({chatId:t})}),[H,t]),xe=(0,o.I4)((()=>{_({command:"/start"})}),[_]),Le=(0,o.I4)((()=>{z({chatId:t})}),[t,z]),Oe=((e,t)=>{const[n,a]=(0,o.eJ)(t);return(0,o.d4)((()=>{t&&(t.startsWith("#")?a(t):bt.fetch(s.fo,e,bt.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,Et.pt)(t).then((()=>{a(`url(${t})`)}))})))}),[t,e]),t?n:void 0})(I,v),Ue=(0,fe.Z)(pe&&"has-header-tools",v&&"custom-bg-image",y&&"custom-bg-color",v&&w&&"blurred",h.aZ?"mask-image-disabled":"mask-image-enabled"),De=(0,fe.Z)("messaging-disabled",!E&&"shown"),je=(0,l.q8)(X,m,g),{composerHiddenScale:Qe,toolbarHiddenScale:qe,composerTranslateX:Ge,toolbarTranslateX:He,unpinHiddenScale:_e,toolbarForUnpinHiddenScale:Ve}=(0,o.Ye)((()=>function(e,t){const n=e<=s.l3?16:32,a=function(e){if(e>s._m){const t=Math.min(Math.max(.25*e,Y),W),n=Math.min(.25*e,W);return Math.min(e-t-n,K)}if(e>s.ks){const t=Math.min(Math.max(.4*e,Y),W);return Math.min(e-t,K)}return e>K?K:e}(e),o=e<=s.l3?54:64,i=t?a-n-o:a-n,r=e>s.l3?Math.min(a-n,512):a-n,c=r/i,l=i/r;return{composerHiddenScale:c,toolbarHiddenScale:l,composerTranslateX:t?o/2*l:0,toolbarTranslateX:t?o/2*-1*c:0,unpinHiddenScale:r/258,toolbarForUnpinHiddenScale:258/r}}(V,ge)),[ge,V]),Xe=(0,fe.Z)("middle-column-footer",!ge&&"no-composer",ge&&ae&&!E&&"with-notch");(0,Re.ZP)(ce&&le,(()=>{F({id:void 0},{forceSyncOnIOs:!0})}),void 0,void 0,void 0,(null==d?void 0:d.map(wt.q))||[]),(0,Re.ZP)(b,j),(0,Re.ZP)(E,Q);const Ke=Boolean(!c&&!ge&&!he&&!me&&!ue&&je),We=Boolean(he||ue||me||c),Ye=Boolean(Ke||E||c);return o.ZP.createElement("div",{id:"MiddleColumn",className:Ue,onTransitionEnd:Ce,style:`\n --composer-hidden-scale: ${Qe};\n --toolbar-hidden-scale: ${qe};\n --unpin-hidden-scale: ${_e};\n --toolbar-unpin-hidden-scale: ${Ve};\n --composer-translate-x: ${Ge}px;\n --toolbar-translate-x: ${He}px;\n --pattern-color: ${Z};\n --theme-background-color:\n ${y||("dark"===I?s.It:s.p3)};\n `,onClick:h.p7&&P?Ne:void 0},o.ZP.createElement("div",{id:"middle-column-bg",style:Oe?`--custom-background: ${Oe}`:void 0}),o.ZP.createElement("div",{id:"middle-column-portals"}),ce&&le&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"messages-layout",onDragEnter:ge?Ee:void 0},o.ZP.createElement(dn,{chatId:ce,threadId:le,messageListType:de,isReady:Pe}),o.ZP.createElement(Fe.Z,{name:N?"none":T===s.zy?"slide":"fade",activeKey:B,shouldCleanup:!0,cleanupExceptionKey:Ze,onStop:be},o.ZP.createElement(Ka,{key:`${ce}-${le}-${de}`,chatId:ce,threadId:le,type:de,canPost:ge,hasTools:pe,onFabToggle:ne,onNotchToggle:se,isReady:Pe,withBottomShift:We}),o.ZP.createElement("div",{className:Xe},ge&&o.ZP.createElement(so,{chatId:ce,threadId:le,messageListType:de,dropAreaState:J,onDropHide:Me,isReady:Pe}),c&&o.ZP.createElement("div",{className:"middle-column-footer-button-container",dir:X.isRtl?"rtl":void 0},o.ZP.createElement(ze.Z,{size:"tiny",fluid:!0,color:"secondary",className:"unpin-all-button",onClick:Se},o.ZP.createElement("i",{className:"icon-unpin"}),o.ZP.createElement("span",null,X("Chat.Pinned.UnpinAll",f,"i")))),Ke&&o.ZP.createElement("div",{className:De},o.ZP.createElement("div",{className:"messaging-disabled-inner"},o.ZP.createElement("span",null,je))),h.wB&&ue&&o.ZP.createElement("div",{className:"middle-column-footer-button-container",dir:X.isRtl?"rtl":void 0},o.ZP.createElement(ze.Z,{size:"tiny",fluid:!0,ripple:!0,className:"join-subscribe-button",onClick:Be},X(Ie?"ProfileJoinChannel":"ProfileJoinGroup"))),h.wB&&me&&o.ZP.createElement("div",{className:"middle-column-footer-button-container",dir:X.isRtl?"rtl":void 0},o.ZP.createElement(ze.Z,{size:"tiny",fluid:!0,ripple:!0,className:"join-subscribe-button",onClick:xe},X("BotStart"))),h.wB&&he&&o.ZP.createElement("div",{className:"middle-column-footer-button-container",dir:X.isRtl?"rtl":void 0},o.ZP.createElement(ze.Z,{size:"tiny",fluid:!0,ripple:!0,className:"join-subscribe-button",onClick:Le},X("BotRestart"))),o.ZP.createElement(io,{messageListType:de,isActive:E,canPost:ge}),o.ZP.createElement(co,{isOpen:Boolean(M),onClose:q}),o.ZP.createElement(lo,{isOpen:Boolean(S),onClose:G}),o.ZP.createElement(uo,{isOpen:R}),o.ZP.createElement(ho,{isOpen:k}))),o.ZP.createElement(Wa,{isShown:ve,canPost:ge,withExtraShift:Ye})),h.wB&&o.ZP.createElement(oo,{isActive:Boolean(b)})),t&&o.ZP.createElement(ro,{isOpen:oe,chatId:t,pinnedMessagesCount:f,onClose:ke,onUnpin:Te}),o.ZP.createElement("div",{teactFastList:!0},null==U?void 0:U.map(((e,t)=>o.ZP.createElement(mo,{teactOrderKey:t,key:e.id,activeEmojiInteraction:e})))))}))),vo=(0,M.Ds)((e=>e()),200,!1);var Io;!function(e){e[e.Profile=0]="Profile",e[e.MemberList=1]="MemberList",e[e.SharedMedia=2]="SharedMedia",e[e.Search=3]="Search",e[e.Management=4]="Management",e[e.ManageInitial=5]="ManageInitial",e[e.ManageChannelSubscribers=6]="ManageChannelSubscribers",e[e.ManageChatAdministrators=7]="ManageChatAdministrators",e[e.ManageChatPrivacyType=8]="ManageChatPrivacyType",e[e.ManageDiscussion=9]="ManageDiscussion",e[e.ManageGroupPermissions=10]="ManageGroupPermissions",e[e.ManageGroupRemovedUsers=11]="ManageGroupRemovedUsers",e[e.ManageChannelRemovedUsers=12]="ManageChannelRemovedUsers",e[e.ManageGroupUserPermissionsCreate=13]="ManageGroupUserPermissionsCreate",e[e.ManageGroupUserPermissions=14]="ManageGroupUserPermissions",e[e.ManageGroupRecentActions=15]="ManageGroupRecentActions",e[e.ManageGroupAdminRights=16]="ManageGroupAdminRights",e[e.ManageGroupNewAdminRights=17]="ManageGroupNewAdminRights",e[e.ManageGroupMembers=18]="ManageGroupMembers",e[e.ManageGroupAddAdmins=19]="ManageGroupAddAdmins",e[e.StickerSearch=20]="StickerSearch",e[e.GifSearch=21]="GifSearch",e[e.PollResults=22]="PollResults",e[e.AddingMembers=23]="AddingMembers",e[e.ManageInvites=24]="ManageInvites",e[e.ManageEditInvite=25]="ManageEditInvite",e[e.ManageReactions=26]="ManageReactions",e[e.ManageInviteInfo=27]="ManageInviteInfo",e[e.ManageJoinRequests=28]="ManageJoinRequests"}(Io||(Io={}));const yo=(0,o.X$)((0,a.c$)(((e,t)=>{var n,a,s;let{chatId:o,isProfile:i,isManagement:c}=t;const{query:d}=(0,r.n5)(e)||{},{query:u}=(0,r.y5)(e)||{},{query:m}=(0,r.yN)(e)||{},h=o?(0,r.Z1)(e,o):void 0,g=h&&(0,l.eA)(h),p=i&&o&&(0,l.YC)(o)?(0,r.dy)(e,o):void 0,f=p&&(0,l.kw)(p),v=Boolean(!c&&i&&!f&&h&&!(0,r.FM)(e,h.id)&&((0,l.YC)(h.id)||((0,l.Nl)(h)||h.isCreator)&&!h.isNotJoined)),I=Boolean(o&&(null===(n=e.management.byChatId[o])||void 0===n?void 0:n.editingInvite)),y=o?null===(a=e.management.byChatId[o])||void 0===a||null===(s=a.inviteInfo)||void 0===s?void 0:s.invite:void 0;return{canManage:v,canAddContact:f,isChannel:g,userId:null==p?void 0:p.id,messageSearchQuery:d,stickerSearchQuery:u,gifSearchQuery:m,isEditingInvite:I,currentInviteInfo:y}}))((e=>{var t;let{chatId:n,isColumnOpen:s,isProfile:i,isSearch:r,isManagement:c,isStickerSearch:l,isGifSearch:d,isPollResults:u,isAddingChatMembers:g,profileState:p,managementScreen:f,canAddContact:v,userId:I,canManage:y,isChannel:Z,onClose:P,onScreenSelect:C,messageSearchQuery:w,stickerSearchQuery:b,gifSearchQuery:E,shouldSkipAnimation:M,isEditingInvite:S,currentInviteInfo:R}=e;const{setLocalTextSearchQuery:k,setStickerSearchQuery:T,setGifSearchQuery:N,searchTextMessagesLocal:B,toggleManagement:x,openHistoryCalendar:A,addContact:O,setEditingExportedInvite:U,deleteExportedChatInvite:F}=(0,a.uC)(),$=(0,o.sO)(null),[D,j,Q]=(0,Ue.Z)(),q=(0,o.I4)((()=>{U({chatId:n,invite:R}),C(m.u1.EditInvite)}),[n,R,C,U]),G=(0,o.I4)((()=>{F({chatId:n,link:R.link}),C(m.u1.Invites),Q()}),[n,Q,R,F,C]),H=(0,o.I4)((e=>{k({query:e}),e.length&&vo(B)}),[B,k]),_=(0,o.I4)((e=>{T({query:e})}),[T]),z=(0,o.I4)((e=>{N({query:e})}),[N]),V=(0,o.I4)((()=>{O({userId:I})}),[O,I]),[X,K]=(0,o.eJ)(!s);(0,o.d4)((()=>{setTimeout((()=>{K(!s)}),300)}),[s]);const W=(0,$e.Z)(),Y=i?p===m.vi.Profile?Io.Profile:p===m.vi.SharedMedia?Io.SharedMedia:p===m.vi.MemberList?Io.MemberList:-1:r?Io.Search:u?Io.PollResults:l?Io.StickerSearch:d?Io.GifSearch:g?Io.AddingMembers:c?f===m.u1.Initial?Io.ManageInitial:f===m.u1.ChatPrivacyType?Io.ManageChatPrivacyType:f===m.u1.Discussion?Io.ManageDiscussion:f===m.u1.ChannelSubscribers?Io.ManageChannelSubscribers:f===m.u1.GroupPermissions?Io.ManageGroupPermissions:f===m.u1.ChatAdministrators?Io.ManageChatAdministrators:f===m.u1.GroupRemovedUsers?Io.ManageGroupRemovedUsers:f===m.u1.ChannelRemovedUsers?Io.ManageChannelRemovedUsers:f===m.u1.GroupUserPermissionsCreate?Io.ManageGroupUserPermissionsCreate:f===m.u1.GroupUserPermissions?Io.ManageGroupUserPermissions:f===m.u1.GroupRecentActions?Io.ManageGroupRecentActions:f===m.u1.ChatAdminRights?Io.ManageGroupAdminRights:f===m.u1.ChatNewAdminRights?Io.ManageGroupNewAdminRights:f===m.u1.GroupMembers?Io.ManageGroupMembers:f===m.u1.Invites?Io.ManageInvites:f===m.u1.EditInvite?Io.ManageEditInvite:f===m.u1.GroupAddAdmins?Io.ManageGroupAddAdmins:f===m.u1.Reactions?Io.ManageReactions:f===m.u1.InviteInfo?Io.ManageInviteInfo:f===m.u1.JoinRequests?Io.ManageJoinRequests:void 0:void 0,J=null!==(t=(0,Bt.Z)(Y,!0))&&void 0!==t?t:-1,ee=h.wB||Y===Io.SharedMedia||Y===Io.MemberList||Y===Io.AddingMembers||c,te=(0,fe.Z)("animated-close-icon",ee&&"state-back",(X||M)&&"no-transition");return o.ZP.createElement("div",{className:"RightHeader"},o.ZP.createElement(ze.Z,{className:"close-button",round:!0,color:"translucent",size:"smaller",onClick:P,ariaLabel:W(ee?"Common.Back":"Common.Close")},o.ZP.createElement("div",{ref:$,className:te})),o.ZP.createElement(Fe.Z,{name:X||M?"none":"slide-fade",activeKey:J},function(){if(-1!==J)switch(J){case Io.PollResults:return o.ZP.createElement("h3",null,W("PollResults"));case Io.Search:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Ve.Z,{parentContainerClassName:"RightSearch",value:w,onChange:H}),o.ZP.createElement(ze.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>A({selectedAt:(0,L._F)(Date.now())}),ariaLabel:"Search messages by date"},o.ZP.createElement("i",{className:"icon-calendar"})));case Io.AddingMembers:return o.ZP.createElement("h3",null,W(Z?"ChannelAddSubscribers":"GroupAddMembers"));case Io.ManageInitial:return o.ZP.createElement("h3",null,W("Edit"));case Io.ManageChatPrivacyType:return o.ZP.createElement("h3",null,W(Z?"ChannelTypeHeader":"GroupTypeHeader"));case Io.ManageDiscussion:return o.ZP.createElement("h3",null,W("Discussion"));case Io.ManageChatAdministrators:return o.ZP.createElement("h3",null,W("ChannelAdministrators"));case Io.ManageGroupRecentActions:return o.ZP.createElement("h3",null,W("Group.Info.AdminLog"));case Io.ManageGroupAdminRights:return o.ZP.createElement("h3",null,W("EditAdminRights"));case Io.ManageGroupNewAdminRights:return o.ZP.createElement("h3",null,W("SetAsAdmin"));case Io.ManageGroupPermissions:return o.ZP.createElement("h3",null,W("ChannelPermissions"));case Io.ManageGroupRemovedUsers:return o.ZP.createElement("h3",null,W("BlockedUsers"));case Io.ManageChannelRemovedUsers:return o.ZP.createElement("h3",null,W("ChannelBlockedUsers"));case Io.ManageGroupUserPermissionsCreate:return o.ZP.createElement("h3",null,W("ChannelAddException"));case Io.ManageGroupUserPermissions:return o.ZP.createElement("h3",null,W("UserRestrictions"));case Io.ManageInvites:return o.ZP.createElement("h3",null,W("lng_group_invite_title"));case Io.ManageEditInvite:return o.ZP.createElement("h3",null,W(S?"EditLink":"NewLink"));case Io.ManageInviteInfo:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("h3",null,W("InviteLink")),o.ZP.createElement("section",{className:"tools"},R&&!R.isRevoked&&o.ZP.createElement(ze.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:W("Edit"),onClick:q},o.ZP.createElement("i",{className:"icon-edit"})),R&&R.isRevoked&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(ze.Z,{round:!0,color:"danger",size:"smaller",ariaLabel:W("Delete"),onClick:j},o.ZP.createElement("i",{className:"icon-delete"})),o.ZP.createElement(jt.Z,{isOpen:D,onClose:Q,title:W("DeleteLink"),text:W("DeleteLinkHelp"),confirmIsDestructive:!0,confirmLabel:W("Delete"),confirmHandler:G}))));case Io.ManageJoinRequests:return o.ZP.createElement("h3",null,W(Z?"SubscribeRequests":"MemberRequests"));case Io.ManageGroupAddAdmins:return o.ZP.createElement("h3",null,W("Channel.Management.AddModerator"));case Io.StickerSearch:return o.ZP.createElement(Ve.Z,{value:b,placeholder:W("SearchStickersHint"),autoFocusSearch:!0,onChange:_});case Io.GifSearch:return o.ZP.createElement(Ve.Z,{value:E,placeholder:W("SearchGifsTitle"),autoFocusSearch:!0,onChange:z});case Io.SharedMedia:return o.ZP.createElement("h3",null,W("SharedMedia"));case Io.ManageChannelSubscribers:return o.ZP.createElement("h3",null,W("ChannelSubscribers"));case Io.MemberList:case Io.ManageGroupMembers:return o.ZP.createElement("h3",null,W("GroupMembers"));case Io.ManageReactions:return o.ZP.createElement("h3",null,W("Reactions"));default:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("h3",null,"Profile"),o.ZP.createElement("section",{className:"tools"},v&&o.ZP.createElement(ze.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:W("AddContact"),onClick:V},o.ZP.createElement("i",{className:"icon-add-user"})),y&&o.ZP.createElement(ze.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:W("Edit"),onClick:x},o.ZP.createElement("i",{className:"icon-edit"}))))}}()))})));var Zo=n(91);var Po=n(7407);function Co(e,t,n,a){const[o,i]=(0,Po.Z)(n?t:void 0,a,void 0,s.Vk);return[o,i,!(!o||!a||o[0]===a[0])]}function wo(e,t,n,a,i,r){const c=(0,o.sO)();(0,we.Z)((()=>{t===e&&i&&r&&(c.current=(0,l.R5)(i,r,e))}),[i,r,t,e]);const[d,u]=(0,Po.Z)(a?n:void 0,c.current,void 0,"media"===e?s.EN:s.pn);return[d,u,!(!d||!c.current||d[0]===c.current[0])]}const bo=(0,M.P2)((e=>e()),250,!1);let Eo=!1;var Mo=n(1273),So=n(1876),Ro=n(787),ko=n(180),To=n(3709),No=n(5418),Bo=n(7262),xo=n(1151),Ao=n(2275);const Lo=[{type:"media",title:"SharedMediaTab2"},{type:"documents",title:"SharedFilesTab2"},{type:"links",title:"SharedLinksTab2"},{type:"audio",title:"SharedMusicTab2"},{type:"voice",title:"SharedVoiceTab2"}];function Oo(e){return[`.shared-media-transition > div:only-child > .${e}-list > .scroll-item`,`.shared-media-transition > .Transition__slide--active > .${e}-list > .scroll-item`].join(", ")}const Uo=(0,o.X$)((0,a.c$)(((e,t)=>{var n,a;let{chatId:s}=t;const o=(0,r.Z1)(e,s),i=(0,r.Zw)(e,s),{currentType:c,resultsByType:d}=(0,r.we)(e)||{},{foundIds:u}=d&&c&&d[c]||{},{byId:m,statusesById:h}=e.users,{byId:g}=e.chats,p=o&&(0,l.Bf)(o),f=o&&(0,l.eA)(o),v=p||f&&(0,l.Nl)(o),I=null==o||null===(n=o.fullInfo)||void 0===n?void 0:n.members,y=v&&o&&o.fullInfo&&!o.fullInfo.canViewMembers,Z=v&&o&&((0,l.VE)(o,"inviteUsers")||o.isCreator),P=v&&o&&((0,l.VE)(o,"banUsers")||o.isCreator),C=(0,r.xs)(e,s);let w,b,E;return(0,l.YC)(s)&&(b=s,E=(0,r.dy)(e,b),w=E&&!E.isSelf&&!(0,l.cS)(E)),{theme:(0,r.Pu)(e),isChannel:f,resolvedUserId:b,chatMessages:i,foundIds:u,mediaSearchType:c,hasCommonChatsTab:w,hasMembersTab:v,areMembersHidden:y,canAddMembers:Z,canDeleteMembers:P,currentUserId:e.currentUserId,isRightColumnShown:(0,r.Jf)(e),isRestricted:null==o?void 0:o.isRestricted,lastSyncTime:e.lastSyncTime,serverTimeOffset:e.serverTimeOffset,activeDownloadIds:C,usersById:m,userStatusesById:h,chatsById:g,isChatProtected:null==o?void 0:o.isProtected,...v&&I&&{members:I},...w&&E&&{commonChatIds:null===(a=E.commonChats)||void 0===a?void 0:a.ids}}}))((e=>{let{chatId:t,profileState:n,onProfileStateChange:i,theme:r,isChannel:c,resolvedUserId:d,currentUserId:g,chatMessages:p,foundIds:f,mediaSearchType:v,hasCommonChatsTab:I,hasMembersTab:y,areMembersHidden:Z,canAddMembers:P,canDeleteMembers:C,commonChatIds:w,members:b,usersById:E,userStatusesById:M,chatsById:S,isRightColumnShown:R,isRestricted:k,lastSyncTime:T,activeDownloadIds:N,serverTimeOffset:B,isChatProtected:x}=e;const{setLocalMediaSearchType:A,loadMoreMembers:L,loadCommonChats:O,openChat:U,searchMediaMessagesLocal:F,openMediaViewer:$,openAudioPlayer:D,focusMessage:j,loadProfilePhotos:Q,setNewChatMembersDialogState:q}=(0,a.uC)(),G=(0,o.sO)(null),H=(0,o.sO)(null),_=(0,$e.Z)(),[z,V]=(0,o.eJ)(0),[X,K]=(0,o.eJ)(),W=(0,o.Ye)((()=>[...y?[{type:"members",title:c?"ChannelSubscribers":"GroupMembers"}]:[],...Lo,...I?[{type:"commonChats",title:"SharedGroupsTab2"}]:[]]),[I,y,c]),Y=W[z].type,[J,ee,te,ne]=function(e,t,n,a,s,i,r,c,d,u,m,h,g,p,f){let v=arguments.length>15&&void 0!==arguments[15]?arguments[15]:0;const I="members"!==s&&i?i:s,y=(0,o.Ye)((()=>{if(r&&d&&u)return(0,l.Z0)(r.map((e=>{let{userId:t}=e;return t})),d,u,void 0,v)}),[r,v,d,u]),Z=(0,o.Ye)((()=>{if(c&&m)return(0,l.ih)(c,m,!0)}),[m,c]),[P,C,w]=Co(0,t,f,y),[b,E,M]=wo("media",I,a,f,h,g),[S,R,k]=wo("documents",I,a,f,h,g),[T,N,B]=wo("links",I,a,f,h,g),[x,A,L]=wo("audio",I,a,f,h,g),[O,U,F]=wo("voice",I,a,f,h,g),[$,D,j]=Co(0,n,f,Z);let Q,q,G=!1;switch(I){case"members":Q=P,q=C,G=w;break;case"commonChats":Q=$,q=D,G=j;break;case"media":Q=b,q=E,G=M;break;case"documents":Q=S,q=R,G=k;break;case"links":Q=T,q=N,G=B;break;case"audio":Q=x,q=A,G=L;break;case"voice":Q=O,q=U,G=F}return[I,Q,q,G]}(R,L,O,F,Y,v,b,w,E,M,S,p,f,t,T,B),ae=W.findIndex((e=>{let{type:t}=e;return t===J})),{handleScroll:se}=function(e,t,n,a){(0,mn.Z)((n=>{let[s]=n;if(s&&s!==t){const n=e.current,s=n.querySelector(".TabList");n.scrollTop{Eo=!1}),350))}}),[t,a]),(0,mn.Z)((t=>{let[s]=t;if(n!==m.vi.Profile||n===s)return;const o=e.current;if(!o)return;const i=o.querySelector(".TabList");!i||i.offsetTop>o.scrollTop||(Eo=!0,(0,In.Z)(o,o.firstElementChild,"start",void 0,2*o.offsetHeight),setTimeout((()=>{Eo=!1}),350),a(n))}),[n]);const s=(0,o.I4)((()=>{const n=e.current;if(!n)return;const s=n.querySelector(".TabList");if(!s)return;let o=m.vi.Profile;n.scrollTop>=s.offsetTop&&(o="members"===t?m.vi.MemberList:m.vi.SharedMedia),a(o)}),[e,a,t]);return(0,o.d4)((()=>{Eo||s()}),[s,t]),{handleScroll:(0,o.I4)((()=>{Eo||bo(s)}),[s])}}(G,Y,n,i),{applyTransitionFix:oe,releaseTransitionFix:ie}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".Transition.shared-media-transition";(0,o.d4)((()=>{function n(){const n=e.current,a=n.querySelector(t),s=n.querySelector(".TabList");a&&s&&(a.style.minHeight=n.offsetHeight-s.offsetHeight+"px")}return n(),window.addEventListener("resize",n,!1),()=>{window.removeEventListener("resize",n,!1)}}),[e,t]);const n=(0,o.I4)((()=>{const t=e.current;if("hidden"!==t.style.overflowY){const e=t.offsetWidth-t.clientWidth;t.style.overflowY="hidden",t.style.marginRight=`${e}px`}}),[e]),a=(0,o.I4)((()=>{const t=e.current;t.style.overflowY="scroll",t.style.marginRight="0"}),[e]);return{applyTransitionFix:n,releaseTransitionFix:a}}(G),[re,ce]=(()=>{const[e,t]=(0,o.eJ)(!1);return[e,(0,o.I4)((()=>{t((e=>!e))}),[])]})(),{observe:le}=(0,Pn.S1)({rootRef:G,throttleMs:500}),de=(0,o.I4)((()=>{ie(),ce()}),[ie,ce]),ue=(0,o.I4)((()=>{q(m.WB.InProgress)}),[q]);(0,o.d4)((()=>{A({mediaType:Y})}),[A,Y]);const me=d||t;(0,o.d4)((()=>{T&&Q({profileId:me})}),[Q,me,T]);const he=(0,o.I4)((e=>{$({chatId:me,threadId:u._f,messageId:e,origin:m.bZ.SharedMedia})}),[me,$]),ge=(0,o.I4)((e=>{D({chatId:me,messageId:e})}),[me,D]),pe=(0,o.I4)((e=>{U({id:e})}),[U]),fe=(0,o.I4)((e=>{j({chatId:me,messageId:e})}),[me,j]),ve=(0,o.I4)((()=>{K(void 0)}),[]);let Ie;(0,o.d4)((()=>{if(H.current&&h.$b)return(0,nt.sf)(H.current,{selectorToPreventScroll:".Profile",onSwipe:(e,t)=>t===nt.eM.Left?(V(Math.min(z+1,W.length-1)),!0):t===nt.eM.Right&&(V(Math.max(0,z-1)),!0)})}),[z,W.length]);const ye="members"===J||!y&&"media"===J;ye?Ie=R?0:1e3:ee||(Ie=s.Y);const Ze=(0,zs.Z)([t,J],Ie);return o.ZP.createElement(Mo.Z,{ref:G,className:"Profile custom-scroll",itemSelector:Oo(J),items:Ze?ee:void 0,cacheBuster:re,sensitiveArea:s.qU,preloadBackwards:Ze?"members"===J?s.Vk:s.EN:0,noScrollRestoreOnTop:!0,noFastList:!0,onLoadMore:te,onScroll:se},!ne&&function(e,t){return o.ZP.createElement("div",{className:"profile-info"},o.ZP.createElement(Ro.Z,{userId:t||e}),o.ZP.createElement(ko.Z,{chatOrUserId:t||e}))}(t,d),!k&&o.ZP.createElement("div",{className:"shared-media"},o.ZP.createElement(Fe.Z,{ref:H,name:_.isRtl?"slide-optimized-rtl":"slide-optimized",activeKey:ae,renderCount:W.length,shouldRestoreHeight:!0,className:"shared-media-transition",onStart:oe,onStop:de},function(){if(!ee||!Ze||!p){const e=ye&&!Ze;return o.ZP.createElement("div",{className:"content empty-list"},!e&&o.ZP.createElement(Ye.Z,null))}if(!ee.length){let e;switch(J){case"members":e=Z?"You have no access to group members list.":"No members found";break;case"commonChats":e=_("NoGroupsInCommon");break;case"documents":e=_("lng_media_file_empty");break;case"links":e=_("lng_media_link_empty");break;case"audio":e=_("lng_media_song_empty");break;case"voice":e=_("lng_media_audio_empty");break;default:e=_("SharedMedia.EmptyTitle")}return o.ZP.createElement("div",{className:"content empty-list"},o.ZP.createElement(Bo.Z,{text:e}))}return o.ZP.createElement("div",{className:`content ${J}-list`,dir:_.isRtl&&"media"===J?"rtl":void 0,teactFastList:!0},"media"===J?ee.map((e=>p[e]&&o.ZP.createElement(To.Z,{key:e,message:p[e],isProtected:x||p[e].isProtected,observeIntersection:le,onClick:he}))):"documents"===J?ee.map((e=>p[e]&&o.ZP.createElement(Hn.Z,{key:e,message:p[e],withDate:!0,smaller:!0,className:"scroll-item",isDownloading:N.includes(e),observeIntersection:le,onDateClick:fe}))):"links"===J?ee.map((e=>p[e]&&o.ZP.createElement(No.Z,{key:e,message:p[e],isProtected:x||p[e].isProtected,observeIntersection:le,onMessageClick:fe}))):"audio"===J?ee.map((e=>p[e]&&o.ZP.createElement(_n.Z,{key:e,theme:r,message:p[e],origin:m.Cr.SharedMedia,date:p[e].date,lastSyncTime:T,className:"scroll-item",onPlay:ge,onDateClick:fe,isDownloading:N.includes(e)}))):"voice"===J?ee.map((e=>p[e]&&o.ZP.createElement(_n.Z,{key:e,theme:r,message:p[e],senderTitle:(0,Zo.F)(_,p[e],S,E),origin:m.Cr.SharedMedia,date:p[e].date,lastSyncTime:T,className:"scroll-item",onPlay:ge,onDateClick:fe,isDownloading:N.includes(e)}))):"members"===J?ee.map(((e,t)=>{return o.ZP.createElement(So.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item small-icon",onClick:()=>pe(e),contextActions:(n=e,n!==g&&C?[{title:_("lng_context_remove_from_group"),icon:"stop",handler:()=>{K(n)}}]:void 0)},o.ZP.createElement(xt.Z,{userId:e,forceShowSelf:!0}));var n})):"commonChats"===J?ee.map(((e,t)=>o.ZP.createElement(So.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item small-icon",onClick:()=>U({id:e})},o.ZP.createElement(At.Z,{chatId:e})))):void 0)}()),o.ZP.createElement(at.Z,{big:!0,activeTab:z,tabs:W,onSwitchTab:V})),P&&o.ZP.createElement(xo.Z,{isShown:"members"===J,onClick:ue,ariaLabel:_("lng_channel_add_users")},o.ZP.createElement("i",{className:"icon-add-user-filled"})),C&&o.ZP.createElement(Ao.Z,{isOpen:Boolean(X),userId:X,onClose:ve}))}))),Fo=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"RightSearch");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)})),$o=(0,o.X$)((e=>{const t=(0,rt.Z)(it.gl.Extra,"Management");return t?o.ZP.createElement(t,e):o.ZP.createElement(ct.Z,null)})),Do=(0,o.X$)((()=>{const e=(0,rt.Z)(it.gl.Extra,"StickerSearch");return e?o.ZP.createElement(e,null):o.ZP.createElement(ct.Z,null)})),jo=(0,o.X$)((()=>{const e=(0,rt.Z)(it.gl.Extra,"GifSearch");return e?o.ZP.createElement(e,null):o.ZP.createElement(ct.Z,null)})),Qo=(0,o.X$)((()=>{const e=(0,rt.Z)(it.gl.Extra,"PollResults");return e?o.ZP.createElement(e,null):o.ZP.createElement(ct.Z,null)}));var qo=n(1820);const Go=(0,o.X$)((0,a.c$)(((e,t)=>{var n;let{chatId:a}=t;const s=(0,r.Z1)(e,a),{userIds:o}=e.contactList||{},{byId:i}=e.chats,{currentUserId:c,newChatMembersProgress:d,connectionState:u}=e,h=s&&(0,l.eA)(s),{query:g,fetchingStatus:p,globalUserIds:f,localUserIds:v}=e.userSearch;return{isChannel:h,members:null==s||null===(n=s.fullInfo)||void 0===n?void 0:n.members,currentUserId:c,chatsById:i,localContactIds:o,searchQuery:g,isSearching:p,isLoading:d===m.WB.Loading,globalUserIds:f,localUserIds:v,connectionState:u}}))((e=>{let{isChannel:t,connectionState:n,members:s,onNextStep:i,currentUserId:r,chatsById:c,localContactIds:d,isLoading:u,searchQuery:m,isSearching:h,localUserIds:p,globalUserIds:f,onClose:v,isActive:I}=e;const{setUserSearchQuery:y,loadContactList:Z}=(0,a.uC)(),P=(0,$e.Z)(),[C,w]=(0,o.eJ)([]),b=(0,Rt.Z)(C)===C;(0,o.d4)((()=>{I&&"connectionStateReady"===n&&Z()}),[n,I,Z]),(0,Re.ZP)(I,v);const E=(0,o.Ye)((()=>s?s.map((e=>e.userId)):[]),[s]),M=(0,o.I4)((e=>{y({query:e})}),[y]),S=(0,o.Ye)((()=>{const e=(0,a.Rd)().users.byId,n=d?(0,l.kK)(d,e,m):[];return(0,l.ih)((0,g.Tw)([...n,...p||[],...f||[]]).filter((n=>{const a=e[n];return!E.includes(n)&&n!==r&&(!a||!(0,l.cS)(a)||!t&&a.canBeInvitedToGroup)})),c)}),[d,c,m,p,f,r,E,t]),R=(0,o.I4)((()=>{C.length&&(y({query:""}),i(C))}),[C,y,i]);return o.ZP.createElement("div",{className:"AddChatMembers"},o.ZP.createElement("div",{className:"AddChatMembers-inner"},o.ZP.createElement(qo.Z,{itemIds:S,selectedIds:C,filterValue:m,filterPlaceholder:P("lng_channel_add_users"),searchInputId:"new-members-picker-search",isLoading:h,onSelectedIdsChange:w,onFilterChange:M,noScrollRestore:b}),o.ZP.createElement(xo.Z,{isShown:Boolean(C.length),disabled:u,ariaLabel:P("lng_channel_add_users"),onClick:R},u?o.ZP.createElement(Ye.Z,{color:"white"}):o.ZP.createElement("i",{className:"icon-arrow-right"}))))}))),Ho=Object.keys(m.qt).length/2,_o=Object.keys(m.u1).length/2;function zo(){const e=document.querySelector(".RightHeader .SearchInput input");e&&e.blur()}const Vo=(0,o.X$)((0,a.c$)((e=>{var t;const{chatId:n,threadId:a}=(0,r.Bt)(e)||{},s=(0,r.g4)(e),o=n?null===(t=e.management.byChatId[n])||void 0===t?void 0:t.nextScreen:void 0;return{contentKey:(0,r.Wq)(e),chatId:n,threadId:a,isChatSelected:Boolean(n&&s),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,nextManagementScreen:o}}))((e=>{var t;let{contentKey:n,chatId:i,threadId:r,isChatSelected:c,shouldSkipHistoryAnimations:l,nextManagementScreen:d}=e;const{toggleChatInfo:u,toggleManagement:h,closeLocalTextSearch:g,setStickerSearchQuery:p,setGifSearchQuery:f,closePollResults:v,addChatMembers:I,setNewChatMembersDialogState:y,setEditingExportedInvite:Z,setOpenedInviteInfo:P,requestNextManagementScreen:C}=(0,a.uC)(),{width:w}=Mt(),[b,E]=(0,o.eJ)(m.vi.Profile),[M,S]=(0,o.eJ)(m.u1.Initial),[R,k]=(0,o.eJ)(),[T,N]=(0,o.eJ)(),B=b!==m.vi.Profile,x=void 0!==n,A=n===m.qt.ChatInfo,L=n===m.qt.Search,O=n===m.qt.Management,U=n===m.qt.StickerSearch,F=n===m.qt.GifSearch,$=n===m.qt.PollResults,D=n===m.qt.AddingMembers,j=w<=s._m,[Q,q]=(0,o.eJ)(!x),G=null!==(t=(0,Bt.Z)(n,!0,!c))&&void 0!==t?t:-1,H=(0,o.I4)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];switch(n){case m.qt.AddingMembers:y(m.WB.Closed);break;case m.qt.ChatInfo:if(B&&e){E(m.vi.Profile);break}u(void 0,{forceSyncOnIOs:!0});break;case m.qt.Management:switch(M){case m.u1.Initial:h();break;case m.u1.ChatPrivacyType:case m.u1.Discussion:case m.u1.GroupPermissions:case m.u1.GroupType:case m.u1.ChatAdministrators:case m.u1.ChannelSubscribers:case m.u1.GroupMembers:case m.u1.Invites:case m.u1.Reactions:case m.u1.JoinRequests:case m.u1.ChannelRemovedUsers:S(m.u1.Initial);break;case m.u1.GroupUserPermissionsCreate:case m.u1.GroupRemovedUsers:case m.u1.GroupUserPermissions:S(m.u1.GroupPermissions),k(void 0),N(void 0);break;case m.u1.ChatAdminRights:case m.u1.ChatNewAdminRights:case m.u1.GroupAddAdmins:case m.u1.GroupRecentActions:S(m.u1.ChatAdministrators);break;case m.u1.EditInvite:case m.u1.InviteInfo:S(m.u1.Invites),P({invite:void 0}),Z({chatId:i,invite:void 0})}break;case m.qt.Search:zo(),g();break;case m.qt.StickerSearch:zo(),p({query:void 0});break;case m.qt.GifSearch:zo(),f({query:void 0});break;case m.qt.PollResults:v()}}),[n,B,u,v,y,M,h,g,p,f,Z,i,P]),_=(0,o.I4)(((e,t)=>{k(e),N(t)}),[]),z=(0,o.I4)((e=>{I({chatId:i,memberIds:e})}),[I,i]);function V(e){if(-1!==G)switch(G){case m.qt.AddingMembers:return o.ZP.createElement(Go,{key:i,chatId:i,isActive:x&&e,onNextStep:z,onClose:H});case m.qt.ChatInfo:return o.ZP.createElement(Uo,{key:i,chatId:i,profileState:b,onProfileStateChange:E});case m.qt.Search:return o.ZP.createElement(Fo,{chatId:i,threadId:r,onClose:H,isActive:x&&e});case m.qt.Management:return o.ZP.createElement($o,{key:i,chatId:i,currentScreen:M,isPromotedByCurrentUser:T,selectedChatMemberId:R,isActive:x&&e,onScreenSelect:S,onChatMemberSelect:_,onClose:H});case m.qt.StickerSearch:return o.ZP.createElement(Do,{onClose:H,isActive:x&&e});case m.qt.GifSearch:return o.ZP.createElement(jo,{onClose:H,isActive:x&&e});case m.qt.PollResults:return o.ZP.createElement(Qo,{onClose:H,isActive:x&&e})}}return(0,o.d4)((()=>x?(0,Ae.Z)(H):void 0),[x,H]),(0,o.d4)((()=>{setTimeout((()=>{q(!x)}),300)}),[x]),(0,o.d4)((()=>{d&&(S(d),C(void 0))}),[d,C]),(0,o.d4)((()=>{x&&j&&H()}),[j]),(0,un.Z)((e=>{let[t]=e;t!==i&&(E(m.vi.Profile),S(m.u1.Initial))}),[i]),(0,Re.ZP)(c&&(n===m.qt.ChatInfo||n===m.qt.Management||n===m.qt.AddingMembers),(()=>H(!1)),u),o.ZP.createElement("div",{id:"RightColumn-wrapper",className:c?void 0:"is-hidden"},j&&o.ZP.createElement("div",{className:"overlay-backdrop",onClick:H}),o.ZP.createElement("div",{id:"RightColumn"},o.ZP.createElement(yo,{chatId:i,isColumnOpen:x,isProfile:A,isSearch:L,isManagement:O,isStickerSearch:U,isGifSearch:F,isPollResults:$,isAddingChatMembers:D,profileState:b,managementScreen:M,onClose:H,shouldSkipAnimation:Q||l,onScreenSelect:S}),o.ZP.createElement(Fe.Z,{name:Q||l?"none":"zoom-fade",renderCount:Ho+_o,activeKey:O?Ho+M:G,shouldCleanup:!0},V)))}))),Xo=(0,o.X$)((e=>{let{isOpen:t}=e;const n=(0,rt.Z)(it.gl.Extra,"MediaViewer",!t);return n?o.ZP.createElement(n,null):void 0}));function Ko(e,t){const n=document.createElement("a");n.href=e,n.download=t;try{n.click()}catch(e){console.error(e)}}const Wo=new Set,Yo=(0,o.X$)((0,a.c$)((e=>({activeDownloads:e.activeDownloads.byChatId,messages:e.messages.byChatId})))((e=>{let{activeDownloads:t,messages:n}=e;const{cancelMessageMediaDownload:s}=(0,a.uC)();(0,o.d4)((()=>{Object.entries(t).forEach((e=>{let[t,a]=e;a.map((e=>n[Number(t)].byId[e])).forEach((e=>{const t=(0,l.Ti)(e,"download");if(t){if(!Wo.has(t)){const n=V.UV(t);if(n)return Wo.delete(t),Ko(n,(0,l.w6)(e)),void s({message:e});V.he(t,u.IU.BlobUrl,!0).then((n=>{Wo.delete(t),n&&Ko(n,(0,l.w6)(e)),s({message:e})})),Wo.add(t)}}else s({message:e})}))}))}),[s,n,t])}))),Jo=(0,o.X$)((e=>{let{isOpen:t}=e;const n=(0,rt.Z)(it.gl.Extra,"Notifications",!t);return n?o.ZP.createElement(n,null):void 0})),ei=(0,o.X$)((e=>{let{isOpen:t}=e;const n=(0,rt.Z)(it.gl.Extra,"Dialogs",!t);return n?o.ZP.createElement(n,null):void 0})),ti=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"ForwardPicker",!t);return n?o.ZP.createElement(n,e):void 0})),ni=(0,o.X$)((e=>{const{url:t}=e,n=(0,rt.Z)(it.gl.Extra,"SafeLinkModal",!t);return n?o.ZP.createElement(n,e):void 0})),ai=(0,o.X$)((e=>{const{isOpen:t}=e,n=(0,rt.Z)(it.gl.Extra,"HistoryCalendar",!t);return n?o.ZP.createElement(n,e):void 0})),si=(0,o.X$)((e=>{const{groupCallId:t}=e,n=(0,rt.Z)(it.gl.Calls,"GroupCall",!t);return n?o.ZP.createElement(n,e):void 0})),oi=(0,o.X$)((e=>{const{groupCallId:t}=e,n=(0,rt.Z)(it.gl.Calls,"ActiveCallHeader",!t);return n?o.ZP.createElement(n,null):void 0})),ii=(0,o.X$)((e=>{let{isOpen:t}=e;const n=(0,rt.Z)(it.gl.Calls,"CallFallbackConfirm",!t);return n?o.ZP.createElement(n,{isOpen:t}):void 0}));let ri,ci=!1;function li(e){document.querySelectorAll('link[rel="icon"], link[rel="alternate icon"]').forEach((t=>{e?t.href.includes("favicon-unread")||(t.href=t.href.replace("favicon","favicon-unread")):t.href=t.href.replace("favicon-unread","favicon")}))}function di(e){document.title!==e&&(document.title=e)}const ui=(0,o.X$)((0,a.c$)((e=>{const{settings:{byKey:{animationLevel:t,language:n,wasTimeFormatSetManually:a}}}=e,{chatId:s,messageId:o}=e.audioPlayer,i=s&&o?(0,r.hj)(e,s,o):void 0;return{connectionState:e.connectionState,authState:e.authState,lastSyncTime:e.lastSyncTime,isLeftColumnShown:e.isLeftColumnShown,isRightColumnShown:(0,r.Jf)(e),isMediaViewerOpen:(0,r.zQ)(e),isForwardModalOpen:(0,r.Ev)(e),hasNotifications:Boolean(e.notifications.length),hasDialogs:Boolean(e.dialogs.length),audioMessage:i,safeLinkModalUrl:e.safeLinkModalUrl,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,openedStickerSetShortName:e.openedStickerSetShortName,isServiceChatReady:(0,r.UW)(e),activeGroupCallId:e.groupCalls.activeGroupCallId,animationLevel:t,language:n,wasTimeFormatSetManually:a,isCallFallbackConfirmOpen:Boolean(e.groupCalls.isFallbackConfirmOpen),addedSetIds:e.stickers.added.setIds}}))((e=>{let{connectionState:t,authState:n,lastSyncTime:i,isLeftColumnShown:r,isRightColumnShown:c,isMediaViewerOpen:l,isForwardModalOpen:d,hasNotifications:u,hasDialogs:m,audioMessage:g,activeGroupCallId:p,safeLinkModalUrl:f,isHistoryCalendarOpen:v,shouldSkipHistoryAnimations:I,openedStickerSetShortName:y,isServiceChatReady:Z,animationLevel:P,language:C,wasTimeFormatSetManually:w,isCallFallbackConfirmOpen:b,addedSetIds:E}=e;const{sync:S,loadAnimatedEmojis:R,loadNotificationSettings:k,loadNotificationExceptions:T,updateIsOnline:N,loadTopInlineBots:B,loadEmojiKeywords:x,loadCountryList:A,loadAvailableReactions:L,loadStickerSets:O,loadAddedStickers:U,loadFavoriteStickers:F,ensureTimeFormat:D,openStickerSetShortName:j,checkVersionNotification:Q,loadAppConfig:q}=(0,a.uC)();s.eM&&!ci&&(ci=!0,console.log(">>> RENDER MAIN")),(0,o.d4)((()=>{"connectionStateReady"===t&&"authorizationStateReady"===n&&S()}),[t,n,S]),(0,o.d4)((()=>{i&&(N(!0),q(),L(),R(),k(),T(),B(),x({language:s.pR}))}),[i,R,x,T,k,B,N,L,q]),(0,o.d4)((()=>{i&&(C!==s.pR&&x({language:C}),A({langCode:C}))}),[C,i,A,x]),(0,o.d4)((()=>{i&&(E?U():(O(),F()))}),[i,E,O,F,U]),(0,o.d4)((()=>{i&&Z&&Q()}),[i,Z,Q]),(0,o.d4)((()=>{i&&!w&&D()}),[i,w,D]),(0,o.d4)((()=>{i&&Re.Oy.startsWith("#?tgaddr=")&&(0,Ie.o)(decodeURIComponent(Re.Oy.substr("#?tgaddr=".length)))}),[i]),(0,o.d4)((()=>{if(p)return J.Z.disableRefresh(),()=>{J.Z.enableRefresh()}}),[p]);const{transitionClassNames:G}=(0,Ze.Z)(!r,void 0,!0,void 0,I),{transitionClassNames:H}=(0,Ze.Z)(c,void 0,!0,void 0,I),_=(0,fe.Z)(G.replace(/([\w-]+)/g,"middle-column-$1"),H.replace(/([\w-]+)/g,"right-column-$1"),I&&"history-animation-disabled");(0,we.Z)((e=>{let[t]=e;if(void 0===t||0===P)return;const n=(0,pe.YW)();(0,ve.L)(document.getElementById("MiddleColumn"),n)}),[r]),(0,we.Z)((e=>{let[t]=e;if(void 0===t||0===P)return;(0,M.T2)((()=>{document.body.classList.add("animating-right-column")}));const n=(0,pe.YW)();(0,ve.L)(document.getElementById("RightColumn"),(()=>{n(),(0,M.T2)((()=>{document.body.classList.remove("animating-right-column")}))}))}),[c]);const z=(0,o.I4)((()=>{N(!1);const e=(0,$.xW)();let t=0;clearInterval(ri),ri=window.setInterval((()=>{if(document.title.includes(s.ou))li(!1);else{if(t%2==0){const t=(0,$.xW)()-e;t>0&&(di(`${t} notification${t>1?"s":""}`),li(!0))}else di(s.Ti),li(!1);t++}}),1e3)}),[N]),V=(0,o.I4)((()=>{N(!0),clearInterval(ri),ri=void 0,document.title.includes(s.ou)||di(s.Ti),li(!1)}),[N]),X=(0,o.I4)((()=>{j({stickerSetShortName:void 0})}),[j]);return(0,Pe.Z)(z,V),Ce(z),function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,o.d4)((()=>{if(h.$b){if(!e)return null==be||be.setAttribute("content",Ee),h.cj&&!h.fl&&document.addEventListener("gesturestart",Se),()=>{null==be||be.setAttribute("content","width=device-width, initial-scale=1, shrink-to-fit=no"),h.cj&&!h.fl&&document.removeEventListener("gesturestart",Se)};null==be||be.setAttribute("content",Me)}}),[e])}(l),o.ZP.createElement("div",{id:"Main",className:_,onDrop:ye.Z,onDragOver:ye.Z},o.ZP.createElement(Pt,null),o.ZP.createElement(fo,null),o.ZP.createElement(Vo,null),o.ZP.createElement(Xo,{isOpen:l}),o.ZP.createElement(ti,{isOpen:d}),o.ZP.createElement(Jo,{isOpen:u}),o.ZP.createElement(ei,{isOpen:m}),g&&o.ZP.createElement(on,{key:g.id,message:g,noUi:!0}),o.ZP.createElement(ni,{url:f}),o.ZP.createElement(ai,{isOpen:v}),o.ZP.createElement(ke.Z,{isOpen:Boolean(y),onClose:X,stickerSetShortName:y}),p&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(si,{groupCallId:p}),o.ZP.createElement(oi,{groupCallId:p})),o.ZP.createElement(Yo,null),o.ZP.createElement(ii,{isOpen:b}),o.ZP.createElement(xe,{isForAppBadge:!0}))})));s.eM&&console.log(">>> FINISH LOAD MAIN BUNDLE"),(0,a.Rd)().connectionState||(0,a.uC)().initApi()},8973:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.8ea62f6317fbac7d4558..js"},4524:(e,t,n)=>{e.exports=n.p+"telegram-logo-filled.67469f6dc5e301e8e0bd..svg"},257:e=>{e.exports="**Telegram Web Z was updated to version 1.35**\n\n👏 **Harder**\n• Admins can now manage removed users list in channels.\n• Copy text feature of multiple messages preserves sender’s name.\n• Added support for subscription bots such as @donate.\n\n🤩 **Better**\n• Fully redesigned context menu on desktops – featuring stunning blur effect.\n• Print or export as PDF chat history with Ctrl + P (⌘ + P on macOS).\n• Various layout improvements.\n\n🚀 **Faster**\n• More performance optimizations.\n"}}]); -//# sourceMappingURL=176.2bd8fc859463a252c8a2.js.map \ No newline at end of file +//# sourceMappingURL=176.c9baace07c5f15a8c611.js.map \ No newline at end of file diff --git a/dist/176.2bd8fc859463a252c8a2.js.map b/dist/176.c9baace07c5f15a8c611.js.map similarity index 99% rename from dist/176.2bd8fc859463a252c8a2.js.map rename to dist/176.c9baace07c5f15a8c611.js.map index 8ccf0388..b303de2a 100644 --- a/dist/176.2bd8fc859463a252c8a2.js.map +++ b/dist/176.c9baace07c5f15a8c611.js.map @@ -1 +1 @@ -{"version":3,"file":"176.2bd8fc859463a252c8a2.js","mappings":"sNAoDO,SAASA,EAAqBC,GACnC,MAAM,OAAEC,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,OAAKC,GAAWC,GAIhBF,GAASI,EAAAA,EAAAA,IAAsBJ,EAAQC,EAAQC,GAAU,GACzDF,GAASK,EAAAA,EAAAA,IAA8BL,EAAQC,EAAQC,OAAUI,IAJxDN,GA3CXO,EAAAA,EAAAA,IAAW,uBAAwBP,IACjC,MAAM,OAAEC,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,GAAKC,GAAWC,EAIhB,OAAOE,EAAAA,EAAAA,IAAsBJ,EAAQC,EAAQC,GAAU,OAGzDK,EAAAA,EAAAA,IAAW,uBAAwBR,IAEnCQ,EAAAA,EAAAA,IAAW,2BAA2B,CAACP,EAAQQ,EAASC,KACtD,MAAM,OAAER,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,IAAKC,IAAWC,EACd,OAGF,MAAM,MAAEQ,GAAUD,EACZE,GAAgBC,EAAAA,EAAAA,IAAmBX,EAAQC,IACzCQ,MAAOG,GAAiBb,EAAOc,gBAAgBC,gBAAgBJ,IAAkB,GAQzF,OANID,IAAUG,IACZb,GAASK,EAAAA,EAAAA,IAA8BL,EAAQC,EAAQC,EAAUc,EAAAA,KAG1DZ,EAAAA,EAAAA,IAAsBJ,EAAQC,EAAQC,GAAU,EAAMQ,OAKjEH,EAAAA,EAAAA,IAAW,2BAA2B,CAACP,EAAQQ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,CAAS9oE,OAAQ+oE,IAChB9sD,GAAgB,mBAAC,GAAD,CAAa7iB,IAAK6iB,EAAa97C,GAAIkC,QAAS45C,EAAclD,MAAI,IAC/E,mBAAC,GAAD,CAAeprC,IAAKC,IACpB,mBAAC,GAAD,CAAiBoyB,OAAQgpE,IACzB,mBAAC,KAAD,CACEhpE,OAAQr8B,QAAQmY,GAChBurB,QAAS0jE,EACThxF,oBAAqB+B,IAEtBie,GACC,sCACE,mBAAC,GAAD,CAAWM,YAAaN,IACxB,mBAAC,GAAD,CAAkBM,YAAaN,KAGnC,mBAAC,GAAD,MACA,mBAAC,GAAD,CAAqBiG,OAAQkpE,IAC7B,mBAAC,GAAD,CAAa7tE,eAAa,SCxU5Bxa,EAAAA,IAEFC,QAAQC,IAAI,gCAGTjb,EAAAA,EAAAA,MAAY+zB,kBACfzb,EAAAA,EAAAA,MAAc+sF,W","sources":["webpack://telegram-t/./src/modules/actions/ui/localSearch.ts","webpack://telegram-t/./src/modules/actions/ui/chats.ts","webpack://telegram-t/./src/modules/actions/ui/messages.ts","webpack://telegram-t/./src/modules/actions/ui/globalSearch.ts","webpack://telegram-t/./src/modules/actions/ui/stickerSearch.ts","webpack://telegram-t/./src/modules/actions/ui/users.ts","webpack://telegram-t/./src/modules/actions/ui/misc.ts","webpack://telegram-t/./src/modules/actions/ui/payments.ts","webpack://telegram-t/./src/modules/actions/api/messages.ts","webpack://telegram-t/./src/modules/actions/api/symbols.ts","webpack://telegram-t/./src/modules/actions/api/globalSearch.ts","webpack://telegram-t/./src/modules/actions/api/localSearch.ts","webpack://telegram-t/./src/modules/actions/api/management.ts","webpack://telegram-t/./src/modules/actions/api/sync.ts","webpack://telegram-t/./src/modules/actions/api/users.ts","webpack://telegram-t/./src/modules/reducers/bots.ts","webpack://telegram-t/./src/modules/actions/api/bots.ts","webpack://telegram-t/./src/modules/actions/api/twoFaSettings.ts","webpack://telegram-t/./src/modules/actions/api/payments.ts","webpack://telegram-t/./src/util/requestQuery.ts","webpack://telegram-t/./src/components/middle/helpers/calculateMiddleFooterTransforms.ts","webpack://telegram-t/./src/modules/reducers/reactions.ts","webpack://telegram-t/./src/modules/actions/api/reactions.ts","webpack://telegram-t/./src/util/areDeepEqual.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/chats.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/messages.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/users.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/symbols.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/misc.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/twoFaSettings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/calls.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/payments.ts","webpack://telegram-t/./src/hooks/useBeforeUnload.ts","webpack://telegram-t/./src/hooks/usePreventPinchZoomGesture.ts","webpack://telegram-t/./src/components/common/UnreadCounter.tsx","webpack://telegram-t/./src/hooks/useConnectionStatus.ts","webpack://telegram-t/./src/hooks/useBrowserOnline.ts","webpack://telegram-t/./src/components/left/ConnectionStatusOverlay.tsx","webpack://telegram-t/./src/components/left/main/LeftMainHeader.tsx","webpack://telegram-t/./src/components/left/main/ChatFolders.tsx","webpack://telegram-t/./src/components/left/search/LeftSearch.async.tsx","webpack://telegram-t/./src/components/left/main/ContactList.async.tsx","webpack://telegram-t/./src/components/left/NewChatButton.tsx","webpack://telegram-t/./src/components/left/main/LeftMain.tsx","webpack://telegram-t/./src/components/left/settings/Settings.async.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.async.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.async.tsx","webpack://telegram-t/./src/components/left/LeftColumn.tsx","webpack://telegram-t/./src/hooks/useResize.ts","webpack://telegram-t/./src/hooks/useCustomBackground.ts","webpack://telegram-t/./src/hooks/useWindowSize.ts","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/HeaderActions.tsx","webpack://telegram-t/./src/hooks/useWebpThumbnail.ts","webpack://telegram-t/./src/components/middle/PinnedMessageNavigation.tsx","webpack://telegram-t/./src/components/middle/HeaderPinnedMessage.tsx","webpack://telegram-t/./src/util/imageResize.ts","webpack://telegram-t/./src/hooks/useMessageMediaMetadata.ts","webpack://telegram-t/./src/hooks/useAsync.ts","webpack://telegram-t/./src/components/middle/AudioPlayer.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallTopPane.tsx","webpack://telegram-t/./src/components/middle/MiddleHeader.tsx","webpack://telegram-t/./src/components/middle/helpers/groupMessages.ts","webpack://telegram-t/./src/components/middle/hooks/useMessageObservers.ts","webpack://telegram-t/./src/components/middle/message/helpers/buildContentClassName.ts","webpack://telegram-t/./src/components/middle/message/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAlbumLayout.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAuthorWidth.ts","webpack://telegram-t/./src/components/middle/message/hooks/useFocusMessage.ts","webpack://telegram-t/./src/components/middle/message/hooks/useOuterHandlers.ts","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/ActionMessage.tsx","webpack://telegram-t/./src/components/common/EmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/message/ReactionAnimatedEmoji.tsx","webpack://telegram-t/./src/components/middle/message/MessageMeta.tsx","webpack://telegram-t/./src/components/middle/message/Sticker.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useBlurredMediaThumbRef.ts","webpack://telegram-t/./src/components/middle/message/helpers/getCustomAppendixBg.ts","webpack://telegram-t/./src/components/middle/message/Photo.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useVideoAutoPause.ts","webpack://telegram-t/./src/components/middle/message/Video.tsx","webpack://telegram-t/./src/components/middle/message/Contact.tsx","webpack://telegram-t/./src/components/middle/message/PollOption.tsx","webpack://telegram-t/./src/components/middle/message/Poll.tsx","webpack://telegram-t/./src/components/middle/message/WebPage.tsx","webpack://telegram-t/./src/components/middle/message/Invoice.tsx","webpack://telegram-t/./src/components/middle/message/hocs/withSelectControl.tsx","webpack://telegram-t/./src/components/middle/message/Album.tsx","webpack://telegram-t/./src/components/middle/message/RoundVideo.tsx","webpack://telegram-t/./src/components/middle/message/InlineButtons.tsx","webpack://telegram-t/./src/components/middle/message/CommentButton.tsx","webpack://telegram-t/./src/components/middle/message/ReactionButton.tsx","webpack://telegram-t/./src/components/middle/message/Reactions.tsx","webpack://telegram-t/./src/components/common/LocalAnimatedEmoji.tsx","webpack://telegram-t/./src/components/middle/message/Message.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useInnerHandlers.ts","webpack://telegram-t/./src/components/middle/message/SponsoredMessage.tsx","webpack://telegram-t/./src/components/middle/MessageListContent.tsx","webpack://telegram-t/./src/components/middle/hooks/useScrollHooks.ts","webpack://telegram-t/./src/components/middle/ContactGreeting.tsx","webpack://telegram-t/./src/components/middle/NoMessages.tsx","webpack://telegram-t/./src/components/middle/MessageList.tsx","webpack://telegram-t/./src/hooks/useNativeCopySelectedMessages.ts","webpack://telegram-t/./src/components/middle/hooks/useStickyDates.ts","webpack://telegram-t/./src/components/middle/ScrollDownButton.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/buildAttachment.ts","webpack://telegram-t/./src/util/insertHtmlInSelection.ts","webpack://telegram-t/./src/components/middle/composer/helpers/applyIosAutoCapitalizationFix.ts","webpack://telegram-t/./src/util/voiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useClipboardPaste.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useDraft.ts","webpack://telegram-t/./src/hooks/useDebouncedMemo.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useInlineBotTooltip.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useBotCommandTooltip.ts","webpack://telegram-t/./src/components/common/DeleteMessageModal.async.tsx","webpack://telegram-t/./src/components/ui/ResponsiveHoverButton.tsx","webpack://telegram-t/./src/components/common/CalendarModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.tsx","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.async.tsx","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.tsx","webpack://telegram-t/./src/components/middle/composer/SendAsMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/Composer.tsx","webpack://telegram-t/./src/components/middle/composer/hooks/useVoiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useStickerTooltip.ts","webpack://telegram-t/./src/util/deleteLastCharacterOutsideSelection.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEditing.ts","webpack://telegram-t/./src/components/middle/MobileSearch.async.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.async.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.async.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.async.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.async.tsx","webpack://telegram-t/./src/components/common/SeenByModal.async.tsx","webpack://telegram-t/./src/components/middle/EmojiInteractionAnimation.async.tsx","webpack://telegram-t/./src/components/middle/ReactorListModal.async.tsx","webpack://telegram-t/./src/components/middle/MiddleColumn.tsx","webpack://telegram-t/./src/components/right/RightHeader.tsx","webpack://telegram-t/./src/components/right/hooks/useProfileViewportIds.ts","webpack://telegram-t/./src/components/right/hooks/useProfileState.ts","webpack://telegram-t/./src/components/right/Profile.tsx","webpack://telegram-t/./src/components/right/hooks/useTransitionFixes.ts","webpack://telegram-t/./src/hooks/useCacheBuster.ts","webpack://telegram-t/./src/components/right/RightSearch.async.tsx","webpack://telegram-t/./src/components/right/management/Management.async.tsx","webpack://telegram-t/./src/components/right/StickerSearch.async.tsx","webpack://telegram-t/./src/components/right/GifSearch.async.tsx","webpack://telegram-t/./src/components/right/PollResults.async.tsx","webpack://telegram-t/./src/components/right/AddChatMembers.tsx","webpack://telegram-t/./src/components/right/RightColumn.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.async.tsx","webpack://telegram-t/./src/util/download.ts","webpack://telegram-t/./src/components/main/DownloadManager.tsx","webpack://telegram-t/./src/components/main/Notifications.async.tsx","webpack://telegram-t/./src/components/main/Dialogs.async.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.async.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.async.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.async.tsx","webpack://telegram-t/./src/components/calls/group/GroupCall.async.tsx","webpack://telegram-t/./src/components/calls/ActiveCallHeader.async.tsx","webpack://telegram-t/./src/components/calls/CallFallbackConfirm.async.tsx","webpack://telegram-t/./src/components/main/Main.tsx","webpack://telegram-t/./src/bundles/main.ts"],"sourcesContent":["import { addReducer } from '../../../lib/teact/teactn';\n\nimport {\n updateLocalTextSearch,\n replaceLocalTextSearchResults,\n updateLocalMediaSearchType,\n} from '../../reducers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { buildChatThreadKey } from '../../helpers';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('openLocalTextSearch', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n return updateLocalTextSearch(global, chatId, threadId, true);\n});\n\naddReducer('closeLocalTextSearch', closeLocalTextSearch);\n\naddReducer('setLocalTextSearchQuery', (global, actions, payload) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const { query } = payload!;\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { query: currentQuery } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n\n if (query !== currentQuery) {\n global = replaceLocalTextSearchResults(global, chatId, threadId, MEMO_EMPTY_ARRAY);\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, true, query);\n\n return global;\n});\n\naddReducer('setLocalMediaSearchType', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return undefined;\n }\n\n const { mediaType } = payload!;\n return updateLocalMediaSearchType(global, chatId, mediaType);\n});\n\nexport function closeLocalTextSearch(global: GlobalState): GlobalState {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return global;\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, false);\n global = replaceLocalTextSearchResults(global, chatId, threadId, undefined);\n return global;\n}\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n exitMessageSelectMode, replaceThreadParam, updateCurrentMessageList,\n} from '../../reducers';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { closeLocalTextSearch } from './localSearch';\n\naddReducer('openChat', (global, actions, payload) => {\n const {\n id, threadId = -1, type = 'thread', shouldReplaceHistory = false,\n } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList\n || (\n currentMessageList.chatId !== id\n || currentMessageList.threadId !== threadId\n || currentMessageList.type !== type\n )) {\n global = replaceThreadParam(global, id, threadId, 'replyStack', []);\n global = exitMessageSelectMode(global);\n global = closeLocalTextSearch(global);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: undefined,\n },\n ...(id !== global.forwardMessages.toChatId && {\n forwardMessages: {},\n }),\n };\n\n setGlobal(global);\n }\n\n return updateCurrentMessageList(global, id, threadId, type, shouldReplaceHistory);\n});\n\naddReducer('openPreviousChat', (global) => {\n return updateCurrentMessageList(global, undefined);\n});\n\naddReducer('openChatWithInfo', (global, actions, payload) => {\n setGlobal({\n ...global,\n isChatInfoShown: true,\n });\n\n actions.openChat(payload);\n});\n\naddReducer('resetChatCreation', (global) => {\n return {\n ...global,\n chatCreation: undefined,\n };\n});\n\naddReducer('setNewChatMembersDialogState', (global, actions, payload) => {\n return {\n ...global,\n newChatMembersProgress: payload,\n };\n});\n\naddReducer('openNextChat', (global, actions, payload) => {\n const { targetIndexDelta, orderedIds } = payload;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n actions.openChat({ id: orderedIds[0] });\n return;\n }\n\n const position = orderedIds.indexOf(chatId);\n\n if (position === -1) {\n return;\n }\n const nextId = orderedIds[position + targetIndexDelta];\n\n actions.openChat({ id: nextId, shouldReplaceHistory: true });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage, MAIN_THREAD_ID } from '../../../api/types';\nimport { FocusDirection } from '../../../types';\n\nimport {\n ANIMATION_END_DELAY,\n APP_VERSION,\n FAST_SMOOTH_MAX_DURATION,\n SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport {\n enterMessageSelectMode,\n toggleMessageSelection,\n exitMessageSelectMode,\n replaceThreadParam,\n updateFocusDirection,\n updateFocusedMessage,\n} from '../../reducers';\nimport {\n selectCurrentChat,\n selectViewportIds,\n selectIsRightColumnShown,\n selectCurrentMessageList,\n selectChat,\n selectThreadInfo,\n selectChatMessages,\n selectAllowedMessageActions,\n selectMessageIdsByGroupId,\n selectForwardedMessageIdsByGroupId,\n selectIsViewportNewest,\n selectReplyingToId,\n selectReplyStack,\n selectSender,\n} from '../../selectors';\nimport { findLast } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport versionNotification from '../../../versionNotification.txt';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport { getMessageSummaryText, getSenderTitle } from '../../helpers';\nimport * as langProvider from '../../../util/langProvider';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { GlobalState } from '../../../global/types';\n\nconst FOCUS_DURATION = 1500;\nconst FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;\nconst POLL_RESULT_OPEN_DELAY_MS = 450;\nconst SERVICE_NOTIFICATIONS_MAX_AMOUNT = 1e3;\n\nlet blurTimeout: number | undefined;\n\naddReducer('setScrollOffset', (global, actions, payload) => {\n const { chatId, threadId, scrollOffset } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'scrollOffset', scrollOffset);\n});\n\naddReducer('setReplyingToId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n const { chatId, threadId } = currentMessageList;\n\n return replaceThreadParam(global, chatId, threadId, 'replyingToId', messageId);\n});\n\naddReducer('setEditingId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n const paramName = type === 'scheduled' ? 'editingScheduledId' : 'editingId';\n\n return replaceThreadParam(global, chatId, threadId, paramName, messageId);\n});\n\naddReducer('editLastMessage', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const lastOwnEditableMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId).canEdit);\n });\n\n if (!lastOwnEditableMessageId) {\n return undefined;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'editingId', lastOwnEditableMessageId);\n});\n\naddReducer('replyToNextMessage', (global, actions, payload) => {\n const { targetIndexDelta } = payload;\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return;\n }\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const isLatest = selectIsViewportNewest(global, chatId, threadId);\n\n let messageId: number | undefined;\n\n if (!isLatest || !replyingToId) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n messageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n messageId = threadInfo?.lastMessageId;\n }\n } else {\n const chatMessageKeys = Object.keys(chatMessages);\n const indexOfCurrent = chatMessageKeys.indexOf(replyingToId.toString());\n const newIndex = indexOfCurrent + targetIndexDelta;\n messageId = newIndex <= chatMessageKeys.length + 1 && newIndex >= 0\n ? Number(chatMessageKeys[newIndex])\n : undefined;\n }\n actions.setReplyingToId({ messageId });\n actions.focusMessage({\n chatId, threadId, messageId,\n });\n});\n\naddReducer('openMediaViewer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, origin,\n } = payload!;\n\n return {\n ...global,\n mediaViewer: {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n },\n forwardMessages: {},\n };\n});\n\naddReducer('closeMediaViewer', (global) => {\n return {\n ...global,\n mediaViewer: {},\n };\n});\n\naddReducer('openAudioPlayer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId, origin, volume, playbackRate, isMuted,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n chatId,\n threadId,\n messageId,\n origin: origin ?? global.audioPlayer.origin,\n volume: volume ?? global.audioPlayer.volume,\n playbackRate: playbackRate || global.audioPlayer.playbackRate,\n isMuted: isMuted || global.audioPlayer.isMuted,\n },\n };\n});\n\naddReducer('setAudioPlayerVolume', (global, actions, payload) => {\n const {\n volume,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n volume,\n },\n };\n});\n\naddReducer('setAudioPlayerPlaybackRate', (global, actions, payload) => {\n const {\n playbackRate,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n playbackRate,\n },\n };\n});\n\naddReducer('setAudioPlayerMuted', (global, actions, payload) => {\n const {\n isMuted,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n isMuted,\n },\n };\n});\n\naddReducer('setAudioPlayerOrigin', (global, actions, payload) => {\n const {\n origin,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n origin,\n },\n };\n});\n\naddReducer('closeAudioPlayer', (global) => {\n return {\n ...global,\n audioPlayer: {\n volume: global.audioPlayer.volume,\n playbackRate: global.audioPlayer.playbackRate,\n isMuted: global.audioPlayer.isMuted,\n },\n };\n});\n\naddReducer('openPollResults', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n const shouldOpenInstantly = selectIsRightColumnShown(global);\n\n if (!shouldOpenInstantly) {\n window.setTimeout(() => {\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }, POLL_RESULT_OPEN_DELAY_MS);\n } else if (chatId !== global.pollResults.chatId || messageId !== global.pollResults.messageId) {\n setGlobal({\n ...global,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }\n});\n\naddReducer('closePollResults', (global) => {\n setGlobal({\n ...global,\n pollResults: {},\n });\n});\n\naddReducer('focusLastMessage', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n let lastMessageId: number | undefined;\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n lastMessageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n lastMessageId = threadInfo?.lastMessageId;\n }\n\n if (!lastMessageId) {\n return;\n }\n\n actions.focusMessage({\n chatId, threadId, messageId: lastMessageId, noHighlight: true,\n });\n});\n\naddReducer('focusNextReply', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const replyStack = selectReplyStack(global, chatId, threadId);\n\n if (!replyStack || replyStack.length === 0) {\n actions.focusLastMessage();\n } else {\n const messageId = replyStack.pop();\n\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack]);\n\n setGlobal(global);\n\n actions.focusMessage({\n chatId,\n threadId,\n messageId,\n });\n }\n\n return undefined;\n});\n\naddReducer('focusMessage', (global, actions, payload) => {\n const {\n chatId, threadId = MAIN_THREAD_ID, messageListType = 'thread', noHighlight, groupedId, groupedChatId,\n replyMessageId, isResizingContainer,\n } = payload!;\n\n let { messageId } = payload!;\n\n if (groupedId !== undefined) {\n const ids = selectForwardedMessageIdsByGroupId(global, groupedChatId, groupedId);\n if (ids?.length) {\n ([messageId] = ids);\n }\n }\n\n const currentMessageList = selectCurrentMessageList(global);\n const shouldSwitchChat = !currentMessageList || (\n chatId !== currentMessageList.chatId\n || threadId !== currentMessageList.threadId\n || messageListType !== currentMessageList.type\n );\n\n if (blurTimeout) {\n clearTimeout(blurTimeout);\n blurTimeout = undefined;\n }\n blurTimeout = window.setTimeout(() => {\n let newGlobal = getGlobal();\n newGlobal = updateFocusedMessage(newGlobal);\n newGlobal = updateFocusDirection(newGlobal);\n setGlobal(newGlobal);\n }, noHighlight ? FOCUS_NO_HIGHLIGHT_DURATION : FOCUS_DURATION);\n\n global = updateFocusedMessage(global, chatId, messageId, noHighlight, isResizingContainer);\n global = updateFocusDirection(global, undefined);\n\n if (replyMessageId) {\n const replyStack = selectReplyStack(global, chatId, threadId) || [];\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack, replyMessageId]);\n }\n\n if (shouldSwitchChat) {\n global = updateFocusDirection(global, FocusDirection.Static);\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (viewportIds && viewportIds.includes(messageId)) {\n setGlobal(global);\n actions.openChat({ id: chatId, threadId });\n return undefined;\n }\n\n if (shouldSwitchChat) {\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', undefined);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n\n if (viewportIds && !shouldSwitchChat) {\n const direction = messageId > viewportIds[0] ? FocusDirection.Down : FocusDirection.Up;\n global = updateFocusDirection(global, direction);\n }\n\n setGlobal(global);\n\n actions.openChat({ id: chatId, threadId });\n actions.loadViewportMessages();\n return undefined;\n});\n\naddReducer('openForwardMenu', (global, actions, payload) => {\n const { fromChatId, messageIds, groupedId } = payload!;\n let groupedMessageIds;\n if (groupedId) {\n groupedMessageIds = selectMessageIdsByGroupId(global, fromChatId, groupedId);\n }\n return {\n ...global,\n forwardMessages: {\n fromChatId,\n messageIds: groupedMessageIds || messageIds,\n isModalShown: true,\n },\n };\n});\n\naddReducer('exitForwardMode', (global) => {\n setGlobal({\n ...global,\n forwardMessages: {},\n });\n});\n\naddReducer('setForwardChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n setGlobal({\n ...global,\n forwardMessages: {\n ...global.forwardMessages,\n toChatId: id,\n isModalShown: false,\n },\n });\n\n actions.openChat({ id });\n actions.closeMediaViewer();\n actions.exitMessageSelectMode();\n});\n\naddReducer('openForwardMenuForSelectedMessages', (global, actions) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId: fromChatId, messageIds } = global.selectedMessages;\n\n actions.openForwardMenu({ fromChatId, messageIds });\n});\n\naddReducer('cancelMessageMediaDownload', (global, actions, payload) => {\n const { message } = payload!;\n\n const byChatId = global.activeDownloads.byChatId[message.chatId];\n if (!byChatId || !byChatId.length) return;\n\n setGlobal({\n ...global,\n activeDownloads: {\n byChatId: {\n ...global.activeDownloads.byChatId,\n [message.chatId]: byChatId.filter((id) => id !== message.id),\n },\n },\n });\n});\n\naddReducer('downloadMessageMedia', (global, actions, payload) => {\n const { message } = payload!;\n if (!message) return;\n\n setGlobal({\n ...global,\n activeDownloads: {\n byChatId: {\n ...global.activeDownloads.byChatId,\n [message.chatId]: [...(global.activeDownloads.byChatId[message.chatId] || []), message.id],\n },\n },\n });\n});\n\naddReducer('downloadSelectedMessages', (global, actions) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId, messageIds } = global.selectedMessages;\n const { threadId } = selectCurrentMessageList(global) || {};\n\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages || !threadId) return;\n const messages = messageIds.map((id) => chatMessages[id])\n .filter((message) => selectAllowedMessageActions(global, message, threadId).canDownload);\n messages.forEach((message) => actions.downloadMessageMedia({ message }));\n});\n\naddReducer('enterMessageSelectMode', (global, actions, payload) => {\n const { messageId } = payload || {};\n const openChat = selectCurrentChat(global);\n if (!openChat) {\n return global;\n }\n\n return enterMessageSelectMode(global, openChat.id, messageId);\n});\n\naddReducer('toggleMessageSelection', (global, actions, payload) => {\n const {\n messageId,\n groupedId,\n childMessageIds,\n withShift,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n\n global = toggleMessageSelection(\n global, chatId, threadId, messageListType, messageId, groupedId, childMessageIds, withShift,\n );\n\n setGlobal(global);\n\n if (global.shouldShowContextMenuHint) {\n actions.disableContextMenuHint();\n actions.showNotification({\n // eslint-disable-next-line max-len\n message: `To **edit** or **reply**, close this menu. Then ${IS_TOUCH_ENV ? 'long tap' : 'right click'} on a message.`,\n });\n }\n});\n\naddReducer('disableContextMenuHint', (global) => {\n if (!global.shouldShowContextMenuHint) {\n return undefined;\n }\n\n return {\n ...global,\n shouldShowContextMenuHint: false,\n };\n});\n\naddReducer('exitMessageSelectMode', exitMessageSelectMode);\n\naddReducer('openPollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: true,\n };\n});\n\naddReducer('closePollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: false,\n };\n});\n\naddReducer('checkVersionNotification', (global, actions) => {\n const currentVersion = APP_VERSION.split('.').slice(0, 2).join('.');\n const { serviceNotifications } = global;\n\n if (serviceNotifications.find(({ version }) => version === currentVersion)) {\n return;\n }\n\n const message: Omit = {\n chatId: SERVICE_NOTIFICATIONS_USER_ID,\n date: getServerTime(global.serverTimeOffset),\n content: {\n text: parseMessageInput(versionNotification),\n },\n isOutgoing: false,\n };\n\n actions.createServiceNotification({\n message,\n version: currentVersion,\n });\n});\n\naddReducer('createServiceNotification', (global, actions, payload) => {\n const { message, version } = payload;\n const { serviceNotifications } = global;\n const serviceChat = selectChat(global, SERVICE_NOTIFICATIONS_USER_ID)!;\n\n const maxId = Math.max(\n serviceChat.lastMessage?.id || 0,\n ...serviceNotifications.map(({ id }) => id),\n );\n const fractionalPart = (serviceNotifications.length + 1) / SERVICE_NOTIFICATIONS_MAX_AMOUNT;\n // The fractional ID is made of the largest integer ID and an incremented fractional part\n const id = Math.floor(maxId) + fractionalPart;\n\n message.id = id;\n\n const serviceNotification = {\n id,\n message,\n version,\n isUnread: true,\n };\n\n setGlobal({\n ...global,\n serviceNotifications: [\n ...serviceNotifications.slice(-SERVICE_NOTIFICATIONS_MAX_AMOUNT),\n serviceNotification,\n ],\n });\n\n actions.apiUpdate({\n '@type': 'newMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n});\n\naddReducer('openReactorListModal', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n return {\n ...global,\n reactorModal: { chatId, messageId },\n };\n});\n\naddReducer('closeReactorListModal', (global) => {\n return {\n ...global,\n reactorModal: undefined,\n };\n});\n\naddReducer('openSeenByModal', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n return {\n ...global,\n seenByModal: { chatId, messageId },\n };\n});\n\naddReducer('closeSeenByModal', (global) => {\n return {\n ...global,\n seenByModal: undefined,\n };\n});\n\naddReducer('copySelectedMessages', (global) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId, messageIds } = global.selectedMessages;\n copyTextForMessages(global, chatId, messageIds);\n});\n\naddReducer('copyMessagesByIds', (global, actions, payload: { messageIds?: number[] } ) => {\n const { messageIds } = payload;\n const chat = selectCurrentChat(global);\n if (!messageIds || messageIds.length === 0 || !chat) {\n return;\n }\n\n copyTextForMessages(global, chat.id, messageIds);\n});\n\n\nfunction copyTextForMessages(global: GlobalState, chatId: string, messageIds: number[]) {\n const { threadId } = selectCurrentMessageList(global) || {};\n const lang = langProvider.getTranslation;\n\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages || !threadId) return;\n const messages = messageIds\n .map((id) => chatMessages[id])\n .filter((message) => selectAllowedMessageActions(global, message, threadId).canCopy)\n .sort((message1, message2) => message1.id - message2.id);\n\n const result = messages.reduce((acc, message) => {\n const sender = selectSender(global, message);\n acc.push(`> ${sender ? getSenderTitle(lang, sender) : ''}:`);\n acc.push(getMessageSummaryText(lang, message, false, 0, undefined, true) + '\\n');\n\n return acc;\n }, [] as string[]);\n\n copyTextToClipboard(result.join('\\n'));\n}\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { updateGlobalSearch, updateGlobalSearchContent } from '../../reducers';\n\nconst MAX_RECENTLY_FOUND_IDS = 10;\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n const { chatId } = global.globalSearch;\n\n return updateGlobalSearch(global, {\n globalResults: {},\n localResults: {},\n resultsByType: undefined,\n ...(query ? { fetchingStatus: { chats: !chatId, messages: true } } : { fetchingStatus: undefined }),\n query,\n });\n});\n\naddReducer('addRecentlyFoundChatId', (global, actions, payload) => {\n const { id } = payload!;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n if (!recentlyFoundChatIds) {\n return updateGlobalSearch(global, { recentlyFoundChatIds: [id] });\n }\n\n const newRecentIds = recentlyFoundChatIds.filter((chatId) => chatId !== id);\n newRecentIds.unshift(id);\n if (newRecentIds.length > MAX_RECENTLY_FOUND_IDS) {\n newRecentIds.pop();\n }\n\n return updateGlobalSearch(global, { recentlyFoundChatIds: newRecentIds });\n});\n\naddReducer('clearRecentlyFoundChats', (global) => {\n return updateGlobalSearch(global, { recentlyFoundChatIds: undefined });\n});\n\naddReducer('setGlobalSearchContent', (global, actions, payload) => {\n const { content } = payload!;\n\n return updateGlobalSearchContent(global, content);\n});\n\naddReducer('setGlobalSearchChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n return updateGlobalSearch(global, { chatId: id, query: undefined, resultsByType: undefined });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n search: {\n query,\n resultIds: undefined,\n },\n },\n };\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n query,\n offsetId: undefined,\n results: undefined,\n },\n },\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { updateUserSearch } from '../../reducers';\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return updateUserSearch(global, {\n globalUserIds: undefined,\n localUserIds: undefined,\n fetchingStatus: Boolean(query),\n query,\n });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiError } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';\nimport getReadableErrorText from '../../../util/getReadableErrorText';\nimport { selectCurrentMessageList } from '../../selectors';\nimport generateIdFor from '../../../util/generateIdFor';\n\nconst MAX_STORED_EMOJIS = 18; // Represents two rows of recent emojis\n\naddReducer('toggleChatInfo', (global, action, payload) => {\n return {\n ...global,\n isChatInfoShown: payload !== undefined ? payload : !global.isChatInfoShown,\n };\n});\n\naddReducer('setLeftColumnWidth', (global, actions, payload) => {\n const leftColumnWidth = payload;\n\n return {\n ...global,\n leftColumnWidth,\n };\n});\n\naddReducer('resetLeftColumnWidth', (global) => {\n return {\n ...global,\n leftColumnWidth: undefined,\n };\n});\n\naddReducer('toggleManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: !(global.management.byChatId[chatId] || {}).isActive,\n },\n },\n },\n };\n});\n\naddReducer('requestNextManagementScreen', (global, actions, payload): GlobalState | undefined => {\n const { screen } = payload || {};\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: true,\n nextScreen: screen,\n },\n },\n },\n };\n});\n\naddReducer('closeManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: false,\n },\n },\n },\n };\n});\n\naddReducer('openChat', (global) => {\n if (!IS_SINGLE_COLUMN_LAYOUT && !IS_TABLET_COLUMN_LAYOUT) {\n return undefined;\n }\n\n return {\n ...global,\n isLeftColumnShown: global.messages.messageLists.length === 0,\n };\n});\n\naddReducer('toggleLeftColumn', (global) => {\n return {\n ...global,\n isLeftColumnShown: !global.isLeftColumnShown,\n };\n});\n\naddReducer('addRecentEmoji', (global, action, payload) => {\n const { emoji } = payload!;\n const { recentEmojis } = global;\n if (!recentEmojis) {\n return {\n ...global,\n recentEmojis: [emoji],\n };\n }\n\n const newEmojis = recentEmojis.filter((e) => e !== emoji);\n newEmojis.unshift(emoji);\n if (newEmojis.length > MAX_STORED_EMOJIS) {\n newEmojis.pop();\n }\n\n return {\n ...global,\n recentEmojis: newEmojis,\n };\n});\n\naddReducer('addRecentSticker', (global, action, payload) => {\n const { sticker } = payload!;\n const { recent } = global.stickers;\n if (!recent) {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n hash: '0',\n stickers: [sticker],\n },\n },\n };\n }\n\n const newStickers = recent.stickers.filter((s) => s.id !== sticker.id);\n newStickers.unshift(sticker);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n ...recent,\n stickers: newStickers,\n },\n },\n };\n});\n\naddReducer('showNotification', (global, actions, payload) => {\n const notification = payload!;\n notification.localId = generateIdFor({});\n\n const newNotifications = [...global.notifications];\n const existingNotificationIndex = newNotifications.findIndex((n) => n.message === notification.message);\n if (existingNotificationIndex !== -1) {\n newNotifications.splice(existingNotificationIndex, 1);\n }\n\n newNotifications.push(notification);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('dismissNotification', (global, actions, payload) => {\n const newNotifications = global.notifications.filter(({ localId }) => localId !== payload.localId);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('showDialog', (global, actions, payload) => {\n const { data } = payload!;\n\n // Filter out errors that we don't want to show to the user\n if ('message' in data && data.hasErrorKey && !getReadableErrorText(data)) {\n return global;\n }\n\n const newDialogs = [...global.dialogs];\n if ('message' in data) {\n const existingErrorIndex = newDialogs.findIndex((err) => (err as ApiError).message === data.message);\n if (existingErrorIndex !== -1) {\n newDialogs.splice(existingErrorIndex, 1);\n }\n }\n\n newDialogs.push(data);\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('dismissDialog', (global) => {\n const newDialogs = [...global.dialogs];\n\n newDialogs.pop();\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('toggleSafeLinkModal', (global, actions, payload) => {\n const { url: safeLinkModalUrl } = payload;\n\n return {\n ...global,\n safeLinkModalUrl,\n };\n});\n\naddReducer('openHistoryCalendar', (global, actions, payload) => {\n const { selectedAt } = payload;\n\n return {\n ...global,\n historyCalendarSelectedAt: selectedAt,\n };\n});\n\naddReducer('closeHistoryCalendar', (global) => {\n return {\n ...global,\n historyCalendarSelectedAt: undefined,\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { clearPayment, closeInvoice } from '../../reducers';\n\naddReducer('openPaymentModal', (global, actions, payload) => {\n const { chatId, messageId } = payload;\n return {\n ...global,\n payment: {\n ...global.payment,\n chatId,\n messageId,\n isPaymentModalOpen: true,\n },\n };\n});\n\naddReducer('closePaymentModal', (global) => {\n const newGlobal = clearPayment(global);\n return closeInvoice(newGlobal);\n});\n\naddReducer('addPaymentError', (global, actions, payload) => {\n const { error } = payload!;\n\n return {\n ...global,\n payment: {\n ...global.payment,\n error,\n },\n };\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiChat,\n ApiMessage,\n ApiMessageEntity,\n ApiNewPoll,\n ApiOnProgress,\n ApiSticker,\n ApiUser,\n ApiVideo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n} from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport {\n MAX_MEDIA_FILES_FOR_ALBUM,\n MESSAGE_LIST_SLICE,\n SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../../config';\nimport { IS_IOS } from '../../../util/environment';\nimport { callApi, cancelApiProgress } from '../../../api/gramjs';\nimport {\n areSortedArraysIntersecting, buildCollectionByKey, split, unique,\n} from '../../../util/iteratees';\nimport {\n addUsers,\n addChatMessagesById,\n replaceThreadParam,\n safeReplaceViewportIds,\n updateChatMessage,\n addChats,\n updateListedIds,\n updateOutlyingIds,\n replaceScheduledMessages,\n updateThreadInfos,\n updateChat,\n updateThreadUnreadFromForwardedMessage,\n updateSponsoredMessage,\n} from '../../reducers';\nimport {\n selectChat,\n selectChatMessage,\n selectCurrentMessageList,\n selectFocusedMessageId,\n selectCurrentChat,\n selectListedIds,\n selectOutlyingIds,\n selectViewportIds,\n selectRealLastReadId,\n selectReplyingToId,\n selectEditingId,\n selectDraft,\n selectThreadOriginChat,\n selectThreadTopMessageId,\n selectEditingScheduledId,\n selectEditingMessage,\n selectScheduledMessage,\n selectNoWebPage,\n selectFirstUnreadId,\n selectUser,\n selectSendAs,\n selectSponsoredMessage,\n} from '../../selectors';\nimport { debounce, rafPromise } from '../../../util/schedulers';\nimport { isServiceNotificationMessage } from '../../helpers';\n\nconst uploadProgressCallbacks = new Map();\n\nconst runDebouncedForMarkRead = debounce((cb) => cb(), 500, false);\n\naddReducer('loadViewportMessages', (global, actions, payload) => {\n const {\n direction = LoadMoreDirection.Around,\n isBudgetPreload = false,\n } = payload || {};\n\n let { chatId, threadId } = payload || {};\n\n if (!chatId) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n chatId = currentMessageList.chatId;\n threadId = currentMessageList.threadId;\n }\n\n const chat = selectChat(global, chatId);\n // TODO Revise if `chat.isRestricted` check is needed\n if (!chat || chat.isRestricted) {\n return undefined;\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (!viewportIds || !viewportIds.length || direction === LoadMoreDirection.Around) {\n const offsetId = selectFocusedMessageId(global, chatId) || selectRealLastReadId(global, chatId, threadId);\n const isOutlying = Boolean(offsetId && listedIds && !listedIds.includes(offsetId));\n const historyIds = (isOutlying ? outlyingIds : listedIds) || [];\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, LoadMoreDirection.Around);\n\n if (areSomeLocal && newViewportIds.length >= MESSAGE_LIST_SLICE) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n if (!areAllLocal) {\n void loadViewportMessages(chat, threadId, offsetId, LoadMoreDirection.Around, isOutlying, isBudgetPreload);\n }\n } else {\n const offsetId = direction === LoadMoreDirection.Backwards ? viewportIds[0] : viewportIds[viewportIds.length - 1];\n const isOutlying = Boolean(outlyingIds);\n const historyIds = (isOutlying ? outlyingIds : listedIds)!;\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, direction);\n\n if (areSomeLocal) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n void loadWithBudget(actions, areAllLocal, isOutlying, isBudgetPreload, chat, threadId, direction, offsetId);\n\n if (isBudgetPreload) {\n return undefined;\n }\n }\n\n return global;\n});\n\nasync function loadWithBudget(\n actions: GlobalActions,\n areAllLocal: boolean, isOutlying: boolean, isBudgetPreload: boolean,\n chat: ApiChat, threadId: number, direction: LoadMoreDirection, offsetId?: number,\n) {\n if (!areAllLocal) {\n await loadViewportMessages(\n chat, threadId, offsetId, direction, isOutlying, isBudgetPreload,\n );\n }\n\n if (!isBudgetPreload) {\n // Let reducer return and update global\n await Promise.resolve();\n actions.loadViewportMessages({\n chatId: chat.id, threadId, direction, isBudgetPreload: true,\n });\n }\n}\n\naddReducer('loadMessage', (global, actions, payload) => {\n const {\n chatId, messageId, replyOriginForId, threadUpdate,\n } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n const message = await loadMessage(chat, messageId, replyOriginForId);\n if (message && threadUpdate) {\n const { lastMessageId, isDeleting } = threadUpdate;\n\n setGlobal(updateThreadUnreadFromForwardedMessage(\n getGlobal(),\n message,\n chatId,\n lastMessageId,\n isDeleting,\n ));\n }\n })();\n});\n\naddReducer('sendMessage', (global, actions, payload) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n\n if (type === 'scheduled' && !payload.scheduledAt) {\n return {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: payload,\n },\n };\n }\n\n const chat = selectChat(global, chatId)!;\n\n const params = {\n ...payload,\n chat,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n noWebPage: selectNoWebPage(global, chatId, threadId),\n sendAs: selectSendAs(global, chatId),\n };\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n const isSingle = !payload.attachments || payload.attachments.length <= 1;\n const isGrouped = !isSingle && payload.attachments && payload.attachments.length > 1;\n\n if (isSingle) {\n const { attachments, ...restParams } = params;\n sendMessage({\n ...restParams,\n attachment: attachments ? attachments[0] : undefined,\n });\n } else if (isGrouped) {\n const {\n text, entities, attachments, ...commonParams\n } = params;\n const groupedAttachments = split(attachments, MAX_MEDIA_FILES_FOR_ALBUM);\n for (let i = 0; i < groupedAttachments.length; i++) {\n const [firstAttachment, ...restAttachments] = groupedAttachments[i];\n const groupedId = `${Date.now()}${i}`;\n\n sendMessage({\n ...commonParams,\n text: i === 0 ? text : undefined,\n entities: i === 0 ? entities : undefined,\n attachment: firstAttachment,\n groupedId: restAttachments.length > 0 ? groupedId : undefined,\n });\n\n restAttachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n groupedId,\n });\n });\n }\n } else {\n const {\n text, entities, attachments, replyingTo, ...commonParams\n } = params;\n\n if (text) {\n sendMessage({\n ...commonParams,\n text,\n entities,\n replyingTo,\n });\n }\n\n attachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n });\n });\n }\n\n return undefined;\n});\n\naddReducer('editMessage', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { text, entities } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const message = selectEditingMessage(global, chatId, threadId, messageListType);\n if (!chat || !message) {\n return;\n }\n\n void callApi('editMessage', {\n chat, message, text, entities, noWebPage: selectNoWebPage(global, chatId, threadId), serverTimeOffset,\n });\n\n actions.setEditingId({ messageId: undefined });\n});\n\naddReducer('cancelSendingMessage', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n const message = selectChatMessage(global, chatId, messageId);\n const progressCallback = message && uploadProgressCallbacks.get(message.previousLocalId || message.id);\n if (progressCallback) {\n cancelApiProgress(progressCallback);\n }\n\n actions.apiUpdate({\n '@type': 'deleteMessages',\n ids: [messageId],\n chatId,\n });\n});\n\naddReducer('saveDraft', (global, actions, payload) => {\n const { chatId, threadId, draft } = payload!;\n if (!draft) {\n return undefined;\n }\n\n const { text, entities } = draft;\n const chat = selectChat(global, chatId)!;\n\n if (threadId === MAIN_THREAD_ID) {\n void callApi('saveDraft', {\n chat,\n text,\n entities,\n replyToMsgId: selectReplyingToId(global, chatId, threadId),\n });\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', draft);\n global = updateChat(global, chatId, { draftDate: Math.round(Date.now() / 1000) });\n\n return global;\n});\n\naddReducer('clearDraft', (global, actions, payload) => {\n const { chatId, threadId, localOnly } = payload!;\n if (!selectDraft(global, chatId, threadId)) {\n return undefined;\n }\n\n const chat = selectChat(global, chatId)!;\n\n if (!localOnly && threadId === MAIN_THREAD_ID) {\n void callApi('clearDraft', chat);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', undefined);\n global = updateChat(global, chatId, { draftDate: undefined });\n\n return global;\n});\n\naddReducer('toggleMessageWebPage', (global, actions, payload) => {\n const { chatId, threadId, noWebPage } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'noWebPage', noWebPage);\n});\n\naddReducer('pinMessage', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const {\n messageId, isUnpin, isOneSide, isSilent,\n } = payload!;\n\n void callApi('pinMessage', {\n chat, messageId, isUnpin, isOneSide, isSilent,\n });\n});\n\naddReducer('unpinAllMessages', (global, actions, payload) => {\n const chat = selectChat(global, payload.chatId);\n if (!chat) {\n return;\n }\n\n void unpinAllMessages(chat);\n});\n\nasync function unpinAllMessages(chat: ApiChat) {\n await callApi('unpinAllMessages', { chat });\n let global = getGlobal();\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', []);\n setGlobal(global);\n}\n\naddReducer('deleteMessages', (global, actions, payload) => {\n const { messageIds, shouldDeleteForAll } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { chatId, threadId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteMessages', { chat, messageIds, shouldDeleteForAll });\n\n const editingId = selectEditingId(global, chatId, threadId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteScheduledMessages', (global, actions, payload) => {\n const { messageIds } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteScheduledMessages', { chat, messageIds });\n\n const editingId = selectEditingScheduledId(global, chatId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteHistory', (global, actions, payload) => {\n (async () => {\n const { chatId, shouldDeleteForAll } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const maxId = chat.lastMessage?.id;\n\n await callApi('deleteHistory', { chat, shouldDeleteForAll, maxId });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('reportMessages', (global, actions, payload) => {\n (async () => {\n const {\n messageIds, reason, description,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n const result = await callApi('reportMessages', {\n peer: chat, messageIds, reason, description,\n });\n\n actions.showNotification({\n message: result\n ? 'Thank you! Your report will be reviewed by our team.'\n : 'Error occured while submiting report. Please, try again later.',\n });\n })();\n});\n\naddReducer('sendMessageAction', (global, actions, payload) => {\n (async () => {\n const { action, chatId, threadId } = payload!;\n if (chatId === global.currentUserId) return; // Message actions are disabled in Saved Messages\n\n const chat = selectChat(global, chatId)!;\n if (!chat) return;\n\n await callApi('sendMessageAction', {\n peer: chat, threadId, action,\n });\n })();\n});\n\naddReducer('markMessageListRead', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return undefined;\n }\n\n const { maxId } = payload!;\n\n runDebouncedForMarkRead(() => {\n void callApi('markMessageListRead', {\n serverTimeOffset, chat, threadId, maxId,\n });\n });\n\n // TODO Support local marking read for threads\n if (threadId !== MAIN_THREAD_ID) {\n return undefined;\n }\n\n if (chatId === SERVICE_NOTIFICATIONS_USER_ID) {\n global = {\n ...global,\n serviceNotifications: global.serviceNotifications.map((notification) => {\n return notification.isUnread && notification.id <= maxId ? { ...notification, isUnread: false } : notification;\n }),\n };\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const minId = selectFirstUnreadId(global, chatId, threadId);\n if (!viewportIds || !minId || !chat.unreadCount) {\n return global;\n }\n\n const readCount = countSortedIds(viewportIds!, minId, maxId);\n if (!readCount) {\n return global;\n }\n\n return updateChat(global, chatId, {\n lastReadInboxMessageId: maxId,\n unreadCount: Math.max(0, chat.unreadCount - readCount),\n });\n});\n\naddReducer('markMessagesRead', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { messageIds } = payload!;\n\n void callApi('markMessagesRead', { chat, messageIds });\n});\n\naddReducer('loadWebPagePreview', (global, actions, payload) => {\n const { text } = payload!;\n void loadWebPagePreview(text);\n});\n\naddReducer('clearWebPagePreview', (global) => {\n if (!global.webPagePreview) {\n return undefined;\n }\n\n return {\n ...global,\n webPagePreview: undefined,\n };\n});\n\naddReducer('sendPollVote', (global, actions, payload) => {\n const { chatId, messageId, options } = payload!;\n const chat = selectChat(global, chatId);\n\n if (chat) {\n void callApi('sendPollVote', { chat, messageId, options });\n }\n});\n\naddReducer('loadPollOptionResults', (global, actions, payload) => {\n const {\n chat, messageId, option, offset, limit, shouldResetVoters,\n } = payload!;\n\n void loadPollOptionResults(chat, messageId, option, offset, limit, shouldResetVoters);\n});\n\naddReducer('forwardMessages', (global, action, payload) => {\n const { fromChatId, messageIds, toChatId } = global.forwardMessages;\n const fromChat = fromChatId ? selectChat(global, fromChatId) : undefined;\n const toChat = toChatId ? selectChat(global, toChatId) : undefined;\n const messages = fromChatId && messageIds\n ? messageIds\n .sort((a, b) => a - b)\n .map((id) => selectChatMessage(global, fromChatId, id)).filter(Boolean as any)\n : undefined;\n\n if (!fromChat || !toChat || !messages) {\n return;\n }\n\n const { isSilent, scheduledAt } = payload;\n const sendAs = selectSendAs(global, toChatId!);\n\n const realMessages = messages.filter((m) => !isServiceNotificationMessage(m));\n if (realMessages.length) {\n void callApi('forwardMessages', {\n fromChat,\n toChat,\n messages: realMessages,\n serverTimeOffset: getGlobal().serverTimeOffset,\n isSilent,\n scheduledAt,\n sendAs,\n });\n }\n\n messages\n .filter((m) => isServiceNotificationMessage(m))\n .forEach((message) => {\n const { text, entities } = message.content.text || {};\n const { sticker, poll } = message.content;\n\n void sendMessage({\n chat: toChat,\n text,\n entities,\n sticker,\n poll,\n isSilent,\n scheduledAt,\n sendAs,\n });\n });\n\n setGlobal({\n ...getGlobal(),\n forwardMessages: {},\n });\n});\n\naddReducer('loadScheduledHistory', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void loadScheduledHistory(chat);\n});\n\naddReducer('sendScheduledMessages', (global, actions, payload) => {\n const {\n chatId, id,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('sendScheduledMessages', {\n chat,\n ids: [id],\n });\n});\n\naddReducer('rescheduleMessage', (global, actions, payload) => {\n const {\n chatId, messageId, scheduledAt,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n const message = chat && selectScheduledMessage(global, chat.id, messageId);\n if (!chat || !message) {\n return;\n }\n\n void callApi('rescheduleMessage', {\n chat,\n message,\n scheduledAt,\n });\n});\n\naddReducer('requestThreadInfoUpdate', (global, actions, payload) => {\n const { chatId, threadId } = payload;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return;\n }\n\n void callApi('requestThreadInfoUpdate', { chat, threadId });\n});\n\nasync function loadWebPagePreview(message: string) {\n const webPagePreview = await callApi('fetchWebPagePreview', { message });\n\n setGlobal({\n ...getGlobal(),\n webPagePreview,\n });\n}\n\nasync function loadViewportMessages(\n chat: ApiChat,\n threadId: number,\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n isOutlying = false,\n isBudgetPreload = false,\n) {\n const chatId = chat.id;\n\n let addOffset: number | undefined;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n addOffset = undefined;\n break;\n case LoadMoreDirection.Around:\n addOffset = -(Math.round(MESSAGE_LIST_SLICE / 2) + 1);\n break;\n case LoadMoreDirection.Forwards:\n addOffset = -(MESSAGE_LIST_SLICE + 1);\n break;\n }\n\n const result = await callApi('fetchMessages', {\n chat: selectThreadOriginChat(getGlobal(), chatId, threadId)!,\n offsetId,\n addOffset,\n limit: MESSAGE_LIST_SLICE,\n threadId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, chats, threadInfos,\n } = result;\n\n let global = getGlobal();\n\n const localMessages = chatId === SERVICE_NOTIFICATIONS_USER_ID\n ? global.serviceNotifications.map(({ message }) => message)\n : [];\n const allMessages = ([] as ApiMessage[]).concat(messages, localMessages);\n const byId = buildCollectionByKey(allMessages, 'id');\n const ids = Object.keys(byId).map(Number);\n\n global = addChatMessagesById(global, chatId, byId);\n global = isOutlying\n ? updateOutlyingIds(global, chatId, threadId, ids)\n : updateListedIds(global, chatId, threadId, ids);\n\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = updateThreadInfos(global, chatId, threadInfos);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (isOutlying && listedIds && outlyingIds) {\n if (!outlyingIds.length || areSortedArraysIntersecting(listedIds, outlyingIds)) {\n global = updateListedIds(global, chatId, threadId, outlyingIds);\n listedIds = selectListedIds(global, chatId, threadId);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n isOutlying = false;\n }\n }\n\n if (!isBudgetPreload) {\n const historyIds = isOutlying ? outlyingIds! : listedIds!;\n const { newViewportIds } = getViewportSlice(historyIds, offsetId, direction);\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds!);\n }\n\n setGlobal(global);\n}\n\nasync function loadMessage(chat: ApiChat, messageId: number, replyOriginForId: number) {\n const result = await callApi('fetchMessage', { chat, messageId });\n if (!result) {\n return undefined;\n }\n\n if (result === MESSAGE_DELETED) {\n if (replyOriginForId) {\n let global = getGlobal();\n const replyMessage = selectChatMessage(global, chat.id, replyOriginForId);\n global = updateChatMessage(global, chat.id, replyOriginForId, {\n ...replyMessage,\n replyToMessageId: undefined,\n });\n setGlobal(global);\n }\n\n return undefined;\n }\n\n let global = getGlobal();\n global = updateChatMessage(global, chat.id, messageId, result.message);\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n setGlobal(global);\n\n return result.message;\n}\n\nfunction findClosestIndex(sourceIds: number[], offsetId: number) {\n if (offsetId < sourceIds[0]) {\n return 0;\n }\n\n if (offsetId > sourceIds[sourceIds.length - 1]) {\n return sourceIds.length - 1;\n }\n\n return sourceIds.findIndex((id, i) => (\n id === offsetId\n || (id < offsetId && sourceIds[i + 1] > offsetId)\n ));\n}\n\nfunction getViewportSlice(\n sourceIds: number[],\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n) {\n const { length } = sourceIds;\n const index = offsetId ? findClosestIndex(sourceIds, offsetId) : -1;\n const isBackwards = direction === LoadMoreDirection.Backwards;\n const indexForDirection = isBackwards ? index : (index + 1) || length;\n const from = indexForDirection - MESSAGE_LIST_SLICE;\n const to = indexForDirection + MESSAGE_LIST_SLICE - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n case LoadMoreDirection.Around:\n default:\n areSomeLocal = newViewportIds.length > 0;\n areAllLocal = newViewportIds.length === MESSAGE_LIST_SLICE;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n\nasync function sendMessage(params: {\n chat: ApiChat;\n text?: string;\n entities?: ApiMessageEntity[];\n replyingTo?: number;\n attachment?: ApiAttachment;\n sticker?: ApiSticker;\n gif?: ApiVideo;\n poll?: ApiNewPoll;\n serverTimeOffset?: number;\n isSilent?: boolean;\n scheduledAt?: number;\n sendAs?: ApiChat | ApiUser;\n}) {\n let localId: number | undefined;\n const progressCallback = params.attachment ? (progress: number, messageLocalId: number) => {\n if (!uploadProgressCallbacks.has(messageLocalId)) {\n localId = messageLocalId;\n uploadProgressCallbacks.set(messageLocalId, progressCallback!);\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n fileUploads: {\n byMessageLocalId: {\n ...global.fileUploads.byMessageLocalId,\n [messageLocalId]: { progress },\n },\n },\n });\n } : undefined;\n\n // @optimization\n if (params.replyingTo || IS_IOS) {\n await rafPromise();\n }\n\n const global = getGlobal();\n params.serverTimeOffset = global.serverTimeOffset;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { threadId } = currentMessageList;\n\n if (!params.replyingTo && threadId !== MAIN_THREAD_ID) {\n params.replyingTo = selectThreadTopMessageId(global, params.chat.id, threadId)!;\n }\n\n await callApi('sendMessage', params, progressCallback);\n\n if (progressCallback && localId) {\n uploadProgressCallbacks.delete(localId);\n }\n}\n\nasync function loadPollOptionResults(\n chat: ApiChat,\n messageId: number,\n option: string,\n offset?: string,\n limit?: number,\n shouldResetVoters?: boolean,\n) {\n const result = await callApi('loadPollOptionResults', {\n chat, messageId, option, offset, limit,\n });\n\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n const { voters } = global.pollResults;\n\n setGlobal({\n ...global,\n pollResults: {\n ...global.pollResults,\n voters: {\n ...voters,\n [option]: unique([\n ...(!shouldResetVoters && voters && voters[option] ? voters[option] : []),\n ...(result && result.users.map((user) => user.id)),\n ]),\n },\n offsets: {\n ...(global.pollResults.offsets ? global.pollResults.offsets : {}),\n [option]: result.nextOffset || '',\n },\n },\n });\n}\n\naddReducer('loadPinnedMessages', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void loadPinnedMessages(chat);\n});\n\naddReducer('loadSeenBy', (global, actions, payload) => {\n const { chatId, messageId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchSeenBy', { chat, messageId });\n if (!result) {\n return;\n }\n\n setGlobal(updateChatMessage(getGlobal(), chatId, messageId, {\n seenByUserIds: result,\n }));\n })();\n});\n\naddReducer('saveDefaultSendAs', (global, actions, payload) => {\n const { chatId, sendAsId } = payload;\n const chat = selectChat(global, chatId);\n const sendAsChat = selectChat(global, sendAsId) || selectUser(global, sendAsId);\n if (!chat || !sendAsChat) {\n return undefined;\n }\n\n void callApi('saveDefaultSendAs', { sendAs: sendAsChat, chat });\n\n return updateChat(global, chatId, {\n fullInfo: {\n ...chat.fullInfo,\n sendAsId,\n },\n });\n});\n\naddReducer('loadSendAs', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchSendAs', { chat });\n if (!result) {\n global = updateChat(global, chatId, {\n sendAsIds: [],\n });\n setGlobal(global);\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChat(global, chatId, {\n sendAsIds: result.ids,\n });\n setGlobal(global);\n })();\n});\n\nasync function loadPinnedMessages(chat: ApiChat) {\n const result = await callApi('fetchPinnedMessages', { chat });\n if (!result) {\n return;\n }\n\n const { messages, chats, users } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = addChatMessagesById(global, chat.id, byId);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', ids);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n setGlobal(global);\n}\n\nasync function loadScheduledHistory(chat: ApiChat) {\n const result = await callApi('fetchScheduledHistory', { chat });\n if (!result) {\n return;\n }\n\n const { messages } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = replaceScheduledMessages(global, chat.id, byId);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n}\n\naddReducer('loadSponsoredMessages', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchSponsoredMessages', { chat });\n if (!result) {\n return;\n }\n\n let newGlobal = updateSponsoredMessage(getGlobal(), chatId, result.messages[0]);\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n newGlobal = addChats(newGlobal, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('viewSponsoredMessage', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n const message = selectSponsoredMessage(global, chatId);\n if (!chat || !message) {\n return;\n }\n\n void callApi('viewSponsoredMessage', { chat, random: message.randomId });\n});\n\nfunction countSortedIds(ids: number[], from: number, to: number) {\n let count = 0;\n\n for (let i = 0, l = ids.length; i < l; i++) {\n if (ids[i] >= from && ids[i] <= to) {\n count++;\n }\n\n if (ids[i] >= to) {\n break;\n }\n }\n\n return count;\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { LangCode } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { pause, throttle } from '../../../util/schedulers';\nimport {\n updateStickerSets,\n updateStickerSet,\n replaceAnimatedEmojis,\n updateGifSearch,\n updateStickersForEmoji,\n rebuildStickersForEmoji,\n} from '../../reducers';\nimport searchWords from '../../../util/searchWords';\nimport { selectStickerSet } from '../../selectors';\n\nconst ADDED_SETS_THROTTLE = 200;\nconst ADDED_SETS_THROTTLE_CHUNK = 10;\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('loadStickerSets', (global) => {\n const { hash } = global.stickers.added || {};\n void loadStickerSets(hash);\n});\n\naddReducer('loadAddedStickers', (global, actions) => {\n const { setIds: addedSetIds } = global.stickers.added;\n const cached = global.stickers.setsById;\n if (!addedSetIds || !addedSetIds.length) {\n return;\n }\n\n (async () => {\n for (let i = 0; i < addedSetIds.length; i++) {\n const id = addedSetIds[i];\n if (cached[id].stickers) {\n continue; // Already loaded\n }\n actions.loadStickers({ stickerSetId: id });\n\n if (i % ADDED_SETS_THROTTLE_CHUNK === 0 && i > 0) {\n await pause(ADDED_SETS_THROTTLE);\n }\n }\n })();\n});\n\naddReducer('loadRecentStickers', (global) => {\n const { hash } = global.stickers.recent || {};\n void loadRecentStickers(hash);\n});\n\naddReducer('loadFavoriteStickers', (global) => {\n const { hash } = global.stickers.favorite || {};\n void loadFavoriteStickers(hash);\n});\n\naddReducer('loadGreetingStickers', (global) => {\n const { hash } = global.stickers.greeting || {};\n\n (async () => {\n const greeting = await callApi('fetchStickersForEmoji', { emoji: '👋⭐️', hash });\n\n if (!greeting) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n stickers: {\n ...newGlobal.stickers,\n greeting: {\n hash: greeting.hash,\n stickers: greeting.stickers.filter((sticker) => sticker.emoji === '👋'),\n },\n },\n });\n })();\n});\n\naddReducer('loadFeaturedStickers', (global) => {\n const { hash } = global.stickers.featured || {};\n void loadFeaturedStickers(hash);\n});\n\naddReducer('loadStickers', (global, actions, payload) => {\n const { stickerSetId, stickerSetShortName } = payload!;\n let { stickerSetAccessHash } = payload!;\n\n if (!stickerSetAccessHash && !stickerSetShortName) {\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n stickerSetAccessHash = stickerSet.accessHash;\n }\n\n void loadStickers(stickerSetId, stickerSetAccessHash, stickerSetShortName);\n});\n\naddReducer('loadAnimatedEmojis', () => {\n void loadAnimatedEmojis();\n void loadAnimatedEmojiEffects();\n});\n\naddReducer('loadSavedGifs', (global) => {\n const { hash } = global.gifs.saved;\n void loadSavedGifs(hash);\n});\n\naddReducer('faveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void callApi('faveSticker', { sticker });\n }\n});\n\naddReducer('unfaveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void unfaveSticker(sticker);\n }\n});\n\naddReducer('toggleStickerSet', (global, actions, payload) => {\n const { stickerSetId } = payload!;\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n const { accessHash, installedDate } = stickerSet;\n\n void callApi(!installedDate ? 'installStickerSet' : 'uninstallStickerSet', { stickerSetId, accessHash });\n});\n\naddReducer('loadEmojiKeywords', (global, actions, payload: { language: LangCode }) => {\n const { language } = payload;\n\n let currentEmojiKeywords = global.emojiKeywords[language];\n if (currentEmojiKeywords?.isLoading) {\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: true,\n },\n },\n });\n\n (async () => {\n const emojiKeywords = await callApi('fetchEmojiKeywords', {\n language,\n fromVersion: currentEmojiKeywords ? currentEmojiKeywords.version : 0,\n });\n\n global = getGlobal();\n currentEmojiKeywords = global.emojiKeywords[language];\n\n if (!emojiKeywords) {\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: false,\n },\n },\n });\n\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n isLoading: false,\n version: emojiKeywords.version,\n keywords: {\n ...(currentEmojiKeywords?.keywords),\n ...emojiKeywords.keywords,\n },\n },\n },\n });\n })();\n});\n\nasync function loadStickerSets(hash?: string) {\n const addedStickers = await callApi('fetchStickerSets', { hash });\n if (!addedStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'added',\n addedStickers.hash,\n addedStickers.sets,\n ));\n}\n\nasync function loadRecentStickers(hash?: string) {\n const recentStickers = await callApi('fetchRecentStickers', { hash });\n if (!recentStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n recent: recentStickers,\n },\n });\n}\n\nasync function loadFavoriteStickers(hash?: string) {\n const favoriteStickers = await callApi('fetchFavoriteStickers', { hash });\n if (!favoriteStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: favoriteStickers,\n },\n });\n}\n\nasync function loadFeaturedStickers(hash?: string) {\n const featuredStickers = await callApi('fetchFeaturedStickers', { hash });\n if (!featuredStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'featured',\n featuredStickers.hash,\n featuredStickers.sets,\n ));\n}\n\nasync function loadStickers(stickerSetId: string, accessHash: string, stickerSetShortName?: string) {\n const stickerSet = await callApi(\n 'fetchStickers',\n { stickerSetShortName, stickerSetId, accessHash },\n );\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers, packs } = stickerSet;\n\n let global = getGlobal();\n\n global = updateStickerSet(global, set.id, { ...set, stickers, packs });\n\n const currentEmoji = global.stickers.forEmoji.emoji;\n if (currentEmoji && packs[currentEmoji]) {\n global = rebuildStickersForEmoji(global);\n }\n\n setGlobal(global);\n}\n\nasync function loadAnimatedEmojis() {\n const stickerSet = await callApi('fetchAnimatedEmojis');\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers } = stickerSet;\n\n setGlobal(replaceAnimatedEmojis(getGlobal(), { ...set, stickers }));\n}\n\nasync function loadAnimatedEmojiEffects() {\n const stickerSet = await callApi('fetchAnimatedEmojiEffects');\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers } = stickerSet;\n\n setGlobal({\n ...getGlobal(),\n animatedEmojiEffects: { ...set, stickers },\n });\n}\n\nfunction unfaveSticker(sticker: ApiSticker) {\n const global = getGlobal();\n\n // Remove sticker preemptively to get instant feedback when user removes sticker\n // from favorites while in Sticker Picker\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: {\n ...global.stickers.favorite,\n stickers: global.stickers.favorite.stickers.filter(({ id }) => id !== sticker.id),\n },\n },\n });\n\n void callApi('faveSticker', { sticker, unfave: true });\n}\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (query) {\n void searchThrottled(() => {\n searchStickers(query);\n });\n }\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query);\n });\n }\n});\n\naddReducer('searchMoreGifs', (global) => {\n const { query, offset } = global.gifs.search;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query, offset);\n });\n }\n});\n\naddReducer('loadStickersForEmoji', (global, actions, payload) => {\n const { emoji } = payload!;\n const { hash } = global.stickers.forEmoji;\n\n void searchThrottled(() => {\n loadStickersForEmoji(emoji, hash);\n });\n});\n\naddReducer('clearStickersForEmoji', (global) => {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {},\n },\n };\n});\n\naddReducer('openStickerSetShortName', (global, actions, payload) => {\n const { stickerSetShortName } = payload!;\n return {\n ...global,\n openedStickerSetShortName: stickerSetShortName,\n };\n});\n\nasync function searchStickers(query: string, hash?: string) {\n const result = await callApi('searchStickers', { query, hash });\n\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n const { setsById, added } = global.stickers;\n\n const resultIds = result.sets.map(({ id }) => id);\n\n if (added.setIds) {\n added.setIds.forEach((id) => {\n if (!resultIds.includes(id)) {\n const { title } = setsById[id] || {};\n if (title && searchWords(title, query)) {\n resultIds.unshift(id);\n }\n }\n });\n }\n\n setGlobal(updateStickerSets(\n global,\n 'search',\n result.hash,\n result.sets,\n resultIds,\n ));\n}\n\nasync function searchGifs(query: string, offset?: string) {\n const result = await callApi('searchGifs', { query, offset });\n if (!result) {\n return;\n }\n\n setGlobal(updateGifSearch(getGlobal(), !offset, result.gifs, result.nextOffset));\n}\n\nasync function loadSavedGifs(hash?: string) {\n const savedGifs = await callApi('fetchSavedGifs', { hash });\n if (!savedGifs) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n gifs: {\n ...global.gifs,\n saved: savedGifs,\n },\n });\n}\n\nasync function loadStickersForEmoji(emoji: string, hash?: string) {\n let global = getGlobal();\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n ...global.stickers.forEmoji,\n emoji,\n },\n },\n });\n\n const result = await callApi('fetchStickersForEmoji', { emoji, hash });\n\n global = getGlobal();\n\n if (!result || global.stickers.forEmoji.emoji !== emoji) {\n return;\n }\n\n global = updateStickersForEmoji(global, emoji, result.stickers, result.hash);\n\n setGlobal(global);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types';\n\nimport {\n addChats,\n addMessages,\n addUsers,\n updateGlobalSearch,\n updateGlobalSearchFetchingStatus,\n updateGlobalSearchResults,\n} from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\nimport { selectChat, selectCurrentGlobalSearchQuery } from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { GLOBAL_SEARCH_SLICE } from '../../../config';\nimport { timestampPlusDay } from '../../../util/dateFormat';\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { chatId } = global.globalSearch;\n const { query } = payload!;\n\n if (query && !chatId) {\n void searchThrottled(() => {\n searchChats(query);\n });\n }\n});\n\naddReducer('setGlobalSearchDate', (global, actions, payload) => {\n const { date } = payload!;\n const maxDate = date ? timestampPlusDay(date) : date;\n const newGlobal = updateGlobalSearch(global, {\n date,\n query: '',\n resultsByType: {\n ...global.globalSearch.resultsByType,\n text: {\n totalCount: undefined,\n foundIds: [],\n nextOffsetId: 0,\n },\n },\n });\n setGlobal(newGlobal);\n const { chatId } = global.globalSearch;\n const chat = chatId ? selectChat(global, chatId) : undefined;\n searchMessagesGlobal('', 'text', undefined, chat, maxDate, date);\n});\n\naddReducer('searchMessagesGlobal', (global, actions, payload) => {\n const {\n query, resultsByType, chatId, date,\n } = global.globalSearch;\n const maxDate = date ? timestampPlusDay(date) : date;\n const { type } = payload;\n const nextOffsetId = (resultsByType?.[type as ApiGlobalMessageSearchType])?.nextOffsetId;\n\n const chat = chatId ? selectChat(global, chatId) : undefined;\n\n searchMessagesGlobal(query, type, nextOffsetId, chat, maxDate, date);\n});\n\nasync function searchChats(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { chats: false }));\n return;\n }\n\n const {\n localChats, localUsers, globalChats, globalUsers,\n } = result;\n\n if (localChats.length || globalChats.length) {\n global = addChats(global, buildCollectionByKey([...localChats, ...globalChats], 'id'));\n }\n\n if (localUsers.length || globalUsers.length) {\n global = addUsers(global, buildCollectionByKey([...localUsers, ...globalUsers], 'id'));\n }\n\n global = updateGlobalSearchFetchingStatus(global, { chats: false });\n global = updateGlobalSearch(global, {\n localResults: {\n chatIds: localChats.map(({ id }) => id),\n userIds: localUsers.map(({ id }) => id),\n },\n globalResults: {\n ...global.globalSearch.globalResults,\n chatIds: globalChats.map(({ id }) => id),\n userIds: globalUsers.map(({ id }) => id),\n },\n });\n\n setGlobal(global);\n}\n\nasync function searchMessagesGlobal(\n query = '', type: ApiGlobalMessageSearchType, offsetRate?: number, chat?: ApiChat, maxDate?: number, minDate?: number,\n) {\n let result;\n\n if (chat) {\n const localResult = await callApi('searchMessagesLocal', {\n chat,\n query,\n type,\n limit: GLOBAL_SEARCH_SLICE,\n offsetId: offsetRate,\n minDate,\n maxDate,\n });\n\n if (localResult) {\n const {\n messages, users, totalCount, nextOffsetId,\n } = localResult;\n\n result = {\n messages,\n users,\n chats: [],\n totalCount,\n nextRate: nextOffsetId,\n };\n }\n } else {\n result = await callApi('searchMessagesGlobal', {\n query,\n offsetRate,\n limit: GLOBAL_SEARCH_SLICE,\n type,\n maxDate,\n minDate,\n });\n }\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || (query !== '' && query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { messages: false }));\n return;\n }\n\n const {\n messages, users, chats, totalCount, nextRate,\n } = result;\n\n if (chats.length) {\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n }\n\n if (users.length) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (messages.length) {\n global = addMessages(global, messages);\n }\n\n global = updateGlobalSearchResults(\n global,\n messages,\n totalCount,\n type,\n nextRate,\n );\n\n setGlobal(global);\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectCurrentTextSearch,\n selectCurrentMediaSearch,\n selectCurrentMessageList,\n selectChat,\n selectThreadInfo,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n addChatMessagesById,\n addChats,\n addUsers,\n updateLocalMediaSearchResults,\n updateLocalTextSearchResults,\n} from '../../reducers';\nimport { SharedMediaType } from '../../../types';\n\naddReducer('searchTextMessagesLocal', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const currentSearch = selectCurrentTextSearch(global);\n if (!chat || !currentSearch || !threadId) {\n return;\n }\n\n const { query, results } = currentSearch;\n const offsetId = results?.nextOffsetId;\n\n let topMessageId: number | undefined;\n if (threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId!, threadId);\n topMessageId = threadInfo?.topMessageId;\n }\n\n void searchTextMessages(chat, threadId, topMessageId, query, offsetId);\n});\n\naddReducer('searchMediaMessagesLocal', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const chat = selectChat(global, chatId);\n const currentSearch = selectCurrentMediaSearch(global);\n\n if (!chat || !currentSearch) {\n return;\n }\n\n const { currentType: type, resultsByType } = currentSearch;\n const currentResults = type && resultsByType && resultsByType[type];\n const offsetId = currentResults?.nextOffsetId;\n\n if (!type) {\n return;\n }\n\n void searchSharedMedia(chat, type, offsetId);\n});\n\naddReducer('searchMessagesByDate', (global, actions, payload) => {\n const { timestamp } = payload!;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void searchMessagesByDate(chat, timestamp);\n});\n\nasync function searchTextMessages(\n chat: ApiChat,\n threadId: number,\n topMessageId?: number,\n query?: string,\n offsetId?: number,\n) {\n if (!query) {\n return;\n }\n\n const result = await callApi('searchMessagesLocal', {\n chat,\n type: 'text',\n query,\n topMessageId,\n limit: MESSAGE_SEARCH_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n chats, users, messages, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentTextSearch(global);\n if (!currentSearch || query !== currentSearch.query) {\n return;\n }\n\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChatMessagesById(global, chat.id, byId);\n global = updateLocalTextSearchResults(global, chat.id, threadId, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\nasync function searchSharedMedia(\n chat: ApiChat,\n type: SharedMediaType,\n offsetId?: number,\n isBudgetPreload = false,\n) {\n const result = await callApi('searchMessagesLocal', {\n chat,\n type,\n limit: SHARED_MEDIA_SLICE * 2,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n chats, users, messages, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentMediaSearch(global);\n if (!currentSearch) {\n return;\n }\n\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChatMessagesById(global, chat.id, byId);\n global = updateLocalMediaSearchResults(global, chat.id, type, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n\n if (!isBudgetPreload) {\n searchSharedMedia(chat, type, nextOffsetId, true);\n }\n}\n\nasync function searchMessagesByDate(chat: ApiChat, timestamp: number) {\n const messageId = await callApi('findFirstMessageIdAfterDate', {\n chat,\n timestamp,\n });\n\n if (!messageId) {\n return;\n }\n\n getDispatch().focusMessage({\n chatId: chat.id,\n messageId,\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementProgress } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { updateChat, updateManagement, updateManagementProgress } from '../../reducers';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport { isChatBasicGroup } from '../../helpers';\n\naddReducer('checkPublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n // No need to check the username if already in progress\n if (global.management.progress === ManagementProgress.InProgress) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n\n const isUsernameAvailable = await callApi('checkChatUsername', { username })!;\n\n global = getGlobal();\n global = updateManagementProgress(\n global, isUsernameAvailable ? ManagementProgress.Complete : ManagementProgress.Error,\n );\n global = updateManagement(global, chatId, { isUsernameAvailable });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n let chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n setGlobal(global);\n\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n const result = await callApi('setChatUsername', { chat, username });\n\n global = getGlobal();\n global = updateManagementProgress(global, result ? ManagementProgress.Complete : ManagementProgress.Error);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePrivateLink', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n callApi('updatePrivateLink', { chat });\n});\n\naddReducer('setEditingExportedInvite', (global, actions, payload) => {\n const { chatId, invite } = payload;\n\n setGlobal(updateManagement(global, chatId, { editingInvite: invite }));\n});\n\naddReducer('setOpenedInviteInfo', (global, actions, payload) => {\n const { chatId, invite } = payload;\n\n const update = invite ? { inviteInfo: { invite } } : { inviteInfo: undefined };\n\n setGlobal(updateManagement(global, chatId, update));\n});\n\naddReducer('loadExportedChatInvites', (global, actions, payload) => {\n const {\n chatId, adminId, isRevoked, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const admin = selectUser(global, adminId || global.currentUserId);\n if (!peer || !admin) return;\n\n (async () => {\n const result = await callApi('fetchExportedChatInvites', {\n peer, admin, isRevoked, limit,\n });\n if (!result) {\n return;\n }\n const update = isRevoked ? { revokedInvites: result } : { invites: result };\n\n setGlobal(updateManagement(getGlobal(), chatId, update));\n })();\n});\n\naddReducer('editExportedChatInvite', (global, actions, payload) => {\n const {\n chatId, link, isRevoked, expireDate, usageLimit, isRequestNeeded, title,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('editExportedChatInvite', {\n peer,\n link,\n isRevoked,\n expireDate,\n usageLimit,\n isRequestNeeded,\n title,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n let invites = global.management.byChatId[chatId].invites || [];\n const revokedInvites = global.management.byChatId[chatId].revokedInvites || [];\n const { oldInvite, newInvite } = result;\n invites = invites.filter((current) => current.link !== oldInvite.link);\n if (newInvite.isRevoked) {\n revokedInvites.unshift(newInvite);\n } else {\n invites.push(newInvite);\n }\n setGlobal(updateManagement(global, chatId, {\n invites,\n revokedInvites,\n }));\n })();\n});\n\naddReducer('exportChatInvite', (global, actions, payload) => {\n const {\n chatId, expireDate, usageLimit, isRequestNeeded, title,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('exportChatInvite', {\n peer,\n expireDate,\n usageLimit,\n isRequestNeeded,\n title,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const invites = global.management.byChatId[chatId].invites || [];\n setGlobal(updateManagement(global, chatId, {\n invites: [...invites, result],\n }));\n })();\n});\n\naddReducer('deleteExportedChatInvite', (global, actions, payload) => {\n const {\n chatId, link,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('deleteExportedChatInvite', {\n peer,\n link,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const managementState = global.management.byChatId[chatId];\n setGlobal(updateManagement(global, chatId, {\n invites: managementState?.invites?.filter((invite) => invite.link !== link),\n revokedInvites: managementState?.revokedInvites?.filter((invite) => invite.link !== link),\n }));\n })();\n});\n\naddReducer('deleteRevokedExportedChatInvites', (global, actions, payload) => {\n const {\n chatId, adminId,\n } = payload!;\n const peer = selectChat(global, chatId);\n const admin = selectUser(global, adminId || global.currentUserId);\n if (!peer || !admin) return;\n\n (async () => {\n const result = await callApi('deleteRevokedExportedChatInvites', {\n peer,\n admin,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n setGlobal(updateManagement(global, chatId, {\n revokedInvites: [],\n }));\n })();\n});\n\naddReducer('loadChatInviteImporters', (global, actions, payload) => {\n const {\n chatId, link, offsetDate, offsetUserId, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const offsetUser = selectUser(global, offsetUserId);\n if (!peer || (offsetUserId && !offsetUser)) return;\n\n (async () => {\n const result = await callApi('fetchChatInviteImporters', {\n peer,\n link,\n offsetDate,\n offsetUser,\n limit,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const currentInviteInfo = global.management.byChatId[chatId]?.inviteInfo;\n if (!currentInviteInfo?.invite || currentInviteInfo.invite.link !== link) return;\n setGlobal(updateManagement(global, chatId, {\n inviteInfo: {\n ...currentInviteInfo,\n importers: result,\n },\n }));\n })();\n});\n\naddReducer('loadChatInviteRequesters', (global, actions, payload) => {\n const {\n chatId, link, offsetDate, offsetUserId, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const offsetUser = selectUser(global, offsetUserId);\n if (!peer || (offsetUserId && !offsetUser)) return;\n\n (async () => {\n const result = await callApi('fetchChatInviteImporters', {\n peer,\n link,\n offsetDate,\n offsetUser,\n limit,\n isRequested: true,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const currentInviteInfo = global.management.byChatId[chatId]?.inviteInfo;\n if (!currentInviteInfo?.invite || currentInviteInfo.invite.link !== link) return;\n setGlobal(updateManagement(global, chatId, {\n inviteInfo: {\n ...currentInviteInfo,\n requesters: result,\n },\n }));\n })();\n});\n\naddReducer('loadChatJoinRequests', (global, actions, payload) => {\n const {\n chatId, offsetDate, offsetUserId, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const offsetUser = selectUser(global, offsetUserId);\n if (!peer || (offsetUserId && !offsetUser)) return;\n\n (async () => {\n const result = await callApi('fetchChatInviteImporters', {\n peer,\n offsetDate,\n offsetUser,\n limit,\n isRequested: true,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n setGlobal(updateChat(global, chatId, { joinRequests: result }));\n })();\n});\n\naddReducer('hideChatJoinRequest', (global, actions, payload) => {\n const {\n chatId, userId, isApproved,\n } = payload!;\n const peer = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!peer || !user) return;\n\n (async () => {\n const result = await callApi('hideChatJoinRequest', {\n peer,\n user,\n isApproved,\n });\n\n if (!result) return;\n global = getGlobal();\n const targetChat = selectChat(global, chatId);\n if (!targetChat) return;\n setGlobal(updateChat(global, chatId, {\n joinRequests: targetChat.joinRequests?.filter((importer) => importer.userId !== userId),\n }));\n })();\n});\n\naddReducer('hideAllChatJoinRequests', (global, actions, payload) => {\n const {\n chatId, isApproved, link,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('hideAllChatJoinRequests', {\n peer,\n isApproved,\n link,\n });\n\n if (!result) return;\n global = getGlobal();\n const targetChat = selectChat(global, chatId);\n if (!targetChat) return;\n\n setGlobal(updateChat(global, chatId, {\n joinRequests: [],\n fullInfo: {\n ...targetChat.fullInfo,\n recentRequesterIds: [],\n requestsPending: 0,\n },\n }));\n })();\n});\n","import {\n addReducer, getGlobal, setGlobal, getDispatch,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiFormattedText, ApiMessage, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport {\n DEBUG, MESSAGE_LIST_SLICE, SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n updateUsers,\n updateChats,\n updateThreadInfos,\n replaceThreadParam,\n updateListedIds,\n safeReplaceViewportIds,\n addChatMessagesById,\n} from '../../reducers';\nimport {\n selectCurrentMessageList,\n selectDraft,\n selectChatMessage,\n selectThreadInfo,\n} from '../../selectors';\nimport { init as initFolderManager } from '../../../util/folderManager';\n\nconst RELEASE_STATUS_TIMEOUT = 15000; // 10 sec;\n\nlet releaseStatusTimeout: number | undefined;\n\naddReducer('sync', () => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START SYNC');\n }\n\n if (releaseStatusTimeout) {\n clearTimeout(releaseStatusTimeout);\n }\n\n setGlobal({ ...getGlobal(), isSyncing: true });\n\n // Workaround for `isSyncing = true` sometimes getting stuck for some reason\n releaseStatusTimeout = window.setTimeout(() => {\n setGlobal({ ...getGlobal(), isSyncing: false });\n releaseStatusTimeout = undefined;\n }, RELEASE_STATUS_TIMEOUT);\n\n const { loadAllChats, preloadTopChatMessages } = getDispatch();\n\n loadAllChats({\n listType: 'active',\n shouldReplace: true,\n onReplace: async () => {\n await loadAndReplaceMessages();\n\n setGlobal({\n ...getGlobal(),\n lastSyncTime: Date.now(),\n isSyncing: false,\n });\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH SYNC');\n }\n\n initFolderManager();\n loadAllChats({ listType: 'archived', shouldReplace: true });\n void callApi('fetchCurrentUser');\n preloadTopChatMessages();\n },\n });\n});\n\nasync function loadAndReplaceMessages() {\n let areMessagesLoaded = false;\n\n let global = getGlobal();\n\n // Memoize drafts\n const draftChatIds = Object.keys(global.messages.byChatId);\n const draftsByChatId = draftChatIds.reduce>((acc, chatId) => {\n const draft = selectDraft(global, chatId, MAIN_THREAD_ID);\n if (draft) {\n acc[chatId] = draft;\n }\n\n return acc;\n }, {});\n\n const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {};\n const currentChat = currentChatId ? global.chats.byId[currentChatId] : undefined;\n if (currentChatId && currentChat) {\n const result = await loadTopMessages(currentChat);\n global = getGlobal();\n const { chatId: newCurrentChatId } = selectCurrentMessageList(global) || {};\n const threadInfo = currentThreadId && selectThreadInfo(global, currentChatId, currentThreadId);\n\n if (result && newCurrentChatId === currentChatId) {\n const currentMessageListInfo = global.messages.byChatId[currentChatId];\n const localMessages = currentChatId === SERVICE_NOTIFICATIONS_USER_ID\n ? global.serviceNotifications.map(({ message }) => message)\n : [];\n const allMessages = ([] as ApiMessage[]).concat(result.messages, localMessages);\n const byId = buildCollectionByKey(allMessages, 'id');\n const listedIds = Object.keys(byId).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {},\n },\n };\n\n global = addChatMessagesById(global, currentChatId, byId);\n global = updateListedIds(global, currentChatId, MAIN_THREAD_ID, listedIds);\n global = safeReplaceViewportIds(global, currentChatId, MAIN_THREAD_ID, listedIds);\n\n if (currentThreadId && threadInfo && threadInfo.originChannelId) {\n const { originChannelId } = threadInfo;\n const currentMessageListInfoOrigin = global.messages.byChatId[originChannelId];\n const resultOrigin = await loadTopMessages(global.chats.byId[originChannelId]);\n if (resultOrigin) {\n const byIdOrigin = buildCollectionByKey(resultOrigin.messages, 'id');\n const listedIdsOrigin = Object.keys(byIdOrigin).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [threadInfo.originChannelId]: {\n byId: byIdOrigin,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfoOrigin?.threadsById[MAIN_THREAD_ID]),\n listedIds: listedIdsOrigin,\n viewportIds: listedIdsOrigin,\n outlyingIds: undefined,\n },\n },\n },\n [currentChatId]: {\n ...global.messages.byChatId[currentChatId],\n threadsById: {\n ...global.messages.byChatId[currentChatId].threadsById,\n [currentThreadId]: {\n ...(currentMessageListInfo?.threadsById[currentThreadId]),\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n }\n }\n\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateThreadInfos(global, currentChatId, result.threadInfos);\n\n areMessagesLoaded = true;\n }\n }\n\n if (!areMessagesLoaded) {\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {},\n },\n };\n }\n\n // Restore drafts\n Object.keys(draftsByChatId).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', draftsByChatId[chatId]);\n });\n\n setGlobal(global);\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n if (audioChatId && audioMessageId && !selectChatMessage(global, audioChatId, audioMessageId)) {\n getDispatch().closeAudioPlayer();\n }\n}\n\nfunction loadTopMessages(chat: ApiChat) {\n return callApi('fetchMessages', {\n chat,\n threadId: MAIN_THREAD_ID,\n offsetId: chat.lastReadInboxMessageId,\n addOffset: -(Math.round(MESSAGE_LIST_SLICE / 2) + 1),\n limit: MESSAGE_LIST_SLICE,\n });\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { debounce, throttle } from '../../../util/schedulers';\nimport { buildCollectionByKey, pick, unique } from '../../../util/iteratees';\nimport { isUserBot, isUserId } from '../../helpers';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport {\n addChats, addUsers, replaceUserStatuses, updateChat, updateManagementProgress, updateUser, updateUsers,\n updateUserSearch, updateUserSearchFetchingStatus,\n} from '../../reducers';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst runDebouncedForFetchFullUser = debounce((cb) => cb(), 500, false, true);\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runThrottledForSearch = throttle((cb) => cb(), 500, false);\n\naddReducer('loadFullUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n runDebouncedForFetchFullUser(() => callApi('fetchFullUser', { id, accessHash }));\n});\n\naddReducer('loadUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchUsers', { users: [user] });\n if (!result) {\n return;\n }\n\n const { users, userStatusesById } = result;\n\n global = getGlobal();\n\n global = updateUsers(global, buildCollectionByKey(users, 'id'));\n setGlobal(replaceUserStatuses(global, {\n ...global.users.statusesById,\n ...userStatusesById,\n }));\n\n setGlobal(global);\n })();\n});\n\naddReducer('loadTopUsers', (global) => {\n const { topPeers: { lastRequestedAt } } = global;\n\n if (!lastRequestedAt || getServerTime(global.serverTimeOffset) - lastRequestedAt > TOP_PEERS_REQUEST_COOLDOWN) {\n void loadTopUsers();\n }\n});\n\naddReducer('loadContactList', () => {\n void loadContactList();\n});\n\naddReducer('loadCurrentUser', () => {\n void callApi('fetchCurrentUser');\n});\n\naddReducer('loadCommonChats', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const user = chatId ? selectUser(global, chatId) : undefined;\n if (!user || isUserBot(user) || user.commonChats?.isFullyLoaded) {\n return;\n }\n\n (async () => {\n const maxId = user.commonChats?.maxId;\n const result = await callApi('fetchCommonChats', user.id, user.accessHash!, maxId);\n if (!result) {\n return;\n }\n\n const { chats, chatIds, isFullyLoaded } = result;\n\n global = getGlobal();\n if (chats.length) {\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n }\n global = updateUser(global, user.id, {\n commonChats: {\n maxId: chatIds.length ? chatIds[chatIds.length - 1] : '0',\n ids: unique((user.commonChats?.ids || []).concat(chatIds)),\n isFullyLoaded,\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('updateContact', (global, actions, payload) => {\n const {\n userId, isMuted, firstName, lastName,\n } = payload!;\n\n void updateContact(userId, isMuted, firstName, lastName);\n});\n\naddReducer('deleteContact', (global, actions, payload) => {\n const { userId } = payload!;\n\n void deleteContact(userId);\n});\n\nasync function loadTopUsers() {\n const result = await callApi('fetchTopUsers');\n if (!result) {\n return;\n }\n\n const { ids, users } = result;\n\n let global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = {\n ...global,\n topPeers: {\n ...global.topPeers,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(global);\n}\n\nasync function loadContactList() {\n const contactList = await callApi('fetchContactList');\n if (!contactList) {\n return;\n }\n\n let global = addUsers(getGlobal(), buildCollectionByKey(contactList.users, 'id'));\n global = addChats(global, buildCollectionByKey(contactList.chats, 'id'));\n\n // Sort contact list by Last Name (or First Name), with latin names being placed first\n const getCompareString = (user: ApiUser) => (user.lastName || user.firstName || '');\n const collator = new Intl.Collator('en-US');\n\n const sortedUsers = contactList.users.sort((a, b) => (\n collator.compare(getCompareString(a), getCompareString(b))\n )).filter((user) => !user.isSelf);\n\n setGlobal({\n ...global,\n contactList: {\n userIds: sortedUsers.map((user) => user.id),\n },\n });\n}\n\nasync function updateContact(\n userId: string,\n isMuted: boolean,\n firstName: string,\n lastName?: string,\n) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n getDispatch().updateChatMutedState({ chatId: userId, isMuted });\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n let result;\n if (user.phoneNumber) {\n result = await callApi('updateContact', { phone: user.phoneNumber, firstName, lastName });\n } else {\n const { id, accessHash } = user;\n result = await callApi('addContact', {\n id,\n accessHash,\n phoneNumber: '',\n firstName,\n lastName,\n });\n }\n\n if (result) {\n setGlobal(updateUser(\n getGlobal(),\n user.id,\n {\n firstName,\n lastName,\n },\n ));\n }\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n}\n\nasync function deleteContact(userId: string) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n await callApi('deleteContact', { id, accessHash });\n}\n\naddReducer('loadProfilePhotos', (global, actions, payload) => {\n const { profileId } = payload!;\n const isPrivate = isUserId(profileId);\n const user = isPrivate ? selectUser(global, profileId) : undefined;\n const chat = !isPrivate ? selectChat(global, profileId) : undefined;\n\n if (!user && !chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchProfilePhotos', user, chat);\n if (!result || !result.photos) {\n return;\n }\n\n let newGlobal = getGlobal();\n if (isPrivate) {\n newGlobal = updateUser(newGlobal, profileId, { photos: result.photos });\n } else {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users!, 'id'));\n newGlobal = updateChat(newGlobal, profileId, { photos: result.photos });\n }\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (!query) return;\n\n void runThrottledForSearch(() => {\n searchUsers(query);\n });\n});\n\naddReducer('addContact', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n void callApi('addContact', pick(user, ['id', 'accessHash', 'firstName', 'lastName', 'phoneNumber']));\n});\n\nasync function searchUsers(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = global.userSearch.query;\n\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateUserSearchFetchingStatus(global, false));\n return;\n }\n\n const { localUsers, globalUsers } = result;\n\n let localUserIds;\n let globalUserIds;\n if (localUsers.length) {\n global = addUsers(global, buildCollectionByKey(localUsers, 'id'));\n localUserIds = localUsers.map(({ id }) => id);\n }\n if (globalUsers.length) {\n global = addUsers(global, buildCollectionByKey(globalUsers, 'id'));\n globalUserIds = globalUsers.map(({ id }) => id);\n }\n\n global = updateUserSearchFetchingStatus(global, false);\n global = updateUserSearch(global, { localUserIds, globalUserIds });\n\n setGlobal(global);\n}\n","import { GlobalState } from '../../global/types';\nimport { InlineBotSettings } from '../../types';\n\nexport function replaceInlineBotSettings(\n global: GlobalState, username: string, inlineBotSettings: InlineBotSettings | false,\n): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n byUsername: {\n ...global.inlineBots.byUsername,\n [username]: inlineBotSettings,\n },\n },\n };\n}\n\nexport function replaceInlineBotsIsLoading(global: GlobalState, isLoading: boolean): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n isLoading,\n },\n };\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiContact, ApiUser } from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport {\n RE_TG_LINK, RE_TME_LINK,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectChat, selectChatBot, selectChatMessage, selectCurrentChat, selectCurrentMessageList,\n selectReplyingToId, selectSendAs, selectUser,\n} from '../../selectors';\nimport { addChats, addUsers, removeBlockedContact } from '../../reducers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce } from '../../../util/schedulers';\nimport { replaceInlineBotSettings, replaceInlineBotsIsLoading } from '../../reducers/bots';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runDebouncedForSearch = debounce((cb) => cb(), 500, false);\n\naddReducer('clickInlineButton', (global, actions, payload) => {\n const { button } = payload;\n\n switch (button.type) {\n case 'command':\n actions.sendBotCommand({ command: button.value });\n break;\n case 'url':\n if (button.value.match(RE_TME_LINK) || button.value.match(RE_TG_LINK)) {\n actions.openTelegramLink({ url: button.value });\n } else {\n actions.toggleSafeLinkModal({ url: button.value });\n }\n break;\n case 'callback': {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n void answerCallbackButton(chat, button.messageId, button.value);\n break;\n }\n case 'requestPoll':\n actions.openPollModal();\n break;\n case 'requestSelfContact': {\n const user = global.currentUserId ? selectUser(global, global.currentUserId) : undefined;\n if (!user) {\n return;\n }\n actions.showDialog({\n data: {\n phoneNumber: user.phoneNumber,\n firstName: user.firstName,\n lastName: user.lastName,\n userId: user.id,\n } as ApiContact,\n });\n break;\n }\n case 'buy': {\n const chat = selectCurrentChat(global);\n const { messageId, value } = button;\n if (!chat) {\n return;\n }\n\n if (value) {\n actions.getReceipt({ receiptMessageId: value, chatId: chat.id, messageId });\n } else {\n actions.getPaymentForm({ chat, messageId });\n actions.setInvoiceMessageInfo(selectChatMessage(global, chat.id, messageId));\n actions.openPaymentModal({ chatId: chat.id, messageId });\n }\n break;\n }\n }\n});\n\naddReducer('sendBotCommand', (global, actions, payload) => {\n const { command, chatId } = payload;\n const { currentUserId } = global;\n const chat = chatId ? selectChat(global, chatId) : selectCurrentChat(global);\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentUserId || !chat || !currentMessageList) {\n return;\n }\n\n const { threadId } = currentMessageList;\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId: chat.id, threadId, value: false });\n\n void sendBotCommand(\n chat, currentUserId, command, selectReplyingToId(global, chat.id, threadId), selectSendAs(global, chatId),\n );\n});\n\naddReducer('restartBot', (global, actions, payload) => {\n const { chatId } = payload;\n const { currentUserId } = global;\n const chat = selectCurrentChat(global);\n const bot = currentUserId && selectChatBot(global, chatId);\n if (!currentUserId || !chat || !bot) {\n return;\n }\n\n (async () => {\n const result = await callApi('unblockContact', bot.id, bot.accessHash);\n if (!result) {\n return;\n }\n\n setGlobal(removeBlockedContact(getGlobal(), bot.id));\n void sendBotCommand(chat, currentUserId, '/start', undefined, selectSendAs(global, chatId));\n })();\n});\n\naddReducer('loadTopInlineBots', (global) => {\n const { lastRequestedAt } = global.topInlineBots;\n\n if (lastRequestedAt && getServerTime(global.serverTimeOffset) - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchTopInlineBots');\n if (!result) {\n return;\n }\n\n const { ids, users } = result;\n\n let newGlobal = getGlobal();\n newGlobal = addUsers(newGlobal, buildCollectionByKey(users, 'id'));\n newGlobal = {\n ...newGlobal,\n topInlineBots: {\n ...newGlobal.topInlineBots,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('queryInlineBot', ((global, actions, payload) => {\n const {\n chatId, username, query, offset,\n } = payload;\n\n (async () => {\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (inlineBotData === false) {\n return;\n }\n\n if (inlineBotData === undefined) {\n const { user: inlineBot, chat } = await callApi('fetchInlineBot', { username }) || {};\n global = getGlobal();\n if (!inlineBot || !chat) {\n setGlobal(replaceInlineBotSettings(global, username, false));\n return;\n }\n\n global = addUsers(global, { [inlineBot.id]: inlineBot });\n global = addChats(global, { [chat.id]: chat });\n inlineBotData = {\n id: inlineBot.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n global = replaceInlineBotSettings(global, username, inlineBotData);\n setGlobal(global);\n }\n\n if (query === inlineBotData.query && !inlineBotData.canLoadMore) {\n return;\n }\n\n void runDebouncedForSearch(() => {\n searchInlineBot({\n username,\n inlineBotData: inlineBotData as InlineBotSettings,\n chatId,\n query,\n offset,\n });\n });\n })();\n}));\n\naddReducer('sendInlineBotResult', (global, actions, payload) => {\n const { id, queryId } = payload;\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList || !id) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const chat = selectChat(global, chatId)!;\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n void callApi('sendInlineBotResult', {\n chat,\n resultId: id,\n queryId,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n sendAs: selectSendAs(global, chatId),\n });\n});\n\naddReducer('resetInlineBot', (global, actions, payload) => {\n const { username } = payload;\n\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (!inlineBotData) {\n return;\n }\n\n inlineBotData = {\n id: inlineBotData.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n setGlobal(replaceInlineBotSettings(global, username, inlineBotData));\n});\n\naddReducer('startBot', (global, actions, payload) => {\n const { botId, param } = payload;\n\n const bot = selectUser(global, botId);\n if (!bot) {\n return;\n }\n\n (async () => {\n await callApi('startBot', {\n bot,\n startParam: param,\n });\n })();\n});\n\nasync function searchInlineBot({\n username,\n inlineBotData,\n chatId,\n query,\n offset,\n}: {\n username: string;\n inlineBotData: InlineBotSettings;\n chatId: string;\n query: string;\n offset?: string;\n}) {\n let global = getGlobal();\n const bot = selectUser(global, inlineBotData.id);\n const chat = selectChat(global, chatId);\n if (!bot || !chat) {\n return;\n }\n\n const shouldReplaceSettings = inlineBotData.query !== query;\n global = replaceInlineBotsIsLoading(global, true);\n global = replaceInlineBotSettings(global, username, {\n ...inlineBotData,\n query,\n ...(shouldReplaceSettings && { offset: undefined, results: [] }),\n });\n setGlobal(global);\n\n const result = await callApi('fetchInlineBotResults', {\n bot,\n chat,\n query,\n offset: shouldReplaceSettings ? undefined : offset,\n });\n\n const newInlineBotData = global.inlineBots.byUsername[username];\n global = replaceInlineBotsIsLoading(getGlobal(), false);\n if (!result || !newInlineBotData || query !== newInlineBotData.query) {\n setGlobal(global);\n return;\n }\n\n const currentIds = new Set((newInlineBotData.results || []).map((data) => data.id));\n const newResults = result.results.filter((data) => !currentIds.has(data.id));\n\n global = replaceInlineBotSettings(global, username, {\n ...newInlineBotData,\n help: result.help,\n ...(newResults.length && { isGallery: result.isGallery }),\n ...(result.switchPm && { switchPm: result.switchPm }),\n canLoadMore: result.results.length > 0 && Boolean(result.nextOffset),\n results: newInlineBotData.offset === '' || newInlineBotData.offset === result.nextOffset\n ? result.results\n : (newInlineBotData.results || []).concat(newResults),\n offset: newResults.length ? result.nextOffset : '',\n });\n\n setGlobal(global);\n}\n\nasync function sendBotCommand(\n chat: ApiChat, currentUserId: string, command: string, replyingTo?: number, sendAs?: ApiChat | ApiUser,\n) {\n await callApi('sendMessage', {\n chat,\n text: command,\n replyingTo,\n sendAs,\n });\n}\n\nasync function answerCallbackButton(chat: ApiChat, messageId: number, data: string) {\n const result = await callApi('answerCallbackButton', {\n chatId: chat.id,\n accessHash: chat.accessHash,\n messageId,\n data,\n });\n\n if (!result) {\n return;\n }\n\n const { showDialog, showNotification, toggleSafeLinkModal } = getDispatch();\n const { message, alert: isError, url } = result;\n\n if (isError) {\n showDialog({ data: { message: message || 'Error' } });\n } else if (message) {\n showNotification({ message });\n } else if (url) {\n toggleSafeLinkModal({ url });\n }\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { replaceSettings, updateTwoFaSettings } from '../../reducers';\n\naddReducer('loadPasswordInfo', () => {\n (async () => {\n const result = await callApi('getPasswordInfo');\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = replaceSettings(global, { hasPassword: result.hasPassword });\n global = updateTwoFaSettings(global, { hint: result.hint });\n setGlobal(global);\n })();\n});\n\naddReducer('checkPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('checkPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('clearPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('clearPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updatePassword', (global, actions, payload) => {\n const {\n currentPassword, password, hint, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updatePassword', currentPassword, password, hint, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updateRecoveryEmail', (global, actions, payload) => {\n const {\n currentPassword, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updateRecoveryEmail', currentPassword, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false, waitingEmailCodeLength: undefined }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('provideTwoFaEmailCode', (global, actions, payload) => {\n const { code } = payload;\n\n void callApi('provideRecoveryEmailCode', code);\n});\n\naddReducer('clearTwoFaError', (global) => {\n return updateTwoFaSettings(global, { error: undefined });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { PaymentStep } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n selectPaymentMessageId,\n selectPaymentRequestId,\n selectProviderPublishableKey,\n selectStripeCredentials,\n selectChatMessage,\n selectPaymentChatId,\n selectChat,\n selectPaymentFormId,\n selectProviderPublicToken,\n selectSmartGlocalCredentials,\n} from '../../selectors';\nimport { callApi } from '../../../api/gramjs';\nimport { getStripeError } from '../../helpers';\nimport { buildQueryString } from '../../../util/requestQuery';\nimport { DEBUG_PAYMENT_SMART_GLOCAL } from '../../../config';\n\nimport {\n updateShippingOptions,\n setPaymentStep,\n setRequestInfoId,\n setPaymentForm,\n setStripeCardInfo,\n setInvoiceMessageInfo,\n setReceipt,\n clearPayment,\n closeInvoice,\n setSmartGlocalCardInfo,\n} from '../../reducers';\n\naddReducer('validateRequestedInfo', (global, actions, payload) => {\n const { requestInfo, saveInfo } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n if (!chat || !messageId) {\n return;\n }\n void validateRequestedInfo(chat, messageId, requestInfo, saveInfo);\n});\n\nasync function validateRequestedInfo(chat: ApiChat, messageId: number, requestInfo: any, shouldSave?: true) {\n const result = await callApi('validateRequestedInfo', {\n chat, messageId, requestInfo, shouldSave,\n });\n if (!result) {\n return;\n }\n\n const { id, shippingOptions } = result;\n if (!id) {\n return;\n }\n\n let global = setRequestInfoId(getGlobal(), id);\n if (shippingOptions) {\n global = updateShippingOptions(global, shippingOptions);\n global = setPaymentStep(global, PaymentStep.Shipping);\n } else {\n global = setPaymentStep(global, PaymentStep.PaymentInfo);\n }\n setGlobal(global);\n}\n\naddReducer('getPaymentForm', (global, actions, payload) => {\n const { chat, messageId } = payload;\n if (!chat || !messageId) {\n return;\n }\n void getPaymentForm(chat, messageId);\n});\n\nasync function getPaymentForm(chat: ApiChat, messageId: number) {\n const result = await callApi('getPaymentForm', { chat, messageId });\n if (!result) {\n return;\n }\n let global = setPaymentForm(getGlobal(), result);\n let step = PaymentStep.PaymentInfo;\n if (global.payment.invoice\n && (global.payment.invoice.shippingAddressRequested\n || global.payment.invoice.nameRequested\n || global.payment.invoice.phoneRequested\n || global.payment.invoice.emailRequested)) {\n step = PaymentStep.ShippingInfo;\n }\n global = setPaymentStep(global, step);\n setGlobal(global);\n}\n\naddReducer('getReceipt', (global, actions, payload) => {\n const { receiptMessageId, chatId, messageId } = payload;\n const chat = chatId && selectChat(global, chatId);\n if (!messageId || !receiptMessageId || !chat) {\n return;\n }\n\n void getReceipt(chat, messageId, receiptMessageId);\n});\n\nasync function getReceipt(chat: ApiChat, messageId: number, receiptMessageId: number) {\n const result = await callApi('getReceipt', chat, receiptMessageId);\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n const message = selectChatMessage(global, chat.id, messageId);\n global = setReceipt(global, result, message);\n setGlobal(global);\n}\n\naddReducer('clearPaymentError', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: undefined,\n },\n });\n});\n\naddReducer('clearReceipt', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n });\n});\n\naddReducer('sendCredentialsInfo', (global, actions, payload) => {\n const { nativeProvider } = global.payment;\n const { credentials } = payload;\n const { data } = credentials;\n\n if (nativeProvider === 'stripe') {\n const publishableKey = selectProviderPublishableKey(global);\n if (!publishableKey) {\n return;\n }\n void sendStripeCredentials(data, publishableKey);\n } else if (nativeProvider === 'smartglocal') {\n const publicToken = selectProviderPublicToken(global);\n if (!publicToken) {\n return;\n }\n void sendSmartGlocalCredentials(data, publicToken);\n }\n});\n\naddReducer('sendPaymentForm', (global, actions, payload) => {\n const { shippingOptionId, saveCredentials } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n const formId = selectPaymentFormId(global);\n const requestInfoId = selectPaymentRequestId(global);\n const { nativeProvider } = global.payment;\n const publishableKey = nativeProvider === 'stripe'\n ? selectProviderPublishableKey(global) : selectProviderPublicToken(global);\n if (!chat || !messageId || !publishableKey || !formId || !nativeProvider) {\n return;\n }\n\n void sendPaymentForm(chat, messageId, nativeProvider, formId, {\n save: saveCredentials,\n data: nativeProvider === 'stripe' ? selectStripeCredentials(global) : selectSmartGlocalCredentials(global),\n }, requestInfoId, shippingOptionId);\n});\n\nasync function sendStripeCredentials(\n data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n country: string;\n zip: string;\n },\n publishableKey: string,\n) {\n const query = buildQueryString({\n 'card[number]': data.cardNumber,\n 'card[exp_month]': data.expiryMonth,\n 'card[exp_year]': data.expiryYear,\n 'card[cvc]': data.cvv,\n 'card[address_zip]': data.zip,\n 'card[address_country]': data.country,\n });\n\n const response = await fetch(`https://api.stripe.com/v1/tokens${query}`, {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Authorization: `Bearer ${publishableKey}`,\n },\n });\n const result = await response.json();\n if (result.error) {\n const error = getStripeError(result.error);\n const global = getGlobal();\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: {\n ...error,\n },\n },\n });\n return;\n }\n let global = setStripeCardInfo(getGlobal(), {\n type: result.type,\n id: result.id,\n });\n global = setPaymentStep(global, PaymentStep.Checkout);\n setGlobal(global);\n}\n\nasync function sendSmartGlocalCredentials(\n data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n },\n publicToken: string,\n) {\n const params = {\n card: {\n number: data.cardNumber.replace(/[^\\d]+/g, ''),\n expiration_month: data.expiryMonth,\n expiration_year: data.expiryYear,\n security_code: data.cvv.replace(/[^\\d]+/g, ''),\n },\n };\n const url = DEBUG_PAYMENT_SMART_GLOCAL\n ? 'https://tgb-playground.smart-glocal.com/cds/v1/tokenize/card'\n : 'https://tgb.smart-glocal.com/cds/v1/tokenize/card';\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-PUBLIC-TOKEN': publicToken,\n },\n body: JSON.stringify(params),\n });\n const result = await response.json();\n\n if (result.status !== 'ok') {\n // TODO после получения документации сделать аналог getStripeError(result.error);\n const error = { description: 'payment error' };\n const global = getGlobal();\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: {\n ...error,\n },\n },\n });\n return;\n }\n\n let global = setSmartGlocalCardInfo(getGlobal(), {\n type: 'card',\n token: result.data.token,\n });\n global = setPaymentStep(global, PaymentStep.Checkout);\n setGlobal(global);\n}\n\nasync function sendPaymentForm(\n chat: ApiChat,\n messageId: number,\n nativeProvider: string,\n formId: string,\n credentials: any,\n requestedInfoId?: string,\n shippingOptionId?: string,\n) {\n const result = await callApi('sendPaymentForm', {\n chat, messageId, formId, credentials, requestedInfoId, shippingOptionId,\n });\n\n if (result === true) {\n const global = clearPayment(getGlobal());\n setGlobal(closeInvoice(global));\n }\n}\n\naddReducer('setPaymentStep', (global, actions, payload = {}) => {\n return setPaymentStep(global, payload.step || PaymentStep.ShippingInfo);\n});\n\naddReducer('setInvoiceMessageInfo', (global, actions, payload) => {\n return setInvoiceMessageInfo(global, payload);\n});\n","export function buildQueryString(data: Record) {\n const query = Object.keys(data).map((k) => `${k}=${data[k]}`).join('&');\n return query.length > 0 ? `?${query}` : '';\n}\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../../../config';\n\nconst REM = 16; // px\nconst MAX_TOOLBAR_WIDTH = 32 * REM;\nconst MAX_MESSAGES_LIST_WIDTH = 45.5 * REM;\nexport const SIDE_COLUMN_MAX_WIDTH = 26.5 * REM;\nexport const MIN_LEFT_COLUMN_WIDTH = 18 * REM;\nconst UNPIN_BUTTON_WIDTH = 16.125 * REM;\n\nexport default function calculateMiddleFooterTransforms(windowWidth: number, canPost?: boolean) {\n const sidePadding = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? REM\n : 2 * REM;\n const messageListWidth = getMessageListWidth(windowWidth);\n const sendButtonWidth = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? 3.375 * REM\n : 4 * REM;\n\n const composerWidth = canPost\n ? messageListWidth - sidePadding - sendButtonWidth\n : messageListWidth - sidePadding;\n const toolbarWidth = windowWidth > MOBILE_SCREEN_MAX_WIDTH\n ? Math.min(messageListWidth - sidePadding, MAX_TOOLBAR_WIDTH)\n : messageListWidth - sidePadding;\n\n const composerHiddenScale = toolbarWidth / composerWidth;\n const toolbarHiddenScale = composerWidth / toolbarWidth;\n const unpinHiddenScale = toolbarWidth / UNPIN_BUTTON_WIDTH;\n const toolbarForUnpinHiddenScale = UNPIN_BUTTON_WIDTH / toolbarWidth;\n\n const composerTranslateX = canPost\n ? (sendButtonWidth / 2) * toolbarHiddenScale\n : 0;\n\n const toolbarTranslateX = canPost\n ? (sendButtonWidth / 2) * -1 * composerHiddenScale\n : 0;\n\n return {\n composerHiddenScale,\n toolbarHiddenScale,\n composerTranslateX,\n toolbarTranslateX,\n unpinHiddenScale,\n toolbarForUnpinHiddenScale,\n };\n}\n\nfunction getMessageListWidth(windowWidth: number) {\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.25, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n const rightColumnWidth = Math.min(\n windowWidth * 0.25,\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth - rightColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.4, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MAX_MESSAGES_LIST_WIDTH) {\n return MAX_MESSAGES_LIST_WIDTH;\n }\n\n return windowWidth;\n}\n","import { updateChatMessage } from './messages';\nimport { GlobalState } from '../../global/types';\nimport { selectChatMessage } from '../selectors';\nimport { MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN, MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config';\nimport {\n MIN_LEFT_COLUMN_WIDTH,\n SIDE_COLUMN_MAX_WIDTH,\n} from '../../components/middle/helpers/calculateMiddleFooterTransforms';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\n\nfunction getLeftColumnWidth(windowWidth: number) {\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) {\n return Math.min(\n Math.max(windowWidth * 0.25, MIN_LEFT_COLUMN_WIDTH),\n windowWidth * 0.33,\n );\n }\n\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN) {\n return Math.min(\n Math.max(windowWidth * 0.33, MIN_LEFT_COLUMN_WIDTH),\n windowWidth * 0.4,\n );\n }\n\n return SIDE_COLUMN_MAX_WIDTH;\n}\n\nexport function subtractXForEmojiInteraction(global: GlobalState, x: number) {\n return x - ((global.isLeftColumnShown && !IS_SINGLE_COLUMN_LAYOUT)\n ? global.leftColumnWidth || getLeftColumnWidth(windowSize.get().width)\n : 0);\n}\n\nexport function addMessageReaction(global: GlobalState, chatId: string, messageId: number, reaction: string) {\n const { reactions } = selectChatMessage(global, chatId, messageId) || {};\n\n if (!reactions) {\n return global;\n }\n\n // Update UI without waiting for server response\n let results = reactions.results.map((l) => (l.reaction === reaction\n ? {\n ...l,\n count: l.isChosen ? l.count : l.count + 1,\n isChosen: true,\n } : (l.isChosen ? {\n ...l,\n isChosen: false,\n count: l.count - 1,\n } : l)))\n .filter((l) => l.count > 0);\n\n let { recentReactions } = reactions;\n\n if (reaction && !results.some((l) => l.reaction === reaction)) {\n const { currentUserId } = global;\n\n results = [...results, {\n reaction,\n isChosen: true,\n count: 1,\n }];\n\n if (reactions.canSeeList) {\n recentReactions = [...(recentReactions || []), {\n userId: currentUserId!,\n reaction,\n }];\n }\n }\n\n return updateChatMessage(global, chatId, messageId, {\n reactions: {\n ...reactions,\n results,\n recentReactions,\n },\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport { callApi } from '../../../api/gramjs';\nimport * as mediaLoader from '../../../util/mediaLoader';\nimport { ApiAppConfig, ApiMediaFormat } from '../../../api/types';\nimport {\n selectChat,\n selectChatMessage,\n selectDefaultReaction,\n selectLocalAnimatedEmojiEffectByName,\n selectMessageIdsByGroupId,\n} from '../../selectors';\nimport { addMessageReaction, subtractXForEmojiInteraction } from '../../reducers/reactions';\nimport { addUsers, updateChatMessage } from '../../reducers';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { ANIMATION_LEVEL_MAX } from '../../../config';\nimport { isMessageLocal } from '../../helpers';\n\nconst INTERACTION_RANDOM_OFFSET = 40;\n\nlet interactionLocalId = 0;\n\naddReducer('loadAvailableReactions', () => {\n (async () => {\n const result = await callApi('getAvailableReactions');\n\n if (!result) {\n return;\n }\n\n // Preload animations\n result.forEach((availableReaction) => {\n if (availableReaction.aroundAnimation) {\n mediaLoader.fetch(`sticker${availableReaction.aroundAnimation.id}`, ApiMediaFormat.Lottie);\n }\n if (availableReaction.centerIcon) {\n mediaLoader.fetch(`sticker${availableReaction.centerIcon.id}`, ApiMediaFormat.Lottie);\n }\n });\n\n setGlobal({\n ...getGlobal(),\n availableReactions: result,\n });\n })();\n});\n\naddReducer('interactWithAnimatedEmoji', (global, actions, payload) => {\n const {\n emoji, x, y, localEffect, startSize, isReversed,\n } = payload!;\n\n const activeEmojiInteraction = {\n id: interactionLocalId++,\n animatedEffect: emoji || localEffect,\n x: subtractXForEmojiInteraction(global, x) + Math.random()\n * INTERACTION_RANDOM_OFFSET - INTERACTION_RANDOM_OFFSET / 2,\n y: y + Math.random() * INTERACTION_RANDOM_OFFSET - INTERACTION_RANDOM_OFFSET / 2,\n startSize,\n isReversed,\n };\n\n return {\n ...global,\n activeEmojiInteractions: [...(global.activeEmojiInteractions || []), activeEmojiInteraction],\n };\n});\n\naddReducer('sendEmojiInteraction', (global, actions, payload) => {\n const {\n messageId, chatId, emoji, interactions, localEffect,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n\n if (!chat || (!emoji && !localEffect) || chatId === global.currentUserId) {\n return;\n }\n\n void callApi('sendEmojiInteraction', {\n chat,\n messageId,\n emoticon: emoji || selectLocalAnimatedEmojiEffectByName(localEffect),\n timestamps: interactions,\n });\n});\n\naddReducer('sendDefaultReaction', (global, actions, payload) => {\n const {\n chatId, messageId, x, y,\n } = payload;\n const reaction = selectDefaultReaction(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n\n if (!reaction || !message || isMessageLocal(message)) return;\n\n actions.sendReaction({\n chatId,\n messageId,\n reaction,\n x,\n y,\n });\n});\n\naddReducer('sendReaction', (global, actions, payload) => {\n const {\n chatId,\n }: { chatId: string } = payload;\n let { messageId } = payload;\n\n let { reaction } = payload;\n\n const chat = selectChat(global, chatId);\n let message = selectChatMessage(global, chatId, messageId);\n\n if (!chat || !message) {\n return undefined;\n }\n\n const isInDocumentGroup = Boolean(message.groupedId) && !message.isInAlbum;\n const documentGroupFirstMessageId = isInDocumentGroup\n ? selectMessageIdsByGroupId(global, chatId, message.groupedId!)![0]\n : undefined;\n message = isInDocumentGroup\n ? selectChatMessage(global, chatId, documentGroupFirstMessageId!) || message\n : message;\n messageId = message?.id || messageId;\n\n if (message.reactions?.results?.some((l) => l.reaction === reaction && l.isChosen)) {\n reaction = undefined;\n }\n\n void callApi('sendReaction', { chat, messageId, reaction });\n\n const { animationLevel } = global.settings.byKey;\n\n if (animationLevel === ANIMATION_LEVEL_MAX) {\n global = {\n ...global,\n activeReactions: {\n ...(reaction ? global.activeReactions : omit(global.activeReactions, [messageId])),\n ...(reaction && {\n [messageId]: {\n reaction,\n messageId,\n },\n }),\n },\n };\n }\n\n return addMessageReaction(global, chatId, messageId, reaction);\n});\n\naddReducer('openChat', (global) => {\n return {\n ...global,\n activeReactions: {},\n };\n});\n\naddReducer('startActiveReaction', (global, actions, payload) => {\n const { messageId, reaction } = payload;\n const { animationLevel } = global.settings.byKey;\n\n if (animationLevel !== ANIMATION_LEVEL_MAX) return global;\n\n if (global.activeReactions[messageId]?.reaction === reaction) {\n return global;\n }\n\n return {\n ...global,\n activeReactions: {\n ...(reaction ? global.activeReactions : omit(global.activeReactions, [messageId])),\n ...(reaction && {\n [messageId]: {\n reaction,\n messageId,\n },\n }),\n },\n };\n});\n\naddReducer('stopActiveReaction', (global, actions, payload) => {\n const { messageId, reaction } = payload;\n\n if (global.activeReactions[messageId]?.reaction !== reaction) {\n return global;\n }\n\n return {\n ...global,\n activeReactions: omit(global.activeReactions, [messageId]),\n };\n});\n\naddReducer('setDefaultReaction', (global, actions, payload) => {\n const { reaction } = payload;\n\n (async () => {\n const result = await callApi('setDefaultReaction', { reaction });\n\n if (!result) {\n return;\n }\n\n global = getGlobal();\n setGlobal({\n ...global,\n appConfig: {\n ...global.appConfig,\n defaultReaction: reaction,\n } as ApiAppConfig,\n });\n })();\n});\n\naddReducer('stopActiveEmojiInteraction', (global, actions, payload) => {\n const { id } = payload;\n\n return {\n ...global,\n activeEmojiInteractions: global.activeEmojiInteractions?.filter((l) => l.id !== id),\n };\n});\n\naddReducer('loadReactors', (global, actions, payload) => {\n const { chatId, messageId, reaction } = payload;\n const chat = selectChat(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n if (!chat || !message) {\n return;\n }\n\n const offset = message.reactors?.nextOffset;\n\n (async () => {\n const result = await callApi('fetchMessageReactionsList', {\n reaction,\n chat,\n messageId,\n offset,\n });\n\n if (!result) {\n return;\n }\n\n global = getGlobal();\n if (result.users?.length) {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n }\n\n const { nextOffset, count, reactions } = result;\n\n setGlobal(updateChatMessage(global, chatId, messageId, {\n reactors: {\n nextOffset,\n count,\n reactions: [\n ...(message.reactors?.reactions || []),\n ...reactions,\n ],\n },\n }));\n })();\n});\n\naddReducer('loadMessageReactions', (global, actions, payload) => {\n const { ids, chatId } = payload;\n\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n callApi('fetchMessageReactions', { ids, chat });\n});\n\naddReducer('sendWatchingEmojiInteraction', (global, actions, payload) => {\n const {\n chatId, emoticon, x, y, startSize, isReversed, id,\n } = payload;\n\n const chat = selectChat(global, chatId);\n\n if (!chat || !global.activeEmojiInteractions?.some((l) => l.id === id) || chatId === global.currentUserId) {\n return undefined;\n }\n\n callApi('sendWatchingEmojiInteraction', { chat, emoticon });\n\n return {\n ...global,\n activeEmojiInteractions: global.activeEmojiInteractions.map((activeEmojiInteraction) => {\n if (activeEmojiInteraction.id === id) {\n return {\n ...activeEmojiInteraction,\n x: subtractXForEmojiInteraction(global, x),\n y,\n startSize,\n isReversed,\n };\n }\n return activeEmojiInteraction;\n }),\n };\n});\n","export function areDeepEqual(value1: T, value2: T): boolean {\n const type1 = typeof value1;\n const type2 = typeof value2;\n if (type1 !== type2) {\n return false;\n }\n\n if (type1 !== 'object') {\n return value1 === value2;\n }\n\n const isArray1 = Array.isArray(value1);\n const isArray2 = Array.isArray(value2);\n\n if (isArray1 !== isArray2) {\n return false;\n }\n\n if (isArray1) {\n const array1 = value1 as any[];\n const array2 = value2 as any[];\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((member1, i) => areDeepEqual(member1, array2[i]));\n }\n\n const object1 = value1 as AnyLiteral;\n const object2 = value2 as AnyLiteral;\n const keys1 = Object.keys(object1);\n\n return keys1.every((key1) => areDeepEqual(object1[key1], object2[key1]));\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { ARCHIVED_FOLDER_ID, MAX_ACTIVE_PINNED_CHATS } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { closeMessageNotifications, notifyAboutMessage } from '../../../util/notifications';\nimport { getMessageRecentReaction } from '../../helpers';\nimport {\n updateChat,\n updateChatListIds,\n updateChatListType,\n replaceThreadParam,\n leaveChat,\n} from '../../reducers';\nimport {\n selectChat,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectChatListType,\n selectCurrentMessageList,\n} from '../../selectors';\n\nconst TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds\n// Enough to animate and mark as read in Message List\nconst CURRENT_CHAT_UNREAD_DELAY = 1500;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateChat': {\n if (!update.noTopChatsRequest && !selectIsChatListed(global, update.id)) {\n // Chat can appear in dialogs list.\n actions.loadTopChats();\n }\n\n const newGlobal = updateChat(global, update.id, update.chat, update.newProfilePhoto);\n setGlobal(newGlobal);\n\n if (update.chat.id) {\n closeMessageNotifications({\n chatId: update.chat.id,\n lastReadInboxMessageId: update.chat.lastReadInboxMessageId,\n });\n }\n break;\n }\n\n case 'updateChatJoin': {\n const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n global = updateChatListIds(global, listType, [update.id]);\n global = updateChat(global, update.id, { isNotJoined: false });\n setGlobal(global);\n\n const chat = selectChat(global, update.id);\n if (chat) {\n actions.requestChatUpdate({ chatId: chat.id });\n }\n break;\n }\n\n case 'updateChatLeave': {\n setGlobal(leaveChat(global, update.id));\n\n break;\n }\n\n case 'updateChatInbox': {\n setGlobal(updateChat(global, update.id, update.chat));\n\n break;\n }\n\n case 'updateChatTypingStatus': {\n const { id, typingStatus } = update;\n setGlobal(updateChat(global, id, { typingStatus }));\n\n setTimeout(() => {\n const newGlobal = getGlobal();\n const chat = selectChat(newGlobal, id);\n if (chat && typingStatus && chat.typingStatus && chat.typingStatus.timestamp === typingStatus.timestamp) {\n setGlobal(updateChat(newGlobal, id, { typingStatus: undefined }));\n }\n }, TYPING_STATUS_CLEAR_DELAY);\n\n break;\n }\n\n case 'newMessage': {\n const { message } = update;\n const { chatId: currentChatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n\n if (message.senderId === global.currentUserId && !message.isFromScheduled) {\n return;\n }\n\n const chat = selectChat(global, update.chatId);\n if (!chat) {\n return;\n }\n\n const isActiveChat = (\n messageListType === 'thread'\n && threadId === MAIN_THREAD_ID\n && update.chatId === currentChatId\n );\n\n if (isActiveChat) {\n setTimeout(() => {\n actions.requestChatUpdate({ chatId: update.chatId });\n }, CURRENT_CHAT_UNREAD_DELAY);\n } else {\n setGlobal(updateChat(global, update.chatId, {\n unreadCount: chat.unreadCount ? chat.unreadCount + 1 : 1,\n ...(update.message.hasUnreadMention && {\n unreadMentionsCount: chat.unreadMentionsCount ? chat.unreadMentionsCount + 1 : 1,\n }),\n }));\n }\n\n notifyAboutMessage({\n chat,\n message,\n });\n\n break;\n }\n\n case 'updateMessage': {\n const { message } = update;\n const chat = selectChat(global, update.chatId);\n if (!chat) {\n return;\n }\n\n if (getMessageRecentReaction(message)) {\n notifyAboutMessage({\n chat,\n message,\n });\n }\n break;\n }\n\n case 'updateCommonBoxMessages':\n case 'updateChannelMessages': {\n const { ids, messageUpdate } = update;\n if (messageUpdate.hasUnreadMention !== false) {\n return;\n }\n\n ids.forEach((id) => {\n const chatId = ('channelId' in update ? update.channelId : selectCommonBoxChatId(global, id))!;\n const chat = selectChat(global, chatId);\n if (chat?.unreadMentionsCount) {\n global = updateChat(global, chatId, {\n unreadMentionsCount: chat.unreadMentionsCount - 1,\n });\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatFullInfo': {\n const { fullInfo } = update;\n const targetChat = global.chats.byId[update.id];\n if (!targetChat) {\n return;\n }\n\n setGlobal(updateChat(global, update.id, {\n fullInfo: {\n ...targetChat.fullInfo,\n ...fullInfo,\n },\n }));\n\n break;\n }\n\n case 'updatePinnedChatIds': {\n const { ids, folderId } = update;\n\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: ids.length ? ids : undefined,\n },\n },\n };\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatPinned': {\n const { id, isPinned } = update;\n const listType = selectChatListType(global, id);\n if (listType) {\n const { [listType]: orderedPinnedIds } = global.chats.orderedPinnedIds;\n\n let newOrderedPinnedIds = orderedPinnedIds || [];\n if (!isPinned) {\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => pinnedId !== id);\n } else if (!newOrderedPinnedIds.includes(id)) {\n // When moving pinned chats to archive, active ordered pinned ids don't get updated\n // (to preserve chat pinned state when it returns from archive)\n // If user already has max pinned chats, we should check for orderedIds\n // that don't point to listed chats\n if (listType === 'active' && newOrderedPinnedIds.length >= MAX_ACTIVE_PINNED_CHATS) {\n const listIds = global.chats.listIds.active;\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => listIds && listIds.includes(pinnedId));\n }\n\n newOrderedPinnedIds = [id, ...newOrderedPinnedIds];\n }\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: newOrderedPinnedIds.length ? newOrderedPinnedIds : undefined,\n },\n },\n };\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatListType': {\n const { id, folderId } = update;\n\n setGlobal(updateChatListType(global, id, folderId));\n\n break;\n }\n\n case 'updateChatFolder': {\n const { id, folder } = update;\n const { byId: chatFoldersById, orderedIds } = global.chatFolders;\n\n const newChatFoldersById = folder\n ? { ...chatFoldersById, [id]: folder }\n : pick(\n chatFoldersById,\n Object.keys(chatFoldersById).map(Number).filter((folderId) => folderId !== id),\n );\n\n const newOrderedIds = folder\n ? orderedIds && orderedIds.includes(id) ? orderedIds : [...(orderedIds || []), id]\n : orderedIds ? orderedIds.filter((orderedId) => orderedId !== id) : undefined;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n byId: newChatFoldersById,\n orderedIds: newOrderedIds,\n },\n });\n\n break;\n }\n\n case 'updateChatFoldersOrder': {\n const { orderedIds } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n orderedIds,\n },\n });\n\n break;\n }\n\n case 'updateRecommendedChatFolders': {\n const { folders } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: folders,\n },\n });\n\n break;\n }\n\n case 'updateChatMembers': {\n const targetChat = global.chats.byId[update.id];\n const { replacedMembers, addedMember, deletedMemberId } = update;\n if (!targetChat) {\n return;\n }\n\n let shouldUpdate = false;\n let members = targetChat.fullInfo?.members\n ? [...targetChat.fullInfo.members]\n : [];\n\n if (replacedMembers) {\n members = replacedMembers;\n shouldUpdate = true;\n } else if (addedMember) {\n if (\n !members.length\n || !members.some((m) => m.userId === addedMember.userId)\n ) {\n members.push(addedMember);\n shouldUpdate = true;\n }\n } else if (members.length && deletedMemberId) {\n const deleteIndex = members.findIndex((m) => m.userId === deletedMemberId);\n if (deleteIndex > -1) {\n members.slice(deleteIndex, 1);\n shouldUpdate = true;\n }\n }\n\n if (shouldUpdate) {\n const adminMembers = members.filter(({ isOwner, isAdmin }) => isOwner || isAdmin);\n // TODO Kicked members?\n\n setGlobal(updateChat(global, update.id, {\n membersCount: members.length,\n fullInfo: {\n ...targetChat.fullInfo,\n members,\n adminMembers,\n },\n }));\n }\n\n break;\n }\n\n case 'deleteProfilePhotos': {\n const { chatId, ids } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat?.photos) {\n setGlobal(updateChat(global, chatId, {\n photos: chat.photos.filter((photo) => !ids.includes(photo.id)),\n }));\n }\n break;\n }\n\n case 'draftMessage': {\n const {\n chatId, formattedText, date, replyingToId,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', formattedText);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'replyingToId', replyingToId);\n global = updateChat(global, chatId, { draftDate: date });\n\n setGlobal(global);\n }\n break;\n }\n\n case 'showInvite': {\n const { data } = update;\n\n actions.showDialog({ data });\n break;\n }\n\n case 'updatePendingJoinRequests': {\n const { chatId, requestsPending, recentRequesterIds } = update;\n const chat = global.chats.byId[chatId];\n if (chat) {\n global = updateChat(global, chatId, {\n fullInfo: {\n ...chat.fullInfo,\n requestsPending,\n recentRequesterIds,\n },\n });\n setGlobal(global);\n actions.loadChatJoinRequests({ chatId });\n }\n }\n }\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiUpdate, ApiMessage, ApiPollResult, ApiThreadInfo, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { unique } from '../../../util/iteratees';\nimport { areDeepEqual } from '../../../util/areDeepEqual';\nimport { notifyAboutMessage } from '../../../util/notifications';\nimport { checkIfReactionAdded } from '../../helpers/reactions';\nimport {\n updateChat,\n deleteChatMessages,\n updateChatMessage,\n updateListedIds,\n addViewportId,\n updateThreadInfo,\n replaceThreadParam,\n updateScheduledMessage,\n deleteChatScheduledMessages,\n updateThreadUnreadFromForwardedMessage,\n} from '../../reducers';\nimport { ActiveEmojiInteraction, GlobalActions, GlobalState } from '../../../global/types';\nimport {\n selectChatMessage,\n selectChatMessages,\n selectIsViewportNewest,\n selectListedIds,\n selectChatMessageByPollId,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectThreadInfo,\n selectThreadByMessage,\n selectPinnedIds,\n selectScheduledMessage,\n selectScheduledMessages,\n isMessageInCurrentMessageList,\n selectScheduledIds,\n selectCurrentMessageList,\n selectViewportIds,\n selectFirstUnreadId,\n selectChat,\n selectIsChatWithBot,\n selectIsServiceChatReady,\n selectLocalAnimatedEmojiEffect,\n selectLocalAnimatedEmoji,\n} from '../../selectors';\nimport {\n getMessageContent, isUserId, isMessageLocal, getMessageText,\n} from '../../helpers';\n\nconst ANIMATION_DELAY = 350;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'newMessage': {\n const {\n chatId, id, message, shouldForceReply,\n } = update;\n global = updateWithLocalMedia(global, chatId, id, message);\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n\n setGlobal(global);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n\n if (isMessageInCurrentMessageList(global, chatId, message as ApiMessage)) {\n if (message.isOutgoing && !(message.content?.action)) {\n const currentMessageList = selectCurrentMessageList(global);\n if (currentMessageList) {\n // We do not use `actions.focusLastMessage` as it may be set with a delay (see below)\n actions.focusMessage({\n chatId,\n threadId: currentMessageList.threadId,\n messageId: message.id,\n noHighlight: true,\n isResizingContainer: true,\n });\n }\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message as ApiMessage) || {};\n if (threadInfo) {\n actions.requestThreadInfoUpdate({ chatId, threadId: threadInfo.threadId });\n }\n\n // @perf Wait until scroll animation finishes or simply rely on delivery status update (which is itself delayed)\n if (!isMessageLocal(message as ApiMessage)) {\n setTimeout(() => {\n let delayedGlobal = getGlobal();\n if (shouldForceReply) {\n delayedGlobal = replaceThreadParam(delayedGlobal, chatId, MAIN_THREAD_ID, 'replyingToId', id);\n }\n setGlobal(updateChatLastMessage(delayedGlobal, chatId, newMessage));\n }, ANIMATION_DELAY);\n }\n } else {\n setGlobal(updateChatLastMessage(getGlobal(), chatId, newMessage));\n }\n\n // Edge case: New message in an old (not loaded) chat.\n if (!selectIsChatListed(global, chatId)) {\n actions.loadTopChats();\n }\n\n break;\n }\n\n case 'updateStartEmojiInteraction': {\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n if (currentChatId !== update.id) return;\n const message = selectChatMessage(global, currentChatId, update.messageId);\n\n if (!message) return;\n\n // Workaround for a weird behavior when interaction is received after watching reaction\n if (getMessageText(message) !== update.emoji) return;\n\n const localEmoji = selectLocalAnimatedEmoji(global, update.emoji);\n\n global = {\n ...global,\n activeEmojiInteractions: [...(global.activeEmojiInteractions || []), {\n id: global.activeEmojiInteractions?.length || 0,\n animatedEffect: localEmoji ? selectLocalAnimatedEmojiEffect(localEmoji) : update.emoji,\n messageId: update.messageId,\n } as ActiveEmojiInteraction],\n };\n\n setGlobal(global);\n\n break;\n }\n\n case 'newScheduledMessage': {\n const { chatId, id, message } = update;\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', unique([...scheduledIds, id]));\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectChatMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n global = updateChatLastMessage(global, chatId, newMessage);\n\n setGlobal(global);\n\n // Scroll down if bot message height is changed with an updated inline keyboard.\n // A drawback: this will scroll down even if the previous scroll was not at bottom.\n const chat = selectChat(global, chatId);\n if (\n chat\n && !message.isOutgoing\n && chat.lastMessage?.id === message.id\n && selectIsChatWithBot(global, chat)\n && isMessageInCurrentMessageList(global, chatId, message as ApiMessage)\n && selectIsViewportNewest(global, chatId, message.threadInfo?.threadId || MAIN_THREAD_ID)\n ) {\n actions.focusLastMessage();\n }\n\n break;\n }\n\n case 'updateScheduledMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectScheduledMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n const ids = Object.keys(selectScheduledMessages(global, chatId) || {}).map(Number).sort((a, b) => b - a);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n const currentMessage = selectChatMessage(global, chatId, localId);\n\n global = deleteChatMessages(global, chatId, [localId]);\n\n // Edge case for \"Send When Online\"\n if (message.isScheduled) {\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n }\n\n global = updateChatMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n const newMessage = selectChatMessage(global, chatId, message.id)!;\n global = updateChatLastMessage(global, chatId, newMessage);\n\n const thread = selectThreadByMessage(global, chatId, message);\n // For some reason Telegram requires to manually mark outgoing thread messages read\n if (thread?.threadInfo) {\n actions.markMessageListRead({ maxId: message.id });\n\n global = replaceThreadParam(global, chatId, thread.threadInfo.threadId, 'threadInfo', {\n ...thread.threadInfo,\n lastMessageId: message.id,\n lastReadInboxMessageId: message.id,\n });\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateScheduledMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', [...scheduledIds, message.id]);\n\n const currentMessage = selectScheduledMessage(global, chatId, localId);\n\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n global = updateScheduledMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n setGlobal(global);\n break;\n }\n\n case 'updatePinnedIds': {\n const { chatId, isPinned, messageIds } = update;\n\n const currentPinnedIds = selectPinnedIds(global, chatId) || [];\n const newPinnedIds = isPinned\n ? [...currentPinnedIds, ...messageIds].sort((a, b) => b - a)\n : currentPinnedIds.filter((id) => !messageIds.includes(id));\n\n setGlobal(replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds', newPinnedIds));\n\n break;\n }\n\n case 'updateThreadInfo': {\n const {\n chatId, threadId, threadInfo, firstMessageId,\n } = update;\n\n const currentThreadInfo = selectThreadInfo(global, chatId, threadId);\n const newTheadInfo = {\n ...currentThreadInfo,\n ...threadInfo,\n };\n\n if (!newTheadInfo.threadId) {\n return;\n }\n\n global = updateThreadInfo(global, chatId, threadId, newTheadInfo as ApiThreadInfo);\n\n if (firstMessageId) {\n global = replaceThreadParam(global, chatId, threadId, 'firstMessageId', firstMessageId);\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'resetMessages': {\n const { id: chatId } = update;\n const messagesById = selectChatMessages(global, chatId);\n\n if (messagesById && !isUserId(chatId)) {\n global = deleteChatMessages(global, chatId, Object.keys(messagesById).map(Number));\n setGlobal(global);\n actions.loadFullChat({ chatId, force: true });\n }\n\n break;\n }\n\n case 'deleteMessages': {\n const { ids, chatId } = update;\n\n deleteMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteScheduledMessages': {\n const { ids, chatId } = update;\n\n deleteScheduledMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteHistory': {\n const { chatId } = update;\n const chatMessages = global.messages.byChatId[chatId];\n if (chatMessages) {\n const ids = Object.keys(chatMessages.byId).map(Number);\n deleteMessages(chatId, ids, actions, global);\n } else {\n actions.requestChatUpdate({ chatId });\n }\n\n break;\n }\n\n case 'updateCommonBoxMessages': {\n const { ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n const chatId = selectCommonBoxChatId(global, id);\n if (chatId) {\n global = updateChatMessage(global, chatId, id, messageUpdate);\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChannelMessages': {\n const { channelId, ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n global = updateChatMessage(global, channelId, id, messageUpdate);\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessagePoll': {\n const { pollId, pollUpdate } = update;\n\n const message = selectChatMessageByPollId(global, pollId);\n\n if (message?.content.poll) {\n const updatedPoll = { ...message.content.poll, ...pollUpdate };\n\n // Workaround for poll update bug: `chosen` option gets reset when someone votes after current user\n const { results: updatedResults } = updatedPoll.results || {};\n if (updatedResults && !updatedResults.some(((result) => result.isChosen))) {\n const { results } = message.content.poll.results;\n const chosenAnswers = results && results.filter((result) => result.isChosen);\n if (chosenAnswers) {\n chosenAnswers.forEach((chosenAnswer) => {\n const chosenAnswerIndex = updatedResults.findIndex((result) => result.option === chosenAnswer.option);\n if (chosenAnswerIndex >= 0) {\n updatedPoll.results.results![chosenAnswerIndex].isChosen = true;\n }\n });\n }\n }\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: updatedPoll,\n },\n },\n ));\n }\n break;\n }\n\n case 'updateMessagePollVote': {\n const { pollId, userId, options } = update;\n const message = selectChatMessageByPollId(global, pollId);\n if (!message || !message.content.poll || !message.content.poll.results) {\n break;\n }\n\n const { poll } = message.content;\n\n const { recentVoterIds, totalVoters, results } = poll.results;\n const newRecentVoterIds = recentVoterIds ? [...recentVoterIds] : [];\n const newTotalVoters = totalVoters ? totalVoters + 1 : 1;\n const newResults = results ? [...results] : [];\n\n newRecentVoterIds.push(userId);\n\n options.forEach((option) => {\n const targetOption = newResults.find((result) => result.option === option);\n const targetOptionIndex = newResults.findIndex((result) => result.option === option);\n const updatedOption: ApiPollResult = targetOption ? { ...targetOption } : { option, votersCount: 0 };\n\n updatedOption.votersCount += 1;\n if (userId === global.currentUserId) {\n updatedOption.isChosen = true;\n }\n\n if (targetOptionIndex) {\n newResults[targetOptionIndex] = updatedOption;\n } else {\n newResults.push(updatedOption);\n }\n });\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: {\n ...poll,\n results: {\n ...poll.results,\n recentVoterIds: newRecentVoterIds,\n totalVoters: newTotalVoters,\n results: newResults,\n },\n },\n },\n },\n ));\n\n break;\n }\n\n case 'updateServiceNotification': {\n const { message } = update;\n\n if (selectIsServiceChatReady(global)) {\n actions.createServiceNotification({ message });\n }\n\n break;\n }\n\n case 'updateMessageReactions': {\n const { chatId, id, reactions } = update;\n const message = selectChatMessage(global, chatId, id);\n const chat = selectChat(global, update.chatId);\n const currentReactions = message?.reactions;\n\n // `updateMessageReactions` happens with an interval so we try to avoid redundant global state updates\n if (currentReactions && areDeepEqual(reactions, currentReactions)) {\n return;\n }\n\n // Only notify about added reactions, not removed ones\n const shouldNotify = checkIfReactionAdded(currentReactions, reactions);\n\n global = updateChatMessage(global, chatId, id, { reactions: update.reactions });\n\n if (shouldNotify) {\n const newMessage = selectChatMessage(global, chatId, id);\n if (!chat || !newMessage) return;\n notifyAboutMessage({\n chat,\n message: newMessage,\n });\n }\n\n setGlobal(global);\n break;\n }\n }\n});\n\nfunction updateWithLocalMedia(\n global: GlobalState, chatId: string, id: number, message: Partial, isScheduled = false,\n) {\n // Preserve locally uploaded media.\n const currentMessage = isScheduled\n ? selectScheduledMessage(global, chatId, id)\n : selectChatMessage(global, chatId, id);\n if (currentMessage && message.content) {\n const {\n photo, video, sticker, document,\n } = getMessageContent(currentMessage);\n if (photo && message.content.photo) {\n message.content.photo.blobUrl = photo.blobUrl;\n message.content.photo.thumbnail = photo.thumbnail;\n } else if (video && message.content.video) {\n message.content.video.blobUrl = video.blobUrl;\n } else if (sticker && message.content.sticker) {\n message.content.sticker.isPreloadedGlobally = sticker.isPreloadedGlobally;\n } else if (document && message.content.document) {\n message.content.document.previewBlobUrl = document.previewBlobUrl;\n }\n }\n\n return isScheduled\n ? updateScheduledMessage(global, chatId, id, message)\n : updateChatMessage(global, chatId, id, message);\n}\n\nfunction updateThreadUnread(global: GlobalState, actions: GlobalActions, message: ApiMessage, isDeleting?: boolean) {\n const { chatId } = message;\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n\n if (!threadInfo && message.replyToMessageId) {\n const originMessage = selectChatMessage(global, chatId, message.replyToMessageId);\n if (originMessage) {\n global = updateThreadUnreadFromForwardedMessage(global, originMessage, chatId, message.id, isDeleting);\n } else {\n actions.loadMessage({\n chatId,\n messageId: message.replyToMessageId,\n threadUpdate: {\n isDeleting,\n lastMessageId: message.id,\n },\n });\n }\n }\n\n return global;\n}\n\nfunction updateListedAndViewportIds(global: GlobalState, actions: GlobalActions, message: ApiMessage) {\n const { id, chatId } = message;\n\n const { threadInfo, firstMessageId } = selectThreadByMessage(global, chatId, message) || {};\n\n const chat = selectChat(global, chatId);\n const isUnreadChatNotLoaded = chat?.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n global = updateThreadUnread(global, actions, message);\n\n if (threadInfo) {\n if (firstMessageId || !isMessageLocal(message)) {\n global = updateListedIds(global, chatId, threadInfo.threadId, [id]);\n\n if (selectIsViewportNewest(global, chatId, threadInfo.threadId)) {\n global = addViewportId(global, chatId, threadInfo.threadId, id);\n\n if (!firstMessageId) {\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'firstMessageId', message.id);\n }\n }\n }\n\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'threadInfo', {\n ...threadInfo,\n lastMessageId: message.id,\n messagesCount: threadInfo.messagesCount + 1,\n });\n }\n\n if (isUnreadChatNotLoaded) {\n return global;\n }\n\n global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);\n\n if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {\n // Always keep the first unread message in the viewport list\n const firstUnreadId = selectFirstUnreadId(global, chatId, MAIN_THREAD_ID);\n const newGlobal = addViewportId(global, chatId, MAIN_THREAD_ID, id);\n const newViewportIds = selectViewportIds(newGlobal, chatId, MAIN_THREAD_ID);\n\n if (!firstUnreadId || newViewportIds!.includes(firstUnreadId)) {\n global = newGlobal;\n }\n }\n\n return global;\n}\n\nfunction updateChatLastMessage(\n global: GlobalState,\n chatId: string,\n message: ApiMessage,\n force = false,\n) {\n const { chats } = global;\n const currentLastMessage = chats.byId[chatId]?.lastMessage;\n\n if (currentLastMessage && !force) {\n const isSameOrNewer = (\n currentLastMessage.id === message.id || currentLastMessage.id === message.previousLocalId\n ) || message.id > currentLastMessage.id;\n\n if (!isSameOrNewer) {\n return global;\n }\n }\n\n return updateChat(global, chatId, { lastMessage: message });\n}\n\nfunction findLastMessage(global: GlobalState, chatId: string) {\n const byId = selectChatMessages(global, chatId);\n const listedIds = selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n if (!byId || !listedIds) {\n return undefined;\n }\n\n let i = listedIds.length;\n while (i--) {\n const message = byId[listedIds[i]];\n if (!message.isDeleting) {\n return message;\n }\n }\n\n return undefined;\n}\n\nfunction deleteMessages(chatId: string | undefined, ids: number[], actions: GlobalActions, global: GlobalState) {\n // Channel update\n\n if (chatId) {\n ids.forEach((id) => {\n global = updateChatMessage(global, chatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, chatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, chatId, newLastMessage, true);\n }\n });\n\n setGlobal(global);\n\n actions.requestChatUpdate({ chatId });\n\n const threadIdsToUpdate: number[] = [];\n\n ids.forEach((id) => {\n const message = selectChatMessage(global, chatId, id);\n if (!message) {\n return;\n }\n\n global = updateThreadUnread(global, actions, message, true);\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n if (threadInfo) {\n threadIdsToUpdate.push(threadInfo.threadId);\n }\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), chatId, ids));\n\n unique(threadIdsToUpdate).forEach((threadId) => {\n actions.requestThreadInfoUpdate({ chatId, threadId });\n });\n }, ANIMATION_DELAY);\n\n return;\n }\n\n // Common box update\n\n const chatsIdsToUpdate: string[] = [];\n\n ids.forEach((id) => {\n const commonBoxChatId = selectCommonBoxChatId(global, id);\n if (commonBoxChatId) {\n chatsIdsToUpdate.push(commonBoxChatId);\n\n global = updateChatMessage(global, commonBoxChatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, commonBoxChatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, commonBoxChatId, newLastMessage, true);\n }\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), commonBoxChatId, [id]));\n }, ANIMATION_DELAY);\n }\n });\n\n setGlobal(global);\n\n unique(chatsIdsToUpdate).forEach((id) => {\n actions.requestChatUpdate({ chatId: id });\n });\n}\n\nfunction deleteScheduledMessages(\n chatId: string | undefined, ids: number[], actions: GlobalActions, global: GlobalState,\n) {\n if (!chatId) {\n return;\n }\n\n ids.forEach((id) => {\n global = updateScheduledMessage(global, chatId, id, {\n isDeleting: true,\n });\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n global = deleteChatScheduledMessages(getGlobal(), chatId, ids);\n const scheduledMessages = selectScheduledMessages(global, chatId);\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'scheduledIds', Object.keys(scheduledMessages || {}).map(Number),\n );\n setGlobal(global);\n }, ANIMATION_DELAY);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, ApiUserStatus } from '../../../api/types';\n\nimport { deleteContact, replaceUserStatuses, updateUser } from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\n\nconst STATUS_UPDATE_THROTTLE = 3000;\n\nconst flushStatusUpdatesThrottled = throttle(flushStatusUpdates, STATUS_UPDATE_THROTTLE, true);\n\nlet pendingStatusUpdates: Record = {};\n\nfunction scheduleStatusUpdate(userId: string, statusUpdate: ApiUserStatus) {\n pendingStatusUpdates[userId] = statusUpdate;\n flushStatusUpdatesThrottled();\n}\n\nfunction flushStatusUpdates() {\n const global = getGlobal();\n\n setGlobal(replaceUserStatuses(global, {\n ...global.users.statusesById,\n ...pendingStatusUpdates,\n }));\n\n pendingStatusUpdates = {};\n}\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'deleteContact': {\n return deleteContact(global, update.id);\n }\n\n case 'updateUser': {\n return updateUser(global, update.id, update.user);\n }\n\n case 'updateUserStatus': {\n // Status updates come very often so we throttle them\n scheduleStatusUpdate(update.userId, update.status);\n return undefined;\n }\n\n case 'updateUserFullInfo': {\n const { id, fullInfo } = update;\n const targetUser = global.users.byId[id];\n if (!targetUser) {\n return undefined;\n }\n\n return updateUser(global, id, {\n fullInfo: {\n ...targetUser.fullInfo,\n ...fullInfo,\n },\n });\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { updateStickerSet } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateStickerSet': {\n return updateStickerSet(global, update.id, update.stickerSet);\n }\n }\n\n return undefined;\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { ApiPrivacyKey, PaymentStep } from '../../../types';\n\nimport {\n addBlockedContact, removeBlockedContact, setConfirmPaymentUrl, setPaymentStep,\n} from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updatePeerBlocked':\n if (update.isBlocked) {\n return addBlockedContact(getGlobal(), update.id);\n } else {\n return removeBlockedContact(getGlobal(), update.id);\n }\n\n case 'updateResetContactList':\n setGlobal({\n ...getGlobal(),\n contactList: {\n userIds: [],\n },\n });\n break;\n\n case 'updateFavoriteStickers':\n actions.loadFavoriteStickers();\n break;\n\n case 'updatePrivacy':\n global.settings.privacy[update.key as ApiPrivacyKey] = update.rules;\n break;\n\n case 'updatePaymentVerificationNeeded':\n global = setConfirmPaymentUrl(getGlobal(), update.url);\n global = setPaymentStep(global, PaymentStep.ConfirmPayment);\n setGlobal(global);\n break;\n }\n\n return undefined;\n});\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\nimport { addNotifyException, updateChat, updateNotifySettings } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateNotifySettings': {\n return updateNotifySettings(global, update.peerType, update.isSilent, update.shouldShowPreviews);\n }\n\n case 'updateNotifyExceptions': {\n const {\n chatId, isMuted, isSilent, shouldShowPreviews,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = updateChat(global, chatId, { isMuted });\n }\n\n setGlobal(addNotifyException(global, chatId, { isMuted, isSilent, shouldShowPreviews }));\n break;\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateTwoFaStateWaitCode': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n isLoading: false,\n waitingEmailCodeLength: update.length,\n },\n };\n }\n\n case 'updateTwoFaError': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n error: update.message,\n },\n };\n }\n }\n\n return undefined;\n});\n","import { addReducer, getGlobal } from '../../../lib/teact/teactn';\nimport { ApiUpdate } from '../../../api/types';\nimport { removeGroupCall, updateGroupCall, updateGroupCallParticipant } from '../../reducers/calls';\nimport { omit } from '../../../util/iteratees';\nimport { selectChat } from '../../selectors';\nimport { updateChat } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateGroupCall': {\n if (update.call.connectionState === 'discarded') {\n if (global.groupCalls.activeGroupCallId) {\n actions.leaveGroupCall({ shouldRemove: true });\n return undefined;\n } else {\n return removeGroupCall(global, update.call.id);\n }\n }\n\n return updateGroupCall(global,\n update.call.id,\n omit(update.call, ['connectionState']),\n undefined,\n update.call.participantsCount);\n }\n case 'updateGroupCallChatId': {\n const chat = selectChat(global, update.chatId);\n if (chat) {\n global = updateChat(global, update.chatId, {\n fullInfo: {\n ...chat.fullInfo,\n groupCallId: update.call.id,\n },\n });\n }\n return global;\n }\n case 'updateGroupCallParticipants': {\n const { groupCallId, participants, nextOffset } = update;\n const { currentUserId } = global;\n\n // `secret-sauce` should disconnect if the participant is us but from another device\n global = getGlobal();\n participants.forEach((participant) => {\n if (participant.id) {\n global = updateGroupCallParticipant(global, groupCallId, participant.id, participant,\n Boolean(nextOffset) || currentUserId === participant.id);\n }\n });\n if (nextOffset) {\n global = updateGroupCall(global, groupCallId, {\n nextOffset,\n });\n }\n return global;\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { clearPayment } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updatePaymentStateCompleted': {\n return clearPayment(global);\n }\n }\n\n return undefined;\n});\n","import { useEffect } from '../lib/teact/teact';\n\nimport { onBeforeUnload } from '../util/schedulers';\n\nexport default function useBeforeUnload(callback: AnyToVoidFunction) {\n useEffect(() => {\n return onBeforeUnload(callback);\n }, [callback]);\n}\n","import { useEffect } from '../lib/teact/teact';\nimport { IS_IOS, IS_PWA, IS_TOUCH_ENV } from '../util/environment';\n\nconst metaViewport = document.querySelector('meta[name=\"viewport\"]');\nconst defaultViewportContent = metaViewport?.getAttribute('content') || '';\nconst allowedZoomViewportContent = 'width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover';\n\nexport default function usePreventPinchZoomGesture(isDisabled = false) {\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n return undefined;\n }\n\n if (isDisabled) {\n // Clean viewport content from values values that disable the ability to zoom a webpage\n // https://web.dev/meta-viewport/\n metaViewport?.setAttribute('content', allowedZoomViewportContent);\n return undefined;\n }\n\n metaViewport?.setAttribute('content', defaultViewportContent);\n\n // Since iOS 10 `user-scaleable=no` is disabled in Safari for iOS,\n // this is only applicable for the browser and does not apply to the PWA mode.\n // https://newbedev.com/how-do-you-disable-viewport-zooming-on-mobile-safari\n if (IS_IOS && !IS_PWA) {\n document.addEventListener('gesturestart', preventEvent);\n }\n\n return () => {\n metaViewport?.setAttribute('content', 'width=device-width, initial-scale=1, shrink-to-fit=no');\n if (IS_IOS && !IS_PWA) {\n document.removeEventListener('gesturestart', preventEvent);\n }\n };\n }, [isDisabled]);\n}\n\nfunction preventEvent(e: Event) {\n e.preventDefault();\n}\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\n\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport { useFolderManagerForUnreadCounters } from '../../hooks/useFolderManager';\nimport { getAllNotificationsCount } from '../../util/folderManager';\nimport { updateAppBadge } from '../../util/appBadge';\n\ninterface OwnProps {\n isForAppBadge?: boolean;\n}\n\nconst UnreadCounter: FC = ({ isForAppBadge }) => {\n useFolderManagerForUnreadCounters();\n const unreadNotificationsCount = getAllNotificationsCount();\n\n useEffect(() => {\n if (isForAppBadge) {\n updateAppBadge(unreadNotificationsCount);\n }\n }, [isForAppBadge, unreadNotificationsCount]);\n\n if (isForAppBadge || !unreadNotificationsCount) {\n return undefined;\n }\n\n return (\n
{formatIntegerCompact(unreadNotificationsCount)}
\n );\n};\n\nexport default memo(UnreadCounter);\n","import { GlobalState } from '../global/types';\n\nimport useBrowserOnline from './useBrowserOnline';\nimport { LangFn } from './useLang';\n\nexport enum ConnectionStatus {\n waitingForNetwork,\n syncing,\n online,\n}\n\ntype ConnectionStatusPosition =\n 'overlay'\n | 'minimized'\n | 'middleHeader'\n | 'none';\n\nexport default function useConnectionStatus(\n lang: LangFn,\n connectionState: GlobalState['connectionState'],\n isSyncing: GlobalState['isSyncing'],\n hasMiddleHeader: boolean,\n isMinimized?: boolean,\n isDisabled?: boolean,\n) {\n let status: ConnectionStatus;\n const isBrowserOnline = useBrowserOnline();\n if (!isBrowserOnline || connectionState === 'connectionStateConnecting') {\n status = ConnectionStatus.waitingForNetwork;\n } else if (isSyncing) {\n status = ConnectionStatus.syncing;\n } else {\n status = ConnectionStatus.online;\n }\n\n let position: ConnectionStatusPosition;\n if (status === ConnectionStatus.online || isDisabled) {\n position = 'none';\n } else if (hasMiddleHeader) {\n position = 'middleHeader';\n } else if (isMinimized) {\n position = 'minimized';\n } else {\n position = 'overlay';\n }\n\n let text: string | undefined;\n if (status === ConnectionStatus.waitingForNetwork) {\n text = lang('WaitingForNetwork');\n } else if (status === ConnectionStatus.syncing) {\n text = lang('Updating');\n }\n\n if (position === 'middleHeader') {\n text = text!.toLowerCase().replace(/\\.+$/, '');\n }\n\n return {\n connectionStatus: status,\n connectionStatusPosition: position,\n connectionStatusText: text,\n };\n}\n","import { useEffect, useState } from '../lib/teact/teact';\n\nexport default function useBrowserOnline() {\n const [isOnline, setIsOnline] = useState(window.navigator.onLine);\n\n useEffect(() => {\n function handleChange() {\n setIsOnline(window.navigator.onLine);\n }\n\n window.addEventListener('online', handleChange);\n window.addEventListener('offline', handleChange);\n\n return () => {\n window.removeEventListener('offline', handleChange);\n window.removeEventListener('online', handleChange);\n };\n }, []);\n\n return isOnline;\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { ConnectionStatus } from '../../hooks/useConnectionStatus';\n\nimport Transition from '../ui/Transition';\nimport Spinner from '../ui/Spinner';\nimport Button from '../ui/Button';\n\nimport './ConnectionStatusOverlay.scss';\n\ntype OwnProps = {\n connectionStatus: ConnectionStatus;\n connectionStatusText: string;\n onClick?: NoneToVoidFunction;\n};\n\nconst ConnectionStatusOverlay: FC = ({\n connectionStatus,\n connectionStatusText,\n onClick,\n}) => {\n const lang = useLang();\n\n return (\n
\n \n
\n \n {connectionStatusText}\n \n
\n \n \n \n
\n );\n};\n\nexport default memo(ConnectionStatusOverlay);\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ISettings, LeftColumnContent } from '../../../types';\nimport { ApiChat } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\n\nimport {\n ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, DEBUG, FEEDBACK_URL,\n} from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { formatDateToString } from '../../../util/dateFormat';\nimport switchTheme from '../../../util/switchTheme';\nimport { setPermanentWebVersion } from '../../../util/permanentWebVersion';\nimport { clearWebsync } from '../../../util/websync';\nimport { selectCurrentMessageList, selectTheme } from '../../../modules/selectors';\nimport { isChatArchived } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport { disableHistoryBack } from '../../../hooks/useHistoryBack';\nimport useConnectionStatus from '../../../hooks/useConnectionStatus';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport SearchInput from '../../ui/SearchInput';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\nimport Switcher from '../../ui/Switcher';\nimport ShowTransition from '../../ui/ShowTransition';\nimport ConnectionStatusOverlay from '../ConnectionStatusOverlay';\n\nimport './LeftMainHeader.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n onSearchQuery: (query: string) => void;\n onSelectSettings: () => void;\n onSelectContacts: () => void;\n onSelectArchived: () => void;\n onReset: () => void;\n};\n\ntype StateProps =\n {\n searchQuery?: string;\n isLoading: boolean;\n currentUserId?: string;\n globalSearchChatId?: string;\n searchDate?: number;\n theme: ISettings['theme'];\n animationLevel: 0 | 1 | 2;\n chatsById?: Record;\n isMessageListOpen: boolean;\n isConnectionStatusMinimized: ISettings['isConnectionStatusMinimized'];\n areChatsLoaded?: boolean;\n }\n & Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [0, 1, 2];\n\nconst PRODUCTION_HOSTNAME = 'web.telegram.org';\nconst LEGACY_VERSION_URL = 'https://web.telegram.org/?legacy=1';\nconst WEBK_VERSION_URL = 'https://web.telegram.org/k/';\n\nconst LeftMainHeader: FC = ({\n content,\n contactsFilter,\n onSearchQuery,\n onSelectSettings,\n onSelectContacts,\n onSelectArchived,\n onReset,\n searchQuery,\n isLoading,\n shouldSkipTransition,\n currentUserId,\n globalSearchChatId,\n searchDate,\n theme,\n animationLevel,\n chatsById,\n connectionState,\n isSyncing,\n isMessageListOpen,\n isConnectionStatusMinimized,\n areChatsLoaded,\n}) => {\n const {\n openChat,\n openTipsChat,\n setGlobalSearchDate,\n setSettingOption,\n setGlobalSearchChatId,\n } = getDispatch();\n\n const lang = useLang();\n const hasMenu = content === LeftColumnContent.ChatList;\n const clearedDateSearchParam = { date: undefined };\n const clearedChatSearchParam = { id: undefined };\n const selectedSearchDate = useMemo(() => {\n return searchDate\n ? formatDateToString(new Date(searchDate * 1000))\n : undefined;\n }, [searchDate]);\n const archivedUnreadChatsCount = useMemo(() => {\n if (!hasMenu || !chatsById) {\n return 0;\n }\n\n return Object.values(chatsById).reduce((total, chat) => {\n if (!isChatArchived(chat)) {\n return total;\n }\n\n return chat.unreadCount ? total + 1 : total;\n }, 0);\n }, [hasMenu, chatsById]);\n\n const { connectionStatus, connectionStatusText, connectionStatusPosition } = useConnectionStatus(\n lang, connectionState, isSyncing, isMessageListOpen, isConnectionStatusMinimized, !areChatsLoaded,\n );\n\n const withOtherVersions = window.location.hostname === PRODUCTION_HOSTNAME;\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n onReset()}\n ariaLabel={hasMenu ? lang('AccDescrOpenMenu2') : 'Return to chat list'}\n >\n
\n \n );\n }, [hasMenu, lang, onReset, shouldSkipTransition]);\n\n const handleSearchFocus = useCallback(() => {\n if (!searchQuery) {\n onSearchQuery('');\n }\n }, [searchQuery, onSearchQuery]);\n\n const toggleConnectionStatus = useCallback(() => {\n setSettingOption({ isConnectionStatusMinimized: !isConnectionStatusMinimized });\n }, [isConnectionStatusMinimized, setSettingOption]);\n\n const handleSelectSaved = useCallback(() => {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n }, [currentUserId, openChat]);\n\n const handleDarkModeToggle = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n const newTheme = theme === 'light' ? 'dark' : 'light';\n\n setSettingOption({ theme: newTheme });\n setSettingOption({ shouldUseSystemTheme: false });\n switchTheme(newTheme, animationLevel === ANIMATION_LEVEL_MAX);\n }, [animationLevel, setSettingOption, theme]);\n\n const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n\n const newLevel = animationLevel === 0 ? 2 : 0;\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [animationLevel, setSettingOption]);\n\n const handleSwitchToWebK = () => {\n setPermanentWebVersion('K');\n clearWebsync();\n disableHistoryBack();\n };\n\n const handleOpenTipsChat = () => {\n openTipsChat({ langCode: lang.code });\n };\n\n const isSearchFocused = (\n Boolean(globalSearchChatId)\n || content === LeftColumnContent.GlobalSearch\n || content === LeftColumnContent.Contacts\n );\n\n const searchInputPlaceholder = content === LeftColumnContent.Contacts\n ? lang('SearchFriends')\n : lang('Search');\n\n return (\n
\n
\n \n \n {lang('SavedMessages')}\n \n \n {lang('ArchivedChats')}\n {archivedUnreadChatsCount > 0 && (\n
{archivedUnreadChatsCount}
\n )}\n \n \n {lang('Contacts')}\n \n \n {lang('Settings')}\n \n \n {lang('lng_menu_night_mode')}\n \n \n \n {lang('Appearance.Animations').toLowerCase()}\n 0}\n />\n \n \n {lang('TelegramFeatures')}\n \n \n Report Bug\n \n {withOtherVersions && (\n <>\n \n Switch to K Version\n \n \n Switch to Old Version\n \n \n )}\n \n \n {selectedSearchDate && (\n \n )}\n {globalSearchChatId && (\n \n )}\n \n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n query: searchQuery, fetchingStatus, chatId, date,\n } = global.globalSearch;\n const { currentUserId, connectionState, isSyncing } = global;\n const { byId: chatsById } = global.chats;\n const { isConnectionStatusMinimized, animationLevel } = global.settings.byKey;\n\n return {\n searchQuery,\n isLoading: fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false,\n currentUserId,\n chatsById,\n globalSearchChatId: chatId,\n searchDate: date,\n theme: selectTheme(global),\n animationLevel,\n connectionState,\n isSyncing,\n isMessageListOpen: Boolean(selectCurrentMessageList(global)),\n isConnectionStatusMinimized,\n areChatsLoaded: Boolean(global.chats.listIds.active),\n };\n },\n)(LeftMainHeader));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatFolder } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { ALL_FOLDER_ID } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { captureEvents, SwipeDirection } from '../../../util/captureEvents';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Transition from '../../ui/Transition';\nimport TabList from '../../ui/TabList';\nimport ChatList from './ChatList';\nimport { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager';\n\ntype OwnProps = {\n onScreenSelect: (screen: SettingsScreens) => void;\n foldersDispatch: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatFoldersById: Record;\n orderedFolderIds?: number[];\n activeChatFolder: number;\n currentUserId?: string;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst SAVED_MESSAGES_HOTKEY = '0';\n\nconst ChatFolders: FC = ({\n foldersDispatch,\n onScreenSelect,\n chatFoldersById,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n loadChatFolders,\n setActiveChatFolder,\n openChat,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime) {\n loadChatFolders();\n }\n }, [lastSyncTime, loadChatFolders]);\n\n const displayedFolders = useMemo(() => {\n return orderedFolderIds\n ? orderedFolderIds.map((id) => chatFoldersById[id] || {}).filter(Boolean)\n : undefined;\n }, [chatFoldersById, orderedFolderIds]);\n\n const folderCountersById = useFolderManagerForUnreadCounters();\n const folderTabs = useMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n return [\n {\n id: ALL_FOLDER_ID,\n title: lang.code === 'en' ? 'All' : lang('FilterAllChats'),\n },\n ...displayedFolders.map(({ id, title }) => ({\n id,\n title,\n badgeCount: folderCountersById[id]?.chatsCount,\n isBadgeActive: Boolean(folderCountersById[id]?.notificationsCount),\n })),\n ];\n }, [displayedFolders, folderCountersById, lang]);\n\n const handleSwitchTab = useCallback((index: number) => {\n setActiveChatFolder(index, { forceOnHeavyAnimation: true });\n }, [setActiveChatFolder]);\n\n // Prevent `activeTab` pointing at non-existing folder after update\n useEffect(() => {\n if (!folderTabs || !folderTabs.length) {\n return;\n }\n\n if (activeChatFolder >= folderTabs.length) {\n setActiveChatFolder(0);\n }\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV || !folderTabs || !folderTabs.length) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.chat-list',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveChatFolder(Math.min(activeChatFolder + 1, folderTabs.length - 1), { forceOnHeavyAnimation: true });\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveChatFolder(Math.max(0, activeChatFolder - 1), { forceOnHeavyAnimation: true });\n return true;\n }\n\n return false;\n }),\n });\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n const isNotInAllTabRef = useRef();\n isNotInAllTabRef.current = activeChatFolder !== 0;\n useEffect(() => (isNotInAllTabRef.current ? captureEscKeyListener(() => {\n if (isNotInAllTabRef.current) {\n setActiveChatFolder(0);\n }\n }) : undefined), [activeChatFolder, setActiveChatFolder]);\n\n useHistoryBack(activeChatFolder !== 0, () => setActiveChatFolder(0, { forceOnHeavyAnimation: true }));\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.ctrlKey && e.shiftKey && e.code.startsWith('Digit') && folderTabs) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n if (digit === SAVED_MESSAGES_HOTKEY) {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n return;\n }\n\n const folder = Number(digit) - 1;\n if (folder > folderTabs.length - 1) return;\n\n setActiveChatFolder(folder, { forceOnHeavyAnimation: true });\n e.preventDefault();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, true);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, true);\n };\n });\n\n const {\n shouldRender: shouldRenderPlaceholder, transitionClassNames,\n } = useShowTransition(!orderedFolderIds, undefined, true);\n\n function renderCurrentTab(isActive: boolean) {\n const activeFolder = Object.values(chatFoldersById)\n .find(({ id }) => id === folderTabs![activeChatFolder].id);\n\n if (!activeFolder || activeChatFolder === 0) {\n return (\n \n );\n }\n\n return (\n \n );\n }\n\n return (\n
\n {folderTabs?.length ? (\n \n ) : shouldRenderPlaceholder ? (\n
\n ) : undefined}\n \n {renderCurrentTab}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatFolders: {\n byId: chatFoldersById,\n orderedIds: orderedFolderIds,\n activeChatFolder,\n },\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n } = global;\n\n return {\n chatFoldersById,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n };\n },\n)(ChatFolders));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './LeftSearch';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst LeftSearchAsync: FC = (props) => {\n const LeftSearch = useModuleLoader(Bundles.Extra, 'LeftSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return LeftSearch ? : ;\n};\n\nexport default memo(LeftSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './ContactList';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst ContactListAsync: FC = (props) => {\n const ContactList = useModuleLoader(Bundles.Extra, 'ContactList');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContactList ? : ;\n};\n\nexport default memo(ContactListAsync);\n","import React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\n\nimport './NewChatButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n onNewPrivateChat: () => void;\n onNewChannel: () => void;\n onNewGroup: () => void;\n};\n\nconst NewChatButton: FC = ({\n isShown,\n onNewPrivateChat,\n onNewChannel,\n onNewGroup,\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (!isShown) {\n setIsMenuOpen(false);\n }\n }, [isShown]);\n\n const lang = useLang();\n\n const fabClassName = buildClassName(\n 'NewChatButton',\n isShown && 'revealed',\n isMenuOpen && 'menu-is-open',\n );\n\n const toggleIsMenuOpen = () => {\n setIsMenuOpen(!isMenuOpen);\n };\n\n const handleClose = () => {\n setIsMenuOpen(false);\n };\n\n return (\n
\n \n \n \n \n \n {lang('NewChannel')}\n {lang('NewGroup')}\n {lang('NewMessageTitle')}\n \n
\n );\n};\n\nexport default memo(NewChatButton);\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { LeftColumnContent, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport useFlag from '../../../hooks/useFlag';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport Transition from '../../ui/Transition';\nimport LeftMainHeader from './LeftMainHeader';\nimport ChatFolders from './ChatFolders';\nimport LeftSearch from '../search/LeftSearch.async';\nimport ContactList from './ContactList.async';\nimport NewChatButton from '../NewChatButton';\nimport Button from '../../ui/Button';\n\nimport './LeftMain.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n searchQuery?: string;\n searchDate?: number;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n foldersDispatch: FolderEditDispatch;\n onSearchQuery: (query: string) => void;\n onContentChange: (content: LeftColumnContent) => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst TRANSITION_RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\nconst BUTTON_CLOSE_DELAY_MS = 250;\nconst APP_OUTDATED_TIMEOUT = 3 * 24 * 60 * 60 * 1000; // 3 days\n\nlet closeTimeout: number | undefined;\n\nconst LeftMain: FC = ({\n content,\n searchQuery,\n searchDate,\n contactsFilter,\n shouldSkipTransition,\n foldersDispatch,\n onSearchQuery,\n onContentChange,\n onScreenSelect,\n onReset,\n}) => {\n const [isNewChatButtonShown, setIsNewChatButtonShown] = useState(IS_TOUCH_ENV);\n\n const isMouseInside = useRef(false);\n\n const handleSelectSettings = useCallback(() => {\n onContentChange(LeftColumnContent.Settings);\n }, [onContentChange]);\n\n const handleSelectContacts = useCallback(() => {\n onContentChange(LeftColumnContent.Contacts);\n }, [onContentChange]);\n\n const handleSelectNewChannel = useCallback(() => {\n onContentChange(LeftColumnContent.NewChannelStep1);\n }, [onContentChange]);\n\n const handleSelectNewGroup = useCallback(() => {\n onContentChange(LeftColumnContent.NewGroupStep1);\n }, [onContentChange]);\n\n const handleSelectArchived = useCallback(() => {\n onContentChange(LeftColumnContent.Archived);\n }, [onContentChange]);\n\n const handleMouseEnter = useCallback(() => {\n if (content !== LeftColumnContent.ChatList) {\n return;\n }\n isMouseInside.current = true;\n setIsNewChatButtonShown(true);\n }, [content]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n setIsNewChatButtonShown(false);\n }\n }, BUTTON_CLOSE_DELAY_MS);\n }, []);\n\n useEffect(() => {\n let autoCloseTimeout: number | undefined;\n if (content !== LeftColumnContent.ChatList) {\n autoCloseTimeout = window.setTimeout(() => {\n setIsNewChatButtonShown(false);\n }, BUTTON_CLOSE_DELAY_MS);\n } else if (isMouseInside.current || IS_TOUCH_ENV) {\n setIsNewChatButtonShown(true);\n }\n\n return () => {\n if (autoCloseTimeout) {\n clearTimeout(autoCloseTimeout);\n autoCloseTimeout = undefined;\n }\n };\n }, [content]);\n\n const [shouldRenderUpdateButton, updateButtonClassNames, handleUpdateClick] = useAppOutdatedCheck();\n\n const lang = useLang();\n\n return (\n \n \n \n {(isActive) => {\n switch (content) {\n case LeftColumnContent.ChatList:\n return ;\n case LeftColumnContent.GlobalSearch:\n return (\n \n );\n case LeftColumnContent.Contacts:\n return ;\n default:\n return undefined;\n }\n }}\n \n {shouldRenderUpdateButton && (\n \n {lang('lng_update_telegram')}\n \n )}\n \n
\n );\n};\n\nfunction useAppOutdatedCheck() {\n const [isAppOutdated, markIsAppOutdated] = useFlag(false);\n\n useEffect(() => {\n const timeout = window.setTimeout(markIsAppOutdated, APP_OUTDATED_TIMEOUT);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [markIsAppOutdated]);\n\n const { shouldRender, transitionClassNames } = useShowTransition(isAppOutdated);\n\n const handleUpdateClick = () => {\n window.location.reload();\n };\n\n return [shouldRender, transitionClassNames, handleUpdateClick] as const;\n}\n\nexport default memo(LeftMain);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Settings';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst SettingsAsync: FC = (props) => {\n const Settings = useModuleLoader(Bundles.Extra, 'Settings');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Settings ? : ;\n};\n\nexport default memo(SettingsAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './NewChat';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst NewChatAsync: FC = (props) => {\n const NewChat = useModuleLoader(Bundles.Extra, 'NewChat');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return NewChat ? : ;\n};\n\nexport default memo(NewChatAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ArchivedChats';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst ArchivedChatsAsync: FC = (props) => {\n const ArchivedChats = useModuleLoader(Bundles.Extra, 'ArchivedChats');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ArchivedChats ? : ;\n};\n\nexport default memo(ArchivedChatsAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { LeftColumnContent, SettingsScreens } from '../../types';\n\nimport { IS_MAC_OS, LAYERS_ANIMATION_NAME } from '../../util/environment';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport getKeyFromEvent from '../../util/getKeyFromEvent';\nimport useFoldersReducer from '../../hooks/reducers/useFoldersReducer';\nimport { useResize } from '../../hooks/useResize';\n\nimport Transition from '../ui/Transition';\nimport LeftMain from './main/LeftMain';\nimport Settings from './settings/Settings.async';\nimport NewChat from './newChat/NewChat.async';\nimport ArchivedChats from './ArchivedChats.async';\n\nimport './LeftColumn.scss';\n\ntype StateProps = {\n searchQuery?: string;\n searchDate?: number;\n activeChatFolder: number;\n shouldSkipHistoryAnimations?: boolean;\n leftColumnWidth?: number;\n};\n\nenum ContentType {\n Main,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Settings,\n Archived,\n // eslint-disable-next-line no-shadow\n NewGroup,\n // eslint-disable-next-line no-shadow\n NewChannel,\n}\n\nconst RENDER_COUNT = Object.keys(ContentType).length / 2;\nconst RESET_TRANSITION_DELAY_MS = 250;\n\nconst LeftColumn: FC = ({\n searchQuery,\n searchDate,\n activeChatFolder,\n shouldSkipHistoryAnimations,\n leftColumnWidth,\n}) => {\n const {\n setGlobalSearchQuery,\n setGlobalSearchChatId,\n resetChatCreation,\n setGlobalSearchDate,\n loadPasswordInfo,\n clearTwoFaError,\n setLeftColumnWidth,\n resetLeftColumnWidth,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const resizeRef = useRef(null);\n const [content, setContent] = useState(LeftColumnContent.ChatList);\n const [settingsScreen, setSettingsScreen] = useState(SettingsScreens.Main);\n const [contactsFilter, setContactsFilter] = useState('');\n const [foldersState, foldersDispatch] = useFoldersReducer();\n\n // Used to reset child components in background.\n const [lastResetTime, setLastResetTime] = useState(0);\n\n let contentType: ContentType = ContentType.Main;\n switch (content) {\n case LeftColumnContent.Archived:\n contentType = ContentType.Archived;\n break;\n case LeftColumnContent.Settings:\n contentType = ContentType.Settings;\n break;\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewChannelStep2:\n contentType = ContentType.NewChannel;\n break;\n case LeftColumnContent.NewGroupStep1:\n case LeftColumnContent.NewGroupStep2:\n contentType = ContentType.NewGroup;\n break;\n }\n\n const handleReset = useCallback((forceReturnToChatList?: boolean) => {\n if (content === LeftColumnContent.NewGroupStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewGroupStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewChannelStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewChannelStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewGroupStep1) {\n const pickerSearchInput = document.getElementById('new-group-picker-search');\n if (pickerSearchInput) {\n pickerSearchInput.blur();\n }\n }\n\n if (content === LeftColumnContent.Settings) {\n switch (settingsScreen) {\n case SettingsScreens.EditProfile:\n case SettingsScreens.Folders:\n case SettingsScreens.General:\n case SettingsScreens.Notifications:\n case SettingsScreens.DataStorage:\n case SettingsScreens.Privacy:\n case SettingsScreens.Language:\n setSettingsScreen(SettingsScreens.Main);\n return;\n\n case SettingsScreens.GeneralChatBackground:\n case SettingsScreens.QuickReaction:\n setSettingsScreen(SettingsScreens.General);\n return;\n case SettingsScreens.GeneralChatBackgroundColor:\n setSettingsScreen(SettingsScreens.GeneralChatBackground);\n return;\n\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyActiveSessions:\n case SettingsScreens.PrivacyBlockedUsers:\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaCongratulations:\n setSettingsScreen(SettingsScreens.Privacy);\n return;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyPhoneNumber);\n return;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyLastSeen);\n return;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyProfilePhoto);\n return;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyForwarding);\n return;\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyGroupChats);\n return;\n case SettingsScreens.TwoFaNewPassword:\n setSettingsScreen(SettingsScreens.TwoFaDisabled);\n return;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaNewPassword);\n return;\n case SettingsScreens.TwoFaNewPasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordConfirm);\n return;\n case SettingsScreens.TwoFaNewPasswordEmail:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordHint);\n return;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordEmail);\n return;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n setSettingsScreen(SettingsScreens.TwoFaEnabled);\n return;\n case SettingsScreens.TwoFaChangePasswordNew:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordCurrent);\n return;\n case SettingsScreens.TwoFaChangePasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordNew);\n return;\n case SettingsScreens.TwoFaChangePasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordConfirm);\n return;\n case SettingsScreens.TwoFaRecoveryEmail:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmailCurrentPassword);\n return;\n case SettingsScreens.TwoFaRecoveryEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmail);\n return;\n\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n setSettingsScreen(SettingsScreens.Folders);\n return;\n\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n setSettingsScreen(SettingsScreens.FoldersEditFolderFromChatList);\n return;\n\n case SettingsScreens.FoldersEditFolderFromChatList:\n setContent(LeftColumnContent.ChatList);\n setSettingsScreen(SettingsScreens.Main);\n return;\n default:\n break;\n }\n }\n\n if (content === LeftColumnContent.ChatList && activeChatFolder === 0) {\n setContent(LeftColumnContent.GlobalSearch);\n return;\n }\n\n setContent(LeftColumnContent.ChatList);\n setContactsFilter('');\n setGlobalSearchQuery({ query: '' });\n setGlobalSearchDate({ date: undefined });\n setGlobalSearchChatId({ id: undefined });\n resetChatCreation();\n setTimeout(() => {\n setLastResetTime(Date.now());\n }, RESET_TRANSITION_DELAY_MS);\n }, [\n content, activeChatFolder, settingsScreen, setGlobalSearchQuery, setGlobalSearchDate, setGlobalSearchChatId,\n resetChatCreation,\n ]);\n\n const handleSearchQuery = useCallback((query: string) => {\n if (content === LeftColumnContent.Contacts) {\n setContactsFilter(query);\n return;\n }\n\n setContent(LeftColumnContent.GlobalSearch);\n\n if (query !== searchQuery) {\n setGlobalSearchQuery({ query });\n }\n }, [content, searchQuery, setGlobalSearchQuery]);\n\n useEffect(\n () => (content !== LeftColumnContent.ChatList || activeChatFolder === 0\n ? captureEscKeyListener(() => handleReset())\n : undefined),\n [activeChatFolder, content, handleReset],\n );\n\n useEffect(() => {\n if (content === LeftColumnContent.GlobalSearch) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && e.shiftKey && getKeyFromEvent(e) === 'f') {\n e.preventDefault();\n setContent(LeftColumnContent.GlobalSearch);\n }\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n }, [content]);\n\n useEffect(() => {\n clearTwoFaError();\n\n if (settingsScreen === SettingsScreens.Privacy) {\n loadPasswordInfo();\n }\n }, [clearTwoFaError, loadPasswordInfo, settingsScreen]);\n\n const {\n initResize, resetResize, handleMouseUp,\n } = useResize(resizeRef, setLeftColumnWidth, resetLeftColumnWidth, leftColumnWidth);\n\n const handleSettingsScreenSelect = (screen: SettingsScreens) => {\n setContent(LeftColumnContent.Settings);\n setSettingsScreen(screen);\n };\n\n return (\n \n \n {(isActive) => {\n switch (contentType) {\n case ContentType.Archived:\n return (\n \n );\n case ContentType.Settings:\n return (\n \n );\n case ContentType.NewChannel:\n return (\n \n );\n case ContentType.NewGroup:\n return (\n \n );\n default:\n return (\n \n );\n }\n }}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n globalSearch: {\n query,\n date,\n },\n chatFolders: {\n activeChatFolder,\n },\n shouldSkipHistoryAnimations,\n leftColumnWidth,\n } = global;\n return {\n searchQuery: query, searchDate: date, activeChatFolder, shouldSkipHistoryAnimations, leftColumnWidth,\n };\n },\n)(LeftColumn));\n","import { RefObject } from 'react';\nimport { useState, useEffect } from '../lib/teact/teact';\nimport useFlag from './useFlag';\n\nexport const useResize = (\n elementRef: RefObject,\n onResize: (width: number) => void,\n onReset: NoneToVoidFunction,\n initialWidth?: number,\n) => {\n const [isActive, markIsActive, unmarkIsActive] = useFlag();\n const [initialMouseX, setInitialMouseX] = useState();\n const [initialElementWidth, setInitialElementWidth] = useState();\n\n useEffect(() => {\n if (!elementRef.current || !initialWidth) {\n return;\n }\n\n elementRef.current.style.width = `${initialWidth}px`;\n }, [elementRef, initialWidth]);\n\n function handleMouseUp() {\n document.body.classList.remove('no-selection', 'cursor-ew-resize');\n }\n\n function initResize(event: React.MouseEvent) {\n document.body.classList.add('no-selection', 'cursor-ew-resize');\n\n setInitialMouseX(event.clientX);\n setInitialElementWidth(elementRef.current!.offsetWidth);\n markIsActive();\n }\n\n function resetResize(event: React.MouseEvent) {\n event.preventDefault();\n elementRef.current!.style.width = '';\n onReset();\n }\n\n useEffect(() => {\n if (!isActive) return;\n\n const handleMouseMove = (event: MouseEvent) => {\n const newWidth = Math.ceil(initialElementWidth + event.clientX - initialMouseX);\n elementRef.current!.style.width = `${newWidth}px`;\n };\n\n function stopDrag() {\n cleanup();\n onResize(elementRef.current!.offsetWidth);\n }\n\n function cleanup() {\n handleMouseUp();\n document.removeEventListener('mousemove', handleMouseMove, false);\n document.removeEventListener('mouseup', stopDrag, false);\n document.removeEventListener('blur', stopDrag, false);\n unmarkIsActive();\n }\n\n document.addEventListener('mousemove', handleMouseMove, false);\n document.addEventListener('mouseup', stopDrag, false);\n document.addEventListener('blur', stopDrag, false);\n\n return cleanup;\n }, [initialElementWidth, initialMouseX, elementRef, onResize, isActive, unmarkIsActive]);\n\n return { initResize, resetResize, handleMouseUp };\n};\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { ThemeKey } from '../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../config';\nimport * as cacheApi from '../util/cacheApi';\nimport { preloadImage } from '../util/files';\n\nconst useCustomBackground = (theme: ThemeKey, settingValue?: string) => {\n const [value, setValue] = useState(settingValue);\n\n useEffect(() => {\n if (!settingValue) {\n return;\n }\n\n if (settingValue.startsWith('#')) {\n setValue(settingValue);\n } else {\n cacheApi.fetch(CUSTOM_BG_CACHE_NAME, theme, cacheApi.Type.Blob)\n .then((blob) => {\n const url = URL.createObjectURL(blob);\n preloadImage(url)\n .then(() => {\n setValue(`url(${url})`);\n });\n });\n }\n }, [settingValue, theme]);\n\n return settingValue ? value : undefined;\n};\n\nexport default useCustomBackground;\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\nimport windowSize from '../util/windowSize';\nimport { ApiDimensions } from '../api/types';\n\nconst THROTTLE = 250;\n\nconst useWindowSize = () => {\n const [size, setSize] = useState(windowSize.get());\n\n useEffect(() => {\n const handleResize = throttle(() => {\n setSize(windowSize.get());\n }, THROTTLE, false);\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return size;\n};\n\nexport default useWindowSize;\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './HeaderMenuContainer';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HeaderMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const HeaderMenuContainer = useModuleLoader(Bundles.Extra, 'HeaderMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HeaderMenuContainer ? : undefined;\n};\n\nexport default memo(HeaderMenuContainerAsync);\n","import React, {\n FC,\n memo,\n useRef,\n useCallback,\n useState,\n useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\nimport { IAnchorPosition, ManagementScreens } from '../../types';\n\nimport {\n ARE_CALLS_SUPPORTED, IS_MAC_OS, IS_PWA, IS_SINGLE_COLUMN_LAYOUT,\n} from '../../util/environment';\nimport getKeyFromEvent from '../../util/getKeyFromEvent';\nimport {\n isChatBasicGroup, isChatChannel, isChatSuperGroup, isUserId,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatBot,\n selectIsUserBlocked,\n selectIsChatBotNotStarted,\n selectIsChatWithSelf,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n} from '../../modules/selectors';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport HeaderMenuContainer from './HeaderMenuContainer.async';\n\ninterface OwnProps {\n chatId: string;\n threadId: number;\n messageListType: MessageListType;\n canExpandActions: boolean;\n}\n\ninterface StateProps {\n noMenu?: boolean;\n isChannel?: boolean;\n isRightColumnShown?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canCall?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n canEnterVoiceChat?: boolean;\n canCreateVoiceChat?: boolean;\n pendingJoinRequests?: number;\n}\n\n// Chrome breaks layout when focusing input during transition\nconst SEARCH_FOCUS_DELAY_MS = 400;\n\nconst HeaderActions: FC = ({\n chatId,\n threadId,\n noMenu,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canCall,\n canMute,\n canLeave,\n canEnterVoiceChat,\n canCreateVoiceChat,\n pendingJoinRequests,\n isRightColumnShown,\n canExpandActions,\n}) => {\n const {\n joinChannel,\n sendBotCommand,\n openLocalTextSearch,\n restartBot,\n openCallFallbackConfirm,\n requestNextManagementScreen,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const menuButtonRef = useRef(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const [menuPosition, setMenuPosition] = useState(undefined);\n\n const handleHeaderMenuOpen = useCallback(() => {\n setIsMenuOpen(true);\n const rect = menuButtonRef.current!.getBoundingClientRect();\n setMenuPosition({ x: rect.right, y: rect.bottom });\n }, []);\n\n const handleHeaderMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n }, []);\n\n const handleHeaderMenuHide = useCallback(() => {\n setMenuPosition(undefined);\n }, []);\n\n const handleSubscribeClick = useCallback(() => {\n joinChannel({ chatId });\n }, [joinChannel, chatId]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleJoinRequestsClick = useCallback(() => {\n requestNextManagementScreen({ screen: ManagementScreens.JoinRequests });\n }, [requestNextManagementScreen]);\n\n const handleSearchClick = useCallback(() => {\n openLocalTextSearch();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // iOS requires synchronous focus on user event.\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.focus();\n } else {\n setTimeout(() => {\n const searchInput = document.querySelector('.RightHeader .SearchInput input');\n if (searchInput) {\n searchInput.focus();\n }\n }, SEARCH_FOCUS_DELAY_MS);\n }\n }, [openLocalTextSearch]);\n\n useEffect(() => {\n if (!canSearch) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (\n IS_PWA && ((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && !e.shiftKey && getKeyFromEvent(e) === 'f'\n ) {\n e.preventDefault();\n handleSearchClick();\n }\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n }, [canSearch, handleSearchClick]);\n\n const lang = useLang();\n\n return (\n
\n {!IS_SINGLE_COLUMN_LAYOUT && (\n <>\n {canExpandActions && canSubscribe && (\n \n {lang(isChannel ? 'ProfileJoinChannel' : 'ProfileJoinGroup')}\n \n )}\n {canExpandActions && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {canExpandActions && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {canSearch && (\n \n \n \n )}\n {canCall && (\n \n \n \n )}\n \n )}\n {Boolean(pendingJoinRequests) && (\n \n \n
{pendingJoinRequests}
\n \n )}\n \n \n \n {menuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const isChannel = Boolean(chat && isChatChannel(chat));\n\n if (!chat || chat.isRestricted || selectIsInSelectMode(global)) {\n return {\n noMenu: true,\n };\n }\n\n const bot = selectChatBot(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isMainThread = messageListType === 'thread' && threadId === MAIN_THREAD_ID;\n const isDiscussionThread = messageListType === 'thread' && threadId !== MAIN_THREAD_ID;\n const isRightColumnShown = selectIsRightColumnShown(global);\n\n const canRestartBot = Boolean(bot && selectIsUserBlocked(global, bot.id));\n const canStartBot = !canRestartBot && Boolean(selectIsChatBotNotStarted(global, chatId));\n const canSubscribe = Boolean(\n isMainThread && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canSearch = isMainThread || isDiscussionThread;\n const canCall = ARE_CALLS_SUPPORTED && isUserId(chat.id) && !isChatWithSelf && !bot;\n const canMute = isMainThread && !isChatWithSelf && !canSubscribe;\n const canLeave = isMainThread && !canSubscribe;\n const canEnterVoiceChat = ARE_CALLS_SUPPORTED && chat.isCallActive;\n const canCreateVoiceChat = ARE_CALLS_SUPPORTED && !chat.isCallActive\n && (chat.adminRights?.manageCall || (chat.isCreator && isChatBasicGroup(chat)));\n const pendingJoinRequests = chat.fullInfo?.requestsPending;\n\n return {\n noMenu: false,\n isChannel,\n isRightColumnShown,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canCall,\n canMute,\n canLeave,\n canEnterVoiceChat,\n canCreateVoiceChat,\n pendingJoinRequests,\n };\n },\n)(HeaderActions));\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\n\nimport { ApiMessage } from '../api/types';\n\nimport { DEBUG } from '../config';\nimport { isWebpSupported } from '../util/environment';\nimport { EMPTY_IMAGE_DATA_URI, webpToPngBase64 } from '../util/webpToPng';\nimport { getMessageMediaThumbDataUri } from '../modules/helpers';\n\nexport default function useWebpThumbnail(message?: ApiMessage) {\n const thumbDataUri = message && getMessageMediaThumbDataUri(message);\n const sticker = message?.content?.sticker;\n const shouldDecodeThumbnail = thumbDataUri && sticker && !isWebpSupported() && thumbDataUri.includes('image/webp');\n const [thumbnailDecoded, setThumbnailDecoded] = useState(EMPTY_IMAGE_DATA_URI);\n const messageId = message?.id;\n\n useLayoutEffect(() => {\n if (!shouldDecodeThumbnail) {\n return;\n }\n\n webpToPngBase64(`b64-${messageId}`, thumbDataUri!)\n .then(setThumbnailDecoded)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n }, [messageId, shouldDecodeThumbnail, thumbDataUri]);\n\n return shouldDecodeThumbnail ? thumbnailDecoded : thumbDataUri;\n}\n","import React, {\n FC,\n useRef,\n useEffect,\n useMemo,\n memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n count: number;\n index: number;\n};\n\nconst BORDER_MASK_LEVEL = 4;\n\nconst PinnedMessageNavigation: FC = ({\n count, index,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const markupParams = useMemo(() => {\n return calculateMarkup(count, index);\n }, [count, index]);\n\n useEffect(() => {\n if (!containerRef.current) {\n return;\n }\n\n const {\n trackHeight,\n trackTranslateY,\n markHeight,\n markTranslateY,\n clipPathId,\n clipPath,\n } = markupParams;\n\n const firstChild = containerRef.current.firstElementChild;\n if (containerRef?.current) {\n const currentElement = containerRef.current;\n const { style } = currentElement;\n style.height = `${trackHeight}px`;\n style.transform = `translateY(-${trackTranslateY}px)`;\n style.clipPath = `url(\"#${clipPathId}\")`;\n const svg = currentElement.querySelector('svg');\n const div = currentElement.querySelector('div');\n const defs = currentElement.querySelector('defs');\n if (!svg) {\n if (firstChild) {\n firstChild.innerHTML = ` ${clipPath} `;\n }\n }\n if (defs) {\n defs.innerHTML = clipPath;\n }\n if (div) {\n div.style.height = `${markHeight}px`;\n div.style.transform = `translateY(${markTranslateY}px)`;\n }\n }\n }, [markupParams]);\n\n if (count === 1) {\n return (\n
\n \n
\n );\n }\n\n const {\n trackHeight, trackTranslateY, markHeight, markTranslateY, clipPathId,\n } = markupParams;\n\n return (\n
BORDER_MASK_LEVEL && 'pinned-message-border-mask')}>\n \n \n \n
\n
\n );\n};\n\nfunction calculateMarkup(count: number, index: number) {\n const reverseIndex = count - index - 1;\n const barHeight = getBarHeight(count);\n const markHeight = getMarkHeight(count, reverseIndex);\n const trackHeight = getTrackHeight(count, barHeight);\n\n const clipPathId = `clipPath${count}`;\n const clipPath = getClipPath(clipPathId, barHeight, count);\n\n const markTranslateY = getMarkTranslateY(reverseIndex, barHeight, count);\n const trackTranslateY = getTrackTranslateY(reverseIndex, count, barHeight, trackHeight);\n return {\n markHeight,\n clipPath,\n markTranslateY,\n trackTranslateY,\n trackHeight,\n clipPathId,\n };\n}\n\nfunction getBarHeight(count: number): number {\n let barHeight = 8;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getMarkHeight(count: number, index: number) {\n let barHeight = 36;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = index === 1 ? 12 : 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getTrackHeight(count: number, barHeight: number) {\n return count <= 3 ? 36 : barHeight * count + 2 * (count - 1);\n}\n\nfunction getClipPath(id: string, barHeight: number, count: number) {\n const radius = 1;\n\n let d = '';\n if (count === 3) {\n d = drawRect(0, 0, 2, barHeight, radius)\n + drawRect(0, 12, 2, barHeight + 1, radius)\n + drawRect(0, 25, 2, barHeight, radius);\n } else {\n for (let i = 0; i < count; i++) {\n d += drawRect(0, (barHeight + 2) * i, 2, barHeight, radius);\n }\n }\n\n return (\n `\n \n `\n );\n}\n\nfunction drawRect(x: number, y: number, width: number, height: number, radius: number) {\n return `M${x},${y + radius}a${radius},${radius},0,0,1,\n ${width},0v${height - 2 * radius}a${radius},${radius},0,0,1,${-width},0Z`;\n}\n\nfunction getMarkTranslateY(index: number, barHeight: number, count: number) {\n if (count === 1) {\n return 0;\n } else if (count === 2) {\n return index === 0 ? 0 : barHeight + 2;\n }\n\n if (count === 3) {\n if (index === 0) {\n return 0;\n } else if (index === 1) {\n return 12;\n }\n\n return 25;\n } else {\n return (barHeight + 2) * index;\n }\n}\n\nfunction getTrackTranslateY(index: number, count: number, barHeight: number, trackHeight: number) {\n if (count <= 4) {\n return 0;\n }\n\n if (index <= 1) {\n return 0;\n } else if (index >= count - 2) {\n return trackHeight - 36;\n }\n\n return (barHeight + 4) / 2 + (index - 2) * (barHeight + 2);\n}\n\nexport default memo(PinnedMessageNavigation);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { getPictogramDimensions } from '../common/helpers/mediaDimensions';\nimport { getMessageMediaHash } from '../../modules/helpers';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Button from '../ui/Button';\nimport RippleEffect from '../ui/RippleEffect';\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\nimport { renderMessageSummary } from '../common/helpers/renderMessageText';\n\nimport PinnedMessageNavigation from './PinnedMessageNavigation';\n\ntype OwnProps = {\n message: ApiMessage;\n index: number;\n count: number;\n customTitle?: string;\n className?: string;\n onUnpinMessage?: (id: number) => void;\n onClick?: () => void;\n onAllPinnedClick?: () => void;\n};\n\nconst HeaderPinnedMessage: FC = ({\n message, count, index, customTitle, className, onUnpinMessage, onClick, onAllPinnedClick,\n}) => {\n const lang = useLang();\n const mediaThumbnail = useWebpThumbnail(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n\n const text = renderMessageSummary(lang, message, Boolean(mediaThumbnail));\n const [isUnpinDialogOpen, openUnpinDialog, closeUnpinDialog] = useFlag();\n\n const handleUnpinMessage = useCallback(() => {\n closeUnpinDialog();\n\n if (onUnpinMessage) {\n onUnpinMessage(message.id);\n }\n }, [closeUnpinDialog, onUnpinMessage, message.id]);\n\n return (\n
\n {count > 1 && (\n \n \n \n )}\n {onUnpinMessage && (\n \n \n \n )}\n \n
\n \n {mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl)}\n
\n
\n {customTitle || `${lang('PinnedMessage')} ${index > 0 ? `#${count - index}` : ''}`}\n
\n

{text}

\n
\n\n \n
\n
\n );\n};\n\nfunction renderPictogram(thumbDataUri: string, blobUrl?: string) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \"\"\n );\n}\n\nexport default memo(HeaderPinnedMessage);\n","export function scaleImage(image: string | Blob, ratio: number, outputType: string = 'image/png'): Promise {\n const url = image instanceof Blob ? URL.createObjectURL(image) : image;\n const img = new Image();\n return new Promise((resolve) => {\n img.onload = () => {\n scale(img, img.width * ratio, img.height * ratio, outputType)\n .then((blob) => {\n if (!blob) throw new Error('Image resize failed!');\n return URL.createObjectURL(blob);\n })\n .then(resolve)\n .finally(() => {\n if (image instanceof Blob) {\n URL.revokeObjectURL(url); // Revoke blob url that we created\n }\n });\n };\n img.src = url;\n });\n}\n\nexport function resizeImage(\n image: string | Blob, width: number, height: number, outputType: string = 'image/png',\n): Promise {\n const url = image instanceof Blob ? URL.createObjectURL(image) : image;\n const img = new Image();\n return new Promise((resolve) => {\n img.onload = () => {\n scale(img, width, height, outputType)\n .then((blob) => {\n if (!blob) throw new Error('Image resize failed!');\n return URL.createObjectURL(blob);\n })\n .then(resolve)\n .finally(() => {\n if (image instanceof Blob) {\n URL.revokeObjectURL(url); // Revoke blob url that we created\n }\n });\n };\n img.src = url;\n });\n}\n\nasync function scale(\n img: HTMLImageElement, width: number, height: number, outputType: string = 'image/png',\n): Promise {\n // Safari does not have built-in resize method with quality control\n if ('createImageBitmap' in window) {\n try {\n const bitmap = await window.createImageBitmap(img,\n { resizeWidth: width, resizeHeight: height, resizeQuality: 'high' });\n if (bitmap.height !== height || bitmap.width !== width) {\n throw new Error('Image bitmap resize not supported!'); // FF93 added support for options, but not resize\n }\n return await new Promise((res) => {\n const canvas = document.createElement('canvas');\n canvas.width = bitmap.width;\n canvas.height = bitmap.height;\n const ctx = canvas.getContext('bitmaprenderer');\n if (ctx) {\n ctx.transferFromImageBitmap(bitmap);\n } else {\n canvas.getContext('2d')!.drawImage(bitmap, 0, 0);\n }\n canvas.toBlob(res, outputType);\n });\n } catch (e) {\n // Fallback. Firefox below 93 does not recognize `createImageBitmap` with 2 parameters\n return steppedScale(img, width, height, undefined, outputType);\n }\n } else {\n return steppedScale(img, width, height, undefined, outputType);\n }\n}\n\nfunction steppedScale(\n img: HTMLImageElement, width: number, height: number, step: number = 0.5, outputType: string = 'image/png',\n): Promise {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n const oc = document.createElement('canvas');\n const octx = oc.getContext('2d')!;\n\n canvas.width = width;\n canvas.height = height;\n\n if (img.width * step > width) { // For performance avoid unnecessary drawing\n const mul = 1 / step;\n let cur = {\n width: Math.floor(img.width * step),\n height: Math.floor(img.height * step),\n };\n\n oc.width = cur.width;\n oc.height = cur.height;\n\n octx.drawImage(img, 0, 0, cur.width, cur.height);\n\n while (cur.width * step > width) {\n cur = {\n width: Math.floor(cur.width * step),\n height: Math.floor(cur.height * step),\n };\n octx.drawImage(oc, 0, 0, cur.width * mul, cur.height * mul, 0, 0, cur.width, cur.height);\n }\n\n ctx.drawImage(oc, 0, 0, cur.width, cur.height, 0, 0, canvas.width, canvas.height);\n } else {\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n }\n\n return new Promise((resolve) => {\n canvas.toBlob(resolve, outputType);\n });\n}\n","import { useMemo } from '../lib/teact/teact';\n\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser, ApiVoice,\n} from '../api/types';\n\nimport useMedia from './useMedia';\nimport { useAsync } from './useAsync';\nimport {\n getAudioHasCover, getChatAvatarHash, getChatTitle, getMessageContent, getMessageMediaHash, getSenderTitle,\n} from '../modules/helpers';\nimport { getTranslation } from '../util/langProvider';\nimport { buildMediaMetadata } from '../util/mediaSession';\nimport { scaleImage, resizeImage } from '../util/imageResize';\nimport { AVATAR_FULL_DIMENSIONS } from '../components/common/helpers/mediaDimensions';\n\nimport telegramLogoPath from '../assets/telegram-logo-filled.svg';\n\nconst LOGO_DIMENSIONS = { width: 200, height: 200 };\nconst MINIMAL_SIZE = 115; // spec says 100, but on Chrome 93 it's not showing\n\n// TODO Add support for video in future\nconst useMessageMediaMetadata = (\n message: ApiMessage, sender?: ApiUser | ApiChat, chat?: ApiChat,\n): MediaMetadata | undefined => {\n const { audio, voice } = getMessageContent(message);\n const title = audio ? (audio.title || audio.fileName) : voice ? 'Voice message' : '';\n const artist = (audio && audio.performer) || (sender && getSenderTitle(getTranslation, sender));\n const album = (chat && getChatTitle(getTranslation, chat)) || 'Telegram';\n\n const audioCoverHash = (audio && getAudioHasCover(audio) && getMessageMediaHash(message, 'pictogram'));\n const avatarHash = sender && getChatAvatarHash(sender, 'big');\n const hash = (audio && audioCoverHash) || (voice && avatarHash);\n const media = useMedia(hash);\n\n const size = useMemo(() => {\n return getCoverSize(audio, voice, media);\n }, [audio, media, voice]);\n const { result: url } = useAsync(() => makeGoodArtwork(media, size), [media, size], telegramLogoPath);\n return useMemo(() => {\n return buildMediaMetadata({\n title,\n artist,\n album,\n artwork: [{ src: url }],\n });\n }, [album, artist, title, url]);\n};\n\nfunction makeGoodArtwork(url?: string, size?: { width: number; height: number }): Promise {\n if (!url) return Promise.resolve(telegramLogoPath);\n if (!size) return resizeImage(url, MINIMAL_SIZE, MINIMAL_SIZE);\n const min = Math.min(size.width, size.height);\n if (min < MINIMAL_SIZE) {\n const ratio = MINIMAL_SIZE / min;\n return scaleImage(url, ratio);\n }\n return Promise.resolve(url);\n}\n\nfunction getCoverSize(audio?: ApiAudio, voice?: ApiVoice, url?: string) {\n if (!url) return LOGO_DIMENSIONS;\n if (audio) {\n if (!audio.thumbnailSizes || audio.thumbnailSizes.length === 0) return undefined;\n const preferred = audio.thumbnailSizes.find((size) => size.type === 'm');\n return preferred || audio.thumbnailSizes[0]; // Sometimes `m` is not present\n }\n\n if (voice) {\n return AVATAR_FULL_DIMENSIONS;\n }\n\n return undefined;\n}\n\nexport default useMessageMediaMetadata;\n","import { useEffect, useState } from '../lib/teact/teact';\n\nexport const useAsync = (fn: () => Promise, deps: any[], defaultValue?: T) => {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState();\n const [result, setResult] = useState(defaultValue);\n useEffect(() => {\n setIsLoading(true);\n let wasCancelled = false;\n fn().then((res) => {\n if (wasCancelled) return;\n setIsLoading(false);\n setResult(res);\n }, (err) => {\n if (wasCancelled) return;\n setIsLoading(false);\n setError(err);\n });\n return () => {\n wasCancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n return { isLoading, error, result };\n};\n","import React, {\n FC, useCallback, useEffect, useMemo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { AudioOrigin } from '../../types';\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser,\n} from '../../api/types';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\n\nimport * as mediaLoader from '../../util/mediaLoader';\nimport {\n getMediaDuration, getMessageContent, getMessageMediaHash, getSenderTitle, isMessageLocal,\n} from '../../modules/helpers';\nimport { selectChat, selectSender } from '../../modules/selectors';\nimport buildClassName from '../../util/buildClassName';\nimport { makeTrackId } from '../../util/audioPlayer';\nimport { clearMediaSession } from '../../util/mediaSession';\nimport windowSize from '../../util/windowSize';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useLang from '../../hooks/useLang';\nimport useMessageMediaMetadata from '../../hooks/useMessageMediaMetadata';\nimport renderText from '../common/helpers/renderText';\n\nimport RippleEffect from '../ui/RippleEffect';\nimport Button from '../ui/Button';\nimport RangeSlider from '../ui/RangeSlider';\n\nimport './AudioPlayer.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n origin?: AudioOrigin;\n className?: string;\n noUi?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiChat | ApiUser;\n chat?: ApiChat;\n volume: number;\n playbackRate: number;\n isMuted: boolean;\n};\n\nconst FAST_PLAYBACK_RATE = 1.8;\n\nconst AudioPlayer: FC = ({\n message,\n className,\n noUi,\n sender,\n chat,\n volume,\n playbackRate,\n isMuted,\n}) => {\n const {\n setAudioPlayerVolume,\n setAudioPlayerPlaybackRate,\n setAudioPlayerMuted,\n focusMessage,\n closeAudioPlayer,\n } = getDispatch();\n\n const lang = useLang();\n const { audio, voice, video } = getMessageContent(message);\n const isVoice = Boolean(voice || video);\n const senderName = sender ? getSenderTitle(lang, sender) : undefined;\n const mediaData = mediaLoader.getFromMemory(getMessageMediaHash(message, 'inline')!) as (string | undefined);\n const mediaMetadata = useMessageMediaMetadata(message, sender, chat);\n\n const {\n playPause,\n stop,\n isPlaying,\n requestNextTrack,\n requestPreviousTrack,\n isFirst,\n isLast,\n setVolume,\n toggleMuted,\n setPlaybackRate,\n } = useAudioPlayer(\n makeTrackId(message),\n getMediaDuration(message)!,\n isVoice ? 'voice' : 'audio',\n mediaData,\n undefined,\n mediaMetadata,\n undefined,\n true,\n undefined,\n undefined,\n isMessageLocal(message),\n true,\n );\n\n // Prevent refresh by accidentally rotating device when listening to a voice message\n const isVoicePlaying = isVoice && isPlaying;\n useEffect(() => {\n if (!isVoicePlaying) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [isVoicePlaying]);\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }, [focusMessage, message.chatId, message.id]);\n\n const handleClose = useCallback(() => {\n if (isPlaying) {\n playPause();\n }\n closeAudioPlayer();\n clearMediaSession();\n stop();\n }, [closeAudioPlayer, isPlaying, playPause, stop]);\n\n const handleVolumeChange = useCallback((value: number) => {\n setAudioPlayerVolume({ volume: value / 100 });\n setAudioPlayerMuted({ isMuted: false });\n\n setVolume(value / 100);\n }, [setAudioPlayerMuted, setAudioPlayerVolume, setVolume]);\n\n const handleVolumeClick = useCallback(() => {\n if (IS_TOUCH_ENV && !IS_IOS) return;\n toggleMuted();\n setAudioPlayerMuted({ isMuted: !isMuted });\n }, [isMuted, setAudioPlayerMuted, toggleMuted]);\n\n const handlePlaybackClick = useCallback(() => {\n if (playbackRate === 1) {\n setPlaybackRate(FAST_PLAYBACK_RATE);\n setAudioPlayerPlaybackRate({ playbackRate: FAST_PLAYBACK_RATE });\n } else {\n setPlaybackRate(1);\n setAudioPlayerPlaybackRate({ playbackRate: 1 });\n }\n }, [playbackRate, setAudioPlayerPlaybackRate, setPlaybackRate]);\n\n const volumeIcon = useMemo(() => {\n if (volume === 0 || isMuted) return 'icon-muted';\n if (volume < 0.3) return 'icon-volume-1';\n if (volume < 0.6) return 'icon-volume-2';\n return 'icon-volume-3';\n }, [volume, isMuted]);\n\n if (noUi) {\n return undefined;\n }\n\n return (\n
\n \n \n \n \n \n \n \n \n \n \n\n
\n {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)}\n \n
\n\n \n \n {!IS_IOS && (\n <>\n
\n
\n \n
\n \n )}\n \n\n {isVoice && (\n \n \n \n )}\n\n \n \n \n
\n );\n};\n\nfunction renderAudio(audio: ApiAudio) {\n const { title, performer, fileName } = audio;\n\n return (\n <>\n
{renderText(title || fileName)}
\n {performer && (\n
{renderText(performer)}
\n )}\n \n );\n}\n\nfunction renderVoice(subtitle: string, senderName?: string) {\n return (\n <>\n
{senderName && renderText(senderName)}
\n
{subtitle}
\n \n );\n}\n\nexport default withGlobal(\n (global, { message }): StateProps => {\n const sender = selectSender(global, message);\n const chat = selectChat(global, message.chatId);\n const { volume, playbackRate, isMuted } = global.audioPlayer;\n\n return {\n sender,\n chat,\n volume,\n playbackRate,\n isMuted,\n };\n },\n)(AudioPlayer);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types';\n\nimport { selectChatGroupCall } from '../../../modules/selectors/calls';\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\n\nimport './GroupCallTopPane.scss';\n\ntype OwnProps = {\n chatId: string;\n hasPinnedOffset: boolean;\n};\n\ntype StateProps = {\n groupCall?: ApiGroupCall;\n isActive: boolean;\n usersById: Record;\n chatsById: Record;\n};\n\nconst GroupCallTopPane: FC = ({\n chatId,\n isActive,\n groupCall,\n hasPinnedOffset,\n usersById,\n chatsById,\n}) => {\n const {\n joinGroupCall,\n subscribeToGroupCallUpdates,\n } = getDispatch();\n\n const lang = useLang();\n\n const handleJoinGroupCall = useCallback(() => {\n joinGroupCall({\n chatId,\n });\n }, [joinGroupCall, chatId]);\n\n const participants = groupCall?.participants;\n\n const fetchedParticipants = useMemo(() => {\n if (participants) {\n return Object.values(participants).filter((_, i) => i < 3).map(({ id, isUser }) => {\n if (isUser) {\n if (!usersById[id]) {\n return undefined;\n }\n return { user: usersById[id] };\n } else {\n if (!chatsById[id]) {\n return undefined;\n }\n return { chat: chatsById[id] };\n }\n }).filter(Boolean);\n } else return [];\n }, [chatsById, participants, usersById]);\n\n useEffect(() => {\n if (!groupCall?.id) return undefined;\n if (!isActive && groupCall.isLoaded) return undefined;\n\n subscribeToGroupCallUpdates({\n id: groupCall.id,\n subscribed: true,\n });\n\n return () => {\n subscribeToGroupCallUpdates({\n id: groupCall.id,\n subscribed: false,\n });\n };\n }, [groupCall?.id, groupCall?.isLoaded, isActive, subscribeToGroupCallUpdates]);\n\n if (!groupCall) return undefined;\n\n return (\n \n
\n {lang('VoipGroupVoiceChat')}\n {lang('Participants', groupCall.participantsCount || 0, 'i')}\n
\n
\n {fetchedParticipants.map((p) => {\n if (!p) return undefined;\n if (p.user) {\n return ;\n } else {\n return ;\n }\n })}\n
\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }) => {\n const chat = selectChat(global, chatId)!;\n const groupCall = selectChatGroupCall(global, chatId);\n return {\n groupCall,\n usersById: global.users.byId,\n chatsById: global.chats.byId,\n activeGroupCallId: global.groupCalls.activeGroupCallId,\n isActive: ((!groupCall ? (chat && chat.isCallNotEmpty && chat.isCallActive)\n : (groupCall.participantsCount > 0 && groupCall.isLoaded)))\n && (global.groupCalls.activeGroupCallId !== groupCall?.id),\n };\n },\n)(GroupCallTopPane));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\nimport cycleRestrict from '../../util/cycleRestrict';\n\nimport { GlobalState, MessageListType } from '../../global/types';\nimport {\n ApiChat, ApiMessage, ApiTypingStatus, ApiUser, MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport {\n EDITABLE_INPUT_ID,\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n} from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n getChatTitle, getMessageKey, getSenderTitle, isUserId,\n} from '../../modules/helpers';\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectForwardedSender,\n selectIsChatWithBot,\n selectIsChatWithSelf,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectPinnedIds,\n selectScheduledIds,\n selectThreadInfo,\n selectThreadTopMessageId,\n} from '../../modules/selectors';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport useConnectionStatus from '../../hooks/useConnectionStatus';\n\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\nimport UnreadCounter from '../common/UnreadCounter';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport HeaderActions from './HeaderActions';\nimport HeaderPinnedMessage from './HeaderPinnedMessage';\nimport AudioPlayer from './AudioPlayer';\nimport GroupCallTopPane from '../calls/group/GroupCallTopPane';\n\nimport './MiddleHeader.scss';\n\nconst ANIMATION_DURATION = 350;\nconst BACK_BUTTON_INACTIVE_TIME = 450;\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n messageListType: MessageListType;\n isReady?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n pinnedMessageIds?: number[] | number;\n messagesById?: Record;\n canUnpin?: boolean;\n topMessageSender?: ApiChat | ApiUser;\n typingStatus?: ApiTypingStatus;\n isSelectModeActive?: boolean;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n audioMessage?: ApiMessage;\n messagesCount?: number;\n isChatWithSelf?: boolean;\n isChatWithBot?: boolean;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n connectionState?: GlobalState['connectionState'];\n isSyncing?: GlobalState['isSyncing'];\n};\n\nconst MiddleHeader: FC = ({\n chatId,\n threadId,\n messageListType,\n isReady,\n pinnedMessageIds,\n messagesById,\n canUnpin,\n topMessageSender,\n typingStatus,\n isSelectModeActive,\n isLeftColumnShown,\n isRightColumnShown,\n audioMessage,\n chat,\n messagesCount,\n isChatWithSelf,\n isChatWithBot,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n connectionState,\n isSyncing,\n}) => {\n const {\n openChatWithInfo,\n pinMessage,\n focusMessage,\n openChat,\n openPreviousChat,\n loadPinnedMessages,\n toggleLeftColumn,\n exitMessageSelectMode,\n } = getDispatch();\n\n const lang = useLang();\n const isBackButtonActive = useRef(true);\n\n const [pinnedMessageIndex, setPinnedMessageIndex] = useState(0);\n const pinnedMessageId = Array.isArray(pinnedMessageIds) ? pinnedMessageIds[pinnedMessageIndex] : pinnedMessageIds;\n const pinnedMessage = messagesById && pinnedMessageId ? messagesById[pinnedMessageId] : undefined;\n const pinnedMessagesCount = Array.isArray(pinnedMessageIds)\n ? pinnedMessageIds.length : (pinnedMessageIds ? 1 : undefined);\n const chatTitleLength = chat && getChatTitle(lang, chat).length;\n const topMessageTitle = topMessageSender ? getSenderTitle(lang, topMessageSender) : undefined;\n\n useEffect(() => {\n if (threadId === MAIN_THREAD_ID && lastSyncTime && isReady) {\n loadPinnedMessages({ chatId });\n }\n }, [chatId, loadPinnedMessages, lastSyncTime, threadId, isReady]);\n\n // Reset pinned index when switching chats and pinning/unpinning\n useEffect(() => {\n setPinnedMessageIndex(0);\n }, [pinnedMessageIds]);\n\n useEnsureMessage(chatId, pinnedMessageId, pinnedMessage);\n\n const { width: windowWidth } = useWindowSize();\n\n const isLeftColumnHideable = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN;\n const shouldShowCloseButton = IS_TABLET_COLUMN_LAYOUT && isLeftColumnShown;\n\n // eslint-disable-next-line no-null/no-null\n const componentRef = useRef(null);\n const shouldAnimateTools = useRef(true);\n\n const handleHeaderClick = useCallback(() => {\n openChatWithInfo({ id: chatId });\n }, [openChatWithInfo, chatId]);\n\n const handleUnpinMessage = useCallback((messageId: number) => {\n pinMessage({ chatId, messageId, isUnpin: true });\n }, [pinMessage, chatId]);\n\n const handlePinnedMessageClick = useCallback((): void => {\n if (pinnedMessage) {\n focusMessage({ chatId: pinnedMessage.chatId, threadId, messageId: pinnedMessage.id });\n\n const newIndex = cycleRestrict(pinnedMessagesCount || 1, pinnedMessageIndex + 1);\n setPinnedMessageIndex(newIndex);\n }\n }, [pinnedMessage, focusMessage, threadId, pinnedMessagesCount, pinnedMessageIndex]);\n\n const handleAllPinnedClick = useCallback(() => {\n openChat({ id: chatId, threadId: MAIN_THREAD_ID, type: 'pinned' });\n }, [openChat, chatId]);\n\n const setBackButtonActive = useCallback(() => {\n setTimeout(() => {\n isBackButtonActive.current = true;\n }, BACK_BUTTON_INACTIVE_TIME);\n }, []);\n\n const handleBackClick = useCallback((e: React.MouseEvent) => {\n if (!isBackButtonActive.current) return;\n\n // Workaround for missing UI when quickly clicking the Back button\n isBackButtonActive.current = false;\n if (IS_SINGLE_COLUMN_LAYOUT) {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID);\n if (messageInput) {\n messageInput.blur();\n }\n }\n\n if (isSelectModeActive) {\n exitMessageSelectMode();\n setBackButtonActive();\n return;\n }\n\n if (threadId === MAIN_THREAD_ID && messageListType === 'thread' && currentTransitionKey === 0) {\n if (IS_SINGLE_COLUMN_LAYOUT || shouldShowCloseButton) {\n e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets\n openChat({ id: undefined });\n } else {\n toggleLeftColumn();\n }\n\n setBackButtonActive();\n\n return;\n }\n\n openPreviousChat();\n setBackButtonActive();\n }, [\n threadId, messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton,\n openChat, toggleLeftColumn, exitMessageSelectMode, setBackButtonActive,\n ]);\n\n const canToolsCollideWithChatInfo = (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n ) || (\n windowWidth > MOBILE_SCREEN_MAX_WIDTH\n && windowWidth < MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && (!chatTitleLength || chatTitleLength > 30)\n );\n const shouldUseStackedToolsClass = canToolsCollideWithChatInfo || (\n windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n );\n\n const {\n shouldRender: shouldRenderAudioPlayer,\n transitionClassNames: audioPlayerClassNames,\n } = useShowTransition(Boolean(audioMessage));\n\n const renderingAudioMessage = useCurrentOrPrev(audioMessage, true);\n\n const {\n shouldRender: shouldRenderPinnedMessage,\n transitionClassNames: pinnedMessageClassNames,\n } = useShowTransition(Boolean(pinnedMessage));\n\n const renderingPinnedMessage = useCurrentOrPrev(pinnedMessage, true);\n const renderingPinnedMessagesCount = useCurrentOrPrev(pinnedMessagesCount, true);\n const renderingCanUnpin = useCurrentOrPrev(canUnpin, true);\n const renderingPinnedMessageTitle = useCurrentOrPrev(topMessageTitle);\n\n const canRevealTools = (shouldRenderPinnedMessage && renderingPinnedMessage)\n || (shouldRenderAudioPlayer && renderingAudioMessage);\n\n // Logic for transition to and from custom display of AudioPlayer/PinnedMessage on smaller screens\n useEffect(() => {\n const componentEl = componentRef.current;\n if (!componentEl) {\n return;\n }\n\n if (!shouldUseStackedToolsClass || !canRevealTools) {\n componentEl.classList.remove('tools-stacked', 'animated');\n shouldAnimateTools.current = true;\n return;\n }\n\n if (isRightColumnShown || canToolsCollideWithChatInfo) {\n if (shouldAnimateTools.current) {\n componentEl.classList.add('tools-stacked', 'animated');\n shouldAnimateTools.current = false;\n }\n\n // Remove animation class to prevent it messing up the show transitions\n setTimeout(() => {\n componentEl.classList.remove('animated');\n }, ANIMATION_DURATION);\n } else {\n componentEl.classList.remove('tools-stacked');\n shouldAnimateTools.current = true;\n }\n }, [shouldUseStackedToolsClass, canRevealTools, canToolsCollideWithChatInfo, isRightColumnShown]);\n\n const { connectionStatusText } = useConnectionStatus(lang, connectionState, isSyncing, true);\n\n function renderInfo() {\n return (\n messageListType === 'thread' && threadId === MAIN_THREAD_ID ? (\n renderMainThreadInfo()\n ) : messageListType === 'thread' ? (\n <>\n {renderBackButton()}\n

\n {lang('CommentsCount', messagesCount, 'i')}\n

\n \n ) : messageListType === 'pinned' ? (\n <>\n {renderBackButton()}\n

\n {lang('PinnedMessagesCount', messagesCount, 'i')}\n

\n \n ) : messageListType === 'scheduled' ? (\n <>\n {renderBackButton()}\n

\n {isChatWithSelf ? lang('Reminders') : lang('messages', messagesCount, 'i')}\n

\n \n ) : undefined\n );\n }\n\n function renderMainThreadInfo() {\n return (\n <>\n {(isLeftColumnHideable || currentTransitionKey > 0) && renderBackButton(shouldShowCloseButton, true)}\n
\n {isUserId(chatId) ? (\n \n ) : (\n \n )}\n
\n \n );\n }\n\n function renderBackButton(asClose = false, withUnreadCounter = false) {\n return (\n
\n \n
\n \n {withUnreadCounter && }\n
\n );\n }\n\n const isAudioPlayerRendered = Boolean(shouldRenderAudioPlayer && renderingAudioMessage);\n\n return (\n
\n \n {renderInfo()}\n \n\n \n\n {shouldRenderPinnedMessage && renderingPinnedMessage && (\n \n )}\n
\n {isAudioPlayerRendered && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const { isLeftColumnShown, lastSyncTime, shouldSkipHistoryAnimations } = global;\n const chat = selectChat(global, chatId);\n\n const { typingStatus } = chat || {};\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n let messagesCount: number | undefined;\n if (messageListType === 'pinned') {\n const pinnedIds = selectPinnedIds(global, chatId);\n messagesCount = pinnedIds?.length;\n } else if (messageListType === 'scheduled') {\n const scheduledIds = selectScheduledIds(global, chatId);\n messagesCount = scheduledIds?.length;\n } else if (messageListType === 'thread' && threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n messagesCount = threadInfo?.messagesCount || 0;\n }\n\n const state: StateProps = {\n typingStatus,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n audioMessage,\n chat,\n messagesCount,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isChatWithBot: chat && selectIsChatWithBot(global, chat),\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n connectionState: global.connectionState,\n isSyncing: global.isSyncing,\n };\n\n const messagesById = selectChatMessages(global, chatId);\n if (messageListType !== 'thread' || !messagesById) {\n return state;\n }\n\n Object.assign(state, { messagesById });\n\n if (threadId !== MAIN_THREAD_ID) {\n const pinnedMessageId = selectThreadTopMessageId(global, chatId, threadId);\n const message = pinnedMessageId ? selectChatMessage(global, chatId, pinnedMessageId) : undefined;\n const topMessageSender = message ? selectForwardedSender(global, message) : undefined;\n\n return {\n ...state,\n pinnedMessageIds: pinnedMessageId,\n canUnpin: false,\n topMessageSender,\n };\n }\n\n const pinnedMessageIds = selectPinnedIds(global, chatId);\n if (pinnedMessageIds?.length) {\n const firstPinnedMessage = messagesById[pinnedMessageIds[0]];\n const {\n canUnpin,\n } = (firstPinnedMessage && selectAllowedMessageActions(global, firstPinnedMessage, threadId)) || {};\n\n return {\n ...state,\n pinnedMessageIds,\n canUnpin,\n };\n }\n\n return state;\n },\n)(MiddleHeader));\n","import { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\n\nimport { getDayStart } from '../../../util/dateFormat';\nimport { isActionMessage } from '../../../modules/helpers';\n\ntype SenderGroup = (ApiMessage | IAlbum)[];\n\nconst GROUP_INTERVAL_SECONDS = 600; // 10 minutes\n\nexport type MessageDateGroup = {\n originalDate: number;\n datetime: number;\n senderGroups: SenderGroup[];\n};\n\nexport function isAlbum(messageOrAlbum: ApiMessage | IAlbum): messageOrAlbum is IAlbum {\n return 'albumId' in messageOrAlbum;\n}\n\nexport function groupMessages(messages: ApiMessage[], firstUnreadId?: number) {\n let currentSenderGroup: SenderGroup = [];\n let currentDateGroup = {\n originalDate: messages[0].date,\n datetime: Number(getDayStart(messages[0].date * 1000)),\n senderGroups: [currentSenderGroup],\n };\n let currentAlbum: IAlbum | undefined;\n\n const dateGroups: MessageDateGroup[] = [currentDateGroup];\n\n messages.forEach((message, index) => {\n if (message.isInAlbum) {\n if (!currentAlbum) {\n currentAlbum = {\n albumId: message.groupedId!,\n messages: [message],\n mainMessage: message,\n };\n } else {\n currentAlbum.messages.push(message);\n if (message.content.text) {\n currentAlbum.mainMessage = message;\n }\n }\n } else {\n currentSenderGroup.push(message);\n }\n\n const nextMessage = messages[index + 1];\n\n if (\n currentAlbum\n && (!nextMessage || !nextMessage.groupedId || nextMessage.groupedId !== currentAlbum.albumId)\n ) {\n currentSenderGroup.push(currentAlbum);\n currentAlbum = undefined;\n }\n if (nextMessage) {\n const nextMessageDayStartsAt = Number(getDayStart(nextMessage.date * 1000));\n if (currentDateGroup.datetime !== nextMessageDayStartsAt) {\n currentDateGroup = {\n originalDate: nextMessage.date,\n datetime: nextMessageDayStartsAt,\n senderGroups: [],\n };\n dateGroups.push(currentDateGroup);\n\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n } else if (\n nextMessage.id === firstUnreadId\n || message.senderId !== nextMessage.senderId\n || message.isOutgoing !== nextMessage.isOutgoing\n || isActionMessage(message)\n || isActionMessage(nextMessage)\n || (\n message.forwardInfo && nextMessage.forwardInfo\n && (\n message.forwardInfo.senderUserId !== nextMessage.forwardInfo.senderUserId\n || message.forwardInfo.fromChatId !== nextMessage.forwardInfo.fromChatId\n || message.forwardInfo.hiddenUserName !== nextMessage.forwardInfo.hiddenUserName\n )\n )\n || message.inlineButtons\n || nextMessage.inlineButtons\n || (nextMessage.date - message.date) > GROUP_INTERVAL_SECONDS\n ) {\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n }\n }\n });\n\n return dateGroups;\n}\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { MessageListType } from '../../../global/types';\n\nimport { IS_ANDROID, IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useBackgroundMode from '../../../hooks/useBackgroundMode';\n\nconst INTERSECTION_THROTTLE_FOR_MEDIA = IS_ANDROID ? 1000 : 350;\nconst INTERSECTION_MARGIN_FOR_MEDIA = IS_SINGLE_COLUMN_LAYOUT ? 300 : 500;\nconst INTERSECTION_THROTTLE_FOR_READING = 150;\n\nexport default function useMessageObservers(\n type: MessageListType,\n containerRef: RefObject,\n memoFirstUnreadIdRef: { current: number | undefined },\n) {\n const { markMessageListRead, markMessagesRead } = getDispatch();\n\n const {\n observe: observeIntersectionForMedia,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n margin: INTERSECTION_MARGIN_FOR_MEDIA,\n });\n\n const {\n observe: observeIntersectionForReading, freeze: freezeForReading, unfreeze: unfreezeForReading,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_READING,\n }, (entries) => {\n if (type !== 'thread') {\n return;\n }\n\n let maxId = 0;\n const mentionIds: number[] = [];\n\n entries.forEach((entry) => {\n const { isIntersecting, target } = entry;\n\n if (!isIntersecting) {\n return;\n }\n\n const { dataset } = target as HTMLDivElement;\n\n const messageId = Number(dataset.lastMessageId || dataset.messageId);\n if (messageId > maxId) {\n maxId = messageId;\n }\n\n if (dataset.hasUnreadMention) {\n mentionIds.push(messageId);\n }\n });\n\n if (memoFirstUnreadIdRef.current && maxId >= memoFirstUnreadIdRef.current) {\n markMessageListRead({ maxId });\n }\n\n if (mentionIds.length) {\n markMessagesRead({ messageIds: mentionIds });\n }\n });\n\n useBackgroundMode(freezeForReading, unfreezeForReading);\n\n const { observe: observeIntersectionForAnimatedStickers } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n });\n\n return {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n };\n}\n","import { ApiMessage } from '../../../../api/types';\n\nimport { getMessageContent } from '../../../../modules/helpers';\n\nexport function isEmojiOnlyMessage(customShape?: boolean | number) {\n return typeof customShape === 'number';\n}\n\nexport function buildContentClassName(\n message: ApiMessage,\n {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments,\n hasActionButton,\n hasReactions,\n }: {\n hasReply?: boolean;\n customShape?: boolean | number;\n isLastInGroup?: boolean;\n asForwarded?: boolean;\n hasThread?: boolean;\n forceSenderName?: boolean;\n hasComments?: boolean;\n hasActionButton?: boolean;\n hasReactions?: boolean;\n } = {},\n) {\n const {\n text, photo, video, audio, voice, document, poll, webPage, contact,\n } = getMessageContent(message);\n\n const classNames = ['message-content'];\n const isMedia = photo || video;\n const isMediaWithNoText = isMedia && !text;\n const isViaBot = Boolean(message.viaBotId);\n\n if (isEmojiOnlyMessage(customShape)) {\n classNames.push(`emoji-only emoji-only-${customShape}`);\n } else if (text) {\n classNames.push('text');\n }\n\n if (hasActionButton) {\n classNames.push('has-action-button');\n }\n\n if (customShape) {\n classNames.push('custom-shape');\n if (video?.isRound) {\n classNames.push('round');\n }\n\n if (hasComments) {\n classNames.push('has-comments');\n }\n }\n if (photo || video) {\n classNames.push('media');\n } else if (audio) {\n classNames.push('audio');\n } else if (voice) {\n classNames.push('voice');\n } else if (document) {\n classNames.push('document');\n } else if (contact) {\n classNames.push('contact');\n } else if (poll) {\n classNames.push('poll');\n } else if (webPage) {\n classNames.push('web-page');\n\n if (webPage.photo || webPage.video) {\n classNames.push('media');\n }\n }\n\n if (asForwarded) {\n classNames.push('is-forwarded');\n }\n\n if (hasReply) {\n classNames.push('is-reply');\n }\n\n if (hasThread) {\n classNames.push('has-replies');\n }\n\n if (hasReactions) {\n classNames.push('has-reactions');\n }\n\n if (isViaBot) {\n classNames.push('is-via-bot');\n }\n\n if (forceSenderName) {\n classNames.push('force-sender-name');\n }\n\n if (!customShape) {\n classNames.push('has-shadow');\n\n if (isMedia && hasComments) {\n classNames.push('has-background');\n }\n\n if (hasReply || asForwarded || !isMediaWithNoText || isViaBot || forceSenderName) {\n classNames.push('has-solid-background');\n }\n\n if (isLastInGroup && (photo || !isMediaWithNoText)) {\n classNames.push('has-appendix');\n }\n }\n\n return classNames.join(' ');\n}\n","import { ApiMessage } from '../../../../api/types';\nimport { calculateInlineImageDimensions, calculateVideoDimensions } from '../../../common/helpers/mediaDimensions';\nimport {\n getMessageText,\n getMessagePhoto,\n getMessageWebPagePhoto,\n isForwardedMessage,\n isOwnMessage,\n getMessageVideo,\n} from '../../../../modules/helpers';\n\nconst MIN_MEDIA_WIDTH = 100;\nconst MIN_MEDIA_WIDTH_WITH_COMMENTS = 238;\nconst MIN_MEDIA_WIDTH_WITH_TEXT = 175;\nconst MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS = 238;\nconst MIN_MEDIA_HEIGHT = 90;\nconst SMALL_IMAGE_THRESHOLD = 12;\n\nexport function getMinMediaWidth(hasText?: boolean, hasCommentButton?: boolean) {\n return hasText\n ? (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS : MIN_MEDIA_WIDTH_WITH_TEXT)\n : (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_COMMENTS : MIN_MEDIA_WIDTH);\n}\n\nexport function calculateMediaDimensions(message: ApiMessage, noAvatars?: boolean) {\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const photo = getMessagePhoto(message) || getMessageWebPagePhoto(message);\n const video = getMessageVideo(message);\n\n const isWebPagePhoto = Boolean(getMessageWebPagePhoto(message));\n const { width, height } = photo\n ? calculateInlineImageDimensions(photo, isOwn, isForwarded, isWebPagePhoto, noAvatars)\n : calculateVideoDimensions(video!, isOwn, isForwarded, noAvatars);\n\n const hasText = Boolean(getMessageText(message));\n const minMediaWidth = getMinMediaWidth(hasText);\n\n let stretchFactor = 1;\n if (width < minMediaWidth && minMediaWidth - width < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = minMediaWidth / width;\n }\n if (height * stretchFactor < MIN_MEDIA_HEIGHT && MIN_MEDIA_HEIGHT - height * stretchFactor < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = MIN_MEDIA_HEIGHT / height;\n }\n\n const finalWidth = Math.round(width * stretchFactor);\n const finalHeight = Math.round(height * stretchFactor);\n\n return {\n width: finalWidth,\n height: finalHeight,\n isSmall: finalWidth < minMediaWidth || finalHeight < MIN_MEDIA_HEIGHT,\n };\n}\n","/* eslint-disable no-bitwise */\n// Based on\n// https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/grouped_layout.cpp\n// https://github.com/overtake/TelegramSwift/blob/master/Telegram-Mac/GroupedLayout.swift#L83\n\nimport { IAlbum } from '../../../../types';\nimport { ApiMessage, ApiDimensions } from '../../../../api/types';\n\nimport { getAvailableWidth, REM } from '../../../common/helpers/mediaDimensions';\nimport { calculateMediaDimensions } from './mediaDimensions';\n\nexport const AlbumRectPart = {\n None: 0,\n Top: 1,\n Right: 2,\n Bottom: 4,\n Left: 8,\n};\n\ntype IAttempt = {\n lineCounts: number[];\n heights: number[];\n};\nexport type IMediaDimensions = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\ntype IMediaLayout = {\n dimensions: IMediaDimensions;\n sides: number;\n};\ntype ILayoutParams = {\n ratios: number[];\n proportions: string;\n averageRatio: number;\n maxWidth: number;\n minWidth: number;\n maxHeight: number;\n spacing: number;\n};\nexport type IAlbumLayout = {\n layout: IMediaLayout[];\n containerStyle: ApiDimensions;\n};\n\nfunction getRatios(messages: ApiMessage[]) {\n return messages.map(\n (message) => {\n const dimensions = calculateMediaDimensions(message) as ApiDimensions;\n\n return dimensions.width / dimensions.height;\n },\n );\n}\n\nfunction getProportions(ratios: number[]) {\n return ratios.map((ratio) => (ratio > 1.2 ? 'w' : (ratio < 0.8 ? 'n' : 'q'))).join('');\n}\n\nfunction getAverageRatio(ratios: number[]) {\n return ratios.reduce((result, ratio) => ratio + result, 1) / ratios.length;\n}\n\nfunction accumulate(list: number[], initValue: number) {\n return list.reduce((accumulator, item) => accumulator + item, initValue);\n}\n\nfunction clamp(num: number, low: number, high: number) {\n return num < low ? low : (num > high ? high : num);\n}\n\nfunction cropRatios(ratios: number[], averageRatio: number) {\n return ratios.map((ratio) => (averageRatio > 1.1 ? clamp(ratio, 1, 2.75) : clamp(ratio, 0.6667, 1)));\n}\n\nfunction calculateContainerSize(layout: IMediaLayout[]) {\n const styles: ApiDimensions = { width: 0, height: 0 };\n layout.forEach(({\n dimensions,\n sides,\n }) => {\n if (sides & AlbumRectPart.Right) {\n styles.width = dimensions.width + dimensions.x;\n }\n if (sides & AlbumRectPart.Bottom) {\n styles.height = dimensions.height + dimensions.y;\n }\n });\n\n return styles;\n}\n\nexport function calculateAlbumLayout(\n isOwn: boolean,\n isForwarded: boolean,\n noAvatars: boolean,\n album: IAlbum,\n): IAlbumLayout {\n const spacing = 2;\n const ratios = getRatios(album.messages);\n const proportions = getProportions(ratios);\n const averageRatio = getAverageRatio(ratios);\n const albumCount = ratios.length;\n const forceCalc = ratios.some((ratio) => ratio > 2);\n const maxWidth = getAvailableWidth(isOwn, isForwarded, false, noAvatars) - (isForwarded ? 2.5 : 0) * REM;\n const maxHeight = maxWidth;\n\n let layout;\n\n const params = {\n ratios,\n proportions,\n averageRatio,\n maxWidth,\n minWidth: 100,\n maxHeight,\n spacing,\n };\n\n if (albumCount >= 5 || forceCalc) {\n layout = layoutWithComplexLayouter(params);\n } else if (albumCount === 2) {\n layout = layoutTwo(params);\n } else if (albumCount === 3) {\n layout = layoutThree(params);\n } else {\n layout = layoutFour(params);\n }\n\n return {\n layout,\n containerStyle: calculateContainerSize(layout),\n };\n}\n\nfunction layoutWithComplexLayouter({\n ratios: originalRatios,\n averageRatio,\n maxWidth,\n minWidth,\n spacing,\n maxHeight = (4 * maxWidth) / 3,\n}: ILayoutParams) {\n const ratios = cropRatios(originalRatios, averageRatio);\n const count = originalRatios.length;\n const result = new Array(count);\n const attempts: IAttempt[] = [];\n\n const multiHeight = (offset: number, attemptCount: number) => {\n const attemptRatios = ratios.slice(offset, offset + attemptCount);\n const sum = accumulate(attemptRatios, 0);\n\n return (maxWidth - (attemptCount - 1) * spacing) / sum;\n };\n\n const pushAttempt = (lineCounts: number[]) => {\n const heights: number[] = [];\n let offset = 0;\n lineCounts.forEach((currentCount) => {\n heights.push(multiHeight(offset, currentCount));\n offset += currentCount;\n });\n\n attempts.push({\n lineCounts,\n heights,\n });\n };\n\n for (let first = 1; first !== count; ++first) {\n const second = count - first;\n if (first <= 3 && second <= 3) {\n pushAttempt([first, second]);\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n const third = count - first - second;\n if (first <= 3 && second <= (averageRatio < 0.85 ? 4 : 3) && third <= 3) {\n pushAttempt([first, second, third]);\n }\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n for (let third = 1; third !== count - first - second; ++third) {\n const fourth = count - first - second - third;\n if (first <= 3 && second <= 3 && third <= 3 && fourth <= 4) {\n pushAttempt([first, second, third, fourth]);\n }\n }\n }\n }\n\n let optimalAttempt: IAttempt | undefined;\n let optimalDiff = 0;\n for (let i = 0; i < attempts.length; i++) {\n const {\n heights,\n lineCounts,\n } = attempts[i];\n const lineCount = lineCounts.length;\n const totalHeight = accumulate(heights, 0) + spacing * (lineCount - 1);\n const minLineHeight = Math.min(...heights);\n const bad1 = minLineHeight < minWidth ? 1.5 : 1;\n const bad2 = (() => {\n for (let line = 1; line !== lineCount; ++line) {\n if (lineCounts[line - 1] > lineCounts[line]) {\n return 1.5;\n }\n }\n\n return 1;\n })();\n const diff = Math.abs(totalHeight - maxHeight) * bad1 * bad2;\n\n if (!optimalAttempt || diff < optimalDiff) {\n optimalAttempt = attempts[i];\n optimalDiff = diff;\n }\n }\n\n const optimalCounts = optimalAttempt!.lineCounts;\n const optimalHeights = optimalAttempt!.heights;\n const rowCount = optimalCounts.length;\n let index = 0;\n let y = 0;\n for (let row = 0; row !== rowCount; ++row) {\n const colCount = optimalCounts[row];\n const lineHeight = optimalHeights[row];\n const height = Math.round(lineHeight);\n let x = 0;\n\n for (let col = 0; col !== colCount; ++col) {\n const sides = AlbumRectPart.None\n | (row === 0 ? AlbumRectPart.Top : AlbumRectPart.None)\n | (row === rowCount - 1 ? AlbumRectPart.Bottom : AlbumRectPart.None)\n | (col === 0 ? AlbumRectPart.Left : AlbumRectPart.None)\n | (col === colCount - 1 ? AlbumRectPart.Right : AlbumRectPart.None);\n const ratio = ratios[index];\n const width = col === colCount - 1 ? maxWidth - x : Math.round(ratio * lineHeight);\n result[index] = {\n dimensions: {\n x,\n y,\n width,\n height,\n },\n sides,\n };\n x += width + spacing;\n ++index;\n }\n y += height + spacing;\n }\n\n return result;\n}\n\nfunction layoutTwo(params: ILayoutParams) {\n const {\n ratios,\n proportions,\n averageRatio,\n } = params;\n return proportions === 'ww' && averageRatio > 1.4 && ratios[1] - ratios[0] < 0.2\n ? layoutTwoTopBottom(params)\n : proportions === 'ww' || proportions === 'qq'\n ? layoutTwoLeftRightEqual(params)\n : layoutTwoLeftRight(params);\n}\n\nfunction layoutTwoTopBottom(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const height = Math.round(Math.min(maxWidth / ratios[0], Math.min(maxWidth / ratios[1], (maxHeight - spacing) / 2)));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: height + spacing,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutTwoLeftRightEqual(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const width = (maxWidth - spacing) / 2;\n const height = Math.round(Math.min(width / ratios[0], Math.min(width / ratios[1], maxHeight)));\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: width + spacing,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutTwoLeftRight(params: ILayoutParams) {\n const {\n ratios,\n minWidth,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const minimalWidth = Math.round(1.5 * minWidth);\n const secondWidth = Math.min(\n Math.round(\n Math.max(\n 0.4 * (maxWidth - spacing),\n (maxWidth - spacing) / ratios[0] / (1 / ratios[0] + 1 / ratios[1]),\n ),\n ),\n maxWidth - spacing - minimalWidth,\n );\n const firstWidth = maxWidth - secondWidth - spacing;\n const height = Math.min(maxHeight, Math.round(Math.min(firstWidth / ratios[0], secondWidth / ratios[1])));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: firstWidth + spacing,\n y: 0,\n width: secondWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutThree(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'n'\n ? layoutThreeLeftAndOther(params)\n : layoutThreeTopAndOther(params);\n}\n\nfunction layoutThreeLeftAndOther(params: ILayoutParams) {\n const {\n maxHeight,\n spacing,\n ratios,\n maxWidth,\n minWidth,\n } = params;\n const firstHeight = maxHeight;\n const thirdHeight = Math.round(\n Math.min(\n (maxHeight - spacing) / 2,\n (ratios[1] * (maxWidth - spacing)) / (ratios[2] + ratios[1]),\n ),\n );\n const secondHeight = firstHeight - thirdHeight - spacing;\n const rightWidth = Math.max(\n minWidth,\n Math.round(\n Math.min(\n (maxWidth - spacing) / 2,\n Math.min(\n thirdHeight * ratios[2],\n secondHeight * ratios[1],\n ),\n ),\n ),\n );\n const leftWidth = Math.min(Math.round(firstHeight * ratios[0]), maxWidth - spacing - rightWidth);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: leftWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: 0,\n width: rightWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: secondHeight + spacing,\n width: rightWidth,\n height: thirdHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutThreeTopAndOther(params: ILayoutParams) {\n const {\n maxWidth,\n ratios,\n maxHeight,\n spacing,\n } = params;\n const firstWidth = maxWidth;\n const firstHeight = Math.round(Math.min(firstWidth / ratios[0], 0.66 * (maxHeight - spacing)));\n const secondWidth = (maxWidth - spacing) / 2;\n const secondHeight = Math.min(\n maxHeight - firstHeight - spacing,\n Math.round(Math.min(\n secondWidth / ratios[1],\n secondWidth / ratios[2],\n )),\n );\n const thirdWidth = firstWidth - secondWidth - spacing;\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: firstHeight + spacing,\n width: secondWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: secondWidth + spacing,\n y: firstHeight + spacing,\n width: thirdWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutFour(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'w'\n ? layoutFourTopAndOther(params)\n : layoutFourLeftAndOther(params);\n}\n\nfunction layoutFourTopAndOther({\n maxWidth,\n ratios,\n spacing,\n maxHeight,\n minWidth,\n}: ILayoutParams) {\n const w = maxWidth;\n const h0 = Math.round(Math.min(w / ratios[0], 0.66 * (maxHeight - spacing)));\n const h = Math.round((maxWidth - 2 * spacing) / (ratios[1] + ratios[2] + ratios[3]));\n const w0 = Math.max(minWidth, Math.round(Math.min(0.4 * (maxWidth - 2 * spacing), h * ratios[1])));\n const w2 = Math.round(Math.max(Math.max(minWidth, 0.33 * (maxWidth - 2 * spacing)), h * ratios[3]));\n const w1 = w - w0 - w2 - 2 * spacing;\n const h1 = Math.min(maxHeight - h0 - spacing, h);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w,\n height: h0,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: h0 + spacing,\n width: w0,\n height: h1,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing + w1 + spacing,\n y: h0 + spacing,\n width: w2,\n height: h1,\n },\n sides: AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutFourLeftAndOther({\n maxHeight,\n ratios,\n maxWidth,\n spacing,\n minWidth,\n}: ILayoutParams) {\n const h = maxHeight;\n const w0 = Math.round(Math.min(h * ratios[0], 0.6 * (maxWidth - spacing)));\n const w = Math.round((maxHeight - 2 * spacing) / (1 / ratios[1] + 1 / ratios[2] + 1 / ratios[3]));\n const h0 = Math.round(w / ratios[1]);\n const h1 = Math.round(w / ratios[2]);\n const h2 = h - h0 - h1 - 2 * spacing;\n const w1 = Math.max(minWidth, Math.min(maxWidth - w0 - spacing, w));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w0,\n height: h,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: 0,\n width: w1,\n height: h0,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + h1 + 2 * spacing,\n width: w1,\n height: h2,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet element: HTMLSpanElement | undefined;\n\nexport default function calculateAuthorWidth(text: string) {\n if (!element) {\n element = document.createElement('span');\n // eslint-disable-next-line max-len\n element.style.font = IS_IOS\n // eslint-disable-next-line max-len\n ? '400 12px system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif'\n : '400 12px \"Roboto\", -apple-system, \"Apple Color Emoji\", BlinkMacSystemFont, \"Helvetica Neue\", sans-serif';\n element.style.whiteSpace = 'nowrap';\n element.style.position = 'absolute';\n element.style.left = '-999px';\n element.style.opacity = '.01';\n document.body.appendChild(element);\n }\n\n element.innerHTML = text;\n\n return element.offsetWidth;\n}\n","import { FocusDirection } from '../../../../types';\n\nimport { useLayoutEffect } from '../../../../lib/teact/teact';\nimport fastSmoothScroll from '../../../../util/fastSmoothScroll';\n\n// This is used when the viewport was replaced.\nconst RELOCATED_FOCUS_OFFSET = 1000;\nconst FOCUS_MARGIN = 20;\n\nexport default function useFocusMessage(\n elementRef: { current: HTMLDivElement | null },\n chatId: string,\n isFocused?: boolean,\n focusDirection?: FocusDirection,\n noFocusHighlight?: boolean,\n isResizingContainer?: boolean,\n) {\n useLayoutEffect(() => {\n if (isFocused && elementRef.current) {\n const messagesContainer = elementRef.current.closest('.MessageList')!;\n\n fastSmoothScroll(\n messagesContainer,\n elementRef.current,\n // `noFocusHighlight` always called from “scroll-to-bottom” buttons\n noFocusHighlight ? 'end' : 'centerOrTop',\n FOCUS_MARGIN,\n focusDirection !== undefined ? RELOCATED_FOCUS_OFFSET : undefined,\n focusDirection,\n undefined,\n isResizingContainer,\n );\n }\n }, [elementRef, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer]);\n}\n","import { RefObject } from 'react';\nimport React, { useEffect, useRef } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../../util/environment';\nimport windowSize from '../../../../util/windowSize';\nimport { captureEvents, SwipeDirection } from '../../../../util/captureEvents';\nimport useFlag from '../../../../hooks/useFlag';\nimport { preventMessageInputBlur } from '../../helpers/preventMessageInputBlur';\nimport stopEvent from '../../../../util/stopEvent';\nimport { REM } from '../../../common/helpers/mediaDimensions';\n\nconst ANDROID_KEYBOARD_HIDE_DELAY_MS = 350;\nconst SWIPE_ANIMATION_DURATION = 150;\nconst QUICK_REACTION_DOUBLE_TAP_DELAY = 200;\nconst QUICK_REACTION_AREA_WIDTH = 3 * REM;\nconst QUICK_REACTION_AREA_HEIGHT = Number(REM);\nconst GROUP_MESSAGE_HOVER_ATTRIBUTE = 'data-is-document-group-hover';\n\nexport default function useOuterHandlers(\n selectMessage: (e?: React.MouseEvent, groupedId?: string) => void,\n containerRef: RefObject,\n messageId: number,\n isAlbum: boolean,\n isInSelectMode: boolean,\n canReply: boolean,\n isProtected: boolean,\n onContextMenu: (e: React.MouseEvent) => void,\n handleBeforeContextMenu: (e: React.MouseEvent) => void,\n chatId: string,\n isContextMenuShown: boolean,\n contentRef: RefObject,\n isOwn: boolean,\n shouldHandleMouseLeave: boolean,\n) {\n const { setReplyingToId, sendDefaultReaction } = getDispatch();\n\n const [isQuickReactionVisible, markQuickReactionVisible, unmarkQuickReactionVisible] = useFlag();\n const [isSwiped, markSwiped, unmarkSwiped] = useFlag();\n const doubleTapTimeoutRef = useRef();\n\n function handleMouseDown(e: React.MouseEvent) {\n preventMessageInputBlur(e);\n handleBeforeContextMenu(e);\n }\n\n function handleMouseMove(e: React.MouseEvent) {\n const container = contentRef.current;\n if (!container) return;\n\n const { clientX, clientY } = e;\n const {\n x, width, y, height,\n } = container.getBoundingClientRect();\n\n const isVisibleX = Math.abs((isOwn ? (clientX - x) : (x + width - clientX))) < QUICK_REACTION_AREA_WIDTH;\n const isVisibleY = Math.abs(y + height - clientY) < QUICK_REACTION_AREA_HEIGHT;\n if (isVisibleX && isVisibleY) {\n markQuickReactionVisible();\n } else {\n unmarkQuickReactionVisible();\n }\n }\n\n function handleSendQuickReaction(e: React.MouseEvent) {\n const { x, y } = e.currentTarget.getBoundingClientRect();\n sendDefaultReaction({\n chatId,\n messageId,\n x,\n y,\n });\n }\n\n function handleTap(e: React.MouseEvent) {\n if (IS_ANDROID) {\n const target = e.target as HTMLDivElement;\n if (!target.classList.contains('text-content') && !target.classList.contains('Message')) {\n return;\n }\n\n if (windowSize.getIsKeyboardVisible()) {\n setTimeout(() => {\n onContextMenu(e);\n }, ANDROID_KEYBOARD_HIDE_DELAY_MS);\n } else {\n onContextMenu(e);\n }\n }\n }\n\n function handleDoubleTap(e: React.MouseEvent) {\n const { pageX: x, pageY: y } = e;\n\n sendDefaultReaction({\n chatId,\n messageId,\n x,\n y,\n });\n }\n\n function handleClick(e: React.MouseEvent) {\n if (isInSelectMode) {\n selectMessage(e);\n return;\n }\n\n if (!IS_TOUCH_ENV) return;\n\n if (doubleTapTimeoutRef.current) {\n clearInterval(doubleTapTimeoutRef.current);\n doubleTapTimeoutRef.current = undefined;\n handleDoubleTap(e);\n return;\n }\n\n doubleTapTimeoutRef.current = setTimeout(() => {\n doubleTapTimeoutRef.current = undefined;\n handleTap(e);\n }, QUICK_REACTION_DOUBLE_TAP_DELAY);\n }\n\n function handleContextMenu(e: React.MouseEvent) {\n if (IS_ANDROID) {\n if ((e.target as HTMLElement).matches('a[href]') || isContextMenuShown) {\n return;\n }\n\n e.preventDefault();\n selectMessage();\n } else {\n onContextMenu(e);\n }\n }\n\n function handleContainerDoubleClick() {\n if (IS_TOUCH_ENV) return;\n\n setReplyingToId({ messageId });\n }\n\n function stopPropagation(e: React.MouseEvent) {\n e.stopPropagation();\n }\n\n useEffect(() => {\n if (!IS_TOUCH_ENV || isInSelectMode || !canReply || isContextMenuShown) {\n return undefined;\n }\n\n let startedAt: number | undefined;\n return captureEvents(containerRef.current!, {\n selectorToPreventScroll: '.MessageList',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n if (!startedAt) {\n startedAt = Date.now();\n }\n\n markSwiped();\n\n return true;\n }\n\n return false;\n }),\n onRelease: () => {\n if (!startedAt) {\n return;\n }\n\n setReplyingToId({ messageId });\n\n setTimeout(unmarkSwiped, Math.max(0, SWIPE_ANIMATION_DURATION - (Date.now() - startedAt)));\n startedAt = undefined;\n },\n });\n }, [\n containerRef, isInSelectMode, messageId, setReplyingToId, markSwiped, unmarkSwiped, canReply, isContextMenuShown,\n ]);\n\n function handleMouseLeave(e: React.MouseEvent) {\n unmarkQuickReactionVisible();\n if (shouldHandleMouseLeave) handleDocumentGroupMouseLeave(e);\n }\n\n return {\n handleMouseDown: !isInSelectMode ? handleMouseDown : undefined,\n handleClick,\n handleContextMenu: !isInSelectMode ? handleContextMenu : (isProtected ? stopEvent : undefined),\n handleDoubleClick: !isInSelectMode ? handleContainerDoubleClick : undefined,\n handleContentDoubleClick: !IS_TOUCH_ENV ? stopPropagation : undefined,\n handleMouseMove,\n handleSendQuickReaction,\n handleMouseLeave,\n isSwiped,\n isQuickReactionVisible,\n handleDocumentGroupMouseEnter,\n };\n}\n\nfunction handleDocumentGroupMouseEnter(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.setAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE, '');\n }\n}\n\nfunction handleDocumentGroupMouseLeave(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.removeAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE);\n }\n}\n\nfunction getLastElementInDocumentGroup(element: Element) {\n let current: Element | null = element;\n\n do {\n current = current.nextElementSibling;\n } while (current && !current.classList.contains('last-in-document-group'));\n\n return current;\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './ContextMenuContainer';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst ContextMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const ContextMenuContainer = useModuleLoader(Bundles.Extra, 'ContextMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContextMenuContainer ? : undefined;\n};\n\nexport default memo(ContextMenuContainerAsync);\n","import React, {\n FC, memo, useEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport {\n selectUser,\n selectChatMessage,\n selectIsMessageFocused,\n selectChat,\n} from '../../modules/selectors';\nimport { isChatChannel } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport { renderActionMessageText } from '../common/helpers/renderActionMessageText';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport { ObserveFn, useOnIntersect } from '../../hooks/useIntersectionObserver';\nimport useFocusMessage from './message/hooks/useFocusMessage';\nimport useLang from '../../hooks/useLang';\n\nimport ContextMenuContainer from './message/ContextMenuContainer.async';\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n isEmbedded?: boolean;\n appearanceOrder?: number;\n isLastInList?: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n targetUserIds?: string[];\n targetMessage?: ApiMessage;\n targetChatId?: string;\n isFocused: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n};\n\nconst APPEARANCE_DELAY = 10;\n\nconst ActionMessage: FC = ({\n message,\n observeIntersection,\n isEmbedded,\n appearanceOrder = 0,\n isLastInList,\n usersById,\n senderUser,\n senderChat,\n targetUserIds,\n targetMessage,\n targetChatId,\n isFocused,\n focusDirection,\n noFocusHighlight,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n useEnsureMessage(message.chatId, message.replyToMessageId, targetMessage);\n useFocusMessage(ref, message.chatId, isFocused, focusDirection, noFocusHighlight);\n\n const lang = useLang();\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const targetUsers = useMemo(() => {\n return targetUserIds\n ? targetUserIds.map((userId) => usersById?.[userId]).filter(Boolean as any)\n : undefined;\n }, [targetUserIds, usersById]);\n\n const content = renderActionMessageText(\n lang,\n message,\n senderUser,\n senderChat,\n targetUsers,\n targetMessage,\n targetChatId,\n { asTextWithSpoilers: isEmbedded },\n );\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref);\n const isContextMenuShown = contextMenuPosition !== undefined;\n\n const handleMouseDown = (e: React.MouseEvent) => {\n preventMessageInputBlur(e);\n handleBeforeContextMenu(e);\n };\n\n if (isEmbedded) {\n return {content};\n }\n\n const className = buildClassName(\n 'ActionMessage message-list-item',\n isFocused && !noFocusHighlight && 'focused',\n isContextMenuShown && 'has-menu-open',\n isLastInList && 'last-in-list',\n transitionClassNames,\n );\n\n return (\n \n {content}\n {contextMenuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message }): StateProps => {\n const { byId: usersById } = global.users;\n const userId = message.senderId;\n const { targetUserIds, targetChatId } = message.content.action || {};\n const targetMessageId = message.replyToMessageId;\n const targetMessage = targetMessageId\n ? selectChatMessage(global, message.chatId, targetMessageId)\n : undefined;\n\n const isFocused = selectIsMessageFocused(global, message);\n const { direction: focusDirection, noHighlight: noFocusHighlight } = (isFocused && global.focusedMessage) || {};\n\n const chat = selectChat(global, message.chatId);\n const isChat = chat && (isChatChannel(chat) || userId === message.chatId);\n const senderUser = !isChat && userId ? selectUser(global, userId) : undefined;\n const senderChat = isChat ? chat : undefined;\n\n return {\n usersById,\n senderUser,\n senderChat,\n targetChatId,\n targetUserIds,\n targetMessage,\n isFocused,\n ...(isFocused && { focusDirection, noFocusHighlight }),\n };\n },\n)(ActionMessage));\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\n\nimport {\n getMessageMediaHash,\n isActionMessage,\n getSenderTitle,\n getMessageRoundVideo,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { getPictogramDimensions } from './helpers/mediaDimensions';\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\nimport useLang from '../../hooks/useLang';\nimport { renderMessageSummary } from './helpers/renderMessageText';\n\nimport ActionMessage from '../middle/ActionMessage';\n\nimport './EmbeddedMessage.scss';\n\ntype OwnProps = {\n observeIntersection?: ObserveFn;\n className?: string;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n title?: string;\n customText?: string;\n isProtected?: boolean;\n onClick: NoneToVoidFunction;\n};\n\nconst NBSP = '\\u00A0';\n\nconst EmbeddedMessage: FC = ({\n className,\n message,\n sender,\n title,\n customText,\n isProtected,\n observeIntersection,\n onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaBlobUrl = useMedia(message && getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n const pictogramId = message && `sticker-reply-thumb${message.id}`;\n const mediaThumbnail = useWebpThumbnail(message);\n const isRoundVideo = Boolean(message && getMessageRoundVideo(message));\n\n const lang = useLang();\n\n const senderTitle = sender && getSenderTitle(lang, sender);\n\n return (\n \n {mediaThumbnail && renderPictogram(pictogramId, mediaThumbnail, mediaBlobUrl, isRoundVideo, isProtected)}\n
\n

\n {!message ? (\n customText || NBSP\n ) : isActionMessage(message) ? (\n \n ) : (\n renderMessageSummary(lang, message, Boolean(mediaThumbnail))\n )}\n

\n
{renderText(senderTitle || title || NBSP)}
\n
\n
\n );\n};\n\nfunction renderPictogram(\n id: string | undefined,\n thumbDataUri: string,\n blobUrl?: string,\n isRoundVideo?: boolean,\n isProtected?: boolean,\n) {\n const { width, height } = getPictogramDimensions();\n\n return (\n <>\n \n {isProtected && }\n \n );\n}\n\nexport default EmbeddedMessage;\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ActiveReaction } from '../../../global/types';\nimport { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\n\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\nimport './ReactionAnimatedEmoji.scss';\n\ntype OwnProps = {\n reaction: string;\n activeReaction?: ActiveReaction;\n isInMeta?: boolean;\n availableReactions?: ApiAvailableReaction[];\n};\n\nconst CENTER_ICON_SIZE = 30;\nconst EFFECT_SIZE = 100;\n\nconst ReactionAnimatedEmoji: FC = ({\n reaction,\n activeReaction,\n isInMeta,\n availableReactions,\n}) => {\n const { stopActiveReaction } = getDispatch();\n\n const availableReaction = availableReactions?.find((r) => r.reaction === reaction);\n const centerIconId = availableReaction?.centerIcon?.id;\n const effectId = availableReaction?.aroundAnimation?.id;\n const mediaDataCenterIcon = useMedia(`sticker${centerIconId}`, !centerIconId, ApiMediaFormat.Lottie);\n const mediaDataEffect = useMedia(`sticker${effectId}`, !effectId, ApiMediaFormat.Lottie);\n\n const shouldPlay = Boolean(activeReaction?.reaction === reaction && mediaDataCenterIcon && mediaDataEffect);\n const {\n shouldRender: shouldRenderAnimation,\n transitionClassNames: animationClassNames,\n } = useShowTransition(shouldPlay, undefined, true, 'slow');\n\n const handleEnded = useCallback(() => {\n stopActiveReaction({ messageId: activeReaction?.messageId, reaction });\n }, [activeReaction?.messageId, reaction, stopActiveReaction]);\n\n const [isAnimationLoaded, markAnimationLoaded, unmarkAnimationLoaded] = useFlag();\n const shouldRenderStatic = !shouldPlay || !isAnimationLoaded;\n\n const className = buildClassName(\n 'ReactionAnimatedEmoji',\n isInMeta && 'in-meta',\n shouldRenderAnimation && 'is-animating',\n );\n\n return (\n
\n {shouldRenderStatic && }\n {shouldRenderAnimation && (\n <>\n \n \n \n )}\n
\n );\n};\n\nexport default memo(ReactionAnimatedEmoji);\n","import React, {\n FC, memo, useMemo,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types';\nimport { ActiveReaction } from '../../../global/types';\n\nimport { formatDateTimeToString, formatTime } from '../../../util/dateFormat';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\n\nimport MessageOutgoingStatus from '../../common/MessageOutgoingStatus';\nimport ReactionAnimatedEmoji from './ReactionAnimatedEmoji';\n\nimport './MessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n reactionMessage?: ApiMessage;\n withReactions?: boolean;\n withReactionOffset?: boolean;\n outgoingStatus?: ApiMessageOutgoingStatus;\n signature?: string;\n onClick: (e: React.MouseEvent) => void;\n activeReaction?: ActiveReaction;\n availableReactions?: ApiAvailableReaction[];\n};\n\nconst MessageMeta: FC = ({\n message, outgoingStatus, signature, onClick, withReactions,\n activeReaction, withReactionOffset, availableReactions,\n reactionMessage,\n}) => {\n const lang = useLang();\n const [isActivated, markActivated] = useFlag();\n\n const reactions = withReactions && reactionMessage?.reactions?.results.filter((l) => l.count > 0);\n\n const title = useMemo(() => {\n if (!isActivated) return undefined;\n const createDateTime = formatDateTimeToString(message.date * 1000, lang.code);\n const editDateTime = message.isEdited && formatDateTimeToString(message.editDate! * 1000, lang.code);\n const forwardedDateTime = message.forwardInfo && formatDateTimeToString(message.forwardInfo.date * 1000, lang.code);\n\n let text = createDateTime;\n if (editDateTime) {\n text += '\\n';\n text += lang('lng_edited_date').replace('{date}', editDateTime);\n }\n if (forwardedDateTime) {\n text += '\\n';\n text += lang('lng_forwarded_date').replace('{date}', forwardedDateTime);\n }\n\n return text;\n }, [isActivated, lang, message]);\n\n return (\n \n {reactions && reactions.map((l) => (\n \n ))}\n {Boolean(message.views) && (\n <>\n \n {formatIntegerCompact(message.views!)}\n \n \n \n )}\n {signature && (\n {renderText(signature)}\n )}\n \n {message.isEdited && `${lang('EditedMessage')} `}\n {formatTime(lang, message.date * 1000)}\n \n {outgoingStatus && (\n \n )}\n
\n );\n};\n\nexport default memo(MessageMeta);\n","import React, { FC, useEffect, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { NO_STICKER_SET_ID } from '../../../config';\nimport { getStickerDimensions } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport useWebpThumbnail from '../../../hooks/useWebpThumbnail';\nimport safePlay from '../../../util/safePlay';\nimport { IS_WEBM_SUPPORTED } from '../../../util/environment';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\nimport './Sticker.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n observeIntersectionForPlaying: ObserveFn;\n shouldLoop?: boolean;\n lastSyncTime?: number;\n};\n\nconst Sticker: FC = ({\n message, observeIntersection, observeIntersectionForPlaying, shouldLoop, lastSyncTime,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n const sticker = message.content.sticker!;\n const { isLottie, stickerSetId, isGif } = sticker;\n const canDisplayGif = IS_WEBM_SUPPORTED;\n const isMemojiSticker = stickerSetId === NO_STICKER_SET_ID;\n\n const shouldLoad = useIsIntersecting(ref, observeIntersection);\n const shouldPlay = useIsIntersecting(ref, observeIntersectionForPlaying);\n\n const mediaHash = sticker.isPreloadedGlobally ? `sticker${sticker.id}` : getMessageMediaHash(message, 'inline')!;\n const previewMediaHash = isGif && !canDisplayGif && (\n sticker.isPreloadedGlobally ? `sticker${sticker.id}?size=m` : getMessageMediaHash(message, 'pictogram'));\n const previewBlobUrl = useMedia(previewMediaHash);\n const thumbDataUri = useWebpThumbnail(message);\n const previewUrl = previewBlobUrl || thumbDataUri;\n\n const mediaData = useMedia(\n mediaHash,\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n\n const isMediaLoaded = Boolean(mediaData);\n const [isLottieLoaded, markLottieLoaded] = useFlag(isMediaLoaded);\n const isMediaReady = isLottie ? isLottieLoaded : isMediaLoaded;\n const transitionClassNames = useMediaTransition(isMediaReady);\n\n const { width, height } = getStickerDimensions(sticker);\n const thumbClassName = buildClassName('thumbnail', !thumbDataUri && 'empty');\n\n const stickerClassName = buildClassName(\n 'Sticker media-inner',\n isMemojiSticker && 'inactive',\n );\n\n useEffect(() => {\n if (!isGif || !ref.current) return;\n const video = ref.current.querySelector('video');\n if (!video) return;\n if (shouldPlay) {\n safePlay(video);\n } else {\n video.pause();\n }\n }, [isGif, shouldPlay]);\n\n return (\n
\n {(!isMediaReady || (isGif && !canDisplayGif)) && (\n \n )}\n {!isLottie && !isGif && (\n \n )}\n {isGif && canDisplayGif && isMediaReady && (\n \n )}\n {isLottie && isMediaLoaded && (\n \n )}\n \n
\n );\n};\n\nexport default Sticker;\n","import { ApiMessage } from '../../../../api/types';\n\nimport { IS_CANVAS_FILTER_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT } from '../../../../util/environment';\nimport { getMessageMediaThumbDataUri } from '../../../../modules/helpers';\nimport useCanvasBlur from '../../../../hooks/useCanvasBlur';\n\nexport default function useBlurredMediaThumbRef(message: ApiMessage, fullMediaData?: string) {\n return useCanvasBlur(\n getMessageMediaThumbDataUri(message),\n Boolean(fullMediaData),\n IS_SINGLE_COLUMN_LAYOUT && !IS_CANVAS_FILTER_SUPPORTED,\n );\n}\n","import { ISettings } from '../../../../types';\n\nconst SELECTED_APPENDIX_COLORS = {\n dark: {\n outgoing: 'rgb(135,116,225)',\n incoming: 'rgb(33,33,33)',\n },\n light: {\n outgoing: 'rgb(238,255,222)',\n incoming: 'rgb(255,255,255)',\n },\n};\n\nexport default function getCustomAppendixBg(\n src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean, theme?: ISettings['theme'],\n) {\n if (isSelected) {\n return Promise.resolve(SELECTED_APPENDIX_COLORS[theme || 'light'][isOwn ? 'outgoing' : 'incoming']);\n }\n return getAppendixColorFromImage(src, isOwn);\n}\n\nasync function getAppendixColorFromImage(src: string, isOwn: boolean) {\n const img = new Image();\n img.src = src;\n\n if (!img.width) {\n await new Promise((resolve) => {\n img.onload = resolve;\n });\n }\n\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n canvas.width = img.width;\n canvas.height = img.height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height);\n\n const x = isOwn ? img.width - 1 : 0;\n const y = img.height - 1;\n\n const pixel = Array.from(ctx.getImageData(x, y, 1, 1).data);\n return `rgba(${pixel.join(',')})`;\n}\n","import React, {\n FC, useCallback, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ISettings } from '../../../types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport {\n getMessagePhoto,\n getMessageWebPagePhoto,\n getMessageMediaHash,\n getMediaTransferState,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport getCustomAppendixBg from './helpers/getCustomAppendixBg';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n canAutoLoad?: boolean;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n uploadProgress?: number;\n size?: 'inline' | 'pictogram';\n shouldAffectAppendix?: boolean;\n dimensions?: IMediaDimensions & { isSmall?: boolean };\n nonInteractive?: boolean;\n isDownloading: boolean;\n isProtected?: boolean;\n theme: ISettings['theme'];\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst CUSTOM_APPENDIX_ATTRIBUTE = 'data-has-custom-appendix';\n\nconst Photo: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n canAutoLoad,\n isInSelectMode,\n isSelected,\n uploadProgress,\n size = 'inline',\n dimensions,\n nonInteractive,\n shouldAffectAppendix,\n isDownloading,\n isProtected,\n theme,\n onClick,\n onCancelUpload,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const photo = (getMessagePhoto(message) || getMessageWebPagePhoto(message))!;\n const localBlobUrl = photo.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isLoadAllowed, setIsLoadAllowed] = useState(canAutoLoad);\n const shouldLoad = isLoadAllowed && isIntersecting;\n const {\n mediaData, loadProgress,\n } = useMediaWithLoadProgress(getMessageMediaHash(message, size), !shouldLoad);\n const fullMediaData = localBlobUrl || mediaData;\n const thumbRef = useBlurredMediaThumbRef(message, fullMediaData);\n\n const {\n loadProgress: downloadProgress,\n } = useMediaWithLoadProgress(getMessageMediaHash(message, 'download'), !isDownloading);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n uploadProgress || (isDownloading ? downloadProgress : loadProgress),\n shouldLoad && !fullMediaData,\n );\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n\n const transitionClassNames = useMediaTransition(fullMediaData);\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasLoadDisabled, 'slow');\n const {\n shouldRender: shouldRenderDownloadButton,\n transitionClassNames: downloadButtonClassNames,\n } = useShowTransition(!fullMediaData && !isLoadAllowed);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n } else if (onClick) {\n onClick(message.id);\n }\n }, [fullMediaData, isUploading, message, onCancelUpload, onClick]);\n\n const isOwn = isOwnMessage(message);\n useLayoutEffect(() => {\n if (!shouldAffectAppendix) {\n return;\n }\n\n const contentEl = ref.current!.closest('.message-content')!;\n\n if (fullMediaData) {\n getCustomAppendixBg(fullMediaData, isOwn, isInSelectMode, isSelected, theme).then((appendixBg) => {\n contentEl.style.setProperty('--appendix-bg', appendixBg);\n contentEl.setAttribute(CUSTOM_APPENDIX_ATTRIBUTE, '');\n });\n } else {\n contentEl.classList.add('has-appendix-thumb');\n }\n }, [fullMediaData, isOwn, shouldAffectAppendix, isInSelectMode, isSelected, theme]);\n\n const { width, height, isSmall } = dimensions || calculateMediaDimensions(message, noAvatars);\n\n const className = buildClassName(\n 'media-inner',\n !isUploading && !nonInteractive && 'interactive',\n isSmall && 'small-image',\n width === height && 'square-image',\n );\n\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n \n \n {isProtected && }\n {shouldRenderSpinner && !shouldRenderDownloadButton && (\n
\n \n
\n )}\n {shouldRenderDownloadButton && }\n {isTransferring && (\n {Math.round(transferProgress * 100)}%\n )}\n \n );\n};\n\nexport default Photo;\n","import { useCallback, useRef } from '../../../../lib/teact/teact';\n\nimport { fastRaf } from '../../../../util/schedulers';\nimport safePlay from '../../../../util/safePlay';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useHeavyAnimationCheck from '../../../../hooks/useHeavyAnimationCheck';\n\nexport default function useVideoAutoPause(playerRef: { current: HTMLVideoElement | null }, canPlay: boolean) {\n const wasPlaying = useRef(playerRef.current?.paused);\n const canPlayRef = useRef();\n canPlayRef.current = canPlay;\n\n const freezePlaying = useCallback(() => {\n if (!playerRef.current) {\n return;\n }\n\n wasPlaying.current = !playerRef.current.paused;\n\n if (wasPlaying.current) {\n playerRef.current.pause();\n }\n }, [playerRef]);\n\n const unfreezePlaying = useCallback(() => {\n if (\n playerRef.current && wasPlaying.current && canPlayRef.current\n // At this point HTMLVideoElement can be unmounted from the DOM\n && document.body.contains(playerRef.current)\n ) {\n safePlay(playerRef.current);\n }\n }, [playerRef]);\n\n const unfreezePlayingOnRaf = useCallback(() => {\n fastRaf(unfreezePlaying);\n }, [unfreezePlaying]);\n\n useBackgroundMode(freezePlaying, unfreezePlayingOnRaf);\n useHeavyAnimationCheck(freezePlaying, unfreezePlaying);\n}\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat, ApiMessage } from '../../../api/types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { calculateVideoDimensions } from '../../common/helpers/mediaDimensions';\nimport {\n getMediaTransferState,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageVideo,\n getMessageWebPageVideo,\n isForwardedMessage,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport useVideoAutoPause from './hooks/useVideoAutoPause';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection: ObserveFn;\n noAvatars?: boolean;\n canAutoLoad?: boolean;\n canAutoPlay?: boolean;\n uploadProgress?: number;\n dimensions?: IMediaDimensions;\n lastSyncTime?: number;\n isDownloading: boolean;\n isProtected?: boolean;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst Video: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n canAutoLoad,\n canAutoPlay,\n uploadProgress,\n lastSyncTime,\n dimensions,\n onClick,\n onCancelUpload,\n isDownloading,\n isProtected,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const video = (getMessageVideo(message) || getMessageWebPageVideo(message))!;\n const localBlobUrl = video.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isLoadAllowed, setIsLoadAllowed] = useState(canAutoLoad);\n const shouldLoad = Boolean(isLoadAllowed && isIntersecting && lastSyncTime);\n const [isPlayAllowed, setIsPlayAllowed] = useState(canAutoPlay);\n\n const previewBlobUrl = useMedia(\n getMessageMediaHash(message, 'pictogram'),\n !(isIntersecting && lastSyncTime),\n getMessageMediaFormat(message, 'pictogram'),\n lastSyncTime,\n );\n const previewClassNames = useMediaTransition(previewBlobUrl);\n\n const { mediaData, loadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const fullMediaData = localBlobUrl || mediaData;\n const isInline = Boolean(isIntersecting && fullMediaData);\n // Thumbnail is always rendered so we can only disable blur if we have preview\n const thumbRef = useBlurredMediaThumbRef(message, previewBlobUrl);\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'download'),\n !isDownloading,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n\n const { isBuffered, bufferingHandlers } = useBuffering(!canAutoLoad);\n const { isUploading, isTransferring, transferProgress } = getMediaTransferState(\n message,\n uploadProgress || (isDownloading ? downloadProgress : loadProgress),\n (shouldLoad && !isBuffered) || isDownloading,\n );\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasLoadDisabled);\n const {\n shouldRender: shouldRenderPlayButton,\n transitionClassNames: playButtonClassNames,\n } = useShowTransition(isLoadAllowed && !isPlayAllowed && !shouldRenderSpinner);\n\n const [playProgress, setPlayProgress] = useState(0);\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setPlayProgress(Math.max(0, e.currentTarget.currentTime - 1));\n }, []);\n\n const duration = (videoRef.current?.duration) || video.duration || 0;\n\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const { width, height } = dimensions || calculateVideoDimensions(video, isOwn, isForwarded, noAvatars);\n\n useVideoAutoPause(videoRef, isInline);\n useVideoCleanup(videoRef, [isInline]);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (isDownloading) {\n getDispatch().cancelMessageMediaDownload({ message });\n } else if (!fullMediaData) {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n } else if (fullMediaData && !isPlayAllowed) {\n setIsPlayAllowed(true);\n videoRef.current!.play();\n } else if (onClick) {\n onClick(message.id);\n }\n }, [isUploading, isDownloading, fullMediaData, isPlayAllowed, onClick, onCancelUpload, message]);\n\n const className = buildClassName('media-inner dark', !isUploading && 'interactive');\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n \n \n {isInline && (\n \n \n \n )}\n {isProtected && }\n {shouldRenderPlayButton && }\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!isLoadAllowed && (\n \n )}\n {isTransferring ? (\n \n {(isUploading || isDownloading) ? `${Math.round(transferProgress * 100)}%` : '...'}\n \n ) : (\n
\n {video.isGif ? 'GIF' : formatMediaDuration(Math.max(duration - playProgress, 0))}\n
\n )}\n \n );\n};\n\nexport default Video;\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport buildClassName from '../../../util/buildClassName';\n\nimport Avatar from '../../common/Avatar';\n\nimport './Contact.scss';\n\ntype OwnProps = {\n contact: ApiContact;\n};\n\ntype StateProps = {\n user?: ApiUser;\n phoneCodeList: ApiCountryCode[];\n};\n\nconst Contact: FC = ({\n contact, user, phoneCodeList,\n}) => {\n const { openChat } = getDispatch();\n\n const {\n firstName,\n lastName,\n phoneNumber,\n userId,\n } = contact;\n\n const handleClick = useCallback(() => {\n openChat({ id: userId });\n }, [openChat, userId]);\n\n return (\n \n \n
\n
{firstName} {lastName}
\n
{formatPhoneNumberWithCode(phoneCodeList, phoneNumber)}
\n
\n \n );\n};\n\nexport default withGlobal(\n (global, { contact }): StateProps => {\n const { countryList: { phoneCodes: phoneCodeList } } = global;\n return {\n user: selectUser(global, contact.userId),\n phoneCodeList,\n };\n },\n)(Contact);\n","import React, {\n FC, useState, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiPollAnswer, ApiPollResult } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport renderText from '../../common/helpers/renderText';\n\nimport './PollOption.scss';\n\ntype OwnProps = {\n answer: ApiPollAnswer;\n voteResults?: ApiPollResult[];\n totalVoters?: number;\n maxVotersCount?: number;\n correctResults: string[];\n shouldAnimate: boolean;\n};\n\nconst PollOption: FC = ({\n answer,\n voteResults,\n totalVoters,\n maxVotersCount,\n correctResults,\n shouldAnimate,\n}) => {\n const result = voteResults && voteResults.find((r) => r.option === answer.option);\n const correctAnswer = correctResults.length === 0 || correctResults.indexOf(answer.option) !== -1;\n const showIcon = (correctResults.length > 0 && correctAnswer) || (result?.isChosen);\n const answerPercent = result ? getPercentage(result.votersCount, totalVoters || 0) : 0;\n const [finalPercent, setFinalPercent] = useState(shouldAnimate ? 0 : answerPercent);\n // eslint-disable-next-line no-null/no-null\n const lineRef = useRef(null);\n const lineWidth = result ? getPercentage(result.votersCount, maxVotersCount || 0) : 0;\n const isAnimationDoesNotStart = finalPercent < answerPercent;\n\n useEffect(() => {\n if (shouldAnimate) {\n setFinalPercent(answerPercent);\n }\n }, [shouldAnimate, answerPercent]);\n\n useEffect(() => {\n const lineEl = lineRef.current;\n\n if (lineEl && shouldAnimate) {\n const svgEl = lineEl.firstElementChild;\n\n const style = isAnimationDoesNotStart ? '' : 'stroke-dasharray: 100% 200%; stroke-dashoffset: -44';\n if (!svgEl) {\n lineEl.innerHTML = `\n \n \n `;\n } else {\n svgEl.setAttribute('style', style);\n }\n }\n }, [isAnimationDoesNotStart, shouldAnimate]);\n\n if (!voteResults || !result) {\n return undefined;\n }\n\n const lineStyle = `width: ${lineWidth}%; transform:scaleX(${isAnimationDoesNotStart ? 0 : 1})`;\n\n return (\n
\n
\n {answerPercent}%\n {showIcon && (\n \n \n \n )}\n
\n
\n
\n {renderText(answer.text)}\n
\n
\n
\n \n
\n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default PollOption;\n","import React, {\n FC,\n useCallback,\n useEffect,\n useState,\n memo,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiMessage, ApiPoll, ApiUser, ApiPollAnswer,\n} from '../../../api/types';\n\nimport renderText from '../../common/helpers/renderText';\nimport { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport CheckboxGroup from '../../ui/CheckboxGroup';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport Notification from '../../ui/Notification';\nimport PollOption from './PollOption';\n\nimport './Poll.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n poll: ApiPoll;\n onSendVote: (options: string[]) => void;\n};\n\ntype StateProps = {\n recentVoterIds?: number[];\n usersById: Record;\n serverTimeOffset: number;\n};\n\nconst SOLUTION_CONTAINER_ID = '#middle-column-portals';\nconst SOLUTION_DURATION = 5000;\nconst NBSP = '\\u00A0';\n\nconst Poll: FC = ({\n message,\n poll,\n recentVoterIds,\n usersById,\n onSendVote,\n serverTimeOffset,\n}) => {\n const { loadMessage, openPollResults } = getDispatch();\n\n const { id: messageId, chatId } = message;\n const { summary, results } = poll;\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [chosenOptions, setChosenOptions] = useState([]);\n const [isSolutionShown, setIsSolutionShown] = useState(false);\n const [wasSubmitted, setWasSubmitted] = useState(false);\n const [closePeriod, setClosePeriod] = useState(\n !summary.closed && summary.closeDate && summary.closeDate > 0\n ? Math.min(summary.closeDate - Math.floor(Date.now() / 1000) + serverTimeOffset, summary.closePeriod!)\n : 0,\n );\n // eslint-disable-next-line no-null/no-null\n const countdownRef = useRef(null);\n const { results: voteResults, totalVoters } = results;\n const hasVoted = voteResults && voteResults.some((r) => r.isChosen);\n const canVote = !summary.closed && !hasVoted;\n const canViewResult = !canVote && summary.isPublic && Number(results.totalVoters) > 0;\n const isMultiple = canVote && summary.multipleChoice;\n const maxVotersCount = voteResults ? Math.max(...voteResults.map((r) => r.votersCount)) : totalVoters;\n const correctResults = voteResults ? voteResults.reduce((answers: string[], r) => {\n if (r.isCorrect) {\n answers.push(r.option);\n }\n\n return answers;\n }, []) : [];\n const answers = summary.answers.map((a) => ({\n label: a.text,\n value: a.option,\n hidden: Boolean(summary.quiz && summary.closePeriod && closePeriod <= 0),\n }));\n\n useEffect(() => {\n if (\n isSubmitting\n && poll.results.results\n && poll.results.results.some((result) => result.isChosen)\n ) {\n setIsSubmitting(false);\n }\n }, [isSubmitting, poll.results.results]);\n\n useEffect(() => {\n if (closePeriod > 0) {\n setTimeout(() => setClosePeriod(closePeriod - 1), 1000);\n }\n\n const countdownEl = countdownRef.current;\n\n if (countdownEl) {\n const circumference = 6 * 2 * Math.PI;\n const svgEl = countdownEl.lastElementChild;\n const timerEl = countdownEl.firstElementChild;\n if (closePeriod <= 5) {\n countdownEl.classList.add('hurry-up');\n }\n\n if (!svgEl || !timerEl) {\n countdownEl.innerHTML = `\n ${formatMediaDuration(closePeriod)}\n \n \n `;\n } else {\n const strokeDashOffset = ((summary.closePeriod! - closePeriod) / summary.closePeriod!) * circumference;\n timerEl.textContent = formatMediaDuration(closePeriod);\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', `-${strokeDashOffset}`);\n }\n }\n }, [closePeriod, summary.closePeriod]);\n\n useEffect(() => {\n if (summary.quiz && (closePeriod <= 0 || (hasVoted && !summary.closed))) {\n loadMessage({ chatId, messageId });\n }\n }, [chatId, closePeriod, hasVoted, loadMessage, messageId, summary.closed, summary.quiz]);\n\n // If the client time is not synchronized, the poll must be updated after the closePeriod time has expired.\n useEffect(() => {\n let timer: number | undefined;\n\n if (summary.quiz && !summary.closed && summary.closePeriod && summary.closePeriod > 0) {\n timer = window.setTimeout(() => {\n loadMessage({ chatId, messageId });\n }, summary.closePeriod * 1000);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [canVote, chatId, loadMessage, messageId, summary.closePeriod, summary.closed, summary.quiz]);\n\n const recentVoters = useMemo(() => {\n return recentVoterIds ? recentVoterIds.reduce((result: ApiUser[], id) => {\n const user = usersById[id];\n if (user) {\n result.push(user);\n }\n\n return result;\n }, []) : [];\n }, [usersById, recentVoterIds]);\n\n const handleRadioChange = useCallback(\n (option: string) => {\n setChosenOptions([option]);\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote([option]);\n }, [onSendVote],\n );\n\n const handleCheckboxChange = useCallback(\n (options: string[]) => {\n setChosenOptions(options);\n }, [],\n );\n\n const handleVoteClick = useCallback(\n () => {\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote(chosenOptions);\n }, [onSendVote, chosenOptions],\n );\n\n const handleViewResultsClick = useCallback(\n () => {\n openPollResults({ chatId, messageId });\n }, [chatId, messageId, openPollResults],\n );\n\n const handleSolutionShow = useCallback(() => {\n setIsSolutionShown(true);\n }, []);\n\n const handleSolutionHide = useCallback(() => {\n setIsSolutionShown(false);\n setWasSubmitted(false);\n }, []);\n\n // Show the solution to quiz if the answer was incorrect\n useEffect(() => {\n if (wasSubmitted && hasVoted && summary.quiz && results.results && poll.results.solution) {\n const correctResult = results.results.find((r) => r.isChosen && r.isCorrect);\n if (!correctResult) {\n setIsSolutionShown(true);\n }\n }\n }, [hasVoted, wasSubmitted, results.results, summary.quiz, poll.results.solution]);\n\n const lang = useLang();\n\n function renderResultOption(answer: ApiPollAnswer) {\n return (\n \n );\n }\n\n function renderRecentVoters() {\n return (\n recentVoters.length > 0 && (\n
\n {recentVoters.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n function renderSolution() {\n return (\n isSolutionShown && poll.results.solution && (\n \n )\n );\n }\n\n return (\n
\n {renderSolution()}\n
{renderText(summary.question, ['emoji', 'br'])}
\n
\n {lang(getPollTypeString(summary))}\n {renderRecentVoters()}\n {closePeriod > 0 && canVote &&
}\n {summary.quiz && poll.results.solution && !canVote && (\n \n \n \n )}\n
\n {canVote && (\n
\n {isMultiple\n ? (\n \n )\n : (\n \n )}\n
\n )}\n {!canVote && (\n
\n {summary.answers.map(renderResultOption)}\n
\n )}\n {!canViewResult && !isMultiple && (\n
{getReadableVotersCount(lang, summary.quiz, results.totalVoters)}
\n )}\n {isMultiple && (\n \n {lang('PollSubmitVotes')}\n \n )}\n {canViewResult && (\n \n {lang('PollViewResults')}\n \n )}\n
\n );\n};\n\nfunction getPollTypeString(summary: ApiPoll['summary']) {\n // When we just created the poll, some properties don't exist.\n if (typeof summary.isPublic === 'undefined') {\n return NBSP;\n }\n\n if (summary.quiz) {\n return summary.isPublic ? 'QuizPoll' : 'AnonymousQuizPoll';\n }\n\n if (summary.closed) {\n return 'FinalResults';\n }\n\n return summary.isPublic ? 'PublicPoll' : 'AnonymousPoll';\n}\n\nfunction getReadableVotersCount(lang: LangFn, isQuiz: true | undefined, count?: number) {\n if (!count) {\n return lang(isQuiz ? 'Chat.Quiz.TotalVotesEmpty' : 'Chat.Poll.TotalVotesResultEmpty');\n }\n\n return lang(isQuiz ? 'Answer' : 'Vote', count, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { poll }) => {\n const { recentVoterIds } = poll.results;\n const { serverTimeOffset, users: { byId: usersById } } = global;\n if (!recentVoterIds || recentVoterIds.length === 0) {\n return {};\n }\n\n return {\n recentVoterIds,\n usersById,\n serverTimeOffset,\n };\n },\n)(Poll));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport { ISettings } from '../../../types';\n\nimport { getMessageWebPage } from '../../../modules/helpers';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\nimport renderText from '../../common/helpers/renderText';\nimport trimText from '../../../util/trimText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport SafeLink from '../../common/SafeLink';\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './WebPage.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n canAutoLoad?: boolean;\n canAutoPlay?: boolean;\n inPreview?: boolean;\n lastSyncTime?: number;\n isDownloading?: boolean;\n isProtected?: boolean;\n theme: ISettings['theme'];\n onMediaClick?: () => void;\n onCancelMediaTransfer?: () => void;\n};\n\nconst WebPage: FC = ({\n message,\n observeIntersection,\n noAvatars,\n canAutoLoad,\n canAutoPlay,\n inPreview,\n lastSyncTime,\n isDownloading = false,\n isProtected,\n theme,\n onMediaClick,\n onCancelMediaTransfer,\n}) => {\n const webPage = getMessageWebPage(message);\n\n let isSquarePhoto = false;\n if (webPage?.photo && !webPage.video) {\n const { width, height } = calculateMediaDimensions(message);\n isSquarePhoto = width === height;\n }\n\n const handleMediaClick = useCallback(() => {\n onMediaClick!();\n }, [onMediaClick]);\n\n if (!webPage) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n photo,\n video,\n } = webPage;\n const isMediaInteractive = (photo || video) && onMediaClick && !isSquarePhoto;\n const truncatedDescription = trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebPage',\n isSquarePhoto && 'with-square-photo',\n !photo && !video && !inPreview && 'without-media',\n video && 'with-video',\n );\n\n return (\n \n {photo && !video && (\n \n )}\n
\n \n {!inPreview && title && (\n

{renderText(title)}

\n )}\n {truncatedDescription && (\n

{renderText(truncatedDescription, ['emoji', 'br'])}

\n )}\n
\n {!inPreview && video && (\n \n )}\n
\n );\n};\n\nexport default memo(WebPage);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { getMessageInvoice } from '../../../modules/helpers';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './Invoice.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n};\n\nconst Invoice: FC = ({\n message,\n}) => {\n const lang = useLang();\n const invoice = getMessageInvoice(message);\n\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = invoice!;\n\n return (\n \n {title && (\n

{renderText(title)}

\n )}\n {text && (\n

{renderText(text, ['emoji', 'br'])}

\n )}\n
\n {photoUrl && (\n \n )}\n

\n {formatCurrency(amount, currency, lang.code)}\n {isTest && {lang('PaymentTestInvoice')}}\n

\n
\n
\n );\n};\n\nexport default memo(Invoice);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC,\n useCallback,\n useMemo,\n memo,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { OwnProps as PhotoProps } from '../Photo';\nimport { OwnProps as VideoProps } from '../Video';\n\nimport buildClassName from '../../../../util/buildClassName';\nimport {\n selectIsInSelectMode,\n selectIsMessageSelected,\n} from '../../../../modules/selectors';\n\ntype OwnProps =\n PhotoProps\n & VideoProps;\n\ntype StateProps = {\n isInSelectMode?: boolean;\n isSelected?: boolean;\n};\n\nexport default function withSelectControl(WrappedComponent: FC) {\n const ComponentWithSelectControl: FC = (props) => {\n const {\n isInSelectMode,\n isSelected,\n message,\n dimensions,\n } = props;\n const { toggleMessageSelection } = getDispatch();\n\n const handleMessageSelect = useCallback((e: ReactMouseEvent) => {\n e.stopPropagation();\n toggleMessageSelection({ messageId: message.id, withShift: e?.shiftKey });\n }, [toggleMessageSelection, message]);\n\n const newProps = useMemo(() => {\n return {\n ...props,\n isInSelectMode,\n isSelected,\n dimensions: {\n ...props.dimensions,\n x: 0,\n y: 0,\n },\n onClick: isInSelectMode ? undefined : props.onClick,\n };\n }, [props, isInSelectMode, isSelected]);\n\n return (\n \n {isInSelectMode && (\n
\n {isSelected && (\n \n )}\n
\n )}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n \n \n );\n };\n\n return memo(withGlobal(\n (global, ownProps) => {\n const { message } = ownProps;\n return {\n isInSelectMode: selectIsInSelectMode(global),\n isSelected: selectIsMessageSelected(global, message.id),\n };\n },\n )(ComponentWithSelectControl));\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum, ISettings } from '../../../types';\nimport { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout';\n\nimport { getMessageContent } from '../../../modules/helpers';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\nimport withSelectControl from './hocs/withSelectControl';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport {\n selectActiveDownloadIds,\n selectCanAutoLoadMedia,\n selectCanAutoPlayMedia,\n selectTheme,\n} from '../../../modules/selectors';\n\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './Album.scss';\n\nconst PhotoWithSelect = withSelectControl(Photo);\nconst VideoWithSelect = withSelectControl(Video);\n\ntype OwnProps = {\n album: IAlbum;\n observeIntersection: ObserveFn;\n hasCustomAppendix?: boolean;\n lastSyncTime?: number;\n isOwn: boolean;\n isProtected?: boolean;\n albumLayout: IAlbumLayout;\n onMediaClick: (messageId: number) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n uploadsById: GlobalState['fileUploads']['byMessageLocalId'];\n activeDownloadIds: number[];\n};\n\nconst Album: FC = ({\n album,\n observeIntersection,\n hasCustomAppendix,\n lastSyncTime,\n isOwn,\n isProtected,\n albumLayout,\n onMediaClick,\n uploadsById,\n activeDownloadIds,\n theme,\n}) => {\n const { cancelSendingMessage } = getDispatch();\n\n const mediaCount = album.messages.length;\n\n const handleCancelUpload = useCallback((message: ApiMessage) => {\n cancelSendingMessage({ chatId: message.chatId, messageId: message.id });\n }, [cancelSendingMessage]);\n\n function renderAlbumMessage(message: ApiMessage, index: number) {\n const { photo, video } = getMessageContent(message);\n const fileUpload = uploadsById[message.previousLocalId || message.id];\n const uploadProgress = fileUpload?.progress;\n const { dimensions, sides } = albumLayout.layout[index];\n\n // Ignoring global updates is a known drawback here\n const canAutoLoad = selectCanAutoLoadMedia(getGlobal(), message);\n const canAutoPlay = selectCanAutoPlayMedia(getGlobal(), message);\n\n if (photo) {\n const shouldAffectAppendix = hasCustomAppendix && (\n // eslint-disable-next-line no-bitwise\n (isOwn ? index === mediaCount - 1 : Boolean(sides & AlbumRectPart.Left && sides & AlbumRectPart.Bottom))\n );\n\n return (\n \n );\n } else if (video) {\n return (\n \n );\n }\n\n return undefined;\n }\n\n const { width: containerWidth, height: containerHeight } = albumLayout.containerStyle;\n\n return (\n \n {album.messages.map(renderAlbumMessage)}\n \n );\n};\n\nexport default withGlobal(\n (global, { album }): StateProps => {\n const { chatId } = album.mainMessage;\n const theme = selectTheme(global);\n const activeDownloadIds = selectActiveDownloadIds(global, chatId);\n return {\n theme,\n uploadsById: global.fileUploads.byMessageLocalId,\n activeDownloadIds,\n };\n },\n)(Album);\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat, ApiMessage } from '../../../api/types';\n\nimport { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { stopCurrentAudio } from '../../../util/audioPlayer';\nimport safePlay from '../../../util/safePlay';\nimport { fastRaf } from '../../../util/schedulers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport useVideoAutoPause from './hooks/useVideoAutoPause';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './RoundVideo.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n canAutoLoad?: boolean;\n lastSyncTime?: number;\n isDownloading?: boolean;\n};\n\nlet stopPrevious: NoneToVoidFunction;\n\nconst RoundVideo: FC = ({\n message,\n observeIntersection,\n canAutoLoad,\n lastSyncTime,\n isDownloading,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playingProgressRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playerRef = useRef(null);\n\n const video = message.content.video!;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isLoadAllowed, setIsLoadAllowed] = useState(canAutoLoad);\n const shouldLoad = Boolean(isLoadAllowed && isIntersecting && lastSyncTime);\n const { mediaData, loadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'download'),\n !isDownloading,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const thumbRef = useBlurredMediaThumbRef(message, mediaData);\n\n const { isBuffered, bufferingHandlers } = useBuffering();\n const isTransferring = (isLoadAllowed && !isBuffered) || isDownloading;\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n\n const transitionClassNames = useMediaTransition(mediaData);\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring || !isBuffered, undefined, wasLoadDisabled);\n\n const [isActivated, setIsActivated] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useEffect(() => {\n if (!isActivated) {\n return;\n }\n\n const svgCenter = ROUND_VIDEO_DIMENSIONS_PX / 2;\n const svgMargin = 6;\n const circumference = (svgCenter - svgMargin) * 2 * Math.PI;\n const strokeDashOffset = circumference - progress * circumference;\n\n const playerEl = playerRef.current!;\n const playingProgressEl = playingProgressRef.current!;\n const svgEl = playingProgressEl.firstElementChild;\n\n if (!svgEl) {\n playingProgressEl.innerHTML = `\n \n \n `;\n } else {\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, [isActivated, progress]);\n\n const shouldPlay = Boolean(mediaData && isIntersecting);\n\n const stopPlaying = useCallback(() => {\n if (!playerRef.current) {\n return;\n }\n\n setIsActivated(false);\n setProgress(0);\n safePlay(playerRef.current);\n\n fastRaf(() => {\n playingProgressRef.current!.innerHTML = '';\n });\n }, []);\n\n const capturePlaying = useCallback(() => {\n stopPrevious?.();\n stopPrevious = stopPlaying;\n }, [stopPlaying]);\n\n useEffect(() => {\n if (!playerRef.current) {\n return;\n }\n\n if (shouldPlay) {\n safePlay(playerRef.current);\n } else {\n playerRef.current.pause();\n }\n }, [shouldPlay]);\n\n useVideoAutoPause(playerRef, shouldPlay);\n useVideoCleanup(playerRef, [mediaData]);\n\n const handleClick = useCallback(() => {\n if (!mediaData) {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n\n return;\n }\n\n if (isDownloading) {\n getDispatch().cancelMessageMediaDownload({ message });\n return;\n }\n\n const playerEl = playerRef.current!;\n if (isActivated) {\n if (playerEl.paused) {\n safePlay(playerEl);\n stopCurrentAudio();\n } else {\n playerEl.pause();\n }\n } else {\n capturePlaying();\n // Pause is a workaround for iOS Safari – otherwise it stops video after several frames\n playerEl.pause();\n playerEl.currentTime = 0;\n safePlay(playerEl);\n stopCurrentAudio();\n\n setIsActivated(true);\n }\n }, [capturePlaying, isActivated, isDownloading, mediaData, message]);\n\n const handleTimeUpdate = useCallback((e: React.UIEvent) => {\n const playerEl = e.currentTarget;\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, []);\n\n const videoClassName = buildClassName('full-media', transitionClassNames);\n\n return (\n \n
\n \n
\n {mediaData && (\n
\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n \n \n
\n )}\n
\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {!mediaData && !isLoadAllowed && (\n \n )}\n
\n {isActivated ? formatMediaDuration(playerRef.current!.currentTime) : formatMediaDuration(video.duration)}\n {(!isActivated || playerRef.current!.paused) && }\n
\n
\n );\n};\n\nexport default RoundVideo;\n","import React, { FC } from '../../../lib/teact/teact';\n\nimport { ApiKeyboardButton, ApiMessage } from '../../../api/types';\n\nimport { RE_TME_LINK } from '../../../config';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './InlineButtons.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n onClick: ({ button }: { button: ApiKeyboardButton }) => void;\n};\n\nconst InlineButtons: FC = ({ message, onClick }) => {\n const lang = useLang();\n\n return (\n
\n {message.inlineButtons!.map((row) => (\n
\n {row.map((button) => (\n onClick({ button })}\n >\n {renderText(lang(button.text))}\n {button.type === 'buy' && }\n {button.type === 'url' && !button.value!.match(RE_TME_LINK) && }\n \n ))}\n
\n ))}\n
\n );\n};\n\nexport default InlineButtons;\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiThreadInfo, ApiUser,\n} from '../../../api/types';\n\nimport { isUserId } from '../../../modules/helpers';\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\n\nimport './CommentButton.scss';\n\ntype OwnProps = {\n threadInfo: ApiThreadInfo;\n disabled?: boolean;\n};\n\nconst CommentButton: FC = ({\n threadInfo,\n disabled,\n}) => {\n const { openChat } = getDispatch();\n\n const lang = useLang();\n const {\n threadId, chatId, messagesCount, lastMessageId, lastReadInboxMessageId, recentReplierIds,\n } = threadInfo;\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, threadId });\n }, [openChat, chatId, threadId]);\n\n const recentRepliers = useMemo(() => {\n if (!recentReplierIds?.length) {\n return undefined;\n }\n\n // No need for expensive global updates on chats and users, so we avoid them\n const { users: { byId: usersById }, chats: { byId: chatsById } } = getGlobal();\n\n return recentReplierIds.map((peerId) => {\n return isUserId(peerId) ? usersById[peerId] : chatsById[peerId];\n }).filter(Boolean);\n }, [recentReplierIds]);\n\n if (messagesCount === undefined) {\n return undefined;\n }\n\n function renderRecentRepliers() {\n return (\n recentRepliers && recentRepliers.length > 0 && (\n
\n {recentRepliers.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n const hasUnread = Boolean(lastReadInboxMessageId && lastMessageId && lastReadInboxMessageId < lastMessageId);\n\n return (\n \n \n {(!recentRepliers || recentRepliers.length === 0) && }\n {renderRecentRepliers()}\n
\n {messagesCount ? lang('Comments', messagesCount, 'i') : lang('LeaveAComment')}\n
\n \n \n );\n};\n\nexport default memo(CommentButton);\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiAvailableReaction, ApiMessage, ApiReactionCount, ApiUser,\n} from '../../../api/types';\nimport { ActiveReaction } from '../../../global/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\nimport ReactionAnimatedEmoji from './ReactionAnimatedEmoji';\n\nimport './Reactions.scss';\n\nconst MAX_REACTORS_AVATARS = 3;\n\nconst ReactionButton: FC<{\n reaction: ApiReactionCount;\n message: ApiMessage;\n activeReaction?: ActiveReaction;\n availableReactions?: ApiAvailableReaction[];\n}> = ({\n reaction,\n message,\n activeReaction,\n availableReactions,\n}) => {\n const { sendReaction } = getDispatch();\n\n const { recentReactions } = message.reactions!;\n\n const recentReactors = useMemo(() => {\n if (!recentReactions || reaction.count > MAX_REACTORS_AVATARS) {\n return undefined;\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return recentReactions\n .filter((recentReaction) => recentReaction.reaction === reaction.reaction)\n .map((recentReaction) => usersById[recentReaction.userId])\n .filter(Boolean) as ApiUser[];\n }, [reaction, recentReactions]);\n\n const handleClick = useCallback(() => {\n sendReaction({\n reaction: reaction.isChosen ? undefined : reaction.reaction,\n chatId: message.chatId,\n messageId: message.id,\n });\n }, [message, reaction, sendReaction]);\n\n return (\n \n \n {recentReactors?.length ? (\n
\n {recentReactors.map((user) => )}\n
\n ) : formatIntegerCompact(reaction.count)}\n \n );\n};\n\nexport default memo(ReactionButton);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMessage } from '../../../api/types';\nimport { ActiveReaction } from '../../../global/types';\n\nimport buildClassName from '../../../util/buildClassName';\n\nimport ReactionButton from './ReactionButton';\n\nimport './Reactions.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n isOutside?: boolean;\n activeReaction?: ActiveReaction;\n availableReactions?: ApiAvailableReaction[];\n metaChildren?: React.ReactNode;\n};\n\nconst Reactions: FC = ({\n message,\n isOutside,\n activeReaction,\n availableReactions,\n metaChildren,\n}) => {\n return (\n
\n {message.reactions!.results.map((reaction) => (\n \n ))}\n {metaChildren}\n
\n );\n};\n\nexport default memo(Reactions);\n","import React, {\n FC, memo, useEffect, useState,\n} from '../../lib/teact/teact';\n\nimport { ActiveEmojiInteraction } from '../../global/types';\n\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';\nimport useAnimatedEmoji from './hooks/useAnimatedEmoji';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nconst QUALITY = 1;\n\ntype OwnProps = {\n localSticker?: string;\n localEffect?: string;\n isOwn?: boolean;\n soundId?: string;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n messageId?: number;\n chatId?: string;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\nconst LocalAnimatedEmoji: FC = ({\n localSticker,\n localEffect,\n isOwn,\n soundId,\n size = 'medium',\n observeIntersection,\n messageId,\n chatId,\n activeEmojiInteractions,\n}) => {\n const {\n playKey,\n ref,\n style,\n width,\n handleClick,\n markAnimationLoaded,\n } = useAnimatedEmoji(size, chatId, messageId, soundId, activeEmojiInteractions, isOwn, localEffect);\n const id = `local_emoji_${localSticker}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [localStickerAnimationData, setLocalStickerAnimationData] = useState();\n useEffect(() => {\n if (localSticker) {\n getAnimationData(localSticker as keyof typeof ANIMATED_STICKERS_PATHS).then((data) => {\n setLocalStickerAnimationData(data);\n });\n }\n }, [localSticker]);\n\n return (\n \n {localStickerAnimationData && (\n \n )}\n \n );\n};\n\nexport default memo(LocalAnimatedEmoji);\n","import React, {\n FC,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ActiveEmojiInteraction, ActiveReaction, MessageListType } from '../../../global/types';\nimport {\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n ApiChat,\n ApiSticker,\n ApiThreadInfo,\n ApiAvailableReaction,\n} from '../../../api/types';\nimport {\n AudioOrigin, FocusDirection, IAlbum, ISettings,\n} from '../../../types';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment';\nimport {\n selectChat,\n selectChatMessage,\n selectUploadProgress,\n selectIsChatWithSelf,\n selectOutgoingStatus,\n selectUser,\n selectIsMessageFocused,\n selectCurrentTextSearch,\n selectAnimatedEmoji,\n selectIsInSelectMode,\n selectIsMessageSelected,\n selectIsDocumentGroupSelected,\n selectSender,\n selectForwardedSender,\n selectThreadTopMessageId,\n selectCanAutoLoadMedia,\n selectCanAutoPlayMedia,\n selectShouldLoopStickers,\n selectTheme,\n selectAllowedMessageActions,\n selectIsDownloading,\n selectThreadInfo,\n selectAnimatedEmojiEffect,\n selectAnimatedEmojiSound,\n selectMessageIdsByGroupId,\n selectLocalAnimatedEmoji,\n selectIsMessageProtected,\n selectLocalAnimatedEmojiEffect,\n selectDefaultReaction,\n} from '../../../modules/selectors';\nimport {\n getMessageContent,\n isOwnMessage,\n isReplyMessage,\n isAnonymousOwnMessage,\n isMessageLocal,\n isUserId,\n isChatWithRepliesBot,\n getMessageCustomShape,\n isChatChannel,\n getMessageSingleEmoji,\n getSenderTitle,\n getUserColorKey,\n areReactionsEmpty,\n} from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport { renderMessageText } from '../../common/helpers/renderMessageText';\nimport { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions';\nimport { buildContentClassName, isEmojiOnlyMessage } from './helpers/buildContentClassName';\nimport { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimensions';\nimport { calculateAlbumLayout } from './helpers/calculateAlbumLayout';\nimport renderText from '../../common/helpers/renderText';\nimport calculateAuthorWidth from './helpers/calculateAuthorWidth';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport useFocusMessage from './hooks/useFocusMessage';\nimport useOuterHandlers from './hooks/useOuterHandlers';\nimport useInnerHandlers from './hooks/useInnerHandlers';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\nimport Document from '../../common/Document';\nimport Audio from '../../common/Audio';\nimport MessageMeta from './MessageMeta';\nimport ContextMenuContainer from './ContextMenuContainer.async';\nimport Sticker from './Sticker';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\nimport Photo from './Photo';\nimport Video from './Video';\nimport Contact from './Contact';\nimport Poll from './Poll';\nimport WebPage from './WebPage';\nimport Invoice from './Invoice';\nimport Album from './Album';\nimport RoundVideo from './RoundVideo';\nimport InlineButtons from './InlineButtons';\nimport CommentButton from './CommentButton';\nimport Reactions from './Reactions';\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport LocalAnimatedEmoji from '../../common/LocalAnimatedEmoji';\n\nimport './Message.scss';\n\ntype MessagePositionProperties = {\n isFirstInGroup: boolean;\n isLastInGroup: boolean;\n isFirstInDocumentGroup: boolean;\n isLastInDocumentGroup: boolean;\n isLastInList: boolean;\n};\n\ntype OwnProps =\n {\n message: ApiMessage;\n observeIntersectionForBottom: ObserveFn;\n observeIntersectionForMedia: ObserveFn;\n observeIntersectionForAnimatedStickers: ObserveFn;\n album?: IAlbum;\n noAvatars?: boolean;\n withAvatar?: boolean;\n withSenderName?: boolean;\n areReactionsInMeta?: boolean;\n threadId: number;\n messageListType: MessageListType;\n noComments: boolean;\n appearanceOrder: number;\n }\n & MessagePositionProperties;\n\ntype StateProps = {\n theme: ISettings['theme'];\n forceSenderName?: boolean;\n chatUsername?: string;\n sender?: ApiUser | ApiChat;\n originSender?: ApiUser | ApiChat;\n botSender?: ApiUser;\n isThreadTop?: boolean;\n shouldHideReply?: boolean;\n replyMessage?: ApiMessage;\n replyMessageSender?: ApiUser | ApiChat;\n outgoingStatus?: ApiMessageOutgoingStatus;\n uploadProgress?: number;\n isInDocumentGroup: boolean;\n isProtected?: boolean;\n isFocused?: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n isResizingContainer?: boolean;\n isForwarding?: boolean;\n isChatWithSelf?: boolean;\n isRepliesChat?: boolean;\n isChannel?: boolean;\n canReply?: boolean;\n lastSyncTime?: number;\n highlight?: string;\n isSingleEmoji?: boolean;\n animatedEmoji?: ApiSticker;\n localSticker?: string;\n localEffect?: string;\n animatedEmojiEffect?: ApiSticker;\n animatedEmojiSoundId?: string;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n isGroupSelected?: boolean;\n isDownloading: boolean;\n threadId?: number;\n isPinnedList?: boolean;\n canAutoLoadMedia?: boolean;\n canAutoPlayMedia?: boolean;\n shouldLoopStickers?: boolean;\n autoLoadFileMaxSizeMb: number;\n threadInfo?: ApiThreadInfo;\n reactionMessage?: ApiMessage;\n availableReactions?: ApiAvailableReaction[];\n defaultReaction?: string;\n activeReaction?: ActiveReaction;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\ntype MetaPosition =\n 'in-text'\n | 'standalone'\n | 'none';\ntype ReactionsPosition =\n 'inside'\n | 'outside'\n | 'in-meta'\n | 'none';\n\nconst NBSP = '\\u00A0';\n// eslint-disable-next-line max-len\nconst APPENDIX_OWN = { __html: '' };\n// eslint-disable-next-line max-len\nconst APPENDIX_NOT_OWN = { __html: '' };\nconst APPEARANCE_DELAY = 10;\nconst NO_MEDIA_CORNERS_THRESHOLD = 18;\n\nconst Message: FC = ({\n message,\n chatUsername,\n observeIntersectionForBottom,\n observeIntersectionForMedia,\n observeIntersectionForAnimatedStickers,\n album,\n noAvatars,\n withAvatar,\n withSenderName,\n areReactionsInMeta,\n noComments,\n appearanceOrder,\n isFirstInGroup,\n isLastInGroup,\n isFirstInDocumentGroup,\n isLastInDocumentGroup,\n isLastInList,\n theme,\n forceSenderName,\n sender,\n originSender,\n botSender,\n isThreadTop,\n shouldHideReply,\n replyMessage,\n replyMessageSender,\n outgoingStatus,\n uploadProgress,\n isInDocumentGroup,\n isProtected,\n isFocused,\n focusDirection,\n noFocusHighlight,\n isResizingContainer,\n isForwarding,\n isChatWithSelf,\n isRepliesChat,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n animatedEmoji,\n localSticker,\n localEffect,\n animatedEmojiEffect,\n animatedEmojiSoundId,\n isInSelectMode,\n isSelected,\n isGroupSelected,\n threadId,\n reactionMessage,\n availableReactions,\n defaultReaction,\n activeReaction,\n activeEmojiInteractions,\n messageListType,\n isPinnedList,\n isDownloading,\n canAutoLoadMedia,\n canAutoPlayMedia,\n shouldLoopStickers,\n autoLoadFileMaxSizeMb,\n threadInfo,\n}) => {\n const {\n toggleMessageSelection,\n clickInlineButton,\n disableContextMenuHint,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const bottomMarkerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const contentRef = useRef(null);\n\n const lang = useLang();\n\n useOnIntersect(bottomMarkerRef, observeIntersectionForBottom);\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu: onContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref, IS_TOUCH_ENV && isInSelectMode, true, IS_ANDROID);\n\n useEffect(() => {\n if (isContextMenuOpen) {\n disableContextMenuHint();\n }\n }, [isContextMenuOpen, disableContextMenuHint]);\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const {\n id: messageId, chatId, forwardInfo, viaBotId,\n } = message;\n\n const isLocal = isMessageLocal(message);\n const isOwn = isOwnMessage(message);\n const isScheduled = messageListType === 'scheduled' || message.isScheduled;\n const hasReply = isReplyMessage(message) && !shouldHideReply;\n const hasThread = Boolean(threadInfo) && messageListType === 'thread';\n const customShape = getMessageCustomShape(message);\n const hasAnimatedEmoji = localSticker || animatedEmoji;\n const hasReactions = reactionMessage?.reactions && !areReactionsEmpty(reactionMessage.reactions);\n const asForwarded = (\n forwardInfo\n && (!isChatWithSelf || isScheduled)\n && !isRepliesChat\n && !forwardInfo.isLinkedChannelPost\n && !customShape\n );\n const isAlbum = Boolean(album) && album!.messages.length > 1;\n const isInDocumentGroupNotFirst = isInDocumentGroup && !isFirstInDocumentGroup;\n const isInDocumentGroupNotLast = isInDocumentGroup && !isLastInDocumentGroup;\n const isContextMenuShown = contextMenuPosition !== undefined;\n const canShowActionButton = (\n !(isContextMenuShown || isInSelectMode || isForwarding)\n && !isInDocumentGroupNotLast\n );\n const canForward = isChannel && !isScheduled;\n const canFocus = Boolean(isPinnedList\n || (forwardInfo\n && (forwardInfo.isChannelPost || (isChatWithSelf && !isOwn) || isRepliesChat)\n && forwardInfo.fromMessageId\n ));\n\n const withCommentButton = threadInfo && !isInDocumentGroupNotLast && messageListType === 'thread' && !noComments;\n const withQuickReactionButton = !IS_TOUCH_ENV && !isInSelectMode && defaultReaction && !isInDocumentGroupNotLast;\n\n const selectMessage = useCallback((e?: React.MouseEvent, groupedId?: string) => {\n toggleMessageSelection({\n messageId,\n groupedId,\n ...(e?.shiftKey && { withShift: true }),\n ...(isAlbum && { childMessageIds: album!.messages.map(({ id }) => id) }),\n });\n }, [toggleMessageSelection, messageId, isAlbum, album]);\n\n const avatarPeer = forwardInfo && (isChatWithSelf || isRepliesChat || !sender) ? originSender : sender;\n const senderPeer = forwardInfo ? originSender : sender;\n\n const {\n handleMouseDown,\n handleClick,\n handleContextMenu,\n handleDoubleClick,\n handleContentDoubleClick,\n handleMouseMove,\n handleSendQuickReaction,\n handleMouseLeave,\n isSwiped,\n isQuickReactionVisible,\n handleDocumentGroupMouseEnter,\n } = useOuterHandlers(\n selectMessage,\n ref,\n messageId,\n isAlbum,\n Boolean(isInSelectMode),\n Boolean(canReply),\n Boolean(isProtected),\n onContextMenu,\n handleBeforeContextMenu,\n chatId,\n isContextMenuShown,\n contentRef,\n isOwn,\n isInDocumentGroupNotLast,\n );\n\n const {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll,\n } = useInnerHandlers(\n lang,\n selectMessage,\n message,\n chatId,\n threadId,\n isInDocumentGroup,\n asForwarded,\n isScheduled,\n isRepliesChat,\n album,\n avatarPeer,\n senderPeer,\n botSender,\n );\n\n const containerClassName = buildClassName(\n 'Message message-list-item',\n isFirstInGroup && 'first-in-group',\n isProtected && 'is-protected',\n isLastInGroup && 'last-in-group',\n isFirstInDocumentGroup && 'first-in-document-group',\n isLastInDocumentGroup && 'last-in-document-group',\n isLastInList && 'last-in-list',\n isOwn && 'own',\n Boolean(message.views) && 'has-views',\n message.isEdited && 'was-edited',\n hasReply && 'has-reply',\n isContextMenuShown && 'has-menu-open',\n isFocused && !noFocusHighlight && 'focused',\n isForwarding && 'is-forwarding',\n message.isDeleting && 'is-deleting',\n isInDocumentGroup && 'is-in-document-group',\n isAlbum && 'is-album',\n message.hasUnreadMention && 'has-unread-mention',\n isSelected && 'is-selected',\n isInSelectMode && 'is-in-selection-mode',\n isThreadTop && 'is-thread-top',\n Boolean(message.inlineButtons) && 'has-inline-buttons',\n isSwiped && 'is-swiped',\n transitionClassNames,\n Boolean(activeReaction) && 'has-active-reaction',\n );\n const contentClassName = buildContentClassName(message, {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments: threadInfo && threadInfo?.messagesCount > 0,\n hasActionButton: canForward || canFocus,\n hasReactions,\n });\n\n const withAppendix = contentClassName.includes('has-appendix');\n const textParts = renderMessageText(message, highlight, isEmojiOnlyMessage(customShape));\n\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, webPage, invoice,\n } = getMessageContent(message);\n\n let metaPosition!: MetaPosition;\n if (isInDocumentGroupNotLast) {\n metaPosition = 'none';\n } else if (textParts && !hasAnimatedEmoji && !webPage) {\n metaPosition = 'in-text';\n } else {\n metaPosition = 'standalone';\n }\n\n let reactionsPosition!: ReactionsPosition;\n if (areReactionsInMeta) {\n reactionsPosition = 'in-meta';\n } else if (hasReactions) {\n if (customShape || ((photo || video || hasAnimatedEmoji) && !textParts)) {\n reactionsPosition = 'outside';\n } else if (asForwarded) {\n metaPosition = 'standalone';\n reactionsPosition = 'inside';\n } else {\n reactionsPosition = 'inside';\n }\n } else {\n reactionsPosition = 'none';\n }\n\n useEnsureMessage(\n isRepliesChat && message.replyToChatId ? message.replyToChatId : chatId,\n hasReply ? message.replyToMessageId : undefined,\n replyMessage,\n message.id,\n );\n useFocusMessage(ref, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer);\n\n let style = '';\n let calculatedWidth;\n let noMediaCorners = false;\n const albumLayout = useMemo(() => {\n return isAlbum ? calculateAlbumLayout(isOwn, Boolean(asForwarded), Boolean(noAvatars), album!) : undefined;\n }, [isAlbum, isOwn, asForwarded, noAvatars, album]);\n\n const extraPadding = asForwarded ? 28 : 0;\n if (!isAlbum && (photo || video)) {\n let width: number | undefined;\n if (photo) {\n width = calculateMediaDimensions(message, noAvatars).width;\n } else if (video) {\n if (video.isRound) {\n width = ROUND_VIDEO_DIMENSIONS_PX;\n } else {\n width = calculateMediaDimensions(message, noAvatars).width;\n }\n }\n\n if (width) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), width);\n if (calculatedWidth - width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n } else if (albumLayout) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), albumLayout.containerStyle.width);\n if (calculatedWidth - albumLayout.containerStyle.width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n\n if (calculatedWidth) {\n style = `width: ${calculatedWidth + extraPadding}px`;\n }\n\n const signature = (isChannel && message.adminTitle) || (!asForwarded && forwardInfo?.adminTitle) || undefined;\n const metaSafeAuthorWidth = useMemo(() => {\n return signature ? calculateAuthorWidth(signature) : undefined;\n }, [signature]);\n\n function renderAvatar() {\n const isAvatarPeerUser = avatarPeer && isUserId(avatarPeer.id);\n const avatarUser = (avatarPeer && isAvatarPeerUser) ? avatarPeer as ApiUser : undefined;\n const avatarChat = (avatarPeer && !isAvatarPeerUser) ? avatarPeer as ApiChat : undefined;\n const hiddenName = (!avatarPeer && forwardInfo) ? forwardInfo.hiddenUserName : undefined;\n\n return (\n \n );\n }\n\n function renderReactionsAndMeta() {\n const meta = (\n \n );\n\n if (reactionsPosition !== 'inside') {\n return meta;\n }\n\n return (\n \n );\n }\n\n function renderContent() {\n const className = buildClassName(\n 'content-inner',\n asForwarded && 'forwarded-message',\n hasReply && 'reply-message',\n noMediaCorners && 'no-media-corners',\n );\n const hasCustomAppendix = isLastInGroup && !textParts && !asForwarded && !hasThread;\n const textContentClass = buildClassName(\n 'text-content',\n metaPosition === 'in-text' && 'with-meta',\n outgoingStatus && 'with-outgoing-icon',\n );\n\n return (\n
\n {renderSenderName()}\n {hasReply && (\n \n )}\n {sticker && (\n \n )}\n {animatedEmoji && (\n \n )}\n {localSticker && (\n \n )}\n {isAlbum && (\n \n )}\n {!isAlbum && photo && (\n \n )}\n {!isAlbum && video && video.isRound && (\n \n )}\n {!isAlbum && video && !video.isRound && (\n \n )}\n {(audio || voice) && (\n \n )}\n {document && (\n \n )}\n {contact && (\n \n )}\n {poll && (\n \n )}\n {!hasAnimatedEmoji && textParts && (\n

\n {textParts}\n {metaPosition === 'in-text' && renderReactionsAndMeta()}\n

\n )}\n\n {webPage && (\n \n )}\n {invoice && }\n
\n );\n }\n\n function renderSenderName() {\n const shouldRender = !(customShape && !viaBotId) && (\n (withSenderName && !photo && !video) || asForwarded || viaBotId || forceSenderName\n ) && !isInDocumentGroupNotFirst && !(hasReply && customShape);\n\n if (!shouldRender) {\n return undefined;\n }\n\n let senderTitle;\n let senderColor;\n if (senderPeer && !(customShape && viaBotId)) {\n senderTitle = getSenderTitle(lang, senderPeer);\n\n if (!asForwarded) {\n senderColor = `color-${getUserColorKey(senderPeer)}`;\n }\n } else if (forwardInfo?.hiddenUserName) {\n senderTitle = forwardInfo.hiddenUserName;\n }\n\n return (\n
\n {senderTitle ? (\n \n {renderText(senderTitle)}\n \n ) : !botSender ? (\n NBSP\n ) : undefined}\n {botSender && (\n <>\n {lang('ViaBot')}\n \n {renderText(`@${botSender.username}`)}\n \n \n )}\n {forwardInfo?.isLinkedChannelPost ? (\n {lang('DiscussChannel')}\n ) : message.adminTitle && !isChannel ? (\n {message.adminTitle}\n ) : undefined}\n
\n );\n }\n\n return (\n \n \n {!isInDocumentGroup && (\n
\n {isSelected && }\n
\n )}\n {isLastInDocumentGroup && (\n \n {isGroupSelected && (\n \n )}\n \n )}\n {withAvatar && renderAvatar()}\n \n \n {asForwarded && !isInDocumentGroupNotFirst && (\n
{lang('ForwardedMessage')}
\n )}\n {renderContent()}\n {!isInDocumentGroupNotLast && metaPosition === 'standalone' && renderReactionsAndMeta()}\n {canShowActionButton && canForward ? (\n \n \n \n ) : canShowActionButton && canFocus ? (\n \n \n \n ) : undefined}\n {withCommentButton && }\n {withAppendix && (\n
\n )}\n {withQuickReactionButton && (\n \n \n
\n )}\n \n {message.inlineButtons && (\n \n )}\n {reactionsPosition === 'outside' && (\n \n )}\n \n {contextMenuPosition && (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const { focusedMessage, forwardMessages, lastSyncTime } = global;\n const {\n message, album, withSenderName, withAvatar, threadId, messageListType, isLastInDocumentGroup,\n } = ownProps;\n const {\n id, chatId, viaBotId, replyToChatId, replyToMessageId, isOutgoing, threadInfo,\n } = message;\n\n const chat = selectChat(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isRepliesChat = isChatWithRepliesBot(chatId);\n const isChannel = chat && isChatChannel(chat);\n const chatUsername = chat?.username;\n\n const forceSenderName = !isChatWithSelf && isAnonymousOwnMessage(message);\n const canShowSender = withSenderName || withAvatar || forceSenderName;\n const sender = selectSender(global, message);\n const originSender = selectForwardedSender(global, message);\n const botSender = viaBotId ? selectUser(global, viaBotId) : undefined;\n\n const threadTopMessageId = threadId ? selectThreadTopMessageId(global, chatId, threadId) : undefined;\n const isThreadTop = message.id === threadTopMessageId;\n\n const shouldHideReply = replyToMessageId === threadTopMessageId;\n const replyMessage = replyToMessageId && !shouldHideReply\n ? selectChatMessage(global, isRepliesChat && replyToChatId ? replyToChatId : chatId, replyToMessageId)\n : undefined;\n const replyMessageSender = replyMessage && selectSender(global, replyMessage);\n\n const uploadProgress = selectUploadProgress(global, message);\n const isFocused = messageListType === 'thread' && (\n album\n ? album.messages.some((m) => selectIsMessageFocused(global, m))\n : selectIsMessageFocused(global, message)\n );\n\n const {\n direction: focusDirection, noHighlight: noFocusHighlight, isResizingContainer,\n } = (isFocused && focusedMessage) || {};\n\n const isForwarding = forwardMessages.messageIds && forwardMessages.messageIds.includes(id);\n\n const { query: highlight } = selectCurrentTextSearch(global) || {};\n\n const singleEmoji = getMessageSingleEmoji(message);\n let isSelected: boolean;\n\n if (album?.messages) {\n isSelected = album.messages.every(({ id: messageId }) => selectIsMessageSelected(global, messageId));\n } else {\n isSelected = selectIsMessageSelected(global, id);\n }\n\n const { canReply } = (messageListType === 'thread' && selectAllowedMessageActions(global, message, threadId)) || {};\n const isDownloading = selectIsDownloading(global, message);\n const actualThreadInfo = threadInfo\n ? selectThreadInfo(global, threadInfo.chatId, threadInfo.threadId) || threadInfo\n : undefined;\n\n const isInDocumentGroup = Boolean(message.groupedId) && !message.isInAlbum;\n const documentGroupFirstMessageId = isInDocumentGroup\n ? selectMessageIdsByGroupId(global, chatId, message.groupedId!)![0]\n : undefined;\n const reactionMessage = isInDocumentGroup ? (\n isLastInDocumentGroup ? selectChatMessage(global, chatId, documentGroupFirstMessageId!) : undefined\n ) : message;\n\n const localSticker = singleEmoji ? selectLocalAnimatedEmoji(global, singleEmoji) : undefined;\n\n return {\n theme: selectTheme(global),\n chatUsername,\n forceSenderName,\n sender: canShowSender ? sender : undefined,\n originSender,\n botSender,\n shouldHideReply,\n isThreadTop,\n replyMessage,\n replyMessageSender,\n isInDocumentGroup,\n isProtected: selectIsMessageProtected(global, message),\n isFocused,\n isForwarding,\n reactionMessage,\n isChatWithSelf,\n isRepliesChat,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n isSingleEmoji: Boolean(singleEmoji),\n animatedEmoji: singleEmoji ? selectAnimatedEmoji(global, singleEmoji) : undefined,\n animatedEmojiEffect: singleEmoji && isUserId(chatId) ? selectAnimatedEmojiEffect(global, singleEmoji) : undefined,\n animatedEmojiSoundId: singleEmoji ? selectAnimatedEmojiSound(global, singleEmoji) : undefined,\n localSticker,\n localEffect: localSticker && isUserId(chatId) ? selectLocalAnimatedEmojiEffect(localSticker) : undefined,\n isInSelectMode: selectIsInSelectMode(global),\n isSelected,\n isGroupSelected: (\n Boolean(message.groupedId)\n && !message.isInAlbum\n && selectIsDocumentGroupSelected(global, chatId, message.groupedId)\n ),\n threadId,\n isDownloading,\n isPinnedList: messageListType === 'pinned',\n canAutoLoadMedia: selectCanAutoLoadMedia(global, message),\n canAutoPlayMedia: selectCanAutoPlayMedia(global, message),\n autoLoadFileMaxSizeMb: global.settings.byKey.autoLoadFileMaxSizeMb,\n shouldLoopStickers: selectShouldLoopStickers(global),\n threadInfo: actualThreadInfo,\n availableReactions: global.availableReactions,\n defaultReaction: isMessageLocal(message) ? undefined : selectDefaultReaction(global, chatId),\n activeReaction: reactionMessage && global.activeReactions[reactionMessage.id],\n activeEmojiInteractions: global.activeEmojiInteractions,\n ...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),\n ...(typeof uploadProgress === 'number' && { uploadProgress }),\n ...(isFocused && { focusDirection, noFocusHighlight, isResizingContainer }),\n };\n },\n)(Message));\n","import React, { useCallback } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { IAlbum, MediaViewerOrigin } from '../../../../types';\nimport {\n ApiChat, ApiMessage, ApiUser, MAIN_THREAD_ID,\n} from '../../../../api/types';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport default function useInnerHandlers(\n lang: LangFn,\n selectMessage: (e: React.MouseEvent, groupedId?: string) => void,\n message: ApiMessage,\n chatId: string,\n threadId: number,\n isInDocumentGroup: boolean,\n asForwarded?: boolean,\n isScheduled?: boolean,\n isChatWithRepliesBot?: boolean,\n album?: IAlbum,\n avatarPeer?: ApiUser | ApiChat,\n senderPeer?: ApiUser | ApiChat,\n botSender?: ApiUser,\n) {\n const {\n openChat, showNotification, focusMessage, openMediaViewer, openAudioPlayer,\n markMessagesRead, cancelSendingMessage, sendPollVote, openForwardMenu, focusMessageInComments,\n } = getDispatch();\n\n const {\n id: messageId, forwardInfo, replyToMessageId, replyToChatId, replyToTopMessageId, groupedId,\n } = message;\n\n const handleAvatarClick = useCallback(() => {\n if (!avatarPeer) {\n return;\n }\n\n openChat({ id: avatarPeer.id });\n }, [avatarPeer, openChat]);\n\n const handleSenderClick = useCallback(() => {\n if (!senderPeer) {\n showNotification({ message: lang('HidAccount') });\n\n return;\n }\n\n if (asForwarded && forwardInfo?.channelPostId) {\n focusMessage({ chatId: senderPeer.id, messageId: forwardInfo.channelPostId });\n } else {\n openChat({ id: senderPeer.id });\n }\n }, [\n asForwarded, focusMessage, forwardInfo, lang, openChat, senderPeer, showNotification,\n ]);\n\n const handleViaBotClick = useCallback(() => {\n if (!botSender) {\n return;\n }\n\n openChat({ id: botSender.id });\n }, [botSender, openChat]);\n\n const handleReplyClick = useCallback((): void => {\n focusMessage({\n chatId: isChatWithRepliesBot && replyToChatId ? replyToChatId : chatId,\n threadId,\n messageId: replyToMessageId,\n replyMessageId: isChatWithRepliesBot && replyToChatId ? undefined : messageId,\n });\n }, [focusMessage, isChatWithRepliesBot, replyToChatId, chatId, threadId, replyToMessageId, messageId]);\n\n const handleMediaClick = useCallback((): void => {\n openMediaViewer({\n chatId, threadId, messageId, origin: isScheduled ? MediaViewerOrigin.ScheduledInline : MediaViewerOrigin.Inline,\n });\n }, [chatId, threadId, messageId, openMediaViewer, isScheduled]);\n\n const handleAudioPlay = useCallback((): void => {\n openAudioPlayer({ chatId, messageId });\n }, [chatId, messageId, openAudioPlayer]);\n\n const handleAlbumMediaClick = useCallback((albumMessageId: number): void => {\n openMediaViewer({\n chatId,\n threadId,\n messageId: albumMessageId,\n origin: isScheduled ? MediaViewerOrigin.ScheduledAlbum : MediaViewerOrigin.Album,\n });\n }, [chatId, threadId, openMediaViewer, isScheduled]);\n\n const handleReadMedia = useCallback((): void => {\n markMessagesRead({ messageIds: [messageId] });\n }, [messageId, markMessagesRead]);\n\n const handleCancelUpload = useCallback(() => {\n cancelSendingMessage({ chatId, messageId });\n }, [cancelSendingMessage, chatId, messageId]);\n\n const handleVoteSend = useCallback((options: string[]) => {\n sendPollVote({ chatId, messageId, options });\n }, [chatId, messageId, sendPollVote]);\n\n const handleGroupForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, groupedId });\n }, [openForwardMenu, chatId, groupedId]);\n\n const handleForward = useCallback(() => {\n if (album && album.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n }\n }, [album, openForwardMenu, chatId, messageId]);\n\n const handleFocus = useCallback(() => {\n focusMessage({\n chatId, threadId: MAIN_THREAD_ID, messageId,\n });\n }, [focusMessage, chatId, messageId]);\n\n const handleFocusForwarded = useCallback(() => {\n if (isInDocumentGroup) {\n focusMessage({\n chatId: forwardInfo!.fromChatId, groupedId, groupedChatId: chatId,\n });\n return;\n }\n\n if (isChatWithRepliesBot && replyToChatId) {\n focusMessageInComments({\n chatId: replyToChatId,\n threadId: replyToTopMessageId,\n messageId: forwardInfo!.fromMessageId,\n });\n } else {\n focusMessage({\n chatId: forwardInfo!.fromChatId, messageId: forwardInfo!.fromMessageId,\n });\n }\n }, [\n isInDocumentGroup, isChatWithRepliesBot, replyToChatId, focusMessage, forwardInfo, groupedId, chatId,\n focusMessageInComments, replyToTopMessageId,\n ]);\n\n const selectWithGroupedId = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n\n selectMessage(e, groupedId);\n }, [selectMessage, groupedId]);\n\n return {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick: selectWithGroupedId,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll: selectWithGroupedId,\n };\n}\n","import { RefObject } from 'react';\nimport React, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiSponsoredMessage, ApiUser } from '../../../api/types';\n\nimport { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities';\nimport { selectChat, selectSponsoredMessage, selectUser } from '../../../modules/selectors';\nimport { getChatTitle, getUserFullName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport Button from '../../ui/Button';\n\nimport './SponsoredMessage.scss';\n\ntype OwnProps = {\n chatId: string;\n containerRef: RefObject;\n};\n\ntype StateProps = {\n message?: ApiSponsoredMessage;\n bot?: ApiUser;\n channel?: ApiChat;\n};\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst SponsoredMessage: FC = ({\n chatId,\n message,\n containerRef,\n bot,\n channel,\n}) => {\n const {\n viewSponsoredMessage,\n openChat,\n openChatByInvite,\n startBot,\n focusMessage,\n } = getDispatch();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const contentRef = useRef(null);\n const shouldObserve = Boolean(message);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n threshold: 1,\n });\n\n useEffect(() => {\n return shouldObserve ? observeIntersection(contentRef.current!, (target) => {\n if (target.isIntersecting) {\n viewSponsoredMessage({ chatId });\n }\n }) : undefined;\n }, [chatId, shouldObserve, observeIntersection, viewSponsoredMessage]);\n\n if (!message) {\n return undefined;\n }\n\n const handleClick = () => {\n if (message.chatInviteHash) {\n openChatByInvite({ hash: message.chatInviteHash });\n } else if (message.channelPostId) {\n focusMessage({ chatId: message.chatId, messageId: message.channelPostId });\n } else {\n openChat({ id: message.chatId });\n\n if (message.startParam) {\n startBot({\n botId: message.chatId,\n param: message.startParam,\n });\n }\n }\n };\n\n return (\n
\n
\n
\n
\n {bot && renderText(getUserFullName(bot) || '')}\n {channel && renderText(message.chatInviteTitle || getChatTitle(lang, channel, bot) || '')}\n
\n\n

\n \n {renderTextWithEntities(message.text.text, message.text.entities)}\n \n\n \n {lang('SponsoredMessage')}\n \n

\n\n \n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const message = selectSponsoredMessage(global, chatId);\n const { chatId: fromChatId, isBot } = message || {};\n\n return {\n message,\n bot: fromChatId && isBot ? selectUser(global, fromChatId) : undefined,\n channel: !isBot && fromChatId ? selectChat(global, fromChatId) : undefined,\n };\n },\n)(SponsoredMessage));\n","import { RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport { SCHEDULED_WHEN_ONLINE } from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport { compact, flatten } from '../../util/iteratees';\nimport { formatHumanDate } from '../../util/dateFormat';\nimport { getMessageOriginalId, isActionMessage, isOwnMessage } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport { isAlbum, MessageDateGroup } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useScrollHooks from './hooks/useScrollHooks';\nimport useMessageObservers from './hooks/useMessageObservers';\n\nimport Message from './message/Message';\nimport SponsoredMessage from './message/SponsoredMessage';\nimport ActionMessage from './ActionMessage';\nimport { getDispatch } from '../../lib/teact/teactn';\n\ninterface OwnProps {\n chatId: string;\n messageIds: number[];\n messageGroups: MessageDateGroup[];\n isViewportNewest: boolean;\n isUnread: boolean;\n withUsers: boolean;\n noAvatars: boolean;\n containerRef: RefObject;\n anchorIdRef: { current: string | undefined };\n memoUnreadDividerBeforeIdRef: { current: number | undefined };\n memoFirstUnreadIdRef: { current: number | undefined };\n threadId: number;\n type: MessageListType;\n isReady: boolean;\n areReactionsInMeta: boolean;\n isScrollingRef: { current: boolean | undefined };\n isScrollPatchNeededRef: { current: boolean | undefined };\n threadTopMessageId: number | undefined;\n hasLinkedChat: boolean | undefined;\n isSchedule: boolean;\n noAppearanceAnimation: boolean;\n onFabToggle: AnyToVoidFunction;\n onNotchToggle: AnyToVoidFunction;\n}\n\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst MessageListContent: FC = ({\n chatId,\n messageIds,\n messageGroups,\n isViewportNewest,\n isUnread,\n withUsers,\n areReactionsInMeta,\n noAvatars,\n containerRef,\n anchorIdRef,\n memoUnreadDividerBeforeIdRef,\n memoFirstUnreadIdRef,\n threadId,\n type,\n isReady,\n isScrollingRef,\n isScrollPatchNeededRef,\n threadTopMessageId,\n hasLinkedChat,\n isSchedule,\n noAppearanceAnimation,\n onFabToggle,\n onNotchToggle,\n}) => {\n const { openHistoryCalendar } = getDispatch();\n\n const {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n } = useMessageObservers(type, containerRef, memoFirstUnreadIdRef);\n\n const {\n backwardsTriggerRef,\n forwardsTriggerRef,\n fabTriggerRef,\n } = useScrollHooks(\n type,\n containerRef,\n messageIds,\n isViewportNewest,\n isUnread,\n onFabToggle,\n onNotchToggle,\n isReady,\n isScrollingRef,\n isScrollPatchNeededRef,\n );\n\n const lang = useLang();\n\n const unreadDivider = (\n
\n {lang('UnreadMessages')}\n
\n );\n\n const messageCountToAnimate = noAppearanceAnimation ? 0 : messageGroups.reduce((acc, messageGroup) => {\n return acc + flatten(messageGroup.senderGroups).length;\n }, 0);\n let appearanceIndex = 0;\n\n const dateGroups = messageGroups.map((\n dateGroup: MessageDateGroup,\n dateGroupIndex: number,\n dateGroupsArray: MessageDateGroup[],\n ) => {\n const senderGroups = dateGroup.senderGroups.map((\n senderGroup,\n senderGroupIndex,\n senderGroupsArray,\n ) => {\n if (senderGroup.length === 1 && !isAlbum(senderGroup[0]) && isActionMessage(senderGroup[0])) {\n const message = senderGroup[0];\n const isLastInList = (\n senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n );\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n ]);\n }\n\n let currentDocumentGroupId: string | undefined;\n\n return flatten(senderGroup.map((\n messageOrAlbum,\n messageIndex,\n ) => {\n const message = isAlbum(messageOrAlbum) ? messageOrAlbum.mainMessage : messageOrAlbum;\n const album = isAlbum(messageOrAlbum) ? messageOrAlbum : undefined;\n const isOwn = isOwnMessage(message);\n const isMessageAlbum = isAlbum(messageOrAlbum);\n const nextMessage = senderGroup[messageIndex + 1];\n\n if (message.previousLocalId && anchorIdRef.current === `message${message.previousLocalId}`) {\n anchorIdRef.current = `message${message.id}`;\n }\n\n const documentGroupId = !isMessageAlbum && message.groupedId ? message.groupedId : undefined;\n const nextDocumentGroupId = nextMessage && !isAlbum(nextMessage) ? nextMessage.groupedId : undefined;\n\n const position = {\n isFirstInGroup: messageIndex === 0,\n isLastInGroup: messageIndex === senderGroup.length - 1,\n isFirstInDocumentGroup: Boolean(documentGroupId && documentGroupId !== currentDocumentGroupId),\n isLastInDocumentGroup: Boolean(documentGroupId && documentGroupId !== nextDocumentGroupId),\n isLastInList: (\n messageIndex === senderGroup.length - 1\n && senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n ),\n };\n\n currentDocumentGroupId = documentGroupId;\n\n const originalId = getMessageOriginalId(message);\n // Scheduled messages can have local IDs in the middle of the list,\n // and keys should be ordered, so we prefix it with a date.\n // However, this may lead to issues if server date is not synchronized with the local one.\n const key = type !== 'scheduled' ? originalId : `${message.date}_${originalId}`;\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n message.id === threadTopMessageId && (\n
\n {lang('DiscussionStarted')}\n
\n ),\n ]);\n }));\n });\n\n return (\n \n openHistoryCalendar({ selectedAt: dateGroup.datetime }) : undefined}\n >\n \n {isSchedule && dateGroup.originalDate === SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledUntilOnline')\n )}\n {isSchedule && dateGroup.originalDate !== SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledOn', formatHumanDate(lang, dateGroup.datetime, undefined, true))\n )}\n {!isSchedule && formatHumanDate(lang, dateGroup.datetime)}\n \n \n {flatten(senderGroups)}\n \n );\n });\n\n return (\n
\n
\n {flatten(dateGroups)}\n {isViewportNewest && }\n \n \n
\n );\n};\n\nexport default memo(MessageListContent);\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { LoadMoreDirection } from '../../../types';\nimport { MessageListType } from '../../../global/types';\n\nimport { LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../../config';\nimport { IS_SCROLL_PATCH_NEEDED, MESSAGE_LIST_SENSITIVE_AREA } from '../../../util/environment';\nimport { debounce } from '../../../util/schedulers';\nimport { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useOnChange from '../../../hooks/useOnChange';\n\nconst FAB_THRESHOLD = 50;\nconst NOTCH_THRESHOLD = 1; // Notch has zero height so we at least need a 1px margin to intersect\nconst TOOLS_FREEZE_TIMEOUT = 250; // Approximate message sending animation duration\n\nexport default function useScrollHooks(\n type: MessageListType,\n containerRef: RefObject,\n messageIds: number[],\n isViewportNewest: boolean,\n isUnread: boolean,\n onFabToggle: AnyToVoidFunction,\n onNotchToggle: AnyToVoidFunction,\n isReady: boolean,\n isScrollingRef: { current: boolean | undefined },\n isScrollPatchNeededRef: { current: boolean | undefined },\n) {\n const { loadViewportMessages } = getDispatch();\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(\n () => (type === 'thread' ? [\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Backwards }), 1000, true, false),\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Forwards }), 1000, true, false),\n ] : []),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [loadViewportMessages, messageIds],\n );\n\n // eslint-disable-next-line no-null/no-null\n const backwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const forwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const fabTriggerRef = useRef(null);\n\n function toggleScrollTools() {\n if (!isReady) return;\n\n if (!messageIds || !messageIds.length) {\n onFabToggle(false);\n onNotchToggle(false);\n return;\n }\n\n if (!isViewportNewest) {\n onFabToggle(true);\n onNotchToggle(true);\n return;\n }\n\n if (!containerRef.current) {\n return;\n }\n\n const { offsetHeight, scrollHeight, scrollTop } = containerRef.current;\n const scrollBottom = Math.round(scrollHeight - scrollTop - offsetHeight);\n const isNearBottom = scrollBottom <= FAB_THRESHOLD;\n const isAtBottom = scrollBottom <= NOTCH_THRESHOLD;\n\n onFabToggle(isUnread ? !isAtBottom : !isNearBottom);\n onNotchToggle(!isAtBottom);\n }\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: MESSAGE_LIST_SENSITIVE_AREA,\n }, (entries) => {\n if (!loadMoreForwards || !loadMoreBackwards) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isFirstMessageLocal = messageIds[0] >= LOCAL_MESSAGE_ID_BASE;\n if (isFirstMessageLocal) {\n return;\n }\n\n const triggerEntry = entries.find(({ isIntersecting }) => isIntersecting);\n if (!triggerEntry) {\n return;\n }\n\n const { target } = triggerEntry;\n\n if (target.className === 'backwards-trigger') {\n if (\n IS_SCROLL_PATCH_NEEDED && isScrollingRef.current && messageIds.length <= MESSAGE_LIST_SLICE\n ) {\n isScrollPatchNeededRef.current = true;\n }\n\n loadMoreBackwards();\n } else if (target.className === 'forwards-trigger') {\n loadMoreForwards();\n }\n });\n\n useOnIntersect(backwardsTriggerRef, observeIntersection);\n useOnIntersect(forwardsTriggerRef, observeIntersection);\n\n const {\n observe: observeIntersectionForFab,\n freeze: freezeForFab,\n unfreeze: unfreezeForFab,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: FAB_THRESHOLD * 2,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForFab);\n\n const {\n observe: observeIntersectionForNotch,\n freeze: freezeForNotch,\n unfreeze: unfreezeForNotch,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: NOTCH_THRESHOLD,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForNotch);\n\n useOnChange(() => {\n if (isReady) {\n toggleScrollTools();\n }\n }, [isReady]);\n\n // Workaround for FAB and notch flickering with tall incoming message\n useOnChange(() => {\n freezeForFab();\n freezeForNotch();\n\n setTimeout(() => {\n unfreezeForNotch();\n unfreezeForFab();\n }, TOOLS_FREEZE_TIMEOUT);\n }, [messageIds]);\n\n return { backwardsTriggerRef, forwardsTriggerRef, fabTriggerRef };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport { selectChat } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport { getUserIdDividend } from '../../modules/helpers';\n\nimport StickerButton from '../common/StickerButton';\n\nimport './ContactGreeting.scss';\n\ntype OwnProps = {\n userId: string;\n};\n\ntype StateProps = {\n sticker?: ApiSticker;\n lastUnreadMessageId?: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst ContactGreeting: FC = ({\n sticker,\n connectionState,\n lastUnreadMessageId,\n}) => {\n const {\n loadGreetingStickers,\n sendMessage,\n markMessageListRead,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n });\n useEffect(() => {\n if (sticker || connectionState !== 'connectionStateReady') {\n return;\n }\n\n loadGreetingStickers();\n }, [connectionState, loadGreetingStickers, sticker]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && lastUnreadMessageId) {\n markMessageListRead({ maxId: lastUnreadMessageId });\n }\n }, [connectionState, markMessageListRead, lastUnreadMessageId]);\n\n const handleStickerSelect = useCallback((selectedSticker: ApiSticker) => {\n selectedSticker = {\n ...selectedSticker,\n isPreloadedGlobally: true,\n };\n sendMessage({ sticker: selectedSticker });\n }, [sendMessage]);\n\n return (\n
\n
\n

{lang('Conversation.EmptyPlaceholder')}

\n

{lang('Conversation.GreetingText')}

\n\n
\n {sticker && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const { stickers } = global.stickers.greeting;\n const dividend = getUserIdDividend(userId) + getUserIdDividend(global.currentUserId!);\n const sticker = stickers?.length ? stickers[dividend % stickers.length] : undefined;\n const chat = selectChat(global, userId);\n if (!chat) {\n return {};\n }\n\n return {\n sticker,\n lastUnreadMessageId: chat.lastMessage && chat.lastMessage.id !== chat.lastReadInboxMessageId\n ? chat.lastMessage.id\n : undefined,\n connectionState: global.connectionState,\n };\n },\n)(ContactGreeting));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport './NoMessages.scss';\n\ntype OwnProps = {\n chatId: string;\n isChatWithSelf?: boolean;\n type: MessageListType;\n isGroupChatJustCreated?: boolean;\n};\n\nconst NoMessages: FC = ({\n isChatWithSelf, type, isGroupChatJustCreated,\n}) => {\n const lang = useLang();\n\n if (type === 'scheduled') {\n return renderScheduled(lang);\n }\n\n if (isChatWithSelf) {\n return renderSavedMessages(lang);\n }\n\n if (isGroupChatJustCreated) {\n return renderGroup(lang);\n }\n\n return (\n
{lang('NoMessages')}
\n );\n};\n\nfunction renderScheduled(lang: LangFn) {\n return (\n
{lang('ScheduledMessages.EmptyPlaceholder')}
\n );\n}\n\nfunction renderSavedMessages(lang: LangFn) {\n return (\n
\n
\n \n

{lang('Conversation.CloudStorageInfo.Title')}

\n
    \n
  • {lang('Conversation.ClousStorageInfo.Description1')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description2')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description3')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description4')}
  • \n
\n
\n
\n );\n}\n\nfunction renderGroup(lang: LangFn) {\n return (\n
\n
\n

{lang('EmptyGroupInfo.Title')}

\n

{lang('EmptyGroupInfo.Subtitle')}

\n
    \n
  • {lang('EmptyGroupInfo.Line1')}
  • \n
  • {lang('EmptyGroupInfo.Line2')}
  • \n
  • {lang('EmptyGroupInfo.Line3')}
  • \n
  • {lang('EmptyGroupInfo.Line4')}
  • \n
\n
\n
\n );\n}\n\nexport default memo(NoMessages);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { MessageListType } from '../../global/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport { ANIMATION_END_DELAY, LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../config';\nimport {\n selectChatMessages,\n selectIsViewportNewest,\n selectFirstUnreadId,\n selectFocusedMessageId,\n selectChat,\n selectIsInSelectMode,\n selectIsChatWithSelf,\n selectChatBot,\n selectIsChatBotNotStarted,\n selectScrollOffset,\n selectThreadTopMessageId,\n selectFirstMessageId,\n selectScheduledMessages,\n selectCurrentMessageIds,\n} from '../../modules/selectors';\nimport {\n isChatChannel,\n isUserId,\n isChatWithRepliesBot,\n isChatGroup,\n} from '../../modules/helpers';\nimport { orderBy } from '../../util/iteratees';\nimport { fastRaf, debounce, onTickEnd } from '../../util/schedulers';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport buildClassName from '../../util/buildClassName';\nimport { groupMessages } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useOnChange from '../../hooks/useOnChange';\nimport useStickyDates from './hooks/useStickyDates';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport resetScroll, { patchChromiumScroll } from '../../util/resetScroll';\nimport fastSmoothScroll, { isAnimatingScroll } from '../../util/fastSmoothScroll';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useInterval from '../../hooks/useInterval';\nimport useNativeCopySelectedMessages from '../../hooks/useNativeCopySelectedMessages';\n\nimport Loading from '../ui/Loading';\nimport MessageListContent from './MessageListContent';\nimport ContactGreeting from './ContactGreeting';\nimport NoMessages from './NoMessages';\n\nimport './MessageList.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n type: MessageListType;\n canPost: boolean;\n isReady: boolean;\n onFabToggle: (shouldShow: boolean) => void;\n onNotchToggle: (shouldShow: boolean) => void;\n hasTools?: boolean;\n withBottomShift?: boolean;\n};\n\ntype StateProps = {\n isChatLoaded?: boolean;\n isChannelChat?: boolean;\n isGroupChat?: boolean;\n isChatWithSelf?: boolean;\n isRepliesChat?: boolean;\n isCreator?: boolean;\n isBot?: boolean;\n messageIds?: number[];\n messagesById?: Record;\n firstUnreadId?: number;\n isViewportNewest?: boolean;\n isRestricted?: boolean;\n restrictionReason?: ApiRestrictionReason;\n focusingId?: number;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n lastMessage?: ApiMessage;\n botDescription?: string;\n threadTopMessageId?: number;\n threadFirstMessageId?: number;\n hasLinkedChat?: boolean;\n lastSyncTime?: number;\n};\n\nconst MESSAGE_REACTIONS_POLLING_INTERVAL = 15 * 1000;\nconst BOTTOM_THRESHOLD = 20;\nconst UNREAD_DIVIDER_TOP = 10;\nconst UNREAD_DIVIDER_TOP_WITH_TOOLS = 60;\nconst SCROLL_DEBOUNCE = 200;\nconst MESSAGE_ANIMATION_DURATION = 500;\nconst BOTTOM_FOCUS_MARGIN = 20;\nconst SELECT_MODE_ANIMATION_DURATION = 200;\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst runDebouncedForScroll = debounce((cb) => cb(), SCROLL_DEBOUNCE, false);\n\nconst MessageList: FC = ({\n chatId,\n threadId,\n type,\n hasTools,\n onFabToggle,\n onNotchToggle,\n isChatLoaded,\n isChannelChat,\n isGroupChat,\n canPost,\n isReady,\n isChatWithSelf,\n isRepliesChat,\n isCreator,\n isBot,\n messageIds,\n messagesById,\n firstUnreadId,\n isViewportNewest,\n threadFirstMessageId,\n isRestricted,\n restrictionReason,\n focusingId,\n isSelectModeActive,\n lastMessage,\n botDescription,\n threadTopMessageId,\n hasLinkedChat,\n lastSyncTime,\n withBottomShift,\n}) => {\n const {\n loadViewportMessages, setScrollOffset, loadSponsoredMessages, loadMessageReactions, copyMessagesByIds,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n // We update local cached `scrollOffsetRef` when opening chat.\n // Then we update global version every second on scrolling.\n const scrollOffsetRef = useRef((type === 'thread' && selectScrollOffset(getGlobal(), chatId, threadId)) || 0);\n const anchorIdRef = useRef();\n const anchorTopRef = useRef();\n const listItemElementsRef = useRef();\n const memoFirstUnreadIdRef = useRef();\n const memoUnreadDividerBeforeIdRef = useRef();\n const memoFocusingIdRef = useRef();\n const isScrollTopJustUpdatedRef = useRef(false);\n const shouldAnimateAppearanceRef = useRef(Boolean(lastMessage));\n\n const [containerHeight, setContainerHeight] = useState();\n\n const areMessagesLoaded = Boolean(messageIds);\n\n useOnChange(() => {\n // We only need it first time when message list appears\n if (areMessagesLoaded) {\n onTickEnd(() => {\n shouldAnimateAppearanceRef.current = false;\n });\n }\n }, [areMessagesLoaded]);\n\n // Updated every time (to be used from intersection callback closure)\n useOnChange(() => {\n memoFirstUnreadIdRef.current = firstUnreadId;\n }, [firstUnreadId]);\n\n useOnChange(() => {\n if (isChannelChat && isReady && lastSyncTime) {\n loadSponsoredMessages({ chatId });\n }\n }, [chatId, isReady, isChannelChat, lastSyncTime]);\n\n // Updated only once when messages are loaded (as we want the unread divider to keep its position)\n useOnChange(() => {\n if (areMessagesLoaded) {\n memoUnreadDividerBeforeIdRef.current = memoFirstUnreadIdRef.current;\n }\n }, [areMessagesLoaded]);\n\n useOnChange(() => {\n memoFocusingIdRef.current = focusingId;\n }, [focusingId]);\n\n useNativeCopySelectedMessages(copyMessagesByIds);\n\n const messageGroups = useMemo(() => {\n if (!messageIds || !messagesById) {\n return undefined;\n }\n\n const viewportIds = threadTopMessageId && (!messageIds[0] || threadFirstMessageId === messageIds[0])\n ? [threadTopMessageId, ...messageIds]\n : messageIds;\n\n if (!viewportIds.length) {\n return undefined;\n }\n\n const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean);\n return groupMessages(orderBy(listedMessages, ['date', 'id']), memoUnreadDividerBeforeIdRef.current);\n }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId]);\n\n useInterval(() => {\n if (!messageIds || !messagesById) {\n return;\n }\n const ids = messageIds.filter((l) => messagesById[l]?.reactions);\n\n if (!ids.length) return;\n\n loadMessageReactions({ chatId, ids });\n }, MESSAGE_REACTIONS_POLLING_INTERVAL);\n\n const loadMoreAround = useMemo(() => {\n if (type !== 'thread') {\n return undefined;\n }\n\n return debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Around }), 1000, true, false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [loadViewportMessages, messageIds]);\n\n const { isScrolled, updateStickyDates } = useStickyDates();\n\n const isScrollingRef = useRef();\n const isScrollPatchNeededRef = useRef();\n\n const handleScroll = useCallback(() => {\n if (isScrollTopJustUpdatedRef.current) {\n isScrollTopJustUpdatedRef.current = false;\n return;\n }\n\n isScrollingRef.current = true;\n\n const container = containerRef.current!;\n\n if (!memoFocusingIdRef.current) {\n updateStickyDates(container, hasTools);\n }\n\n runDebouncedForScroll(() => {\n isScrollingRef.current = false;\n\n fastRaf(() => {\n if (!container.parentElement) {\n return;\n }\n\n scrollOffsetRef.current = container.scrollHeight - container.scrollTop;\n\n if (type === 'thread') {\n setScrollOffset({ chatId, threadId, scrollOffset: scrollOffsetRef.current });\n }\n });\n });\n }, [updateStickyDates, hasTools, type, setScrollOffset, chatId, threadId]);\n\n // Container resize observer (caused by Composer reply/webpage panels)\n useEffect(() => {\n if (!('ResizeObserver' in window) || process.env.APP_ENV === 'perf') {\n return undefined;\n }\n\n const observer = new ResizeObserver(([entry]) => {\n // During animation\n if (!(entry.target as HTMLDivElement).offsetParent) {\n return;\n }\n\n setContainerHeight(entry.contentRect.height);\n });\n\n observer.observe(containerRef.current!);\n\n return () => {\n observer.disconnect();\n };\n }, []);\n\n // Memorize height for scroll animation\n const { height: windowHeight } = useWindowSize();\n\n useEffect(() => {\n containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight);\n }, [windowHeight, canPost]);\n\n // Initial message loading\n useEffect(() => {\n if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isLastMessageLocal = messageIds && messageIds[messageIds.length - 1] >= LOCAL_MESSAGE_ID_BASE;\n if (isLastMessageLocal) {\n return;\n }\n\n const container = containerRef.current!;\n\n if (!messageIds || (\n messageIds.length < MESSAGE_LIST_SLICE / 2\n && (container.firstElementChild as HTMLDivElement).clientHeight <= container.offsetHeight\n )) {\n loadMoreAround();\n }\n }, [isChatLoaded, messageIds, loadMoreAround, focusingId, isRestricted]);\n\n // Remember scroll position before repositioning it\n useOnChange(() => {\n if (!messageIds || !listItemElementsRef.current) {\n return;\n }\n\n const preservedItemElements = listItemElementsRef.current\n .filter((element) => messageIds.includes(Number(element.dataset.messageId)));\n\n // We avoid the very first item as it may be a partly-loaded album\n // and also because it may be removed when messages limit is reached\n const anchor = preservedItemElements[1] || preservedItemElements[0];\n if (!anchor) {\n return;\n }\n\n anchorIdRef.current = anchor.id;\n anchorTopRef.current = anchor.getBoundingClientRect().top;\n // This should match deps for `useLayoutEffectWithPrevDeps` below\n }, [messageIds, isViewportNewest, containerHeight, hasTools]);\n\n // Handles updated message list, takes care of scroll repositioning\n useLayoutEffectWithPrevDeps(([\n prevMessageIds, prevIsViewportNewest, prevContainerHeight,\n ]) => {\n const container = containerRef.current!;\n listItemElementsRef.current = Array.from(container.querySelectorAll('.message-list-item'));\n\n const hasLastMessageChanged = (\n messageIds && prevMessageIds && messageIds[messageIds.length - 1] !== prevMessageIds[prevMessageIds.length - 1]\n );\n const hasViewportShifted = (\n messageIds?.[0] !== prevMessageIds?.[0] && messageIds?.length === (MESSAGE_LIST_SLICE / 2 + 1)\n );\n const wasMessageAdded = hasLastMessageChanged && !hasViewportShifted;\n const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];\n\n // Add extra height when few messages to allow smooth scroll animation. Uses assumption that `parentElement`\n // is a Transition slide and its CSS class can not be reset in a declarative way.\n const shouldForceScroll = (\n isViewportNewest\n && wasMessageAdded\n && (messageIds && messageIds.length < MESSAGE_LIST_SLICE / 2)\n && !container.parentElement!.classList.contains('force-messages-scroll')\n && (container.firstElementChild as HTMLDivElement)!.clientHeight <= container.offsetHeight * 2\n );\n\n if (shouldForceScroll) {\n container.parentElement!.classList.add('force-messages-scroll');\n\n setTimeout(() => {\n if (container.parentElement) {\n container.parentElement.classList.remove('force-messages-scroll');\n }\n }, MESSAGE_ANIMATION_DURATION);\n }\n\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const scrollOffset = scrollOffsetRef.current;\n const lastItemElement = listItemElementsRef.current[listItemElementsRef.current.length - 1];\n\n let bottomOffset = scrollOffset - (prevContainerHeight || offsetHeight);\n if (wasMessageAdded) {\n // If two new messages come at once (e.g. when bot responds) then the first message will update `scrollOffset`\n // right away (before animation) which creates inconsistency until the animation completes. To workaround that,\n // we calculate `isAtBottom` with a \"buffer\" of the latest message height (this is approximate).\n const lastItemHeight = lastItemElement ? lastItemElement.offsetHeight : 0;\n bottomOffset -= lastItemHeight;\n }\n const isAtBottom = isViewportNewest && prevIsViewportNewest && bottomOffset <= BOTTOM_THRESHOLD;\n\n let newScrollTop!: number;\n\n if (wasMessageAdded && isAtBottom && !isAlreadyFocusing) {\n if (lastItemElement) {\n fastRaf(() => {\n fastSmoothScroll(\n container,\n lastItemElement,\n 'end',\n BOTTOM_FOCUS_MARGIN,\n );\n });\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n scrollOffsetRef.current = Math.max(Math.ceil(scrollHeight - newScrollTop), offsetHeight);\n\n // Scroll still needs to be restored after container resize\n if (!shouldForceScroll) {\n return;\n }\n }\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.time('scrollTop');\n }\n\n const isResized = prevContainerHeight !== undefined && prevContainerHeight !== containerHeight;\n const anchor = anchorIdRef.current && container.querySelector(`#${anchorIdRef.current}`);\n const unreadDivider = (\n !anchor\n && memoUnreadDividerBeforeIdRef.current\n && container.querySelector(`.${UNREAD_DIVIDER_CLASS}`)\n );\n\n if (isAtBottom && isResized) {\n if (isAnimatingScroll()) {\n return;\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n } else if (anchor) {\n if (isScrollPatchNeededRef.current) {\n isScrollPatchNeededRef.current = false;\n patchChromiumScroll(container);\n }\n\n const newAnchorTop = anchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));\n } else if (unreadDivider) {\n newScrollTop = Math.min(\n unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP),\n scrollHeight - scrollOffset,\n );\n } else {\n newScrollTop = scrollHeight - scrollOffset;\n }\n\n resetScroll(container, Math.ceil(newScrollTop));\n\n if (!memoFocusingIdRef.current) {\n isScrollTopJustUpdatedRef.current = true;\n fastRaf(() => {\n isScrollTopJustUpdatedRef.current = false;\n });\n }\n\n scrollOffsetRef.current = Math.max(Math.ceil(scrollHeight - newScrollTop), offsetHeight);\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.timeEnd('scrollTop');\n }\n // This should match deps for `useOnChange` above\n }, [messageIds, isViewportNewest, containerHeight, hasTools] as const);\n\n useEffectWithPrevDeps(([prevIsSelectModeActive]) => {\n if (prevIsSelectModeActive !== undefined) {\n dispatchHeavyAnimationEvent(SELECT_MODE_ANIMATION_DURATION + ANIMATION_END_DELAY);\n }\n }, [isSelectModeActive]);\n\n const lang = useLang();\n\n const isPrivate = Boolean(chatId && isUserId(chatId));\n const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf || isRepliesChat);\n const noAvatars = Boolean(!withUsers || isChannelChat);\n const shouldRenderGreeting = isUserId(chatId) && !isChatWithSelf && !isBot\n && (\n (\n !messageGroups && !lastMessage && messageIds\n // Used to avoid flickering when deleting a greeting that has just been sent\n && (!listItemElementsRef.current || listItemElementsRef.current.length === 0)\n )\n || (messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'contactSignUp')\n || (lastMessage?.content?.action?.type === 'contactSignUp')\n );\n\n const isGroupChatJustCreated = isGroupChat && isCreator\n && messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'chatCreate';\n\n const className = buildClassName(\n 'MessageList custom-scroll',\n noAvatars && 'no-avatars',\n !canPost && 'no-composer',\n type === 'pinned' && 'type-pinned',\n withBottomShift && 'with-bottom-shift',\n isSelectModeActive && 'select-mode-active',\n isScrolled && 'scrolled',\n !isReady && 'is-animating',\n );\n\n return (\n \n {isRestricted ? (\n
\n \n {restrictionReason ? restrictionReason.text : `This is a private ${isChannelChat ? 'channel' : 'chat'}`}\n \n
\n ) : botDescription ? (\n
{renderText(lang(botDescription), ['br', 'emoji', 'links'])}
\n ) : shouldRenderGreeting ? (\n \n ) : messageIds && (!messageGroups || isGroupChatJustCreated) ? (\n \n ) : ((messageIds && messageGroups) || lastMessage) ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, type }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const messageIds = selectCurrentMessageIds(global, chatId, threadId, type);\n const messagesById = type === 'scheduled'\n ? selectScheduledMessages(global, chatId)\n : selectChatMessages(global, chatId);\n const threadTopMessageId = selectThreadTopMessageId(global, chatId, threadId);\n\n if (\n threadId !== MAIN_THREAD_ID\n && !(messagesById && threadTopMessageId && messagesById[threadTopMessageId])\n ) {\n return {};\n }\n\n const { isRestricted, restrictionReason, lastMessage } = chat;\n const focusingId = selectFocusedMessageId(global, chatId);\n\n const withLastMessageWhenPreloading = (\n threadId === MAIN_THREAD_ID\n && !messageIds && !chat.unreadCount && !focusingId && lastMessage && !lastMessage.groupedId\n );\n\n const chatBot = selectChatBot(global, chatId)!;\n let botDescription: string | undefined;\n if (selectIsChatBotNotStarted(global, chatId)) {\n if (chatBot.fullInfo) {\n botDescription = chatBot.fullInfo.botDescription || 'NoMessages';\n } else {\n botDescription = 'Updating bot info...';\n }\n }\n\n return {\n isChatLoaded: true,\n isRestricted,\n restrictionReason,\n isChannelChat: isChatChannel(chat),\n isGroupChat: isChatGroup(chat),\n isCreator: chat.isCreator,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isRepliesChat: isChatWithRepliesBot(chatId),\n isBot: Boolean(chatBot),\n messageIds,\n messagesById,\n firstUnreadId: selectFirstUnreadId(global, chatId, threadId),\n isViewportNewest: type !== 'thread' || selectIsViewportNewest(global, chatId, threadId),\n threadFirstMessageId: selectFirstMessageId(global, chatId, threadId),\n focusingId,\n isSelectModeActive: selectIsInSelectMode(global),\n botDescription,\n threadTopMessageId,\n hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)\n ? Boolean(chat.fullInfo.linkedChatId)\n : undefined,\n lastSyncTime: global.lastSyncTime,\n ...(withLastMessageWhenPreloading && { lastMessage }),\n };\n },\n)(MessageList));\n","import { useEffect } from '../lib/teact/teact';\nimport { IS_MAC_OS } from '../util/environment';\nimport getKeyFromEvent from '../util/getKeyFromEvent';\nimport getMessageIdsForSelectedText from '../util/getMessageIdsForSelectedText';\n\nconst useNativeCopySelectedMessages = (copyMessagesByIds: ({ messageIds }: { messageIds?: number[] }) => void) => {\n useEffect(() => {\n function handleCopy(e: KeyboardEvent) {\n if (((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && getKeyFromEvent(e) === 'c') {\n const messageIds = getMessageIdsForSelectedText();\n\n if (messageIds && messageIds.length > 0) {\n e.preventDefault();\n copyMessagesByIds({ messageIds });\n }\n }\n }\n\n document.addEventListener('keydown', handleCopy, false);\n\n return () => {\n document.removeEventListener('keydown', handleCopy, false);\n };\n }, [copyMessagesByIds]);\n};\n\nexport default useNativeCopySelectedMessages;\n","import { useCallback } from '../../../lib/teact/teact';\n\nimport { fastRaf } from '../../../util/schedulers';\nimport useDebounce from '../../../hooks/useDebounce';\nimport useFlag from '../../../hooks/useFlag';\n\nconst DEBOUNCE = 1000;\nconst STICKY_TOP = 10;\nconst STICKY_TOP_WITH_TOOLS = 60;\n\nexport default function useStickyDates() {\n // For some reason we can not synchronously hide a sticky element (from `useLayoutEffect`) when chat opens\n // so we will add `position: sticky` only after first scroll. There would be no animation on the first show though.\n const [isScrolled, markIsScrolled] = useFlag(false);\n\n const runDebounced = useDebounce(DEBOUNCE, true);\n\n const updateStickyDates = useCallback((container: HTMLDivElement, hasTools?: boolean) => {\n markIsScrolled();\n\n if (!document.body.classList.contains('is-scrolling-messages')) {\n fastRaf(() => {\n document.body.classList.add('is-scrolling-messages');\n });\n }\n\n runDebounced(() => {\n fastRaf(() => {\n const currentStuck = document.querySelector('.stuck');\n if (currentStuck) {\n currentStuck.classList.remove('stuck');\n }\n\n const stuckDateEl = findStuckDate(container, hasTools);\n if (stuckDateEl) {\n stuckDateEl.classList.add('stuck');\n }\n\n document.body.classList.remove('is-scrolling-messages');\n });\n });\n }, [markIsScrolled, runDebounced]);\n\n return {\n isScrolled,\n updateStickyDates,\n };\n}\n\nfunction findStuckDate(container: HTMLElement, hasTools?: boolean) {\n const allElements = container.querySelectorAll('.sticky-date');\n const containerTop = container.scrollTop;\n\n return Array.from(allElements).find((el) => {\n const { offsetTop, offsetHeight } = el;\n const top = offsetTop - containerTop;\n return -offsetHeight <= top && top <= (hasTools ? STICKY_TOP_WITH_TOOLS : STICKY_TOP);\n });\n}\n","import React, {\n FC, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\n\nimport { selectChat, selectCurrentMessageList } from '../../modules/selectors';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport fastSmoothScroll from '../../util/fastSmoothScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ScrollDownButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n canPost?: boolean;\n withExtraShift?: boolean;\n};\n\ntype StateProps = {\n messageListType?: MessageListType;\n unreadCount?: number;\n};\n\nconst FOCUS_MARGIN = 20;\n\nconst ScrollDownButton: FC = ({\n isShown,\n canPost,\n messageListType,\n unreadCount,\n withExtraShift,\n}) => {\n const { focusNextReply } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const elementRef = useRef(null);\n\n const handleClick = useCallback(() => {\n if (!isShown) {\n return;\n }\n\n if (messageListType === 'thread') {\n focusNextReply();\n } else {\n const messagesContainer = elementRef.current!.parentElement!.querySelector('.MessageList')!;\n const messageElements = messagesContainer.querySelectorAll('.message-list-item');\n const lastMessageElement = messageElements[messageElements.length - 1];\n if (!lastMessageElement) {\n return;\n }\n\n fastSmoothScroll(messagesContainer, lastMessageElement, 'end', FOCUS_MARGIN);\n }\n }, [isShown, messageListType, focusNextReply]);\n\n const fabClassName = buildClassName(\n 'ScrollDownButton',\n isShown && 'revealed',\n !canPost && 'no-composer',\n withExtraShift && 'with-extra-shift',\n );\n\n return (\n
\n
\n \n \n \n {Boolean(unreadCount) && (\n
{formatIntegerCompact(unreadCount!)}
\n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return {};\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n\n return {\n messageListType,\n unreadCount: chat && threadId === MAIN_THREAD_ID && messageListType === 'thread' ? chat.unreadCount : undefined,\n };\n },\n)(ScrollDownButton));\n","import { ApiAttachment } from '../../../../api/types';\nimport { SUPPORTED_IMAGE_CONTENT_TYPES, SUPPORTED_VIDEO_CONTENT_TYPES } from '../../../../config';\nimport {\n preloadImage,\n preloadVideo,\n createPosterForVideo,\n fetchBlob,\n} from '../../../../util/files';\nimport { scaleImage } from '../../../../util/imageResize';\n\nconst MAX_QUICK_IMG_SIZE = 1280; // px\nconst FILE_EXT_REGEX = /\\.[^/.]+$/;\n\nexport default async function buildAttachment(\n filename: string, blob: Blob, isQuick: boolean, options?: Partial,\n): Promise {\n const blobUrl = URL.createObjectURL(blob);\n const { type: mimeType, size } = blob;\n let quick;\n let previewBlobUrl;\n\n if (SUPPORTED_IMAGE_CONTENT_TYPES.has(mimeType)) {\n if (isQuick) {\n const img = await preloadImage(blobUrl);\n const { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE || mimeType !== 'image/jpeg') {\n const resizedUrl = await scaleImage(blobUrl, MAX_QUICK_IMG_SIZE / Math.max(width, height), 'image/jpeg');\n URL.revokeObjectURL(blobUrl);\n const newBlob = await fetchBlob(resizedUrl);\n return buildAttachment(filename, newBlob, true, options);\n }\n\n if (mimeType === 'image/jpeg') {\n filename = filename.replace(FILE_EXT_REGEX, '.jpg');\n }\n\n quick = { width, height };\n } else {\n previewBlobUrl = blobUrl;\n }\n } else if (SUPPORTED_VIDEO_CONTENT_TYPES.has(mimeType)) {\n const { videoWidth: width, videoHeight: height, duration } = await preloadVideo(blobUrl);\n quick = { width, height, duration };\n\n previewBlobUrl = await createPosterForVideo(blobUrl);\n }\n\n return {\n blobUrl,\n filename,\n mimeType,\n size,\n quick,\n previewBlobUrl,\n ...options,\n };\n}\n","export default function insertHtmlInSelection(html: string) {\n const selection = window.getSelection();\n\n if (selection?.getRangeAt && selection.rangeCount) {\n const range = selection.getRangeAt(0);\n range.deleteContents();\n\n const fragment = range.createContextualFragment(html);\n const lastInsertedNode = fragment.lastChild;\n range.insertNode(fragment);\n if (lastInsertedNode) {\n range.setStartAfter(lastInsertedNode);\n range.setEndAfter(lastInsertedNode);\n } else {\n range.collapse(false);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet resetInput: HTMLInputElement;\n\nif (IS_IOS) {\n resetInput = document.createElement('input');\n resetInput.classList.add('for-ios-autocapitalization-fix');\n document.body.appendChild(resetInput);\n}\n\n// https://stackoverflow.com/a/55652503\nexport default function applyIosAutoCapitalizationFix(inputEl: HTMLElement) {\n resetInput.focus();\n inputEl.focus();\n}\n","import { IOpusRecorder } from 'opus-recorder';\n\nexport type Result = { blob: Blob; duration: number; waveform: number[] };\n\nconst encoderPath = new URL('opus-recorder/dist/encoderWorker.min', import.meta.url).href;\nconst MIN_RECORDING_TIME = 1000;\nconst POLYFILL_OPTIONS = { encoderPath, reuseWorker: true };\nconst BLOB_PARAMS = { type: 'audio/ogg' };\nconst FFT_SIZE = 64;\nconst MIN_VOLUME = 0.1;\n\nlet opusRecorderPromise: Promise<{ default: IOpusRecorder }>;\nlet OpusRecorder: IOpusRecorder;\nlet mediaRecorder: IOpusRecorder;\n\nexport async function init() {\n if (!opusRecorderPromise) {\n opusRecorderPromise = import('opus-recorder');\n OpusRecorder = (await opusRecorderPromise).default;\n mediaRecorder = new OpusRecorder(POLYFILL_OPTIONS);\n }\n\n return opusRecorderPromise;\n}\n\nexport async function start(analyzerCallback: Function) {\n await startMediaRecorder();\n\n const startedAt = Date.now();\n let pausedAt: number;\n const chunks: Uint8Array[] = [];\n const waveform: number[] = [];\n\n mediaRecorder.ondataavailable = (typedArray) => {\n chunks.push(typedArray);\n };\n\n const releaseAnalyzer = subscribeToAnalyzer(mediaRecorder, (volume: number) => {\n waveform.push(volume * 255);\n analyzerCallback(volume);\n });\n\n return {\n stop: () => new Promise((resolve, reject) => {\n mediaRecorder.onstop = () => {\n resolve({\n blob: new Blob(chunks, BLOB_PARAMS),\n duration: Math.round(((pausedAt || Date.now()) - startedAt) / 1000),\n waveform,\n });\n };\n mediaRecorder.onerror = reject;\n\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.stop();\n releaseAnalyzer();\n }, delayStop);\n }),\n pause: () => {\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.pause();\n pausedAt = Date.now();\n releaseAnalyzer();\n }, delayStop);\n },\n };\n}\n\nasync function startMediaRecorder() {\n await init();\n await mediaRecorder.start();\n}\n\nfunction subscribeToAnalyzer(recorder: IOpusRecorder, cb: Function) {\n const source = recorder.sourceNode;\n const analyser = source.context.createAnalyser();\n analyser.fftSize = FFT_SIZE;\n source.connect(analyser);\n\n const dataLength = analyser.frequencyBinCount;\n const dataArray = new Uint8Array(dataLength);\n let isDestroyed = false;\n\n function tick() {\n if (isDestroyed) {\n return;\n }\n\n analyser.getByteFrequencyData(dataArray);\n\n const sum = dataArray.reduce((acc, current) => acc + current, 0);\n const mean = (sum / dataLength);\n const volume = mean / 255;\n\n cb(volume < MIN_VOLUME ? 0 : volume);\n\n requestAnimationFrame(tick);\n }\n\n tick();\n\n return () => {\n isDestroyed = true;\n };\n}\n","import { StateHookSetter, useEffect } from '../../../../lib/teact/teact';\nimport { ApiAttachment, ApiMessage } from '../../../../api/types';\n\nimport buildAttachment from '../helpers/buildAttachment';\nimport { EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID } from '../../../../config';\nimport getFilesFromDataTransferItems from '../helpers/getFilesFromDataTransferItems';\n\nconst CLIPBOARD_ACCEPTED_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\nconst MAX_MESSAGE_LENGTH = 4096;\n\nconst useClipboardPaste = (\n insertTextAndUpdateCursor: (text: string, inputId?: string) => void,\n setAttachments: StateHookSetter,\n editedMessage: ApiMessage | undefined,\n) => {\n useEffect(() => {\n async function handlePaste(e: ClipboardEvent) {\n if (!e.clipboardData) {\n return;\n }\n\n const input = document.activeElement;\n if (input && ![EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID].includes(input.id)) {\n return;\n }\n\n\n const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);\n const { items } = e.clipboardData;\n let files: File[] = [];\n\n e.preventDefault();\n if (items.length > 0) {\n files = await getFilesFromDataTransferItems(items);\n }\n\n if (files.length === 0 && !pastedText) {\n return;\n }\n\n if (files.length > 0 && !editedMessage) {\n const newAttachments = await Promise.all(files.map((file) => {\n return buildAttachment(file.name, file, files.length === 1 && CLIPBOARD_ACCEPTED_TYPES.includes(file.type));\n }));\n setAttachments((attachments) => attachments.concat(newAttachments));\n }\n\n if (pastedText) {\n insertTextAndUpdateCursor(pastedText, input?.id);\n }\n }\n\n document.addEventListener('paste', handlePaste, false);\n\n return () => {\n document.removeEventListener('paste', handlePaste, false);\n };\n }, [insertTextAndUpdateCursor, editedMessage, setAttachments]);\n};\n\nexport default useClipboardPaste;\n","import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiFormattedText, ApiMessage } from '../../../../api/types';\n\nimport { DRAFT_DEBOUNCE, EDITABLE_INPUT_ID } from '../../../../config';\nimport usePrevious from '../../../../hooks/usePrevious';\nimport { debounce } from '../../../../util/schedulers';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport parseMessageInput from '../../../../util/parseMessageInput';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../../../hooks/useBeforeUnload';\nimport { IS_TOUCH_ENV } from '../../../../util/environment';\nimport { getTextWithEntitiesAsHtml } from '../../../common/helpers/renderTextWithEntities';\n\n// Used to avoid running debounced callbacks when chat changes.\nlet currentChatId: string | undefined;\nlet currentThreadId: number | undefined;\n\nconst useDraft = (\n draft: ApiFormattedText | undefined,\n chatId: string,\n threadId: number,\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n) => {\n const { saveDraft, clearDraft } = getDispatch();\n\n const updateDraft = useCallback((draftChatId: string, draftThreadId: number) => {\n const currentHtml = htmlRef.current;\n if (currentHtml.length && !editedMessage) {\n saveDraft({ chatId: draftChatId, threadId: draftThreadId, draft: parseMessageInput(currentHtml!) });\n } else {\n clearDraft({ chatId: draftChatId, threadId: draftThreadId });\n }\n }, [clearDraft, editedMessage, htmlRef, saveDraft]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const runDebouncedForSaveDraft = useMemo(() => debounce((cb) => cb(), DRAFT_DEBOUNCE, false), [chatId]);\n\n const prevChatId = usePrevious(chatId);\n const prevThreadId = usePrevious(threadId);\n\n // Save draft on chat change\n useEffect(() => {\n currentChatId = chatId;\n currentThreadId = threadId;\n\n return () => {\n currentChatId = undefined;\n currentThreadId = undefined;\n\n updateDraft(chatId, threadId);\n };\n }, [chatId, threadId, updateDraft]);\n\n // Restore draft on chat change\n useEffect(() => {\n if (chatId === prevChatId && threadId === prevThreadId) {\n return;\n }\n\n if (!draft) {\n return;\n }\n\n setHtml(getTextWithEntitiesAsHtml(draft));\n\n if (!IS_TOUCH_ENV) {\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }\n }, [chatId, threadId, draft, setHtml, updateDraft, prevChatId, prevThreadId]);\n\n const html = htmlRef.current;\n // Update draft when input changes\n const prevHtml = usePrevious(html);\n useEffect(() => {\n if (!chatId || !threadId || prevChatId !== chatId || prevThreadId !== threadId || prevHtml === html) {\n return;\n }\n\n if (html.length) {\n runDebouncedForSaveDraft(() => {\n if (currentChatId !== chatId || currentThreadId !== threadId) {\n return;\n }\n\n updateDraft(chatId, threadId);\n });\n } else {\n updateDraft(chatId, threadId);\n }\n }, [chatId, html, prevChatId, prevHtml, prevThreadId, runDebouncedForSaveDraft, threadId, updateDraft]);\n\n const handleBlur = useCallback(() => {\n if (chatId && threadId) {\n updateDraft(chatId, threadId);\n }\n }, [chatId, threadId, updateDraft]);\n\n useBackgroundMode(handleBlur);\n useBeforeUnload(handleBlur);\n};\n\nexport default useDraft;\n","import { useState } from '../lib/teact/teact';\n\nimport useDebounce from './useDebounce';\nimport useOnChange from './useOnChange';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport useFlag from './useFlag';\n\nexport default function useDebouncedMemo(\n resolverFn: () => R, ms: number, dependencies: D,\n): R | undefined {\n const runDebounced = useDebounce(ms, true);\n const [value, setValue] = useState();\n const [isFrozen, freeze, unfreeze] = useFlag();\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useOnChange(() => {\n if (isFrozen) {\n return;\n }\n\n runDebounced(() => {\n setValue(resolverFn());\n });\n }, [...dependencies, isFrozen]);\n\n return value;\n}\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\nimport { InlineBotSettings } from '../../../../types';\nimport useFlag from '../../../../hooks/useFlag';\nimport usePrevious from '../../../../hooks/usePrevious';\nimport useDebouncedMemo from '../../../../hooks/useDebouncedMemo';\n\nconst DEBOUNCE_MS = 300;\nconst INLINE_BOT_QUERY_REGEXP = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+(.*)/i;\nconst HAS_NEW_LINE = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+\\n{2,}/i;\nconst MEMO_NO_RESULT = {\n username: '',\n query: '',\n canShowHelp: false,\n usernameLowered: '',\n};\n\nconst tempEl = document.createElement('div');\n\nexport default function useInlineBotTooltip(\n isAllowed: boolean,\n chatId: string,\n html: string,\n inlineBots?: Record,\n) {\n const { queryInlineBot, resetInlineBot } = getDispatch();\n\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const {\n username, query, canShowHelp, usernameLowered,\n } = useDebouncedMemo(() => parseBotQuery(html), DEBOUNCE_MS, [html]) || {};\n const prevQuery = usePrevious(query);\n const prevUsername = usePrevious(username);\n const inlineBotData = usernameLowered ? inlineBots?.[usernameLowered] : undefined;\n const {\n id: botId,\n switchPm,\n offset,\n results,\n isGallery,\n help,\n } = inlineBotData || {};\n\n useEffect(() => {\n if (prevQuery !== query) {\n unmarkIsOpen();\n }\n }, [prevQuery, query, unmarkIsOpen]);\n\n useEffect(() => {\n if (isAllowed && usernameLowered && chatId) {\n queryInlineBot({ chatId, username: usernameLowered, query });\n }\n }, [query, isAllowed, queryInlineBot, chatId, usernameLowered]);\n\n const loadMore = useCallback(() => {\n queryInlineBot({\n chatId, username: usernameLowered, query, offset,\n });\n }, [offset, chatId, query, queryInlineBot, usernameLowered]);\n\n useEffect(() => {\n if (isAllowed && botId && (switchPm || (results?.length))) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [botId, isAllowed, markIsOpen, results, switchPm, unmarkIsOpen]);\n\n if (prevUsername !== username) {\n resetInlineBot({ username: prevUsername });\n }\n\n return {\n isOpen,\n id: botId,\n isGallery,\n switchPm,\n results,\n closeTooltip: unmarkIsOpen,\n help: canShowHelp && help ? `@${username} ${help}` : undefined,\n loadMore,\n };\n}\n\nfunction parseBotQuery(html: string) {\n const text = getPlainText(html);\n const result = text.match(INLINE_BOT_QUERY_REGEXP);\n if (!result) {\n return MEMO_NO_RESULT;\n }\n\n return {\n username: result[1],\n query: result[2],\n canShowHelp: result[2] === '' && !text.match(HAS_NEW_LINE),\n usernameLowered: result[1].toLowerCase(),\n };\n}\n\nfunction getPlainText(html: string) {\n tempEl.innerHTML = html.replace(/
/g, '\\n');\n\n return tempEl.innerText;\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotCommand } from '../../../../api/types';\n\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport { throttle } from '../../../../util/schedulers';\nimport useFlag from '../../../../hooks/useFlag';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_COMMAND = /^[\\w@]{1,32}\\s?/i;\n\nexport default function useBotCommandTooltip(\n isAllowed: boolean,\n html: string,\n botCommands?: ApiBotCommand[] | false,\n chatBotCommands?: ApiBotCommand[],\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [filteredBotCommands, setFilteredBotCommands] = useState();\n\n const getFilteredCommands = useCallback((filter) => {\n if (!botCommands && !chatBotCommands) {\n setFilteredBotCommands(undefined);\n\n return;\n }\n\n runThrottled(() => {\n const nextFilteredBotCommands = (botCommands || chatBotCommands || [])\n .filter(({ command }) => !filter || command.includes(filter));\n setFilteredBotCommands(\n nextFilteredBotCommands && nextFilteredBotCommands.length ? nextFilteredBotCommands : undefined,\n );\n });\n }, [botCommands, chatBotCommands]);\n\n useEffect(() => {\n if (!isAllowed || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const shouldShowCommands = html.startsWith('/');\n\n if (shouldShowCommands) {\n const filter = prepareForRegExp(html.substr(1)).match(RE_COMMAND);\n getFilteredCommands(filter ? filter[0] : '');\n } else {\n unmarkIsOpen();\n }\n }, [getFilteredCommands, html, isAllowed, unmarkIsOpen]);\n\n useEffect(() => {\n if (filteredBotCommands && filteredBotCommands.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [filteredBotCommands, markIsOpen, unmarkIsOpen]);\n\n return {\n isOpen,\n close: unmarkIsOpen,\n filteredBotCommands,\n };\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './DeleteMessageModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DeleteMessageModalAsync: FC = (props) => {\n const { isOpen } = props;\n const DeleteMessageModal = useModuleLoader(Bundles.Extra, 'DeleteMessageModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DeleteMessageModal ? : undefined;\n};\n\nexport default memo(DeleteMessageModalAsync);\n","import React, {\n FC, useRef, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\ntype OwnProps = {\n onActivate: NoneToVoidFunction;\n} & Omit;\n\nconst BUTTON_ACTIVATE_DELAY = 200;\nlet openTimeout: number | undefined;\nlet isFirstTimeActivation = true;\n\nconst ResponsiveHoverButton: FC = ({ onActivate, ...buttonProps }) => {\n const isMouseInside = useRef(false);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n\n // This is used to counter additional delay caused by asynchronous module loading\n if (isFirstTimeActivation) {\n isFirstTimeActivation = false;\n onActivate();\n return;\n }\n\n if (openTimeout) {\n clearTimeout(openTimeout);\n openTimeout = undefined;\n }\n openTimeout = window.setTimeout(() => {\n if (isMouseInside.current) {\n onActivate();\n }\n }, BUTTON_ACTIVATE_DELAY);\n }, [onActivate]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n }, []);\n\n return (\n \n );\n};\n\nexport default memo(ResponsiveHoverButton);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './CalendarModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst CalendarModalAsync: FC = (props) => {\n const { isOpen } = props;\n const CalendarModal = useModuleLoader(Bundles.Extra, 'CalendarModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CalendarModal ? : undefined;\n};\n\nexport default memo(CalendarModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const AttachMenu = useModuleLoader(Bundles.Extra, 'AttachMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachMenu ? : undefined;\n};\n\nexport default memo(AttachMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './SymbolMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst SymbolMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const SymbolMenu = useModuleLoader(Bundles.Extra, 'SymbolMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SymbolMenu ? : undefined;\n};\n\nexport default memo(SymbolMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './InlineBotTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst InlineBotTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const InlineBotTooltip = useModuleLoader(Bundles.Extra, 'InlineBotTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return InlineBotTooltip ? : undefined;\n};\n\nexport default memo(InlineBotTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './MentionTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst MentionTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const MentionTooltip = useModuleLoader(Bundles.Extra, 'MentionTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MentionTooltip ? : undefined;\n};\n\nexport default memo(MentionTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './CustomSendMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst CustomSendMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const CustomSend = useModuleLoader(Bundles.Extra, 'CustomSendMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CustomSend ? : undefined;\n};\n\nexport default memo(CustomSendMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './StickerTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst StickerTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerTooltip = useModuleLoader(Bundles.Extra, 'StickerTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerTooltip ? : undefined;\n};\n\nexport default memo(StickerTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandTooltip = useModuleLoader(Bundles.Extra, 'BotCommandTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandTooltip ? : undefined;\n};\n\nexport default memo(BotCommandTooltipAsync);\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { selectChatMessage, selectCurrentMessageList } from '../../../modules/selectors';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useFlag from '../../../hooks/useFlag';\n\nimport Menu from '../../ui/Menu';\nimport Button from '../../ui/Button';\n\nimport './BotKeyboardMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageId: number;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n message?: ApiMessage;\n};\n\nconst BotKeyboardMenu: FC = ({\n isOpen, message, onClose,\n}) => {\n const { clickInlineButton } = getDispatch();\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n const { isKeyboardSingleUse } = message || {};\n const [forceOpen, markForceOpen, unmarkForceOpen] = useFlag(true);\n\n const handleClose = () => {\n unmarkForceOpen();\n onClose();\n };\n\n useEffect(() => {\n markForceOpen();\n }, [markForceOpen, message?.keyboardButtons]);\n\n if (!message || !message.keyboardButtons) {\n return undefined;\n }\n\n return (\n \n
\n {message.keyboardButtons.map((row) => (\n
\n {row.map((button) => (\n clickInlineButton({ button })}\n >\n {button.text}\n \n ))}\n
\n ))}\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { messageId }): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return {};\n }\n\n return { message: selectChatMessage(global, chatId, messageId) };\n },\n)(BotKeyboardMenu));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\n\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectForwardedSender,\n selectUser,\n selectCurrentMessageList,\n selectReplyingToId,\n selectEditingId,\n selectEditingScheduledId,\n selectEditingMessage,\n} from '../../../modules/selectors';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport { isUserId } from '../../../modules/helpers';\n\nimport Button from '../../ui/Button';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\n\nimport './ComposerEmbeddedMessage.scss';\n\ntype StateProps = {\n replyingToId?: number;\n editingId?: number;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n shouldAnimate?: boolean;\n forwardedMessagesCount?: number;\n};\n\nconst FORWARD_RENDERING_DELAY = 300;\n\nconst ComposerEmbeddedMessage: FC = ({\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount,\n}) => {\n const {\n setReplyingToId,\n setEditingId,\n focusMessage,\n exitForwardMode,\n } = getDispatch();\n\n const isShown = Boolean(\n ((replyingToId || editingId) && message)\n || (sender && forwardedMessagesCount),\n );\n const canAnimate = useAsyncRendering(\n [forwardedMessagesCount],\n forwardedMessagesCount ? FORWARD_RENDERING_DELAY : undefined,\n );\n\n const {\n shouldRender, transitionClassNames,\n } = useShowTransition(canAnimate && isShown, undefined, !shouldAnimate, undefined, !shouldAnimate);\n\n const clearEmbedded = useCallback(() => {\n if (replyingToId) {\n setReplyingToId({ messageId: undefined });\n } else if (editingId) {\n setEditingId({ messageId: undefined });\n } else if (forwardedMessagesCount) {\n exitForwardMode();\n }\n }, [replyingToId, editingId, forwardedMessagesCount, setReplyingToId, setEditingId, exitForwardMode]);\n\n useEffect(() => (isShown ? captureEscKeyListener(clearEmbedded) : undefined), [isShown, clearEmbedded]);\n\n const handleMessageClick = useCallback((): void => {\n focusMessage({ chatId: message!.chatId, messageId: message!.id });\n }, [focusMessage, message]);\n\n const className = buildClassName('ComposerEmbeddedMessage', transitionClassNames);\n\n const customText = forwardedMessagesCount && forwardedMessagesCount > 1\n ? `${forwardedMessagesCount} forwarded messages`\n : undefined;\n\n if (!shouldRender) {\n return undefined;\n }\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId || !messageListType) {\n return {};\n }\n\n const {\n currentUserId,\n forwardMessages: { fromChatId, toChatId, messageIds: forwardMessageIds },\n } = global;\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const editingId = messageListType === 'scheduled'\n ? selectEditingScheduledId(global, chatId)\n : selectEditingId(global, chatId, threadId);\n const shouldAnimate = global.settings.byKey.animationLevel >= 1;\n const isForwarding = toChatId === chatId;\n\n let message;\n if (replyingToId) {\n message = selectChatMessage(global, chatId, replyingToId);\n } else if (editingId) {\n message = selectEditingMessage(global, chatId, threadId, messageListType);\n } else if (isForwarding && forwardMessageIds!.length === 1) {\n message = selectChatMessage(global, fromChatId!, forwardMessageIds![0]);\n }\n\n let sender: ApiChat | ApiUser | undefined;\n if (replyingToId && message) {\n const { forwardInfo } = message;\n const isChatWithSelf = chatId === currentUserId;\n\n if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {\n sender = selectForwardedSender(global, message);\n }\n\n if (!sender) {\n sender = selectSender(global, message);\n }\n } else if (isForwarding) {\n sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);\n }\n\n return {\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount: isForwarding ? forwardMessageIds!.length : undefined,\n };\n },\n)(ComposerEmbeddedMessage));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachmentModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachmentModalAsync: FC = (props) => {\n const { attachments } = props;\n const AttachmentModal = useModuleLoader(Bundles.Extra, 'AttachmentModal', !attachments.length);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachmentModal ? : undefined;\n};\n\nexport default memo(AttachmentModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandMenu = useModuleLoader(Bundles.Extra, 'BotCommandMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandMenu ? : undefined;\n};\n\nexport default memo(BotCommandMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './PollModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst PollModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PollModal = useModuleLoader(Bundles.Extra, 'PollModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PollModal ? : undefined;\n};\n\nexport default memo(PollModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './DropArea';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst DropAreaAsync: FC = (props) => {\n const { isOpen } = props;\n const DropArea = useModuleLoader(Bundles.Extra, 'DropArea', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DropArea ? : undefined;\n};\n\nexport default memo(DropAreaAsync);\nexport { DropAreaState } from './DropArea';\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types';\nimport { ISettings } from '../../../types';\n\nimport { RE_LINK_TEMPLATE } from '../../../config';\nimport { selectNoWebPage, selectTheme } from '../../../modules/selectors';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';\nimport useDebouncedMemo from '../../../hooks/useDebouncedMemo';\nimport buildClassName from '../../../util/buildClassName';\n\nimport WebPage from '../message/WebPage';\nimport Button from '../../ui/Button';\n\nimport './WebPagePreview.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n messageText: string;\n disabled?: boolean;\n};\n\ntype StateProps = {\n webPagePreview?: ApiWebPage;\n noWebPage?: boolean;\n theme: ISettings['theme'];\n};\n\nconst DEBOUNCE_MS = 300;\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\n\nconst WebPagePreview: FC = ({\n chatId,\n threadId,\n messageText,\n disabled,\n webPagePreview,\n noWebPage,\n theme,\n}) => {\n const {\n loadWebPagePreview,\n clearWebPagePreview,\n toggleMessageWebPage,\n } = getDispatch();\n\n const link = useDebouncedMemo(() => {\n const { text, entities } = parseMessageInput(messageText);\n\n const linkEntity = entities && entities.find(({ type }) => type === ApiMessageEntityTypes.TextUrl);\n if (linkEntity) {\n return linkEntity.url;\n }\n\n const textMatch = text.match(RE_LINK);\n if (textMatch) {\n return textMatch[0];\n }\n\n return undefined;\n }, DEBOUNCE_MS, [messageText]);\n\n useEffect(() => {\n if (link) {\n loadWebPagePreview({ text: link });\n } else {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }\n }, [chatId, toggleMessageWebPage, clearWebPagePreview, link, loadWebPagePreview, threadId]);\n\n useOnChange(() => {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }, [chatId]);\n\n const isShown = Boolean(webPagePreview && messageText.length && !noWebPage && !disabled);\n const { shouldRender, transitionClassNames } = useShowTransition(isShown);\n\n const renderingWebPage = useCurrentOrPrev(webPagePreview, true);\n\n if (!shouldRender || !renderingWebPage) {\n return undefined;\n }\n\n const handleClearWebpagePreview = () => {\n toggleMessageWebPage({ chatId, threadId, noWebPage: true });\n };\n\n // TODO Refactor so `WebPage` can be used without message\n const { photo, ...webPageWithoutPhoto } = renderingWebPage;\n const messageStub = {\n content: {\n webPage: webPageWithoutPhoto,\n },\n } as ApiMessage;\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId }): StateProps => {\n const noWebPage = selectNoWebPage(global, chatId, threadId);\n return {\n theme: selectTheme(global),\n webPagePreview: global.webPagePreview,\n noWebPage,\n };\n },\n)(WebPagePreview));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './SendAsMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst SendAsMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const SendAsMenu = useModuleLoader(Bundles.Extra, 'SendAsMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SendAsMenu ? : undefined;\n};\n\nexport default memo(SendAsMenuAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState, MessageListType } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiBotInlineResult,\n ApiBotInlineMediaResult,\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessage,\n ApiFormattedText,\n ApiChat,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n ApiBotCommand,\n} from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport {\n BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_ID, REPLIES_USER_ID, SCHEDULED_WHEN_ONLINE, SEND_MESSAGE_ACTION_INTERVAL,\n} from '../../../config';\nimport { IS_VOICE_RECORDING_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT, IS_IOS } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport {\n selectChat,\n selectIsRightColumnShown,\n selectIsInSelectMode,\n selectNewestMessageWithBotKeyboardButtons,\n selectDraft,\n selectScheduledIds,\n selectEditingMessage,\n selectIsChatWithSelf,\n selectChatBot,\n selectChatUser,\n selectChatMessage,\n selectUser,\n selectUserStatus,\n} from '../../../modules/selectors';\nimport {\n getAllowedAttachmentOptions,\n getChatSlowModeOptions,\n isUserId,\n isChatAdmin,\n isChatSuperGroup,\n} from '../../../modules/helpers';\nimport { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport buildAttachment from './helpers/buildAttachment';\nimport renderText from '../../common/helpers/renderText';\nimport insertHtmlInSelection from '../../../util/insertHtmlInSelection';\nimport deleteLastCharacterOutsideSelection from '../../../util/deleteLastCharacterOutsideSelection';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport applyIosAutoCapitalizationFix from './helpers/applyIosAutoCapitalizationFix';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport useFlag from '../../../hooks/useFlag';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useStickerTooltip from './hooks/useStickerTooltip';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport useLang from '../../../hooks/useLang';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\nimport useInterval from '../../../hooks/useInterval';\nimport useOnChange from '../../../hooks/useOnChange';\nimport { useStateRef } from '../../../hooks/useStateRef';\nimport useVoiceRecording from './hooks/useVoiceRecording';\nimport useClipboardPaste from './hooks/useClipboardPaste';\nimport useDraft from './hooks/useDraft';\nimport useEditing from './hooks/useEditing';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useInlineBotTooltip from './hooks/useInlineBotTooltip';\nimport useBotCommandTooltip from './hooks/useBotCommandTooltip';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal.async';\nimport Button from '../../ui/Button';\nimport ResponsiveHoverButton from '../../ui/ResponsiveHoverButton';\nimport Spinner from '../../ui/Spinner';\nimport CalendarModal from '../../common/CalendarModal.async';\nimport Avatar from '../../common/Avatar';\nimport AttachMenu from './AttachMenu.async';\nimport SymbolMenu from './SymbolMenu.async';\nimport InlineBotTooltip from './InlineBotTooltip.async';\nimport MentionTooltip from './MentionTooltip.async';\nimport CustomSendMenu from './CustomSendMenu.async';\nimport StickerTooltip from './StickerTooltip.async';\nimport EmojiTooltip from './EmojiTooltip.async';\nimport BotCommandTooltip from './BotCommandTooltip.async';\nimport BotKeyboardMenu from './BotKeyboardMenu';\nimport MessageInput from './MessageInput';\nimport ComposerEmbeddedMessage from './ComposerEmbeddedMessage';\nimport AttachmentModal from './AttachmentModal.async';\nimport BotCommandMenu from './BotCommandMenu.async';\nimport PollModal from './PollModal.async';\nimport DropArea, { DropAreaState } from './DropArea.async';\nimport WebPagePreview from './WebPagePreview';\nimport SendAsMenu from './SendAsMenu.async';\n\nimport './Composer.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n messageListType: MessageListType;\n dropAreaState: string;\n isReady: boolean;\n onDropHide: NoneToVoidFunction;\n};\n\ntype StateProps =\n {\n editingMessage?: ApiMessage;\n chat?: ApiChat;\n draft?: ApiFormattedText;\n isChatWithBot?: boolean;\n isChatWithSelf?: boolean;\n isRightColumnShown?: boolean;\n isSelectModeActive?: boolean;\n isForwarding?: boolean;\n isPollModalOpen?: boolean;\n botKeyboardMessageId?: number;\n botKeyboardPlaceholder?: string;\n withScheduledButton?: boolean;\n shouldSchedule?: boolean;\n canScheduleUntilOnline?: boolean;\n stickersForEmoji?: ApiSticker[];\n groupChatMembers?: ApiChatMember[];\n currentUserId?: string;\n recentEmojis: string[];\n lastSyncTime?: number;\n contentToBeScheduled?: GlobalState['messages']['contentToBeScheduled'];\n shouldSuggestStickers?: boolean;\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n serverTimeOffset: number;\n topInlineBotIds?: string[];\n isInlineBotLoading: boolean;\n inlineBots?: Record;\n botCommands?: ApiBotCommand[] | false;\n chatBotCommands?: ApiBotCommand[];\n sendAsUser?: ApiUser;\n sendAsChat?: ApiChat;\n sendAsId?: string;\n }\n & Pick;\n\nenum MainButtonState {\n Send = 'send',\n Record = 'record',\n Edit = 'edit',\n Schedule = 'schedule',\n}\n\nconst VOICE_RECORDING_FILENAME = 'wonderful-voice-message.ogg';\n// When voice recording is active, composer placeholder will hide to prevent overlapping\nconst SCREEN_WIDTH_TO_HIDE_PLACEHOLDER = 600; // px\n\nconst MOBILE_KEYBOARD_HIDE_DELAY_MS = 100;\nconst SELECT_MODE_TRANSITION_MS = 200;\nconst MESSAGE_MAX_LENGTH = 4096;\nconst CAPTION_MAX_LENGTH = 1024;\nconst SENDING_ANIMATION_DURATION = 350;\n// eslint-disable-next-line max-len\nconst APPENDIX = '';\n\nconst Composer: FC = ({\n dropAreaState,\n shouldSchedule,\n canScheduleUntilOnline,\n isReady,\n onDropHide,\n editingMessage,\n chatId,\n threadId,\n messageListType,\n draft,\n chat,\n connectionState,\n isChatWithBot,\n isChatWithSelf,\n isRightColumnShown,\n isSelectModeActive,\n isForwarding,\n isPollModalOpen,\n botKeyboardMessageId,\n botKeyboardPlaceholder,\n withScheduledButton,\n stickersForEmoji,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n lastSyncTime,\n contentToBeScheduled,\n shouldSuggestStickers,\n baseEmojiKeywords,\n emojiKeywords,\n serverTimeOffset,\n recentEmojis,\n inlineBots,\n isInlineBotLoading,\n botCommands,\n chatBotCommands,\n sendAsUser,\n sendAsChat,\n sendAsId,\n}) => {\n const {\n sendMessage,\n clearDraft,\n showDialog,\n setStickerSearchQuery,\n setGifSearchQuery,\n forwardMessages,\n openPollModal,\n closePollModal,\n loadScheduledHistory,\n openChat,\n addRecentEmoji,\n sendInlineBotResult,\n loadSendAs,\n loadFullChat,\n } = getDispatch();\n const lang = useLang();\n\n // eslint-disable-next-line no-null/no-null\n const appendixRef = useRef(null);\n const [html, setHtml] = useState('');\n const htmlRef = useStateRef(html);\n const lastMessageSendTimeSeconds = useRef();\n const prevDropAreaState = usePrevious(dropAreaState);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n const [\n scheduledMessageArgs, setScheduledMessageArgs,\n ] = useState();\n const { width: windowWidth } = windowSize.get();\n const sendAsIds = chat?.sendAsIds;\n const canShowSendAs = sendAsIds && (sendAsIds.length > 1 || !sendAsIds.includes(currentUserId!));\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n useEffect(() => {\n lastMessageSendTimeSeconds.current = undefined;\n }, [chatId]);\n\n useEffect(() => {\n if (chatId && lastSyncTime && threadId === MAIN_THREAD_ID && isReady) {\n loadScheduledHistory({ chatId });\n }\n }, [isReady, chatId, loadScheduledHistory, lastSyncTime, threadId]);\n\n useEffect(() => {\n if (chatId && chat && lastSyncTime && !sendAsIds && isReady && isChatSuperGroup(chat)) {\n loadSendAs({ chatId });\n }\n }, [chat, chatId, isReady, lastSyncTime, loadSendAs, sendAsIds]);\n\n useEffect(() => {\n if (chatId && chat && lastSyncTime && !chat.fullInfo && isReady && isChatSuperGroup(chat)) {\n loadFullChat({ chatId });\n }\n }, [chat, chatId, isReady, lastSyncTime, loadFullChat]);\n\n const shouldAnimateSendAsButtonRef = useRef(false);\n useOnChange(([prevChatId, prevSendAsIds]) => {\n // We only animate send-as button if `sendAsIds` was missing when opening the chat\n shouldAnimateSendAsButtonRef.current = Boolean(chatId === prevChatId && sendAsIds && !prevSendAsIds);\n }, [chatId, sendAsIds]);\n\n useLayoutEffect(() => {\n if (!appendixRef.current) return;\n\n appendixRef.current.innerHTML = APPENDIX;\n }, []);\n\n useEffect(() => {\n if (contentToBeScheduled) {\n setScheduledMessageArgs(contentToBeScheduled);\n openCalendar();\n }\n }, [contentToBeScheduled, openCalendar]);\n\n const [attachments, setAttachments] = useState([]);\n\n const [isBotKeyboardOpen, openBotKeyboard, closeBotKeyboard] = useFlag();\n const [isBotCommandMenuOpen, openBotCommandMenu, closeBotCommandMenu] = useFlag();\n const [isAttachMenuOpen, openAttachMenu, closeAttachMenu] = useFlag();\n const [isSymbolMenuOpen, openSymbolMenu, closeSymbolMenu] = useFlag();\n const [isSendAsMenuOpen, openSendAsMenu, closeSendAsMenu] = useFlag();\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isSymbolMenuLoaded, onSymbolMenuLoadingComplete] = useFlag();\n const [isHoverDisabled, disableHover, enableHover] = useFlag();\n\n const {\n startRecordingVoice,\n stopRecordingVoice,\n pauseRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef: mainButtonRef,\n startRecordTimeRef,\n } = useVoiceRecording();\n\n useInterval(() => {\n sendMessageAction({ type: 'recordAudio' });\n }, activeVoiceRecording && SEND_MESSAGE_ACTION_INTERVAL);\n\n useEffect(() => {\n if (!activeVoiceRecording) {\n sendMessageAction({ type: 'cancel' });\n }\n }, [activeVoiceRecording, sendMessageAction]);\n\n const mainButtonState = editingMessage ? MainButtonState.Edit\n : (!IS_VOICE_RECORDING_SUPPORTED || activeVoiceRecording || (html && !attachments.length) || isForwarding)\n ? (shouldSchedule ? MainButtonState.Schedule : MainButtonState.Send)\n : MainButtonState.Record;\n const canShowCustomSendMenu = !shouldSchedule;\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n !attachments.length,\n htmlRef,\n setHtml,\n undefined,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n );\n\n const {\n isOpen: isInlineBotTooltipOpen,\n id: inlineBotId,\n isGallery: isInlineBotTooltipGallery,\n switchPm: inlineBotSwitchPm,\n results: inlineBotResults,\n closeTooltip: closeInlineBotTooltip,\n help: inlineBotHelp,\n loadMore: loadMoreForInlineBot,\n } = useInlineBotTooltip(\n Boolean(!attachments.length && lastSyncTime),\n chatId,\n html,\n inlineBots,\n );\n\n const {\n isOpen: isBotCommandTooltipOpen,\n close: closeBotCommandTooltip,\n filteredBotCommands: botTooltipCommands,\n } = useBotCommandTooltip(\n Boolean((botCommands && botCommands.length) || (chatBotCommands && chatBotCommands.length)),\n html,\n botCommands,\n chatBotCommands,\n );\n\n const {\n isContextMenuOpen: isCustomSendMenuOpen,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n } = useContextMenuHandlers(mainButtonRef, !(mainButtonState === MainButtonState.Send && canShowCustomSendMenu));\n\n const {\n canSendStickers, canSendGifs, canAttachMedia, canAttachPolls, canAttachEmbedLinks,\n } = useMemo(() => getAllowedAttachmentOptions(chat, isChatWithBot), [chat, isChatWithBot]);\n\n const isAdmin = chat && isChatAdmin(chat);\n const slowMode = getChatSlowModeOptions(chat);\n\n const { isStickerTooltipOpen, closeStickerTooltip } = useStickerTooltip(\n Boolean(shouldSuggestStickers && canSendStickers && !attachments.length),\n html,\n stickersForEmoji,\n !isReady,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n Boolean(shouldSuggestStickers && canSendStickers && !attachments.length),\n htmlRef,\n recentEmojis,\n undefined,\n setHtml,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n const insertTextAndUpdateCursor = useCallback((text: string, inputId: string = EDITABLE_INPUT_ID) => {\n const selection = window.getSelection()!;\n const messageInput = document.getElementById(inputId)!;\n const newHtml = renderText(text, ['escape_html', 'emoji_html', 'br_html'])\n .join('')\n .replace(/\\u200b+/g, '\\u200b');\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, inputId)) {\n insertHtmlInSelection(newHtml);\n messageInput.dispatchEvent(new Event('input', { bubbles: true }));\n return;\n }\n }\n\n setHtml(`${htmlRef.current!}${newHtml}`);\n\n // If selection is outside of input, set cursor at the end of input\n requestAnimationFrame(() => {\n focusEditableElement(messageInput);\n });\n }, [htmlRef]);\n\n const removeSymbol = useCallback(() => {\n const selection = window.getSelection()!;\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, EDITABLE_INPUT_ID)) {\n document.execCommand('delete', false);\n return;\n }\n }\n\n setHtml(deleteLastCharacterOutsideSelection(htmlRef.current!));\n }, [htmlRef]);\n\n const resetComposer = useCallback((shouldPreserveInput = false) => {\n if (!shouldPreserveInput) {\n setHtml('');\n }\n setAttachments(MEMO_EMPTY_ARRAY);\n closeStickerTooltip();\n closeCalendar();\n setScheduledMessageArgs(undefined);\n closeMentionTooltip();\n closeEmojiTooltip();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // @optimization\n setTimeout(() => closeSymbolMenu(), SENDING_ANIMATION_DURATION);\n } else {\n closeSymbolMenu();\n }\n }, [closeStickerTooltip, closeCalendar, closeMentionTooltip, closeEmojiTooltip, closeSymbolMenu]);\n\n // Handle chat change (ref is used to avoid redundant effect calls)\n const stopRecordingVoiceRef = useRef();\n stopRecordingVoiceRef.current = stopRecordingVoice;\n useEffect(() => {\n return () => {\n stopRecordingVoiceRef.current!();\n resetComposer();\n };\n }, [chatId, resetComposer, stopRecordingVoiceRef]);\n\n const handleEditComplete = useEditing(htmlRef, setHtml, editingMessage, resetComposer, openDeleteModal);\n useDraft(draft, chatId, threadId, htmlRef, setHtml, editingMessage);\n useClipboardPaste(insertTextAndUpdateCursor, setAttachments, editingMessage);\n\n const handleFileSelect = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments(await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))));\n }, []);\n\n const handleAppendFiles = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments([\n ...attachments,\n ...await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))),\n ]);\n }, [attachments]);\n\n const handleClearAttachment = useCallback(() => {\n setAttachments(MEMO_EMPTY_ARRAY);\n }, []);\n\n const handleSend = useCallback(async (isSilent = false, scheduledAt?: number) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n let currentAttachments = attachments;\n\n if (activeVoiceRecording) {\n const record = await stopRecordingVoice();\n if (record) {\n const { blob, duration, waveform } = record;\n currentAttachments = [await buildAttachment(\n VOICE_RECORDING_FILENAME,\n blob,\n false,\n { voice: { duration, waveform } },\n )];\n }\n }\n\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!currentAttachments.length && !text && !isForwarding) {\n return;\n }\n\n const maxLength = currentAttachments.length ? CAPTION_MAX_LENGTH : MESSAGE_MAX_LENGTH;\n if (text?.length > maxLength) {\n const extraLength = text.length - maxLength;\n showDialog({\n data: {\n message: 'MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS',\n textParams: {\n '{EXTRA_CHARS_COUNT}': extraLength,\n '{PLURAL_S}': extraLength > 1 ? 's' : '',\n },\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (currentAttachments.length || text) {\n if (slowMode && !isAdmin) {\n const nowSeconds = getServerTime(serverTimeOffset);\n const secondsSinceLastMessage = lastMessageSendTimeSeconds.current\n && Math.floor(nowSeconds - lastMessageSendTimeSeconds.current);\n const nextSendDateNotReached = slowMode.nextSendDate && slowMode.nextSendDate > nowSeconds;\n\n if (\n (secondsSinceLastMessage && secondsSinceLastMessage < slowMode.seconds)\n || nextSendDateNotReached\n ) {\n const secondsRemaining = nextSendDateNotReached\n ? slowMode.nextSendDate! - nowSeconds\n : slowMode.seconds - secondsSinceLastMessage!;\n showDialog({\n data: {\n message: lang('SlowModeHint', formatMediaDuration(secondsRemaining)),\n isSlowMode: true,\n hasErrorKey: false,\n },\n });\n\n messageInput.blur();\n\n return;\n }\n }\n\n sendMessage({\n text,\n entities,\n attachments: currentAttachments,\n scheduledAt,\n isSilent,\n });\n }\n\n if (isForwarding) {\n forwardMessages({\n scheduledAt,\n isSilent,\n });\n }\n\n lastMessageSendTimeSeconds.current = getServerTime(serverTimeOffset);\n\n clearDraft({ chatId, localOnly: true });\n\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n // Wait until message animation starts\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [\n connectionState, attachments, activeVoiceRecording, isForwarding, clearDraft, chatId, serverTimeOffset,\n resetComposer, stopRecordingVoice, showDialog, slowMode, isAdmin, sendMessage, forwardMessages, lang, htmlRef,\n ]);\n\n const handleActivateBotCommandMenu = useCallback(() => {\n closeSymbolMenu();\n openBotCommandMenu();\n }, [closeSymbolMenu, openBotCommandMenu]);\n\n const handleActivateSymbolMenu = useCallback(() => {\n closeBotCommandMenu();\n closeSendAsMenu();\n openSymbolMenu();\n }, [closeBotCommandMenu, closeSendAsMenu, openSymbolMenu]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker, shouldPreserveInput = false) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n if (shouldSchedule) {\n setScheduledMessageArgs({ sticker });\n openCalendar();\n } else {\n sendMessage({ sticker });\n requestAnimationFrame(() => {\n resetComposer(shouldPreserveInput);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleGifSelect = useCallback((gif: ApiVideo) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ gif });\n openCalendar();\n } else {\n sendMessage({ gif });\n requestAnimationFrame(() => {\n resetComposer(true);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleInlineBotSelect = useCallback((inlineResult: ApiBotInlineResult | ApiBotInlineMediaResult) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n sendInlineBotResult({\n id: inlineResult.id,\n queryId: inlineResult.queryId,\n });\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, connectionState, resetComposer, sendInlineBotResult]);\n\n const handleBotCommandSelect = useCallback(() => {\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, resetComposer]);\n\n const handlePollSend = useCallback((poll: ApiNewPoll) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ poll });\n closePollModal();\n openCalendar();\n } else {\n sendMessage({ poll });\n closePollModal();\n }\n }, [closePollModal, openCalendar, sendMessage, shouldSchedule]);\n\n const handleSilentSend = useCallback(() => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ isSilent: true });\n openCalendar();\n } else {\n void handleSend(true);\n }\n }, [handleSend, openCalendar, shouldSchedule]);\n\n const handleMessageSchedule = useCallback((date: Date, isWhenOnline = false) => {\n const { isSilent, ...restArgs } = scheduledMessageArgs || {};\n\n // Scheduled time can not be less than 10 seconds in future\n const scheduledAt = Math.round(Math.max(date.getTime(), Date.now() + 60 * 1000) / 1000)\n + (isWhenOnline ? 0 : serverTimeOffset);\n\n if (!scheduledMessageArgs || Object.keys(restArgs).length === 0) {\n void handleSend(Boolean(isSilent), scheduledAt);\n } else {\n sendMessage({\n ...scheduledMessageArgs,\n scheduledAt,\n });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }\n closeCalendar();\n }, [closeCalendar, handleSend, resetComposer, scheduledMessageArgs, sendMessage, serverTimeOffset]);\n\n const handleMessageScheduleUntilOnline = useCallback(() => {\n handleMessageSchedule(new Date(SCHEDULED_WHEN_ONLINE * 1000), true);\n }, [handleMessageSchedule]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n setScheduledMessageArgs(undefined);\n }, [closeCalendar]);\n\n const handleSearchOpen = useCallback((type: 'stickers' | 'gifs') => {\n if (type === 'stickers') {\n setStickerSearchQuery({ query: '' });\n setGifSearchQuery({ query: undefined });\n } else {\n setGifSearchQuery({ query: '' });\n setStickerSearchQuery({ query: undefined });\n }\n }, [setStickerSearchQuery, setGifSearchQuery]);\n\n const handleSymbolMenuOpen = useCallback(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (!IS_SINGLE_COLUMN_LAYOUT || messageInput !== document.activeElement) {\n openSymbolMenu();\n return;\n }\n\n messageInput.blur();\n setTimeout(() => {\n closeBotCommandMenu();\n openSymbolMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [openSymbolMenu, closeBotCommandMenu]);\n\n const handleSendAsMenuOpen = useCallback(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (!IS_SINGLE_COLUMN_LAYOUT || messageInput !== document.activeElement) {\n closeBotCommandMenu();\n closeSymbolMenu();\n openSendAsMenu();\n return;\n }\n\n messageInput.blur();\n setTimeout(() => {\n closeBotCommandMenu();\n closeSymbolMenu();\n openSendAsMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [closeBotCommandMenu, closeSymbolMenu, openSendAsMenu]);\n\n const handleAllScheduledClick = useCallback(() => {\n openChat({ id: chatId, threadId, type: 'scheduled' });\n }, [openChat, chatId, threadId]);\n\n useEffect(() => {\n if (isRightColumnShown && IS_SINGLE_COLUMN_LAYOUT) {\n closeSymbolMenu();\n }\n }, [isRightColumnShown, closeSymbolMenu]);\n\n useEffect(() => {\n if (!isReady) return;\n\n if (isSelectModeActive) {\n disableHover();\n } else {\n setTimeout(() => {\n enableHover();\n }, SELECT_MODE_TRANSITION_MS);\n }\n }, [isSelectModeActive, enableHover, disableHover, isReady]);\n\n const mainButtonHandler = useCallback(() => {\n switch (mainButtonState) {\n case MainButtonState.Send:\n handleSend();\n break;\n case MainButtonState.Record:\n void startRecordingVoice();\n break;\n case MainButtonState.Edit:\n handleEditComplete();\n break;\n case MainButtonState.Schedule:\n if (activeVoiceRecording) {\n pauseRecordingVoice();\n }\n openCalendar();\n break;\n default:\n break;\n }\n }, [\n mainButtonState, handleSend, startRecordingVoice, handleEditComplete,\n activeVoiceRecording, openCalendar, pauseRecordingVoice,\n ]);\n\n const areVoiceMessagesNotAllowed = mainButtonState === MainButtonState.Record && !canAttachMedia;\n\n const prevEditedMessage = usePrevious(editingMessage, true);\n const renderedEditedMessage = editingMessage || prevEditedMessage;\n\n const scheduledDefaultDate = new Date();\n scheduledDefaultDate.setSeconds(0);\n scheduledDefaultDate.setMilliseconds(0);\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n let sendButtonAriaLabel = 'SendMessage';\n switch (mainButtonState) {\n case MainButtonState.Edit:\n sendButtonAriaLabel = 'Save edited message';\n break;\n case MainButtonState.Record:\n sendButtonAriaLabel = areVoiceMessagesNotAllowed\n ? 'Conversation.DefaultRestrictedMedia'\n : 'AccDescrVoiceMessage';\n }\n\n const className = buildClassName(\n 'Composer',\n !isSelectModeActive && 'shown',\n isHoverDisabled && 'hover-disabled',\n );\n\n const symbolMenuButtonClassName = buildClassName(\n 'mobile-symbol-menu-button',\n !isReady && 'not-ready',\n isSymbolMenuLoaded\n ? (isSymbolMenuOpen && 'menu-opened')\n : (isSymbolMenuOpen && 'is-loading'),\n );\n\n const onSend = mainButtonState === MainButtonState.Edit\n ? handleEditComplete\n : mainButtonState === MainButtonState.Schedule ? openCalendar\n : handleSend;\n\n return (\n
\n {canAttachMedia && isReady && (\n \n )}\n \n \n {renderedEditedMessage && (\n \n )}\n \n \n \n \n
\n
\n \n \n
\n {isChatWithBot && botCommands !== false && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {canShowSendAs && (sendAsUser || sendAsChat) && (\n \n \n \n )}\n {IS_SINGLE_COLUMN_LAYOUT ? (\n \n \n \n {isSymbolMenuOpen && !isSymbolMenuLoaded && }\n \n ) : (\n \n \n \n )}\n \n {isInlineBotLoading && Boolean(inlineBotId) && (\n \n )}\n {withScheduledButton && (\n \n \n \n )}\n {botKeyboardMessageId && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {!activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {activeVoiceRecording && currentRecordTime && (\n \n {formatVoiceRecordDuration(currentRecordTime - startRecordTimeRef.current!)}\n \n )}\n \n \n \n {botKeyboardMessageId && (\n \n )}\n {botCommands && (\n \n )}\n \n
\n
\n {activeVoiceRecording && (\n \n \n \n )}\n \n \n \n \n \n \n {canShowCustomSendMenu && (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const chatUser = chat && selectChatUser(global, chat);\n const chatBot = chatId !== REPLIES_USER_ID ? selectChatBot(global, chatId) : undefined;\n const isChatWithBot = Boolean(chatBot);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const messageWithActualBotKeyboard = isChatWithBot && selectNewestMessageWithBotKeyboardButtons(global, chatId);\n const scheduledIds = selectScheduledIds(global, chatId);\n const { language, shouldSuggestStickers } = global.settings.byKey;\n const baseEmojiKeywords = global.emojiKeywords[BASE_EMOJI_KEYWORD_LANG];\n const emojiKeywords = language !== BASE_EMOJI_KEYWORD_LANG ? global.emojiKeywords[language] : undefined;\n const botKeyboardMessageId = messageWithActualBotKeyboard ? messageWithActualBotKeyboard.id : undefined;\n const keyboardMessage = botKeyboardMessageId ? selectChatMessage(global, chatId, botKeyboardMessageId) : undefined;\n const { currentUserId } = global;\n const defaultSendAsId = chat?.fullInfo ? chat?.fullInfo?.sendAsId || currentUserId : undefined;\n const sendAsId = chat?.sendAsIds && defaultSendAsId && chat.sendAsIds.includes(defaultSendAsId)\n ? defaultSendAsId\n : (chat?.adminRights?.anonymous ? chat?.id : undefined);\n const sendAsUser = sendAsId ? selectUser(global, sendAsId) : undefined;\n const sendAsChat = !sendAsUser && sendAsId ? selectChat(global, sendAsId) : undefined;\n\n return {\n editingMessage: selectEditingMessage(global, chatId, threadId, messageListType),\n connectionState: global.connectionState,\n draft: selectDraft(global, chatId, threadId),\n chat,\n isChatWithBot,\n isChatWithSelf,\n canScheduleUntilOnline: Boolean(\n !isChatWithSelf && !isChatWithBot && chat && chatUser\n && isUserId(chatId) && selectUserStatus(global, chatId)?.wasOnline,\n ),\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n withScheduledButton: (\n threadId === MAIN_THREAD_ID\n && messageListType === 'thread'\n && Boolean(scheduledIds?.length)\n ),\n shouldSchedule: messageListType === 'scheduled',\n botKeyboardMessageId,\n botKeyboardPlaceholder: keyboardMessage?.keyboardPlaceholder,\n isForwarding: chatId === global.forwardMessages.toChatId,\n isPollModalOpen: global.isPollModalOpen,\n stickersForEmoji: global.stickers.forEmoji.stickers,\n groupChatMembers: chat?.fullInfo?.members,\n topInlineBotIds: global.topInlineBots?.userIds,\n currentUserId,\n lastSyncTime: global.lastSyncTime,\n contentToBeScheduled: global.messages.contentToBeScheduled,\n shouldSuggestStickers,\n recentEmojis: global.recentEmojis,\n baseEmojiKeywords: baseEmojiKeywords?.keywords,\n emojiKeywords: emojiKeywords?.keywords,\n serverTimeOffset: global.serverTimeOffset,\n inlineBots: global.inlineBots.byUsername,\n isInlineBotLoading: global.inlineBots.isLoading,\n chatBotCommands: chat && chat.fullInfo && chat.fullInfo.botCommands,\n botCommands: chatBot && chatBot.fullInfo ? (chatBot.fullInfo.botCommands || false) : undefined,\n sendAsUser,\n sendAsChat,\n sendAsId,\n };\n },\n)(Composer));\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\n\nimport { IS_SAFARI, IS_VOICE_RECORDING_SUPPORTED } from '../../../../util/environment';\nimport * as voiceRecording from '../../../../util/voiceRecording';\nimport captureEscKeyListener from '../../../../util/captureEscKeyListener';\n\ntype ActiveVoiceRecording = { stop: () => Promise; pause: NoneToVoidFunction } | undefined;\n\nconst useVoiceRecording = () => {\n // eslint-disable-next-line no-null/no-null\n const recordButtonRef = useRef(null);\n const [activeVoiceRecording, setActiveVoiceRecording] = useState();\n const startRecordTimeRef = useRef();\n const [currentRecordTime, setCurrentRecordTime] = useState();\n\n useEffect(() => {\n // Preloading worker fixes silent first record on iOS\n if (IS_SAFARI && IS_VOICE_RECORDING_SUPPORTED) {\n void voiceRecording.init();\n }\n }, []);\n\n const startRecordingVoice = useCallback(async () => {\n try {\n const { stop, pause } = await voiceRecording.start((tickVolume: number) => {\n if (recordButtonRef.current) {\n if (startRecordTimeRef.current && Date.now() % 4 === 0) {\n recordButtonRef.current.style.boxShadow = `0 0 0 ${(tickVolume || 0) * 50}px rgba(0,0,0,.15)`;\n }\n setCurrentRecordTime(Date.now());\n }\n });\n startRecordTimeRef.current = Date.now();\n setCurrentRecordTime(Date.now());\n\n setActiveVoiceRecording({ stop, pause });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }, []);\n\n const pauseRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n try {\n return activeVoiceRecording!.pause();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n const stopRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n setActiveVoiceRecording(undefined);\n startRecordTimeRef.current = undefined;\n setCurrentRecordTime(undefined);\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n try {\n return activeVoiceRecording!.stop();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n useEffect(() => {\n return activeVoiceRecording ? captureEscKeyListener(stopRecordingVoice) : undefined;\n }, [activeVoiceRecording, stopRecordingVoice]);\n\n return {\n startRecordingVoice,\n pauseRecordingVoice,\n stopRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef,\n startRecordTimeRef,\n };\n};\n\nexport default useVoiceRecording;\n","import { useEffect, useMemo } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/environment';\n\nimport parseEmojiOnlyString from '../../../common/helpers/parseEmojiOnlyString';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\n\nexport default function useStickerTooltip(\n isAllowed: boolean,\n html: string,\n stickers?: ApiSticker[],\n isDisabled = false,\n) {\n const cleanHtml = useMemo(() => prepareForRegExp(html).trim(), [html]);\n const { loadStickersForEmoji, clearStickersForEmoji } = getDispatch();\n const isSingleEmoji = (\n (IS_EMOJI_SUPPORTED && parseEmojiOnlyString(cleanHtml) === 1)\n || (!IS_EMOJI_SUPPORTED && Boolean(html.match(/^]*?>$/g)))\n );\n const hasStickers = Boolean(stickers) && isSingleEmoji;\n\n useEffect(() => {\n if (isDisabled) return;\n\n if (isAllowed && isSingleEmoji) {\n loadStickersForEmoji({\n emoji: IS_EMOJI_SUPPORTED ? cleanHtml : cleanHtml.match(/alt=\"(.+)\"/)?.[1],\n });\n } else if (hasStickers || !isSingleEmoji) {\n clearStickersForEmoji();\n }\n // We omit `hasStickers` here to prevent re-fetching after manually closing tooltip (via ).\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [html, isSingleEmoji, clearStickersForEmoji, loadStickersForEmoji, isAllowed, isDisabled]);\n\n return {\n isStickerTooltipOpen: hasStickers,\n closeStickerTooltip: clearStickersForEmoji,\n };\n}\n","export default function deleteLastCharacterOutsideSelection(html: string) {\n const tempInput = document.createElement('div');\n tempInput.contentEditable = 'true';\n tempInput.style.position = 'absolute';\n tempInput.style.left = '-10000px';\n tempInput.style.top = '-10000px';\n tempInput.innerHTML = html;\n document.body.appendChild(tempInput);\n let element = tempInput.lastChild!;\n\n if (element.lastChild) {\n // Selects the last and the deepest child of the element.\n while (element.lastChild) {\n element = element.lastChild;\n }\n }\n\n // Gets length of the element's content.\n const textLength = element.textContent!.length;\n const range = document.createRange();\n const selection = window.getSelection()!;\n\n // Sets selection position to the end of the element.\n range.setStart(element, textLength);\n range.setEnd(element, textLength);\n selection.removeAllRanges();\n selection.addRange(range);\n document.execCommand('delete', false);\n\n const result = tempInput.innerHTML;\n document.body.removeChild(tempInput);\n\n return result;\n}\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../../api/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport parseMessageInput from '../../../../util/parseMessageInput';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport { hasMessageMedia } from '../../../../modules/helpers';\nimport { getTextWithEntitiesAsHtml } from '../../../common/helpers/renderTextWithEntities';\n\nconst useEditing = (\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n resetComposer: () => void,\n openDeleteModal: () => void,\n) => {\n const { editMessage } = getDispatch();\n\n // TODO useOnChange\n // Handle editing message\n useEffect(() => {\n if (!editedMessage) {\n setHtml('');\n return;\n }\n\n setHtml(getTextWithEntitiesAsHtml(editedMessage.content.text));\n\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }, [editedMessage, setHtml]);\n\n const handleEditComplete = useCallback(() => {\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!editedMessage) {\n return;\n }\n\n if (!text && !hasMessageMedia(editedMessage)) {\n openDeleteModal();\n return;\n }\n\n editMessage({\n messageId: editedMessage.id,\n text,\n entities,\n });\n\n resetComposer();\n }, [editMessage, editedMessage, htmlRef, openDeleteModal, resetComposer]);\n\n return handleEditComplete;\n};\n\nexport default useEditing;\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './MobileSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MobileSearchAsync: FC = (props) => {\n const { isActive } = props;\n const MobileSearch = useModuleLoader(Bundles.Extra, 'MobileSearch', !isActive, true);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MobileSearch ? : undefined;\n};\n\nexport default memo(MobileSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './MessageSelectToolbar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MessageSelectToolbarAsync: FC = (props) => {\n const { isActive } = props;\n const MessageSelectToolbar = useModuleLoader(Bundles.Extra, 'MessageSelectToolbar', !isActive);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MessageSelectToolbar ? : undefined;\n};\n\nexport default memo(MessageSelectToolbarAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './UnpinAllMessagesModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst UnpinAllMessagesModalAsync: FC = (props) => {\n const { isOpen } = props;\n const UnpinAllMessagesModal = useModuleLoader(Bundles.Extra, 'UnpinAllMessagesModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return UnpinAllMessagesModal ? : undefined;\n};\n\nexport default memo(UnpinAllMessagesModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './PaymentModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst PaymentModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PaymentModal = useModuleLoader(Bundles.Extra, 'PaymentModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PaymentModal ? : undefined;\n};\n\nexport default memo(PaymentModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ReceiptModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ReceiptModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ReceiptModal = useModuleLoader(Bundles.Extra, 'ReceiptModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ReceiptModal ? : undefined;\n};\n\nexport default memo(ReceiptModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './SeenByModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst SeenByModalAsync: FC = (props) => {\n const { isOpen } = props;\n const SeenByModal = useModuleLoader(Bundles.Extra, 'SeenByModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SeenByModal ? : undefined;\n};\n\nexport default memo(SeenByModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './EmojiInteractionAnimation';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst EmojiInteractionAnimationAsync: FC = (props) => {\n const { activeEmojiInteraction } = props;\n const EmojiInteractionAnimation = useModuleLoader(Bundles.Extra, 'EmojiInteractionAnimation',\n !activeEmojiInteraction);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return EmojiInteractionAnimation ? : undefined;\n};\n\nexport default memo(EmojiInteractionAnimationAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ReactorListModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ReactorListModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ReactorListModal = useModuleLoader(Bundles.Extra, 'ReactorListModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ReactorListModal ? : undefined;\n};\n\nexport default memo(ReactorListModalAsync);\n","import React, {\n FC, useEffect, useState, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';\nimport {\n MessageListType,\n MessageList as GlobalMessageList,\n ActiveEmojiInteraction,\n} from '../../global/types';\nimport { ThemeKey } from '../../types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n ANIMATION_LEVEL_MAX,\n ANIMATION_END_DELAY,\n DARK_THEME_BG_COLOR,\n LIGHT_THEME_BG_COLOR,\n ANIMATION_LEVEL_MIN,\n SUPPORTED_IMAGE_CONTENT_TYPES,\n} from '../../config';\nimport {\n IS_SINGLE_COLUMN_LAYOUT,\n IS_TABLET_COLUMN_LAYOUT,\n IS_TOUCH_ENV,\n MASK_IMAGE_DISABLED,\n} from '../../util/environment';\nimport { DropAreaState } from './composer/DropArea';\nimport {\n selectChat,\n selectChatBot,\n selectCurrentMessageList,\n selectCurrentTextSearch,\n selectIsChatBotNotStarted,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectIsUserBlocked,\n selectPinnedIds,\n selectTheme,\n} from '../../modules/selectors';\nimport {\n getCanPostInChat, getMessageSendingRestrictionReason, isChatChannel, isChatSuperGroup, isUserId,\n} from '../../modules/helpers';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport buildClassName from '../../util/buildClassName';\nimport { createMessageHash } from '../../util/routing';\nimport useCustomBackground from '../../hooks/useCustomBackground';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport usePrevious from '../../hooks/usePrevious';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport useOnChange from '../../hooks/useOnChange';\nimport calculateMiddleFooterTransforms from './helpers/calculateMiddleFooterTransforms';\n\nimport Transition from '../ui/Transition';\nimport MiddleHeader from './MiddleHeader';\nimport MessageList from './MessageList';\nimport ScrollDownButton from './ScrollDownButton';\nimport Composer from './composer/Composer';\nimport Button from '../ui/Button';\nimport MobileSearch from './MobileSearch.async';\nimport MessageSelectToolbar from './MessageSelectToolbar.async';\nimport UnpinAllMessagesModal from '../common/UnpinAllMessagesModal.async';\nimport PaymentModal from '../payment/PaymentModal.async';\nimport ReceiptModal from '../payment/ReceiptModal.async';\nimport SeenByModal from '../common/SeenByModal.async';\nimport EmojiInteractionAnimation from './EmojiInteractionAnimation.async';\nimport ReactorListModal from './ReactorListModal.async';\n\nimport './MiddleColumn.scss';\n\ntype StateProps = {\n chatId?: string;\n threadId?: number;\n messageListType?: MessageListType;\n isPrivate?: boolean;\n isPinnedMessageList?: boolean;\n isScheduledMessageList?: boolean;\n canPost?: boolean;\n currentUserBannedRights?: ApiChatBannedRights;\n defaultBannedRights?: ApiChatBannedRights;\n hasPinnedOrAudioPlayer?: boolean;\n pinnedMessagesCount?: number;\n theme: ThemeKey;\n customBackground?: string;\n backgroundColor?: string;\n patternColor?: string;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n isBackgroundBlurred?: boolean;\n isMobileSearchActive?: boolean;\n isSelectModeActive?: boolean;\n isPaymentModalOpen?: boolean;\n isReceiptModalOpen?: boolean;\n isSeenByModalOpen: boolean;\n isReactorListModalOpen: boolean;\n animationLevel?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n messageLists?: GlobalMessageList[];\n isChannel?: boolean;\n canSubscribe?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\nconst CLOSE_ANIMATION_DURATION = IS_SINGLE_COLUMN_LAYOUT ? 450 + ANIMATION_END_DELAY : undefined;\n\nfunction isImage(item: DataTransferItem) {\n return item.kind === 'file' && item.type && SUPPORTED_IMAGE_CONTENT_TYPES.has(item.type);\n}\n\nconst MiddleColumn: FC = ({\n chatId,\n threadId,\n messageListType,\n isPrivate,\n isPinnedMessageList,\n messageLists,\n canPost,\n currentUserBannedRights,\n defaultBannedRights,\n hasPinnedOrAudioPlayer,\n pinnedMessagesCount,\n customBackground,\n theme,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown,\n isBackgroundBlurred,\n isMobileSearchActive,\n isSelectModeActive,\n isPaymentModalOpen,\n isReceiptModalOpen,\n isSeenByModalOpen,\n isReactorListModalOpen,\n animationLevel,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n isChannel,\n canSubscribe,\n canStartBot,\n canRestartBot,\n activeEmojiInteractions,\n}) => {\n const {\n openChat,\n unpinAllMessages,\n loadUser,\n closeLocalTextSearch,\n exitMessageSelectMode,\n closePaymentModal,\n clearReceipt,\n joinChannel,\n sendBotCommand,\n restartBot,\n } = getDispatch();\n\n const { width: windowWidth } = useWindowSize();\n\n const lang = useLang();\n const [dropAreaState, setDropAreaState] = useState(DropAreaState.None);\n const [isFabShown, setIsFabShown] = useState();\n const [isNotchShown, setIsNotchShown] = useState();\n const [isUnpinModalOpen, setIsUnpinModalOpen] = useState(false);\n\n const hasTools = hasPinnedOrAudioPlayer && (\n windowWidth < MOBILE_SCREEN_MAX_WIDTH\n || (\n isRightColumnShown && windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ) || (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n )\n );\n\n const renderingChatId = usePrevDuringAnimation(chatId, CLOSE_ANIMATION_DURATION);\n const renderingThreadId = usePrevDuringAnimation(threadId, CLOSE_ANIMATION_DURATION);\n const renderingMessageListType = usePrevDuringAnimation(messageListType, CLOSE_ANIMATION_DURATION);\n const renderingCanSubscribe = usePrevDuringAnimation(canSubscribe, CLOSE_ANIMATION_DURATION);\n const renderingCanStartBot = usePrevDuringAnimation(canStartBot, CLOSE_ANIMATION_DURATION);\n const renderingCanRestartBot = usePrevDuringAnimation(canRestartBot, CLOSE_ANIMATION_DURATION);\n const renderingCanPost = usePrevDuringAnimation(canPost, CLOSE_ANIMATION_DURATION)\n && !renderingCanRestartBot && !renderingCanStartBot && !renderingCanSubscribe;\n const renderingHasTools = usePrevDuringAnimation(hasTools, CLOSE_ANIMATION_DURATION);\n const renderingIsFabShown = usePrevDuringAnimation(isFabShown, CLOSE_ANIMATION_DURATION);\n const renderingIsChannel = usePrevDuringAnimation(isChannel, CLOSE_ANIMATION_DURATION);\n\n const prevTransitionKey = usePrevious(currentTransitionKey);\n\n const cleanupExceptionKey = (\n prevTransitionKey !== undefined && prevTransitionKey < currentTransitionKey ? prevTransitionKey : undefined\n );\n\n const { isReady, handleOpenEnd, handleSlideStop } = useIsReady(\n !shouldSkipHistoryAnimations && animationLevel !== ANIMATION_LEVEL_MIN,\n currentTransitionKey,\n prevTransitionKey,\n chatId,\n );\n\n useEffect(() => {\n return chatId\n ? captureEscKeyListener(() => {\n openChat({ id: undefined });\n })\n : undefined;\n }, [chatId, openChat]);\n\n useOnChange(() => {\n setDropAreaState(DropAreaState.None);\n setIsFabShown(undefined);\n setIsNotchShown(undefined);\n }, [chatId]);\n\n // Fix for mobile virtual keyboard\n useEffect(() => {\n const { visualViewport } = window as any;\n if (!visualViewport) {\n return undefined;\n }\n\n const handleResize = () => {\n if (window.visualViewport.height !== document.documentElement.clientHeight) {\n document.body.classList.add('keyboard-visible');\n } else {\n document.body.classList.remove('keyboard-visible');\n }\n };\n\n visualViewport.addEventListener('resize', handleResize);\n\n return () => {\n visualViewport.removeEventListener('resize', handleResize);\n };\n }, []);\n\n useEffect(() => {\n if (isPrivate) {\n loadUser({ userId: chatId });\n }\n }, [chatId, isPrivate, loadUser]);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n const { items } = e.dataTransfer || {};\n const shouldDrawQuick = items && items.length > 0 && Array.from(items)\n // Filter unnecessary element for drag and drop images in Firefox (https://github.com/Ajaxy/telegram-tt/issues/49)\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#image\n .filter((item) => item.type !== 'text/uri-list')\n // As of September 2021, native clients suggest \"send quick, but compressed\" only for images\n .every(isImage);\n\n setDropAreaState(shouldDrawQuick ? DropAreaState.QuickFile : DropAreaState.Document);\n }, []);\n\n const handleHideDropArea = useCallback(() => {\n setDropAreaState(DropAreaState.None);\n }, []);\n\n const handleOpenUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(true);\n }, []);\n\n const closeUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(false);\n }, []);\n\n const handleUnpinAllMessages = useCallback(() => {\n unpinAllMessages({ chatId });\n closeUnpinModal();\n openChat({ id: chatId });\n }, [unpinAllMessages, openChat, closeUnpinModal, chatId]);\n\n const handleTabletFocus = useCallback(() => {\n openChat({ id: chatId });\n }, [openChat, chatId]);\n\n const handleSubscribeClick = useCallback(() => {\n joinChannel({ chatId });\n }, [joinChannel, chatId]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const customBackgroundValue = useCustomBackground(theme, customBackground);\n\n const className = buildClassName(\n renderingHasTools && 'has-header-tools',\n customBackground && 'custom-bg-image',\n backgroundColor && 'custom-bg-color',\n customBackground && isBackgroundBlurred && 'blurred',\n MASK_IMAGE_DISABLED ? 'mask-image-disabled' : 'mask-image-enabled',\n );\n\n const messagingDisabledClassName = buildClassName(\n 'messaging-disabled',\n !isSelectModeActive && 'shown',\n );\n\n const messageSendingRestrictionReason = getMessageSendingRestrictionReason(\n lang, currentUserBannedRights, defaultBannedRights,\n );\n\n // CSS Variables calculation doesn't work properly with transforms, so we calculate transform values in JS\n const {\n composerHiddenScale, toolbarHiddenScale,\n composerTranslateX, toolbarTranslateX,\n unpinHiddenScale, toolbarForUnpinHiddenScale,\n } = useMemo(\n () => calculateMiddleFooterTransforms(windowWidth, renderingCanPost),\n [renderingCanPost, windowWidth],\n );\n\n const footerClassName = buildClassName(\n 'middle-column-footer',\n !renderingCanPost && 'no-composer',\n renderingCanPost && isNotchShown && !isSelectModeActive && 'with-notch',\n );\n\n const closeChat = () => {\n openChat({ id: undefined }, { forceSyncOnIOs: true });\n };\n\n useHistoryBack(\n renderingChatId && renderingThreadId,\n closeChat, undefined, undefined, undefined,\n messageLists?.map(createMessageHash) || [],\n );\n\n useHistoryBack(isMobileSearchActive, closeLocalTextSearch);\n useHistoryBack(isSelectModeActive, exitMessageSelectMode);\n\n const isMessagingDisabled = Boolean(\n !isPinnedMessageList && !renderingCanPost && !renderingCanRestartBot && !renderingCanStartBot\n && !renderingCanSubscribe && messageSendingRestrictionReason,\n );\n const withMessageListBottomShift = Boolean(\n renderingCanRestartBot || renderingCanSubscribe || renderingCanStartBot || isPinnedMessageList,\n );\n const withExtraShift = Boolean(isMessagingDisabled || isSelectModeActive || isPinnedMessageList);\n\n return (\n \n \n
\n {renderingChatId && renderingThreadId && (\n <>\n
\n \n \n \n
\n {renderingCanPost && (\n \n )}\n {isPinnedMessageList && (\n
\n \n \n {lang('Chat.Pinned.UnpinAll', pinnedMessagesCount, 'i')}\n \n
\n )}\n {isMessagingDisabled && (\n
\n
\n \n {messageSendingRestrictionReason}\n \n
\n
\n )}\n {IS_SINGLE_COLUMN_LAYOUT && renderingCanSubscribe && (\n
\n \n {lang(renderingIsChannel ? 'ProfileJoinChannel' : 'ProfileJoinGroup')}\n \n
\n )}\n {IS_SINGLE_COLUMN_LAYOUT && renderingCanStartBot && (\n
\n \n {lang('BotStart')}\n \n
\n )}\n {IS_SINGLE_COLUMN_LAYOUT && renderingCanRestartBot && (\n
\n \n {lang('BotRestart')}\n \n
\n )}\n \n \n \n \n \n
\n \n\n \n
\n {IS_SINGLE_COLUMN_LAYOUT && }\n \n )}\n {chatId && (\n \n )}\n
\n {activeEmojiInteractions?.map((activeEmojiInteraction, i) => (\n \n ))}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const {\n isBlurred: isBackgroundBlurred, background: customBackground, backgroundColor, patternColor,\n } = global.settings.themes[theme] || {};\n\n const { messageLists } = global.messages;\n const currentMessageList = selectCurrentMessageList(global);\n const { isLeftColumnShown, chats: { listIds }, activeEmojiInteractions } = global;\n\n const state: StateProps = {\n theme,\n customBackground,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isBackgroundBlurred,\n isMobileSearchActive: Boolean(IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global)),\n isSelectModeActive: selectIsInSelectMode(global),\n isPaymentModalOpen: global.payment.isPaymentModalOpen,\n isReceiptModalOpen: Boolean(global.payment.receipt),\n isSeenByModalOpen: Boolean(global.seenByModal),\n isReactorListModalOpen: Boolean(global.reactorModal),\n animationLevel: global.settings.byKey.animationLevel,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n activeEmojiInteractions,\n };\n\n if (!currentMessageList || !listIds.active) {\n return state;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const bot = selectChatBot(global, chatId);\n const pinnedIds = selectPinnedIds(global, chatId);\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n\n const canPost = chat && getCanPostInChat(chat, threadId);\n const isBotNotStarted = selectIsChatBotNotStarted(global, chatId);\n const isPinnedMessageList = messageListType === 'pinned';\n const isScheduledMessageList = messageListType === 'scheduled';\n const isMainThread = messageListType === 'thread' && threadId === MAIN_THREAD_ID;\n const isChannel = Boolean(chat && isChatChannel(chat));\n const canSubscribe = Boolean(\n chat && isMainThread && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canRestartBot = Boolean(bot && selectIsUserBlocked(global, bot.id));\n const canStartBot = !canRestartBot && isBotNotStarted;\n\n return {\n ...state,\n chatId,\n threadId,\n messageListType,\n isPrivate: isUserId(chatId),\n canPost: !isPinnedMessageList && (!chat || canPost) && !isBotNotStarted,\n isPinnedMessageList,\n isScheduledMessageList,\n currentUserBannedRights: chat?.currentUserBannedRights,\n defaultBannedRights: chat?.defaultBannedRights,\n hasPinnedOrAudioPlayer: (\n threadId !== MAIN_THREAD_ID\n || Boolean(!isPinnedMessageList && pinnedIds?.length)\n || Boolean(audioChatId && audioMessageId)\n ),\n pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n messageLists,\n isChannel,\n canSubscribe,\n canStartBot,\n canRestartBot,\n };\n },\n)(MiddleColumn));\n\nfunction useIsReady(\n withAnimations?: boolean,\n currentTransitionKey?: number,\n prevTransitionKey?: number,\n chatId?: string,\n) {\n const [isReady, setIsReady] = useState(!IS_SINGLE_COLUMN_LAYOUT);\n const forceUpdate = useForceUpdate();\n\n const willSwitchMessageList = prevTransitionKey !== undefined && prevTransitionKey !== currentTransitionKey;\n if (willSwitchMessageList) {\n if (withAnimations) {\n setIsReady(false);\n } else {\n forceUpdate();\n }\n }\n\n useOnChange(() => {\n if (!withAnimations) {\n setIsReady(true);\n }\n }, [withAnimations]);\n\n function handleOpenEnd(e: React.TransitionEvent) {\n if (e.propertyName === 'transform' && e.target === e.currentTarget) {\n setIsReady(Boolean(chatId));\n }\n }\n\n function handleSlideStop() {\n setIsReady(true);\n }\n\n return {\n isReady: isReady && !willSwitchMessageList,\n handleOpenEnd: withAnimations ? handleOpenEnd : undefined,\n handleSlideStop: withAnimations ? handleSlideStop : undefined,\n };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ManagementScreens, ProfileState } from '../../types';\nimport { ApiExportedInvite } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectChat,\n selectCurrentGifSearch,\n selectCurrentStickerSearch,\n selectCurrentTextSearch,\n selectIsChatWithSelf,\n selectUser,\n} from '../../modules/selectors';\nimport {\n getCanAddContact, isChatAdmin, isChatChannel, isUserId,\n} from '../../modules/helpers';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\nimport { getDayStartAt } from '../../util/dateFormat';\n\nimport SearchInput from '../ui/SearchInput';\nimport Button from '../ui/Button';\nimport Transition from '../ui/Transition';\nimport ConfirmDialog from '../ui/ConfirmDialog';\n\nimport './RightHeader.scss';\n\ntype OwnProps = {\n chatId?: string;\n isColumnOpen?: boolean;\n isProfile?: boolean;\n isSearch?: boolean;\n isManagement?: boolean;\n isStickerSearch?: boolean;\n isGifSearch?: boolean;\n isPollResults?: boolean;\n isAddingChatMembers?: boolean;\n shouldSkipAnimation?: boolean;\n profileState?: ProfileState;\n managementScreen?: ManagementScreens;\n onClose: () => void;\n onScreenSelect: (screen: ManagementScreens) => void;\n};\n\ntype StateProps = {\n canAddContact?: boolean;\n canManage?: boolean;\n isChannel?: boolean;\n userId?: string;\n messageSearchQuery?: string;\n stickerSearchQuery?: string;\n gifSearchQuery?: string;\n isEditingInvite?: boolean;\n currentInviteInfo?: ApiExportedInvite;\n};\n\nconst COLUMN_CLOSE_DELAY_MS = 300;\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nenum HeaderContent {\n Profile,\n MemberList,\n SharedMedia,\n Search,\n Management,\n ManageInitial,\n ManageChannelSubscribers,\n ManageChatAdministrators,\n ManageChatPrivacyType,\n ManageDiscussion,\n ManageGroupPermissions,\n ManageGroupRemovedUsers,\n ManageChannelRemovedUsers,\n ManageGroupUserPermissionsCreate,\n ManageGroupUserPermissions,\n ManageGroupRecentActions,\n ManageGroupAdminRights,\n ManageGroupNewAdminRights,\n ManageGroupMembers,\n ManageGroupAddAdmins,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n ManageInvites,\n ManageEditInvite,\n ManageReactions,\n ManageInviteInfo,\n ManageJoinRequests,\n}\n\nconst RightHeader: FC = ({\n chatId,\n isColumnOpen,\n isProfile,\n isSearch,\n isManagement,\n isStickerSearch,\n isGifSearch,\n isPollResults,\n isAddingChatMembers,\n profileState,\n managementScreen,\n canAddContact,\n userId,\n canManage,\n isChannel,\n onClose,\n onScreenSelect,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n shouldSkipAnimation,\n isEditingInvite,\n currentInviteInfo,\n}) => {\n const {\n setLocalTextSearchQuery,\n setStickerSearchQuery,\n setGifSearchQuery,\n searchTextMessagesLocal,\n toggleManagement,\n openHistoryCalendar,\n addContact,\n setEditingExportedInvite,\n deleteExportedChatInvite,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const backButtonRef = useRef(null);\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n\n const handleEditInviteClick = useCallback(() => {\n setEditingExportedInvite({ chatId: chatId!, invite: currentInviteInfo! });\n onScreenSelect(ManagementScreens.EditInvite);\n }, [chatId, currentInviteInfo, onScreenSelect, setEditingExportedInvite]);\n\n const handleDeleteInviteClick = useCallback(() => {\n deleteExportedChatInvite({ chatId: chatId!, link: currentInviteInfo!.link });\n onScreenSelect(ManagementScreens.Invites);\n closeDeleteDialog();\n }, [chatId, closeDeleteDialog, currentInviteInfo, deleteExportedChatInvite, onScreenSelect]);\n\n const handleMessageSearchQueryChange = useCallback((query: string) => {\n setLocalTextSearchQuery({ query });\n\n if (query.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleStickerSearchQueryChange = useCallback((query: string) => {\n setStickerSearchQuery({ query });\n }, [setStickerSearchQuery]);\n\n const handleGifSearchQueryChange = useCallback((query: string) => {\n setGifSearchQuery({ query });\n }, [setGifSearchQuery]);\n\n const handleAddContact = useCallback(() => {\n addContact({ userId });\n }, [addContact, userId]);\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isColumnOpen);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isColumnOpen);\n }, COLUMN_CLOSE_DELAY_MS);\n }, [isColumnOpen]);\n\n const lang = useLang();\n const contentKey = isProfile ? (\n profileState === ProfileState.Profile ? (\n HeaderContent.Profile\n ) : profileState === ProfileState.SharedMedia ? (\n HeaderContent.SharedMedia\n ) : profileState === ProfileState.MemberList ? (\n HeaderContent.MemberList\n ) : -1 // Never reached\n ) : isSearch ? (\n HeaderContent.Search\n ) : isPollResults ? (\n HeaderContent.PollResults\n ) : isStickerSearch ? (\n HeaderContent.StickerSearch\n ) : isGifSearch ? (\n HeaderContent.GifSearch\n ) : isAddingChatMembers ? (\n HeaderContent.AddingMembers\n ) : isManagement ? (\n managementScreen === ManagementScreens.Initial ? (\n HeaderContent.ManageInitial\n ) : managementScreen === ManagementScreens.ChatPrivacyType ? (\n HeaderContent.ManageChatPrivacyType\n ) : managementScreen === ManagementScreens.Discussion ? (\n HeaderContent.ManageDiscussion\n ) : managementScreen === ManagementScreens.ChannelSubscribers ? (\n HeaderContent.ManageChannelSubscribers\n ) : managementScreen === ManagementScreens.GroupPermissions ? (\n HeaderContent.ManageGroupPermissions\n ) : managementScreen === ManagementScreens.ChatAdministrators ? (\n HeaderContent.ManageChatAdministrators\n ) : managementScreen === ManagementScreens.GroupRemovedUsers ? (\n HeaderContent.ManageGroupRemovedUsers\n ) : managementScreen === ManagementScreens.ChannelRemovedUsers ? (\n HeaderContent.ManageChannelRemovedUsers\n ) : managementScreen === ManagementScreens.GroupUserPermissionsCreate ? (\n HeaderContent.ManageGroupUserPermissionsCreate\n ) : managementScreen === ManagementScreens.GroupUserPermissions ? (\n HeaderContent.ManageGroupUserPermissions\n ) : managementScreen === ManagementScreens.GroupRecentActions ? (\n HeaderContent.ManageGroupRecentActions\n ) : managementScreen === ManagementScreens.ChatAdminRights ? (\n HeaderContent.ManageGroupAdminRights\n ) : managementScreen === ManagementScreens.ChatNewAdminRights ? (\n HeaderContent.ManageGroupNewAdminRights\n ) : managementScreen === ManagementScreens.GroupMembers ? (\n HeaderContent.ManageGroupMembers\n ) : managementScreen === ManagementScreens.Invites ? (\n HeaderContent.ManageInvites\n ) : managementScreen === ManagementScreens.EditInvite ? (\n HeaderContent.ManageEditInvite\n ) : managementScreen === ManagementScreens.GroupAddAdmins ? (\n HeaderContent.ManageGroupAddAdmins\n ) : managementScreen === ManagementScreens.Reactions ? (\n HeaderContent.ManageReactions\n ) : managementScreen === ManagementScreens.InviteInfo ? (\n HeaderContent.ManageInviteInfo\n ) : managementScreen === ManagementScreens.JoinRequests ? (\n HeaderContent.ManageJoinRequests\n ) : undefined // Never reached\n ) : undefined; // When column is closed\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true) ?? -1;\n\n function renderHeaderContent() {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case HeaderContent.PollResults:\n return

{lang('PollResults')}

;\n case HeaderContent.Search:\n return (\n <>\n \n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n \n );\n case HeaderContent.AddingMembers:\n return

{lang(isChannel ? 'ChannelAddSubscribers' : 'GroupAddMembers')}

;\n case HeaderContent.ManageInitial:\n return

{lang('Edit')}

;\n case HeaderContent.ManageChatPrivacyType:\n return

{lang(isChannel ? 'ChannelTypeHeader' : 'GroupTypeHeader')}

;\n case HeaderContent.ManageDiscussion:\n return

{lang('Discussion')}

;\n case HeaderContent.ManageChatAdministrators:\n return

{lang('ChannelAdministrators')}

;\n case HeaderContent.ManageGroupRecentActions:\n return

{lang('Group.Info.AdminLog')}

;\n case HeaderContent.ManageGroupAdminRights:\n return

{lang('EditAdminRights')}

;\n case HeaderContent.ManageGroupNewAdminRights:\n return

{lang('SetAsAdmin')}

;\n case HeaderContent.ManageGroupPermissions:\n return

{lang('ChannelPermissions')}

;\n case HeaderContent.ManageGroupRemovedUsers:\n return

{lang('BlockedUsers')}

;\n case HeaderContent.ManageChannelRemovedUsers:\n return

{lang('ChannelBlockedUsers')}

;\n case HeaderContent.ManageGroupUserPermissionsCreate:\n return

{lang('ChannelAddException')}

;\n case HeaderContent.ManageGroupUserPermissions:\n return

{lang('UserRestrictions')}

;\n case HeaderContent.ManageInvites:\n return

{lang('lng_group_invite_title')}

;\n case HeaderContent.ManageEditInvite:\n return

{isEditingInvite ? lang('EditLink') : lang('NewLink')}

;\n case HeaderContent.ManageInviteInfo:\n return (\n <>\n

{lang('InviteLink')}

\n
\n {currentInviteInfo && !currentInviteInfo.isRevoked && (\n \n \n \n )}\n {currentInviteInfo && currentInviteInfo.isRevoked && (\n <>\n \n \n \n \n \n )}\n
\n \n );\n case HeaderContent.ManageJoinRequests:\n return

{isChannel ? lang('SubscribeRequests') : lang('MemberRequests')}

;\n case HeaderContent.ManageGroupAddAdmins:\n return

{lang('Channel.Management.AddModerator')}

;\n case HeaderContent.StickerSearch:\n return (\n \n );\n case HeaderContent.GifSearch:\n return (\n \n );\n case HeaderContent.SharedMedia:\n return

{lang('SharedMedia')}

;\n case HeaderContent.ManageChannelSubscribers:\n return

{lang('ChannelSubscribers')}

;\n case HeaderContent.MemberList:\n case HeaderContent.ManageGroupMembers:\n return

{lang('GroupMembers')}

;\n case HeaderContent.ManageReactions:\n return

{lang('Reactions')}

;\n default:\n return (\n <>\n

Profile

\n
\n {canAddContact && (\n \n \n \n )}\n {canManage && (\n \n \n \n )}\n
\n \n );\n }\n }\n\n const isBackButton = (\n IS_SINGLE_COLUMN_LAYOUT\n || contentKey === HeaderContent.SharedMedia\n || contentKey === HeaderContent.MemberList\n || contentKey === HeaderContent.AddingMembers\n || isManagement\n );\n\n const buttonClassName = buildClassName(\n 'animated-close-icon',\n isBackButton && 'state-back',\n (shouldSkipTransition || shouldSkipAnimation) && 'no-transition',\n );\n\n return (\n
\n \n
\n \n \n {renderHeaderContent()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isProfile, isManagement }): StateProps => {\n const { query: messageSearchQuery } = selectCurrentTextSearch(global) || {};\n const { query: stickerSearchQuery } = selectCurrentStickerSearch(global) || {};\n const { query: gifSearchQuery } = selectCurrentGifSearch(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChannel = chat && isChatChannel(chat);\n const user = isProfile && chatId && isUserId(chatId) ? selectUser(global, chatId) : undefined;\n\n const canAddContact = user && getCanAddContact(user);\n const canManage = Boolean(\n !isManagement\n && isProfile\n && !canAddContact\n && chat\n && !selectIsChatWithSelf(global, chat.id)\n // chat.isCreator is for Basic Groups\n && (isUserId(chat.id) || ((isChatAdmin(chat) || chat.isCreator) && !chat.isNotJoined)),\n );\n const isEditingInvite = Boolean(chatId && global.management.byChatId[chatId]?.editingInvite);\n const currentInviteInfo = chatId ? global.management.byChatId[chatId]?.inviteInfo?.invite : undefined;\n\n return {\n canManage,\n canAddContact,\n isChannel,\n userId: user?.id,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n isEditingInvite,\n currentInviteInfo,\n };\n },\n)(RightHeader));\n","import { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport {\n ApiChat, ApiChatMember, ApiMessage, ApiUser, ApiUserStatus,\n} from '../../../api/types';\nimport { ProfileTabType, SharedMediaType } from '../../../types';\n\nimport { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { getMessageContentIds, sortChatIds, sortUserIds } from '../../../modules/helpers';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nexport default function useProfileViewportIds(\n isRightColumnShown: boolean,\n loadMoreMembers: AnyToVoidFunction,\n loadCommonChats: AnyToVoidFunction,\n searchMessages: AnyToVoidFunction,\n tabType: ProfileTabType,\n mediaSearchType?: SharedMediaType,\n groupChatMembers?: ApiChatMember[],\n commonChatIds?: string[],\n usersById?: Record,\n userStatusesById?: Record,\n chatsById?: Record,\n chatMessages?: Record,\n foundIds?: number[],\n chatId?: string,\n lastSyncTime?: number,\n serverTimeOffset = 0,\n) {\n const resultType = tabType === 'members' || !mediaSearchType ? tabType : mediaSearchType;\n\n const memberIds = useMemo(() => {\n if (!groupChatMembers || !usersById || !userStatusesById) {\n return undefined;\n }\n\n return sortUserIds(\n groupChatMembers.map(({ userId }) => userId),\n usersById,\n userStatusesById,\n undefined,\n serverTimeOffset,\n );\n }, [groupChatMembers, serverTimeOffset, usersById, userStatusesById]);\n\n const chatIds = useMemo(() => {\n if (!commonChatIds || !chatsById) {\n return undefined;\n }\n\n return sortChatIds(commonChatIds, chatsById, true);\n }, [chatsById, commonChatIds]);\n\n const [memberViewportIds, getMoreMembers, noProfileInfoForMembers] = useInfiniteScrollForLoadableItems(\n resultType, loadMoreMembers, lastSyncTime, memberIds,\n );\n\n const [mediaViewportIds, getMoreMedia, noProfileInfoForMedia] = useInfiniteScrollForSharedMedia(\n 'media', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [documentViewportIds, getMoreDocuments, noProfileInfoForDocuments] = useInfiniteScrollForSharedMedia(\n 'documents', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [linkViewportIds, getMoreLinks, noProfileInfoForLinks] = useInfiniteScrollForSharedMedia(\n 'links', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [audioViewportIds, getMoreAudio, noProfileInfoForAudio] = useInfiniteScrollForSharedMedia(\n 'audio', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [voiceViewportIds, getMoreVoices, noProfileInfoForVoices] = useInfiniteScrollForSharedMedia(\n 'voice', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [commonChatViewportIds, getMoreCommonChats, noProfileInfoForCommonChats] = useInfiniteScrollForLoadableItems(\n resultType, loadCommonChats, lastSyncTime, chatIds,\n );\n\n let viewportIds: number[] | string[] | undefined;\n let getMore: AnyToVoidFunction | undefined;\n let noProfileInfo = false;\n\n switch (resultType) {\n case 'members':\n viewportIds = memberViewportIds;\n getMore = getMoreMembers;\n noProfileInfo = noProfileInfoForMembers;\n break;\n case 'commonChats':\n viewportIds = commonChatViewportIds;\n getMore = getMoreCommonChats;\n noProfileInfo = noProfileInfoForCommonChats;\n break;\n case 'media':\n viewportIds = mediaViewportIds;\n getMore = getMoreMedia;\n noProfileInfo = noProfileInfoForMedia;\n break;\n case 'documents':\n viewportIds = documentViewportIds;\n getMore = getMoreDocuments;\n noProfileInfo = noProfileInfoForDocuments;\n break;\n case 'links':\n viewportIds = linkViewportIds;\n getMore = getMoreLinks;\n noProfileInfo = noProfileInfoForLinks;\n break;\n case 'audio':\n viewportIds = audioViewportIds;\n getMore = getMoreAudio;\n noProfileInfo = noProfileInfoForAudio;\n break;\n case 'voice':\n viewportIds = voiceViewportIds;\n getMore = getMoreVoices;\n noProfileInfo = noProfileInfoForVoices;\n break;\n }\n\n return [resultType, viewportIds, getMore, noProfileInfo] as const;\n}\n\nfunction useInfiniteScrollForLoadableItems(\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n itemIds?: string[],\n) {\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n itemIds,\n undefined,\n MEMBERS_SLICE,\n );\n\n const isOnTop = !viewportIds || !itemIds || viewportIds[0] === itemIds[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n\nfunction useInfiniteScrollForSharedMedia(\n forSharedMediaType: SharedMediaType,\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n chatMessages?: Record,\n foundIds?: number[],\n) {\n const messageIdsRef = useRef();\n\n useOnChange(() => {\n if (currentResultType === forSharedMediaType && chatMessages && foundIds) {\n messageIdsRef.current = getMessageContentIds(\n chatMessages,\n foundIds,\n forSharedMediaType,\n );\n }\n }, [chatMessages, foundIds, currentResultType, forSharedMediaType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n messageIdsRef.current,\n undefined,\n forSharedMediaType === 'media' ? SHARED_MEDIA_SLICE : MESSAGE_SEARCH_SLICE,\n );\n\n const isOnTop = !viewportIds || !messageIdsRef.current || viewportIds[0] === messageIdsRef.current[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nimport { ProfileState } from '../../../types';\n\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport { throttle } from '../../../util/schedulers';\nimport useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps';\n\nconst TRANSITION_DURATION = 300;\nconst PROGRAMMATIC_SCROLL_TIMEOUT_MS = 350;\n\nconst runThrottledForScroll = throttle((cb) => cb(), 250, false);\n\nlet isScrollingProgrammatically = false;\n\nexport default function useProfileState(\n containerRef: { current: HTMLDivElement | null },\n tabType: string,\n profileState: ProfileState,\n onProfileStateChange: (state: ProfileState) => void,\n) {\n // Scroll to tabs if needed\n useEffectWithPrevDeps(([prevTabType]) => {\n if (prevTabType && prevTabType !== tabType) {\n const container = containerRef.current!;\n const tabsEl = container.querySelector('.TabList')!;\n if (container.scrollTop < tabsEl.offsetTop) {\n onProfileStateChange(tabType === 'members' ? ProfileState.MemberList : ProfileState.SharedMedia);\n isScrollingProgrammatically = true;\n fastSmoothScroll(container, tabsEl, 'start', undefined, undefined, undefined, TRANSITION_DURATION);\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n }\n }\n }, [tabType, onProfileStateChange]);\n\n // Scroll to top\n useEffectWithPrevDeps(([prevProfileState]) => {\n if (profileState !== ProfileState.Profile || profileState === prevProfileState) {\n return;\n }\n\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl || tabListEl.offsetTop > container.scrollTop) {\n return;\n }\n\n isScrollingProgrammatically = true;\n fastSmoothScroll(\n container,\n container.firstElementChild as HTMLElement,\n 'start',\n undefined,\n container.offsetHeight * 2,\n );\n\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n\n onProfileStateChange(profileState);\n }, [profileState]);\n\n const determineProfileState = useCallback(() => {\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl) {\n return;\n }\n\n let state: ProfileState = ProfileState.Profile;\n if (container.scrollTop >= tabListEl.offsetTop) {\n state = tabType === 'members'\n ? ProfileState.MemberList\n : ProfileState.SharedMedia;\n }\n\n onProfileStateChange(state);\n }, [containerRef, onProfileStateChange, tabType]);\n\n // Determine profile state when switching tabs\n useEffect(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n determineProfileState();\n }, [determineProfileState, tabType]);\n\n // Determine profile state when scrolling\n const handleScroll = useCallback(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n runThrottledForScroll(determineProfileState);\n }, [determineProfileState]);\n\n return { handleScroll };\n}\n","import React, {\n FC, useCallback, useEffect, useMemo, useRef, useState, memo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n MAIN_THREAD_ID,\n ApiMessage,\n ApiChat,\n ApiChatMember,\n ApiUser,\n ApiUserStatus,\n} from '../../api/types';\nimport {\n NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType, AudioOrigin,\n} from '../../types';\n\nimport {\n MEMBERS_SLICE,\n PROFILE_SENSITIVE_AREA,\n SHARED_MEDIA_SLICE,\n SLIDE_TRANSITION_DURATION,\n} from '../../config';\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isUserBot, isUserId,\n} from '../../modules/helpers';\nimport {\n selectChatMessages,\n selectChat,\n selectCurrentMediaSearch,\n selectIsRightColumnShown,\n selectTheme,\n selectActiveDownloadIds,\n selectUser,\n} from '../../modules/selectors';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport { getSenderName } from '../left/search/helpers/getSenderName';\nimport useCacheBuster from '../../hooks/useCacheBuster';\nimport useProfileViewportIds from './hooks/useProfileViewportIds';\nimport useProfileState from './hooks/useProfileState';\nimport useTransitionFixes from './hooks/useTransitionFixes';\nimport useAsyncRendering from './hooks/useAsyncRendering';\nimport useLang from '../../hooks/useLang';\n\nimport Transition from '../ui/Transition';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport TabList from '../ui/TabList';\nimport Spinner from '../ui/Spinner';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport ProfileInfo from '../common/ProfileInfo';\nimport Document from '../common/Document';\nimport Audio from '../common/Audio';\nimport ChatExtra from '../common/ChatExtra';\nimport Media from '../common/Media';\nimport WebLink from '../common/WebLink';\nimport NothingFound from '../common/NothingFound';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport DeleteMemberModal from './DeleteMemberModal';\nimport GroupChatInfo from '../common/GroupChatInfo';\n\nimport './Profile.scss';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\n\ntype OwnProps = {\n chatId: string;\n profileState: ProfileState;\n onProfileStateChange: (state: ProfileState) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n isChannel?: boolean;\n currentUserId?: string;\n resolvedUserId?: string;\n chatMessages?: Record;\n foundIds?: number[];\n mediaSearchType?: SharedMediaType;\n hasCommonChatsTab?: boolean;\n hasMembersTab?: boolean;\n areMembersHidden?: boolean;\n canAddMembers?: boolean;\n canDeleteMembers?: boolean;\n members?: ApiChatMember[];\n commonChatIds?: string[];\n chatsById: Record;\n usersById: Record;\n userStatusesById: Record;\n isRightColumnShown: boolean;\n isRestricted?: boolean;\n lastSyncTime?: number;\n serverTimeOffset: number;\n activeDownloadIds: number[];\n isChatProtected?: boolean;\n};\n\nconst TABS = [\n { type: 'media', title: 'SharedMediaTab2' },\n { type: 'documents', title: 'SharedFilesTab2' },\n { type: 'links', title: 'SharedLinksTab2' },\n { type: 'audio', title: 'SharedMusicTab2' },\n { type: 'voice', title: 'SharedVoiceTab2' },\n];\n\nconst HIDDEN_RENDER_DELAY = 1000;\nconst INTERSECTION_THROTTLE = 500;\n\nconst Profile: FC = ({\n chatId,\n profileState,\n onProfileStateChange,\n theme,\n isChannel,\n resolvedUserId,\n currentUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasCommonChatsTab,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n commonChatIds,\n members,\n usersById,\n userStatusesById,\n chatsById,\n isRightColumnShown,\n isRestricted,\n lastSyncTime,\n activeDownloadIds,\n serverTimeOffset,\n isChatProtected,\n}) => {\n const {\n setLocalMediaSearchType,\n loadMoreMembers,\n loadCommonChats,\n openChat,\n searchMediaMessagesLocal,\n openMediaViewer,\n openAudioPlayer,\n focusMessage,\n loadProfilePhotos,\n setNewChatMembersDialogState,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(0);\n const [deletingUserId, setDeletingUserId] = useState();\n\n const tabs = useMemo(() => ([\n ...(hasMembersTab ? [{\n type: 'members', title: isChannel ? 'ChannelSubscribers' : 'GroupMembers',\n }] : []),\n ...TABS,\n ...(hasCommonChatsTab ? [{\n type: 'commonChats', title: 'SharedGroupsTab2',\n }] : []),\n ]), [hasCommonChatsTab, hasMembersTab, isChannel]);\n const tabType = tabs[activeTab].type as ProfileTabType;\n\n const [resultType, viewportIds, getMore, noProfileInfo] = useProfileViewportIds(\n isRightColumnShown, loadMoreMembers, loadCommonChats, searchMediaMessagesLocal, tabType, mediaSearchType, members,\n commonChatIds, usersById, userStatusesById, chatsById, chatMessages, foundIds, chatId, lastSyncTime,\n serverTimeOffset,\n );\n const activeKey = tabs.findIndex(({ type }) => type === resultType);\n\n const { handleScroll } = useProfileState(containerRef, tabType, profileState, onProfileStateChange);\n\n const { applyTransitionFix, releaseTransitionFix } = useTransitionFixes(containerRef);\n\n const [cacheBuster, resetCacheBuster] = useCacheBuster();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleTransitionStop = useCallback(() => {\n releaseTransitionFix();\n resetCacheBuster();\n }, [releaseTransitionFix, resetCacheBuster]);\n\n const handleNewMemberDialogOpen = useCallback(() => {\n setNewChatMembersDialogState(NewChatMembersProgress.InProgress);\n }, [setNewChatMembersDialogState]);\n\n // Update search type when switching tabs\n useEffect(() => {\n setLocalMediaSearchType({ mediaType: tabType });\n }, [setLocalMediaSearchType, tabType]);\n\n const profileId = resolvedUserId || chatId;\n\n useEffect(() => {\n if (lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [loadProfilePhotos, profileId, lastSyncTime]);\n\n const handleSelectMedia = useCallback((messageId: number) => {\n openMediaViewer({\n chatId: profileId,\n threadId: MAIN_THREAD_ID,\n messageId,\n origin: MediaViewerOrigin.SharedMedia,\n });\n }, [profileId, openMediaViewer]);\n\n const handlePlayAudio = useCallback((messageId: number) => {\n openAudioPlayer({ chatId: profileId, messageId });\n }, [profileId, openAudioPlayer]);\n\n const handleMemberClick = useCallback((id: string) => {\n openChat({ id });\n }, [openChat]);\n\n const handleMessageFocus = useCallback((messageId: number) => {\n focusMessage({ chatId: profileId, messageId });\n }, [profileId, focusMessage]);\n\n const handleDeleteMembersModalClose = useCallback(() => {\n setDeletingUserId(undefined);\n }, []);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.Profile',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveTab(Math.min(activeTab + 1, tabs.length - 1));\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveTab(Math.max(0, activeTab - 1));\n return true;\n }\n\n return false;\n }),\n });\n }, [activeTab, tabs.length]);\n\n let renderingDelay;\n const isFirstTab = resultType === 'members' || (!hasMembersTab && resultType === 'media');\n // @optimization Used to unparallelize rendering of message list and profile media\n if (isFirstTab) {\n renderingDelay = !isRightColumnShown ? HIDDEN_RENDER_DELAY : 0;\n // @optimization Used to delay first render of secondary tabs while animating\n } else if (!viewportIds) {\n renderingDelay = SLIDE_TRANSITION_DURATION;\n }\n const canRenderContent = useAsyncRendering([chatId, resultType], renderingDelay);\n\n function getMemberContextAction(memberId: string) {\n return memberId === currentUserId || !canDeleteMembers ? undefined : [{\n title: lang('lng_context_remove_from_group'),\n icon: 'stop',\n handler: () => {\n setDeletingUserId(memberId);\n },\n }];\n }\n\n function renderContent() {\n if (!viewportIds || !canRenderContent || !chatMessages) {\n const noSpinner = isFirstTab && !canRenderContent;\n\n return (\n
\n {!noSpinner && }\n
\n );\n }\n\n if (!viewportIds.length) {\n let text: string;\n\n switch (resultType) {\n case 'members':\n text = areMembersHidden ? 'You have no access to group members list.' : 'No members found';\n break;\n case 'commonChats':\n text = lang('NoGroupsInCommon');\n break;\n case 'documents':\n text = lang('lng_media_file_empty');\n break;\n case 'links':\n text = lang('lng_media_link_empty');\n break;\n case 'audio':\n text = lang('lng_media_song_empty');\n break;\n case 'voice':\n text = lang('lng_media_audio_empty');\n break;\n default:\n text = lang('SharedMedia.EmptyTitle');\n }\n\n return (\n
\n \n
\n );\n }\n\n return (\n \n {resultType === 'media' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'documents' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'links' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'audio' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'voice' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'members' ? (\n (viewportIds as string[])!.map((id, i) => (\n handleMemberClick(id)}\n contextActions={getMemberContextAction(id)}\n >\n \n \n ))\n ) : resultType === 'commonChats' ? (\n (viewportIds as string[])!.map((id, i) => (\n openChat({ id })}\n >\n \n \n ))\n ) : undefined}\n
\n );\n }\n\n return (\n \n {!noProfileInfo && renderProfileInfo(chatId, resolvedUserId)}\n {!isRestricted && (\n \n \n {renderContent()}\n \n \n
\n )}\n\n {canAddMembers && (\n \n \n \n )}\n {canDeleteMembers && (\n \n )}\n \n );\n};\n\nfunction renderProfileInfo(chatId: string, resolvedUserId?: string) {\n return (\n
\n \n \n
\n );\n}\n\nfunction buildInfiniteScrollItemSelector(resultType: string) {\n return [\n // Used on first render\n `.shared-media-transition > div:only-child > .${resultType}-list > .scroll-item`,\n // Used after transition\n `.shared-media-transition > .Transition__slide--active > .${resultType}-list > .scroll-item`,\n ].join(', ');\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const chatMessages = selectChatMessages(global, chatId);\n const { currentType: mediaSearchType, resultsByType } = selectCurrentMediaSearch(global) || {};\n const { foundIds } = (resultsByType && mediaSearchType && resultsByType[mediaSearchType]) || {};\n\n const { byId: usersById, statusesById: userStatusesById } = global.users;\n const { byId: chatsById } = global.chats;\n\n const isGroup = chat && isChatGroup(chat);\n const isChannel = chat && isChatChannel(chat);\n const hasMembersTab = isGroup || (isChannel && isChatAdmin(chat!));\n const members = chat?.fullInfo?.members;\n const areMembersHidden = hasMembersTab && chat && chat.fullInfo && !chat.fullInfo.canViewMembers;\n const canAddMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'inviteUsers') || chat.isCreator);\n const canDeleteMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'banUsers') || chat.isCreator);\n const activeDownloadIds = selectActiveDownloadIds(global, chatId);\n\n let hasCommonChatsTab;\n let resolvedUserId;\n let user;\n if (isUserId(chatId)) {\n resolvedUserId = chatId;\n user = selectUser(global, resolvedUserId);\n hasCommonChatsTab = user && !user.isSelf && !isUserBot(user);\n }\n\n return {\n theme: selectTheme(global),\n isChannel,\n resolvedUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasCommonChatsTab,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n currentUserId: global.currentUserId,\n isRightColumnShown: selectIsRightColumnShown(global),\n isRestricted: chat?.isRestricted,\n lastSyncTime: global.lastSyncTime,\n serverTimeOffset: global.serverTimeOffset,\n activeDownloadIds,\n usersById,\n userStatusesById,\n chatsById,\n isChatProtected: chat?.isProtected,\n ...(hasMembersTab && members && { members }),\n ...(hasCommonChatsTab && user && { commonChatIds: user.commonChats?.ids }),\n };\n },\n)(Profile));\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nexport default function useTransitionFixes(\n containerRef: { current: HTMLDivElement | null },\n transitionElSelector = '.Transition.shared-media-transition',\n) {\n // Set `min-height` for shared media container to prevent jumping when switching tabs\n useEffect(() => {\n function setMinHeight() {\n const container = containerRef.current!;\n const transitionEl = container.querySelector(transitionElSelector);\n const tabsEl = container.querySelector('.TabList');\n if (transitionEl && tabsEl) {\n transitionEl.style.minHeight = `${container.offsetHeight - tabsEl.offsetHeight}px`;\n }\n }\n\n setMinHeight();\n\n window.addEventListener('resize', setMinHeight, false);\n\n return () => {\n window.removeEventListener('resize', setMinHeight, false);\n };\n }, [containerRef, transitionElSelector]);\n\n // Workaround for scrollable content flickering during animation.\n const applyTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n if (container.style.overflowY !== 'hidden') {\n const scrollBarWidth = container.offsetWidth - container.clientWidth;\n container.style.overflowY = 'hidden';\n container.style.marginRight = `${scrollBarWidth}px`;\n }\n }, [containerRef]);\n\n const releaseTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n container.style.overflowY = 'scroll';\n container.style.marginRight = '0';\n }, [containerRef]);\n\n return { applyTransitionFix, releaseTransitionFix };\n}\n","import { useCallback, useState } from '../lib/teact/teact';\n\nconst useCacheBuster = () => {\n const [cacheBuster, setCacheBuster] = useState(false);\n\n const updateCacheBuster = useCallback(() => {\n setCacheBuster((current) => !current);\n }, []);\n\n return [cacheBuster, updateCacheBuster] as const;\n};\n\nexport default useCacheBuster;\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './RightSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst RightSearchAsync: FC = (props) => {\n const RightSearch = useModuleLoader(Bundles.Extra, 'RightSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return RightSearch ? : ;\n};\n\nexport default memo(RightSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Management';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nimport Loading from '../../ui/Loading';\n\nconst ManagementAsync: FC = (props) => {\n const Management = useModuleLoader(Bundles.Extra, 'Management');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Management ? : ;\n};\n\nexport default memo(ManagementAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst StickerSearchAsync: FC = () => {\n const StickerSearch = useModuleLoader(Bundles.Extra, 'StickerSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSearch ? : ;\n};\n\nexport default memo(StickerSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst GifSearchAsync: FC = () => {\n const GifSearch = useModuleLoader(Bundles.Extra, 'GifSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return GifSearch ? : ;\n};\n\nexport default memo(GifSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst PollResultsAsync: FC = () => {\n const PollResults = useModuleLoader(Bundles.Extra, 'PollResults');\n\n return PollResults ? : ;\n};\n\nexport default memo(PollResultsAsync);\n","import React, {\n FC, useCallback, useMemo, memo, useState, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiChatMember, ApiUpdateConnectionStateType,\n} from '../../api/types';\nimport { NewChatMembersProgress } from '../../types';\n\nimport { unique } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport {\n filterUsersByName, isChatChannel, isUserBot, sortChatIds,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Picker from '../common/Picker';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport Spinner from '../ui/Spinner';\n\nimport './AddChatMembers.scss';\n\nexport type OwnProps = {\n chatId: string;\n isActive: boolean;\n onNextStep: (memberIds: string[]) => void;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n isChannel?: boolean;\n members?: ApiChatMember[];\n currentUserId?: string;\n chatsById: Record;\n localContactIds?: string[];\n searchQuery?: string;\n isLoading: boolean;\n isSearching?: boolean;\n localUserIds?: string[];\n globalUserIds?: string[];\n};\n\nconst AddChatMembers: FC = ({\n isChannel,\n connectionState,\n members,\n onNextStep,\n currentUserId,\n chatsById,\n localContactIds,\n isLoading,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n onClose,\n isActive,\n}) => {\n const { setUserSearchQuery, loadContactList } = getDispatch();\n\n const lang = useLang();\n const [selectedMemberIds, setSelectedMemberIds] = useState([]);\n const prevSelectedMemberIds = usePrevious(selectedMemberIds);\n const noPickerScrollRestore = prevSelectedMemberIds === selectedMemberIds;\n\n useEffect(() => {\n if (isActive && connectionState === 'connectionStateReady') {\n loadContactList();\n }\n }, [connectionState, isActive, loadContactList]);\n\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n return members ? members.map((member) => member.userId) : [];\n }, [members]);\n\n const handleFilterChange = useCallback((query: string) => {\n setUserSearchQuery({ query });\n }, [setUserSearchQuery]);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const filteredContactIds = localContactIds ? filterUsersByName(localContactIds, usersById, searchQuery) : [];\n\n return sortChatIds(\n unique([\n ...filteredContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((userId) => {\n const user = usersById[userId];\n\n // The user can be added to the chat if the following conditions are met:\n // the user has not yet been added to the current chat\n // AND it is not the current user,\n // AND (it is not found (user from global search) OR it is not a bot OR it is a bot,\n // but the current chat is not a channel AND the appropriate permission is set).\n return (\n !memberIds.includes(userId)\n && userId !== currentUserId\n && (!user || !isUserBot(user) || (!isChannel && user.canBeInvitedToGroup))\n );\n }),\n chatsById,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, currentUserId, memberIds, isChannel,\n ]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length) {\n setUserSearchQuery({ query: '' });\n onNextStep(selectedMemberIds);\n }\n }, [selectedMemberIds, setUserSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: chatsById } = global.chats;\n const { currentUserId, newChatMembersProgress, connectionState } = global;\n const isChannel = chat && isChatChannel(chat);\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalUserIds,\n localUserIds,\n } = global.userSearch;\n\n return {\n isChannel,\n members: chat?.fullInfo?.members,\n currentUserId,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n isLoading: newChatMembersProgress === NewChatMembersProgress.Loading,\n globalUserIds,\n localUserIds,\n connectionState,\n };\n },\n)(AddChatMembers));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ManagementScreens, NewChatMembersProgress, ProfileState, RightColumnContent,\n} from '../../types';\n\nimport { MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport {\n selectAreActiveChatsLoaded,\n selectCurrentMessageList,\n selectRightColumnContentKey,\n} from '../../modules/selectors';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport RightHeader from './RightHeader';\nimport Profile from './Profile';\nimport Transition from '../ui/Transition';\nimport RightSearch from './RightSearch.async';\nimport Management from './management/Management.async';\nimport StickerSearch from './StickerSearch.async';\nimport GifSearch from './GifSearch.async';\nimport PollResults from './PollResults.async';\nimport AddChatMembers from './AddChatMembers';\n\nimport './RightColumn.scss';\n\ntype StateProps = {\n contentKey?: RightColumnContent;\n chatId?: string;\n threadId?: number;\n isChatSelected: boolean;\n shouldSkipHistoryAnimations?: boolean;\n nextManagementScreen?: ManagementScreens;\n};\n\nconst CLOSE_ANIMATION_DURATION = 300;\nconst MAIN_SCREENS_COUNT = Object.keys(RightColumnContent).length / 2;\nconst MANAGEMENT_SCREENS_COUNT = Object.keys(ManagementScreens).length / 2;\n\nfunction blurSearchInput() {\n const searchInput = document.querySelector('.RightHeader .SearchInput input') as HTMLInputElement;\n if (searchInput) {\n searchInput.blur();\n }\n}\n\nconst RightColumn: FC = ({\n contentKey,\n chatId,\n threadId,\n isChatSelected,\n shouldSkipHistoryAnimations,\n nextManagementScreen,\n}) => {\n const {\n toggleChatInfo,\n toggleManagement,\n closeLocalTextSearch,\n setStickerSearchQuery,\n setGifSearchQuery,\n closePollResults,\n addChatMembers,\n setNewChatMembersDialogState,\n setEditingExportedInvite,\n setOpenedInviteInfo,\n requestNextManagementScreen,\n } = getDispatch();\n\n const { width: windowWidth } = useWindowSize();\n const [profileState, setProfileState] = useState(ProfileState.Profile);\n const [managementScreen, setManagementScreen] = useState(ManagementScreens.Initial);\n const [selectedChatMemberId, setSelectedChatMemberId] = useState();\n const [isPromotedByCurrentUser, setIsPromotedByCurrentUser] = useState();\n const isScrolledDown = profileState !== ProfileState.Profile;\n\n const isOpen = contentKey !== undefined;\n const isProfile = contentKey === RightColumnContent.ChatInfo;\n const isSearch = contentKey === RightColumnContent.Search;\n const isManagement = contentKey === RightColumnContent.Management;\n const isStickerSearch = contentKey === RightColumnContent.StickerSearch;\n const isGifSearch = contentKey === RightColumnContent.GifSearch;\n const isPollResults = contentKey === RightColumnContent.PollResults;\n const isAddingChatMembers = contentKey === RightColumnContent.AddingMembers;\n const isOverlaying = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN;\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isOpen);\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true, !isChatSelected) ?? -1;\n\n const close = useCallback((shouldScrollUp = true) => {\n switch (contentKey) {\n case RightColumnContent.AddingMembers:\n setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n break;\n case RightColumnContent.ChatInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n toggleChatInfo(undefined, { forceSyncOnIOs: true });\n break;\n case RightColumnContent.Management: {\n switch (managementScreen) {\n case ManagementScreens.Initial:\n toggleManagement();\n break;\n case ManagementScreens.ChatPrivacyType:\n case ManagementScreens.Discussion:\n case ManagementScreens.GroupPermissions:\n case ManagementScreens.GroupType:\n case ManagementScreens.ChatAdministrators:\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n case ManagementScreens.Invites:\n case ManagementScreens.Reactions:\n case ManagementScreens.JoinRequests:\n case ManagementScreens.ChannelRemovedUsers:\n setManagementScreen(ManagementScreens.Initial);\n break;\n case ManagementScreens.GroupUserPermissionsCreate:\n case ManagementScreens.GroupRemovedUsers:\n case ManagementScreens.GroupUserPermissions:\n setManagementScreen(ManagementScreens.GroupPermissions);\n setSelectedChatMemberId(undefined);\n setIsPromotedByCurrentUser(undefined);\n break;\n case ManagementScreens.ChatAdminRights:\n case ManagementScreens.ChatNewAdminRights:\n case ManagementScreens.GroupAddAdmins:\n case ManagementScreens.GroupRecentActions:\n setManagementScreen(ManagementScreens.ChatAdministrators);\n break;\n case ManagementScreens.EditInvite:\n case ManagementScreens.InviteInfo:\n setManagementScreen(ManagementScreens.Invites);\n setOpenedInviteInfo({ invite: undefined });\n setEditingExportedInvite({ chatId, invite: undefined });\n break;\n }\n\n break;\n }\n case RightColumnContent.Search: {\n blurSearchInput();\n closeLocalTextSearch();\n break;\n }\n case RightColumnContent.StickerSearch:\n blurSearchInput();\n setStickerSearchQuery({ query: undefined });\n break;\n case RightColumnContent.GifSearch: {\n blurSearchInput();\n setGifSearchQuery({ query: undefined });\n break;\n }\n case RightColumnContent.PollResults:\n closePollResults();\n break;\n }\n }, [\n contentKey, isScrolledDown, toggleChatInfo, closePollResults, setNewChatMembersDialogState,\n managementScreen, toggleManagement, closeLocalTextSearch, setStickerSearchQuery, setGifSearchQuery,\n setEditingExportedInvite, chatId, setOpenedInviteInfo,\n ]);\n\n const handleSelectChatMember = useCallback((memberId, isPromoted) => {\n setSelectedChatMemberId(memberId);\n setIsPromotedByCurrentUser(isPromoted);\n }, []);\n\n const handleAppendingChatMembers = useCallback((memberIds: string[]) => {\n addChatMembers({ chatId, memberIds });\n }, [addChatMembers, chatId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(close) : undefined), [isOpen, close]);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isOpen);\n }, CLOSE_ANIMATION_DURATION);\n }, [isOpen]);\n\n useEffect(() => {\n if (nextManagementScreen) {\n setManagementScreen(nextManagementScreen);\n requestNextManagementScreen(undefined);\n }\n }, [nextManagementScreen, requestNextManagementScreen]);\n\n // Close Right Column when it transforms into overlayed state on screen resize\n useEffect(() => {\n if (isOpen && isOverlaying) {\n close();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOverlaying]);\n\n // We need to clear profile state and management screen state, when changing chats\n useLayoutEffectWithPrevDeps(([prevChatId]) => {\n if (prevChatId !== chatId ) {\n setProfileState(ProfileState.Profile);\n setManagementScreen(ManagementScreens.Initial);\n }\n }, [chatId]);\n\n useHistoryBack(isChatSelected && (\n contentKey === RightColumnContent.ChatInfo\n || contentKey === RightColumnContent.Management\n || contentKey === RightColumnContent.AddingMembers\n ), () => close(false), toggleChatInfo);\n\n // eslint-disable-next-line consistent-return\n function renderContent(isActive: boolean) {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case RightColumnContent.AddingMembers:\n return (\n \n );\n case RightColumnContent.ChatInfo:\n return (\n \n );\n case RightColumnContent.Search:\n return ;\n case RightColumnContent.Management:\n return (\n \n );\n\n case RightColumnContent.StickerSearch:\n return ;\n case RightColumnContent.GifSearch:\n return ;\n case RightColumnContent.PollResults:\n return ;\n }\n }\n\n return (\n \n {isOverlaying && (\n
\n )}\n
\n \n \n {renderContent}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n const nextManagementScreen = chatId ? global.management.byChatId[chatId]?.nextScreen : undefined;\n\n return {\n contentKey: selectRightColumnContentKey(global),\n chatId,\n threadId,\n isChatSelected: Boolean(chatId && areActiveChatsLoaded),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n nextManagementScreen,\n };\n },\n)(RightColumn));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { Bundles } from '../../util/moduleLoader';\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\ninterface OwnProps {\n isOpen: boolean;\n}\n\nconst MediaViewerAsync: FC = ({ isOpen }) => {\n const MediaViewer = useModuleLoader(Bundles.Extra, 'MediaViewer', !isOpen);\n\n return MediaViewer ? : undefined;\n};\n\nexport default memo(MediaViewerAsync);\n","export default function download(url: string, filename: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n try {\n link.click();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err); // Suppress redundant \"Blob loading failed\" error popup on IOS\n }\n}\n","import { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { Thread } from '../../global/types';\nimport { ApiMediaFormat, ApiMessage } from '../../api/types';\n\nimport * as mediaLoader from '../../util/mediaLoader';\nimport download from '../../util/download';\nimport {\n getMessageContentFilename, getMessageMediaHash,\n} from '../../modules/helpers';\n\ntype StateProps = {\n activeDownloads: Record;\n messages: Record;\n threadsById: Record;\n }>;\n};\n\nconst startedDownloads = new Set();\n\nconst DownloadManager: FC = ({\n activeDownloads,\n messages,\n}) => {\n const { cancelMessageMediaDownload } = getDispatch();\n\n useEffect(() => {\n Object.entries(activeDownloads).forEach(([chatId, messageIds]) => {\n const activeMessages = messageIds.map((id) => messages[Number(chatId)].byId[id]);\n activeMessages.forEach((message) => {\n const downloadHash = getMessageMediaHash(message, 'download');\n if (!downloadHash) {\n cancelMessageMediaDownload({ message });\n return;\n }\n\n if (!startedDownloads.has(downloadHash)) {\n const mediaData = mediaLoader.getFromMemory(downloadHash);\n if (mediaData) {\n startedDownloads.delete(downloadHash);\n download(mediaData, getMessageContentFilename(message));\n cancelMessageMediaDownload({ message });\n return;\n }\n\n mediaLoader.fetch(downloadHash, ApiMediaFormat.BlobUrl, true).then((result) => {\n startedDownloads.delete(downloadHash);\n if (result) {\n download(result, getMessageContentFilename(message));\n }\n cancelMessageMediaDownload({ message });\n });\n\n startedDownloads.add(downloadHash);\n }\n });\n });\n }, [\n cancelMessageMediaDownload,\n messages,\n activeDownloads,\n ]);\n\n return undefined;\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const activeDownloads = global.activeDownloads.byChatId;\n const messages = global.messages.byChatId;\n return {\n activeDownloads,\n messages,\n };\n },\n)(DownloadManager));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst NotificationsAsync: FC = ({ isOpen }) => {\n const Notifications = useModuleLoader(Bundles.Extra, 'Notifications', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Notifications ? : undefined;\n};\n\nexport default memo(NotificationsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DialogsAsync: FC = ({ isOpen }) => {\n const Dialogs = useModuleLoader(Bundles.Extra, 'Dialogs', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Dialogs ? : undefined;\n};\n\nexport default memo(DialogsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './ForwardPicker';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ForwardPickerAsync: FC = (props) => {\n const { isOpen } = props;\n const ForwardPicker = useModuleLoader(Bundles.Extra, 'ForwardPicker', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ForwardPicker ? : undefined;\n};\n\nexport default memo(ForwardPickerAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './SafeLinkModal';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst SafeLinkModalAsync: FC = (props) => {\n const { url } = props;\n const SafeLinkModal = useModuleLoader(Bundles.Extra, 'SafeLinkModal', !url);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SafeLinkModal ? : undefined;\n};\n\nexport default memo(SafeLinkModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './HistoryCalendar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HistoryCalendarAsync: FC = (props) => {\n const { isOpen } = props;\n const HistoryCalendar = useModuleLoader(Bundles.Extra, 'HistoryCalendar', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HistoryCalendar ? : undefined;\n};\n\nexport default memo(HistoryCalendarAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './GroupCall';\n\nconst GroupCallAsync: FC = (props) => {\n const { groupCallId } = props;\n const GroupCall = useModuleLoader(Bundles.Calls, 'GroupCall', !groupCallId);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return GroupCall ? : undefined;\n};\n\nexport default memo(GroupCallAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport { Bundles } from '../../util/moduleLoader';\n\ntype OwnProps = {\n groupCallId?: string;\n};\n\nconst ActiveCallHeaderAsync: FC = (props) => {\n const { groupCallId } = props;\n const ActiveCallHeader = useModuleLoader(Bundles.Calls, 'ActiveCallHeader', !groupCallId);\n\n return ActiveCallHeader ? : undefined;\n};\n\nexport default memo(ActiveCallHeaderAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport { Bundles } from '../../util/moduleLoader';\n\ntype OwnProps = {\n isOpen: boolean;\n};\n\nconst CallFallbackConfirmAsync: FC = ({ isOpen }) => {\n const CallFallbackConfirm = useModuleLoader(Bundles.Calls, 'CallFallbackConfirm', !isOpen);\n\n return CallFallbackConfirm ? : undefined;\n};\n\nexport default memo(CallFallbackConfirmAsync);\n","import React, {\n FC, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { LangCode } from '../../types';\nimport { ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport '../../modules/actions/all';\nimport {\n BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE,\n} from '../../config';\nimport {\n selectChatMessage,\n selectIsForwardModalOpen,\n selectIsMediaViewerOpen,\n selectIsRightColumnShown,\n selectIsServiceChatReady,\n} from '../../modules/selectors';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport buildClassName from '../../util/buildClassName';\nimport { fastRaf } from '../../util/schedulers';\nimport { waitForTransitionEnd } from '../../util/cssAnimationEndListeners';\nimport { processDeepLink } from '../../util/deeplink';\nimport stopEvent from '../../util/stopEvent';\nimport windowSize from '../../util/windowSize';\nimport { getAllNotificationsCount } from '../../util/folderManager';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../hooks/useBeforeUnload';\nimport useOnChange from '../../hooks/useOnChange';\nimport usePreventPinchZoomGesture from '../../hooks/usePreventPinchZoomGesture';\nimport { LOCATION_HASH } from '../../hooks/useHistoryBack';\n\nimport StickerSetModal from '../common/StickerSetModal.async';\nimport UnreadCount from '../common/UnreadCounter';\nimport LeftColumn from '../left/LeftColumn';\nimport MiddleColumn from '../middle/MiddleColumn';\nimport RightColumn from '../right/RightColumn';\nimport MediaViewer from '../mediaViewer/MediaViewer.async';\nimport AudioPlayer from '../middle/AudioPlayer';\nimport DownloadManager from './DownloadManager';\nimport Notifications from './Notifications.async';\nimport Dialogs from './Dialogs.async';\nimport ForwardPicker from './ForwardPicker.async';\nimport SafeLinkModal from './SafeLinkModal.async';\nimport HistoryCalendar from './HistoryCalendar.async';\nimport GroupCall from '../calls/group/GroupCall.async';\nimport ActiveCallHeader from '../calls/ActiveCallHeader.async';\nimport CallFallbackConfirm from '../calls/CallFallbackConfirm.async';\n\nimport './Main.scss';\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n authState?: ApiUpdateAuthorizationStateType;\n lastSyncTime?: number;\n isLeftColumnShown: boolean;\n isRightColumnShown: boolean;\n isMediaViewerOpen: boolean;\n isForwardModalOpen: boolean;\n hasNotifications: boolean;\n hasDialogs: boolean;\n audioMessage?: ApiMessage;\n safeLinkModalUrl?: string;\n isHistoryCalendarOpen: boolean;\n shouldSkipHistoryAnimations?: boolean;\n openedStickerSetShortName?: string;\n activeGroupCallId?: string;\n isServiceChatReady?: boolean;\n animationLevel: number;\n language?: LangCode;\n wasTimeFormatSetManually?: boolean;\n isCallFallbackConfirmOpen: boolean;\n addedSetIds?: string[];\n};\n\nconst NOTIFICATION_INTERVAL = 1000;\n\nlet notificationInterval: number | undefined;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_isLogged = false;\n\nconst Main: FC = ({\n connectionState,\n authState,\n lastSyncTime,\n isLeftColumnShown,\n isRightColumnShown,\n isMediaViewerOpen,\n isForwardModalOpen,\n hasNotifications,\n hasDialogs,\n audioMessage,\n activeGroupCallId,\n safeLinkModalUrl,\n isHistoryCalendarOpen,\n shouldSkipHistoryAnimations,\n openedStickerSetShortName,\n isServiceChatReady,\n animationLevel,\n language,\n wasTimeFormatSetManually,\n isCallFallbackConfirmOpen,\n addedSetIds,\n}) => {\n const {\n sync,\n loadAnimatedEmojis,\n loadNotificationSettings,\n loadNotificationExceptions,\n updateIsOnline,\n loadTopInlineBots,\n loadEmojiKeywords,\n loadCountryList,\n loadAvailableReactions,\n loadStickerSets,\n loadAddedStickers,\n loadFavoriteStickers,\n ensureTimeFormat,\n openStickerSetShortName,\n checkVersionNotification,\n loadAppConfig,\n } = getDispatch();\n\n if (DEBUG && !DEBUG_isLogged) {\n DEBUG_isLogged = true;\n // eslint-disable-next-line no-console\n console.log('>>> RENDER MAIN');\n }\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && authState === 'authorizationStateReady') {\n sync();\n }\n }, [connectionState, authState, sync]);\n\n // Initial API calls\n useEffect(() => {\n if (lastSyncTime) {\n updateIsOnline(true);\n loadAppConfig();\n loadAvailableReactions();\n loadAnimatedEmojis();\n loadNotificationSettings();\n loadNotificationExceptions();\n loadTopInlineBots();\n loadEmojiKeywords({ language: BASE_EMOJI_KEYWORD_LANG });\n }\n }, [\n lastSyncTime, loadAnimatedEmojis, loadEmojiKeywords, loadNotificationExceptions, loadNotificationSettings,\n loadTopInlineBots, updateIsOnline, loadAvailableReactions, loadAppConfig,\n ]);\n\n // Language-based API calls\n useEffect(() => {\n if (lastSyncTime) {\n if (language !== BASE_EMOJI_KEYWORD_LANG) {\n loadEmojiKeywords({ language });\n }\n\n loadCountryList({ langCode: language });\n }\n }, [language, lastSyncTime, loadCountryList, loadEmojiKeywords]);\n\n // Sticker sets\n useEffect(() => {\n if (lastSyncTime) {\n if (!addedSetIds) {\n loadStickerSets();\n loadFavoriteStickers();\n } else {\n loadAddedStickers();\n }\n }\n }, [lastSyncTime, addedSetIds, loadStickerSets, loadFavoriteStickers, loadAddedStickers]);\n\n // Check version when service chat is ready\n useEffect(() => {\n if (lastSyncTime && isServiceChatReady) {\n checkVersionNotification();\n }\n }, [lastSyncTime, isServiceChatReady, checkVersionNotification]);\n\n // Ensure time format\n useEffect(() => {\n if (lastSyncTime && !wasTimeFormatSetManually) {\n ensureTimeFormat();\n }\n }, [lastSyncTime, wasTimeFormatSetManually, ensureTimeFormat]);\n\n // Parse deep link\n useEffect(() => {\n if (lastSyncTime && LOCATION_HASH.startsWith('#?tgaddr=')) {\n processDeepLink(decodeURIComponent(LOCATION_HASH.substr('#?tgaddr='.length)));\n }\n }, [lastSyncTime]);\n\n // Prevent refresh by accidentally rotating device when listening to a voice chat\n useEffect(() => {\n if (!activeGroupCallId) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [activeGroupCallId]);\n\n const {\n transitionClassNames: middleColumnTransitionClassNames,\n } = useShowTransition(!isLeftColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const {\n transitionClassNames: rightColumnTransitionClassNames,\n } = useShowTransition(isRightColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const className = buildClassName(\n middleColumnTransitionClassNames.replace(/([\\w-]+)/g, 'middle-column-$1'),\n rightColumnTransitionClassNames.replace(/([\\w-]+)/g, 'right-column-$1'),\n shouldSkipHistoryAnimations && 'history-animation-disabled',\n );\n\n // Dispatch heavy transition event when opening middle column\n useOnChange(([prevIsLeftColumnShown]) => {\n if (prevIsLeftColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('MiddleColumn')!, dispatchHeavyAnimationEnd);\n }, [isLeftColumnShown]);\n\n // Dispatch heavy transition event and add body class when opening right column\n useOnChange(([prevIsRightColumnShown]) => {\n if (prevIsRightColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n fastRaf(() => {\n document.body.classList.add('animating-right-column');\n });\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('RightColumn')!, () => {\n dispatchHeavyAnimationEnd();\n\n fastRaf(() => {\n document.body.classList.remove('animating-right-column');\n });\n });\n }, [isRightColumnShown]);\n\n const handleBlur = useCallback(() => {\n updateIsOnline(false);\n\n const initialUnread = getAllNotificationsCount();\n let index = 0;\n\n clearInterval(notificationInterval);\n notificationInterval = window.setInterval(() => {\n if (document.title.includes(INACTIVE_MARKER)) {\n updateIcon(false);\n return;\n }\n\n if (index % 2 === 0) {\n const newUnread = getAllNotificationsCount() - initialUnread;\n if (newUnread > 0) {\n updatePageTitle(`${newUnread} notification${newUnread > 1 ? 's' : ''}`);\n updateIcon(true);\n }\n } else {\n updatePageTitle(PAGE_TITLE);\n updateIcon(false);\n }\n\n index++;\n }, NOTIFICATION_INTERVAL);\n }, [updateIsOnline]);\n\n const handleFocus = useCallback(() => {\n updateIsOnline(true);\n\n clearInterval(notificationInterval);\n notificationInterval = undefined;\n\n if (!document.title.includes(INACTIVE_MARKER)) {\n updatePageTitle(PAGE_TITLE);\n }\n\n updateIcon(false);\n }, [updateIsOnline]);\n\n const handleStickerSetModalClose = useCallback(() => {\n openStickerSetShortName({ stickerSetShortName: undefined });\n }, [openStickerSetShortName]);\n\n // Online status and browser tab indicators\n useBackgroundMode(handleBlur, handleFocus);\n useBeforeUnload(handleBlur);\n\n usePreventPinchZoomGesture(isMediaViewerOpen);\n\n return (\n
\n \n \n \n \n \n \n \n {audioMessage && }\n \n \n \n {activeGroupCallId && (\n <>\n \n \n \n )}\n \n \n \n
\n );\n};\n\nfunction updateIcon(asUnread: boolean) {\n document.querySelectorAll('link[rel=\"icon\"], link[rel=\"alternate icon\"]')\n .forEach((link) => {\n if (asUnread) {\n if (!link.href.includes('favicon-unread')) {\n link.href = link.href.replace('favicon', 'favicon-unread');\n }\n } else {\n link.href = link.href.replace('favicon-unread', 'favicon');\n }\n });\n}\n\n// For some reason setting `document.title` to the same value\n// causes increment of Chrome Dev Tools > Performance Monitor > DOM Nodes counter\nfunction updatePageTitle(nextTitle: string) {\n if (document.title !== nextTitle) {\n document.title = nextTitle;\n }\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { settings: { byKey: { animationLevel, language, wasTimeFormatSetManually } } } = global;\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n return {\n connectionState: global.connectionState,\n authState: global.authState,\n lastSyncTime: global.lastSyncTime,\n isLeftColumnShown: global.isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isMediaViewerOpen: selectIsMediaViewerOpen(global),\n isForwardModalOpen: selectIsForwardModalOpen(global),\n hasNotifications: Boolean(global.notifications.length),\n hasDialogs: Boolean(global.dialogs.length),\n audioMessage,\n safeLinkModalUrl: global.safeLinkModalUrl,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n openedStickerSetShortName: global.openedStickerSetShortName,\n isServiceChatReady: selectIsServiceChatReady(global),\n activeGroupCallId: global.groupCalls.activeGroupCallId,\n animationLevel,\n language,\n wasTimeFormatSetManually,\n isCallFallbackConfirmOpen: Boolean(global.groupCalls.isFallbackConfirmOpen),\n addedSetIds: global.stickers.added.setIds,\n };\n },\n)(Main));\n","import { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { DEBUG } from '../config';\n\nexport { default as Main } from '../components/main/Main';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH LOAD MAIN BUNDLE');\n}\n\nif (!getGlobal().connectionState) {\n getDispatch().initApi();\n}\n"],"names":["closeLocalTextSearch","global","chatId","threadId","selectCurrentMessageList","updateLocalTextSearch","replaceLocalTextSearchResults","undefined","addReducer","actions","payload","query","chatThreadKey","buildChatThreadKey","currentQuery","localTextSearch","byChatThreadKey","MEMO_EMPTY_ARRAY","mediaType","updateLocalMediaSearchType","id","type","shouldReplaceHistory","currentMessageList","replaceThreadParam","exitMessageSelectMode","messages","contentToBeScheduled","forwardMessages","toChatId","setGlobal","updateCurrentMessageList","isChatInfoShown","openChat","chatCreation","newChatMembersProgress","targetIndexDelta","orderedIds","position","indexOf","nextId","FOCUS_NO_HIGHLIGHT_DURATION","FAST_SMOOTH_MAX_DURATION","ANIMATION_END_DELAY","blurTimeout","copyTextForMessages","messageIds","lang","langProvider","chatMessages","selectChatMessages","result","map","filter","message","selectAllowedMessageActions","canCopy","sort","message1","message2","reduce","acc","sender","selectSender","push","getSenderTitle","getMessageSummaryText","copyTextToClipboard","join","scrollOffset","messageId","paramName","viewportIds","selectViewportIds","lastOwnEditableMessageId","findLast","Boolean","canEdit","replyingToId","selectReplyingToId","selectIsViewportNewest","chatMessageKeys","Object","keys","newIndex","toString","length","Number","MAIN_THREAD_ID","chat","selectChat","lastMessage","threadInfo","selectThreadInfo","lastMessageId","setReplyingToId","focusMessage","avatarOwnerId","profilePhotoIndex","origin","mediaViewer","volume","playbackRate","isMuted","audioPlayer","selectIsRightColumnShown","pollResults","voters","window","setTimeout","newGlobal","getGlobal","noHighlight","replyStack","selectReplyStack","pop","focusLastMessage","messageListType","groupedId","groupedChatId","replyMessageId","isResizingContainer","ids","selectForwardedMessageIdsByGroupId","shouldSwitchChat","clearTimeout","updateFocusedMessage","updateFocusDirection","FocusDirection","includes","direction","loadViewportMessages","fromChatId","groupedMessageIds","selectMessageIdsByGroupId","isModalShown","closeMediaViewer","selectedMessages","openForwardMenu","byChatId","activeDownloads","canDownload","forEach","downloadMessageMedia","selectCurrentChat","enterMessageSelectMode","childMessageIds","withShift","toggleMessageSelection","shouldShowContextMenuHint","disableContextMenuHint","showNotification","IS_TOUCH_ENV","isPollModalOpen","currentVersion","APP_VERSION","slice","serviceNotifications","find","version","SERVICE_NOTIFICATIONS_USER_ID","date","getServerTime","serverTimeOffset","content","text","parseMessageInput","versionNotification","isOutgoing","createServiceNotification","serviceChat","maxId","Math","max","fractionalPart","floor","serviceNotification","isUnread","apiUpdate","reactorModal","seenByModal","globalSearch","updateGlobalSearch","globalResults","localResults","resultsByType","fetchingStatus","chats","recentlyFoundChatIds","newRecentIds","unshift","updateGlobalSearchContent","stickers","search","resultIds","gifs","offsetId","results","updateUserSearch","globalUserIds","localUserIds","action","leftColumnWidth","management","isActive","screen","nextScreen","IS_SINGLE_COLUMN_LAYOUT","IS_TABLET_COLUMN_LAYOUT","isLeftColumnShown","messageLists","emoji","recentEmojis","newEmojis","e","sticker","recent","hash","newStickers","s","notification","localId","generateIdFor","newNotifications","notifications","existingNotificationIndex","findIndex","n","splice","data","hasErrorKey","getReadableErrorText","newDialogs","dialogs","existingErrorIndex","err","url","safeLinkModalUrl","selectedAt","historyCalendarSelectedAt","payment","isPaymentModalOpen","clearPayment","closeInvoice","error","uploadProgressCallbacks","Map","runDebouncedForMarkRead","debounce","cb","async","isOutlying","isBudgetPreload","addOffset","LoadMoreDirection","round","MESSAGE_LIST_SLICE","callApi","selectThreadOriginChat","limit","users","threadInfos","localMessages","allMessages","concat","byId","buildCollectionByKey","addChatMessagesById","updateOutlyingIds","updateListedIds","addUsers","addChats","updateThreadInfos","listedIds","selectListedIds","outlyingIds","selectOutlyingIds","areSortedArraysIntersecting","historyIds","newViewportIds","getViewportSlice","safeReplaceViewportIds","sourceIds","index","i","findClosestIndex","indexForDirection","from","to","areSomeLocal","areAllLocal","sendMessage","params","progressCallback","attachment","progress","messageLocalId","has","set","fileUploads","byMessageLocalId","replyingTo","IS_IOS","rafPromise","selectThreadTopMessageId","delete","isRestricted","Promise","resolve","loadWithBudget","selectFocusedMessageId","selectRealLastReadId","replyOriginForId","threadUpdate","MESSAGE_DELETED","replyMessage","selectChatMessage","updateChatMessage","replyToMessageId","loadMessage","isDeleting","updateThreadUnreadFromForwardedMessage","scheduledAt","noWebPage","selectNoWebPage","sendAs","selectSendAs","clearWebPagePreview","value","isSingle","attachments","isGrouped","restParams","entities","commonParams","groupedAttachments","split","MAX_MEDIA_FILES_FOR_ALBUM","firstAttachment","restAttachments","Date","now","selectEditingMessage","setEditingId","get","previousLocalId","cancelApiProgress","draft","replyToMsgId","updateChat","draftDate","localOnly","selectDraft","isUnpin","isOneSide","isSilent","unpinAllMessages","shouldDeleteForAll","editingId","selectEditingId","selectEditingScheduledId","activeChat","reason","description","peer","currentUserId","minId","selectFirstUnreadId","unreadCount","readCount","count","l","countSortedIds","lastReadInboxMessageId","webPagePreview","loadWebPagePreview","options","option","offset","shouldResetVoters","unique","user","offsets","nextOffset","loadPollOptionResults","fromChat","toChat","a","b","realMessages","m","isServiceNotificationMessage","poll","replaceScheduledMessages","loadScheduledHistory","selectScheduledMessage","loadPinnedMessages","seenByUserIds","sendAsId","sendAsChat","selectUser","fullInfo","sendAsIds","updateSponsoredMessage","selectSponsoredMessage","random","randomId","searchThrottled","throttle","searchGifs","updateGifSearch","added","addedStickers","updateStickerSets","sets","loadStickerSets","setIds","addedSetIds","cached","setsById","loadStickers","stickerSetId","pause","recentStickers","loadRecentStickers","favorite","favoriteStickers","loadFavoriteStickers","greeting","featured","featuredStickers","loadFeaturedStickers","stickerSetShortName","stickerSetAccessHash","stickerSet","selectStickerSet","accessHash","packs","updateStickerSet","currentEmoji","forEmoji","rebuildStickersForEmoji","replaceAnimatedEmojis","loadAnimatedEmojis","animatedEmojiEffects","loadAnimatedEmojiEffects","saved","savedGifs","loadSavedGifs","unfave","unfaveSticker","installedDate","language","currentEmojiKeywords","emojiKeywords","isLoading","fromVersion","keywords","searchStickers","title","searchWords","updateStickersForEmoji","loadStickersForEmoji","openedStickerSetShortName","searchMessagesGlobal","offsetRate","maxDate","minDate","localResult","GLOBAL_SEARCH_SLICE","totalCount","nextOffsetId","nextRate","currentSearchQuery","selectCurrentGlobalSearchQuery","updateGlobalSearchFetchingStatus","addMessages","updateGlobalSearchResults","searchSharedMedia","SHARED_MEDIA_SLICE","newFoundIds","currentSearch","selectCurrentMediaSearch","updateLocalMediaSearchResults","localChats","localUsers","globalChats","globalUsers","chatIds","userIds","searchChats","timestampPlusDay","foundIds","selectCurrentTextSearch","topMessageId","MESSAGE_SEARCH_SLICE","updateLocalTextSearchResults","searchTextMessages","currentType","currentResults","timestamp","getDispatch","searchMessagesByDate","ManagementProgress","username","updateManagementProgress","updateManagement","isUsernameAvailable","isChatBasicGroup","invite","editingInvite","update","inviteInfo","adminId","isRevoked","admin","revokedInvites","invites","link","expireDate","usageLimit","isRequestNeeded","oldInvite","newInvite","current","managementState","offsetDate","offsetUserId","offsetUser","currentInviteInfo","importers","isRequested","requesters","joinRequests","userId","isApproved","targetChat","importer","recentRequesterIds","requestsPending","releaseStatusTimeout","loadTopMessages","DEBUG","console","log","isSyncing","loadAllChats","preloadTopChatMessages","listType","shouldReplace","onReplace","areMessagesLoaded","draftsByChatId","currentChatId","currentThreadId","currentChat","newCurrentChatId","currentMessageListInfo","originChannelId","currentMessageListInfoOrigin","resultOrigin","byIdOrigin","listedIdsOrigin","threadsById","updateChats","updateUsers","audioChatId","audioMessageId","closeAudioPlayer","loadAndReplaceMessages","lastSyncTime","initFolderManager","runDebouncedForFetchFullUser","runThrottledForSearch","replaceInlineBotSettings","inlineBotSettings","inlineBots","byUsername","replaceInlineBotsIsLoading","userStatusesById","replaceUserStatuses","statusesById","topPeers","lastRequestedAt","loadTopUsers","contactList","getCompareString","lastName","firstName","collator","Intl","Collator","sortedUsers","compare","isSelf","loadContactList","isUserBot","commonChats","isFullyLoaded","updateUser","updateChatMutedState","phoneNumber","phone","updateContact","deleteContact","profileId","isPrivate","isUserId","photos","userSearch","updateUserSearchFetchingStatus","searchUsers","pick","runDebouncedForSearch","sendBotCommand","command","button","match","RE_TME_LINK","RE_TG_LINK","openTelegramLink","toggleSafeLinkModal","showDialog","alert","isError","answerCallbackButton","openPollModal","getReceipt","receiptMessageId","getPaymentForm","setInvoiceMessageInfo","openPaymentModal","bot","selectChatBot","removeBlockedContact","topInlineBots","inlineBotData","inlineBot","switchPm","canLoadMore","shouldReplaceSettings","newInlineBotData","currentIds","Set","newResults","help","isGallery","searchInlineBot","queryId","resultId","botId","param","startParam","replaceSettings","hasPassword","updateTwoFaSettings","hint","currentPassword","onSuccess","isSuccess","password","email","waitingEmailCodeLength","code","requestInfo","saveInfo","selectPaymentChatId","selectPaymentMessageId","shouldSave","shippingOptions","setRequestInfoId","updateShippingOptions","setPaymentStep","PaymentStep","validateRequestedInfo","setPaymentForm","step","invoice","shippingAddressRequested","nameRequested","phoneRequested","emailRequested","setReceipt","receipt","nativeProvider","credentials","publishableKey","selectProviderPublishableKey","k","buildQueryString","cardNumber","expiryMonth","expiryYear","cvv","zip","country","response","fetch","method","headers","Authorization","json","getStripeError","setStripeCardInfo","sendStripeCredentials","publicToken","selectProviderPublicToken","card","number","replace","expiration_month","expiration_year","security_code","DEBUG_PAYMENT_SMART_GLOCAL","Accept","body","JSON","stringify","status","setSmartGlocalCardInfo","token","sendSmartGlocalCredentials","shippingOptionId","saveCredentials","formId","selectPaymentFormId","requestInfoId","selectPaymentRequestId","requestedInfoId","sendPaymentForm","save","selectStripeCredentials","selectSmartGlocalCredentials","MAX_MESSAGES_LIST_WIDTH","SIDE_COLUMN_MAX_WIDTH","MIN_LEFT_COLUMN_WIDTH","subtractXForEmojiInteraction","x","windowWidth","windowSize","width","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","min","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","interactionLocalId","availableReaction","aroundAnimation","mediaLoader","ApiMediaFormat","centerIcon","availableReactions","y","localEffect","startSize","isReversed","activeEmojiInteraction","animatedEffect","INTERACTION_RANDOM_OFFSET","activeEmojiInteractions","interactions","emoticon","selectLocalAnimatedEmojiEffectByName","timestamps","reaction","selectDefaultReaction","isMessageLocal","sendReaction","isInDocumentGroup","isInAlbum","documentGroupFirstMessageId","reactions","some","isChosen","animationLevel","settings","byKey","ANIMATION_LEVEL_MAX","activeReactions","omit","recentReactions","canSeeList","addMessageReaction","appConfig","defaultReaction","reactors","areDeepEqual","value1","value2","type1","isArray1","Array","isArray","array1","array2","every","member1","object1","object2","key1","noTopChatsRequest","selectIsChatListed","loadTopChats","newProfilePhoto","closeMessageNotifications","selectChatListType","updateChatListIds","isNotJoined","requestChatUpdate","leaveChat","typingStatus","senderId","isFromScheduled","hasUnreadMention","unreadMentionsCount","notifyAboutMessage","getMessageRecentReaction","messageUpdate","channelId","selectCommonBoxChatId","folderId","ARCHIVED_FOLDER_ID","orderedPinnedIds","isPinned","newOrderedPinnedIds","MAX_ACTIVE_PINNED_CHATS","listIds","active","pinnedId","updateChatListType","folder","chatFoldersById","chatFolders","newChatFoldersById","newOrderedIds","orderedId","folders","recommended","replacedMembers","addedMember","deletedMemberId","shouldUpdate","members","deleteIndex","adminMembers","isOwner","isAdmin","membersCount","photo","formattedText","loadChatJoinRequests","ANIMATION_DELAY","updateWithLocalMedia","isScheduled","currentMessage","video","document","getMessageContent","blobUrl","thumbnail","isPreloadedGlobally","previewBlobUrl","updateScheduledMessage","updateThreadUnread","selectThreadByMessage","originMessage","updateListedAndViewportIds","firstMessageId","isUnreadChatNotLoaded","addViewportId","messagesCount","firstUnreadId","updateChatLastMessage","force","currentLastMessage","findLastMessage","deleteMessages","newLastMessage","threadIdsToUpdate","deleteChatMessages","requestThreadInfoUpdate","chatsIdsToUpdate","commonBoxChatId","shouldForceReply","updateThreadInfo","newMessage","isMessageInCurrentMessageList","delayedGlobal","getMessageText","localEmoji","selectLocalAnimatedEmoji","selectLocalAnimatedEmojiEffect","scheduledIds","selectScheduledIds","selectIsChatWithBot","selectScheduledMessages","deleteChatScheduledMessages","thread","markMessageListRead","currentPinnedIds","selectPinnedIds","newPinnedIds","newTheadInfo","messagesById","loadFullChat","scheduledMessages","deleteScheduledMessages","pollId","pollUpdate","selectChatMessageByPollId","updatedPoll","updatedResults","chosenAnswers","chosenAnswer","chosenAnswerIndex","recentVoterIds","totalVoters","newRecentVoterIds","newTotalVoters","targetOption","targetOptionIndex","updatedOption","votersCount","selectIsServiceChatReady","currentReactions","shouldNotify","checkIfReactionAdded","flushStatusUpdatesThrottled","pendingStatusUpdates","statusUpdate","targetUser","isBlocked","addBlockedContact","privacy","key","rules","setConfirmPaymentUrl","updateNotifySettings","peerType","shouldShowPreviews","addNotifyException","twoFaSettings","call","connectionState","groupCalls","activeGroupCallId","leaveGroupCall","shouldRemove","removeGroupCall","updateGroupCall","participantsCount","groupCallId","participants","participant","updateGroupCallParticipant","useBeforeUnload","callback","useEffect","onBeforeUnload","metaViewport","querySelector","defaultViewportContent","getAttribute","allowedZoomViewportContent","preventEvent","preventDefault","memo","isForAppBadge","useFolderManagerForUnreadCounters","unreadNotificationsCount","getAllNotificationsCount","updateAppBadge","className","formatIntegerCompact","ConnectionStatus","useConnectionStatus","hasMiddleHeader","isMinimized","isDisabled","isOnline","setIsOnline","useState","navigator","onLine","handleChange","addEventListener","removeEventListener","useBrowserOnline","syncing","online","waitingForNetwork","toLowerCase","connectionStatus","connectionStatusPosition","connectionStatusText","onClick","useLang","dir","isRtl","Spinner","color","Transition","activeKey","name","Button","size","ANIMATION_LEVEL_OPTIONS","withGlobal","searchQuery","chatsById","isConnectionStatusMinimized","globalSearchChatId","searchDate","theme","selectTheme","isMessageListOpen","areChatsLoaded","contactsFilter","onSearchQuery","onSelectSettings","onSelectContacts","onSelectArchived","onReset","shouldSkipTransition","openTipsChat","setGlobalSearchDate","setSettingOption","setGlobalSearchChatId","hasMenu","LeftColumnContent","selectedSearchDate","useMemo","formatDateToString","archivedUnreadChatsCount","values","total","isChatArchived","withOtherVersions","location","hostname","MainButton","onTrigger","isOpen","ripple","ariaLabel","buildClassName","handleSearchFocus","useCallback","toggleConnectionStatus","handleSelectSaved","handleDarkModeToggle","stopPropagation","newTheme","shouldUseSystemTheme","switchTheme","handleAnimationLevelChange","newLevel","_","classList","toggle","isSearchFocused","searchInputPlaceholder","DropdownMenu","trigger","footer","APP_NAME","APP_REVISION","MenuItem","icon","Switcher","label","checked","noAnimation","langCode","href","FEEDBACK_URL","setPermanentWebVersion","clearWebsync","disableHistoryBack","SearchInput","inputId","parentContainerClassName","focused","spinnerColor","spinnerBackgroundColor","placeholder","autoComplete","canClose","onChange","onFocus","onSpinnerClick","PickerSelectedItem","clickArg","chatOrUserId","ShowTransition","isCustom","orderedFolderIds","activeChatFolder","shouldSkipHistoryAnimations","foldersDispatch","onScreenSelect","loadChatFolders","setActiveChatFolder","transitionRef","useRef","displayedFolders","folderCountersById","folderTabs","ALL_FOLDER_ID","badgeCount","chatsCount","isBadgeActive","notificationsCount","handleSwitchTab","forceOnHeavyAnimation","captureEvents","selectorToPreventScroll","onSwipe","SwipeDirection","isNotInAllTabRef","captureEscKeyListener","useHistoryBack","handleKeyDown","ctrlKey","shiftKey","startsWith","digit","shouldRender","shouldRenderPlaceholder","transitionClassNames","useShowTransition","renderCurrentTab","activeFolder","ChatList","folderType","TabList","tabs","activeTab","onSwitchTab","ref","renderCount","props","LeftSearch","useModuleLoader","Bundles","Loading","ContactList","isShown","onNewPrivateChat","onNewChannel","onNewGroup","isMenuOpen","setIsMenuOpen","fabClassName","tabIndex","Menu","positionX","positionY","autoClose","onClose","TRANSITION_RENDER_COUNT","closeTimeout","onContentChange","isNewChatButtonShown","setIsNewChatButtonShown","isMouseInside","handleSelectSettings","handleSelectContacts","handleSelectNewChannel","handleSelectNewGroup","handleSelectArchived","handleMouseEnter","handleMouseLeave","autoCloseTimeout","shouldRenderUpdateButton","updateButtonClassNames","handleUpdateClick","isAppOutdated","markIsAppOutdated","useFlag","timeout","reload","useAppOutdatedCheck","onMouseEnter","onMouseLeave","shouldCleanup","cleanupExceptionKey","fluid","pill","Settings","NewChat","ArchivedChats","ContentType","RENDER_COUNT","setGlobalSearchQuery","resetChatCreation","loadPasswordInfo","clearTwoFaError","setLeftColumnWidth","resetLeftColumnWidth","resizeRef","setContent","settingsScreen","setSettingsScreen","SettingsScreens","setContactsFilter","foldersState","useFoldersReducer","lastResetTime","setLastResetTime","contentType","Main","Archived","NewChannel","NewGroup","handleReset","forceReturnToChatList","pickerSearchInput","getElementById","blur","handleSearchQuery","IS_MAC_OS","metaKey","getKeyFromEvent","initResize","resetResize","handleMouseUp","elementRef","onResize","initialWidth","markIsActive","unmarkIsActive","initialMouseX","setInitialMouseX","initialElementWidth","setInitialElementWidth","remove","style","handleMouseMove","event","newWidth","ceil","clientX","stopDrag","cleanup","offsetWidth","add","useResize","handleSettingsScreenSelect","LAYERS_ANIMATION_NAME","currentScreen","isChannel","onMouseDown","onMouseUp","onDoubleClick","setSize","handleResize","HeaderMenuContainer","isChatChannel","selectIsInSelectMode","noMenu","isChatWithSelf","selectIsChatWithSelf","isMainThread","isDiscussionThread","isRightColumnShown","canRestartBot","selectIsUserBlocked","canStartBot","selectIsChatBotNotStarted","canSubscribe","isChatSuperGroup","canSearch","canCall","ARE_CALLS_SUPPORTED","canMute","canLeave","canEnterVoiceChat","isCallActive","canCreateVoiceChat","adminRights","manageCall","isCreator","pendingJoinRequests","canExpandActions","joinChannel","openLocalTextSearch","restartBot","openCallFallbackConfirm","requestNextManagementScreen","menuButtonRef","menuPosition","setMenuPosition","handleHeaderMenuOpen","rect","getBoundingClientRect","right","bottom","handleHeaderMenuClose","handleHeaderMenuHide","handleSubscribeClick","handleStartBot","handleRestartBot","handleJoinRequestsClick","ManagementScreens","handleSearchClick","focus","searchInput","IS_PWA","disabled","anchor","withExtraActions","onSubscribeChannel","onSearchClick","onCloseAnimationEnd","useWebpThumbnail","thumbDataUri","getMessageMediaThumbDataUri","shouldDecodeThumbnail","isWebpSupported","thumbnailDecoded","setThumbnailDecoded","EMPTY_IMAGE_DATA_URI","useLayoutEffect","webpToPngBase64","then","catch","drawRect","height","radius","containerRef","markupParams","reverseIndex","barHeight","getBarHeight","markHeight","getMarkHeight","trackHeight","getTrackHeight","clipPathId","clipPath","d","getClipPath","markTranslateY","getMarkTranslateY","trackTranslateY","getTrackTranslateY","calculateMarkup","firstChild","firstElementChild","currentElement","transform","svg","div","defs","innerHTML","customTitle","onUnpinMessage","onAllPinnedClick","mediaThumbnail","mediaBlobUrl","useMedia","getMessageMediaHash","renderMessageSummary","isUnpinDialogOpen","openUnpinDialog","closeUnpinDialog","handleUnpinMessage","ConfirmDialog","confirmLabel","confirmHandler","getPictogramDimensions","src","alt","renderPictogram","RippleEffect","scaleImage","image","ratio","outputType","Blob","URL","createObjectURL","img","Image","onload","scale","blob","Error","finally","revokeObjectURL","steppedScale","bitmap","createImageBitmap","resizeWidth","resizeHeight","resizeQuality","res","canvas","createElement","ctx","getContext","transferFromImageBitmap","drawImage","toBlob","oc","octx","mul","cur","LOGO_DIMENSIONS","MINIMAL_SIZE","audio","voice","fileName","artist","performer","getTranslation","album","getChatTitle","audioCoverHash","getAudioHasCover","avatarHash","getChatAvatarHash","media","thumbnailSizes","preferred","AVATAR_FULL_DIMENSIONS","getCoverSize","fn","deps","defaultValue","setIsLoading","setError","setResult","wasCancelled","telegramLogoPath","resizeImage","makeGoodArtwork","useAsync","buildMediaMetadata","artwork","noUi","setAudioPlayerVolume","setAudioPlayerPlaybackRate","setAudioPlayerMuted","isVoice","senderName","mediaData","mediaMetadata","useMessageMediaMetadata","playPause","stop","isPlaying","requestNextTrack","requestPreviousTrack","isFirst","isLast","setVolume","toggleMuted","setPlaybackRate","useAudioPlayer","makeTrackId","getMediaDuration","isVoicePlaying","handleClick","handleClose","clearMediaSession","handleVolumeChange","handleVolumeClick","handlePlaybackClick","volumeIcon","renderText","renderAudio","subtitle","renderVoice","withClickPropagation","RangeSlider","groupCall","selectChatGroupCall","usersById","isLoaded","isCallNotEmpty","hasPinnedOffset","joinGroupCall","subscribeToGroupCallUpdates","handleJoinGroupCall","fetchedParticipants","isUser","subscribed","p","Avatar","audioMessage","pinnedIds","state","isSelectModeActive","isChatWithBot","currentTransitionKey","assign","pinnedMessageId","topMessageSender","selectForwardedSender","pinnedMessageIds","canUnpin","firstPinnedMessage","isReady","openChatWithInfo","pinMessage","openPreviousChat","toggleLeftColumn","isBackButtonActive","pinnedMessageIndex","setPinnedMessageIndex","pinnedMessage","pinnedMessagesCount","chatTitleLength","topMessageTitle","useEnsureMessage","useWindowSize","isLeftColumnHideable","shouldShowCloseButton","componentRef","shouldAnimateTools","handleHeaderClick","handlePinnedMessageClick","cycleRestrict","handleAllPinnedClick","setBackButtonActive","handleBackClick","messageInput","EDITABLE_INPUT_ID","canToolsCollideWithChatInfo","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MOBILE_SCREEN_MAX_WIDTH","shouldUseStackedToolsClass","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","shouldRenderAudioPlayer","audioPlayerClassNames","renderingAudioMessage","useCurrentOrPrev","shouldRenderPinnedMessage","pinnedMessageClassNames","renderingPinnedMessage","renderingPinnedMessagesCount","renderingCanUnpin","renderingPinnedMessageTitle","canRevealTools","componentEl","renderBackButton","asClose","withUnreadCounter","isAudioPlayerRendered","PrivateChatInfo","withDots","withFullInfo","withMediaViewer","withUpdatingStatus","noRtl","GroupChatInfo","getMessageKey","isAlbum","messageOrAlbum","groupMessages","currentAlbum","currentSenderGroup","currentDateGroup","originalDate","datetime","getDayStart","senderGroups","dateGroups","mainMessage","albumId","nextMessage","nextMessageDayStartsAt","isActionMessage","forwardInfo","senderUserId","hiddenUserName","inlineButtons","INTERSECTION_THROTTLE_FOR_MEDIA","IS_ANDROID","INTERSECTION_MARGIN_FOR_MEDIA","isEmojiOnlyMessage","customShape","getMinMediaWidth","hasText","hasCommentButton","calculateMediaDimensions","noAvatars","isOwn","isOwnMessage","isForwarded","isForwardedMessage","getMessagePhoto","getMessageWebPagePhoto","getMessageVideo","isWebPagePhoto","calculateInlineImageDimensions","calculateVideoDimensions","minMediaWidth","stretchFactor","finalWidth","finalHeight","isSmall","accumulate","list","initValue","accumulator","item","clamp","num","low","high","calculateContainerSize","layout","styles","dimensions","sides","calculateAlbumLayout","ratios","getRatios","proportions","getProportions","averageRatio","getAverageRatio","albumCount","forceCalc","maxWidth","getAvailableWidth","REM","minWidth","maxHeight","spacing","originalRatios","cropRatios","attempts","pushAttempt","lineCounts","heights","currentCount","attemptCount","sum","multiHeight","first","second","third","fourth","optimalAttempt","optimalDiff","lineCount","totalHeight","bad1","bad2","line","diff","abs","optimalCounts","optimalHeights","rowCount","row","colCount","lineHeight","col","layoutWithComplexLayouter","AlbumRectPart","layoutTwoTopBottom","layoutTwoLeftRightEqual","minimalWidth","secondWidth","firstWidth","layoutTwoLeftRight","layoutTwo","firstHeight","thirdHeight","secondHeight","rightWidth","leftWidth","layoutThreeLeftAndOther","layoutThreeTopAndOther","layoutThree","w","h0","h","w0","w2","w1","h1","layoutFourTopAndOther","h2","layoutFourLeftAndOther","layoutFour","containerStyle","element","calculateAuthorWidth","font","whiteSpace","left","opacity","appendChild","useFocusMessage","isFocused","focusDirection","noFocusHighlight","messagesContainer","closest","fastSmoothScroll","QUICK_REACTION_AREA_WIDTH","QUICK_REACTION_AREA_HEIGHT","GROUP_MESSAGE_HOVER_ATTRIBUTE","useOuterHandlers","selectMessage","isInSelectMode","canReply","isProtected","onContextMenu","handleBeforeContextMenu","isContextMenuShown","contentRef","shouldHandleMouseLeave","sendDefaultReaction","isQuickReactionVisible","markQuickReactionVisible","unmarkQuickReactionVisible","isSwiped","markSwiped","unmarkSwiped","doubleTapTimeoutRef","startedAt","onRelease","handleMouseDown","preventMessageInputBlur","clearInterval","pageX","pageY","handleDoubleTap","target","contains","handleTap","handleContextMenu","stopEvent","matches","handleDoubleClick","handleContentDoubleClick","container","clientY","isVisibleX","isVisibleY","handleSendQuickReaction","currentTarget","lastGroupElement","getLastElementInDocumentGroup","removeAttribute","handleDocumentGroupMouseLeave","handleDocumentGroupMouseEnter","setAttribute","nextElementSibling","ContextMenuContainer","targetUserIds","targetChatId","targetMessageId","targetMessage","selectIsMessageFocused","focusedMessage","isChat","senderUser","senderChat","observeIntersection","isEmbedded","appearanceOrder","isLastInList","useOnIntersect","noAppearanceAnimation","markShown","targetUsers","renderActionMessageText","asTextWithSpoilers","isContextMenuOpen","contextMenuPosition","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","customText","isIntersecting","useIsIntersecting","pictogramId","isRoundVideo","getMessageRoundVideo","senderTitle","draggable","activeReaction","isInMeta","stopActiveReaction","r","centerIconId","effectId","mediaDataCenterIcon","mediaDataEffect","shouldPlay","shouldRenderAnimation","animationClassNames","handleEnded","isAnimationLoaded","markAnimationLoaded","unmarkAnimationLoaded","shouldRenderStatic","ReactionStaticEmoji","AnimatedSticker","animationData","play","noLoop","onLoad","onEnded","outgoingStatus","signature","withReactions","withReactionOffset","reactionMessage","isActivated","markActivated","createDateTime","formatDateTimeToString","editDateTime","isEdited","editDate","forwardedDateTime","views","formatTime","MessageOutgoingStatus","observeIntersectionForPlaying","shouldLoop","isModalOpen","openModal","closeModal","isLottie","isGif","canDisplayGif","IS_WEBM_SUPPORTED","isMemojiSticker","NO_STICKER_SET_ID","shouldLoad","mediaHash","previewMediaHash","previewUrl","getMessageMediaFormat","isMediaLoaded","isLottieLoaded","markLottieLoaded","isMediaReady","useMediaTransition","getStickerDimensions","thumbClassName","stickerClassName","safePlay","autoPlay","playsInline","loop","muted","fromSticker","useBlurredMediaThumbRef","fullMediaData","useCanvasBlur","IS_CANVAS_FILTER_SUPPORTED","SELECTED_APPENDIX_COLORS","dark","outgoing","incoming","light","canAutoLoad","isSelected","uploadProgress","nonInteractive","shouldAffectAppendix","isDownloading","onCancelUpload","localBlobUrl","isLoadAllowed","setIsLoadAllowed","loadProgress","useMediaWithLoadProgress","thumbRef","downloadProgress","isUploading","isTransferring","transferProgress","getMediaTransferState","wasLoadDisabled","usePrevious","shouldRenderSpinner","spinnerClassNames","shouldRenderDownloadButton","downloadButtonClassNames","isAllowed","contentEl","inSelectMode","getImageData","getAppendixColorFromImage","getCustomAppendixBg","appendixBg","setProperty","ProgressSpinner","useVideoAutoPause","playerRef","canPlay","wasPlaying","paused","canPlayRef","freezePlaying","unfreezePlaying","unfreezePlayingOnRaf","fastRaf","useBackgroundMode","useHeavyAnimationCheck","canAutoPlay","videoRef","getMessageWebPageVideo","isPlayAllowed","setIsPlayAllowed","previewClassNames","isInline","isBuffered","bufferingHandlers","useBuffering","shouldRenderPlayButton","playButtonClassNames","playProgress","setPlayProgress","handleTimeUpdate","currentTime","duration","useVideoCleanup","cancelMessageMediaDownload","onTimeUpdate","formatMediaDuration","contact","countryList","phoneCodes","phoneCodeList","formatPhoneNumberWithCode","getPercentage","toFixed","answer","voteResults","maxVotersCount","correctResults","shouldAnimate","correctAnswer","showIcon","answerPercent","finalPercent","setFinalPercent","lineRef","lineWidth","isAnimationDoesNotStart","lineEl","svgEl","lineStyle","onSendVote","openPollResults","summary","isSubmitting","setIsSubmitting","chosenOptions","setChosenOptions","isSolutionShown","setIsSolutionShown","wasSubmitted","setWasSubmitted","closePeriod","setClosePeriod","closed","closeDate","countdownRef","hasVoted","canVote","canViewResult","isPublic","isMultiple","multipleChoice","answers","isCorrect","hidden","quiz","countdownEl","circumference","PI","lastElementChild","timerEl","strokeDashOffset","textContent","timer","recentVoters","handleRadioChange","handleCheckboxChange","handleVoteClick","handleViewResultsClick","handleSolutionShow","handleSolutionHide","solution","Notification","renderTextWithEntities","solutionEntities","onDismiss","containerId","question","getPollTypeString","CheckboxGroup","loadingOptions","RadioGroup","loadingOption","isQuiz","getReadableVotersCount","isText","inPreview","onMediaClick","onCancelMediaTransfer","webPage","getMessageWebPage","isSquarePhoto","handleMediaClick","siteName","displayUrl","isMediaInteractive","truncatedDescription","trimText","SafeLink","getMessageInvoice","amount","currency","isTest","photoUrl","formatCurrency","withSelectControl","WrappedComponent","ownProps","selectIsMessageSelected","handleMessageSelect","newProps","PhotoWithSelect","Photo","VideoWithSelect","Video","activeDownloadIds","selectActiveDownloadIds","uploadsById","hasCustomAppendix","albumLayout","cancelSendingMessage","mediaCount","handleCancelUpload","containerWidth","containerHeight","fileUpload","selectCanAutoLoadMedia","selectCanAutoPlayMedia","stopPrevious","playingProgressRef","shouldSpinnerRender","setIsActivated","setProgress","svgCenter","ROUND_VIDEO_DIMENSIONS_PX","playerEl","playingProgressEl","stopPlaying","capturePlaying","stopCurrentAudio","videoClassName","recentReplierIds","recentRepliers","peerId","hasUnread","recentReactors","recentReaction","isOutside","metaChildren","localSticker","soundId","playKey","useAnimatedEmoji","localStickerAnimationData","setLocalStickerAnimationData","getAnimationData","quality","APPENDIX_OWN","__html","APPENDIX_NOT_OWN","withSenderName","withAvatar","isLastInDocumentGroup","viaBotId","replyToChatId","isRepliesChat","isChatWithRepliesBot","chatUsername","forceSenderName","isAnonymousOwnMessage","canShowSender","originSender","botSender","threadTopMessageId","isThreadTop","shouldHideReply","replyMessageSender","selectUploadProgress","isForwarding","highlight","singleEmoji","getMessageSingleEmoji","selectIsDownloading","actualThreadInfo","selectIsMessageProtected","isSingleEmoji","animatedEmoji","selectAnimatedEmoji","animatedEmojiEffect","selectAnimatedEmojiEffect","animatedEmojiSoundId","selectAnimatedEmojiSound","isGroupSelected","selectIsDocumentGroupSelected","isPinnedList","canAutoLoadMedia","canAutoPlayMedia","autoLoadFileMaxSizeMb","shouldLoopStickers","selectShouldLoopStickers","selectOutgoingStatus","observeIntersectionForBottom","observeIntersectionForMedia","observeIntersectionForAnimatedStickers","areReactionsInMeta","noComments","isFirstInGroup","isLastInGroup","isFirstInDocumentGroup","clickInlineButton","bottomMarkerRef","isLocal","hasReply","isReplyMessage","hasThread","getMessageCustomShape","hasAnimatedEmoji","hasReactions","areReactionsEmpty","asForwarded","isLinkedChannelPost","isInDocumentGroupNotFirst","isInDocumentGroupNotLast","canShowActionButton","canForward","canFocus","isChannelPost","fromMessageId","withCommentButton","withQuickReactionButton","avatarPeer","senderPeer","handleAvatarClick","handleSenderClick","handleViaBotClick","handleReplyClick","handleAudioPlay","handleAlbumMediaClick","handleMetaClick","handleReadMedia","handleVoteSend","handleGroupForward","handleForward","handleFocus","handleFocusForwarded","handleDocumentGroupSelectAll","openMediaViewer","openAudioPlayer","markMessagesRead","sendPollVote","focusMessageInComments","replyToTopMessageId","channelPostId","MediaViewerOrigin","albumMessageId","selectWithGroupedId","useInnerHandlers","containerClassName","contentClassName","hasComments","hasActionButton","classNames","isMedia","isMediaWithNoText","isViaBot","isRound","buildContentClassName","withAppendix","textParts","renderMessageText","metaPosition","reactionsPosition","calculatedWidth","noMediaCorners","extraPadding","adminTitle","metaSafeAuthorWidth","renderReactionsAndMeta","meta","onMouseMove","isAvatarPeerUser","avatarUser","avatarChat","hiddenName","renderAvatar","textContentClass","senderColor","getUserColorKey","renderSenderName","AnimatedEmoji","effect","forceLoadPreview","Audio","AudioOrigin","isSelectable","onPlay","onReadMedia","Document","renderContent","dangerouslySetInnerHTML","isBot","channel","viewSponsoredMessage","openChatByInvite","startBot","shouldObserve","observe","useIntersectionObserver","rootRef","debounceMs","threshold","getUserFullName","chatInviteTitle","chatInviteHash","messageGroups","isViewportNewest","withUsers","anchorIdRef","memoUnreadDividerBeforeIdRef","memoFirstUnreadIdRef","isScrollingRef","isScrollPatchNeededRef","hasLinkedChat","isSchedule","onFabToggle","onNotchToggle","openHistoryCalendar","observeIntersectionForReading","throttleMs","margin","freeze","freezeForReading","unfreeze","unfreezeForReading","entries","mentionIds","entry","dataset","useMessageObservers","backwardsTriggerRef","forwardsTriggerRef","fabTriggerRef","loadMoreBackwards","loadMoreForwards","toggleScrollTools","offsetHeight","scrollHeight","scrollTop","scrollBottom","isAtBottom","MESSAGE_LIST_SENSITIVE_AREA","LOCAL_MESSAGE_ID_BASE","triggerEntry","IS_SCROLL_PATCH_NEEDED","observeIntersectionForFab","freezeForFab","unfreezeForFab","FAB_THRESHOLD","observeIntersectionForNotch","freezeForNotch","unfreezeForNotch","useOnChange","useScrollHooks","unreadDivider","messageCountToAnimate","messageGroup","flatten","appearanceIndex","dateGroup","dateGroupIndex","dateGroupsArray","senderGroup","senderGroupIndex","senderGroupsArray","compact","currentDocumentGroupId","messageIndex","isMessageAlbum","documentGroupId","nextDocumentGroupId","originalId","getMessageOriginalId","teactFastList","SCHEDULED_WHEN_ONLINE","formatHumanDate","dividend","getUserIdDividend","lastUnreadMessageId","loadGreetingStickers","handleStickerSelect","selectedSticker","StickerButton","isGroupChatJustCreated","renderScheduled","renderSavedMessages","renderGroup","runDebouncedForScroll","selectCurrentMessageIds","restrictionReason","focusingId","withLastMessageWhenPreloading","chatBot","botDescription","isChatLoaded","isChannelChat","isGroupChat","isChatGroup","threadFirstMessageId","selectFirstMessageId","linkedChatId","hasTools","canPost","withBottomShift","setScrollOffset","loadSponsoredMessages","loadMessageReactions","copyMessagesByIds","scrollOffsetRef","selectScrollOffset","anchorTopRef","listItemElementsRef","memoFocusingIdRef","isScrollTopJustUpdatedRef","shouldAnimateAppearanceRef","setContainerHeight","onTickEnd","handleCopy","getMessageIdsForSelectedText","useNativeCopySelectedMessages","listedMessages","orderBy","useInterval","loadMoreAround","isScrolled","updateStickyDates","markIsScrolled","runDebounced","useDebounce","currentStuck","stuckDateEl","allElements","querySelectorAll","containerTop","el","offsetTop","top","findStuckDate","useStickyDates","handleScroll","parentElement","observer","ResizeObserver","offsetParent","contentRect","disconnect","windowHeight","normalHeight","String","clientHeight","preservedItemElements","useLayoutEffectWithPrevDeps","prevMessageIds","prevIsViewportNewest","prevContainerHeight","hasLastMessageChanged","hasViewportShifted","wasMessageAdded","isAlreadyFocusing","shouldForceScroll","lastItemElement","bottomOffset","newScrollTop","isResized","isAnimatingScroll","patchChromiumScroll","resetScroll","useEffectWithPrevDeps","prevIsSelectModeActive","dispatchHeavyAnimationEvent","shouldRenderGreeting","onScroll","backgroundColor","withExtraShift","focusNextReply","messageElements","lastMessageElement","MAX_QUICK_IMG_SIZE","FILE_EXT_REGEX","buildAttachment","filename","isQuick","mimeType","quick","SUPPORTED_IMAGE_CONTENT_TYPES","preloadImage","resizedUrl","fetchBlob","SUPPORTED_VIDEO_CONTENT_TYPES","videoWidth","videoHeight","preloadVideo","createPosterForVideo","insertHtmlInSelection","html","selection","getSelection","getRangeAt","rangeCount","range","deleteContents","fragment","createContextualFragment","lastInsertedNode","lastChild","insertNode","setStartAfter","setEndAfter","collapse","removeAllRanges","addRange","resetInput","applyIosAutoCapitalizationFix","inputEl","POLYFILL_OPTIONS","encoderPath","reuseWorker","BLOB_PARAMS","opusRecorderPromise","OpusRecorder","mediaRecorder","init","default","start","analyzerCallback","startMediaRecorder","pausedAt","chunks","waveform","ondataavailable","typedArray","releaseAnalyzer","recorder","source","sourceNode","analyser","context","createAnalyser","fftSize","connect","dataLength","frequencyBinCount","dataArray","Uint8Array","isDestroyed","tick","getByteFrequencyData","requestAnimationFrame","subscribeToAnalyzer","reject","onstop","onerror","delayStop","CLIPBOARD_ACCEPTED_TYPES","useDebouncedMemo","resolverFn","ms","dependencies","setValue","isFrozen","INLINE_BOT_QUERY_REGEXP","HAS_NEW_LINE","MEMO_NO_RESULT","canShowHelp","usernameLowered","tempEl","runThrottled","RE_COMMAND","DeleteMessageModal","openTimeout","isFirstTimeActivation","onActivate","buttonProps","CalendarModal","AttachMenu","SymbolMenu","InlineBotTooltip","MentionTooltip","CustomSend","StickerTooltip","BotCommandTooltip","useMouseInside","isKeyboardSingleUse","forceOpen","markForceOpen","unmarkForceOpen","keyboardButtons","noCompact","forwardMessageIds","forwardedMessagesCount","exitForwardMode","canAnimate","useAsyncRendering","clearEmbedded","handleMessageClick","faded","AttachmentModal","BotCommandMenu","PollModal","DropArea","RE_LINK","RegExp","RE_LINK_TEMPLATE","messageText","toggleMessageWebPage","linkEntity","ApiMessageEntityTypes","textMatch","renderingWebPage","webPageWithoutPhoto","messageStub","SendAsMenu","MainButtonState","VOICE_RECORDING_FILENAME","chatUser","selectChatUser","REPLIES_USER_ID","messageWithActualBotKeyboard","selectNewestMessageWithBotKeyboardButtons","shouldSuggestStickers","baseEmojiKeywords","BASE_EMOJI_KEYWORD_LANG","botKeyboardMessageId","keyboardMessage","defaultSendAsId","anonymous","sendAsUser","editingMessage","canScheduleUntilOnline","selectUserStatus","wasOnline","withScheduledButton","shouldSchedule","botKeyboardPlaceholder","keyboardPlaceholder","stickersForEmoji","groupChatMembers","topInlineBotIds","isInlineBotLoading","chatBotCommands","botCommands","dropAreaState","onDropHide","clearDraft","setStickerSearchQuery","setGifSearchQuery","closePollModal","addRecentEmoji","sendInlineBotResult","loadSendAs","appendixRef","setHtml","htmlRef","useStateRef","lastMessageSendTimeSeconds","prevDropAreaState","isCalendarOpen","openCalendar","closeCalendar","scheduledMessageArgs","setScheduledMessageArgs","canShowSendAs","sendMessageAction","useSendMessageAction","shouldAnimateSendAsButtonRef","prevChatId","prevSendAsIds","setAttachments","isBotKeyboardOpen","openBotKeyboard","closeBotKeyboard","isBotCommandMenuOpen","openBotCommandMenu","closeBotCommandMenu","isAttachMenuOpen","openAttachMenu","closeAttachMenu","isSymbolMenuOpen","openSymbolMenu","closeSymbolMenu","isSendAsMenuOpen","openSendAsMenu","closeSendAsMenu","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isSymbolMenuLoaded","onSymbolMenuLoadingComplete","isHoverDisabled","disableHover","enableHover","startRecordingVoice","stopRecordingVoice","pauseRecordingVoice","activeVoiceRecording","currentRecordTime","recordButtonRef","mainButtonRef","startRecordTimeRef","setActiveVoiceRecording","setCurrentRecordTime","IS_SAFARI","IS_VOICE_RECORDING_SUPPORTED","voiceRecording","tickVolume","boxShadow","useVoiceRecording","SEND_MESSAGE_ACTION_INTERVAL","mainButtonState","Edit","Schedule","Send","Record","canShowCustomSendMenu","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","isInlineBotTooltipOpen","inlineBotId","isInlineBotTooltipGallery","inlineBotSwitchPm","inlineBotResults","closeTooltip","closeInlineBotTooltip","inlineBotHelp","loadMore","loadMoreForInlineBot","queryInlineBot","resetInlineBot","markIsOpen","unmarkIsOpen","innerText","getPlainText","parseBotQuery","prevQuery","prevUsername","useInlineBotTooltip","isBotCommandTooltipOpen","close","closeBotCommandTooltip","filteredBotCommands","botTooltipCommands","setFilteredBotCommands","getFilteredCommands","nextFilteredBotCommands","prepareForRegExp","substr","useBotCommandTooltip","isCustomSendMenuOpen","canSendStickers","canSendGifs","canAttachMedia","canAttachPolls","canAttachEmbedLinks","getAllowedAttachmentOptions","isChatAdmin","slowMode","getChatSlowModeOptions","isStickerTooltipOpen","closeStickerTooltip","cleanHtml","trim","clearStickersForEmoji","IS_EMOJI_SUPPORTED","parseEmojiOnlyString","hasStickers","useStickerTooltip","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","insertTextAndUpdateCursor","newHtml","selectionRange","isSelectionInsideInput","dispatchEvent","Event","bubbles","focusEditableElement","removeSymbol","execCommand","tempInput","contentEditable","textLength","createRange","setStart","setEnd","removeChild","deleteLastCharacterOutsideSelection","resetComposer","shouldPreserveInput","stopRecordingVoiceRef","handleEditComplete","editedMessage","editMessage","getTextWithEntitiesAsHtml","hasMessageMedia","useEditing","saveDraft","updateDraft","draftChatId","draftThreadId","currentHtml","runDebouncedForSaveDraft","DRAFT_DEBOUNCE","prevThreadId","prevHtml","handleBlur","useDraft","handlePaste","clipboardData","input","activeElement","EDITABLE_INPUT_MODAL_ID","pastedText","getData","substring","items","files","getFilesFromDataTransferItems","newAttachments","all","file","useClipboardPaste","handleFileSelect","handleAppendFiles","handleClearAttachment","handleSend","currentAttachments","record","maxLength","extraLength","textParams","nowSeconds","secondsSinceLastMessage","nextSendDateNotReached","nextSendDate","seconds","secondsRemaining","isSlowMode","handleActivateBotCommandMenu","handleActivateSymbolMenu","handleGifSelect","gif","handleInlineBotSelect","inlineResult","handleBotCommandSelect","handlePollSend","handleSilentSend","handleMessageSchedule","isWhenOnline","restArgs","getTime","handleMessageScheduleUntilOnline","handleCloseCalendar","handleSearchOpen","handleSymbolMenuOpen","handleSendAsMenuOpen","handleAllScheduledClick","mainButtonHandler","areVoiceMessagesNotAllowed","prevEditedMessage","renderedEditedMessage","scheduledDefaultDate","setSeconds","setMilliseconds","scheduledMaxDate","setFullYear","getFullYear","sendButtonAriaLabel","symbolMenuButtonClassName","onSend","DropAreaState","withQuick","onHide","onFileSelect","caption","onCaptionUpdate","onFileAppend","onClear","selectedSendAsId","onInsertUserName","filteredUsers","onSelectResult","withUsername","MessageInput","forcedPlaceholder","canAutoFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","formatVoiceRecordDuration","onStickerSelect","emojis","onEmojiSelect","onPollCreate","onGifSelect","onRemoveSymbol","onSearchOpen","onSilentSend","onScheduleSend","withTimePicker","maxAt","getDayStartAt","isFutureMode","secondButtonLabel","onSubmit","onSecondButtonClick","MobileSearch","MessageSelectToolbar","UnpinAllMessagesModal","PaymentModal","ReceiptModal","SeenByModal","EmojiInteractionAnimation","ReactorListModal","CLOSE_ANIMATION_DURATION","isImage","kind","isBlurred","isBackgroundBlurred","background","customBackground","patternColor","themes","isMobileSearchActive","isReceiptModalOpen","isSeenByModalOpen","isReactorListModalOpen","getCanPostInChat","isBotNotStarted","isPinnedMessageList","isScheduledMessageList","currentUserBannedRights","defaultBannedRights","hasPinnedOrAudioPlayer","loadUser","closePaymentModal","clearReceipt","setDropAreaState","isFabShown","setIsFabShown","isNotchShown","setIsNotchShown","isUnpinModalOpen","setIsUnpinModalOpen","renderingChatId","usePrevDuringAnimation","renderingThreadId","renderingMessageListType","renderingCanSubscribe","renderingCanStartBot","renderingCanRestartBot","renderingCanPost","renderingHasTools","renderingIsFabShown","renderingIsChannel","prevTransitionKey","handleOpenEnd","handleSlideStop","withAnimations","setIsReady","forceUpdate","useForceUpdate","willSwitchMessageList","propertyName","useIsReady","ANIMATION_LEVEL_MIN","visualViewport","documentElement","handleDragEnter","dataTransfer","shouldDrawQuick","handleHideDropArea","handleOpenUnpinModal","closeUnpinModal","handleUnpinAllMessages","handleTabletFocus","customBackgroundValue","settingValue","cacheApi","CUSTOM_BG_CACHE_NAME","Type","useCustomBackground","MASK_IMAGE_DISABLED","messagingDisabledClassName","messageSendingRestrictionReason","getMessageSendingRestrictionReason","composerHiddenScale","toolbarHiddenScale","composerTranslateX","toolbarTranslateX","unpinHiddenScale","toolbarForUnpinHiddenScale","sidePadding","messageListWidth","rightColumnWidth","getMessageListWidth","sendButtonWidth","composerWidth","toolbarWidth","calculateMiddleFooterTransforms","footerClassName","forceSyncOnIOs","createMessageHash","isMessagingDisabled","withMessageListBottomShift","onTransitionEnd","DARK_THEME_BG_COLOR","LIGHT_THEME_BG_COLOR","onDragEnter","onStop","onUnpin","teactOrderKey","HeaderContent","isProfile","isManagement","messageSearchQuery","stickerSearchQuery","selectCurrentStickerSearch","gifSearchQuery","selectCurrentGifSearch","canAddContact","getCanAddContact","canManage","isEditingInvite","isColumnOpen","isSearch","isStickerSearch","isGifSearch","isPollResults","isAddingChatMembers","profileState","managementScreen","shouldSkipAnimation","setLocalTextSearchQuery","searchTextMessagesLocal","toggleManagement","addContact","setEditingExportedInvite","deleteExportedChatInvite","backButtonRef","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","handleEditInviteClick","handleDeleteInviteClick","handleMessageSearchQueryChange","handleStickerSearchQueryChange","handleGifSearchQueryChange","handleAddContact","setShouldSkipTransition","contentKey","ProfileState","Profile","SharedMedia","MemberList","Search","PollResults","StickerSearch","GifSearch","AddingMembers","ManageInitial","ManageChatPrivacyType","ManageDiscussion","ManageChannelSubscribers","ManageGroupPermissions","ManageChatAdministrators","ManageGroupRemovedUsers","ManageChannelRemovedUsers","ManageGroupUserPermissionsCreate","ManageGroupUserPermissions","ManageGroupRecentActions","ManageGroupAdminRights","ManageGroupNewAdminRights","ManageGroupMembers","ManageInvites","ManageEditInvite","ManageGroupAddAdmins","ManageReactions","ManageInviteInfo","ManageJoinRequests","renderingContentKey","isBackButton","buttonClassName","confirmIsDestructive","autoFocusSearch","renderHeaderContent","useInfiniteScrollForLoadableItems","currentResultType","handleLoadMore","itemIds","getMore","useInfiniteScroll","MEMBERS_SLICE","useInfiniteScrollForSharedMedia","forSharedMediaType","messageIdsRef","getMessageContentIds","runThrottledForScroll","isScrollingProgrammatically","TABS","buildInfiniteScrollItemSelector","resultType","mediaSearchType","isGroup","hasMembersTab","areMembersHidden","canViewMembers","canAddMembers","getHasAdminRight","canDeleteMembers","hasCommonChatsTab","resolvedUserId","isChatProtected","commonChatIds","onProfileStateChange","setLocalMediaSearchType","loadMoreMembers","loadCommonChats","searchMediaMessagesLocal","loadProfilePhotos","setNewChatMembersDialogState","setActiveTab","deletingUserId","setDeletingUserId","tabType","noProfileInfo","searchMessages","memberIds","sortUserIds","sortChatIds","memberViewportIds","getMoreMembers","noProfileInfoForMembers","mediaViewportIds","getMoreMedia","noProfileInfoForMedia","documentViewportIds","getMoreDocuments","noProfileInfoForDocuments","linkViewportIds","getMoreLinks","noProfileInfoForLinks","audioViewportIds","getMoreAudio","noProfileInfoForAudio","voiceViewportIds","getMoreVoices","noProfileInfoForVoices","commonChatViewportIds","getMoreCommonChats","noProfileInfoForCommonChats","useProfileViewportIds","prevTabType","tabsEl","prevProfileState","tabListEl","determineProfileState","useProfileState","applyTransitionFix","releaseTransitionFix","transitionElSelector","setMinHeight","transitionEl","minHeight","overflowY","scrollBarWidth","clientWidth","marginRight","useTransitionFixes","cacheBuster","resetCacheBuster","setCacheBuster","useCacheBuster","handleTransitionStop","handleNewMemberDialogOpen","NewChatMembersProgress","handleSelectMedia","handlePlayAudio","handleMemberClick","handleMessageFocus","handleDeleteMembersModalClose","renderingDelay","isFirstTab","SLIDE_TRANSITION_DURATION","canRenderContent","InfiniteScroll","itemSelector","sensitiveArea","PROFILE_SENSITIVE_AREA","preloadBackwards","noScrollRestoreOnTop","noFastList","onLoadMore","ProfileInfo","ChatExtra","renderProfileInfo","shouldRestoreHeight","onStart","noSpinner","NothingFound","Media","withDate","smaller","onDateClick","WebLink","onMessageClick","getSenderName","ListItem","contextActions","memberId","handler","forceShowSelf","big","FloatingActionButton","DeleteMemberModal","RightSearch","Management","localContactIds","isSearching","onNextStep","setUserSearchQuery","selectedMemberIds","setSelectedMemberIds","noPickerScrollRestore","member","handleFilterChange","displayedIds","filteredContactIds","filterUsersByName","canBeInvitedToGroup","handleNextStep","Picker","selectedIds","filterValue","filterPlaceholder","searchInputId","onSelectedIdsChange","onFilterChange","noScrollRestore","MAIN_SCREENS_COUNT","RightColumnContent","MANAGEMENT_SCREENS_COUNT","blurSearchInput","areActiveChatsLoaded","selectAreActiveChatsLoaded","nextManagementScreen","selectRightColumnContentKey","isChatSelected","toggleChatInfo","closePollResults","addChatMembers","setOpenedInviteInfo","setProfileState","setManagementScreen","selectedChatMemberId","setSelectedChatMemberId","isPromotedByCurrentUser","setIsPromotedByCurrentUser","isScrolledDown","isOverlaying","shouldScrollUp","handleSelectChatMember","isPromoted","handleAppendingChatMembers","onChatMemberSelect","MediaViewer","download","click","startedDownloads","downloadHash","getMessageContentFilename","Notifications","Dialogs","ForwardPicker","SafeLinkModal","HistoryCalendar","GroupCall","ActiveCallHeader","CallFallbackConfirm","notificationInterval","DEBUG_isLogged","updateIcon","asUnread","updatePageTitle","nextTitle","wasTimeFormatSetManually","authState","isMediaViewerOpen","selectIsMediaViewerOpen","isForwardModalOpen","selectIsForwardModalOpen","hasNotifications","hasDialogs","isHistoryCalendarOpen","isServiceChatReady","isCallFallbackConfirmOpen","isFallbackConfirmOpen","sync","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","loadCountryList","loadAvailableReactions","loadAddedStickers","ensureTimeFormat","openStickerSetShortName","checkVersionNotification","loadAppConfig","LOCATION_HASH","processDeepLink","decodeURIComponent","middleColumnTransitionClassNames","rightColumnTransitionClassNames","prevIsLeftColumnShown","dispatchHeavyAnimationEnd","waitForTransitionEnd","prevIsRightColumnShown","initialUnread","setInterval","INACTIVE_MARKER","newUnread","PAGE_TITLE","handleStickerSetModalClose","usePreventPinchZoomGesture","onDrop","onDragOver","initApi"],"sourceRoot":""} \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AAS0jE,EACThxF,oBAAqB+B,IAEtBie,GACC,sCACE,mBAAC,GAAD,CAAWM,YAAaN,IACxB,mBAAC,GAAD,CAAkBM,YAAaN,KAGnC,mBAAC,GAAD,MACA,mBAAC,GAAD,CAAqBiG,OAAQkpE,IAC7B,mBAAC,GAAD,CAAa7tE,eAAa,SCxU5Bxa,EAAAA,IAEFC,QAAQC,IAAI,gCAGTjb,EAAAA,EAAAA,MAAY+zB,kBACfzb,EAAAA,EAAAA,MAAc+sF,W","sources":["webpack://telegram-t/./src/modules/actions/ui/localSearch.ts","webpack://telegram-t/./src/modules/actions/ui/chats.ts","webpack://telegram-t/./src/modules/actions/ui/messages.ts","webpack://telegram-t/./src/modules/actions/ui/globalSearch.ts","webpack://telegram-t/./src/modules/actions/ui/stickerSearch.ts","webpack://telegram-t/./src/modules/actions/ui/users.ts","webpack://telegram-t/./src/modules/actions/ui/misc.ts","webpack://telegram-t/./src/modules/actions/ui/payments.ts","webpack://telegram-t/./src/modules/actions/api/messages.ts","webpack://telegram-t/./src/modules/actions/api/symbols.ts","webpack://telegram-t/./src/modules/actions/api/globalSearch.ts","webpack://telegram-t/./src/modules/actions/api/localSearch.ts","webpack://telegram-t/./src/modules/actions/api/management.ts","webpack://telegram-t/./src/modules/actions/api/sync.ts","webpack://telegram-t/./src/modules/actions/api/users.ts","webpack://telegram-t/./src/modules/reducers/bots.ts","webpack://telegram-t/./src/modules/actions/api/bots.ts","webpack://telegram-t/./src/modules/actions/api/twoFaSettings.ts","webpack://telegram-t/./src/modules/actions/api/payments.ts","webpack://telegram-t/./src/util/requestQuery.ts","webpack://telegram-t/./src/components/middle/helpers/calculateMiddleFooterTransforms.ts","webpack://telegram-t/./src/modules/reducers/reactions.ts","webpack://telegram-t/./src/modules/actions/api/reactions.ts","webpack://telegram-t/./src/util/areDeepEqual.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/chats.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/messages.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/users.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/symbols.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/misc.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/twoFaSettings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/calls.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/payments.ts","webpack://telegram-t/./src/hooks/useBeforeUnload.ts","webpack://telegram-t/./src/hooks/usePreventPinchZoomGesture.ts","webpack://telegram-t/./src/components/common/UnreadCounter.tsx","webpack://telegram-t/./src/hooks/useConnectionStatus.ts","webpack://telegram-t/./src/hooks/useBrowserOnline.ts","webpack://telegram-t/./src/components/left/ConnectionStatusOverlay.tsx","webpack://telegram-t/./src/components/left/main/LeftMainHeader.tsx","webpack://telegram-t/./src/components/left/main/ChatFolders.tsx","webpack://telegram-t/./src/components/left/search/LeftSearch.async.tsx","webpack://telegram-t/./src/components/left/main/ContactList.async.tsx","webpack://telegram-t/./src/components/left/NewChatButton.tsx","webpack://telegram-t/./src/components/left/main/LeftMain.tsx","webpack://telegram-t/./src/components/left/settings/Settings.async.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.async.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.async.tsx","webpack://telegram-t/./src/components/left/LeftColumn.tsx","webpack://telegram-t/./src/hooks/useResize.ts","webpack://telegram-t/./src/hooks/useCustomBackground.ts","webpack://telegram-t/./src/hooks/useWindowSize.ts","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/HeaderActions.tsx","webpack://telegram-t/./src/hooks/useWebpThumbnail.ts","webpack://telegram-t/./src/components/middle/PinnedMessageNavigation.tsx","webpack://telegram-t/./src/components/middle/HeaderPinnedMessage.tsx","webpack://telegram-t/./src/util/imageResize.ts","webpack://telegram-t/./src/hooks/useMessageMediaMetadata.ts","webpack://telegram-t/./src/hooks/useAsync.ts","webpack://telegram-t/./src/components/middle/AudioPlayer.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallTopPane.tsx","webpack://telegram-t/./src/components/middle/MiddleHeader.tsx","webpack://telegram-t/./src/components/middle/helpers/groupMessages.ts","webpack://telegram-t/./src/components/middle/hooks/useMessageObservers.ts","webpack://telegram-t/./src/components/middle/message/helpers/buildContentClassName.ts","webpack://telegram-t/./src/components/middle/message/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAlbumLayout.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAuthorWidth.ts","webpack://telegram-t/./src/components/middle/message/hooks/useFocusMessage.ts","webpack://telegram-t/./src/components/middle/message/hooks/useOuterHandlers.ts","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/ActionMessage.tsx","webpack://telegram-t/./src/components/common/EmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/message/ReactionAnimatedEmoji.tsx","webpack://telegram-t/./src/components/middle/message/MessageMeta.tsx","webpack://telegram-t/./src/components/middle/message/Sticker.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useBlurredMediaThumbRef.ts","webpack://telegram-t/./src/components/middle/message/helpers/getCustomAppendixBg.ts","webpack://telegram-t/./src/components/middle/message/Photo.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useVideoAutoPause.ts","webpack://telegram-t/./src/components/middle/message/Video.tsx","webpack://telegram-t/./src/components/middle/message/Contact.tsx","webpack://telegram-t/./src/components/middle/message/PollOption.tsx","webpack://telegram-t/./src/components/middle/message/Poll.tsx","webpack://telegram-t/./src/components/middle/message/WebPage.tsx","webpack://telegram-t/./src/components/middle/message/Invoice.tsx","webpack://telegram-t/./src/components/middle/message/hocs/withSelectControl.tsx","webpack://telegram-t/./src/components/middle/message/Album.tsx","webpack://telegram-t/./src/components/middle/message/RoundVideo.tsx","webpack://telegram-t/./src/components/middle/message/InlineButtons.tsx","webpack://telegram-t/./src/components/middle/message/CommentButton.tsx","webpack://telegram-t/./src/components/middle/message/ReactionButton.tsx","webpack://telegram-t/./src/components/middle/message/Reactions.tsx","webpack://telegram-t/./src/components/common/LocalAnimatedEmoji.tsx","webpack://telegram-t/./src/components/middle/message/Message.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useInnerHandlers.ts","webpack://telegram-t/./src/components/middle/message/SponsoredMessage.tsx","webpack://telegram-t/./src/components/middle/MessageListContent.tsx","webpack://telegram-t/./src/components/middle/hooks/useScrollHooks.ts","webpack://telegram-t/./src/components/middle/ContactGreeting.tsx","webpack://telegram-t/./src/components/middle/NoMessages.tsx","webpack://telegram-t/./src/components/middle/MessageList.tsx","webpack://telegram-t/./src/hooks/useNativeCopySelectedMessages.ts","webpack://telegram-t/./src/components/middle/hooks/useStickyDates.ts","webpack://telegram-t/./src/components/middle/ScrollDownButton.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/buildAttachment.ts","webpack://telegram-t/./src/util/insertHtmlInSelection.ts","webpack://telegram-t/./src/components/middle/composer/helpers/applyIosAutoCapitalizationFix.ts","webpack://telegram-t/./src/util/voiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useClipboardPaste.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useDraft.ts","webpack://telegram-t/./src/hooks/useDebouncedMemo.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useInlineBotTooltip.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useBotCommandTooltip.ts","webpack://telegram-t/./src/components/common/DeleteMessageModal.async.tsx","webpack://telegram-t/./src/components/ui/ResponsiveHoverButton.tsx","webpack://telegram-t/./src/components/common/CalendarModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.tsx","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.async.tsx","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.tsx","webpack://telegram-t/./src/components/middle/composer/SendAsMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/Composer.tsx","webpack://telegram-t/./src/components/middle/composer/hooks/useVoiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useStickerTooltip.ts","webpack://telegram-t/./src/util/deleteLastCharacterOutsideSelection.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEditing.ts","webpack://telegram-t/./src/components/middle/MobileSearch.async.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.async.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.async.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.async.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.async.tsx","webpack://telegram-t/./src/components/common/SeenByModal.async.tsx","webpack://telegram-t/./src/components/middle/EmojiInteractionAnimation.async.tsx","webpack://telegram-t/./src/components/middle/ReactorListModal.async.tsx","webpack://telegram-t/./src/components/middle/MiddleColumn.tsx","webpack://telegram-t/./src/components/right/RightHeader.tsx","webpack://telegram-t/./src/components/right/hooks/useProfileViewportIds.ts","webpack://telegram-t/./src/components/right/hooks/useProfileState.ts","webpack://telegram-t/./src/components/right/Profile.tsx","webpack://telegram-t/./src/components/right/hooks/useTransitionFixes.ts","webpack://telegram-t/./src/hooks/useCacheBuster.ts","webpack://telegram-t/./src/components/right/RightSearch.async.tsx","webpack://telegram-t/./src/components/right/management/Management.async.tsx","webpack://telegram-t/./src/components/right/StickerSearch.async.tsx","webpack://telegram-t/./src/components/right/GifSearch.async.tsx","webpack://telegram-t/./src/components/right/PollResults.async.tsx","webpack://telegram-t/./src/components/right/AddChatMembers.tsx","webpack://telegram-t/./src/components/right/RightColumn.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.async.tsx","webpack://telegram-t/./src/util/download.ts","webpack://telegram-t/./src/components/main/DownloadManager.tsx","webpack://telegram-t/./src/components/main/Notifications.async.tsx","webpack://telegram-t/./src/components/main/Dialogs.async.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.async.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.async.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.async.tsx","webpack://telegram-t/./src/components/calls/group/GroupCall.async.tsx","webpack://telegram-t/./src/components/calls/ActiveCallHeader.async.tsx","webpack://telegram-t/./src/components/calls/CallFallbackConfirm.async.tsx","webpack://telegram-t/./src/components/main/Main.tsx","webpack://telegram-t/./src/bundles/main.ts"],"sourcesContent":["import { addReducer } from '../../../lib/teact/teactn';\n\nimport {\n updateLocalTextSearch,\n replaceLocalTextSearchResults,\n updateLocalMediaSearchType,\n} from '../../reducers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { buildChatThreadKey } from '../../helpers';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('openLocalTextSearch', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n return updateLocalTextSearch(global, chatId, threadId, true);\n});\n\naddReducer('closeLocalTextSearch', closeLocalTextSearch);\n\naddReducer('setLocalTextSearchQuery', (global, actions, payload) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const { query } = payload!;\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { query: currentQuery } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n\n if (query !== currentQuery) {\n global = replaceLocalTextSearchResults(global, chatId, threadId, MEMO_EMPTY_ARRAY);\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, true, query);\n\n return global;\n});\n\naddReducer('setLocalMediaSearchType', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return undefined;\n }\n\n const { mediaType } = payload!;\n return updateLocalMediaSearchType(global, chatId, mediaType);\n});\n\nexport function closeLocalTextSearch(global: GlobalState): GlobalState {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return global;\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, false);\n global = replaceLocalTextSearchResults(global, chatId, threadId, undefined);\n return global;\n}\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n exitMessageSelectMode, replaceThreadParam, updateCurrentMessageList,\n} from '../../reducers';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { closeLocalTextSearch } from './localSearch';\n\naddReducer('openChat', (global, actions, payload) => {\n const {\n id, threadId = -1, type = 'thread', shouldReplaceHistory = false,\n } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList\n || (\n currentMessageList.chatId !== id\n || currentMessageList.threadId !== threadId\n || currentMessageList.type !== type\n )) {\n global = replaceThreadParam(global, id, threadId, 'replyStack', []);\n global = exitMessageSelectMode(global);\n global = closeLocalTextSearch(global);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: undefined,\n },\n ...(id !== global.forwardMessages.toChatId && {\n forwardMessages: {},\n }),\n };\n\n setGlobal(global);\n }\n\n return updateCurrentMessageList(global, id, threadId, type, shouldReplaceHistory);\n});\n\naddReducer('openPreviousChat', (global) => {\n return updateCurrentMessageList(global, undefined);\n});\n\naddReducer('openChatWithInfo', (global, actions, payload) => {\n setGlobal({\n ...global,\n isChatInfoShown: true,\n });\n\n actions.openChat(payload);\n});\n\naddReducer('resetChatCreation', (global) => {\n return {\n ...global,\n chatCreation: undefined,\n };\n});\n\naddReducer('setNewChatMembersDialogState', (global, actions, payload) => {\n return {\n ...global,\n newChatMembersProgress: payload,\n };\n});\n\naddReducer('openNextChat', (global, actions, payload) => {\n const { targetIndexDelta, orderedIds } = payload;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n actions.openChat({ id: orderedIds[0] });\n return;\n }\n\n const position = orderedIds.indexOf(chatId);\n\n if (position === -1) {\n return;\n }\n const nextId = orderedIds[position + targetIndexDelta];\n\n actions.openChat({ id: nextId, shouldReplaceHistory: true });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage, MAIN_THREAD_ID } from '../../../api/types';\nimport { FocusDirection } from '../../../types';\n\nimport {\n ANIMATION_END_DELAY,\n APP_VERSION,\n FAST_SMOOTH_MAX_DURATION,\n SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport {\n enterMessageSelectMode,\n toggleMessageSelection,\n exitMessageSelectMode,\n replaceThreadParam,\n updateFocusDirection,\n updateFocusedMessage,\n} from '../../reducers';\nimport {\n selectCurrentChat,\n selectViewportIds,\n selectIsRightColumnShown,\n selectCurrentMessageList,\n selectChat,\n selectThreadInfo,\n selectChatMessages,\n selectAllowedMessageActions,\n selectMessageIdsByGroupId,\n selectForwardedMessageIdsByGroupId,\n selectIsViewportNewest,\n selectReplyingToId,\n selectReplyStack,\n selectSender,\n} from '../../selectors';\nimport { findLast } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport versionNotification from '../../../versionNotification.txt';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport { getMessageSummaryText, getSenderTitle } from '../../helpers';\nimport * as langProvider from '../../../util/langProvider';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { GlobalState } from '../../../global/types';\n\nconst FOCUS_DURATION = 1500;\nconst FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;\nconst POLL_RESULT_OPEN_DELAY_MS = 450;\nconst SERVICE_NOTIFICATIONS_MAX_AMOUNT = 1e3;\n\nlet blurTimeout: number | undefined;\n\naddReducer('setScrollOffset', (global, actions, payload) => {\n const { chatId, threadId, scrollOffset } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'scrollOffset', scrollOffset);\n});\n\naddReducer('setReplyingToId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n const { chatId, threadId } = currentMessageList;\n\n return replaceThreadParam(global, chatId, threadId, 'replyingToId', messageId);\n});\n\naddReducer('setEditingId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n const paramName = type === 'scheduled' ? 'editingScheduledId' : 'editingId';\n\n return replaceThreadParam(global, chatId, threadId, paramName, messageId);\n});\n\naddReducer('editLastMessage', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const lastOwnEditableMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId).canEdit);\n });\n\n if (!lastOwnEditableMessageId) {\n return undefined;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'editingId', lastOwnEditableMessageId);\n});\n\naddReducer('replyToNextMessage', (global, actions, payload) => {\n const { targetIndexDelta } = payload;\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return;\n }\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const isLatest = selectIsViewportNewest(global, chatId, threadId);\n\n let messageId: number | undefined;\n\n if (!isLatest || !replyingToId) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n messageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n messageId = threadInfo?.lastMessageId;\n }\n } else {\n const chatMessageKeys = Object.keys(chatMessages);\n const indexOfCurrent = chatMessageKeys.indexOf(replyingToId.toString());\n const newIndex = indexOfCurrent + targetIndexDelta;\n messageId = newIndex <= chatMessageKeys.length + 1 && newIndex >= 0\n ? Number(chatMessageKeys[newIndex])\n : undefined;\n }\n actions.setReplyingToId({ messageId });\n actions.focusMessage({\n chatId, threadId, messageId,\n });\n});\n\naddReducer('openMediaViewer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, origin,\n } = payload!;\n\n return {\n ...global,\n mediaViewer: {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n },\n forwardMessages: {},\n };\n});\n\naddReducer('closeMediaViewer', (global) => {\n return {\n ...global,\n mediaViewer: {},\n };\n});\n\naddReducer('openAudioPlayer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId, origin, volume, playbackRate, isMuted,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n chatId,\n threadId,\n messageId,\n origin: origin ?? global.audioPlayer.origin,\n volume: volume ?? global.audioPlayer.volume,\n playbackRate: playbackRate || global.audioPlayer.playbackRate,\n isMuted: isMuted || global.audioPlayer.isMuted,\n },\n };\n});\n\naddReducer('setAudioPlayerVolume', (global, actions, payload) => {\n const {\n volume,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n volume,\n },\n };\n});\n\naddReducer('setAudioPlayerPlaybackRate', (global, actions, payload) => {\n const {\n playbackRate,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n playbackRate,\n },\n };\n});\n\naddReducer('setAudioPlayerMuted', (global, actions, payload) => {\n const {\n isMuted,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n isMuted,\n },\n };\n});\n\naddReducer('setAudioPlayerOrigin', (global, actions, payload) => {\n const {\n origin,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n ...global.audioPlayer,\n origin,\n },\n };\n});\n\naddReducer('closeAudioPlayer', (global) => {\n return {\n ...global,\n audioPlayer: {\n volume: global.audioPlayer.volume,\n playbackRate: global.audioPlayer.playbackRate,\n isMuted: global.audioPlayer.isMuted,\n },\n };\n});\n\naddReducer('openPollResults', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n const shouldOpenInstantly = selectIsRightColumnShown(global);\n\n if (!shouldOpenInstantly) {\n window.setTimeout(() => {\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }, POLL_RESULT_OPEN_DELAY_MS);\n } else if (chatId !== global.pollResults.chatId || messageId !== global.pollResults.messageId) {\n setGlobal({\n ...global,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }\n});\n\naddReducer('closePollResults', (global) => {\n setGlobal({\n ...global,\n pollResults: {},\n });\n});\n\naddReducer('focusLastMessage', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n let lastMessageId: number | undefined;\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n lastMessageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n lastMessageId = threadInfo?.lastMessageId;\n }\n\n if (!lastMessageId) {\n return;\n }\n\n actions.focusMessage({\n chatId, threadId, messageId: lastMessageId, noHighlight: true,\n });\n});\n\naddReducer('focusNextReply', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const replyStack = selectReplyStack(global, chatId, threadId);\n\n if (!replyStack || replyStack.length === 0) {\n actions.focusLastMessage();\n } else {\n const messageId = replyStack.pop();\n\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack]);\n\n setGlobal(global);\n\n actions.focusMessage({\n chatId,\n threadId,\n messageId,\n });\n }\n\n return undefined;\n});\n\naddReducer('focusMessage', (global, actions, payload) => {\n const {\n chatId, threadId = MAIN_THREAD_ID, messageListType = 'thread', noHighlight, groupedId, groupedChatId,\n replyMessageId, isResizingContainer,\n } = payload!;\n\n let { messageId } = payload!;\n\n if (groupedId !== undefined) {\n const ids = selectForwardedMessageIdsByGroupId(global, groupedChatId, groupedId);\n if (ids?.length) {\n ([messageId] = ids);\n }\n }\n\n const currentMessageList = selectCurrentMessageList(global);\n const shouldSwitchChat = !currentMessageList || (\n chatId !== currentMessageList.chatId\n || threadId !== currentMessageList.threadId\n || messageListType !== currentMessageList.type\n );\n\n if (blurTimeout) {\n clearTimeout(blurTimeout);\n blurTimeout = undefined;\n }\n blurTimeout = window.setTimeout(() => {\n let newGlobal = getGlobal();\n newGlobal = updateFocusedMessage(newGlobal);\n newGlobal = updateFocusDirection(newGlobal);\n setGlobal(newGlobal);\n }, noHighlight ? FOCUS_NO_HIGHLIGHT_DURATION : FOCUS_DURATION);\n\n global = updateFocusedMessage(global, chatId, messageId, noHighlight, isResizingContainer);\n global = updateFocusDirection(global, undefined);\n\n if (replyMessageId) {\n const replyStack = selectReplyStack(global, chatId, threadId) || [];\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack, replyMessageId]);\n }\n\n if (shouldSwitchChat) {\n global = updateFocusDirection(global, FocusDirection.Static);\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (viewportIds && viewportIds.includes(messageId)) {\n setGlobal(global);\n actions.openChat({ id: chatId, threadId });\n return undefined;\n }\n\n if (shouldSwitchChat) {\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', undefined);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n\n if (viewportIds && !shouldSwitchChat) {\n const direction = messageId > viewportIds[0] ? FocusDirection.Down : FocusDirection.Up;\n global = updateFocusDirection(global, direction);\n }\n\n setGlobal(global);\n\n actions.openChat({ id: chatId, threadId });\n actions.loadViewportMessages();\n return undefined;\n});\n\naddReducer('openForwardMenu', (global, actions, payload) => {\n const { fromChatId, messageIds, groupedId } = payload!;\n let groupedMessageIds;\n if (groupedId) {\n groupedMessageIds = selectMessageIdsByGroupId(global, fromChatId, groupedId);\n }\n return {\n ...global,\n forwardMessages: {\n fromChatId,\n messageIds: groupedMessageIds || messageIds,\n isModalShown: true,\n },\n };\n});\n\naddReducer('exitForwardMode', (global) => {\n setGlobal({\n ...global,\n forwardMessages: {},\n });\n});\n\naddReducer('setForwardChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n setGlobal({\n ...global,\n forwardMessages: {\n ...global.forwardMessages,\n toChatId: id,\n isModalShown: false,\n },\n });\n\n actions.openChat({ id });\n actions.closeMediaViewer();\n actions.exitMessageSelectMode();\n});\n\naddReducer('openForwardMenuForSelectedMessages', (global, actions) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId: fromChatId, messageIds } = global.selectedMessages;\n\n actions.openForwardMenu({ fromChatId, messageIds });\n});\n\naddReducer('cancelMessageMediaDownload', (global, actions, payload) => {\n const { message } = payload!;\n\n const byChatId = global.activeDownloads.byChatId[message.chatId];\n if (!byChatId || !byChatId.length) return;\n\n setGlobal({\n ...global,\n activeDownloads: {\n byChatId: {\n ...global.activeDownloads.byChatId,\n [message.chatId]: byChatId.filter((id) => id !== message.id),\n },\n },\n });\n});\n\naddReducer('downloadMessageMedia', (global, actions, payload) => {\n const { message } = payload!;\n if (!message) return;\n\n setGlobal({\n ...global,\n activeDownloads: {\n byChatId: {\n ...global.activeDownloads.byChatId,\n [message.chatId]: [...(global.activeDownloads.byChatId[message.chatId] || []), message.id],\n },\n },\n });\n});\n\naddReducer('downloadSelectedMessages', (global, actions) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId, messageIds } = global.selectedMessages;\n const { threadId } = selectCurrentMessageList(global) || {};\n\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages || !threadId) return;\n const messages = messageIds.map((id) => chatMessages[id])\n .filter((message) => selectAllowedMessageActions(global, message, threadId).canDownload);\n messages.forEach((message) => actions.downloadMessageMedia({ message }));\n});\n\naddReducer('enterMessageSelectMode', (global, actions, payload) => {\n const { messageId } = payload || {};\n const openChat = selectCurrentChat(global);\n if (!openChat) {\n return global;\n }\n\n return enterMessageSelectMode(global, openChat.id, messageId);\n});\n\naddReducer('toggleMessageSelection', (global, actions, payload) => {\n const {\n messageId,\n groupedId,\n childMessageIds,\n withShift,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n\n global = toggleMessageSelection(\n global, chatId, threadId, messageListType, messageId, groupedId, childMessageIds, withShift,\n );\n\n setGlobal(global);\n\n if (global.shouldShowContextMenuHint) {\n actions.disableContextMenuHint();\n actions.showNotification({\n // eslint-disable-next-line max-len\n message: `To **edit** or **reply**, close this menu. Then ${IS_TOUCH_ENV ? 'long tap' : 'right click'} on a message.`,\n });\n }\n});\n\naddReducer('disableContextMenuHint', (global) => {\n if (!global.shouldShowContextMenuHint) {\n return undefined;\n }\n\n return {\n ...global,\n shouldShowContextMenuHint: false,\n };\n});\n\naddReducer('exitMessageSelectMode', exitMessageSelectMode);\n\naddReducer('openPollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: true,\n };\n});\n\naddReducer('closePollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: false,\n };\n});\n\naddReducer('checkVersionNotification', (global, actions) => {\n const currentVersion = APP_VERSION.split('.').slice(0, 2).join('.');\n const { serviceNotifications } = global;\n\n if (serviceNotifications.find(({ version }) => version === currentVersion)) {\n return;\n }\n\n const message: Omit = {\n chatId: SERVICE_NOTIFICATIONS_USER_ID,\n date: getServerTime(global.serverTimeOffset),\n content: {\n text: parseMessageInput(versionNotification),\n },\n isOutgoing: false,\n };\n\n actions.createServiceNotification({\n message,\n version: currentVersion,\n });\n});\n\naddReducer('createServiceNotification', (global, actions, payload) => {\n const { message, version } = payload;\n const { serviceNotifications } = global;\n const serviceChat = selectChat(global, SERVICE_NOTIFICATIONS_USER_ID)!;\n\n const maxId = Math.max(\n serviceChat.lastMessage?.id || 0,\n ...serviceNotifications.map(({ id }) => id),\n );\n const fractionalPart = (serviceNotifications.length + 1) / SERVICE_NOTIFICATIONS_MAX_AMOUNT;\n // The fractional ID is made of the largest integer ID and an incremented fractional part\n const id = Math.floor(maxId) + fractionalPart;\n\n message.id = id;\n\n const serviceNotification = {\n id,\n message,\n version,\n isUnread: true,\n };\n\n setGlobal({\n ...global,\n serviceNotifications: [\n ...serviceNotifications.slice(-SERVICE_NOTIFICATIONS_MAX_AMOUNT),\n serviceNotification,\n ],\n });\n\n actions.apiUpdate({\n '@type': 'newMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n});\n\naddReducer('openReactorListModal', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n return {\n ...global,\n reactorModal: { chatId, messageId },\n };\n});\n\naddReducer('closeReactorListModal', (global) => {\n return {\n ...global,\n reactorModal: undefined,\n };\n});\n\naddReducer('openSeenByModal', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n return {\n ...global,\n seenByModal: { chatId, messageId },\n };\n});\n\naddReducer('closeSeenByModal', (global) => {\n return {\n ...global,\n seenByModal: undefined,\n };\n});\n\naddReducer('copySelectedMessages', (global) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId, messageIds } = global.selectedMessages;\n copyTextForMessages(global, chatId, messageIds);\n});\n\naddReducer('copyMessagesByIds', (global, actions, payload: { messageIds?: number[] } ) => {\n const { messageIds } = payload;\n const chat = selectCurrentChat(global);\n if (!messageIds || messageIds.length === 0 || !chat) {\n return;\n }\n\n copyTextForMessages(global, chat.id, messageIds);\n});\n\n\nfunction copyTextForMessages(global: GlobalState, chatId: string, messageIds: number[]) {\n const { threadId } = selectCurrentMessageList(global) || {};\n const lang = langProvider.getTranslation;\n\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages || !threadId) return;\n const messages = messageIds\n .map((id) => chatMessages[id])\n .filter((message) => selectAllowedMessageActions(global, message, threadId).canCopy)\n .sort((message1, message2) => message1.id - message2.id);\n\n const result = messages.reduce((acc, message) => {\n const sender = selectSender(global, message);\n acc.push(`> ${sender ? getSenderTitle(lang, sender) : ''}:`);\n acc.push(getMessageSummaryText(lang, message, false, 0, undefined, true) + '\\n');\n\n return acc;\n }, [] as string[]);\n\n copyTextToClipboard(result.join('\\n'));\n}\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { updateGlobalSearch, updateGlobalSearchContent } from '../../reducers';\n\nconst MAX_RECENTLY_FOUND_IDS = 10;\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n const { chatId } = global.globalSearch;\n\n return updateGlobalSearch(global, {\n globalResults: {},\n localResults: {},\n resultsByType: undefined,\n ...(query ? { fetchingStatus: { chats: !chatId, messages: true } } : { fetchingStatus: undefined }),\n query,\n });\n});\n\naddReducer('addRecentlyFoundChatId', (global, actions, payload) => {\n const { id } = payload!;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n if (!recentlyFoundChatIds) {\n return updateGlobalSearch(global, { recentlyFoundChatIds: [id] });\n }\n\n const newRecentIds = recentlyFoundChatIds.filter((chatId) => chatId !== id);\n newRecentIds.unshift(id);\n if (newRecentIds.length > MAX_RECENTLY_FOUND_IDS) {\n newRecentIds.pop();\n }\n\n return updateGlobalSearch(global, { recentlyFoundChatIds: newRecentIds });\n});\n\naddReducer('clearRecentlyFoundChats', (global) => {\n return updateGlobalSearch(global, { recentlyFoundChatIds: undefined });\n});\n\naddReducer('setGlobalSearchContent', (global, actions, payload) => {\n const { content } = payload!;\n\n return updateGlobalSearchContent(global, content);\n});\n\naddReducer('setGlobalSearchChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n return updateGlobalSearch(global, { chatId: id, query: undefined, resultsByType: undefined });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n search: {\n query,\n resultIds: undefined,\n },\n },\n };\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n query,\n offsetId: undefined,\n results: undefined,\n },\n },\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { updateUserSearch } from '../../reducers';\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return updateUserSearch(global, {\n globalUserIds: undefined,\n localUserIds: undefined,\n fetchingStatus: Boolean(query),\n query,\n });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiError } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';\nimport getReadableErrorText from '../../../util/getReadableErrorText';\nimport { selectCurrentMessageList } from '../../selectors';\nimport generateIdFor from '../../../util/generateIdFor';\n\nconst MAX_STORED_EMOJIS = 18; // Represents two rows of recent emojis\n\naddReducer('toggleChatInfo', (global, action, payload) => {\n return {\n ...global,\n isChatInfoShown: payload !== undefined ? payload : !global.isChatInfoShown,\n };\n});\n\naddReducer('setLeftColumnWidth', (global, actions, payload) => {\n const leftColumnWidth = payload;\n\n return {\n ...global,\n leftColumnWidth,\n };\n});\n\naddReducer('resetLeftColumnWidth', (global) => {\n return {\n ...global,\n leftColumnWidth: undefined,\n };\n});\n\naddReducer('toggleManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: !(global.management.byChatId[chatId] || {}).isActive,\n },\n },\n },\n };\n});\n\naddReducer('requestNextManagementScreen', (global, actions, payload): GlobalState | undefined => {\n const { screen } = payload || {};\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: true,\n nextScreen: screen,\n },\n },\n },\n };\n});\n\naddReducer('closeManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: false,\n },\n },\n },\n };\n});\n\naddReducer('openChat', (global) => {\n if (!IS_SINGLE_COLUMN_LAYOUT && !IS_TABLET_COLUMN_LAYOUT) {\n return undefined;\n }\n\n return {\n ...global,\n isLeftColumnShown: global.messages.messageLists.length === 0,\n };\n});\n\naddReducer('toggleLeftColumn', (global) => {\n return {\n ...global,\n isLeftColumnShown: !global.isLeftColumnShown,\n };\n});\n\naddReducer('addRecentEmoji', (global, action, payload) => {\n const { emoji } = payload!;\n const { recentEmojis } = global;\n if (!recentEmojis) {\n return {\n ...global,\n recentEmojis: [emoji],\n };\n }\n\n const newEmojis = recentEmojis.filter((e) => e !== emoji);\n newEmojis.unshift(emoji);\n if (newEmojis.length > MAX_STORED_EMOJIS) {\n newEmojis.pop();\n }\n\n return {\n ...global,\n recentEmojis: newEmojis,\n };\n});\n\naddReducer('addRecentSticker', (global, action, payload) => {\n const { sticker } = payload!;\n const { recent } = global.stickers;\n if (!recent) {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n hash: '0',\n stickers: [sticker],\n },\n },\n };\n }\n\n const newStickers = recent.stickers.filter((s) => s.id !== sticker.id);\n newStickers.unshift(sticker);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n ...recent,\n stickers: newStickers,\n },\n },\n };\n});\n\naddReducer('showNotification', (global, actions, payload) => {\n const notification = payload!;\n notification.localId = generateIdFor({});\n\n const newNotifications = [...global.notifications];\n const existingNotificationIndex = newNotifications.findIndex((n) => n.message === notification.message);\n if (existingNotificationIndex !== -1) {\n newNotifications.splice(existingNotificationIndex, 1);\n }\n\n newNotifications.push(notification);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('dismissNotification', (global, actions, payload) => {\n const newNotifications = global.notifications.filter(({ localId }) => localId !== payload.localId);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('showDialog', (global, actions, payload) => {\n const { data } = payload!;\n\n // Filter out errors that we don't want to show to the user\n if ('message' in data && data.hasErrorKey && !getReadableErrorText(data)) {\n return global;\n }\n\n const newDialogs = [...global.dialogs];\n if ('message' in data) {\n const existingErrorIndex = newDialogs.findIndex((err) => (err as ApiError).message === data.message);\n if (existingErrorIndex !== -1) {\n newDialogs.splice(existingErrorIndex, 1);\n }\n }\n\n newDialogs.push(data);\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('dismissDialog', (global) => {\n const newDialogs = [...global.dialogs];\n\n newDialogs.pop();\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('toggleSafeLinkModal', (global, actions, payload) => {\n const { url: safeLinkModalUrl } = payload;\n\n return {\n ...global,\n safeLinkModalUrl,\n };\n});\n\naddReducer('openHistoryCalendar', (global, actions, payload) => {\n const { selectedAt } = payload;\n\n return {\n ...global,\n historyCalendarSelectedAt: selectedAt,\n };\n});\n\naddReducer('closeHistoryCalendar', (global) => {\n return {\n ...global,\n historyCalendarSelectedAt: undefined,\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { clearPayment, closeInvoice } from '../../reducers';\n\naddReducer('openPaymentModal', (global, actions, payload) => {\n const { chatId, messageId } = payload;\n return {\n ...global,\n payment: {\n ...global.payment,\n chatId,\n messageId,\n isPaymentModalOpen: true,\n },\n };\n});\n\naddReducer('closePaymentModal', (global) => {\n const newGlobal = clearPayment(global);\n return closeInvoice(newGlobal);\n});\n\naddReducer('addPaymentError', (global, actions, payload) => {\n const { error } = payload!;\n\n return {\n ...global,\n payment: {\n ...global.payment,\n error,\n },\n };\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiChat,\n ApiMessage,\n ApiMessageEntity,\n ApiNewPoll,\n ApiOnProgress,\n ApiSticker,\n ApiUser,\n ApiVideo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n} from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport {\n MAX_MEDIA_FILES_FOR_ALBUM,\n MESSAGE_LIST_SLICE,\n SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../../config';\nimport { IS_IOS } from '../../../util/environment';\nimport { callApi, cancelApiProgress } from '../../../api/gramjs';\nimport {\n areSortedArraysIntersecting, buildCollectionByKey, split, unique,\n} from '../../../util/iteratees';\nimport {\n addUsers,\n addChatMessagesById,\n replaceThreadParam,\n safeReplaceViewportIds,\n updateChatMessage,\n addChats,\n updateListedIds,\n updateOutlyingIds,\n replaceScheduledMessages,\n updateThreadInfos,\n updateChat,\n updateThreadUnreadFromForwardedMessage,\n updateSponsoredMessage,\n} from '../../reducers';\nimport {\n selectChat,\n selectChatMessage,\n selectCurrentMessageList,\n selectFocusedMessageId,\n selectCurrentChat,\n selectListedIds,\n selectOutlyingIds,\n selectViewportIds,\n selectRealLastReadId,\n selectReplyingToId,\n selectEditingId,\n selectDraft,\n selectThreadOriginChat,\n selectThreadTopMessageId,\n selectEditingScheduledId,\n selectEditingMessage,\n selectScheduledMessage,\n selectNoWebPage,\n selectFirstUnreadId,\n selectUser,\n selectSendAs,\n selectSponsoredMessage,\n} from '../../selectors';\nimport { debounce, rafPromise } from '../../../util/schedulers';\nimport { isServiceNotificationMessage } from '../../helpers';\n\nconst uploadProgressCallbacks = new Map();\n\nconst runDebouncedForMarkRead = debounce((cb) => cb(), 500, false);\n\naddReducer('loadViewportMessages', (global, actions, payload) => {\n const {\n direction = LoadMoreDirection.Around,\n isBudgetPreload = false,\n } = payload || {};\n\n let { chatId, threadId } = payload || {};\n\n if (!chatId) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n chatId = currentMessageList.chatId;\n threadId = currentMessageList.threadId;\n }\n\n const chat = selectChat(global, chatId);\n // TODO Revise if `chat.isRestricted` check is needed\n if (!chat || chat.isRestricted) {\n return undefined;\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (!viewportIds || !viewportIds.length || direction === LoadMoreDirection.Around) {\n const offsetId = selectFocusedMessageId(global, chatId) || selectRealLastReadId(global, chatId, threadId);\n const isOutlying = Boolean(offsetId && listedIds && !listedIds.includes(offsetId));\n const historyIds = (isOutlying ? outlyingIds : listedIds) || [];\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, LoadMoreDirection.Around);\n\n if (areSomeLocal && newViewportIds.length >= MESSAGE_LIST_SLICE) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n if (!areAllLocal) {\n void loadViewportMessages(chat, threadId, offsetId, LoadMoreDirection.Around, isOutlying, isBudgetPreload);\n }\n } else {\n const offsetId = direction === LoadMoreDirection.Backwards ? viewportIds[0] : viewportIds[viewportIds.length - 1];\n const isOutlying = Boolean(outlyingIds);\n const historyIds = (isOutlying ? outlyingIds : listedIds)!;\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, direction);\n\n if (areSomeLocal) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n void loadWithBudget(actions, areAllLocal, isOutlying, isBudgetPreload, chat, threadId, direction, offsetId);\n\n if (isBudgetPreload) {\n return undefined;\n }\n }\n\n return global;\n});\n\nasync function loadWithBudget(\n actions: GlobalActions,\n areAllLocal: boolean, isOutlying: boolean, isBudgetPreload: boolean,\n chat: ApiChat, threadId: number, direction: LoadMoreDirection, offsetId?: number,\n) {\n if (!areAllLocal) {\n await loadViewportMessages(\n chat, threadId, offsetId, direction, isOutlying, isBudgetPreload,\n );\n }\n\n if (!isBudgetPreload) {\n // Let reducer return and update global\n await Promise.resolve();\n actions.loadViewportMessages({\n chatId: chat.id, threadId, direction, isBudgetPreload: true,\n });\n }\n}\n\naddReducer('loadMessage', (global, actions, payload) => {\n const {\n chatId, messageId, replyOriginForId, threadUpdate,\n } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n const message = await loadMessage(chat, messageId, replyOriginForId);\n if (message && threadUpdate) {\n const { lastMessageId, isDeleting } = threadUpdate;\n\n setGlobal(updateThreadUnreadFromForwardedMessage(\n getGlobal(),\n message,\n chatId,\n lastMessageId,\n isDeleting,\n ));\n }\n })();\n});\n\naddReducer('sendMessage', (global, actions, payload) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n\n if (type === 'scheduled' && !payload.scheduledAt) {\n return {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: payload,\n },\n };\n }\n\n const chat = selectChat(global, chatId)!;\n\n const params = {\n ...payload,\n chat,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n noWebPage: selectNoWebPage(global, chatId, threadId),\n sendAs: selectSendAs(global, chatId),\n };\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n const isSingle = !payload.attachments || payload.attachments.length <= 1;\n const isGrouped = !isSingle && payload.attachments && payload.attachments.length > 1;\n\n if (isSingle) {\n const { attachments, ...restParams } = params;\n sendMessage({\n ...restParams,\n attachment: attachments ? attachments[0] : undefined,\n });\n } else if (isGrouped) {\n const {\n text, entities, attachments, ...commonParams\n } = params;\n const groupedAttachments = split(attachments, MAX_MEDIA_FILES_FOR_ALBUM);\n for (let i = 0; i < groupedAttachments.length; i++) {\n const [firstAttachment, ...restAttachments] = groupedAttachments[i];\n const groupedId = `${Date.now()}${i}`;\n\n sendMessage({\n ...commonParams,\n text: i === 0 ? text : undefined,\n entities: i === 0 ? entities : undefined,\n attachment: firstAttachment,\n groupedId: restAttachments.length > 0 ? groupedId : undefined,\n });\n\n restAttachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n groupedId,\n });\n });\n }\n } else {\n const {\n text, entities, attachments, replyingTo, ...commonParams\n } = params;\n\n if (text) {\n sendMessage({\n ...commonParams,\n text,\n entities,\n replyingTo,\n });\n }\n\n attachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n });\n });\n }\n\n return undefined;\n});\n\naddReducer('editMessage', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { text, entities } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const message = selectEditingMessage(global, chatId, threadId, messageListType);\n if (!chat || !message) {\n return;\n }\n\n void callApi('editMessage', {\n chat, message, text, entities, noWebPage: selectNoWebPage(global, chatId, threadId), serverTimeOffset,\n });\n\n actions.setEditingId({ messageId: undefined });\n});\n\naddReducer('cancelSendingMessage', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n const message = selectChatMessage(global, chatId, messageId);\n const progressCallback = message && uploadProgressCallbacks.get(message.previousLocalId || message.id);\n if (progressCallback) {\n cancelApiProgress(progressCallback);\n }\n\n actions.apiUpdate({\n '@type': 'deleteMessages',\n ids: [messageId],\n chatId,\n });\n});\n\naddReducer('saveDraft', (global, actions, payload) => {\n const { chatId, threadId, draft } = payload!;\n if (!draft) {\n return undefined;\n }\n\n const { text, entities } = draft;\n const chat = selectChat(global, chatId)!;\n\n if (threadId === MAIN_THREAD_ID) {\n void callApi('saveDraft', {\n chat,\n text,\n entities,\n replyToMsgId: selectReplyingToId(global, chatId, threadId),\n });\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', draft);\n global = updateChat(global, chatId, { draftDate: Math.round(Date.now() / 1000) });\n\n return global;\n});\n\naddReducer('clearDraft', (global, actions, payload) => {\n const { chatId, threadId, localOnly } = payload!;\n if (!selectDraft(global, chatId, threadId)) {\n return undefined;\n }\n\n const chat = selectChat(global, chatId)!;\n\n if (!localOnly && threadId === MAIN_THREAD_ID) {\n void callApi('clearDraft', chat);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', undefined);\n global = updateChat(global, chatId, { draftDate: undefined });\n\n return global;\n});\n\naddReducer('toggleMessageWebPage', (global, actions, payload) => {\n const { chatId, threadId, noWebPage } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'noWebPage', noWebPage);\n});\n\naddReducer('pinMessage', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const {\n messageId, isUnpin, isOneSide, isSilent,\n } = payload!;\n\n void callApi('pinMessage', {\n chat, messageId, isUnpin, isOneSide, isSilent,\n });\n});\n\naddReducer('unpinAllMessages', (global, actions, payload) => {\n const chat = selectChat(global, payload.chatId);\n if (!chat) {\n return;\n }\n\n void unpinAllMessages(chat);\n});\n\nasync function unpinAllMessages(chat: ApiChat) {\n await callApi('unpinAllMessages', { chat });\n let global = getGlobal();\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', []);\n setGlobal(global);\n}\n\naddReducer('deleteMessages', (global, actions, payload) => {\n const { messageIds, shouldDeleteForAll } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { chatId, threadId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteMessages', { chat, messageIds, shouldDeleteForAll });\n\n const editingId = selectEditingId(global, chatId, threadId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteScheduledMessages', (global, actions, payload) => {\n const { messageIds } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteScheduledMessages', { chat, messageIds });\n\n const editingId = selectEditingScheduledId(global, chatId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteHistory', (global, actions, payload) => {\n (async () => {\n const { chatId, shouldDeleteForAll } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const maxId = chat.lastMessage?.id;\n\n await callApi('deleteHistory', { chat, shouldDeleteForAll, maxId });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('reportMessages', (global, actions, payload) => {\n (async () => {\n const {\n messageIds, reason, description,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n const result = await callApi('reportMessages', {\n peer: chat, messageIds, reason, description,\n });\n\n actions.showNotification({\n message: result\n ? 'Thank you! Your report will be reviewed by our team.'\n : 'Error occured while submiting report. Please, try again later.',\n });\n })();\n});\n\naddReducer('sendMessageAction', (global, actions, payload) => {\n (async () => {\n const { action, chatId, threadId } = payload!;\n if (chatId === global.currentUserId) return; // Message actions are disabled in Saved Messages\n\n const chat = selectChat(global, chatId)!;\n if (!chat) return;\n\n await callApi('sendMessageAction', {\n peer: chat, threadId, action,\n });\n })();\n});\n\naddReducer('markMessageListRead', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return undefined;\n }\n\n const { maxId } = payload!;\n\n runDebouncedForMarkRead(() => {\n void callApi('markMessageListRead', {\n serverTimeOffset, chat, threadId, maxId,\n });\n });\n\n // TODO Support local marking read for threads\n if (threadId !== MAIN_THREAD_ID) {\n return undefined;\n }\n\n if (chatId === SERVICE_NOTIFICATIONS_USER_ID) {\n global = {\n ...global,\n serviceNotifications: global.serviceNotifications.map((notification) => {\n return notification.isUnread && notification.id <= maxId ? { ...notification, isUnread: false } : notification;\n }),\n };\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const minId = selectFirstUnreadId(global, chatId, threadId);\n if (!viewportIds || !minId || !chat.unreadCount) {\n return global;\n }\n\n const readCount = countSortedIds(viewportIds!, minId, maxId);\n if (!readCount) {\n return global;\n }\n\n return updateChat(global, chatId, {\n lastReadInboxMessageId: maxId,\n unreadCount: Math.max(0, chat.unreadCount - readCount),\n });\n});\n\naddReducer('markMessagesRead', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { messageIds } = payload!;\n\n void callApi('markMessagesRead', { chat, messageIds });\n});\n\naddReducer('loadWebPagePreview', (global, actions, payload) => {\n const { text } = payload!;\n void loadWebPagePreview(text);\n});\n\naddReducer('clearWebPagePreview', (global) => {\n if (!global.webPagePreview) {\n return undefined;\n }\n\n return {\n ...global,\n webPagePreview: undefined,\n };\n});\n\naddReducer('sendPollVote', (global, actions, payload) => {\n const { chatId, messageId, options } = payload!;\n const chat = selectChat(global, chatId);\n\n if (chat) {\n void callApi('sendPollVote', { chat, messageId, options });\n }\n});\n\naddReducer('loadPollOptionResults', (global, actions, payload) => {\n const {\n chat, messageId, option, offset, limit, shouldResetVoters,\n } = payload!;\n\n void loadPollOptionResults(chat, messageId, option, offset, limit, shouldResetVoters);\n});\n\naddReducer('forwardMessages', (global, action, payload) => {\n const { fromChatId, messageIds, toChatId } = global.forwardMessages;\n const fromChat = fromChatId ? selectChat(global, fromChatId) : undefined;\n const toChat = toChatId ? selectChat(global, toChatId) : undefined;\n const messages = fromChatId && messageIds\n ? messageIds\n .sort((a, b) => a - b)\n .map((id) => selectChatMessage(global, fromChatId, id)).filter(Boolean as any)\n : undefined;\n\n if (!fromChat || !toChat || !messages) {\n return;\n }\n\n const { isSilent, scheduledAt } = payload;\n const sendAs = selectSendAs(global, toChatId!);\n\n const realMessages = messages.filter((m) => !isServiceNotificationMessage(m));\n if (realMessages.length) {\n void callApi('forwardMessages', {\n fromChat,\n toChat,\n messages: realMessages,\n serverTimeOffset: getGlobal().serverTimeOffset,\n isSilent,\n scheduledAt,\n sendAs,\n });\n }\n\n messages\n .filter((m) => isServiceNotificationMessage(m))\n .forEach((message) => {\n const { text, entities } = message.content.text || {};\n const { sticker, poll } = message.content;\n\n void sendMessage({\n chat: toChat,\n text,\n entities,\n sticker,\n poll,\n isSilent,\n scheduledAt,\n sendAs,\n });\n });\n\n setGlobal({\n ...getGlobal(),\n forwardMessages: {},\n });\n});\n\naddReducer('loadScheduledHistory', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void loadScheduledHistory(chat);\n});\n\naddReducer('sendScheduledMessages', (global, actions, payload) => {\n const {\n chatId, id,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('sendScheduledMessages', {\n chat,\n ids: [id],\n });\n});\n\naddReducer('rescheduleMessage', (global, actions, payload) => {\n const {\n chatId, messageId, scheduledAt,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n const message = chat && selectScheduledMessage(global, chat.id, messageId);\n if (!chat || !message) {\n return;\n }\n\n void callApi('rescheduleMessage', {\n chat,\n message,\n scheduledAt,\n });\n});\n\naddReducer('requestThreadInfoUpdate', (global, actions, payload) => {\n const { chatId, threadId } = payload;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return;\n }\n\n void callApi('requestThreadInfoUpdate', { chat, threadId });\n});\n\nasync function loadWebPagePreview(message: string) {\n const webPagePreview = await callApi('fetchWebPagePreview', { message });\n\n setGlobal({\n ...getGlobal(),\n webPagePreview,\n });\n}\n\nasync function loadViewportMessages(\n chat: ApiChat,\n threadId: number,\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n isOutlying = false,\n isBudgetPreload = false,\n) {\n const chatId = chat.id;\n\n let addOffset: number | undefined;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n addOffset = undefined;\n break;\n case LoadMoreDirection.Around:\n addOffset = -(Math.round(MESSAGE_LIST_SLICE / 2) + 1);\n break;\n case LoadMoreDirection.Forwards:\n addOffset = -(MESSAGE_LIST_SLICE + 1);\n break;\n }\n\n const result = await callApi('fetchMessages', {\n chat: selectThreadOriginChat(getGlobal(), chatId, threadId)!,\n offsetId,\n addOffset,\n limit: MESSAGE_LIST_SLICE,\n threadId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, chats, threadInfos,\n } = result;\n\n let global = getGlobal();\n\n const localMessages = chatId === SERVICE_NOTIFICATIONS_USER_ID\n ? global.serviceNotifications.map(({ message }) => message)\n : [];\n const allMessages = ([] as ApiMessage[]).concat(messages, localMessages);\n const byId = buildCollectionByKey(allMessages, 'id');\n const ids = Object.keys(byId).map(Number);\n\n global = addChatMessagesById(global, chatId, byId);\n global = isOutlying\n ? updateOutlyingIds(global, chatId, threadId, ids)\n : updateListedIds(global, chatId, threadId, ids);\n\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = updateThreadInfos(global, chatId, threadInfos);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (isOutlying && listedIds && outlyingIds) {\n if (!outlyingIds.length || areSortedArraysIntersecting(listedIds, outlyingIds)) {\n global = updateListedIds(global, chatId, threadId, outlyingIds);\n listedIds = selectListedIds(global, chatId, threadId);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n isOutlying = false;\n }\n }\n\n if (!isBudgetPreload) {\n const historyIds = isOutlying ? outlyingIds! : listedIds!;\n const { newViewportIds } = getViewportSlice(historyIds, offsetId, direction);\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds!);\n }\n\n setGlobal(global);\n}\n\nasync function loadMessage(chat: ApiChat, messageId: number, replyOriginForId: number) {\n const result = await callApi('fetchMessage', { chat, messageId });\n if (!result) {\n return undefined;\n }\n\n if (result === MESSAGE_DELETED) {\n if (replyOriginForId) {\n let global = getGlobal();\n const replyMessage = selectChatMessage(global, chat.id, replyOriginForId);\n global = updateChatMessage(global, chat.id, replyOriginForId, {\n ...replyMessage,\n replyToMessageId: undefined,\n });\n setGlobal(global);\n }\n\n return undefined;\n }\n\n let global = getGlobal();\n global = updateChatMessage(global, chat.id, messageId, result.message);\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n setGlobal(global);\n\n return result.message;\n}\n\nfunction findClosestIndex(sourceIds: number[], offsetId: number) {\n if (offsetId < sourceIds[0]) {\n return 0;\n }\n\n if (offsetId > sourceIds[sourceIds.length - 1]) {\n return sourceIds.length - 1;\n }\n\n return sourceIds.findIndex((id, i) => (\n id === offsetId\n || (id < offsetId && sourceIds[i + 1] > offsetId)\n ));\n}\n\nfunction getViewportSlice(\n sourceIds: number[],\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n) {\n const { length } = sourceIds;\n const index = offsetId ? findClosestIndex(sourceIds, offsetId) : -1;\n const isBackwards = direction === LoadMoreDirection.Backwards;\n const indexForDirection = isBackwards ? index : (index + 1) || length;\n const from = indexForDirection - MESSAGE_LIST_SLICE;\n const to = indexForDirection + MESSAGE_LIST_SLICE - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n case LoadMoreDirection.Around:\n default:\n areSomeLocal = newViewportIds.length > 0;\n areAllLocal = newViewportIds.length === MESSAGE_LIST_SLICE;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n\nasync function sendMessage(params: {\n chat: ApiChat;\n text?: string;\n entities?: ApiMessageEntity[];\n replyingTo?: number;\n attachment?: ApiAttachment;\n sticker?: ApiSticker;\n gif?: ApiVideo;\n poll?: ApiNewPoll;\n serverTimeOffset?: number;\n isSilent?: boolean;\n scheduledAt?: number;\n sendAs?: ApiChat | ApiUser;\n}) {\n let localId: number | undefined;\n const progressCallback = params.attachment ? (progress: number, messageLocalId: number) => {\n if (!uploadProgressCallbacks.has(messageLocalId)) {\n localId = messageLocalId;\n uploadProgressCallbacks.set(messageLocalId, progressCallback!);\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n fileUploads: {\n byMessageLocalId: {\n ...global.fileUploads.byMessageLocalId,\n [messageLocalId]: { progress },\n },\n },\n });\n } : undefined;\n\n // @optimization\n if (params.replyingTo || IS_IOS) {\n await rafPromise();\n }\n\n const global = getGlobal();\n params.serverTimeOffset = global.serverTimeOffset;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { threadId } = currentMessageList;\n\n if (!params.replyingTo && threadId !== MAIN_THREAD_ID) {\n params.replyingTo = selectThreadTopMessageId(global, params.chat.id, threadId)!;\n }\n\n await callApi('sendMessage', params, progressCallback);\n\n if (progressCallback && localId) {\n uploadProgressCallbacks.delete(localId);\n }\n}\n\nasync function loadPollOptionResults(\n chat: ApiChat,\n messageId: number,\n option: string,\n offset?: string,\n limit?: number,\n shouldResetVoters?: boolean,\n) {\n const result = await callApi('loadPollOptionResults', {\n chat, messageId, option, offset, limit,\n });\n\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n const { voters } = global.pollResults;\n\n setGlobal({\n ...global,\n pollResults: {\n ...global.pollResults,\n voters: {\n ...voters,\n [option]: unique([\n ...(!shouldResetVoters && voters && voters[option] ? voters[option] : []),\n ...(result && result.users.map((user) => user.id)),\n ]),\n },\n offsets: {\n ...(global.pollResults.offsets ? global.pollResults.offsets : {}),\n [option]: result.nextOffset || '',\n },\n },\n });\n}\n\naddReducer('loadPinnedMessages', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void loadPinnedMessages(chat);\n});\n\naddReducer('loadSeenBy', (global, actions, payload) => {\n const { chatId, messageId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchSeenBy', { chat, messageId });\n if (!result) {\n return;\n }\n\n setGlobal(updateChatMessage(getGlobal(), chatId, messageId, {\n seenByUserIds: result,\n }));\n })();\n});\n\naddReducer('saveDefaultSendAs', (global, actions, payload) => {\n const { chatId, sendAsId } = payload;\n const chat = selectChat(global, chatId);\n const sendAsChat = selectChat(global, sendAsId) || selectUser(global, sendAsId);\n if (!chat || !sendAsChat) {\n return undefined;\n }\n\n void callApi('saveDefaultSendAs', { sendAs: sendAsChat, chat });\n\n return updateChat(global, chatId, {\n fullInfo: {\n ...chat.fullInfo,\n sendAsId,\n },\n });\n});\n\naddReducer('loadSendAs', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchSendAs', { chat });\n if (!result) {\n global = updateChat(global, chatId, {\n sendAsIds: [],\n });\n setGlobal(global);\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChat(global, chatId, {\n sendAsIds: result.ids,\n });\n setGlobal(global);\n })();\n});\n\nasync function loadPinnedMessages(chat: ApiChat) {\n const result = await callApi('fetchPinnedMessages', { chat });\n if (!result) {\n return;\n }\n\n const { messages, chats, users } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = addChatMessagesById(global, chat.id, byId);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', ids);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n setGlobal(global);\n}\n\nasync function loadScheduledHistory(chat: ApiChat) {\n const result = await callApi('fetchScheduledHistory', { chat });\n if (!result) {\n return;\n }\n\n const { messages } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = replaceScheduledMessages(global, chat.id, byId);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n}\n\naddReducer('loadSponsoredMessages', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchSponsoredMessages', { chat });\n if (!result) {\n return;\n }\n\n let newGlobal = updateSponsoredMessage(getGlobal(), chatId, result.messages[0]);\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n newGlobal = addChats(newGlobal, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('viewSponsoredMessage', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n const message = selectSponsoredMessage(global, chatId);\n if (!chat || !message) {\n return;\n }\n\n void callApi('viewSponsoredMessage', { chat, random: message.randomId });\n});\n\nfunction countSortedIds(ids: number[], from: number, to: number) {\n let count = 0;\n\n for (let i = 0, l = ids.length; i < l; i++) {\n if (ids[i] >= from && ids[i] <= to) {\n count++;\n }\n\n if (ids[i] >= to) {\n break;\n }\n }\n\n return count;\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { LangCode } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { pause, throttle } from '../../../util/schedulers';\nimport {\n updateStickerSets,\n updateStickerSet,\n replaceAnimatedEmojis,\n updateGifSearch,\n updateStickersForEmoji,\n rebuildStickersForEmoji,\n} from '../../reducers';\nimport searchWords from '../../../util/searchWords';\nimport { selectStickerSet } from '../../selectors';\n\nconst ADDED_SETS_THROTTLE = 200;\nconst ADDED_SETS_THROTTLE_CHUNK = 10;\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('loadStickerSets', (global) => {\n const { hash } = global.stickers.added || {};\n void loadStickerSets(hash);\n});\n\naddReducer('loadAddedStickers', (global, actions) => {\n const { setIds: addedSetIds } = global.stickers.added;\n const cached = global.stickers.setsById;\n if (!addedSetIds || !addedSetIds.length) {\n return;\n }\n\n (async () => {\n for (let i = 0; i < addedSetIds.length; i++) {\n const id = addedSetIds[i];\n if (cached[id].stickers) {\n continue; // Already loaded\n }\n actions.loadStickers({ stickerSetId: id });\n\n if (i % ADDED_SETS_THROTTLE_CHUNK === 0 && i > 0) {\n await pause(ADDED_SETS_THROTTLE);\n }\n }\n })();\n});\n\naddReducer('loadRecentStickers', (global) => {\n const { hash } = global.stickers.recent || {};\n void loadRecentStickers(hash);\n});\n\naddReducer('loadFavoriteStickers', (global) => {\n const { hash } = global.stickers.favorite || {};\n void loadFavoriteStickers(hash);\n});\n\naddReducer('loadGreetingStickers', (global) => {\n const { hash } = global.stickers.greeting || {};\n\n (async () => {\n const greeting = await callApi('fetchStickersForEmoji', { emoji: '👋⭐️', hash });\n\n if (!greeting) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n stickers: {\n ...newGlobal.stickers,\n greeting: {\n hash: greeting.hash,\n stickers: greeting.stickers.filter((sticker) => sticker.emoji === '👋'),\n },\n },\n });\n })();\n});\n\naddReducer('loadFeaturedStickers', (global) => {\n const { hash } = global.stickers.featured || {};\n void loadFeaturedStickers(hash);\n});\n\naddReducer('loadStickers', (global, actions, payload) => {\n const { stickerSetId, stickerSetShortName } = payload!;\n let { stickerSetAccessHash } = payload!;\n\n if (!stickerSetAccessHash && !stickerSetShortName) {\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n stickerSetAccessHash = stickerSet.accessHash;\n }\n\n void loadStickers(stickerSetId, stickerSetAccessHash, stickerSetShortName);\n});\n\naddReducer('loadAnimatedEmojis', () => {\n void loadAnimatedEmojis();\n void loadAnimatedEmojiEffects();\n});\n\naddReducer('loadSavedGifs', (global) => {\n const { hash } = global.gifs.saved;\n void loadSavedGifs(hash);\n});\n\naddReducer('faveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void callApi('faveSticker', { sticker });\n }\n});\n\naddReducer('unfaveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void unfaveSticker(sticker);\n }\n});\n\naddReducer('toggleStickerSet', (global, actions, payload) => {\n const { stickerSetId } = payload!;\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n const { accessHash, installedDate } = stickerSet;\n\n void callApi(!installedDate ? 'installStickerSet' : 'uninstallStickerSet', { stickerSetId, accessHash });\n});\n\naddReducer('loadEmojiKeywords', (global, actions, payload: { language: LangCode }) => {\n const { language } = payload;\n\n let currentEmojiKeywords = global.emojiKeywords[language];\n if (currentEmojiKeywords?.isLoading) {\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: true,\n },\n },\n });\n\n (async () => {\n const emojiKeywords = await callApi('fetchEmojiKeywords', {\n language,\n fromVersion: currentEmojiKeywords ? currentEmojiKeywords.version : 0,\n });\n\n global = getGlobal();\n currentEmojiKeywords = global.emojiKeywords[language];\n\n if (!emojiKeywords) {\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: false,\n },\n },\n });\n\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n isLoading: false,\n version: emojiKeywords.version,\n keywords: {\n ...(currentEmojiKeywords?.keywords),\n ...emojiKeywords.keywords,\n },\n },\n },\n });\n })();\n});\n\nasync function loadStickerSets(hash?: string) {\n const addedStickers = await callApi('fetchStickerSets', { hash });\n if (!addedStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'added',\n addedStickers.hash,\n addedStickers.sets,\n ));\n}\n\nasync function loadRecentStickers(hash?: string) {\n const recentStickers = await callApi('fetchRecentStickers', { hash });\n if (!recentStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n recent: recentStickers,\n },\n });\n}\n\nasync function loadFavoriteStickers(hash?: string) {\n const favoriteStickers = await callApi('fetchFavoriteStickers', { hash });\n if (!favoriteStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: favoriteStickers,\n },\n });\n}\n\nasync function loadFeaturedStickers(hash?: string) {\n const featuredStickers = await callApi('fetchFeaturedStickers', { hash });\n if (!featuredStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'featured',\n featuredStickers.hash,\n featuredStickers.sets,\n ));\n}\n\nasync function loadStickers(stickerSetId: string, accessHash: string, stickerSetShortName?: string) {\n const stickerSet = await callApi(\n 'fetchStickers',\n { stickerSetShortName, stickerSetId, accessHash },\n );\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers, packs } = stickerSet;\n\n let global = getGlobal();\n\n global = updateStickerSet(global, set.id, { ...set, stickers, packs });\n\n const currentEmoji = global.stickers.forEmoji.emoji;\n if (currentEmoji && packs[currentEmoji]) {\n global = rebuildStickersForEmoji(global);\n }\n\n setGlobal(global);\n}\n\nasync function loadAnimatedEmojis() {\n const stickerSet = await callApi('fetchAnimatedEmojis');\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers } = stickerSet;\n\n setGlobal(replaceAnimatedEmojis(getGlobal(), { ...set, stickers }));\n}\n\nasync function loadAnimatedEmojiEffects() {\n const stickerSet = await callApi('fetchAnimatedEmojiEffects');\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers } = stickerSet;\n\n setGlobal({\n ...getGlobal(),\n animatedEmojiEffects: { ...set, stickers },\n });\n}\n\nfunction unfaveSticker(sticker: ApiSticker) {\n const global = getGlobal();\n\n // Remove sticker preemptively to get instant feedback when user removes sticker\n // from favorites while in Sticker Picker\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: {\n ...global.stickers.favorite,\n stickers: global.stickers.favorite.stickers.filter(({ id }) => id !== sticker.id),\n },\n },\n });\n\n void callApi('faveSticker', { sticker, unfave: true });\n}\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (query) {\n void searchThrottled(() => {\n searchStickers(query);\n });\n }\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query);\n });\n }\n});\n\naddReducer('searchMoreGifs', (global) => {\n const { query, offset } = global.gifs.search;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query, offset);\n });\n }\n});\n\naddReducer('loadStickersForEmoji', (global, actions, payload) => {\n const { emoji } = payload!;\n const { hash } = global.stickers.forEmoji;\n\n void searchThrottled(() => {\n loadStickersForEmoji(emoji, hash);\n });\n});\n\naddReducer('clearStickersForEmoji', (global) => {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {},\n },\n };\n});\n\naddReducer('openStickerSetShortName', (global, actions, payload) => {\n const { stickerSetShortName } = payload!;\n return {\n ...global,\n openedStickerSetShortName: stickerSetShortName,\n };\n});\n\nasync function searchStickers(query: string, hash?: string) {\n const result = await callApi('searchStickers', { query, hash });\n\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n const { setsById, added } = global.stickers;\n\n const resultIds = result.sets.map(({ id }) => id);\n\n if (added.setIds) {\n added.setIds.forEach((id) => {\n if (!resultIds.includes(id)) {\n const { title } = setsById[id] || {};\n if (title && searchWords(title, query)) {\n resultIds.unshift(id);\n }\n }\n });\n }\n\n setGlobal(updateStickerSets(\n global,\n 'search',\n result.hash,\n result.sets,\n resultIds,\n ));\n}\n\nasync function searchGifs(query: string, offset?: string) {\n const result = await callApi('searchGifs', { query, offset });\n if (!result) {\n return;\n }\n\n setGlobal(updateGifSearch(getGlobal(), !offset, result.gifs, result.nextOffset));\n}\n\nasync function loadSavedGifs(hash?: string) {\n const savedGifs = await callApi('fetchSavedGifs', { hash });\n if (!savedGifs) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n gifs: {\n ...global.gifs,\n saved: savedGifs,\n },\n });\n}\n\nasync function loadStickersForEmoji(emoji: string, hash?: string) {\n let global = getGlobal();\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n ...global.stickers.forEmoji,\n emoji,\n },\n },\n });\n\n const result = await callApi('fetchStickersForEmoji', { emoji, hash });\n\n global = getGlobal();\n\n if (!result || global.stickers.forEmoji.emoji !== emoji) {\n return;\n }\n\n global = updateStickersForEmoji(global, emoji, result.stickers, result.hash);\n\n setGlobal(global);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types';\n\nimport {\n addChats,\n addMessages,\n addUsers,\n updateGlobalSearch,\n updateGlobalSearchFetchingStatus,\n updateGlobalSearchResults,\n} from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\nimport { selectChat, selectCurrentGlobalSearchQuery } from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { GLOBAL_SEARCH_SLICE } from '../../../config';\nimport { timestampPlusDay } from '../../../util/dateFormat';\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { chatId } = global.globalSearch;\n const { query } = payload!;\n\n if (query && !chatId) {\n void searchThrottled(() => {\n searchChats(query);\n });\n }\n});\n\naddReducer('setGlobalSearchDate', (global, actions, payload) => {\n const { date } = payload!;\n const maxDate = date ? timestampPlusDay(date) : date;\n const newGlobal = updateGlobalSearch(global, {\n date,\n query: '',\n resultsByType: {\n ...global.globalSearch.resultsByType,\n text: {\n totalCount: undefined,\n foundIds: [],\n nextOffsetId: 0,\n },\n },\n });\n setGlobal(newGlobal);\n const { chatId } = global.globalSearch;\n const chat = chatId ? selectChat(global, chatId) : undefined;\n searchMessagesGlobal('', 'text', undefined, chat, maxDate, date);\n});\n\naddReducer('searchMessagesGlobal', (global, actions, payload) => {\n const {\n query, resultsByType, chatId, date,\n } = global.globalSearch;\n const maxDate = date ? timestampPlusDay(date) : date;\n const { type } = payload;\n const nextOffsetId = (resultsByType?.[type as ApiGlobalMessageSearchType])?.nextOffsetId;\n\n const chat = chatId ? selectChat(global, chatId) : undefined;\n\n searchMessagesGlobal(query, type, nextOffsetId, chat, maxDate, date);\n});\n\nasync function searchChats(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { chats: false }));\n return;\n }\n\n const {\n localChats, localUsers, globalChats, globalUsers,\n } = result;\n\n if (localChats.length || globalChats.length) {\n global = addChats(global, buildCollectionByKey([...localChats, ...globalChats], 'id'));\n }\n\n if (localUsers.length || globalUsers.length) {\n global = addUsers(global, buildCollectionByKey([...localUsers, ...globalUsers], 'id'));\n }\n\n global = updateGlobalSearchFetchingStatus(global, { chats: false });\n global = updateGlobalSearch(global, {\n localResults: {\n chatIds: localChats.map(({ id }) => id),\n userIds: localUsers.map(({ id }) => id),\n },\n globalResults: {\n ...global.globalSearch.globalResults,\n chatIds: globalChats.map(({ id }) => id),\n userIds: globalUsers.map(({ id }) => id),\n },\n });\n\n setGlobal(global);\n}\n\nasync function searchMessagesGlobal(\n query = '', type: ApiGlobalMessageSearchType, offsetRate?: number, chat?: ApiChat, maxDate?: number, minDate?: number,\n) {\n let result;\n\n if (chat) {\n const localResult = await callApi('searchMessagesLocal', {\n chat,\n query,\n type,\n limit: GLOBAL_SEARCH_SLICE,\n offsetId: offsetRate,\n minDate,\n maxDate,\n });\n\n if (localResult) {\n const {\n messages, users, totalCount, nextOffsetId,\n } = localResult;\n\n result = {\n messages,\n users,\n chats: [],\n totalCount,\n nextRate: nextOffsetId,\n };\n }\n } else {\n result = await callApi('searchMessagesGlobal', {\n query,\n offsetRate,\n limit: GLOBAL_SEARCH_SLICE,\n type,\n maxDate,\n minDate,\n });\n }\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || (query !== '' && query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { messages: false }));\n return;\n }\n\n const {\n messages, users, chats, totalCount, nextRate,\n } = result;\n\n if (chats.length) {\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n }\n\n if (users.length) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (messages.length) {\n global = addMessages(global, messages);\n }\n\n global = updateGlobalSearchResults(\n global,\n messages,\n totalCount,\n type,\n nextRate,\n );\n\n setGlobal(global);\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectCurrentTextSearch,\n selectCurrentMediaSearch,\n selectCurrentMessageList,\n selectChat,\n selectThreadInfo,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n addChatMessagesById,\n addChats,\n addUsers,\n updateLocalMediaSearchResults,\n updateLocalTextSearchResults,\n} from '../../reducers';\nimport { SharedMediaType } from '../../../types';\n\naddReducer('searchTextMessagesLocal', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const currentSearch = selectCurrentTextSearch(global);\n if (!chat || !currentSearch || !threadId) {\n return;\n }\n\n const { query, results } = currentSearch;\n const offsetId = results?.nextOffsetId;\n\n let topMessageId: number | undefined;\n if (threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId!, threadId);\n topMessageId = threadInfo?.topMessageId;\n }\n\n void searchTextMessages(chat, threadId, topMessageId, query, offsetId);\n});\n\naddReducer('searchMediaMessagesLocal', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const chat = selectChat(global, chatId);\n const currentSearch = selectCurrentMediaSearch(global);\n\n if (!chat || !currentSearch) {\n return;\n }\n\n const { currentType: type, resultsByType } = currentSearch;\n const currentResults = type && resultsByType && resultsByType[type];\n const offsetId = currentResults?.nextOffsetId;\n\n if (!type) {\n return;\n }\n\n void searchSharedMedia(chat, type, offsetId);\n});\n\naddReducer('searchMessagesByDate', (global, actions, payload) => {\n const { timestamp } = payload!;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void searchMessagesByDate(chat, timestamp);\n});\n\nasync function searchTextMessages(\n chat: ApiChat,\n threadId: number,\n topMessageId?: number,\n query?: string,\n offsetId?: number,\n) {\n if (!query) {\n return;\n }\n\n const result = await callApi('searchMessagesLocal', {\n chat,\n type: 'text',\n query,\n topMessageId,\n limit: MESSAGE_SEARCH_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n chats, users, messages, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentTextSearch(global);\n if (!currentSearch || query !== currentSearch.query) {\n return;\n }\n\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChatMessagesById(global, chat.id, byId);\n global = updateLocalTextSearchResults(global, chat.id, threadId, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\nasync function searchSharedMedia(\n chat: ApiChat,\n type: SharedMediaType,\n offsetId?: number,\n isBudgetPreload = false,\n) {\n const result = await callApi('searchMessagesLocal', {\n chat,\n type,\n limit: SHARED_MEDIA_SLICE * 2,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n chats, users, messages, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentMediaSearch(global);\n if (!currentSearch) {\n return;\n }\n\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChatMessagesById(global, chat.id, byId);\n global = updateLocalMediaSearchResults(global, chat.id, type, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n\n if (!isBudgetPreload) {\n searchSharedMedia(chat, type, nextOffsetId, true);\n }\n}\n\nasync function searchMessagesByDate(chat: ApiChat, timestamp: number) {\n const messageId = await callApi('findFirstMessageIdAfterDate', {\n chat,\n timestamp,\n });\n\n if (!messageId) {\n return;\n }\n\n getDispatch().focusMessage({\n chatId: chat.id,\n messageId,\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementProgress } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { updateChat, updateManagement, updateManagementProgress } from '../../reducers';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport { isChatBasicGroup } from '../../helpers';\n\naddReducer('checkPublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n // No need to check the username if already in progress\n if (global.management.progress === ManagementProgress.InProgress) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n\n const isUsernameAvailable = await callApi('checkChatUsername', { username })!;\n\n global = getGlobal();\n global = updateManagementProgress(\n global, isUsernameAvailable ? ManagementProgress.Complete : ManagementProgress.Error,\n );\n global = updateManagement(global, chatId, { isUsernameAvailable });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n let chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n setGlobal(global);\n\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n const result = await callApi('setChatUsername', { chat, username });\n\n global = getGlobal();\n global = updateManagementProgress(global, result ? ManagementProgress.Complete : ManagementProgress.Error);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePrivateLink', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n callApi('updatePrivateLink', { chat });\n});\n\naddReducer('setEditingExportedInvite', (global, actions, payload) => {\n const { chatId, invite } = payload;\n\n setGlobal(updateManagement(global, chatId, { editingInvite: invite }));\n});\n\naddReducer('setOpenedInviteInfo', (global, actions, payload) => {\n const { chatId, invite } = payload;\n\n const update = invite ? { inviteInfo: { invite } } : { inviteInfo: undefined };\n\n setGlobal(updateManagement(global, chatId, update));\n});\n\naddReducer('loadExportedChatInvites', (global, actions, payload) => {\n const {\n chatId, adminId, isRevoked, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const admin = selectUser(global, adminId || global.currentUserId);\n if (!peer || !admin) return;\n\n (async () => {\n const result = await callApi('fetchExportedChatInvites', {\n peer, admin, isRevoked, limit,\n });\n if (!result) {\n return;\n }\n const update = isRevoked ? { revokedInvites: result } : { invites: result };\n\n setGlobal(updateManagement(getGlobal(), chatId, update));\n })();\n});\n\naddReducer('editExportedChatInvite', (global, actions, payload) => {\n const {\n chatId, link, isRevoked, expireDate, usageLimit, isRequestNeeded, title,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('editExportedChatInvite', {\n peer,\n link,\n isRevoked,\n expireDate,\n usageLimit,\n isRequestNeeded,\n title,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n let invites = global.management.byChatId[chatId].invites || [];\n const revokedInvites = global.management.byChatId[chatId].revokedInvites || [];\n const { oldInvite, newInvite } = result;\n invites = invites.filter((current) => current.link !== oldInvite.link);\n if (newInvite.isRevoked) {\n revokedInvites.unshift(newInvite);\n } else {\n invites.push(newInvite);\n }\n setGlobal(updateManagement(global, chatId, {\n invites,\n revokedInvites,\n }));\n })();\n});\n\naddReducer('exportChatInvite', (global, actions, payload) => {\n const {\n chatId, expireDate, usageLimit, isRequestNeeded, title,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('exportChatInvite', {\n peer,\n expireDate,\n usageLimit,\n isRequestNeeded,\n title,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const invites = global.management.byChatId[chatId].invites || [];\n setGlobal(updateManagement(global, chatId, {\n invites: [...invites, result],\n }));\n })();\n});\n\naddReducer('deleteExportedChatInvite', (global, actions, payload) => {\n const {\n chatId, link,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('deleteExportedChatInvite', {\n peer,\n link,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const managementState = global.management.byChatId[chatId];\n setGlobal(updateManagement(global, chatId, {\n invites: managementState?.invites?.filter((invite) => invite.link !== link),\n revokedInvites: managementState?.revokedInvites?.filter((invite) => invite.link !== link),\n }));\n })();\n});\n\naddReducer('deleteRevokedExportedChatInvites', (global, actions, payload) => {\n const {\n chatId, adminId,\n } = payload!;\n const peer = selectChat(global, chatId);\n const admin = selectUser(global, adminId || global.currentUserId);\n if (!peer || !admin) return;\n\n (async () => {\n const result = await callApi('deleteRevokedExportedChatInvites', {\n peer,\n admin,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n setGlobal(updateManagement(global, chatId, {\n revokedInvites: [],\n }));\n })();\n});\n\naddReducer('loadChatInviteImporters', (global, actions, payload) => {\n const {\n chatId, link, offsetDate, offsetUserId, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const offsetUser = selectUser(global, offsetUserId);\n if (!peer || (offsetUserId && !offsetUser)) return;\n\n (async () => {\n const result = await callApi('fetchChatInviteImporters', {\n peer,\n link,\n offsetDate,\n offsetUser,\n limit,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const currentInviteInfo = global.management.byChatId[chatId]?.inviteInfo;\n if (!currentInviteInfo?.invite || currentInviteInfo.invite.link !== link) return;\n setGlobal(updateManagement(global, chatId, {\n inviteInfo: {\n ...currentInviteInfo,\n importers: result,\n },\n }));\n })();\n});\n\naddReducer('loadChatInviteRequesters', (global, actions, payload) => {\n const {\n chatId, link, offsetDate, offsetUserId, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const offsetUser = selectUser(global, offsetUserId);\n if (!peer || (offsetUserId && !offsetUser)) return;\n\n (async () => {\n const result = await callApi('fetchChatInviteImporters', {\n peer,\n link,\n offsetDate,\n offsetUser,\n limit,\n isRequested: true,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n const currentInviteInfo = global.management.byChatId[chatId]?.inviteInfo;\n if (!currentInviteInfo?.invite || currentInviteInfo.invite.link !== link) return;\n setGlobal(updateManagement(global, chatId, {\n inviteInfo: {\n ...currentInviteInfo,\n requesters: result,\n },\n }));\n })();\n});\n\naddReducer('loadChatJoinRequests', (global, actions, payload) => {\n const {\n chatId, offsetDate, offsetUserId, limit,\n } = payload!;\n const peer = selectChat(global, chatId);\n const offsetUser = selectUser(global, offsetUserId);\n if (!peer || (offsetUserId && !offsetUser)) return;\n\n (async () => {\n const result = await callApi('fetchChatInviteImporters', {\n peer,\n offsetDate,\n offsetUser,\n limit,\n isRequested: true,\n });\n if (!result) {\n return;\n }\n global = getGlobal();\n setGlobal(updateChat(global, chatId, { joinRequests: result }));\n })();\n});\n\naddReducer('hideChatJoinRequest', (global, actions, payload) => {\n const {\n chatId, userId, isApproved,\n } = payload!;\n const peer = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!peer || !user) return;\n\n (async () => {\n const result = await callApi('hideChatJoinRequest', {\n peer,\n user,\n isApproved,\n });\n\n if (!result) return;\n global = getGlobal();\n const targetChat = selectChat(global, chatId);\n if (!targetChat) return;\n setGlobal(updateChat(global, chatId, {\n joinRequests: targetChat.joinRequests?.filter((importer) => importer.userId !== userId),\n }));\n })();\n});\n\naddReducer('hideAllChatJoinRequests', (global, actions, payload) => {\n const {\n chatId, isApproved, link,\n } = payload!;\n const peer = selectChat(global, chatId);\n if (!peer) return;\n\n (async () => {\n const result = await callApi('hideAllChatJoinRequests', {\n peer,\n isApproved,\n link,\n });\n\n if (!result) return;\n global = getGlobal();\n const targetChat = selectChat(global, chatId);\n if (!targetChat) return;\n\n setGlobal(updateChat(global, chatId, {\n joinRequests: [],\n fullInfo: {\n ...targetChat.fullInfo,\n recentRequesterIds: [],\n requestsPending: 0,\n },\n }));\n })();\n});\n","import {\n addReducer, getGlobal, setGlobal, getDispatch,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiFormattedText, ApiMessage, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport {\n DEBUG, MESSAGE_LIST_SLICE, SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n updateUsers,\n updateChats,\n updateThreadInfos,\n replaceThreadParam,\n updateListedIds,\n safeReplaceViewportIds,\n addChatMessagesById,\n} from '../../reducers';\nimport {\n selectCurrentMessageList,\n selectDraft,\n selectChatMessage,\n selectThreadInfo,\n} from '../../selectors';\nimport { init as initFolderManager } from '../../../util/folderManager';\n\nconst RELEASE_STATUS_TIMEOUT = 15000; // 10 sec;\n\nlet releaseStatusTimeout: number | undefined;\n\naddReducer('sync', () => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START SYNC');\n }\n\n if (releaseStatusTimeout) {\n clearTimeout(releaseStatusTimeout);\n }\n\n setGlobal({ ...getGlobal(), isSyncing: true });\n\n // Workaround for `isSyncing = true` sometimes getting stuck for some reason\n releaseStatusTimeout = window.setTimeout(() => {\n setGlobal({ ...getGlobal(), isSyncing: false });\n releaseStatusTimeout = undefined;\n }, RELEASE_STATUS_TIMEOUT);\n\n const { loadAllChats, preloadTopChatMessages } = getDispatch();\n\n loadAllChats({\n listType: 'active',\n shouldReplace: true,\n onReplace: async () => {\n await loadAndReplaceMessages();\n\n setGlobal({\n ...getGlobal(),\n lastSyncTime: Date.now(),\n isSyncing: false,\n });\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH SYNC');\n }\n\n initFolderManager();\n loadAllChats({ listType: 'archived', shouldReplace: true });\n void callApi('fetchCurrentUser');\n preloadTopChatMessages();\n },\n });\n});\n\nasync function loadAndReplaceMessages() {\n let areMessagesLoaded = false;\n\n let global = getGlobal();\n\n // Memoize drafts\n const draftChatIds = Object.keys(global.messages.byChatId);\n const draftsByChatId = draftChatIds.reduce>((acc, chatId) => {\n const draft = selectDraft(global, chatId, MAIN_THREAD_ID);\n if (draft) {\n acc[chatId] = draft;\n }\n\n return acc;\n }, {});\n\n const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {};\n const currentChat = currentChatId ? global.chats.byId[currentChatId] : undefined;\n if (currentChatId && currentChat) {\n const result = await loadTopMessages(currentChat);\n global = getGlobal();\n const { chatId: newCurrentChatId } = selectCurrentMessageList(global) || {};\n const threadInfo = currentThreadId && selectThreadInfo(global, currentChatId, currentThreadId);\n\n if (result && newCurrentChatId === currentChatId) {\n const currentMessageListInfo = global.messages.byChatId[currentChatId];\n const localMessages = currentChatId === SERVICE_NOTIFICATIONS_USER_ID\n ? global.serviceNotifications.map(({ message }) => message)\n : [];\n const allMessages = ([] as ApiMessage[]).concat(result.messages, localMessages);\n const byId = buildCollectionByKey(allMessages, 'id');\n const listedIds = Object.keys(byId).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {},\n },\n };\n\n global = addChatMessagesById(global, currentChatId, byId);\n global = updateListedIds(global, currentChatId, MAIN_THREAD_ID, listedIds);\n global = safeReplaceViewportIds(global, currentChatId, MAIN_THREAD_ID, listedIds);\n\n if (currentThreadId && threadInfo && threadInfo.originChannelId) {\n const { originChannelId } = threadInfo;\n const currentMessageListInfoOrigin = global.messages.byChatId[originChannelId];\n const resultOrigin = await loadTopMessages(global.chats.byId[originChannelId]);\n if (resultOrigin) {\n const byIdOrigin = buildCollectionByKey(resultOrigin.messages, 'id');\n const listedIdsOrigin = Object.keys(byIdOrigin).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [threadInfo.originChannelId]: {\n byId: byIdOrigin,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfoOrigin?.threadsById[MAIN_THREAD_ID]),\n listedIds: listedIdsOrigin,\n viewportIds: listedIdsOrigin,\n outlyingIds: undefined,\n },\n },\n },\n [currentChatId]: {\n ...global.messages.byChatId[currentChatId],\n threadsById: {\n ...global.messages.byChatId[currentChatId].threadsById,\n [currentThreadId]: {\n ...(currentMessageListInfo?.threadsById[currentThreadId]),\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n }\n }\n\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateThreadInfos(global, currentChatId, result.threadInfos);\n\n areMessagesLoaded = true;\n }\n }\n\n if (!areMessagesLoaded) {\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {},\n },\n };\n }\n\n // Restore drafts\n Object.keys(draftsByChatId).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', draftsByChatId[chatId]);\n });\n\n setGlobal(global);\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n if (audioChatId && audioMessageId && !selectChatMessage(global, audioChatId, audioMessageId)) {\n getDispatch().closeAudioPlayer();\n }\n}\n\nfunction loadTopMessages(chat: ApiChat) {\n return callApi('fetchMessages', {\n chat,\n threadId: MAIN_THREAD_ID,\n offsetId: chat.lastReadInboxMessageId,\n addOffset: -(Math.round(MESSAGE_LIST_SLICE / 2) + 1),\n limit: MESSAGE_LIST_SLICE,\n });\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { debounce, throttle } from '../../../util/schedulers';\nimport { buildCollectionByKey, pick, unique } from '../../../util/iteratees';\nimport { isUserBot, isUserId } from '../../helpers';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport {\n addChats, addUsers, replaceUserStatuses, updateChat, updateManagementProgress, updateUser, updateUsers,\n updateUserSearch, updateUserSearchFetchingStatus,\n} from '../../reducers';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst runDebouncedForFetchFullUser = debounce((cb) => cb(), 500, false, true);\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runThrottledForSearch = throttle((cb) => cb(), 500, false);\n\naddReducer('loadFullUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n runDebouncedForFetchFullUser(() => callApi('fetchFullUser', { id, accessHash }));\n});\n\naddReducer('loadUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchUsers', { users: [user] });\n if (!result) {\n return;\n }\n\n const { users, userStatusesById } = result;\n\n global = getGlobal();\n\n global = updateUsers(global, buildCollectionByKey(users, 'id'));\n setGlobal(replaceUserStatuses(global, {\n ...global.users.statusesById,\n ...userStatusesById,\n }));\n\n setGlobal(global);\n })();\n});\n\naddReducer('loadTopUsers', (global) => {\n const { topPeers: { lastRequestedAt } } = global;\n\n if (!lastRequestedAt || getServerTime(global.serverTimeOffset) - lastRequestedAt > TOP_PEERS_REQUEST_COOLDOWN) {\n void loadTopUsers();\n }\n});\n\naddReducer('loadContactList', () => {\n void loadContactList();\n});\n\naddReducer('loadCurrentUser', () => {\n void callApi('fetchCurrentUser');\n});\n\naddReducer('loadCommonChats', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const user = chatId ? selectUser(global, chatId) : undefined;\n if (!user || isUserBot(user) || user.commonChats?.isFullyLoaded) {\n return;\n }\n\n (async () => {\n const maxId = user.commonChats?.maxId;\n const result = await callApi('fetchCommonChats', user.id, user.accessHash!, maxId);\n if (!result) {\n return;\n }\n\n const { chats, chatIds, isFullyLoaded } = result;\n\n global = getGlobal();\n if (chats.length) {\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n }\n global = updateUser(global, user.id, {\n commonChats: {\n maxId: chatIds.length ? chatIds[chatIds.length - 1] : '0',\n ids: unique((user.commonChats?.ids || []).concat(chatIds)),\n isFullyLoaded,\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('updateContact', (global, actions, payload) => {\n const {\n userId, isMuted, firstName, lastName,\n } = payload!;\n\n void updateContact(userId, isMuted, firstName, lastName);\n});\n\naddReducer('deleteContact', (global, actions, payload) => {\n const { userId } = payload!;\n\n void deleteContact(userId);\n});\n\nasync function loadTopUsers() {\n const result = await callApi('fetchTopUsers');\n if (!result) {\n return;\n }\n\n const { ids, users } = result;\n\n let global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = {\n ...global,\n topPeers: {\n ...global.topPeers,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(global);\n}\n\nasync function loadContactList() {\n const contactList = await callApi('fetchContactList');\n if (!contactList) {\n return;\n }\n\n let global = addUsers(getGlobal(), buildCollectionByKey(contactList.users, 'id'));\n global = addChats(global, buildCollectionByKey(contactList.chats, 'id'));\n\n // Sort contact list by Last Name (or First Name), with latin names being placed first\n const getCompareString = (user: ApiUser) => (user.lastName || user.firstName || '');\n const collator = new Intl.Collator('en-US');\n\n const sortedUsers = contactList.users.sort((a, b) => (\n collator.compare(getCompareString(a), getCompareString(b))\n )).filter((user) => !user.isSelf);\n\n setGlobal({\n ...global,\n contactList: {\n userIds: sortedUsers.map((user) => user.id),\n },\n });\n}\n\nasync function updateContact(\n userId: string,\n isMuted: boolean,\n firstName: string,\n lastName?: string,\n) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n getDispatch().updateChatMutedState({ chatId: userId, isMuted });\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n let result;\n if (user.phoneNumber) {\n result = await callApi('updateContact', { phone: user.phoneNumber, firstName, lastName });\n } else {\n const { id, accessHash } = user;\n result = await callApi('addContact', {\n id,\n accessHash,\n phoneNumber: '',\n firstName,\n lastName,\n });\n }\n\n if (result) {\n setGlobal(updateUser(\n getGlobal(),\n user.id,\n {\n firstName,\n lastName,\n },\n ));\n }\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n}\n\nasync function deleteContact(userId: string) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n await callApi('deleteContact', { id, accessHash });\n}\n\naddReducer('loadProfilePhotos', (global, actions, payload) => {\n const { profileId } = payload!;\n const isPrivate = isUserId(profileId);\n const user = isPrivate ? selectUser(global, profileId) : undefined;\n const chat = !isPrivate ? selectChat(global, profileId) : undefined;\n\n if (!user && !chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchProfilePhotos', user, chat);\n if (!result || !result.photos) {\n return;\n }\n\n let newGlobal = getGlobal();\n if (isPrivate) {\n newGlobal = updateUser(newGlobal, profileId, { photos: result.photos });\n } else {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users!, 'id'));\n newGlobal = updateChat(newGlobal, profileId, { photos: result.photos });\n }\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (!query) return;\n\n void runThrottledForSearch(() => {\n searchUsers(query);\n });\n});\n\naddReducer('addContact', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n void callApi('addContact', pick(user, ['id', 'accessHash', 'firstName', 'lastName', 'phoneNumber']));\n});\n\nasync function searchUsers(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = global.userSearch.query;\n\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateUserSearchFetchingStatus(global, false));\n return;\n }\n\n const { localUsers, globalUsers } = result;\n\n let localUserIds;\n let globalUserIds;\n if (localUsers.length) {\n global = addUsers(global, buildCollectionByKey(localUsers, 'id'));\n localUserIds = localUsers.map(({ id }) => id);\n }\n if (globalUsers.length) {\n global = addUsers(global, buildCollectionByKey(globalUsers, 'id'));\n globalUserIds = globalUsers.map(({ id }) => id);\n }\n\n global = updateUserSearchFetchingStatus(global, false);\n global = updateUserSearch(global, { localUserIds, globalUserIds });\n\n setGlobal(global);\n}\n","import { GlobalState } from '../../global/types';\nimport { InlineBotSettings } from '../../types';\n\nexport function replaceInlineBotSettings(\n global: GlobalState, username: string, inlineBotSettings: InlineBotSettings | false,\n): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n byUsername: {\n ...global.inlineBots.byUsername,\n [username]: inlineBotSettings,\n },\n },\n };\n}\n\nexport function replaceInlineBotsIsLoading(global: GlobalState, isLoading: boolean): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n isLoading,\n },\n };\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiContact, ApiUser } from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport {\n RE_TG_LINK, RE_TME_LINK,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectChat, selectChatBot, selectChatMessage, selectCurrentChat, selectCurrentMessageList,\n selectReplyingToId, selectSendAs, selectUser,\n} from '../../selectors';\nimport { addChats, addUsers, removeBlockedContact } from '../../reducers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce } from '../../../util/schedulers';\nimport { replaceInlineBotSettings, replaceInlineBotsIsLoading } from '../../reducers/bots';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runDebouncedForSearch = debounce((cb) => cb(), 500, false);\n\naddReducer('clickInlineButton', (global, actions, payload) => {\n const { button } = payload;\n\n switch (button.type) {\n case 'command':\n actions.sendBotCommand({ command: button.value });\n break;\n case 'url':\n if (button.value.match(RE_TME_LINK) || button.value.match(RE_TG_LINK)) {\n actions.openTelegramLink({ url: button.value });\n } else {\n actions.toggleSafeLinkModal({ url: button.value });\n }\n break;\n case 'callback': {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n void answerCallbackButton(chat, button.messageId, button.value);\n break;\n }\n case 'requestPoll':\n actions.openPollModal();\n break;\n case 'requestSelfContact': {\n const user = global.currentUserId ? selectUser(global, global.currentUserId) : undefined;\n if (!user) {\n return;\n }\n actions.showDialog({\n data: {\n phoneNumber: user.phoneNumber,\n firstName: user.firstName,\n lastName: user.lastName,\n userId: user.id,\n } as ApiContact,\n });\n break;\n }\n case 'buy': {\n const chat = selectCurrentChat(global);\n const { messageId, value } = button;\n if (!chat) {\n return;\n }\n\n if (value) {\n actions.getReceipt({ receiptMessageId: value, chatId: chat.id, messageId });\n } else {\n actions.getPaymentForm({ chat, messageId });\n actions.setInvoiceMessageInfo(selectChatMessage(global, chat.id, messageId));\n actions.openPaymentModal({ chatId: chat.id, messageId });\n }\n break;\n }\n }\n});\n\naddReducer('sendBotCommand', (global, actions, payload) => {\n const { command, chatId } = payload;\n const { currentUserId } = global;\n const chat = chatId ? selectChat(global, chatId) : selectCurrentChat(global);\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentUserId || !chat || !currentMessageList) {\n return;\n }\n\n const { threadId } = currentMessageList;\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId: chat.id, threadId, value: false });\n\n void sendBotCommand(\n chat, currentUserId, command, selectReplyingToId(global, chat.id, threadId), selectSendAs(global, chatId),\n );\n});\n\naddReducer('restartBot', (global, actions, payload) => {\n const { chatId } = payload;\n const { currentUserId } = global;\n const chat = selectCurrentChat(global);\n const bot = currentUserId && selectChatBot(global, chatId);\n if (!currentUserId || !chat || !bot) {\n return;\n }\n\n (async () => {\n const result = await callApi('unblockContact', bot.id, bot.accessHash);\n if (!result) {\n return;\n }\n\n setGlobal(removeBlockedContact(getGlobal(), bot.id));\n void sendBotCommand(chat, currentUserId, '/start', undefined, selectSendAs(global, chatId));\n })();\n});\n\naddReducer('loadTopInlineBots', (global) => {\n const { lastRequestedAt } = global.topInlineBots;\n\n if (lastRequestedAt && getServerTime(global.serverTimeOffset) - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchTopInlineBots');\n if (!result) {\n return;\n }\n\n const { ids, users } = result;\n\n let newGlobal = getGlobal();\n newGlobal = addUsers(newGlobal, buildCollectionByKey(users, 'id'));\n newGlobal = {\n ...newGlobal,\n topInlineBots: {\n ...newGlobal.topInlineBots,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('queryInlineBot', ((global, actions, payload) => {\n const {\n chatId, username, query, offset,\n } = payload;\n\n (async () => {\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (inlineBotData === false) {\n return;\n }\n\n if (inlineBotData === undefined) {\n const { user: inlineBot, chat } = await callApi('fetchInlineBot', { username }) || {};\n global = getGlobal();\n if (!inlineBot || !chat) {\n setGlobal(replaceInlineBotSettings(global, username, false));\n return;\n }\n\n global = addUsers(global, { [inlineBot.id]: inlineBot });\n global = addChats(global, { [chat.id]: chat });\n inlineBotData = {\n id: inlineBot.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n global = replaceInlineBotSettings(global, username, inlineBotData);\n setGlobal(global);\n }\n\n if (query === inlineBotData.query && !inlineBotData.canLoadMore) {\n return;\n }\n\n void runDebouncedForSearch(() => {\n searchInlineBot({\n username,\n inlineBotData: inlineBotData as InlineBotSettings,\n chatId,\n query,\n offset,\n });\n });\n })();\n}));\n\naddReducer('sendInlineBotResult', (global, actions, payload) => {\n const { id, queryId } = payload;\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList || !id) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const chat = selectChat(global, chatId)!;\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n void callApi('sendInlineBotResult', {\n chat,\n resultId: id,\n queryId,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n sendAs: selectSendAs(global, chatId),\n });\n});\n\naddReducer('resetInlineBot', (global, actions, payload) => {\n const { username } = payload;\n\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (!inlineBotData) {\n return;\n }\n\n inlineBotData = {\n id: inlineBotData.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n setGlobal(replaceInlineBotSettings(global, username, inlineBotData));\n});\n\naddReducer('startBot', (global, actions, payload) => {\n const { botId, param } = payload;\n\n const bot = selectUser(global, botId);\n if (!bot) {\n return;\n }\n\n (async () => {\n await callApi('startBot', {\n bot,\n startParam: param,\n });\n })();\n});\n\nasync function searchInlineBot({\n username,\n inlineBotData,\n chatId,\n query,\n offset,\n}: {\n username: string;\n inlineBotData: InlineBotSettings;\n chatId: string;\n query: string;\n offset?: string;\n}) {\n let global = getGlobal();\n const bot = selectUser(global, inlineBotData.id);\n const chat = selectChat(global, chatId);\n if (!bot || !chat) {\n return;\n }\n\n const shouldReplaceSettings = inlineBotData.query !== query;\n global = replaceInlineBotsIsLoading(global, true);\n global = replaceInlineBotSettings(global, username, {\n ...inlineBotData,\n query,\n ...(shouldReplaceSettings && { offset: undefined, results: [] }),\n });\n setGlobal(global);\n\n const result = await callApi('fetchInlineBotResults', {\n bot,\n chat,\n query,\n offset: shouldReplaceSettings ? undefined : offset,\n });\n\n const newInlineBotData = global.inlineBots.byUsername[username];\n global = replaceInlineBotsIsLoading(getGlobal(), false);\n if (!result || !newInlineBotData || query !== newInlineBotData.query) {\n setGlobal(global);\n return;\n }\n\n const currentIds = new Set((newInlineBotData.results || []).map((data) => data.id));\n const newResults = result.results.filter((data) => !currentIds.has(data.id));\n\n global = replaceInlineBotSettings(global, username, {\n ...newInlineBotData,\n help: result.help,\n ...(newResults.length && { isGallery: result.isGallery }),\n ...(result.switchPm && { switchPm: result.switchPm }),\n canLoadMore: result.results.length > 0 && Boolean(result.nextOffset),\n results: newInlineBotData.offset === '' || newInlineBotData.offset === result.nextOffset\n ? result.results\n : (newInlineBotData.results || []).concat(newResults),\n offset: newResults.length ? result.nextOffset : '',\n });\n\n setGlobal(global);\n}\n\nasync function sendBotCommand(\n chat: ApiChat, currentUserId: string, command: string, replyingTo?: number, sendAs?: ApiChat | ApiUser,\n) {\n await callApi('sendMessage', {\n chat,\n text: command,\n replyingTo,\n sendAs,\n });\n}\n\nasync function answerCallbackButton(chat: ApiChat, messageId: number, data: string) {\n const result = await callApi('answerCallbackButton', {\n chatId: chat.id,\n accessHash: chat.accessHash,\n messageId,\n data,\n });\n\n if (!result) {\n return;\n }\n\n const { showDialog, showNotification, toggleSafeLinkModal } = getDispatch();\n const { message, alert: isError, url } = result;\n\n if (isError) {\n showDialog({ data: { message: message || 'Error' } });\n } else if (message) {\n showNotification({ message });\n } else if (url) {\n toggleSafeLinkModal({ url });\n }\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { replaceSettings, updateTwoFaSettings } from '../../reducers';\n\naddReducer('loadPasswordInfo', () => {\n (async () => {\n const result = await callApi('getPasswordInfo');\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = replaceSettings(global, { hasPassword: result.hasPassword });\n global = updateTwoFaSettings(global, { hint: result.hint });\n setGlobal(global);\n })();\n});\n\naddReducer('checkPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('checkPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('clearPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('clearPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updatePassword', (global, actions, payload) => {\n const {\n currentPassword, password, hint, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updatePassword', currentPassword, password, hint, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updateRecoveryEmail', (global, actions, payload) => {\n const {\n currentPassword, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updateRecoveryEmail', currentPassword, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false, waitingEmailCodeLength: undefined }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('provideTwoFaEmailCode', (global, actions, payload) => {\n const { code } = payload;\n\n void callApi('provideRecoveryEmailCode', code);\n});\n\naddReducer('clearTwoFaError', (global) => {\n return updateTwoFaSettings(global, { error: undefined });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { PaymentStep } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n selectPaymentMessageId,\n selectPaymentRequestId,\n selectProviderPublishableKey,\n selectStripeCredentials,\n selectChatMessage,\n selectPaymentChatId,\n selectChat,\n selectPaymentFormId,\n selectProviderPublicToken,\n selectSmartGlocalCredentials,\n} from '../../selectors';\nimport { callApi } from '../../../api/gramjs';\nimport { getStripeError } from '../../helpers';\nimport { buildQueryString } from '../../../util/requestQuery';\nimport { DEBUG_PAYMENT_SMART_GLOCAL } from '../../../config';\n\nimport {\n updateShippingOptions,\n setPaymentStep,\n setRequestInfoId,\n setPaymentForm,\n setStripeCardInfo,\n setInvoiceMessageInfo,\n setReceipt,\n clearPayment,\n closeInvoice,\n setSmartGlocalCardInfo,\n} from '../../reducers';\n\naddReducer('validateRequestedInfo', (global, actions, payload) => {\n const { requestInfo, saveInfo } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n if (!chat || !messageId) {\n return;\n }\n void validateRequestedInfo(chat, messageId, requestInfo, saveInfo);\n});\n\nasync function validateRequestedInfo(chat: ApiChat, messageId: number, requestInfo: any, shouldSave?: true) {\n const result = await callApi('validateRequestedInfo', {\n chat, messageId, requestInfo, shouldSave,\n });\n if (!result) {\n return;\n }\n\n const { id, shippingOptions } = result;\n if (!id) {\n return;\n }\n\n let global = setRequestInfoId(getGlobal(), id);\n if (shippingOptions) {\n global = updateShippingOptions(global, shippingOptions);\n global = setPaymentStep(global, PaymentStep.Shipping);\n } else {\n global = setPaymentStep(global, PaymentStep.PaymentInfo);\n }\n setGlobal(global);\n}\n\naddReducer('getPaymentForm', (global, actions, payload) => {\n const { chat, messageId } = payload;\n if (!chat || !messageId) {\n return;\n }\n void getPaymentForm(chat, messageId);\n});\n\nasync function getPaymentForm(chat: ApiChat, messageId: number) {\n const result = await callApi('getPaymentForm', { chat, messageId });\n if (!result) {\n return;\n }\n let global = setPaymentForm(getGlobal(), result);\n let step = PaymentStep.PaymentInfo;\n if (global.payment.invoice\n && (global.payment.invoice.shippingAddressRequested\n || global.payment.invoice.nameRequested\n || global.payment.invoice.phoneRequested\n || global.payment.invoice.emailRequested)) {\n step = PaymentStep.ShippingInfo;\n }\n global = setPaymentStep(global, step);\n setGlobal(global);\n}\n\naddReducer('getReceipt', (global, actions, payload) => {\n const { receiptMessageId, chatId, messageId } = payload;\n const chat = chatId && selectChat(global, chatId);\n if (!messageId || !receiptMessageId || !chat) {\n return;\n }\n\n void getReceipt(chat, messageId, receiptMessageId);\n});\n\nasync function getReceipt(chat: ApiChat, messageId: number, receiptMessageId: number) {\n const result = await callApi('getReceipt', chat, receiptMessageId);\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n const message = selectChatMessage(global, chat.id, messageId);\n global = setReceipt(global, result, message);\n setGlobal(global);\n}\n\naddReducer('clearPaymentError', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: undefined,\n },\n });\n});\n\naddReducer('clearReceipt', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n });\n});\n\naddReducer('sendCredentialsInfo', (global, actions, payload) => {\n const { nativeProvider } = global.payment;\n const { credentials } = payload;\n const { data } = credentials;\n\n if (nativeProvider === 'stripe') {\n const publishableKey = selectProviderPublishableKey(global);\n if (!publishableKey) {\n return;\n }\n void sendStripeCredentials(data, publishableKey);\n } else if (nativeProvider === 'smartglocal') {\n const publicToken = selectProviderPublicToken(global);\n if (!publicToken) {\n return;\n }\n void sendSmartGlocalCredentials(data, publicToken);\n }\n});\n\naddReducer('sendPaymentForm', (global, actions, payload) => {\n const { shippingOptionId, saveCredentials } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n const formId = selectPaymentFormId(global);\n const requestInfoId = selectPaymentRequestId(global);\n const { nativeProvider } = global.payment;\n const publishableKey = nativeProvider === 'stripe'\n ? selectProviderPublishableKey(global) : selectProviderPublicToken(global);\n if (!chat || !messageId || !publishableKey || !formId || !nativeProvider) {\n return;\n }\n\n void sendPaymentForm(chat, messageId, nativeProvider, formId, {\n save: saveCredentials,\n data: nativeProvider === 'stripe' ? selectStripeCredentials(global) : selectSmartGlocalCredentials(global),\n }, requestInfoId, shippingOptionId);\n});\n\nasync function sendStripeCredentials(\n data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n country: string;\n zip: string;\n },\n publishableKey: string,\n) {\n const query = buildQueryString({\n 'card[number]': data.cardNumber,\n 'card[exp_month]': data.expiryMonth,\n 'card[exp_year]': data.expiryYear,\n 'card[cvc]': data.cvv,\n 'card[address_zip]': data.zip,\n 'card[address_country]': data.country,\n });\n\n const response = await fetch(`https://api.stripe.com/v1/tokens${query}`, {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Authorization: `Bearer ${publishableKey}`,\n },\n });\n const result = await response.json();\n if (result.error) {\n const error = getStripeError(result.error);\n const global = getGlobal();\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: {\n ...error,\n },\n },\n });\n return;\n }\n let global = setStripeCardInfo(getGlobal(), {\n type: result.type,\n id: result.id,\n });\n global = setPaymentStep(global, PaymentStep.Checkout);\n setGlobal(global);\n}\n\nasync function sendSmartGlocalCredentials(\n data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n },\n publicToken: string,\n) {\n const params = {\n card: {\n number: data.cardNumber.replace(/[^\\d]+/g, ''),\n expiration_month: data.expiryMonth,\n expiration_year: data.expiryYear,\n security_code: data.cvv.replace(/[^\\d]+/g, ''),\n },\n };\n const url = DEBUG_PAYMENT_SMART_GLOCAL\n ? 'https://tgb-playground.smart-glocal.com/cds/v1/tokenize/card'\n : 'https://tgb.smart-glocal.com/cds/v1/tokenize/card';\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-PUBLIC-TOKEN': publicToken,\n },\n body: JSON.stringify(params),\n });\n const result = await response.json();\n\n if (result.status !== 'ok') {\n // TODO после получения документации сделать аналог getStripeError(result.error);\n const error = { description: 'payment error' };\n const global = getGlobal();\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: {\n ...error,\n },\n },\n });\n return;\n }\n\n let global = setSmartGlocalCardInfo(getGlobal(), {\n type: 'card',\n token: result.data.token,\n });\n global = setPaymentStep(global, PaymentStep.Checkout);\n setGlobal(global);\n}\n\nasync function sendPaymentForm(\n chat: ApiChat,\n messageId: number,\n nativeProvider: string,\n formId: string,\n credentials: any,\n requestedInfoId?: string,\n shippingOptionId?: string,\n) {\n const result = await callApi('sendPaymentForm', {\n chat, messageId, formId, credentials, requestedInfoId, shippingOptionId,\n });\n\n if (result === true) {\n const global = clearPayment(getGlobal());\n setGlobal(closeInvoice(global));\n }\n}\n\naddReducer('setPaymentStep', (global, actions, payload = {}) => {\n return setPaymentStep(global, payload.step || PaymentStep.ShippingInfo);\n});\n\naddReducer('setInvoiceMessageInfo', (global, actions, payload) => {\n return setInvoiceMessageInfo(global, payload);\n});\n","export function buildQueryString(data: Record) {\n const query = Object.keys(data).map((k) => `${k}=${data[k]}`).join('&');\n return query.length > 0 ? `?${query}` : '';\n}\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../../../config';\n\nconst REM = 16; // px\nconst MAX_TOOLBAR_WIDTH = 32 * REM;\nconst MAX_MESSAGES_LIST_WIDTH = 45.5 * REM;\nexport const SIDE_COLUMN_MAX_WIDTH = 26.5 * REM;\nexport const MIN_LEFT_COLUMN_WIDTH = 18 * REM;\nconst UNPIN_BUTTON_WIDTH = 16.125 * REM;\n\nexport default function calculateMiddleFooterTransforms(windowWidth: number, canPost?: boolean) {\n const sidePadding = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? REM\n : 2 * REM;\n const messageListWidth = getMessageListWidth(windowWidth);\n const sendButtonWidth = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? 3.375 * REM\n : 4 * REM;\n\n const composerWidth = canPost\n ? messageListWidth - sidePadding - sendButtonWidth\n : messageListWidth - sidePadding;\n const toolbarWidth = windowWidth > MOBILE_SCREEN_MAX_WIDTH\n ? Math.min(messageListWidth - sidePadding, MAX_TOOLBAR_WIDTH)\n : messageListWidth - sidePadding;\n\n const composerHiddenScale = toolbarWidth / composerWidth;\n const toolbarHiddenScale = composerWidth / toolbarWidth;\n const unpinHiddenScale = toolbarWidth / UNPIN_BUTTON_WIDTH;\n const toolbarForUnpinHiddenScale = UNPIN_BUTTON_WIDTH / toolbarWidth;\n\n const composerTranslateX = canPost\n ? (sendButtonWidth / 2) * toolbarHiddenScale\n : 0;\n\n const toolbarTranslateX = canPost\n ? (sendButtonWidth / 2) * -1 * composerHiddenScale\n : 0;\n\n return {\n composerHiddenScale,\n toolbarHiddenScale,\n composerTranslateX,\n toolbarTranslateX,\n unpinHiddenScale,\n toolbarForUnpinHiddenScale,\n };\n}\n\nfunction getMessageListWidth(windowWidth: number) {\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.25, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n const rightColumnWidth = Math.min(\n windowWidth * 0.25,\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth - rightColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.4, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MAX_MESSAGES_LIST_WIDTH) {\n return MAX_MESSAGES_LIST_WIDTH;\n }\n\n return windowWidth;\n}\n","import { updateChatMessage } from './messages';\nimport { GlobalState } from '../../global/types';\nimport { selectChatMessage } from '../selectors';\nimport { MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN, MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config';\nimport {\n MIN_LEFT_COLUMN_WIDTH,\n SIDE_COLUMN_MAX_WIDTH,\n} from '../../components/middle/helpers/calculateMiddleFooterTransforms';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\n\nfunction getLeftColumnWidth(windowWidth: number) {\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) {\n return Math.min(\n Math.max(windowWidth * 0.25, MIN_LEFT_COLUMN_WIDTH),\n windowWidth * 0.33,\n );\n }\n\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN) {\n return Math.min(\n Math.max(windowWidth * 0.33, MIN_LEFT_COLUMN_WIDTH),\n windowWidth * 0.4,\n );\n }\n\n return SIDE_COLUMN_MAX_WIDTH;\n}\n\nexport function subtractXForEmojiInteraction(global: GlobalState, x: number) {\n return x - ((global.isLeftColumnShown && !IS_SINGLE_COLUMN_LAYOUT)\n ? global.leftColumnWidth || getLeftColumnWidth(windowSize.get().width)\n : 0);\n}\n\nexport function addMessageReaction(global: GlobalState, chatId: string, messageId: number, reaction: string) {\n const { reactions } = selectChatMessage(global, chatId, messageId) || {};\n\n if (!reactions) {\n return global;\n }\n\n // Update UI without waiting for server response\n let results = reactions.results.map((l) => (l.reaction === reaction\n ? {\n ...l,\n count: l.isChosen ? l.count : l.count + 1,\n isChosen: true,\n } : (l.isChosen ? {\n ...l,\n isChosen: false,\n count: l.count - 1,\n } : l)))\n .filter((l) => l.count > 0);\n\n let { recentReactions } = reactions;\n\n if (reaction && !results.some((l) => l.reaction === reaction)) {\n const { currentUserId } = global;\n\n results = [...results, {\n reaction,\n isChosen: true,\n count: 1,\n }];\n\n if (reactions.canSeeList) {\n recentReactions = [...(recentReactions || []), {\n userId: currentUserId!,\n reaction,\n }];\n }\n }\n\n return updateChatMessage(global, chatId, messageId, {\n reactions: {\n ...reactions,\n results,\n recentReactions,\n },\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport { callApi } from '../../../api/gramjs';\nimport * as mediaLoader from '../../../util/mediaLoader';\nimport { ApiAppConfig, ApiMediaFormat } from '../../../api/types';\nimport {\n selectChat,\n selectChatMessage,\n selectDefaultReaction,\n selectLocalAnimatedEmojiEffectByName,\n selectMessageIdsByGroupId,\n} from '../../selectors';\nimport { addMessageReaction, subtractXForEmojiInteraction } from '../../reducers/reactions';\nimport { addUsers, updateChatMessage } from '../../reducers';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { ANIMATION_LEVEL_MAX } from '../../../config';\nimport { isMessageLocal } from '../../helpers';\n\nconst INTERACTION_RANDOM_OFFSET = 40;\n\nlet interactionLocalId = 0;\n\naddReducer('loadAvailableReactions', () => {\n (async () => {\n const result = await callApi('getAvailableReactions');\n\n if (!result) {\n return;\n }\n\n // Preload animations\n result.forEach((availableReaction) => {\n if (availableReaction.aroundAnimation) {\n mediaLoader.fetch(`sticker${availableReaction.aroundAnimation.id}`, ApiMediaFormat.Lottie);\n }\n if (availableReaction.centerIcon) {\n mediaLoader.fetch(`sticker${availableReaction.centerIcon.id}`, ApiMediaFormat.Lottie);\n }\n });\n\n setGlobal({\n ...getGlobal(),\n availableReactions: result,\n });\n })();\n});\n\naddReducer('interactWithAnimatedEmoji', (global, actions, payload) => {\n const {\n emoji, x, y, localEffect, startSize, isReversed,\n } = payload!;\n\n const activeEmojiInteraction = {\n id: interactionLocalId++,\n animatedEffect: emoji || localEffect,\n x: subtractXForEmojiInteraction(global, x) + Math.random()\n * INTERACTION_RANDOM_OFFSET - INTERACTION_RANDOM_OFFSET / 2,\n y: y + Math.random() * INTERACTION_RANDOM_OFFSET - INTERACTION_RANDOM_OFFSET / 2,\n startSize,\n isReversed,\n };\n\n return {\n ...global,\n activeEmojiInteractions: [...(global.activeEmojiInteractions || []), activeEmojiInteraction],\n };\n});\n\naddReducer('sendEmojiInteraction', (global, actions, payload) => {\n const {\n messageId, chatId, emoji, interactions, localEffect,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n\n if (!chat || (!emoji && !localEffect) || chatId === global.currentUserId) {\n return;\n }\n\n void callApi('sendEmojiInteraction', {\n chat,\n messageId,\n emoticon: emoji || selectLocalAnimatedEmojiEffectByName(localEffect),\n timestamps: interactions,\n });\n});\n\naddReducer('sendDefaultReaction', (global, actions, payload) => {\n const {\n chatId, messageId, x, y,\n } = payload;\n const reaction = selectDefaultReaction(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n\n if (!reaction || !message || isMessageLocal(message)) return;\n\n actions.sendReaction({\n chatId,\n messageId,\n reaction,\n x,\n y,\n });\n});\n\naddReducer('sendReaction', (global, actions, payload) => {\n const {\n chatId,\n }: { chatId: string } = payload;\n let { messageId } = payload;\n\n let { reaction } = payload;\n\n const chat = selectChat(global, chatId);\n let message = selectChatMessage(global, chatId, messageId);\n\n if (!chat || !message) {\n return undefined;\n }\n\n const isInDocumentGroup = Boolean(message.groupedId) && !message.isInAlbum;\n const documentGroupFirstMessageId = isInDocumentGroup\n ? selectMessageIdsByGroupId(global, chatId, message.groupedId!)![0]\n : undefined;\n message = isInDocumentGroup\n ? selectChatMessage(global, chatId, documentGroupFirstMessageId!) || message\n : message;\n messageId = message?.id || messageId;\n\n if (message.reactions?.results?.some((l) => l.reaction === reaction && l.isChosen)) {\n reaction = undefined;\n }\n\n void callApi('sendReaction', { chat, messageId, reaction });\n\n const { animationLevel } = global.settings.byKey;\n\n if (animationLevel === ANIMATION_LEVEL_MAX) {\n global = {\n ...global,\n activeReactions: {\n ...(reaction ? global.activeReactions : omit(global.activeReactions, [messageId])),\n ...(reaction && {\n [messageId]: {\n reaction,\n messageId,\n },\n }),\n },\n };\n }\n\n return addMessageReaction(global, chatId, messageId, reaction);\n});\n\naddReducer('openChat', (global) => {\n return {\n ...global,\n activeReactions: {},\n };\n});\n\naddReducer('startActiveReaction', (global, actions, payload) => {\n const { messageId, reaction } = payload;\n const { animationLevel } = global.settings.byKey;\n\n if (animationLevel !== ANIMATION_LEVEL_MAX) return global;\n\n if (global.activeReactions[messageId]?.reaction === reaction) {\n return global;\n }\n\n return {\n ...global,\n activeReactions: {\n ...(reaction ? global.activeReactions : omit(global.activeReactions, [messageId])),\n ...(reaction && {\n [messageId]: {\n reaction,\n messageId,\n },\n }),\n },\n };\n});\n\naddReducer('stopActiveReaction', (global, actions, payload) => {\n const { messageId, reaction } = payload;\n\n if (global.activeReactions[messageId]?.reaction !== reaction) {\n return global;\n }\n\n return {\n ...global,\n activeReactions: omit(global.activeReactions, [messageId]),\n };\n});\n\naddReducer('setDefaultReaction', (global, actions, payload) => {\n const { reaction } = payload;\n\n (async () => {\n const result = await callApi('setDefaultReaction', { reaction });\n\n if (!result) {\n return;\n }\n\n global = getGlobal();\n setGlobal({\n ...global,\n appConfig: {\n ...global.appConfig,\n defaultReaction: reaction,\n } as ApiAppConfig,\n });\n })();\n});\n\naddReducer('stopActiveEmojiInteraction', (global, actions, payload) => {\n const { id } = payload;\n\n return {\n ...global,\n activeEmojiInteractions: global.activeEmojiInteractions?.filter((l) => l.id !== id),\n };\n});\n\naddReducer('loadReactors', (global, actions, payload) => {\n const { chatId, messageId, reaction } = payload;\n const chat = selectChat(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n if (!chat || !message) {\n return;\n }\n\n const offset = message.reactors?.nextOffset;\n\n (async () => {\n const result = await callApi('fetchMessageReactionsList', {\n reaction,\n chat,\n messageId,\n offset,\n });\n\n if (!result) {\n return;\n }\n\n global = getGlobal();\n if (result.users?.length) {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n }\n\n const { nextOffset, count, reactions } = result;\n\n setGlobal(updateChatMessage(global, chatId, messageId, {\n reactors: {\n nextOffset,\n count,\n reactions: [\n ...(message.reactors?.reactions || []),\n ...reactions,\n ],\n },\n }));\n })();\n});\n\naddReducer('loadMessageReactions', (global, actions, payload) => {\n const { ids, chatId } = payload;\n\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n callApi('fetchMessageReactions', { ids, chat });\n});\n\naddReducer('sendWatchingEmojiInteraction', (global, actions, payload) => {\n const {\n chatId, emoticon, x, y, startSize, isReversed, id,\n } = payload;\n\n const chat = selectChat(global, chatId);\n\n if (!chat || !global.activeEmojiInteractions?.some((l) => l.id === id) || chatId === global.currentUserId) {\n return undefined;\n }\n\n callApi('sendWatchingEmojiInteraction', { chat, emoticon });\n\n return {\n ...global,\n activeEmojiInteractions: global.activeEmojiInteractions.map((activeEmojiInteraction) => {\n if (activeEmojiInteraction.id === id) {\n return {\n ...activeEmojiInteraction,\n x: subtractXForEmojiInteraction(global, x),\n y,\n startSize,\n isReversed,\n };\n }\n return activeEmojiInteraction;\n }),\n };\n});\n","export function areDeepEqual(value1: T, value2: T): boolean {\n const type1 = typeof value1;\n const type2 = typeof value2;\n if (type1 !== type2) {\n return false;\n }\n\n if (type1 !== 'object') {\n return value1 === value2;\n }\n\n const isArray1 = Array.isArray(value1);\n const isArray2 = Array.isArray(value2);\n\n if (isArray1 !== isArray2) {\n return false;\n }\n\n if (isArray1) {\n const array1 = value1 as any[];\n const array2 = value2 as any[];\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((member1, i) => areDeepEqual(member1, array2[i]));\n }\n\n const object1 = value1 as AnyLiteral;\n const object2 = value2 as AnyLiteral;\n const keys1 = Object.keys(object1);\n\n return keys1.every((key1) => areDeepEqual(object1[key1], object2[key1]));\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { ARCHIVED_FOLDER_ID, MAX_ACTIVE_PINNED_CHATS } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { closeMessageNotifications, notifyAboutMessage } from '../../../util/notifications';\nimport { getMessageRecentReaction } from '../../helpers';\nimport {\n updateChat,\n updateChatListIds,\n updateChatListType,\n replaceThreadParam,\n leaveChat,\n} from '../../reducers';\nimport {\n selectChat,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectChatListType,\n selectCurrentMessageList,\n} from '../../selectors';\n\nconst TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds\n// Enough to animate and mark as read in Message List\nconst CURRENT_CHAT_UNREAD_DELAY = 1500;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateChat': {\n if (!update.noTopChatsRequest && !selectIsChatListed(global, update.id)) {\n // Chat can appear in dialogs list.\n actions.loadTopChats();\n }\n\n const newGlobal = updateChat(global, update.id, update.chat, update.newProfilePhoto);\n setGlobal(newGlobal);\n\n if (update.chat.id) {\n closeMessageNotifications({\n chatId: update.chat.id,\n lastReadInboxMessageId: update.chat.lastReadInboxMessageId,\n });\n }\n break;\n }\n\n case 'updateChatJoin': {\n const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n global = updateChatListIds(global, listType, [update.id]);\n global = updateChat(global, update.id, { isNotJoined: false });\n setGlobal(global);\n\n const chat = selectChat(global, update.id);\n if (chat) {\n actions.requestChatUpdate({ chatId: chat.id });\n }\n break;\n }\n\n case 'updateChatLeave': {\n setGlobal(leaveChat(global, update.id));\n\n break;\n }\n\n case 'updateChatInbox': {\n setGlobal(updateChat(global, update.id, update.chat));\n\n break;\n }\n\n case 'updateChatTypingStatus': {\n const { id, typingStatus } = update;\n setGlobal(updateChat(global, id, { typingStatus }));\n\n setTimeout(() => {\n const newGlobal = getGlobal();\n const chat = selectChat(newGlobal, id);\n if (chat && typingStatus && chat.typingStatus && chat.typingStatus.timestamp === typingStatus.timestamp) {\n setGlobal(updateChat(newGlobal, id, { typingStatus: undefined }));\n }\n }, TYPING_STATUS_CLEAR_DELAY);\n\n break;\n }\n\n case 'newMessage': {\n const { message } = update;\n const { chatId: currentChatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n\n if (message.senderId === global.currentUserId && !message.isFromScheduled) {\n return;\n }\n\n const chat = selectChat(global, update.chatId);\n if (!chat) {\n return;\n }\n\n const isActiveChat = (\n messageListType === 'thread'\n && threadId === MAIN_THREAD_ID\n && update.chatId === currentChatId\n );\n\n if (isActiveChat) {\n setTimeout(() => {\n actions.requestChatUpdate({ chatId: update.chatId });\n }, CURRENT_CHAT_UNREAD_DELAY);\n } else {\n setGlobal(updateChat(global, update.chatId, {\n unreadCount: chat.unreadCount ? chat.unreadCount + 1 : 1,\n ...(update.message.hasUnreadMention && {\n unreadMentionsCount: chat.unreadMentionsCount ? chat.unreadMentionsCount + 1 : 1,\n }),\n }));\n }\n\n notifyAboutMessage({\n chat,\n message,\n });\n\n break;\n }\n\n case 'updateMessage': {\n const { message } = update;\n const chat = selectChat(global, update.chatId);\n if (!chat) {\n return;\n }\n\n if (getMessageRecentReaction(message)) {\n notifyAboutMessage({\n chat,\n message,\n });\n }\n break;\n }\n\n case 'updateCommonBoxMessages':\n case 'updateChannelMessages': {\n const { ids, messageUpdate } = update;\n if (messageUpdate.hasUnreadMention !== false) {\n return;\n }\n\n ids.forEach((id) => {\n const chatId = ('channelId' in update ? update.channelId : selectCommonBoxChatId(global, id))!;\n const chat = selectChat(global, chatId);\n if (chat?.unreadMentionsCount) {\n global = updateChat(global, chatId, {\n unreadMentionsCount: chat.unreadMentionsCount - 1,\n });\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatFullInfo': {\n const { fullInfo } = update;\n const targetChat = global.chats.byId[update.id];\n if (!targetChat) {\n return;\n }\n\n setGlobal(updateChat(global, update.id, {\n fullInfo: {\n ...targetChat.fullInfo,\n ...fullInfo,\n },\n }));\n\n break;\n }\n\n case 'updatePinnedChatIds': {\n const { ids, folderId } = update;\n\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: ids.length ? ids : undefined,\n },\n },\n };\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatPinned': {\n const { id, isPinned } = update;\n const listType = selectChatListType(global, id);\n if (listType) {\n const { [listType]: orderedPinnedIds } = global.chats.orderedPinnedIds;\n\n let newOrderedPinnedIds = orderedPinnedIds || [];\n if (!isPinned) {\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => pinnedId !== id);\n } else if (!newOrderedPinnedIds.includes(id)) {\n // When moving pinned chats to archive, active ordered pinned ids don't get updated\n // (to preserve chat pinned state when it returns from archive)\n // If user already has max pinned chats, we should check for orderedIds\n // that don't point to listed chats\n if (listType === 'active' && newOrderedPinnedIds.length >= MAX_ACTIVE_PINNED_CHATS) {\n const listIds = global.chats.listIds.active;\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => listIds && listIds.includes(pinnedId));\n }\n\n newOrderedPinnedIds = [id, ...newOrderedPinnedIds];\n }\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: newOrderedPinnedIds.length ? newOrderedPinnedIds : undefined,\n },\n },\n };\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatListType': {\n const { id, folderId } = update;\n\n setGlobal(updateChatListType(global, id, folderId));\n\n break;\n }\n\n case 'updateChatFolder': {\n const { id, folder } = update;\n const { byId: chatFoldersById, orderedIds } = global.chatFolders;\n\n const newChatFoldersById = folder\n ? { ...chatFoldersById, [id]: folder }\n : pick(\n chatFoldersById,\n Object.keys(chatFoldersById).map(Number).filter((folderId) => folderId !== id),\n );\n\n const newOrderedIds = folder\n ? orderedIds && orderedIds.includes(id) ? orderedIds : [...(orderedIds || []), id]\n : orderedIds ? orderedIds.filter((orderedId) => orderedId !== id) : undefined;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n byId: newChatFoldersById,\n orderedIds: newOrderedIds,\n },\n });\n\n break;\n }\n\n case 'updateChatFoldersOrder': {\n const { orderedIds } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n orderedIds,\n },\n });\n\n break;\n }\n\n case 'updateRecommendedChatFolders': {\n const { folders } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: folders,\n },\n });\n\n break;\n }\n\n case 'updateChatMembers': {\n const targetChat = global.chats.byId[update.id];\n const { replacedMembers, addedMember, deletedMemberId } = update;\n if (!targetChat) {\n return;\n }\n\n let shouldUpdate = false;\n let members = targetChat.fullInfo?.members\n ? [...targetChat.fullInfo.members]\n : [];\n\n if (replacedMembers) {\n members = replacedMembers;\n shouldUpdate = true;\n } else if (addedMember) {\n if (\n !members.length\n || !members.some((m) => m.userId === addedMember.userId)\n ) {\n members.push(addedMember);\n shouldUpdate = true;\n }\n } else if (members.length && deletedMemberId) {\n const deleteIndex = members.findIndex((m) => m.userId === deletedMemberId);\n if (deleteIndex > -1) {\n members.slice(deleteIndex, 1);\n shouldUpdate = true;\n }\n }\n\n if (shouldUpdate) {\n const adminMembers = members.filter(({ isOwner, isAdmin }) => isOwner || isAdmin);\n // TODO Kicked members?\n\n setGlobal(updateChat(global, update.id, {\n membersCount: members.length,\n fullInfo: {\n ...targetChat.fullInfo,\n members,\n adminMembers,\n },\n }));\n }\n\n break;\n }\n\n case 'deleteProfilePhotos': {\n const { chatId, ids } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat?.photos) {\n setGlobal(updateChat(global, chatId, {\n photos: chat.photos.filter((photo) => !ids.includes(photo.id)),\n }));\n }\n break;\n }\n\n case 'draftMessage': {\n const {\n chatId, formattedText, date, replyingToId,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', formattedText);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'replyingToId', replyingToId);\n global = updateChat(global, chatId, { draftDate: date });\n\n setGlobal(global);\n }\n break;\n }\n\n case 'showInvite': {\n const { data } = update;\n\n actions.showDialog({ data });\n break;\n }\n\n case 'updatePendingJoinRequests': {\n const { chatId, requestsPending, recentRequesterIds } = update;\n const chat = global.chats.byId[chatId];\n if (chat) {\n global = updateChat(global, chatId, {\n fullInfo: {\n ...chat.fullInfo,\n requestsPending,\n recentRequesterIds,\n },\n });\n setGlobal(global);\n actions.loadChatJoinRequests({ chatId });\n }\n }\n }\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiUpdate, ApiMessage, ApiPollResult, ApiThreadInfo, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { unique } from '../../../util/iteratees';\nimport { areDeepEqual } from '../../../util/areDeepEqual';\nimport { notifyAboutMessage } from '../../../util/notifications';\nimport { checkIfReactionAdded } from '../../helpers/reactions';\nimport {\n updateChat,\n deleteChatMessages,\n updateChatMessage,\n updateListedIds,\n addViewportId,\n updateThreadInfo,\n replaceThreadParam,\n updateScheduledMessage,\n deleteChatScheduledMessages,\n updateThreadUnreadFromForwardedMessage,\n} from '../../reducers';\nimport { ActiveEmojiInteraction, GlobalActions, GlobalState } from '../../../global/types';\nimport {\n selectChatMessage,\n selectChatMessages,\n selectIsViewportNewest,\n selectListedIds,\n selectChatMessageByPollId,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectThreadInfo,\n selectThreadByMessage,\n selectPinnedIds,\n selectScheduledMessage,\n selectScheduledMessages,\n isMessageInCurrentMessageList,\n selectScheduledIds,\n selectCurrentMessageList,\n selectViewportIds,\n selectFirstUnreadId,\n selectChat,\n selectIsChatWithBot,\n selectIsServiceChatReady,\n selectLocalAnimatedEmojiEffect,\n selectLocalAnimatedEmoji,\n} from '../../selectors';\nimport {\n getMessageContent, isUserId, isMessageLocal, getMessageText,\n} from '../../helpers';\n\nconst ANIMATION_DELAY = 350;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'newMessage': {\n const {\n chatId, id, message, shouldForceReply,\n } = update;\n global = updateWithLocalMedia(global, chatId, id, message);\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n\n setGlobal(global);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n\n if (isMessageInCurrentMessageList(global, chatId, message as ApiMessage)) {\n if (message.isOutgoing && !(message.content?.action)) {\n const currentMessageList = selectCurrentMessageList(global);\n if (currentMessageList) {\n // We do not use `actions.focusLastMessage` as it may be set with a delay (see below)\n actions.focusMessage({\n chatId,\n threadId: currentMessageList.threadId,\n messageId: message.id,\n noHighlight: true,\n isResizingContainer: true,\n });\n }\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message as ApiMessage) || {};\n if (threadInfo) {\n actions.requestThreadInfoUpdate({ chatId, threadId: threadInfo.threadId });\n }\n\n // @perf Wait until scroll animation finishes or simply rely on delivery status update (which is itself delayed)\n if (!isMessageLocal(message as ApiMessage)) {\n setTimeout(() => {\n let delayedGlobal = getGlobal();\n if (shouldForceReply) {\n delayedGlobal = replaceThreadParam(delayedGlobal, chatId, MAIN_THREAD_ID, 'replyingToId', id);\n }\n setGlobal(updateChatLastMessage(delayedGlobal, chatId, newMessage));\n }, ANIMATION_DELAY);\n }\n } else {\n setGlobal(updateChatLastMessage(getGlobal(), chatId, newMessage));\n }\n\n // Edge case: New message in an old (not loaded) chat.\n if (!selectIsChatListed(global, chatId)) {\n actions.loadTopChats();\n }\n\n break;\n }\n\n case 'updateStartEmojiInteraction': {\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n if (currentChatId !== update.id) return;\n const message = selectChatMessage(global, currentChatId, update.messageId);\n\n if (!message) return;\n\n // Workaround for a weird behavior when interaction is received after watching reaction\n if (getMessageText(message) !== update.emoji) return;\n\n const localEmoji = selectLocalAnimatedEmoji(global, update.emoji);\n\n global = {\n ...global,\n activeEmojiInteractions: [...(global.activeEmojiInteractions || []), {\n id: global.activeEmojiInteractions?.length || 0,\n animatedEffect: localEmoji ? selectLocalAnimatedEmojiEffect(localEmoji) : update.emoji,\n messageId: update.messageId,\n } as ActiveEmojiInteraction],\n };\n\n setGlobal(global);\n\n break;\n }\n\n case 'newScheduledMessage': {\n const { chatId, id, message } = update;\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', unique([...scheduledIds, id]));\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectChatMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n global = updateChatLastMessage(global, chatId, newMessage);\n\n setGlobal(global);\n\n // Scroll down if bot message height is changed with an updated inline keyboard.\n // A drawback: this will scroll down even if the previous scroll was not at bottom.\n const chat = selectChat(global, chatId);\n if (\n chat\n && !message.isOutgoing\n && chat.lastMessage?.id === message.id\n && selectIsChatWithBot(global, chat)\n && isMessageInCurrentMessageList(global, chatId, message as ApiMessage)\n && selectIsViewportNewest(global, chatId, message.threadInfo?.threadId || MAIN_THREAD_ID)\n ) {\n actions.focusLastMessage();\n }\n\n break;\n }\n\n case 'updateScheduledMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectScheduledMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n const ids = Object.keys(selectScheduledMessages(global, chatId) || {}).map(Number).sort((a, b) => b - a);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n const currentMessage = selectChatMessage(global, chatId, localId);\n\n global = deleteChatMessages(global, chatId, [localId]);\n\n // Edge case for \"Send When Online\"\n if (message.isScheduled) {\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n }\n\n global = updateChatMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n const newMessage = selectChatMessage(global, chatId, message.id)!;\n global = updateChatLastMessage(global, chatId, newMessage);\n\n const thread = selectThreadByMessage(global, chatId, message);\n // For some reason Telegram requires to manually mark outgoing thread messages read\n if (thread?.threadInfo) {\n actions.markMessageListRead({ maxId: message.id });\n\n global = replaceThreadParam(global, chatId, thread.threadInfo.threadId, 'threadInfo', {\n ...thread.threadInfo,\n lastMessageId: message.id,\n lastReadInboxMessageId: message.id,\n });\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateScheduledMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', [...scheduledIds, message.id]);\n\n const currentMessage = selectScheduledMessage(global, chatId, localId);\n\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n global = updateScheduledMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n setGlobal(global);\n break;\n }\n\n case 'updatePinnedIds': {\n const { chatId, isPinned, messageIds } = update;\n\n const currentPinnedIds = selectPinnedIds(global, chatId) || [];\n const newPinnedIds = isPinned\n ? [...currentPinnedIds, ...messageIds].sort((a, b) => b - a)\n : currentPinnedIds.filter((id) => !messageIds.includes(id));\n\n setGlobal(replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds', newPinnedIds));\n\n break;\n }\n\n case 'updateThreadInfo': {\n const {\n chatId, threadId, threadInfo, firstMessageId,\n } = update;\n\n const currentThreadInfo = selectThreadInfo(global, chatId, threadId);\n const newTheadInfo = {\n ...currentThreadInfo,\n ...threadInfo,\n };\n\n if (!newTheadInfo.threadId) {\n return;\n }\n\n global = updateThreadInfo(global, chatId, threadId, newTheadInfo as ApiThreadInfo);\n\n if (firstMessageId) {\n global = replaceThreadParam(global, chatId, threadId, 'firstMessageId', firstMessageId);\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'resetMessages': {\n const { id: chatId } = update;\n const messagesById = selectChatMessages(global, chatId);\n\n if (messagesById && !isUserId(chatId)) {\n global = deleteChatMessages(global, chatId, Object.keys(messagesById).map(Number));\n setGlobal(global);\n actions.loadFullChat({ chatId, force: true });\n }\n\n break;\n }\n\n case 'deleteMessages': {\n const { ids, chatId } = update;\n\n deleteMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteScheduledMessages': {\n const { ids, chatId } = update;\n\n deleteScheduledMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteHistory': {\n const { chatId } = update;\n const chatMessages = global.messages.byChatId[chatId];\n if (chatMessages) {\n const ids = Object.keys(chatMessages.byId).map(Number);\n deleteMessages(chatId, ids, actions, global);\n } else {\n actions.requestChatUpdate({ chatId });\n }\n\n break;\n }\n\n case 'updateCommonBoxMessages': {\n const { ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n const chatId = selectCommonBoxChatId(global, id);\n if (chatId) {\n global = updateChatMessage(global, chatId, id, messageUpdate);\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChannelMessages': {\n const { channelId, ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n global = updateChatMessage(global, channelId, id, messageUpdate);\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessagePoll': {\n const { pollId, pollUpdate } = update;\n\n const message = selectChatMessageByPollId(global, pollId);\n\n if (message?.content.poll) {\n const updatedPoll = { ...message.content.poll, ...pollUpdate };\n\n // Workaround for poll update bug: `chosen` option gets reset when someone votes after current user\n const { results: updatedResults } = updatedPoll.results || {};\n if (updatedResults && !updatedResults.some(((result) => result.isChosen))) {\n const { results } = message.content.poll.results;\n const chosenAnswers = results && results.filter((result) => result.isChosen);\n if (chosenAnswers) {\n chosenAnswers.forEach((chosenAnswer) => {\n const chosenAnswerIndex = updatedResults.findIndex((result) => result.option === chosenAnswer.option);\n if (chosenAnswerIndex >= 0) {\n updatedPoll.results.results![chosenAnswerIndex].isChosen = true;\n }\n });\n }\n }\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: updatedPoll,\n },\n },\n ));\n }\n break;\n }\n\n case 'updateMessagePollVote': {\n const { pollId, userId, options } = update;\n const message = selectChatMessageByPollId(global, pollId);\n if (!message || !message.content.poll || !message.content.poll.results) {\n break;\n }\n\n const { poll } = message.content;\n\n const { recentVoterIds, totalVoters, results } = poll.results;\n const newRecentVoterIds = recentVoterIds ? [...recentVoterIds] : [];\n const newTotalVoters = totalVoters ? totalVoters + 1 : 1;\n const newResults = results ? [...results] : [];\n\n newRecentVoterIds.push(userId);\n\n options.forEach((option) => {\n const targetOption = newResults.find((result) => result.option === option);\n const targetOptionIndex = newResults.findIndex((result) => result.option === option);\n const updatedOption: ApiPollResult = targetOption ? { ...targetOption } : { option, votersCount: 0 };\n\n updatedOption.votersCount += 1;\n if (userId === global.currentUserId) {\n updatedOption.isChosen = true;\n }\n\n if (targetOptionIndex) {\n newResults[targetOptionIndex] = updatedOption;\n } else {\n newResults.push(updatedOption);\n }\n });\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: {\n ...poll,\n results: {\n ...poll.results,\n recentVoterIds: newRecentVoterIds,\n totalVoters: newTotalVoters,\n results: newResults,\n },\n },\n },\n },\n ));\n\n break;\n }\n\n case 'updateServiceNotification': {\n const { message } = update;\n\n if (selectIsServiceChatReady(global)) {\n actions.createServiceNotification({ message });\n }\n\n break;\n }\n\n case 'updateMessageReactions': {\n const { chatId, id, reactions } = update;\n const message = selectChatMessage(global, chatId, id);\n const chat = selectChat(global, update.chatId);\n const currentReactions = message?.reactions;\n\n // `updateMessageReactions` happens with an interval so we try to avoid redundant global state updates\n if (currentReactions && areDeepEqual(reactions, currentReactions)) {\n return;\n }\n\n // Only notify about added reactions, not removed ones\n const shouldNotify = checkIfReactionAdded(currentReactions, reactions);\n\n global = updateChatMessage(global, chatId, id, { reactions: update.reactions });\n\n if (shouldNotify) {\n const newMessage = selectChatMessage(global, chatId, id);\n if (!chat || !newMessage) return;\n notifyAboutMessage({\n chat,\n message: newMessage,\n });\n }\n\n setGlobal(global);\n break;\n }\n }\n});\n\nfunction updateWithLocalMedia(\n global: GlobalState, chatId: string, id: number, message: Partial, isScheduled = false,\n) {\n // Preserve locally uploaded media.\n const currentMessage = isScheduled\n ? selectScheduledMessage(global, chatId, id)\n : selectChatMessage(global, chatId, id);\n if (currentMessage && message.content) {\n const {\n photo, video, sticker, document,\n } = getMessageContent(currentMessage);\n if (photo && message.content.photo) {\n message.content.photo.blobUrl = photo.blobUrl;\n message.content.photo.thumbnail = photo.thumbnail;\n } else if (video && message.content.video) {\n message.content.video.blobUrl = video.blobUrl;\n } else if (sticker && message.content.sticker) {\n message.content.sticker.isPreloadedGlobally = sticker.isPreloadedGlobally;\n } else if (document && message.content.document) {\n message.content.document.previewBlobUrl = document.previewBlobUrl;\n }\n }\n\n return isScheduled\n ? updateScheduledMessage(global, chatId, id, message)\n : updateChatMessage(global, chatId, id, message);\n}\n\nfunction updateThreadUnread(global: GlobalState, actions: GlobalActions, message: ApiMessage, isDeleting?: boolean) {\n const { chatId } = message;\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n\n if (!threadInfo && message.replyToMessageId) {\n const originMessage = selectChatMessage(global, chatId, message.replyToMessageId);\n if (originMessage) {\n global = updateThreadUnreadFromForwardedMessage(global, originMessage, chatId, message.id, isDeleting);\n } else {\n actions.loadMessage({\n chatId,\n messageId: message.replyToMessageId,\n threadUpdate: {\n isDeleting,\n lastMessageId: message.id,\n },\n });\n }\n }\n\n return global;\n}\n\nfunction updateListedAndViewportIds(global: GlobalState, actions: GlobalActions, message: ApiMessage) {\n const { id, chatId } = message;\n\n const { threadInfo, firstMessageId } = selectThreadByMessage(global, chatId, message) || {};\n\n const chat = selectChat(global, chatId);\n const isUnreadChatNotLoaded = chat?.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n global = updateThreadUnread(global, actions, message);\n\n if (threadInfo) {\n if (firstMessageId || !isMessageLocal(message)) {\n global = updateListedIds(global, chatId, threadInfo.threadId, [id]);\n\n if (selectIsViewportNewest(global, chatId, threadInfo.threadId)) {\n global = addViewportId(global, chatId, threadInfo.threadId, id);\n\n if (!firstMessageId) {\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'firstMessageId', message.id);\n }\n }\n }\n\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'threadInfo', {\n ...threadInfo,\n lastMessageId: message.id,\n messagesCount: threadInfo.messagesCount + 1,\n });\n }\n\n if (isUnreadChatNotLoaded) {\n return global;\n }\n\n global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);\n\n if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {\n // Always keep the first unread message in the viewport list\n const firstUnreadId = selectFirstUnreadId(global, chatId, MAIN_THREAD_ID);\n const newGlobal = addViewportId(global, chatId, MAIN_THREAD_ID, id);\n const newViewportIds = selectViewportIds(newGlobal, chatId, MAIN_THREAD_ID);\n\n if (!firstUnreadId || newViewportIds!.includes(firstUnreadId)) {\n global = newGlobal;\n }\n }\n\n return global;\n}\n\nfunction updateChatLastMessage(\n global: GlobalState,\n chatId: string,\n message: ApiMessage,\n force = false,\n) {\n const { chats } = global;\n const currentLastMessage = chats.byId[chatId]?.lastMessage;\n\n if (currentLastMessage && !force) {\n const isSameOrNewer = (\n currentLastMessage.id === message.id || currentLastMessage.id === message.previousLocalId\n ) || message.id > currentLastMessage.id;\n\n if (!isSameOrNewer) {\n return global;\n }\n }\n\n return updateChat(global, chatId, { lastMessage: message });\n}\n\nfunction findLastMessage(global: GlobalState, chatId: string) {\n const byId = selectChatMessages(global, chatId);\n const listedIds = selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n if (!byId || !listedIds) {\n return undefined;\n }\n\n let i = listedIds.length;\n while (i--) {\n const message = byId[listedIds[i]];\n if (!message.isDeleting) {\n return message;\n }\n }\n\n return undefined;\n}\n\nfunction deleteMessages(chatId: string | undefined, ids: number[], actions: GlobalActions, global: GlobalState) {\n // Channel update\n\n if (chatId) {\n ids.forEach((id) => {\n global = updateChatMessage(global, chatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, chatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, chatId, newLastMessage, true);\n }\n });\n\n setGlobal(global);\n\n actions.requestChatUpdate({ chatId });\n\n const threadIdsToUpdate: number[] = [];\n\n ids.forEach((id) => {\n const message = selectChatMessage(global, chatId, id);\n if (!message) {\n return;\n }\n\n global = updateThreadUnread(global, actions, message, true);\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n if (threadInfo) {\n threadIdsToUpdate.push(threadInfo.threadId);\n }\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), chatId, ids));\n\n unique(threadIdsToUpdate).forEach((threadId) => {\n actions.requestThreadInfoUpdate({ chatId, threadId });\n });\n }, ANIMATION_DELAY);\n\n return;\n }\n\n // Common box update\n\n const chatsIdsToUpdate: string[] = [];\n\n ids.forEach((id) => {\n const commonBoxChatId = selectCommonBoxChatId(global, id);\n if (commonBoxChatId) {\n chatsIdsToUpdate.push(commonBoxChatId);\n\n global = updateChatMessage(global, commonBoxChatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, commonBoxChatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, commonBoxChatId, newLastMessage, true);\n }\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), commonBoxChatId, [id]));\n }, ANIMATION_DELAY);\n }\n });\n\n setGlobal(global);\n\n unique(chatsIdsToUpdate).forEach((id) => {\n actions.requestChatUpdate({ chatId: id });\n });\n}\n\nfunction deleteScheduledMessages(\n chatId: string | undefined, ids: number[], actions: GlobalActions, global: GlobalState,\n) {\n if (!chatId) {\n return;\n }\n\n ids.forEach((id) => {\n global = updateScheduledMessage(global, chatId, id, {\n isDeleting: true,\n });\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n global = deleteChatScheduledMessages(getGlobal(), chatId, ids);\n const scheduledMessages = selectScheduledMessages(global, chatId);\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'scheduledIds', Object.keys(scheduledMessages || {}).map(Number),\n );\n setGlobal(global);\n }, ANIMATION_DELAY);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, ApiUserStatus } from '../../../api/types';\n\nimport { deleteContact, replaceUserStatuses, updateUser } from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\n\nconst STATUS_UPDATE_THROTTLE = 3000;\n\nconst flushStatusUpdatesThrottled = throttle(flushStatusUpdates, STATUS_UPDATE_THROTTLE, true);\n\nlet pendingStatusUpdates: Record = {};\n\nfunction scheduleStatusUpdate(userId: string, statusUpdate: ApiUserStatus) {\n pendingStatusUpdates[userId] = statusUpdate;\n flushStatusUpdatesThrottled();\n}\n\nfunction flushStatusUpdates() {\n const global = getGlobal();\n\n setGlobal(replaceUserStatuses(global, {\n ...global.users.statusesById,\n ...pendingStatusUpdates,\n }));\n\n pendingStatusUpdates = {};\n}\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'deleteContact': {\n return deleteContact(global, update.id);\n }\n\n case 'updateUser': {\n return updateUser(global, update.id, update.user);\n }\n\n case 'updateUserStatus': {\n // Status updates come very often so we throttle them\n scheduleStatusUpdate(update.userId, update.status);\n return undefined;\n }\n\n case 'updateUserFullInfo': {\n const { id, fullInfo } = update;\n const targetUser = global.users.byId[id];\n if (!targetUser) {\n return undefined;\n }\n\n return updateUser(global, id, {\n fullInfo: {\n ...targetUser.fullInfo,\n ...fullInfo,\n },\n });\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { updateStickerSet } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateStickerSet': {\n return updateStickerSet(global, update.id, update.stickerSet);\n }\n }\n\n return undefined;\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { ApiPrivacyKey, PaymentStep } from '../../../types';\n\nimport {\n addBlockedContact, removeBlockedContact, setConfirmPaymentUrl, setPaymentStep,\n} from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updatePeerBlocked':\n if (update.isBlocked) {\n return addBlockedContact(getGlobal(), update.id);\n } else {\n return removeBlockedContact(getGlobal(), update.id);\n }\n\n case 'updateResetContactList':\n setGlobal({\n ...getGlobal(),\n contactList: {\n userIds: [],\n },\n });\n break;\n\n case 'updateFavoriteStickers':\n actions.loadFavoriteStickers();\n break;\n\n case 'updatePrivacy':\n global.settings.privacy[update.key as ApiPrivacyKey] = update.rules;\n break;\n\n case 'updatePaymentVerificationNeeded':\n global = setConfirmPaymentUrl(getGlobal(), update.url);\n global = setPaymentStep(global, PaymentStep.ConfirmPayment);\n setGlobal(global);\n break;\n }\n\n return undefined;\n});\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\nimport { addNotifyException, updateChat, updateNotifySettings } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateNotifySettings': {\n return updateNotifySettings(global, update.peerType, update.isSilent, update.shouldShowPreviews);\n }\n\n case 'updateNotifyExceptions': {\n const {\n chatId, isMuted, isSilent, shouldShowPreviews,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = updateChat(global, chatId, { isMuted });\n }\n\n setGlobal(addNotifyException(global, chatId, { isMuted, isSilent, shouldShowPreviews }));\n break;\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateTwoFaStateWaitCode': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n isLoading: false,\n waitingEmailCodeLength: update.length,\n },\n };\n }\n\n case 'updateTwoFaError': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n error: update.message,\n },\n };\n }\n }\n\n return undefined;\n});\n","import { addReducer, getGlobal } from '../../../lib/teact/teactn';\nimport { ApiUpdate } from '../../../api/types';\nimport { removeGroupCall, updateGroupCall, updateGroupCallParticipant } from '../../reducers/calls';\nimport { omit } from '../../../util/iteratees';\nimport { selectChat } from '../../selectors';\nimport { updateChat } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateGroupCall': {\n if (update.call.connectionState === 'discarded') {\n if (global.groupCalls.activeGroupCallId) {\n actions.leaveGroupCall({ shouldRemove: true });\n return undefined;\n } else {\n return removeGroupCall(global, update.call.id);\n }\n }\n\n return updateGroupCall(global,\n update.call.id,\n omit(update.call, ['connectionState']),\n undefined,\n update.call.participantsCount);\n }\n case 'updateGroupCallChatId': {\n const chat = selectChat(global, update.chatId);\n if (chat) {\n global = updateChat(global, update.chatId, {\n fullInfo: {\n ...chat.fullInfo,\n groupCallId: update.call.id,\n },\n });\n }\n return global;\n }\n case 'updateGroupCallParticipants': {\n const { groupCallId, participants, nextOffset } = update;\n const { currentUserId } = global;\n\n // `secret-sauce` should disconnect if the participant is us but from another device\n global = getGlobal();\n participants.forEach((participant) => {\n if (participant.id) {\n global = updateGroupCallParticipant(global, groupCallId, participant.id, participant,\n Boolean(nextOffset) || currentUserId === participant.id);\n }\n });\n if (nextOffset) {\n global = updateGroupCall(global, groupCallId, {\n nextOffset,\n });\n }\n return global;\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { clearPayment } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updatePaymentStateCompleted': {\n return clearPayment(global);\n }\n }\n\n return undefined;\n});\n","import { useEffect } from '../lib/teact/teact';\n\nimport { onBeforeUnload } from '../util/schedulers';\n\nexport default function useBeforeUnload(callback: AnyToVoidFunction) {\n useEffect(() => {\n return onBeforeUnload(callback);\n }, [callback]);\n}\n","import { useEffect } from '../lib/teact/teact';\nimport { IS_IOS, IS_PWA, IS_TOUCH_ENV } from '../util/environment';\n\nconst metaViewport = document.querySelector('meta[name=\"viewport\"]');\nconst defaultViewportContent = metaViewport?.getAttribute('content') || '';\nconst allowedZoomViewportContent = 'width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover';\n\nexport default function usePreventPinchZoomGesture(isDisabled = false) {\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n return undefined;\n }\n\n if (isDisabled) {\n // Clean viewport content from values values that disable the ability to zoom a webpage\n // https://web.dev/meta-viewport/\n metaViewport?.setAttribute('content', allowedZoomViewportContent);\n return undefined;\n }\n\n metaViewport?.setAttribute('content', defaultViewportContent);\n\n // Since iOS 10 `user-scaleable=no` is disabled in Safari for iOS,\n // this is only applicable for the browser and does not apply to the PWA mode.\n // https://newbedev.com/how-do-you-disable-viewport-zooming-on-mobile-safari\n if (IS_IOS && !IS_PWA) {\n document.addEventListener('gesturestart', preventEvent);\n }\n\n return () => {\n metaViewport?.setAttribute('content', 'width=device-width, initial-scale=1, shrink-to-fit=no');\n if (IS_IOS && !IS_PWA) {\n document.removeEventListener('gesturestart', preventEvent);\n }\n };\n }, [isDisabled]);\n}\n\nfunction preventEvent(e: Event) {\n e.preventDefault();\n}\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\n\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport { useFolderManagerForUnreadCounters } from '../../hooks/useFolderManager';\nimport { getAllNotificationsCount } from '../../util/folderManager';\nimport { updateAppBadge } from '../../util/appBadge';\n\ninterface OwnProps {\n isForAppBadge?: boolean;\n}\n\nconst UnreadCounter: FC = ({ isForAppBadge }) => {\n useFolderManagerForUnreadCounters();\n const unreadNotificationsCount = getAllNotificationsCount();\n\n useEffect(() => {\n if (isForAppBadge) {\n updateAppBadge(unreadNotificationsCount);\n }\n }, [isForAppBadge, unreadNotificationsCount]);\n\n if (isForAppBadge || !unreadNotificationsCount) {\n return undefined;\n }\n\n return (\n
{formatIntegerCompact(unreadNotificationsCount)}
\n );\n};\n\nexport default memo(UnreadCounter);\n","import { GlobalState } from '../global/types';\n\nimport useBrowserOnline from './useBrowserOnline';\nimport { LangFn } from './useLang';\n\nexport enum ConnectionStatus {\n waitingForNetwork,\n syncing,\n online,\n}\n\ntype ConnectionStatusPosition =\n 'overlay'\n | 'minimized'\n | 'middleHeader'\n | 'none';\n\nexport default function useConnectionStatus(\n lang: LangFn,\n connectionState: GlobalState['connectionState'],\n isSyncing: GlobalState['isSyncing'],\n hasMiddleHeader: boolean,\n isMinimized?: boolean,\n isDisabled?: boolean,\n) {\n let status: ConnectionStatus;\n const isBrowserOnline = useBrowserOnline();\n if (!isBrowserOnline || connectionState === 'connectionStateConnecting') {\n status = ConnectionStatus.waitingForNetwork;\n } else if (isSyncing) {\n status = ConnectionStatus.syncing;\n } else {\n status = ConnectionStatus.online;\n }\n\n let position: ConnectionStatusPosition;\n if (status === ConnectionStatus.online || isDisabled) {\n position = 'none';\n } else if (hasMiddleHeader) {\n position = 'middleHeader';\n } else if (isMinimized) {\n position = 'minimized';\n } else {\n position = 'overlay';\n }\n\n let text: string | undefined;\n if (status === ConnectionStatus.waitingForNetwork) {\n text = lang('WaitingForNetwork');\n } else if (status === ConnectionStatus.syncing) {\n text = lang('Updating');\n }\n\n if (position === 'middleHeader') {\n text = text!.toLowerCase().replace(/\\.+$/, '');\n }\n\n return {\n connectionStatus: status,\n connectionStatusPosition: position,\n connectionStatusText: text,\n };\n}\n","import { useEffect, useState } from '../lib/teact/teact';\n\nexport default function useBrowserOnline() {\n const [isOnline, setIsOnline] = useState(window.navigator.onLine);\n\n useEffect(() => {\n function handleChange() {\n setIsOnline(window.navigator.onLine);\n }\n\n window.addEventListener('online', handleChange);\n window.addEventListener('offline', handleChange);\n\n return () => {\n window.removeEventListener('offline', handleChange);\n window.removeEventListener('online', handleChange);\n };\n }, []);\n\n return isOnline;\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { ConnectionStatus } from '../../hooks/useConnectionStatus';\n\nimport Transition from '../ui/Transition';\nimport Spinner from '../ui/Spinner';\nimport Button from '../ui/Button';\n\nimport './ConnectionStatusOverlay.scss';\n\ntype OwnProps = {\n connectionStatus: ConnectionStatus;\n connectionStatusText: string;\n onClick?: NoneToVoidFunction;\n};\n\nconst ConnectionStatusOverlay: FC = ({\n connectionStatus,\n connectionStatusText,\n onClick,\n}) => {\n const lang = useLang();\n\n return (\n
\n \n
\n \n {connectionStatusText}\n \n
\n \n \n \n
\n );\n};\n\nexport default memo(ConnectionStatusOverlay);\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ISettings, LeftColumnContent } from '../../../types';\nimport { ApiChat } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\n\nimport {\n ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, DEBUG, FEEDBACK_URL,\n} from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { formatDateToString } from '../../../util/dateFormat';\nimport switchTheme from '../../../util/switchTheme';\nimport { setPermanentWebVersion } from '../../../util/permanentWebVersion';\nimport { clearWebsync } from '../../../util/websync';\nimport { selectCurrentMessageList, selectTheme } from '../../../modules/selectors';\nimport { isChatArchived } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport { disableHistoryBack } from '../../../hooks/useHistoryBack';\nimport useConnectionStatus from '../../../hooks/useConnectionStatus';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport SearchInput from '../../ui/SearchInput';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\nimport Switcher from '../../ui/Switcher';\nimport ShowTransition from '../../ui/ShowTransition';\nimport ConnectionStatusOverlay from '../ConnectionStatusOverlay';\n\nimport './LeftMainHeader.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n onSearchQuery: (query: string) => void;\n onSelectSettings: () => void;\n onSelectContacts: () => void;\n onSelectArchived: () => void;\n onReset: () => void;\n};\n\ntype StateProps =\n {\n searchQuery?: string;\n isLoading: boolean;\n currentUserId?: string;\n globalSearchChatId?: string;\n searchDate?: number;\n theme: ISettings['theme'];\n animationLevel: 0 | 1 | 2;\n chatsById?: Record;\n isMessageListOpen: boolean;\n isConnectionStatusMinimized: ISettings['isConnectionStatusMinimized'];\n areChatsLoaded?: boolean;\n }\n & Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [0, 1, 2];\n\nconst PRODUCTION_HOSTNAME = 'web.telegram.org';\nconst LEGACY_VERSION_URL = 'https://web.telegram.org/?legacy=1';\nconst WEBK_VERSION_URL = 'https://web.telegram.org/k/';\n\nconst LeftMainHeader: FC = ({\n content,\n contactsFilter,\n onSearchQuery,\n onSelectSettings,\n onSelectContacts,\n onSelectArchived,\n onReset,\n searchQuery,\n isLoading,\n shouldSkipTransition,\n currentUserId,\n globalSearchChatId,\n searchDate,\n theme,\n animationLevel,\n chatsById,\n connectionState,\n isSyncing,\n isMessageListOpen,\n isConnectionStatusMinimized,\n areChatsLoaded,\n}) => {\n const {\n openChat,\n openTipsChat,\n setGlobalSearchDate,\n setSettingOption,\n setGlobalSearchChatId,\n } = getDispatch();\n\n const lang = useLang();\n const hasMenu = content === LeftColumnContent.ChatList;\n const clearedDateSearchParam = { date: undefined };\n const clearedChatSearchParam = { id: undefined };\n const selectedSearchDate = useMemo(() => {\n return searchDate\n ? formatDateToString(new Date(searchDate * 1000))\n : undefined;\n }, [searchDate]);\n const archivedUnreadChatsCount = useMemo(() => {\n if (!hasMenu || !chatsById) {\n return 0;\n }\n\n return Object.values(chatsById).reduce((total, chat) => {\n if (!isChatArchived(chat)) {\n return total;\n }\n\n return chat.unreadCount ? total + 1 : total;\n }, 0);\n }, [hasMenu, chatsById]);\n\n const { connectionStatus, connectionStatusText, connectionStatusPosition } = useConnectionStatus(\n lang, connectionState, isSyncing, isMessageListOpen, isConnectionStatusMinimized, !areChatsLoaded,\n );\n\n const withOtherVersions = window.location.hostname === PRODUCTION_HOSTNAME;\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n onReset()}\n ariaLabel={hasMenu ? lang('AccDescrOpenMenu2') : 'Return to chat list'}\n >\n
\n \n );\n }, [hasMenu, lang, onReset, shouldSkipTransition]);\n\n const handleSearchFocus = useCallback(() => {\n if (!searchQuery) {\n onSearchQuery('');\n }\n }, [searchQuery, onSearchQuery]);\n\n const toggleConnectionStatus = useCallback(() => {\n setSettingOption({ isConnectionStatusMinimized: !isConnectionStatusMinimized });\n }, [isConnectionStatusMinimized, setSettingOption]);\n\n const handleSelectSaved = useCallback(() => {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n }, [currentUserId, openChat]);\n\n const handleDarkModeToggle = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n const newTheme = theme === 'light' ? 'dark' : 'light';\n\n setSettingOption({ theme: newTheme });\n setSettingOption({ shouldUseSystemTheme: false });\n switchTheme(newTheme, animationLevel === ANIMATION_LEVEL_MAX);\n }, [animationLevel, setSettingOption, theme]);\n\n const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n\n const newLevel = animationLevel === 0 ? 2 : 0;\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [animationLevel, setSettingOption]);\n\n const handleSwitchToWebK = () => {\n setPermanentWebVersion('K');\n clearWebsync();\n disableHistoryBack();\n };\n\n const handleOpenTipsChat = () => {\n openTipsChat({ langCode: lang.code });\n };\n\n const isSearchFocused = (\n Boolean(globalSearchChatId)\n || content === LeftColumnContent.GlobalSearch\n || content === LeftColumnContent.Contacts\n );\n\n const searchInputPlaceholder = content === LeftColumnContent.Contacts\n ? lang('SearchFriends')\n : lang('Search');\n\n return (\n
\n
\n \n \n {lang('SavedMessages')}\n \n \n {lang('ArchivedChats')}\n {archivedUnreadChatsCount > 0 && (\n
{archivedUnreadChatsCount}
\n )}\n \n \n {lang('Contacts')}\n \n \n {lang('Settings')}\n \n \n {lang('lng_menu_night_mode')}\n \n \n \n {lang('Appearance.Animations').toLowerCase()}\n 0}\n />\n \n \n {lang('TelegramFeatures')}\n \n \n Report Bug\n \n {withOtherVersions && (\n <>\n \n Switch to K Version\n \n \n Switch to Old Version\n \n \n )}\n \n \n {selectedSearchDate && (\n \n )}\n {globalSearchChatId && (\n \n )}\n \n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n query: searchQuery, fetchingStatus, chatId, date,\n } = global.globalSearch;\n const { currentUserId, connectionState, isSyncing } = global;\n const { byId: chatsById } = global.chats;\n const { isConnectionStatusMinimized, animationLevel } = global.settings.byKey;\n\n return {\n searchQuery,\n isLoading: fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false,\n currentUserId,\n chatsById,\n globalSearchChatId: chatId,\n searchDate: date,\n theme: selectTheme(global),\n animationLevel,\n connectionState,\n isSyncing,\n isMessageListOpen: Boolean(selectCurrentMessageList(global)),\n isConnectionStatusMinimized,\n areChatsLoaded: Boolean(global.chats.listIds.active),\n };\n },\n)(LeftMainHeader));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatFolder } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { ALL_FOLDER_ID } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { captureEvents, SwipeDirection } from '../../../util/captureEvents';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Transition from '../../ui/Transition';\nimport TabList from '../../ui/TabList';\nimport ChatList from './ChatList';\nimport { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager';\n\ntype OwnProps = {\n onScreenSelect: (screen: SettingsScreens) => void;\n foldersDispatch: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatFoldersById: Record;\n orderedFolderIds?: number[];\n activeChatFolder: number;\n currentUserId?: string;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst SAVED_MESSAGES_HOTKEY = '0';\n\nconst ChatFolders: FC = ({\n foldersDispatch,\n onScreenSelect,\n chatFoldersById,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n loadChatFolders,\n setActiveChatFolder,\n openChat,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime) {\n loadChatFolders();\n }\n }, [lastSyncTime, loadChatFolders]);\n\n const displayedFolders = useMemo(() => {\n return orderedFolderIds\n ? orderedFolderIds.map((id) => chatFoldersById[id] || {}).filter(Boolean)\n : undefined;\n }, [chatFoldersById, orderedFolderIds]);\n\n const folderCountersById = useFolderManagerForUnreadCounters();\n const folderTabs = useMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n return [\n {\n id: ALL_FOLDER_ID,\n title: lang.code === 'en' ? 'All' : lang('FilterAllChats'),\n },\n ...displayedFolders.map(({ id, title }) => ({\n id,\n title,\n badgeCount: folderCountersById[id]?.chatsCount,\n isBadgeActive: Boolean(folderCountersById[id]?.notificationsCount),\n })),\n ];\n }, [displayedFolders, folderCountersById, lang]);\n\n const handleSwitchTab = useCallback((index: number) => {\n setActiveChatFolder(index, { forceOnHeavyAnimation: true });\n }, [setActiveChatFolder]);\n\n // Prevent `activeTab` pointing at non-existing folder after update\n useEffect(() => {\n if (!folderTabs || !folderTabs.length) {\n return;\n }\n\n if (activeChatFolder >= folderTabs.length) {\n setActiveChatFolder(0);\n }\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV || !folderTabs || !folderTabs.length) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.chat-list',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveChatFolder(Math.min(activeChatFolder + 1, folderTabs.length - 1), { forceOnHeavyAnimation: true });\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveChatFolder(Math.max(0, activeChatFolder - 1), { forceOnHeavyAnimation: true });\n return true;\n }\n\n return false;\n }),\n });\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n const isNotInAllTabRef = useRef();\n isNotInAllTabRef.current = activeChatFolder !== 0;\n useEffect(() => (isNotInAllTabRef.current ? captureEscKeyListener(() => {\n if (isNotInAllTabRef.current) {\n setActiveChatFolder(0);\n }\n }) : undefined), [activeChatFolder, setActiveChatFolder]);\n\n useHistoryBack(activeChatFolder !== 0, () => setActiveChatFolder(0, { forceOnHeavyAnimation: true }));\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.ctrlKey && e.shiftKey && e.code.startsWith('Digit') && folderTabs) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n if (digit === SAVED_MESSAGES_HOTKEY) {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n return;\n }\n\n const folder = Number(digit) - 1;\n if (folder > folderTabs.length - 1) return;\n\n setActiveChatFolder(folder, { forceOnHeavyAnimation: true });\n e.preventDefault();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, true);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, true);\n };\n });\n\n const {\n shouldRender: shouldRenderPlaceholder, transitionClassNames,\n } = useShowTransition(!orderedFolderIds, undefined, true);\n\n function renderCurrentTab(isActive: boolean) {\n const activeFolder = Object.values(chatFoldersById)\n .find(({ id }) => id === folderTabs![activeChatFolder].id);\n\n if (!activeFolder || activeChatFolder === 0) {\n return (\n \n );\n }\n\n return (\n \n );\n }\n\n return (\n
\n {folderTabs?.length ? (\n \n ) : shouldRenderPlaceholder ? (\n
\n ) : undefined}\n \n {renderCurrentTab}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatFolders: {\n byId: chatFoldersById,\n orderedIds: orderedFolderIds,\n activeChatFolder,\n },\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n } = global;\n\n return {\n chatFoldersById,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n };\n },\n)(ChatFolders));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './LeftSearch';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst LeftSearchAsync: FC = (props) => {\n const LeftSearch = useModuleLoader(Bundles.Extra, 'LeftSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return LeftSearch ? : ;\n};\n\nexport default memo(LeftSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './ContactList';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst ContactListAsync: FC = (props) => {\n const ContactList = useModuleLoader(Bundles.Extra, 'ContactList');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContactList ? : ;\n};\n\nexport default memo(ContactListAsync);\n","import React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\n\nimport './NewChatButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n onNewPrivateChat: () => void;\n onNewChannel: () => void;\n onNewGroup: () => void;\n};\n\nconst NewChatButton: FC = ({\n isShown,\n onNewPrivateChat,\n onNewChannel,\n onNewGroup,\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (!isShown) {\n setIsMenuOpen(false);\n }\n }, [isShown]);\n\n const lang = useLang();\n\n const fabClassName = buildClassName(\n 'NewChatButton',\n isShown && 'revealed',\n isMenuOpen && 'menu-is-open',\n );\n\n const toggleIsMenuOpen = () => {\n setIsMenuOpen(!isMenuOpen);\n };\n\n const handleClose = () => {\n setIsMenuOpen(false);\n };\n\n return (\n
\n \n \n \n \n \n {lang('NewChannel')}\n {lang('NewGroup')}\n {lang('NewMessageTitle')}\n \n
\n );\n};\n\nexport default memo(NewChatButton);\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { LeftColumnContent, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport useFlag from '../../../hooks/useFlag';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport Transition from '../../ui/Transition';\nimport LeftMainHeader from './LeftMainHeader';\nimport ChatFolders from './ChatFolders';\nimport LeftSearch from '../search/LeftSearch.async';\nimport ContactList from './ContactList.async';\nimport NewChatButton from '../NewChatButton';\nimport Button from '../../ui/Button';\n\nimport './LeftMain.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n searchQuery?: string;\n searchDate?: number;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n foldersDispatch: FolderEditDispatch;\n onSearchQuery: (query: string) => void;\n onContentChange: (content: LeftColumnContent) => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst TRANSITION_RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\nconst BUTTON_CLOSE_DELAY_MS = 250;\nconst APP_OUTDATED_TIMEOUT = 3 * 24 * 60 * 60 * 1000; // 3 days\n\nlet closeTimeout: number | undefined;\n\nconst LeftMain: FC = ({\n content,\n searchQuery,\n searchDate,\n contactsFilter,\n shouldSkipTransition,\n foldersDispatch,\n onSearchQuery,\n onContentChange,\n onScreenSelect,\n onReset,\n}) => {\n const [isNewChatButtonShown, setIsNewChatButtonShown] = useState(IS_TOUCH_ENV);\n\n const isMouseInside = useRef(false);\n\n const handleSelectSettings = useCallback(() => {\n onContentChange(LeftColumnContent.Settings);\n }, [onContentChange]);\n\n const handleSelectContacts = useCallback(() => {\n onContentChange(LeftColumnContent.Contacts);\n }, [onContentChange]);\n\n const handleSelectNewChannel = useCallback(() => {\n onContentChange(LeftColumnContent.NewChannelStep1);\n }, [onContentChange]);\n\n const handleSelectNewGroup = useCallback(() => {\n onContentChange(LeftColumnContent.NewGroupStep1);\n }, [onContentChange]);\n\n const handleSelectArchived = useCallback(() => {\n onContentChange(LeftColumnContent.Archived);\n }, [onContentChange]);\n\n const handleMouseEnter = useCallback(() => {\n if (content !== LeftColumnContent.ChatList) {\n return;\n }\n isMouseInside.current = true;\n setIsNewChatButtonShown(true);\n }, [content]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n setIsNewChatButtonShown(false);\n }\n }, BUTTON_CLOSE_DELAY_MS);\n }, []);\n\n useEffect(() => {\n let autoCloseTimeout: number | undefined;\n if (content !== LeftColumnContent.ChatList) {\n autoCloseTimeout = window.setTimeout(() => {\n setIsNewChatButtonShown(false);\n }, BUTTON_CLOSE_DELAY_MS);\n } else if (isMouseInside.current || IS_TOUCH_ENV) {\n setIsNewChatButtonShown(true);\n }\n\n return () => {\n if (autoCloseTimeout) {\n clearTimeout(autoCloseTimeout);\n autoCloseTimeout = undefined;\n }\n };\n }, [content]);\n\n const [shouldRenderUpdateButton, updateButtonClassNames, handleUpdateClick] = useAppOutdatedCheck();\n\n const lang = useLang();\n\n return (\n \n \n \n {(isActive) => {\n switch (content) {\n case LeftColumnContent.ChatList:\n return ;\n case LeftColumnContent.GlobalSearch:\n return (\n \n );\n case LeftColumnContent.Contacts:\n return ;\n default:\n return undefined;\n }\n }}\n \n {shouldRenderUpdateButton && (\n \n {lang('lng_update_telegram')}\n \n )}\n \n
\n );\n};\n\nfunction useAppOutdatedCheck() {\n const [isAppOutdated, markIsAppOutdated] = useFlag(false);\n\n useEffect(() => {\n const timeout = window.setTimeout(markIsAppOutdated, APP_OUTDATED_TIMEOUT);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [markIsAppOutdated]);\n\n const { shouldRender, transitionClassNames } = useShowTransition(isAppOutdated);\n\n const handleUpdateClick = () => {\n window.location.reload();\n };\n\n return [shouldRender, transitionClassNames, handleUpdateClick] as const;\n}\n\nexport default memo(LeftMain);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Settings';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst SettingsAsync: FC = (props) => {\n const Settings = useModuleLoader(Bundles.Extra, 'Settings');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Settings ? : ;\n};\n\nexport default memo(SettingsAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './NewChat';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst NewChatAsync: FC = (props) => {\n const NewChat = useModuleLoader(Bundles.Extra, 'NewChat');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return NewChat ? : ;\n};\n\nexport default memo(NewChatAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ArchivedChats';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst ArchivedChatsAsync: FC = (props) => {\n const ArchivedChats = useModuleLoader(Bundles.Extra, 'ArchivedChats');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ArchivedChats ? : ;\n};\n\nexport default memo(ArchivedChatsAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { LeftColumnContent, SettingsScreens } from '../../types';\n\nimport { IS_MAC_OS, LAYERS_ANIMATION_NAME } from '../../util/environment';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport getKeyFromEvent from '../../util/getKeyFromEvent';\nimport useFoldersReducer from '../../hooks/reducers/useFoldersReducer';\nimport { useResize } from '../../hooks/useResize';\n\nimport Transition from '../ui/Transition';\nimport LeftMain from './main/LeftMain';\nimport Settings from './settings/Settings.async';\nimport NewChat from './newChat/NewChat.async';\nimport ArchivedChats from './ArchivedChats.async';\n\nimport './LeftColumn.scss';\n\ntype StateProps = {\n searchQuery?: string;\n searchDate?: number;\n activeChatFolder: number;\n shouldSkipHistoryAnimations?: boolean;\n leftColumnWidth?: number;\n};\n\nenum ContentType {\n Main,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Settings,\n Archived,\n // eslint-disable-next-line no-shadow\n NewGroup,\n // eslint-disable-next-line no-shadow\n NewChannel,\n}\n\nconst RENDER_COUNT = Object.keys(ContentType).length / 2;\nconst RESET_TRANSITION_DELAY_MS = 250;\n\nconst LeftColumn: FC = ({\n searchQuery,\n searchDate,\n activeChatFolder,\n shouldSkipHistoryAnimations,\n leftColumnWidth,\n}) => {\n const {\n setGlobalSearchQuery,\n setGlobalSearchChatId,\n resetChatCreation,\n setGlobalSearchDate,\n loadPasswordInfo,\n clearTwoFaError,\n setLeftColumnWidth,\n resetLeftColumnWidth,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const resizeRef = useRef(null);\n const [content, setContent] = useState(LeftColumnContent.ChatList);\n const [settingsScreen, setSettingsScreen] = useState(SettingsScreens.Main);\n const [contactsFilter, setContactsFilter] = useState('');\n const [foldersState, foldersDispatch] = useFoldersReducer();\n\n // Used to reset child components in background.\n const [lastResetTime, setLastResetTime] = useState(0);\n\n let contentType: ContentType = ContentType.Main;\n switch (content) {\n case LeftColumnContent.Archived:\n contentType = ContentType.Archived;\n break;\n case LeftColumnContent.Settings:\n contentType = ContentType.Settings;\n break;\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewChannelStep2:\n contentType = ContentType.NewChannel;\n break;\n case LeftColumnContent.NewGroupStep1:\n case LeftColumnContent.NewGroupStep2:\n contentType = ContentType.NewGroup;\n break;\n }\n\n const handleReset = useCallback((forceReturnToChatList?: boolean) => {\n if (content === LeftColumnContent.NewGroupStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewGroupStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewChannelStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewChannelStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewGroupStep1) {\n const pickerSearchInput = document.getElementById('new-group-picker-search');\n if (pickerSearchInput) {\n pickerSearchInput.blur();\n }\n }\n\n if (content === LeftColumnContent.Settings) {\n switch (settingsScreen) {\n case SettingsScreens.EditProfile:\n case SettingsScreens.Folders:\n case SettingsScreens.General:\n case SettingsScreens.Notifications:\n case SettingsScreens.DataStorage:\n case SettingsScreens.Privacy:\n case SettingsScreens.Language:\n setSettingsScreen(SettingsScreens.Main);\n return;\n\n case SettingsScreens.GeneralChatBackground:\n case SettingsScreens.QuickReaction:\n setSettingsScreen(SettingsScreens.General);\n return;\n case SettingsScreens.GeneralChatBackgroundColor:\n setSettingsScreen(SettingsScreens.GeneralChatBackground);\n return;\n\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyActiveSessions:\n case SettingsScreens.PrivacyBlockedUsers:\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaCongratulations:\n setSettingsScreen(SettingsScreens.Privacy);\n return;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyPhoneNumber);\n return;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyLastSeen);\n return;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyProfilePhoto);\n return;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyForwarding);\n return;\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyGroupChats);\n return;\n case SettingsScreens.TwoFaNewPassword:\n setSettingsScreen(SettingsScreens.TwoFaDisabled);\n return;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaNewPassword);\n return;\n case SettingsScreens.TwoFaNewPasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordConfirm);\n return;\n case SettingsScreens.TwoFaNewPasswordEmail:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordHint);\n return;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordEmail);\n return;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n setSettingsScreen(SettingsScreens.TwoFaEnabled);\n return;\n case SettingsScreens.TwoFaChangePasswordNew:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordCurrent);\n return;\n case SettingsScreens.TwoFaChangePasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordNew);\n return;\n case SettingsScreens.TwoFaChangePasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordConfirm);\n return;\n case SettingsScreens.TwoFaRecoveryEmail:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmailCurrentPassword);\n return;\n case SettingsScreens.TwoFaRecoveryEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmail);\n return;\n\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n setSettingsScreen(SettingsScreens.Folders);\n return;\n\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n setSettingsScreen(SettingsScreens.FoldersEditFolderFromChatList);\n return;\n\n case SettingsScreens.FoldersEditFolderFromChatList:\n setContent(LeftColumnContent.ChatList);\n setSettingsScreen(SettingsScreens.Main);\n return;\n default:\n break;\n }\n }\n\n if (content === LeftColumnContent.ChatList && activeChatFolder === 0) {\n setContent(LeftColumnContent.GlobalSearch);\n return;\n }\n\n setContent(LeftColumnContent.ChatList);\n setContactsFilter('');\n setGlobalSearchQuery({ query: '' });\n setGlobalSearchDate({ date: undefined });\n setGlobalSearchChatId({ id: undefined });\n resetChatCreation();\n setTimeout(() => {\n setLastResetTime(Date.now());\n }, RESET_TRANSITION_DELAY_MS);\n }, [\n content, activeChatFolder, settingsScreen, setGlobalSearchQuery, setGlobalSearchDate, setGlobalSearchChatId,\n resetChatCreation,\n ]);\n\n const handleSearchQuery = useCallback((query: string) => {\n if (content === LeftColumnContent.Contacts) {\n setContactsFilter(query);\n return;\n }\n\n setContent(LeftColumnContent.GlobalSearch);\n\n if (query !== searchQuery) {\n setGlobalSearchQuery({ query });\n }\n }, [content, searchQuery, setGlobalSearchQuery]);\n\n useEffect(\n () => (content !== LeftColumnContent.ChatList || activeChatFolder === 0\n ? captureEscKeyListener(() => handleReset())\n : undefined),\n [activeChatFolder, content, handleReset],\n );\n\n useEffect(() => {\n if (content === LeftColumnContent.GlobalSearch) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && e.shiftKey && getKeyFromEvent(e) === 'f') {\n e.preventDefault();\n setContent(LeftColumnContent.GlobalSearch);\n }\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n }, [content]);\n\n useEffect(() => {\n clearTwoFaError();\n\n if (settingsScreen === SettingsScreens.Privacy) {\n loadPasswordInfo();\n }\n }, [clearTwoFaError, loadPasswordInfo, settingsScreen]);\n\n const {\n initResize, resetResize, handleMouseUp,\n } = useResize(resizeRef, setLeftColumnWidth, resetLeftColumnWidth, leftColumnWidth);\n\n const handleSettingsScreenSelect = (screen: SettingsScreens) => {\n setContent(LeftColumnContent.Settings);\n setSettingsScreen(screen);\n };\n\n return (\n \n \n {(isActive) => {\n switch (contentType) {\n case ContentType.Archived:\n return (\n \n );\n case ContentType.Settings:\n return (\n \n );\n case ContentType.NewChannel:\n return (\n \n );\n case ContentType.NewGroup:\n return (\n \n );\n default:\n return (\n \n );\n }\n }}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n globalSearch: {\n query,\n date,\n },\n chatFolders: {\n activeChatFolder,\n },\n shouldSkipHistoryAnimations,\n leftColumnWidth,\n } = global;\n return {\n searchQuery: query, searchDate: date, activeChatFolder, shouldSkipHistoryAnimations, leftColumnWidth,\n };\n },\n)(LeftColumn));\n","import { RefObject } from 'react';\nimport { useState, useEffect } from '../lib/teact/teact';\nimport useFlag from './useFlag';\n\nexport const useResize = (\n elementRef: RefObject,\n onResize: (width: number) => void,\n onReset: NoneToVoidFunction,\n initialWidth?: number,\n) => {\n const [isActive, markIsActive, unmarkIsActive] = useFlag();\n const [initialMouseX, setInitialMouseX] = useState();\n const [initialElementWidth, setInitialElementWidth] = useState();\n\n useEffect(() => {\n if (!elementRef.current || !initialWidth) {\n return;\n }\n\n elementRef.current.style.width = `${initialWidth}px`;\n }, [elementRef, initialWidth]);\n\n function handleMouseUp() {\n document.body.classList.remove('no-selection', 'cursor-ew-resize');\n }\n\n function initResize(event: React.MouseEvent) {\n document.body.classList.add('no-selection', 'cursor-ew-resize');\n\n setInitialMouseX(event.clientX);\n setInitialElementWidth(elementRef.current!.offsetWidth);\n markIsActive();\n }\n\n function resetResize(event: React.MouseEvent) {\n event.preventDefault();\n elementRef.current!.style.width = '';\n onReset();\n }\n\n useEffect(() => {\n if (!isActive) return;\n\n const handleMouseMove = (event: MouseEvent) => {\n const newWidth = Math.ceil(initialElementWidth + event.clientX - initialMouseX);\n elementRef.current!.style.width = `${newWidth}px`;\n };\n\n function stopDrag() {\n cleanup();\n onResize(elementRef.current!.offsetWidth);\n }\n\n function cleanup() {\n handleMouseUp();\n document.removeEventListener('mousemove', handleMouseMove, false);\n document.removeEventListener('mouseup', stopDrag, false);\n document.removeEventListener('blur', stopDrag, false);\n unmarkIsActive();\n }\n\n document.addEventListener('mousemove', handleMouseMove, false);\n document.addEventListener('mouseup', stopDrag, false);\n document.addEventListener('blur', stopDrag, false);\n\n return cleanup;\n }, [initialElementWidth, initialMouseX, elementRef, onResize, isActive, unmarkIsActive]);\n\n return { initResize, resetResize, handleMouseUp };\n};\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { ThemeKey } from '../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../config';\nimport * as cacheApi from '../util/cacheApi';\nimport { preloadImage } from '../util/files';\n\nconst useCustomBackground = (theme: ThemeKey, settingValue?: string) => {\n const [value, setValue] = useState(settingValue);\n\n useEffect(() => {\n if (!settingValue) {\n return;\n }\n\n if (settingValue.startsWith('#')) {\n setValue(settingValue);\n } else {\n cacheApi.fetch(CUSTOM_BG_CACHE_NAME, theme, cacheApi.Type.Blob)\n .then((blob) => {\n const url = URL.createObjectURL(blob);\n preloadImage(url)\n .then(() => {\n setValue(`url(${url})`);\n });\n });\n }\n }, [settingValue, theme]);\n\n return settingValue ? value : undefined;\n};\n\nexport default useCustomBackground;\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\nimport windowSize from '../util/windowSize';\nimport { ApiDimensions } from '../api/types';\n\nconst THROTTLE = 250;\n\nconst useWindowSize = () => {\n const [size, setSize] = useState(windowSize.get());\n\n useEffect(() => {\n const handleResize = throttle(() => {\n setSize(windowSize.get());\n }, THROTTLE, false);\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return size;\n};\n\nexport default useWindowSize;\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './HeaderMenuContainer';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HeaderMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const HeaderMenuContainer = useModuleLoader(Bundles.Extra, 'HeaderMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HeaderMenuContainer ? : undefined;\n};\n\nexport default memo(HeaderMenuContainerAsync);\n","import React, {\n FC,\n memo,\n useRef,\n useCallback,\n useState,\n useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\nimport { IAnchorPosition, ManagementScreens } from '../../types';\n\nimport {\n ARE_CALLS_SUPPORTED, IS_MAC_OS, IS_PWA, IS_SINGLE_COLUMN_LAYOUT,\n} from '../../util/environment';\nimport getKeyFromEvent from '../../util/getKeyFromEvent';\nimport {\n isChatBasicGroup, isChatChannel, isChatSuperGroup, isUserId,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatBot,\n selectIsUserBlocked,\n selectIsChatBotNotStarted,\n selectIsChatWithSelf,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n} from '../../modules/selectors';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport HeaderMenuContainer from './HeaderMenuContainer.async';\n\ninterface OwnProps {\n chatId: string;\n threadId: number;\n messageListType: MessageListType;\n canExpandActions: boolean;\n}\n\ninterface StateProps {\n noMenu?: boolean;\n isChannel?: boolean;\n isRightColumnShown?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canCall?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n canEnterVoiceChat?: boolean;\n canCreateVoiceChat?: boolean;\n pendingJoinRequests?: number;\n}\n\n// Chrome breaks layout when focusing input during transition\nconst SEARCH_FOCUS_DELAY_MS = 400;\n\nconst HeaderActions: FC = ({\n chatId,\n threadId,\n noMenu,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canCall,\n canMute,\n canLeave,\n canEnterVoiceChat,\n canCreateVoiceChat,\n pendingJoinRequests,\n isRightColumnShown,\n canExpandActions,\n}) => {\n const {\n joinChannel,\n sendBotCommand,\n openLocalTextSearch,\n restartBot,\n openCallFallbackConfirm,\n requestNextManagementScreen,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const menuButtonRef = useRef(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const [menuPosition, setMenuPosition] = useState(undefined);\n\n const handleHeaderMenuOpen = useCallback(() => {\n setIsMenuOpen(true);\n const rect = menuButtonRef.current!.getBoundingClientRect();\n setMenuPosition({ x: rect.right, y: rect.bottom });\n }, []);\n\n const handleHeaderMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n }, []);\n\n const handleHeaderMenuHide = useCallback(() => {\n setMenuPosition(undefined);\n }, []);\n\n const handleSubscribeClick = useCallback(() => {\n joinChannel({ chatId });\n }, [joinChannel, chatId]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleJoinRequestsClick = useCallback(() => {\n requestNextManagementScreen({ screen: ManagementScreens.JoinRequests });\n }, [requestNextManagementScreen]);\n\n const handleSearchClick = useCallback(() => {\n openLocalTextSearch();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // iOS requires synchronous focus on user event.\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.focus();\n } else {\n setTimeout(() => {\n const searchInput = document.querySelector('.RightHeader .SearchInput input');\n if (searchInput) {\n searchInput.focus();\n }\n }, SEARCH_FOCUS_DELAY_MS);\n }\n }, [openLocalTextSearch]);\n\n useEffect(() => {\n if (!canSearch) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (\n IS_PWA && ((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && !e.shiftKey && getKeyFromEvent(e) === 'f'\n ) {\n e.preventDefault();\n handleSearchClick();\n }\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n }, [canSearch, handleSearchClick]);\n\n const lang = useLang();\n\n return (\n
\n {!IS_SINGLE_COLUMN_LAYOUT && (\n <>\n {canExpandActions && canSubscribe && (\n \n {lang(isChannel ? 'ProfileJoinChannel' : 'ProfileJoinGroup')}\n \n )}\n {canExpandActions && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {canExpandActions && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {canSearch && (\n \n \n \n )}\n {canCall && (\n \n \n \n )}\n \n )}\n {Boolean(pendingJoinRequests) && (\n \n \n
{pendingJoinRequests}
\n \n )}\n \n \n \n {menuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const isChannel = Boolean(chat && isChatChannel(chat));\n\n if (!chat || chat.isRestricted || selectIsInSelectMode(global)) {\n return {\n noMenu: true,\n };\n }\n\n const bot = selectChatBot(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isMainThread = messageListType === 'thread' && threadId === MAIN_THREAD_ID;\n const isDiscussionThread = messageListType === 'thread' && threadId !== MAIN_THREAD_ID;\n const isRightColumnShown = selectIsRightColumnShown(global);\n\n const canRestartBot = Boolean(bot && selectIsUserBlocked(global, bot.id));\n const canStartBot = !canRestartBot && Boolean(selectIsChatBotNotStarted(global, chatId));\n const canSubscribe = Boolean(\n isMainThread && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canSearch = isMainThread || isDiscussionThread;\n const canCall = ARE_CALLS_SUPPORTED && isUserId(chat.id) && !isChatWithSelf && !bot;\n const canMute = isMainThread && !isChatWithSelf && !canSubscribe;\n const canLeave = isMainThread && !canSubscribe;\n const canEnterVoiceChat = ARE_CALLS_SUPPORTED && chat.isCallActive;\n const canCreateVoiceChat = ARE_CALLS_SUPPORTED && !chat.isCallActive\n && (chat.adminRights?.manageCall || (chat.isCreator && isChatBasicGroup(chat)));\n const pendingJoinRequests = chat.fullInfo?.requestsPending;\n\n return {\n noMenu: false,\n isChannel,\n isRightColumnShown,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canCall,\n canMute,\n canLeave,\n canEnterVoiceChat,\n canCreateVoiceChat,\n pendingJoinRequests,\n };\n },\n)(HeaderActions));\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\n\nimport { ApiMessage } from '../api/types';\n\nimport { DEBUG } from '../config';\nimport { isWebpSupported } from '../util/environment';\nimport { EMPTY_IMAGE_DATA_URI, webpToPngBase64 } from '../util/webpToPng';\nimport { getMessageMediaThumbDataUri } from '../modules/helpers';\n\nexport default function useWebpThumbnail(message?: ApiMessage) {\n const thumbDataUri = message && getMessageMediaThumbDataUri(message);\n const sticker = message?.content?.sticker;\n const shouldDecodeThumbnail = thumbDataUri && sticker && !isWebpSupported() && thumbDataUri.includes('image/webp');\n const [thumbnailDecoded, setThumbnailDecoded] = useState(EMPTY_IMAGE_DATA_URI);\n const messageId = message?.id;\n\n useLayoutEffect(() => {\n if (!shouldDecodeThumbnail) {\n return;\n }\n\n webpToPngBase64(`b64-${messageId}`, thumbDataUri!)\n .then(setThumbnailDecoded)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n }, [messageId, shouldDecodeThumbnail, thumbDataUri]);\n\n return shouldDecodeThumbnail ? thumbnailDecoded : thumbDataUri;\n}\n","import React, {\n FC,\n useRef,\n useEffect,\n useMemo,\n memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n count: number;\n index: number;\n};\n\nconst BORDER_MASK_LEVEL = 4;\n\nconst PinnedMessageNavigation: FC = ({\n count, index,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const markupParams = useMemo(() => {\n return calculateMarkup(count, index);\n }, [count, index]);\n\n useEffect(() => {\n if (!containerRef.current) {\n return;\n }\n\n const {\n trackHeight,\n trackTranslateY,\n markHeight,\n markTranslateY,\n clipPathId,\n clipPath,\n } = markupParams;\n\n const firstChild = containerRef.current.firstElementChild;\n if (containerRef?.current) {\n const currentElement = containerRef.current;\n const { style } = currentElement;\n style.height = `${trackHeight}px`;\n style.transform = `translateY(-${trackTranslateY}px)`;\n style.clipPath = `url(\"#${clipPathId}\")`;\n const svg = currentElement.querySelector('svg');\n const div = currentElement.querySelector('div');\n const defs = currentElement.querySelector('defs');\n if (!svg) {\n if (firstChild) {\n firstChild.innerHTML = ` ${clipPath} `;\n }\n }\n if (defs) {\n defs.innerHTML = clipPath;\n }\n if (div) {\n div.style.height = `${markHeight}px`;\n div.style.transform = `translateY(${markTranslateY}px)`;\n }\n }\n }, [markupParams]);\n\n if (count === 1) {\n return (\n
\n \n
\n );\n }\n\n const {\n trackHeight, trackTranslateY, markHeight, markTranslateY, clipPathId,\n } = markupParams;\n\n return (\n
BORDER_MASK_LEVEL && 'pinned-message-border-mask')}>\n \n \n \n
\n \n );\n};\n\nfunction calculateMarkup(count: number, index: number) {\n const reverseIndex = count - index - 1;\n const barHeight = getBarHeight(count);\n const markHeight = getMarkHeight(count, reverseIndex);\n const trackHeight = getTrackHeight(count, barHeight);\n\n const clipPathId = `clipPath${count}`;\n const clipPath = getClipPath(clipPathId, barHeight, count);\n\n const markTranslateY = getMarkTranslateY(reverseIndex, barHeight, count);\n const trackTranslateY = getTrackTranslateY(reverseIndex, count, barHeight, trackHeight);\n return {\n markHeight,\n clipPath,\n markTranslateY,\n trackTranslateY,\n trackHeight,\n clipPathId,\n };\n}\n\nfunction getBarHeight(count: number): number {\n let barHeight = 8;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getMarkHeight(count: number, index: number) {\n let barHeight = 36;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = index === 1 ? 12 : 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getTrackHeight(count: number, barHeight: number) {\n return count <= 3 ? 36 : barHeight * count + 2 * (count - 1);\n}\n\nfunction getClipPath(id: string, barHeight: number, count: number) {\n const radius = 1;\n\n let d = '';\n if (count === 3) {\n d = drawRect(0, 0, 2, barHeight, radius)\n + drawRect(0, 12, 2, barHeight + 1, radius)\n + drawRect(0, 25, 2, barHeight, radius);\n } else {\n for (let i = 0; i < count; i++) {\n d += drawRect(0, (barHeight + 2) * i, 2, barHeight, radius);\n }\n }\n\n return (\n `\n \n `\n );\n}\n\nfunction drawRect(x: number, y: number, width: number, height: number, radius: number) {\n return `M${x},${y + radius}a${radius},${radius},0,0,1,\n ${width},0v${height - 2 * radius}a${radius},${radius},0,0,1,${-width},0Z`;\n}\n\nfunction getMarkTranslateY(index: number, barHeight: number, count: number) {\n if (count === 1) {\n return 0;\n } else if (count === 2) {\n return index === 0 ? 0 : barHeight + 2;\n }\n\n if (count === 3) {\n if (index === 0) {\n return 0;\n } else if (index === 1) {\n return 12;\n }\n\n return 25;\n } else {\n return (barHeight + 2) * index;\n }\n}\n\nfunction getTrackTranslateY(index: number, count: number, barHeight: number, trackHeight: number) {\n if (count <= 4) {\n return 0;\n }\n\n if (index <= 1) {\n return 0;\n } else if (index >= count - 2) {\n return trackHeight - 36;\n }\n\n return (barHeight + 4) / 2 + (index - 2) * (barHeight + 2);\n}\n\nexport default memo(PinnedMessageNavigation);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { getPictogramDimensions } from '../common/helpers/mediaDimensions';\nimport { getMessageMediaHash } from '../../modules/helpers';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Button from '../ui/Button';\nimport RippleEffect from '../ui/RippleEffect';\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\nimport { renderMessageSummary } from '../common/helpers/renderMessageText';\n\nimport PinnedMessageNavigation from './PinnedMessageNavigation';\n\ntype OwnProps = {\n message: ApiMessage;\n index: number;\n count: number;\n customTitle?: string;\n className?: string;\n onUnpinMessage?: (id: number) => void;\n onClick?: () => void;\n onAllPinnedClick?: () => void;\n};\n\nconst HeaderPinnedMessage: FC = ({\n message, count, index, customTitle, className, onUnpinMessage, onClick, onAllPinnedClick,\n}) => {\n const lang = useLang();\n const mediaThumbnail = useWebpThumbnail(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n\n const text = renderMessageSummary(lang, message, Boolean(mediaThumbnail));\n const [isUnpinDialogOpen, openUnpinDialog, closeUnpinDialog] = useFlag();\n\n const handleUnpinMessage = useCallback(() => {\n closeUnpinDialog();\n\n if (onUnpinMessage) {\n onUnpinMessage(message.id);\n }\n }, [closeUnpinDialog, onUnpinMessage, message.id]);\n\n return (\n
\n {count > 1 && (\n \n \n \n )}\n {onUnpinMessage && (\n \n \n \n )}\n \n
\n \n {mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl)}\n
\n
\n {customTitle || `${lang('PinnedMessage')} ${index > 0 ? `#${count - index}` : ''}`}\n
\n

{text}

\n
\n\n \n
\n
\n );\n};\n\nfunction renderPictogram(thumbDataUri: string, blobUrl?: string) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \"\"\n );\n}\n\nexport default memo(HeaderPinnedMessage);\n","export function scaleImage(image: string | Blob, ratio: number, outputType: string = 'image/png'): Promise {\n const url = image instanceof Blob ? URL.createObjectURL(image) : image;\n const img = new Image();\n return new Promise((resolve) => {\n img.onload = () => {\n scale(img, img.width * ratio, img.height * ratio, outputType)\n .then((blob) => {\n if (!blob) throw new Error('Image resize failed!');\n return URL.createObjectURL(blob);\n })\n .then(resolve)\n .finally(() => {\n if (image instanceof Blob) {\n URL.revokeObjectURL(url); // Revoke blob url that we created\n }\n });\n };\n img.src = url;\n });\n}\n\nexport function resizeImage(\n image: string | Blob, width: number, height: number, outputType: string = 'image/png',\n): Promise {\n const url = image instanceof Blob ? URL.createObjectURL(image) : image;\n const img = new Image();\n return new Promise((resolve) => {\n img.onload = () => {\n scale(img, width, height, outputType)\n .then((blob) => {\n if (!blob) throw new Error('Image resize failed!');\n return URL.createObjectURL(blob);\n })\n .then(resolve)\n .finally(() => {\n if (image instanceof Blob) {\n URL.revokeObjectURL(url); // Revoke blob url that we created\n }\n });\n };\n img.src = url;\n });\n}\n\nasync function scale(\n img: HTMLImageElement, width: number, height: number, outputType: string = 'image/png',\n): Promise {\n // Safari does not have built-in resize method with quality control\n if ('createImageBitmap' in window) {\n try {\n const bitmap = await window.createImageBitmap(img,\n { resizeWidth: width, resizeHeight: height, resizeQuality: 'high' });\n if (bitmap.height !== height || bitmap.width !== width) {\n throw new Error('Image bitmap resize not supported!'); // FF93 added support for options, but not resize\n }\n return await new Promise((res) => {\n const canvas = document.createElement('canvas');\n canvas.width = bitmap.width;\n canvas.height = bitmap.height;\n const ctx = canvas.getContext('bitmaprenderer');\n if (ctx) {\n ctx.transferFromImageBitmap(bitmap);\n } else {\n canvas.getContext('2d')!.drawImage(bitmap, 0, 0);\n }\n canvas.toBlob(res, outputType);\n });\n } catch (e) {\n // Fallback. Firefox below 93 does not recognize `createImageBitmap` with 2 parameters\n return steppedScale(img, width, height, undefined, outputType);\n }\n } else {\n return steppedScale(img, width, height, undefined, outputType);\n }\n}\n\nfunction steppedScale(\n img: HTMLImageElement, width: number, height: number, step: number = 0.5, outputType: string = 'image/png',\n): Promise {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n const oc = document.createElement('canvas');\n const octx = oc.getContext('2d')!;\n\n canvas.width = width;\n canvas.height = height;\n\n if (img.width * step > width) { // For performance avoid unnecessary drawing\n const mul = 1 / step;\n let cur = {\n width: Math.floor(img.width * step),\n height: Math.floor(img.height * step),\n };\n\n oc.width = cur.width;\n oc.height = cur.height;\n\n octx.drawImage(img, 0, 0, cur.width, cur.height);\n\n while (cur.width * step > width) {\n cur = {\n width: Math.floor(cur.width * step),\n height: Math.floor(cur.height * step),\n };\n octx.drawImage(oc, 0, 0, cur.width * mul, cur.height * mul, 0, 0, cur.width, cur.height);\n }\n\n ctx.drawImage(oc, 0, 0, cur.width, cur.height, 0, 0, canvas.width, canvas.height);\n } else {\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n }\n\n return new Promise((resolve) => {\n canvas.toBlob(resolve, outputType);\n });\n}\n","import { useMemo } from '../lib/teact/teact';\n\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser, ApiVoice,\n} from '../api/types';\n\nimport useMedia from './useMedia';\nimport { useAsync } from './useAsync';\nimport {\n getAudioHasCover, getChatAvatarHash, getChatTitle, getMessageContent, getMessageMediaHash, getSenderTitle,\n} from '../modules/helpers';\nimport { getTranslation } from '../util/langProvider';\nimport { buildMediaMetadata } from '../util/mediaSession';\nimport { scaleImage, resizeImage } from '../util/imageResize';\nimport { AVATAR_FULL_DIMENSIONS } from '../components/common/helpers/mediaDimensions';\n\nimport telegramLogoPath from '../assets/telegram-logo-filled.svg';\n\nconst LOGO_DIMENSIONS = { width: 200, height: 200 };\nconst MINIMAL_SIZE = 115; // spec says 100, but on Chrome 93 it's not showing\n\n// TODO Add support for video in future\nconst useMessageMediaMetadata = (\n message: ApiMessage, sender?: ApiUser | ApiChat, chat?: ApiChat,\n): MediaMetadata | undefined => {\n const { audio, voice } = getMessageContent(message);\n const title = audio ? (audio.title || audio.fileName) : voice ? 'Voice message' : '';\n const artist = (audio && audio.performer) || (sender && getSenderTitle(getTranslation, sender));\n const album = (chat && getChatTitle(getTranslation, chat)) || 'Telegram';\n\n const audioCoverHash = (audio && getAudioHasCover(audio) && getMessageMediaHash(message, 'pictogram'));\n const avatarHash = sender && getChatAvatarHash(sender, 'big');\n const hash = (audio && audioCoverHash) || (voice && avatarHash);\n const media = useMedia(hash);\n\n const size = useMemo(() => {\n return getCoverSize(audio, voice, media);\n }, [audio, media, voice]);\n const { result: url } = useAsync(() => makeGoodArtwork(media, size), [media, size], telegramLogoPath);\n return useMemo(() => {\n return buildMediaMetadata({\n title,\n artist,\n album,\n artwork: [{ src: url }],\n });\n }, [album, artist, title, url]);\n};\n\nfunction makeGoodArtwork(url?: string, size?: { width: number; height: number }): Promise {\n if (!url) return Promise.resolve(telegramLogoPath);\n if (!size) return resizeImage(url, MINIMAL_SIZE, MINIMAL_SIZE);\n const min = Math.min(size.width, size.height);\n if (min < MINIMAL_SIZE) {\n const ratio = MINIMAL_SIZE / min;\n return scaleImage(url, ratio);\n }\n return Promise.resolve(url);\n}\n\nfunction getCoverSize(audio?: ApiAudio, voice?: ApiVoice, url?: string) {\n if (!url) return LOGO_DIMENSIONS;\n if (audio) {\n if (!audio.thumbnailSizes || audio.thumbnailSizes.length === 0) return undefined;\n const preferred = audio.thumbnailSizes.find((size) => size.type === 'm');\n return preferred || audio.thumbnailSizes[0]; // Sometimes `m` is not present\n }\n\n if (voice) {\n return AVATAR_FULL_DIMENSIONS;\n }\n\n return undefined;\n}\n\nexport default useMessageMediaMetadata;\n","import { useEffect, useState } from '../lib/teact/teact';\n\nexport const useAsync = (fn: () => Promise, deps: any[], defaultValue?: T) => {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState();\n const [result, setResult] = useState(defaultValue);\n useEffect(() => {\n setIsLoading(true);\n let wasCancelled = false;\n fn().then((res) => {\n if (wasCancelled) return;\n setIsLoading(false);\n setResult(res);\n }, (err) => {\n if (wasCancelled) return;\n setIsLoading(false);\n setError(err);\n });\n return () => {\n wasCancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n return { isLoading, error, result };\n};\n","import React, {\n FC, useCallback, useEffect, useMemo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { AudioOrigin } from '../../types';\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser,\n} from '../../api/types';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\n\nimport * as mediaLoader from '../../util/mediaLoader';\nimport {\n getMediaDuration, getMessageContent, getMessageMediaHash, getSenderTitle, isMessageLocal,\n} from '../../modules/helpers';\nimport { selectChat, selectSender } from '../../modules/selectors';\nimport buildClassName from '../../util/buildClassName';\nimport { makeTrackId } from '../../util/audioPlayer';\nimport { clearMediaSession } from '../../util/mediaSession';\nimport windowSize from '../../util/windowSize';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useLang from '../../hooks/useLang';\nimport useMessageMediaMetadata from '../../hooks/useMessageMediaMetadata';\nimport renderText from '../common/helpers/renderText';\n\nimport RippleEffect from '../ui/RippleEffect';\nimport Button from '../ui/Button';\nimport RangeSlider from '../ui/RangeSlider';\n\nimport './AudioPlayer.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n origin?: AudioOrigin;\n className?: string;\n noUi?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiChat | ApiUser;\n chat?: ApiChat;\n volume: number;\n playbackRate: number;\n isMuted: boolean;\n};\n\nconst FAST_PLAYBACK_RATE = 1.8;\n\nconst AudioPlayer: FC = ({\n message,\n className,\n noUi,\n sender,\n chat,\n volume,\n playbackRate,\n isMuted,\n}) => {\n const {\n setAudioPlayerVolume,\n setAudioPlayerPlaybackRate,\n setAudioPlayerMuted,\n focusMessage,\n closeAudioPlayer,\n } = getDispatch();\n\n const lang = useLang();\n const { audio, voice, video } = getMessageContent(message);\n const isVoice = Boolean(voice || video);\n const senderName = sender ? getSenderTitle(lang, sender) : undefined;\n const mediaData = mediaLoader.getFromMemory(getMessageMediaHash(message, 'inline')!) as (string | undefined);\n const mediaMetadata = useMessageMediaMetadata(message, sender, chat);\n\n const {\n playPause,\n stop,\n isPlaying,\n requestNextTrack,\n requestPreviousTrack,\n isFirst,\n isLast,\n setVolume,\n toggleMuted,\n setPlaybackRate,\n } = useAudioPlayer(\n makeTrackId(message),\n getMediaDuration(message)!,\n isVoice ? 'voice' : 'audio',\n mediaData,\n undefined,\n mediaMetadata,\n undefined,\n true,\n undefined,\n undefined,\n isMessageLocal(message),\n true,\n );\n\n // Prevent refresh by accidentally rotating device when listening to a voice message\n const isVoicePlaying = isVoice && isPlaying;\n useEffect(() => {\n if (!isVoicePlaying) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [isVoicePlaying]);\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }, [focusMessage, message.chatId, message.id]);\n\n const handleClose = useCallback(() => {\n if (isPlaying) {\n playPause();\n }\n closeAudioPlayer();\n clearMediaSession();\n stop();\n }, [closeAudioPlayer, isPlaying, playPause, stop]);\n\n const handleVolumeChange = useCallback((value: number) => {\n setAudioPlayerVolume({ volume: value / 100 });\n setAudioPlayerMuted({ isMuted: false });\n\n setVolume(value / 100);\n }, [setAudioPlayerMuted, setAudioPlayerVolume, setVolume]);\n\n const handleVolumeClick = useCallback(() => {\n if (IS_TOUCH_ENV && !IS_IOS) return;\n toggleMuted();\n setAudioPlayerMuted({ isMuted: !isMuted });\n }, [isMuted, setAudioPlayerMuted, toggleMuted]);\n\n const handlePlaybackClick = useCallback(() => {\n if (playbackRate === 1) {\n setPlaybackRate(FAST_PLAYBACK_RATE);\n setAudioPlayerPlaybackRate({ playbackRate: FAST_PLAYBACK_RATE });\n } else {\n setPlaybackRate(1);\n setAudioPlayerPlaybackRate({ playbackRate: 1 });\n }\n }, [playbackRate, setAudioPlayerPlaybackRate, setPlaybackRate]);\n\n const volumeIcon = useMemo(() => {\n if (volume === 0 || isMuted) return 'icon-muted';\n if (volume < 0.3) return 'icon-volume-1';\n if (volume < 0.6) return 'icon-volume-2';\n return 'icon-volume-3';\n }, [volume, isMuted]);\n\n if (noUi) {\n return undefined;\n }\n\n return (\n
\n \n \n \n \n \n \n \n \n \n \n\n
\n {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)}\n \n
\n\n \n \n {!IS_IOS && (\n <>\n
\n
\n \n
\n \n )}\n \n\n {isVoice && (\n \n \n \n )}\n\n \n \n \n
\n );\n};\n\nfunction renderAudio(audio: ApiAudio) {\n const { title, performer, fileName } = audio;\n\n return (\n <>\n
{renderText(title || fileName)}
\n {performer && (\n
{renderText(performer)}
\n )}\n \n );\n}\n\nfunction renderVoice(subtitle: string, senderName?: string) {\n return (\n <>\n
{senderName && renderText(senderName)}
\n
{subtitle}
\n \n );\n}\n\nexport default withGlobal(\n (global, { message }): StateProps => {\n const sender = selectSender(global, message);\n const chat = selectChat(global, message.chatId);\n const { volume, playbackRate, isMuted } = global.audioPlayer;\n\n return {\n sender,\n chat,\n volume,\n playbackRate,\n isMuted,\n };\n },\n)(AudioPlayer);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types';\n\nimport { selectChatGroupCall } from '../../../modules/selectors/calls';\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\n\nimport './GroupCallTopPane.scss';\n\ntype OwnProps = {\n chatId: string;\n hasPinnedOffset: boolean;\n};\n\ntype StateProps = {\n groupCall?: ApiGroupCall;\n isActive: boolean;\n usersById: Record;\n chatsById: Record;\n};\n\nconst GroupCallTopPane: FC = ({\n chatId,\n isActive,\n groupCall,\n hasPinnedOffset,\n usersById,\n chatsById,\n}) => {\n const {\n joinGroupCall,\n subscribeToGroupCallUpdates,\n } = getDispatch();\n\n const lang = useLang();\n\n const handleJoinGroupCall = useCallback(() => {\n joinGroupCall({\n chatId,\n });\n }, [joinGroupCall, chatId]);\n\n const participants = groupCall?.participants;\n\n const fetchedParticipants = useMemo(() => {\n if (participants) {\n return Object.values(participants).filter((_, i) => i < 3).map(({ id, isUser }) => {\n if (isUser) {\n if (!usersById[id]) {\n return undefined;\n }\n return { user: usersById[id] };\n } else {\n if (!chatsById[id]) {\n return undefined;\n }\n return { chat: chatsById[id] };\n }\n }).filter(Boolean);\n } else return [];\n }, [chatsById, participants, usersById]);\n\n useEffect(() => {\n if (!groupCall?.id) return undefined;\n if (!isActive && groupCall.isLoaded) return undefined;\n\n subscribeToGroupCallUpdates({\n id: groupCall.id,\n subscribed: true,\n });\n\n return () => {\n subscribeToGroupCallUpdates({\n id: groupCall.id,\n subscribed: false,\n });\n };\n }, [groupCall?.id, groupCall?.isLoaded, isActive, subscribeToGroupCallUpdates]);\n\n if (!groupCall) return undefined;\n\n return (\n \n
\n {lang('VoipGroupVoiceChat')}\n {lang('Participants', groupCall.participantsCount || 0, 'i')}\n
\n
\n {fetchedParticipants.map((p) => {\n if (!p) return undefined;\n if (p.user) {\n return ;\n } else {\n return ;\n }\n })}\n
\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }) => {\n const chat = selectChat(global, chatId)!;\n const groupCall = selectChatGroupCall(global, chatId);\n return {\n groupCall,\n usersById: global.users.byId,\n chatsById: global.chats.byId,\n activeGroupCallId: global.groupCalls.activeGroupCallId,\n isActive: ((!groupCall ? (chat && chat.isCallNotEmpty && chat.isCallActive)\n : (groupCall.participantsCount > 0 && groupCall.isLoaded)))\n && (global.groupCalls.activeGroupCallId !== groupCall?.id),\n };\n },\n)(GroupCallTopPane));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\nimport cycleRestrict from '../../util/cycleRestrict';\n\nimport { GlobalState, MessageListType } from '../../global/types';\nimport {\n ApiChat, ApiMessage, ApiTypingStatus, ApiUser, MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport {\n EDITABLE_INPUT_ID,\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n} from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n getChatTitle, getMessageKey, getSenderTitle, isUserId,\n} from '../../modules/helpers';\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectForwardedSender,\n selectIsChatWithBot,\n selectIsChatWithSelf,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectPinnedIds,\n selectScheduledIds,\n selectThreadInfo,\n selectThreadTopMessageId,\n} from '../../modules/selectors';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport useConnectionStatus from '../../hooks/useConnectionStatus';\n\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\nimport UnreadCounter from '../common/UnreadCounter';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport HeaderActions from './HeaderActions';\nimport HeaderPinnedMessage from './HeaderPinnedMessage';\nimport AudioPlayer from './AudioPlayer';\nimport GroupCallTopPane from '../calls/group/GroupCallTopPane';\n\nimport './MiddleHeader.scss';\n\nconst ANIMATION_DURATION = 350;\nconst BACK_BUTTON_INACTIVE_TIME = 450;\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n messageListType: MessageListType;\n isReady?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n pinnedMessageIds?: number[] | number;\n messagesById?: Record;\n canUnpin?: boolean;\n topMessageSender?: ApiChat | ApiUser;\n typingStatus?: ApiTypingStatus;\n isSelectModeActive?: boolean;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n audioMessage?: ApiMessage;\n messagesCount?: number;\n isChatWithSelf?: boolean;\n isChatWithBot?: boolean;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n connectionState?: GlobalState['connectionState'];\n isSyncing?: GlobalState['isSyncing'];\n};\n\nconst MiddleHeader: FC = ({\n chatId,\n threadId,\n messageListType,\n isReady,\n pinnedMessageIds,\n messagesById,\n canUnpin,\n topMessageSender,\n typingStatus,\n isSelectModeActive,\n isLeftColumnShown,\n isRightColumnShown,\n audioMessage,\n chat,\n messagesCount,\n isChatWithSelf,\n isChatWithBot,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n connectionState,\n isSyncing,\n}) => {\n const {\n openChatWithInfo,\n pinMessage,\n focusMessage,\n openChat,\n openPreviousChat,\n loadPinnedMessages,\n toggleLeftColumn,\n exitMessageSelectMode,\n } = getDispatch();\n\n const lang = useLang();\n const isBackButtonActive = useRef(true);\n\n const [pinnedMessageIndex, setPinnedMessageIndex] = useState(0);\n const pinnedMessageId = Array.isArray(pinnedMessageIds) ? pinnedMessageIds[pinnedMessageIndex] : pinnedMessageIds;\n const pinnedMessage = messagesById && pinnedMessageId ? messagesById[pinnedMessageId] : undefined;\n const pinnedMessagesCount = Array.isArray(pinnedMessageIds)\n ? pinnedMessageIds.length : (pinnedMessageIds ? 1 : undefined);\n const chatTitleLength = chat && getChatTitle(lang, chat).length;\n const topMessageTitle = topMessageSender ? getSenderTitle(lang, topMessageSender) : undefined;\n\n useEffect(() => {\n if (threadId === MAIN_THREAD_ID && lastSyncTime && isReady) {\n loadPinnedMessages({ chatId });\n }\n }, [chatId, loadPinnedMessages, lastSyncTime, threadId, isReady]);\n\n // Reset pinned index when switching chats and pinning/unpinning\n useEffect(() => {\n setPinnedMessageIndex(0);\n }, [pinnedMessageIds]);\n\n useEnsureMessage(chatId, pinnedMessageId, pinnedMessage);\n\n const { width: windowWidth } = useWindowSize();\n\n const isLeftColumnHideable = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN;\n const shouldShowCloseButton = IS_TABLET_COLUMN_LAYOUT && isLeftColumnShown;\n\n // eslint-disable-next-line no-null/no-null\n const componentRef = useRef(null);\n const shouldAnimateTools = useRef(true);\n\n const handleHeaderClick = useCallback(() => {\n openChatWithInfo({ id: chatId });\n }, [openChatWithInfo, chatId]);\n\n const handleUnpinMessage = useCallback((messageId: number) => {\n pinMessage({ chatId, messageId, isUnpin: true });\n }, [pinMessage, chatId]);\n\n const handlePinnedMessageClick = useCallback((): void => {\n if (pinnedMessage) {\n focusMessage({ chatId: pinnedMessage.chatId, threadId, messageId: pinnedMessage.id });\n\n const newIndex = cycleRestrict(pinnedMessagesCount || 1, pinnedMessageIndex + 1);\n setPinnedMessageIndex(newIndex);\n }\n }, [pinnedMessage, focusMessage, threadId, pinnedMessagesCount, pinnedMessageIndex]);\n\n const handleAllPinnedClick = useCallback(() => {\n openChat({ id: chatId, threadId: MAIN_THREAD_ID, type: 'pinned' });\n }, [openChat, chatId]);\n\n const setBackButtonActive = useCallback(() => {\n setTimeout(() => {\n isBackButtonActive.current = true;\n }, BACK_BUTTON_INACTIVE_TIME);\n }, []);\n\n const handleBackClick = useCallback((e: React.MouseEvent) => {\n if (!isBackButtonActive.current) return;\n\n // Workaround for missing UI when quickly clicking the Back button\n isBackButtonActive.current = false;\n if (IS_SINGLE_COLUMN_LAYOUT) {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID);\n if (messageInput) {\n messageInput.blur();\n }\n }\n\n if (isSelectModeActive) {\n exitMessageSelectMode();\n setBackButtonActive();\n return;\n }\n\n if (threadId === MAIN_THREAD_ID && messageListType === 'thread' && currentTransitionKey === 0) {\n if (IS_SINGLE_COLUMN_LAYOUT || shouldShowCloseButton) {\n e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets\n openChat({ id: undefined });\n } else {\n toggleLeftColumn();\n }\n\n setBackButtonActive();\n\n return;\n }\n\n openPreviousChat();\n setBackButtonActive();\n }, [\n threadId, messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton,\n openChat, toggleLeftColumn, exitMessageSelectMode, setBackButtonActive,\n ]);\n\n const canToolsCollideWithChatInfo = (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n ) || (\n windowWidth > MOBILE_SCREEN_MAX_WIDTH\n && windowWidth < MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && (!chatTitleLength || chatTitleLength > 30)\n );\n const shouldUseStackedToolsClass = canToolsCollideWithChatInfo || (\n windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n );\n\n const {\n shouldRender: shouldRenderAudioPlayer,\n transitionClassNames: audioPlayerClassNames,\n } = useShowTransition(Boolean(audioMessage));\n\n const renderingAudioMessage = useCurrentOrPrev(audioMessage, true);\n\n const {\n shouldRender: shouldRenderPinnedMessage,\n transitionClassNames: pinnedMessageClassNames,\n } = useShowTransition(Boolean(pinnedMessage));\n\n const renderingPinnedMessage = useCurrentOrPrev(pinnedMessage, true);\n const renderingPinnedMessagesCount = useCurrentOrPrev(pinnedMessagesCount, true);\n const renderingCanUnpin = useCurrentOrPrev(canUnpin, true);\n const renderingPinnedMessageTitle = useCurrentOrPrev(topMessageTitle);\n\n const canRevealTools = (shouldRenderPinnedMessage && renderingPinnedMessage)\n || (shouldRenderAudioPlayer && renderingAudioMessage);\n\n // Logic for transition to and from custom display of AudioPlayer/PinnedMessage on smaller screens\n useEffect(() => {\n const componentEl = componentRef.current;\n if (!componentEl) {\n return;\n }\n\n if (!shouldUseStackedToolsClass || !canRevealTools) {\n componentEl.classList.remove('tools-stacked', 'animated');\n shouldAnimateTools.current = true;\n return;\n }\n\n if (isRightColumnShown || canToolsCollideWithChatInfo) {\n if (shouldAnimateTools.current) {\n componentEl.classList.add('tools-stacked', 'animated');\n shouldAnimateTools.current = false;\n }\n\n // Remove animation class to prevent it messing up the show transitions\n setTimeout(() => {\n componentEl.classList.remove('animated');\n }, ANIMATION_DURATION);\n } else {\n componentEl.classList.remove('tools-stacked');\n shouldAnimateTools.current = true;\n }\n }, [shouldUseStackedToolsClass, canRevealTools, canToolsCollideWithChatInfo, isRightColumnShown]);\n\n const { connectionStatusText } = useConnectionStatus(lang, connectionState, isSyncing, true);\n\n function renderInfo() {\n return (\n messageListType === 'thread' && threadId === MAIN_THREAD_ID ? (\n renderMainThreadInfo()\n ) : messageListType === 'thread' ? (\n <>\n {renderBackButton()}\n

\n {lang('CommentsCount', messagesCount, 'i')}\n

\n \n ) : messageListType === 'pinned' ? (\n <>\n {renderBackButton()}\n

\n {lang('PinnedMessagesCount', messagesCount, 'i')}\n

\n \n ) : messageListType === 'scheduled' ? (\n <>\n {renderBackButton()}\n

\n {isChatWithSelf ? lang('Reminders') : lang('messages', messagesCount, 'i')}\n

\n \n ) : undefined\n );\n }\n\n function renderMainThreadInfo() {\n return (\n <>\n {(isLeftColumnHideable || currentTransitionKey > 0) && renderBackButton(shouldShowCloseButton, true)}\n
\n {isUserId(chatId) ? (\n \n ) : (\n \n )}\n
\n \n );\n }\n\n function renderBackButton(asClose = false, withUnreadCounter = false) {\n return (\n
\n \n
\n \n {withUnreadCounter && }\n
\n );\n }\n\n const isAudioPlayerRendered = Boolean(shouldRenderAudioPlayer && renderingAudioMessage);\n\n return (\n
\n \n {renderInfo()}\n \n\n \n\n {shouldRenderPinnedMessage && renderingPinnedMessage && (\n \n )}\n
\n {isAudioPlayerRendered && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const { isLeftColumnShown, lastSyncTime, shouldSkipHistoryAnimations } = global;\n const chat = selectChat(global, chatId);\n\n const { typingStatus } = chat || {};\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n let messagesCount: number | undefined;\n if (messageListType === 'pinned') {\n const pinnedIds = selectPinnedIds(global, chatId);\n messagesCount = pinnedIds?.length;\n } else if (messageListType === 'scheduled') {\n const scheduledIds = selectScheduledIds(global, chatId);\n messagesCount = scheduledIds?.length;\n } else if (messageListType === 'thread' && threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n messagesCount = threadInfo?.messagesCount || 0;\n }\n\n const state: StateProps = {\n typingStatus,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n audioMessage,\n chat,\n messagesCount,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isChatWithBot: chat && selectIsChatWithBot(global, chat),\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n connectionState: global.connectionState,\n isSyncing: global.isSyncing,\n };\n\n const messagesById = selectChatMessages(global, chatId);\n if (messageListType !== 'thread' || !messagesById) {\n return state;\n }\n\n Object.assign(state, { messagesById });\n\n if (threadId !== MAIN_THREAD_ID) {\n const pinnedMessageId = selectThreadTopMessageId(global, chatId, threadId);\n const message = pinnedMessageId ? selectChatMessage(global, chatId, pinnedMessageId) : undefined;\n const topMessageSender = message ? selectForwardedSender(global, message) : undefined;\n\n return {\n ...state,\n pinnedMessageIds: pinnedMessageId,\n canUnpin: false,\n topMessageSender,\n };\n }\n\n const pinnedMessageIds = selectPinnedIds(global, chatId);\n if (pinnedMessageIds?.length) {\n const firstPinnedMessage = messagesById[pinnedMessageIds[0]];\n const {\n canUnpin,\n } = (firstPinnedMessage && selectAllowedMessageActions(global, firstPinnedMessage, threadId)) || {};\n\n return {\n ...state,\n pinnedMessageIds,\n canUnpin,\n };\n }\n\n return state;\n },\n)(MiddleHeader));\n","import { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\n\nimport { getDayStart } from '../../../util/dateFormat';\nimport { isActionMessage } from '../../../modules/helpers';\n\ntype SenderGroup = (ApiMessage | IAlbum)[];\n\nconst GROUP_INTERVAL_SECONDS = 600; // 10 minutes\n\nexport type MessageDateGroup = {\n originalDate: number;\n datetime: number;\n senderGroups: SenderGroup[];\n};\n\nexport function isAlbum(messageOrAlbum: ApiMessage | IAlbum): messageOrAlbum is IAlbum {\n return 'albumId' in messageOrAlbum;\n}\n\nexport function groupMessages(messages: ApiMessage[], firstUnreadId?: number) {\n let currentSenderGroup: SenderGroup = [];\n let currentDateGroup = {\n originalDate: messages[0].date,\n datetime: Number(getDayStart(messages[0].date * 1000)),\n senderGroups: [currentSenderGroup],\n };\n let currentAlbum: IAlbum | undefined;\n\n const dateGroups: MessageDateGroup[] = [currentDateGroup];\n\n messages.forEach((message, index) => {\n if (message.isInAlbum) {\n if (!currentAlbum) {\n currentAlbum = {\n albumId: message.groupedId!,\n messages: [message],\n mainMessage: message,\n };\n } else {\n currentAlbum.messages.push(message);\n if (message.content.text) {\n currentAlbum.mainMessage = message;\n }\n }\n } else {\n currentSenderGroup.push(message);\n }\n\n const nextMessage = messages[index + 1];\n\n if (\n currentAlbum\n && (!nextMessage || !nextMessage.groupedId || nextMessage.groupedId !== currentAlbum.albumId)\n ) {\n currentSenderGroup.push(currentAlbum);\n currentAlbum = undefined;\n }\n if (nextMessage) {\n const nextMessageDayStartsAt = Number(getDayStart(nextMessage.date * 1000));\n if (currentDateGroup.datetime !== nextMessageDayStartsAt) {\n currentDateGroup = {\n originalDate: nextMessage.date,\n datetime: nextMessageDayStartsAt,\n senderGroups: [],\n };\n dateGroups.push(currentDateGroup);\n\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n } else if (\n nextMessage.id === firstUnreadId\n || message.senderId !== nextMessage.senderId\n || message.isOutgoing !== nextMessage.isOutgoing\n || isActionMessage(message)\n || isActionMessage(nextMessage)\n || (\n message.forwardInfo && nextMessage.forwardInfo\n && (\n message.forwardInfo.senderUserId !== nextMessage.forwardInfo.senderUserId\n || message.forwardInfo.fromChatId !== nextMessage.forwardInfo.fromChatId\n || message.forwardInfo.hiddenUserName !== nextMessage.forwardInfo.hiddenUserName\n )\n )\n || message.inlineButtons\n || nextMessage.inlineButtons\n || (nextMessage.date - message.date) > GROUP_INTERVAL_SECONDS\n ) {\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n }\n }\n });\n\n return dateGroups;\n}\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { MessageListType } from '../../../global/types';\n\nimport { IS_ANDROID, IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useBackgroundMode from '../../../hooks/useBackgroundMode';\n\nconst INTERSECTION_THROTTLE_FOR_MEDIA = IS_ANDROID ? 1000 : 350;\nconst INTERSECTION_MARGIN_FOR_MEDIA = IS_SINGLE_COLUMN_LAYOUT ? 300 : 500;\nconst INTERSECTION_THROTTLE_FOR_READING = 150;\n\nexport default function useMessageObservers(\n type: MessageListType,\n containerRef: RefObject,\n memoFirstUnreadIdRef: { current: number | undefined },\n) {\n const { markMessageListRead, markMessagesRead } = getDispatch();\n\n const {\n observe: observeIntersectionForMedia,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n margin: INTERSECTION_MARGIN_FOR_MEDIA,\n });\n\n const {\n observe: observeIntersectionForReading, freeze: freezeForReading, unfreeze: unfreezeForReading,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_READING,\n }, (entries) => {\n if (type !== 'thread') {\n return;\n }\n\n let maxId = 0;\n const mentionIds: number[] = [];\n\n entries.forEach((entry) => {\n const { isIntersecting, target } = entry;\n\n if (!isIntersecting) {\n return;\n }\n\n const { dataset } = target as HTMLDivElement;\n\n const messageId = Number(dataset.lastMessageId || dataset.messageId);\n if (messageId > maxId) {\n maxId = messageId;\n }\n\n if (dataset.hasUnreadMention) {\n mentionIds.push(messageId);\n }\n });\n\n if (memoFirstUnreadIdRef.current && maxId >= memoFirstUnreadIdRef.current) {\n markMessageListRead({ maxId });\n }\n\n if (mentionIds.length) {\n markMessagesRead({ messageIds: mentionIds });\n }\n });\n\n useBackgroundMode(freezeForReading, unfreezeForReading);\n\n const { observe: observeIntersectionForAnimatedStickers } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n });\n\n return {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n };\n}\n","import { ApiMessage } from '../../../../api/types';\n\nimport { getMessageContent } from '../../../../modules/helpers';\n\nexport function isEmojiOnlyMessage(customShape?: boolean | number) {\n return typeof customShape === 'number';\n}\n\nexport function buildContentClassName(\n message: ApiMessage,\n {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments,\n hasActionButton,\n hasReactions,\n }: {\n hasReply?: boolean;\n customShape?: boolean | number;\n isLastInGroup?: boolean;\n asForwarded?: boolean;\n hasThread?: boolean;\n forceSenderName?: boolean;\n hasComments?: boolean;\n hasActionButton?: boolean;\n hasReactions?: boolean;\n } = {},\n) {\n const {\n text, photo, video, audio, voice, document, poll, webPage, contact,\n } = getMessageContent(message);\n\n const classNames = ['message-content'];\n const isMedia = photo || video;\n const isMediaWithNoText = isMedia && !text;\n const isViaBot = Boolean(message.viaBotId);\n\n if (isEmojiOnlyMessage(customShape)) {\n classNames.push(`emoji-only emoji-only-${customShape}`);\n } else if (text) {\n classNames.push('text');\n }\n\n if (hasActionButton) {\n classNames.push('has-action-button');\n }\n\n if (customShape) {\n classNames.push('custom-shape');\n if (video?.isRound) {\n classNames.push('round');\n }\n\n if (hasComments) {\n classNames.push('has-comments');\n }\n }\n if (photo || video) {\n classNames.push('media');\n } else if (audio) {\n classNames.push('audio');\n } else if (voice) {\n classNames.push('voice');\n } else if (document) {\n classNames.push('document');\n } else if (contact) {\n classNames.push('contact');\n } else if (poll) {\n classNames.push('poll');\n } else if (webPage) {\n classNames.push('web-page');\n\n if (webPage.photo || webPage.video) {\n classNames.push('media');\n }\n }\n\n if (asForwarded) {\n classNames.push('is-forwarded');\n }\n\n if (hasReply) {\n classNames.push('is-reply');\n }\n\n if (hasThread) {\n classNames.push('has-replies');\n }\n\n if (hasReactions) {\n classNames.push('has-reactions');\n }\n\n if (isViaBot) {\n classNames.push('is-via-bot');\n }\n\n if (forceSenderName) {\n classNames.push('force-sender-name');\n }\n\n if (!customShape) {\n classNames.push('has-shadow');\n\n if (isMedia && hasComments) {\n classNames.push('has-background');\n }\n\n if (hasReply || asForwarded || !isMediaWithNoText || isViaBot || forceSenderName) {\n classNames.push('has-solid-background');\n }\n\n if (isLastInGroup && (photo || !isMediaWithNoText)) {\n classNames.push('has-appendix');\n }\n }\n\n return classNames.join(' ');\n}\n","import { ApiMessage } from '../../../../api/types';\nimport { calculateInlineImageDimensions, calculateVideoDimensions } from '../../../common/helpers/mediaDimensions';\nimport {\n getMessageText,\n getMessagePhoto,\n getMessageWebPagePhoto,\n isForwardedMessage,\n isOwnMessage,\n getMessageVideo,\n} from '../../../../modules/helpers';\n\nconst MIN_MEDIA_WIDTH = 100;\nconst MIN_MEDIA_WIDTH_WITH_COMMENTS = 238;\nconst MIN_MEDIA_WIDTH_WITH_TEXT = 175;\nconst MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS = 238;\nconst MIN_MEDIA_HEIGHT = 90;\nconst SMALL_IMAGE_THRESHOLD = 12;\n\nexport function getMinMediaWidth(hasText?: boolean, hasCommentButton?: boolean) {\n return hasText\n ? (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS : MIN_MEDIA_WIDTH_WITH_TEXT)\n : (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_COMMENTS : MIN_MEDIA_WIDTH);\n}\n\nexport function calculateMediaDimensions(message: ApiMessage, noAvatars?: boolean) {\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const photo = getMessagePhoto(message) || getMessageWebPagePhoto(message);\n const video = getMessageVideo(message);\n\n const isWebPagePhoto = Boolean(getMessageWebPagePhoto(message));\n const { width, height } = photo\n ? calculateInlineImageDimensions(photo, isOwn, isForwarded, isWebPagePhoto, noAvatars)\n : calculateVideoDimensions(video!, isOwn, isForwarded, noAvatars);\n\n const hasText = Boolean(getMessageText(message));\n const minMediaWidth = getMinMediaWidth(hasText);\n\n let stretchFactor = 1;\n if (width < minMediaWidth && minMediaWidth - width < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = minMediaWidth / width;\n }\n if (height * stretchFactor < MIN_MEDIA_HEIGHT && MIN_MEDIA_HEIGHT - height * stretchFactor < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = MIN_MEDIA_HEIGHT / height;\n }\n\n const finalWidth = Math.round(width * stretchFactor);\n const finalHeight = Math.round(height * stretchFactor);\n\n return {\n width: finalWidth,\n height: finalHeight,\n isSmall: finalWidth < minMediaWidth || finalHeight < MIN_MEDIA_HEIGHT,\n };\n}\n","/* eslint-disable no-bitwise */\n// Based on\n// https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/grouped_layout.cpp\n// https://github.com/overtake/TelegramSwift/blob/master/Telegram-Mac/GroupedLayout.swift#L83\n\nimport { IAlbum } from '../../../../types';\nimport { ApiMessage, ApiDimensions } from '../../../../api/types';\n\nimport { getAvailableWidth, REM } from '../../../common/helpers/mediaDimensions';\nimport { calculateMediaDimensions } from './mediaDimensions';\n\nexport const AlbumRectPart = {\n None: 0,\n Top: 1,\n Right: 2,\n Bottom: 4,\n Left: 8,\n};\n\ntype IAttempt = {\n lineCounts: number[];\n heights: number[];\n};\nexport type IMediaDimensions = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\ntype IMediaLayout = {\n dimensions: IMediaDimensions;\n sides: number;\n};\ntype ILayoutParams = {\n ratios: number[];\n proportions: string;\n averageRatio: number;\n maxWidth: number;\n minWidth: number;\n maxHeight: number;\n spacing: number;\n};\nexport type IAlbumLayout = {\n layout: IMediaLayout[];\n containerStyle: ApiDimensions;\n};\n\nfunction getRatios(messages: ApiMessage[]) {\n return messages.map(\n (message) => {\n const dimensions = calculateMediaDimensions(message) as ApiDimensions;\n\n return dimensions.width / dimensions.height;\n },\n );\n}\n\nfunction getProportions(ratios: number[]) {\n return ratios.map((ratio) => (ratio > 1.2 ? 'w' : (ratio < 0.8 ? 'n' : 'q'))).join('');\n}\n\nfunction getAverageRatio(ratios: number[]) {\n return ratios.reduce((result, ratio) => ratio + result, 1) / ratios.length;\n}\n\nfunction accumulate(list: number[], initValue: number) {\n return list.reduce((accumulator, item) => accumulator + item, initValue);\n}\n\nfunction clamp(num: number, low: number, high: number) {\n return num < low ? low : (num > high ? high : num);\n}\n\nfunction cropRatios(ratios: number[], averageRatio: number) {\n return ratios.map((ratio) => (averageRatio > 1.1 ? clamp(ratio, 1, 2.75) : clamp(ratio, 0.6667, 1)));\n}\n\nfunction calculateContainerSize(layout: IMediaLayout[]) {\n const styles: ApiDimensions = { width: 0, height: 0 };\n layout.forEach(({\n dimensions,\n sides,\n }) => {\n if (sides & AlbumRectPart.Right) {\n styles.width = dimensions.width + dimensions.x;\n }\n if (sides & AlbumRectPart.Bottom) {\n styles.height = dimensions.height + dimensions.y;\n }\n });\n\n return styles;\n}\n\nexport function calculateAlbumLayout(\n isOwn: boolean,\n isForwarded: boolean,\n noAvatars: boolean,\n album: IAlbum,\n): IAlbumLayout {\n const spacing = 2;\n const ratios = getRatios(album.messages);\n const proportions = getProportions(ratios);\n const averageRatio = getAverageRatio(ratios);\n const albumCount = ratios.length;\n const forceCalc = ratios.some((ratio) => ratio > 2);\n const maxWidth = getAvailableWidth(isOwn, isForwarded, false, noAvatars) - (isForwarded ? 2.5 : 0) * REM;\n const maxHeight = maxWidth;\n\n let layout;\n\n const params = {\n ratios,\n proportions,\n averageRatio,\n maxWidth,\n minWidth: 100,\n maxHeight,\n spacing,\n };\n\n if (albumCount >= 5 || forceCalc) {\n layout = layoutWithComplexLayouter(params);\n } else if (albumCount === 2) {\n layout = layoutTwo(params);\n } else if (albumCount === 3) {\n layout = layoutThree(params);\n } else {\n layout = layoutFour(params);\n }\n\n return {\n layout,\n containerStyle: calculateContainerSize(layout),\n };\n}\n\nfunction layoutWithComplexLayouter({\n ratios: originalRatios,\n averageRatio,\n maxWidth,\n minWidth,\n spacing,\n maxHeight = (4 * maxWidth) / 3,\n}: ILayoutParams) {\n const ratios = cropRatios(originalRatios, averageRatio);\n const count = originalRatios.length;\n const result = new Array(count);\n const attempts: IAttempt[] = [];\n\n const multiHeight = (offset: number, attemptCount: number) => {\n const attemptRatios = ratios.slice(offset, offset + attemptCount);\n const sum = accumulate(attemptRatios, 0);\n\n return (maxWidth - (attemptCount - 1) * spacing) / sum;\n };\n\n const pushAttempt = (lineCounts: number[]) => {\n const heights: number[] = [];\n let offset = 0;\n lineCounts.forEach((currentCount) => {\n heights.push(multiHeight(offset, currentCount));\n offset += currentCount;\n });\n\n attempts.push({\n lineCounts,\n heights,\n });\n };\n\n for (let first = 1; first !== count; ++first) {\n const second = count - first;\n if (first <= 3 && second <= 3) {\n pushAttempt([first, second]);\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n const third = count - first - second;\n if (first <= 3 && second <= (averageRatio < 0.85 ? 4 : 3) && third <= 3) {\n pushAttempt([first, second, third]);\n }\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n for (let third = 1; third !== count - first - second; ++third) {\n const fourth = count - first - second - third;\n if (first <= 3 && second <= 3 && third <= 3 && fourth <= 4) {\n pushAttempt([first, second, third, fourth]);\n }\n }\n }\n }\n\n let optimalAttempt: IAttempt | undefined;\n let optimalDiff = 0;\n for (let i = 0; i < attempts.length; i++) {\n const {\n heights,\n lineCounts,\n } = attempts[i];\n const lineCount = lineCounts.length;\n const totalHeight = accumulate(heights, 0) + spacing * (lineCount - 1);\n const minLineHeight = Math.min(...heights);\n const bad1 = minLineHeight < minWidth ? 1.5 : 1;\n const bad2 = (() => {\n for (let line = 1; line !== lineCount; ++line) {\n if (lineCounts[line - 1] > lineCounts[line]) {\n return 1.5;\n }\n }\n\n return 1;\n })();\n const diff = Math.abs(totalHeight - maxHeight) * bad1 * bad2;\n\n if (!optimalAttempt || diff < optimalDiff) {\n optimalAttempt = attempts[i];\n optimalDiff = diff;\n }\n }\n\n const optimalCounts = optimalAttempt!.lineCounts;\n const optimalHeights = optimalAttempt!.heights;\n const rowCount = optimalCounts.length;\n let index = 0;\n let y = 0;\n for (let row = 0; row !== rowCount; ++row) {\n const colCount = optimalCounts[row];\n const lineHeight = optimalHeights[row];\n const height = Math.round(lineHeight);\n let x = 0;\n\n for (let col = 0; col !== colCount; ++col) {\n const sides = AlbumRectPart.None\n | (row === 0 ? AlbumRectPart.Top : AlbumRectPart.None)\n | (row === rowCount - 1 ? AlbumRectPart.Bottom : AlbumRectPart.None)\n | (col === 0 ? AlbumRectPart.Left : AlbumRectPart.None)\n | (col === colCount - 1 ? AlbumRectPart.Right : AlbumRectPart.None);\n const ratio = ratios[index];\n const width = col === colCount - 1 ? maxWidth - x : Math.round(ratio * lineHeight);\n result[index] = {\n dimensions: {\n x,\n y,\n width,\n height,\n },\n sides,\n };\n x += width + spacing;\n ++index;\n }\n y += height + spacing;\n }\n\n return result;\n}\n\nfunction layoutTwo(params: ILayoutParams) {\n const {\n ratios,\n proportions,\n averageRatio,\n } = params;\n return proportions === 'ww' && averageRatio > 1.4 && ratios[1] - ratios[0] < 0.2\n ? layoutTwoTopBottom(params)\n : proportions === 'ww' || proportions === 'qq'\n ? layoutTwoLeftRightEqual(params)\n : layoutTwoLeftRight(params);\n}\n\nfunction layoutTwoTopBottom(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const height = Math.round(Math.min(maxWidth / ratios[0], Math.min(maxWidth / ratios[1], (maxHeight - spacing) / 2)));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: height + spacing,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutTwoLeftRightEqual(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const width = (maxWidth - spacing) / 2;\n const height = Math.round(Math.min(width / ratios[0], Math.min(width / ratios[1], maxHeight)));\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: width + spacing,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutTwoLeftRight(params: ILayoutParams) {\n const {\n ratios,\n minWidth,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const minimalWidth = Math.round(1.5 * minWidth);\n const secondWidth = Math.min(\n Math.round(\n Math.max(\n 0.4 * (maxWidth - spacing),\n (maxWidth - spacing) / ratios[0] / (1 / ratios[0] + 1 / ratios[1]),\n ),\n ),\n maxWidth - spacing - minimalWidth,\n );\n const firstWidth = maxWidth - secondWidth - spacing;\n const height = Math.min(maxHeight, Math.round(Math.min(firstWidth / ratios[0], secondWidth / ratios[1])));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: firstWidth + spacing,\n y: 0,\n width: secondWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutThree(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'n'\n ? layoutThreeLeftAndOther(params)\n : layoutThreeTopAndOther(params);\n}\n\nfunction layoutThreeLeftAndOther(params: ILayoutParams) {\n const {\n maxHeight,\n spacing,\n ratios,\n maxWidth,\n minWidth,\n } = params;\n const firstHeight = maxHeight;\n const thirdHeight = Math.round(\n Math.min(\n (maxHeight - spacing) / 2,\n (ratios[1] * (maxWidth - spacing)) / (ratios[2] + ratios[1]),\n ),\n );\n const secondHeight = firstHeight - thirdHeight - spacing;\n const rightWidth = Math.max(\n minWidth,\n Math.round(\n Math.min(\n (maxWidth - spacing) / 2,\n Math.min(\n thirdHeight * ratios[2],\n secondHeight * ratios[1],\n ),\n ),\n ),\n );\n const leftWidth = Math.min(Math.round(firstHeight * ratios[0]), maxWidth - spacing - rightWidth);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: leftWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: 0,\n width: rightWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: secondHeight + spacing,\n width: rightWidth,\n height: thirdHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutThreeTopAndOther(params: ILayoutParams) {\n const {\n maxWidth,\n ratios,\n maxHeight,\n spacing,\n } = params;\n const firstWidth = maxWidth;\n const firstHeight = Math.round(Math.min(firstWidth / ratios[0], 0.66 * (maxHeight - spacing)));\n const secondWidth = (maxWidth - spacing) / 2;\n const secondHeight = Math.min(\n maxHeight - firstHeight - spacing,\n Math.round(Math.min(\n secondWidth / ratios[1],\n secondWidth / ratios[2],\n )),\n );\n const thirdWidth = firstWidth - secondWidth - spacing;\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: firstHeight + spacing,\n width: secondWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: secondWidth + spacing,\n y: firstHeight + spacing,\n width: thirdWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutFour(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'w'\n ? layoutFourTopAndOther(params)\n : layoutFourLeftAndOther(params);\n}\n\nfunction layoutFourTopAndOther({\n maxWidth,\n ratios,\n spacing,\n maxHeight,\n minWidth,\n}: ILayoutParams) {\n const w = maxWidth;\n const h0 = Math.round(Math.min(w / ratios[0], 0.66 * (maxHeight - spacing)));\n const h = Math.round((maxWidth - 2 * spacing) / (ratios[1] + ratios[2] + ratios[3]));\n const w0 = Math.max(minWidth, Math.round(Math.min(0.4 * (maxWidth - 2 * spacing), h * ratios[1])));\n const w2 = Math.round(Math.max(Math.max(minWidth, 0.33 * (maxWidth - 2 * spacing)), h * ratios[3]));\n const w1 = w - w0 - w2 - 2 * spacing;\n const h1 = Math.min(maxHeight - h0 - spacing, h);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w,\n height: h0,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: h0 + spacing,\n width: w0,\n height: h1,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing + w1 + spacing,\n y: h0 + spacing,\n width: w2,\n height: h1,\n },\n sides: AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutFourLeftAndOther({\n maxHeight,\n ratios,\n maxWidth,\n spacing,\n minWidth,\n}: ILayoutParams) {\n const h = maxHeight;\n const w0 = Math.round(Math.min(h * ratios[0], 0.6 * (maxWidth - spacing)));\n const w = Math.round((maxHeight - 2 * spacing) / (1 / ratios[1] + 1 / ratios[2] + 1 / ratios[3]));\n const h0 = Math.round(w / ratios[1]);\n const h1 = Math.round(w / ratios[2]);\n const h2 = h - h0 - h1 - 2 * spacing;\n const w1 = Math.max(minWidth, Math.min(maxWidth - w0 - spacing, w));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w0,\n height: h,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: 0,\n width: w1,\n height: h0,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + h1 + 2 * spacing,\n width: w1,\n height: h2,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet element: HTMLSpanElement | undefined;\n\nexport default function calculateAuthorWidth(text: string) {\n if (!element) {\n element = document.createElement('span');\n // eslint-disable-next-line max-len\n element.style.font = IS_IOS\n // eslint-disable-next-line max-len\n ? '400 12px system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif'\n : '400 12px \"Roboto\", -apple-system, \"Apple Color Emoji\", BlinkMacSystemFont, \"Helvetica Neue\", sans-serif';\n element.style.whiteSpace = 'nowrap';\n element.style.position = 'absolute';\n element.style.left = '-999px';\n element.style.opacity = '.01';\n document.body.appendChild(element);\n }\n\n element.innerHTML = text;\n\n return element.offsetWidth;\n}\n","import { FocusDirection } from '../../../../types';\n\nimport { useLayoutEffect } from '../../../../lib/teact/teact';\nimport fastSmoothScroll from '../../../../util/fastSmoothScroll';\n\n// This is used when the viewport was replaced.\nconst RELOCATED_FOCUS_OFFSET = 1000;\nconst FOCUS_MARGIN = 20;\n\nexport default function useFocusMessage(\n elementRef: { current: HTMLDivElement | null },\n chatId: string,\n isFocused?: boolean,\n focusDirection?: FocusDirection,\n noFocusHighlight?: boolean,\n isResizingContainer?: boolean,\n) {\n useLayoutEffect(() => {\n if (isFocused && elementRef.current) {\n const messagesContainer = elementRef.current.closest('.MessageList')!;\n\n fastSmoothScroll(\n messagesContainer,\n elementRef.current,\n // `noFocusHighlight` always called from “scroll-to-bottom” buttons\n noFocusHighlight ? 'end' : 'centerOrTop',\n FOCUS_MARGIN,\n focusDirection !== undefined ? RELOCATED_FOCUS_OFFSET : undefined,\n focusDirection,\n undefined,\n isResizingContainer,\n );\n }\n }, [elementRef, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer]);\n}\n","import { RefObject } from 'react';\nimport React, { useEffect, useRef } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../../util/environment';\nimport windowSize from '../../../../util/windowSize';\nimport { captureEvents, SwipeDirection } from '../../../../util/captureEvents';\nimport useFlag from '../../../../hooks/useFlag';\nimport { preventMessageInputBlur } from '../../helpers/preventMessageInputBlur';\nimport stopEvent from '../../../../util/stopEvent';\nimport { REM } from '../../../common/helpers/mediaDimensions';\n\nconst ANDROID_KEYBOARD_HIDE_DELAY_MS = 350;\nconst SWIPE_ANIMATION_DURATION = 150;\nconst QUICK_REACTION_DOUBLE_TAP_DELAY = 200;\nconst QUICK_REACTION_AREA_WIDTH = 3 * REM;\nconst QUICK_REACTION_AREA_HEIGHT = Number(REM);\nconst GROUP_MESSAGE_HOVER_ATTRIBUTE = 'data-is-document-group-hover';\n\nexport default function useOuterHandlers(\n selectMessage: (e?: React.MouseEvent, groupedId?: string) => void,\n containerRef: RefObject,\n messageId: number,\n isAlbum: boolean,\n isInSelectMode: boolean,\n canReply: boolean,\n isProtected: boolean,\n onContextMenu: (e: React.MouseEvent) => void,\n handleBeforeContextMenu: (e: React.MouseEvent) => void,\n chatId: string,\n isContextMenuShown: boolean,\n contentRef: RefObject,\n isOwn: boolean,\n shouldHandleMouseLeave: boolean,\n) {\n const { setReplyingToId, sendDefaultReaction } = getDispatch();\n\n const [isQuickReactionVisible, markQuickReactionVisible, unmarkQuickReactionVisible] = useFlag();\n const [isSwiped, markSwiped, unmarkSwiped] = useFlag();\n const doubleTapTimeoutRef = useRef();\n\n function handleMouseDown(e: React.MouseEvent) {\n preventMessageInputBlur(e);\n handleBeforeContextMenu(e);\n }\n\n function handleMouseMove(e: React.MouseEvent) {\n const container = contentRef.current;\n if (!container) return;\n\n const { clientX, clientY } = e;\n const {\n x, width, y, height,\n } = container.getBoundingClientRect();\n\n const isVisibleX = Math.abs((isOwn ? (clientX - x) : (x + width - clientX))) < QUICK_REACTION_AREA_WIDTH;\n const isVisibleY = Math.abs(y + height - clientY) < QUICK_REACTION_AREA_HEIGHT;\n if (isVisibleX && isVisibleY) {\n markQuickReactionVisible();\n } else {\n unmarkQuickReactionVisible();\n }\n }\n\n function handleSendQuickReaction(e: React.MouseEvent) {\n const { x, y } = e.currentTarget.getBoundingClientRect();\n sendDefaultReaction({\n chatId,\n messageId,\n x,\n y,\n });\n }\n\n function handleTap(e: React.MouseEvent) {\n if (IS_ANDROID) {\n const target = e.target as HTMLDivElement;\n if (!target.classList.contains('text-content') && !target.classList.contains('Message')) {\n return;\n }\n\n if (windowSize.getIsKeyboardVisible()) {\n setTimeout(() => {\n onContextMenu(e);\n }, ANDROID_KEYBOARD_HIDE_DELAY_MS);\n } else {\n onContextMenu(e);\n }\n }\n }\n\n function handleDoubleTap(e: React.MouseEvent) {\n const { pageX: x, pageY: y } = e;\n\n sendDefaultReaction({\n chatId,\n messageId,\n x,\n y,\n });\n }\n\n function handleClick(e: React.MouseEvent) {\n if (isInSelectMode) {\n selectMessage(e);\n return;\n }\n\n if (!IS_TOUCH_ENV) return;\n\n if (doubleTapTimeoutRef.current) {\n clearInterval(doubleTapTimeoutRef.current);\n doubleTapTimeoutRef.current = undefined;\n handleDoubleTap(e);\n return;\n }\n\n doubleTapTimeoutRef.current = setTimeout(() => {\n doubleTapTimeoutRef.current = undefined;\n handleTap(e);\n }, QUICK_REACTION_DOUBLE_TAP_DELAY);\n }\n\n function handleContextMenu(e: React.MouseEvent) {\n if (IS_ANDROID) {\n if ((e.target as HTMLElement).matches('a[href]') || isContextMenuShown) {\n return;\n }\n\n e.preventDefault();\n selectMessage();\n } else {\n onContextMenu(e);\n }\n }\n\n function handleContainerDoubleClick() {\n if (IS_TOUCH_ENV) return;\n\n setReplyingToId({ messageId });\n }\n\n function stopPropagation(e: React.MouseEvent) {\n e.stopPropagation();\n }\n\n useEffect(() => {\n if (!IS_TOUCH_ENV || isInSelectMode || !canReply || isContextMenuShown) {\n return undefined;\n }\n\n let startedAt: number | undefined;\n return captureEvents(containerRef.current!, {\n selectorToPreventScroll: '.MessageList',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n if (!startedAt) {\n startedAt = Date.now();\n }\n\n markSwiped();\n\n return true;\n }\n\n return false;\n }),\n onRelease: () => {\n if (!startedAt) {\n return;\n }\n\n setReplyingToId({ messageId });\n\n setTimeout(unmarkSwiped, Math.max(0, SWIPE_ANIMATION_DURATION - (Date.now() - startedAt)));\n startedAt = undefined;\n },\n });\n }, [\n containerRef, isInSelectMode, messageId, setReplyingToId, markSwiped, unmarkSwiped, canReply, isContextMenuShown,\n ]);\n\n function handleMouseLeave(e: React.MouseEvent) {\n unmarkQuickReactionVisible();\n if (shouldHandleMouseLeave) handleDocumentGroupMouseLeave(e);\n }\n\n return {\n handleMouseDown: !isInSelectMode ? handleMouseDown : undefined,\n handleClick,\n handleContextMenu: !isInSelectMode ? handleContextMenu : (isProtected ? stopEvent : undefined),\n handleDoubleClick: !isInSelectMode ? handleContainerDoubleClick : undefined,\n handleContentDoubleClick: !IS_TOUCH_ENV ? stopPropagation : undefined,\n handleMouseMove,\n handleSendQuickReaction,\n handleMouseLeave,\n isSwiped,\n isQuickReactionVisible,\n handleDocumentGroupMouseEnter,\n };\n}\n\nfunction handleDocumentGroupMouseEnter(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.setAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE, '');\n }\n}\n\nfunction handleDocumentGroupMouseLeave(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.removeAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE);\n }\n}\n\nfunction getLastElementInDocumentGroup(element: Element) {\n let current: Element | null = element;\n\n do {\n current = current.nextElementSibling;\n } while (current && !current.classList.contains('last-in-document-group'));\n\n return current;\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './ContextMenuContainer';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst ContextMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const ContextMenuContainer = useModuleLoader(Bundles.Extra, 'ContextMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContextMenuContainer ? : undefined;\n};\n\nexport default memo(ContextMenuContainerAsync);\n","import React, {\n FC, memo, useEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport {\n selectUser,\n selectChatMessage,\n selectIsMessageFocused,\n selectChat,\n} from '../../modules/selectors';\nimport { isChatChannel } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport { renderActionMessageText } from '../common/helpers/renderActionMessageText';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport { ObserveFn, useOnIntersect } from '../../hooks/useIntersectionObserver';\nimport useFocusMessage from './message/hooks/useFocusMessage';\nimport useLang from '../../hooks/useLang';\n\nimport ContextMenuContainer from './message/ContextMenuContainer.async';\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n isEmbedded?: boolean;\n appearanceOrder?: number;\n isLastInList?: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n targetUserIds?: string[];\n targetMessage?: ApiMessage;\n targetChatId?: string;\n isFocused: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n};\n\nconst APPEARANCE_DELAY = 10;\n\nconst ActionMessage: FC = ({\n message,\n observeIntersection,\n isEmbedded,\n appearanceOrder = 0,\n isLastInList,\n usersById,\n senderUser,\n senderChat,\n targetUserIds,\n targetMessage,\n targetChatId,\n isFocused,\n focusDirection,\n noFocusHighlight,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n useEnsureMessage(message.chatId, message.replyToMessageId, targetMessage);\n useFocusMessage(ref, message.chatId, isFocused, focusDirection, noFocusHighlight);\n\n const lang = useLang();\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const targetUsers = useMemo(() => {\n return targetUserIds\n ? targetUserIds.map((userId) => usersById?.[userId]).filter(Boolean as any)\n : undefined;\n }, [targetUserIds, usersById]);\n\n const content = renderActionMessageText(\n lang,\n message,\n senderUser,\n senderChat,\n targetUsers,\n targetMessage,\n targetChatId,\n { asTextWithSpoilers: isEmbedded },\n );\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref);\n const isContextMenuShown = contextMenuPosition !== undefined;\n\n const handleMouseDown = (e: React.MouseEvent) => {\n preventMessageInputBlur(e);\n handleBeforeContextMenu(e);\n };\n\n if (isEmbedded) {\n return {content};\n }\n\n const className = buildClassName(\n 'ActionMessage message-list-item',\n isFocused && !noFocusHighlight && 'focused',\n isContextMenuShown && 'has-menu-open',\n isLastInList && 'last-in-list',\n transitionClassNames,\n );\n\n return (\n \n {content}\n {contextMenuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message }): StateProps => {\n const { byId: usersById } = global.users;\n const userId = message.senderId;\n const { targetUserIds, targetChatId } = message.content.action || {};\n const targetMessageId = message.replyToMessageId;\n const targetMessage = targetMessageId\n ? selectChatMessage(global, message.chatId, targetMessageId)\n : undefined;\n\n const isFocused = selectIsMessageFocused(global, message);\n const { direction: focusDirection, noHighlight: noFocusHighlight } = (isFocused && global.focusedMessage) || {};\n\n const chat = selectChat(global, message.chatId);\n const isChat = chat && (isChatChannel(chat) || userId === message.chatId);\n const senderUser = !isChat && userId ? selectUser(global, userId) : undefined;\n const senderChat = isChat ? chat : undefined;\n\n return {\n usersById,\n senderUser,\n senderChat,\n targetChatId,\n targetUserIds,\n targetMessage,\n isFocused,\n ...(isFocused && { focusDirection, noFocusHighlight }),\n };\n },\n)(ActionMessage));\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\n\nimport {\n getMessageMediaHash,\n isActionMessage,\n getSenderTitle,\n getMessageRoundVideo,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { getPictogramDimensions } from './helpers/mediaDimensions';\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\nimport useLang from '../../hooks/useLang';\nimport { renderMessageSummary } from './helpers/renderMessageText';\n\nimport ActionMessage from '../middle/ActionMessage';\n\nimport './EmbeddedMessage.scss';\n\ntype OwnProps = {\n observeIntersection?: ObserveFn;\n className?: string;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n title?: string;\n customText?: string;\n isProtected?: boolean;\n onClick: NoneToVoidFunction;\n};\n\nconst NBSP = '\\u00A0';\n\nconst EmbeddedMessage: FC = ({\n className,\n message,\n sender,\n title,\n customText,\n isProtected,\n observeIntersection,\n onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaBlobUrl = useMedia(message && getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n const pictogramId = message && `sticker-reply-thumb${message.id}`;\n const mediaThumbnail = useWebpThumbnail(message);\n const isRoundVideo = Boolean(message && getMessageRoundVideo(message));\n\n const lang = useLang();\n\n const senderTitle = sender && getSenderTitle(lang, sender);\n\n return (\n \n {mediaThumbnail && renderPictogram(pictogramId, mediaThumbnail, mediaBlobUrl, isRoundVideo, isProtected)}\n
\n

\n {!message ? (\n customText || NBSP\n ) : isActionMessage(message) ? (\n \n ) : (\n renderMessageSummary(lang, message, Boolean(mediaThumbnail))\n )}\n

\n
{renderText(senderTitle || title || NBSP)}
\n
\n \n );\n};\n\nfunction renderPictogram(\n id: string | undefined,\n thumbDataUri: string,\n blobUrl?: string,\n isRoundVideo?: boolean,\n isProtected?: boolean,\n) {\n const { width, height } = getPictogramDimensions();\n\n return (\n <>\n \n {isProtected && }\n \n );\n}\n\nexport default EmbeddedMessage;\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ActiveReaction } from '../../../global/types';\nimport { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\n\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\nimport './ReactionAnimatedEmoji.scss';\n\ntype OwnProps = {\n reaction: string;\n activeReaction?: ActiveReaction;\n isInMeta?: boolean;\n availableReactions?: ApiAvailableReaction[];\n};\n\nconst CENTER_ICON_SIZE = 30;\nconst EFFECT_SIZE = 100;\n\nconst ReactionAnimatedEmoji: FC = ({\n reaction,\n activeReaction,\n isInMeta,\n availableReactions,\n}) => {\n const { stopActiveReaction } = getDispatch();\n\n const availableReaction = availableReactions?.find((r) => r.reaction === reaction);\n const centerIconId = availableReaction?.centerIcon?.id;\n const effectId = availableReaction?.aroundAnimation?.id;\n const mediaDataCenterIcon = useMedia(`sticker${centerIconId}`, !centerIconId, ApiMediaFormat.Lottie);\n const mediaDataEffect = useMedia(`sticker${effectId}`, !effectId, ApiMediaFormat.Lottie);\n\n const shouldPlay = Boolean(activeReaction?.reaction === reaction && mediaDataCenterIcon && mediaDataEffect);\n const {\n shouldRender: shouldRenderAnimation,\n transitionClassNames: animationClassNames,\n } = useShowTransition(shouldPlay, undefined, true, 'slow');\n\n const handleEnded = useCallback(() => {\n stopActiveReaction({ messageId: activeReaction?.messageId, reaction });\n }, [activeReaction?.messageId, reaction, stopActiveReaction]);\n\n const [isAnimationLoaded, markAnimationLoaded, unmarkAnimationLoaded] = useFlag();\n const shouldRenderStatic = !shouldPlay || !isAnimationLoaded;\n\n const className = buildClassName(\n 'ReactionAnimatedEmoji',\n isInMeta && 'in-meta',\n shouldRenderAnimation && 'is-animating',\n );\n\n return (\n
\n {shouldRenderStatic && }\n {shouldRenderAnimation && (\n <>\n \n \n \n )}\n
\n );\n};\n\nexport default memo(ReactionAnimatedEmoji);\n","import React, {\n FC, memo, useMemo,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types';\nimport { ActiveReaction } from '../../../global/types';\n\nimport { formatDateTimeToString, formatTime } from '../../../util/dateFormat';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\n\nimport MessageOutgoingStatus from '../../common/MessageOutgoingStatus';\nimport ReactionAnimatedEmoji from './ReactionAnimatedEmoji';\n\nimport './MessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n reactionMessage?: ApiMessage;\n withReactions?: boolean;\n withReactionOffset?: boolean;\n outgoingStatus?: ApiMessageOutgoingStatus;\n signature?: string;\n onClick: (e: React.MouseEvent) => void;\n activeReaction?: ActiveReaction;\n availableReactions?: ApiAvailableReaction[];\n};\n\nconst MessageMeta: FC = ({\n message, outgoingStatus, signature, onClick, withReactions,\n activeReaction, withReactionOffset, availableReactions,\n reactionMessage,\n}) => {\n const lang = useLang();\n const [isActivated, markActivated] = useFlag();\n\n const reactions = withReactions && reactionMessage?.reactions?.results.filter((l) => l.count > 0);\n\n const title = useMemo(() => {\n if (!isActivated) return undefined;\n const createDateTime = formatDateTimeToString(message.date * 1000, lang.code);\n const editDateTime = message.isEdited && formatDateTimeToString(message.editDate! * 1000, lang.code);\n const forwardedDateTime = message.forwardInfo && formatDateTimeToString(message.forwardInfo.date * 1000, lang.code);\n\n let text = createDateTime;\n if (editDateTime) {\n text += '\\n';\n text += lang('lng_edited_date').replace('{date}', editDateTime);\n }\n if (forwardedDateTime) {\n text += '\\n';\n text += lang('lng_forwarded_date').replace('{date}', forwardedDateTime);\n }\n\n return text;\n }, [isActivated, lang, message]);\n\n return (\n \n {reactions && reactions.map((l) => (\n \n ))}\n {Boolean(message.views) && (\n <>\n \n {formatIntegerCompact(message.views!)}\n \n \n \n )}\n {signature && (\n {renderText(signature)}\n )}\n \n {message.isEdited && `${lang('EditedMessage')} `}\n {formatTime(lang, message.date * 1000)}\n \n {outgoingStatus && (\n \n )}\n
\n );\n};\n\nexport default memo(MessageMeta);\n","import React, { FC, useEffect, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { NO_STICKER_SET_ID } from '../../../config';\nimport { getStickerDimensions } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport useWebpThumbnail from '../../../hooks/useWebpThumbnail';\nimport safePlay from '../../../util/safePlay';\nimport { IS_WEBM_SUPPORTED } from '../../../util/environment';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\nimport './Sticker.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n observeIntersectionForPlaying: ObserveFn;\n shouldLoop?: boolean;\n lastSyncTime?: number;\n};\n\nconst Sticker: FC = ({\n message, observeIntersection, observeIntersectionForPlaying, shouldLoop, lastSyncTime,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n const sticker = message.content.sticker!;\n const { isLottie, stickerSetId, isGif } = sticker;\n const canDisplayGif = IS_WEBM_SUPPORTED;\n const isMemojiSticker = stickerSetId === NO_STICKER_SET_ID;\n\n const shouldLoad = useIsIntersecting(ref, observeIntersection);\n const shouldPlay = useIsIntersecting(ref, observeIntersectionForPlaying);\n\n const mediaHash = sticker.isPreloadedGlobally ? `sticker${sticker.id}` : getMessageMediaHash(message, 'inline')!;\n const previewMediaHash = isGif && !canDisplayGif && (\n sticker.isPreloadedGlobally ? `sticker${sticker.id}?size=m` : getMessageMediaHash(message, 'pictogram'));\n const previewBlobUrl = useMedia(previewMediaHash);\n const thumbDataUri = useWebpThumbnail(message);\n const previewUrl = previewBlobUrl || thumbDataUri;\n\n const mediaData = useMedia(\n mediaHash,\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n\n const isMediaLoaded = Boolean(mediaData);\n const [isLottieLoaded, markLottieLoaded] = useFlag(isMediaLoaded);\n const isMediaReady = isLottie ? isLottieLoaded : isMediaLoaded;\n const transitionClassNames = useMediaTransition(isMediaReady);\n\n const { width, height } = getStickerDimensions(sticker);\n const thumbClassName = buildClassName('thumbnail', !thumbDataUri && 'empty');\n\n const stickerClassName = buildClassName(\n 'Sticker media-inner',\n isMemojiSticker && 'inactive',\n );\n\n useEffect(() => {\n if (!isGif || !ref.current) return;\n const video = ref.current.querySelector('video');\n if (!video) return;\n if (shouldPlay) {\n safePlay(video);\n } else {\n video.pause();\n }\n }, [isGif, shouldPlay]);\n\n return (\n
\n {(!isMediaReady || (isGif && !canDisplayGif)) && (\n \n )}\n {!isLottie && !isGif && (\n \n )}\n {isGif && canDisplayGif && isMediaReady && (\n \n )}\n {isLottie && isMediaLoaded && (\n \n )}\n \n
\n );\n};\n\nexport default Sticker;\n","import { ApiMessage } from '../../../../api/types';\n\nimport { IS_CANVAS_FILTER_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT } from '../../../../util/environment';\nimport { getMessageMediaThumbDataUri } from '../../../../modules/helpers';\nimport useCanvasBlur from '../../../../hooks/useCanvasBlur';\n\nexport default function useBlurredMediaThumbRef(message: ApiMessage, fullMediaData?: string) {\n return useCanvasBlur(\n getMessageMediaThumbDataUri(message),\n Boolean(fullMediaData),\n IS_SINGLE_COLUMN_LAYOUT && !IS_CANVAS_FILTER_SUPPORTED,\n );\n}\n","import { ISettings } from '../../../../types';\n\nconst SELECTED_APPENDIX_COLORS = {\n dark: {\n outgoing: 'rgb(135,116,225)',\n incoming: 'rgb(33,33,33)',\n },\n light: {\n outgoing: 'rgb(238,255,222)',\n incoming: 'rgb(255,255,255)',\n },\n};\n\nexport default function getCustomAppendixBg(\n src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean, theme?: ISettings['theme'],\n) {\n if (isSelected) {\n return Promise.resolve(SELECTED_APPENDIX_COLORS[theme || 'light'][isOwn ? 'outgoing' : 'incoming']);\n }\n return getAppendixColorFromImage(src, isOwn);\n}\n\nasync function getAppendixColorFromImage(src: string, isOwn: boolean) {\n const img = new Image();\n img.src = src;\n\n if (!img.width) {\n await new Promise((resolve) => {\n img.onload = resolve;\n });\n }\n\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n canvas.width = img.width;\n canvas.height = img.height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height);\n\n const x = isOwn ? img.width - 1 : 0;\n const y = img.height - 1;\n\n const pixel = Array.from(ctx.getImageData(x, y, 1, 1).data);\n return `rgba(${pixel.join(',')})`;\n}\n","import React, {\n FC, useCallback, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ISettings } from '../../../types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport {\n getMessagePhoto,\n getMessageWebPagePhoto,\n getMessageMediaHash,\n getMediaTransferState,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport getCustomAppendixBg from './helpers/getCustomAppendixBg';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n canAutoLoad?: boolean;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n uploadProgress?: number;\n size?: 'inline' | 'pictogram';\n shouldAffectAppendix?: boolean;\n dimensions?: IMediaDimensions & { isSmall?: boolean };\n nonInteractive?: boolean;\n isDownloading: boolean;\n isProtected?: boolean;\n theme: ISettings['theme'];\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst CUSTOM_APPENDIX_ATTRIBUTE = 'data-has-custom-appendix';\n\nconst Photo: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n canAutoLoad,\n isInSelectMode,\n isSelected,\n uploadProgress,\n size = 'inline',\n dimensions,\n nonInteractive,\n shouldAffectAppendix,\n isDownloading,\n isProtected,\n theme,\n onClick,\n onCancelUpload,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const photo = (getMessagePhoto(message) || getMessageWebPagePhoto(message))!;\n const localBlobUrl = photo.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isLoadAllowed, setIsLoadAllowed] = useState(canAutoLoad);\n const shouldLoad = isLoadAllowed && isIntersecting;\n const {\n mediaData, loadProgress,\n } = useMediaWithLoadProgress(getMessageMediaHash(message, size), !shouldLoad);\n const fullMediaData = localBlobUrl || mediaData;\n const thumbRef = useBlurredMediaThumbRef(message, fullMediaData);\n\n const {\n loadProgress: downloadProgress,\n } = useMediaWithLoadProgress(getMessageMediaHash(message, 'download'), !isDownloading);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n uploadProgress || (isDownloading ? downloadProgress : loadProgress),\n shouldLoad && !fullMediaData,\n );\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n\n const transitionClassNames = useMediaTransition(fullMediaData);\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasLoadDisabled, 'slow');\n const {\n shouldRender: shouldRenderDownloadButton,\n transitionClassNames: downloadButtonClassNames,\n } = useShowTransition(!fullMediaData && !isLoadAllowed);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n } else if (onClick) {\n onClick(message.id);\n }\n }, [fullMediaData, isUploading, message, onCancelUpload, onClick]);\n\n const isOwn = isOwnMessage(message);\n useLayoutEffect(() => {\n if (!shouldAffectAppendix) {\n return;\n }\n\n const contentEl = ref.current!.closest('.message-content')!;\n\n if (fullMediaData) {\n getCustomAppendixBg(fullMediaData, isOwn, isInSelectMode, isSelected, theme).then((appendixBg) => {\n contentEl.style.setProperty('--appendix-bg', appendixBg);\n contentEl.setAttribute(CUSTOM_APPENDIX_ATTRIBUTE, '');\n });\n } else {\n contentEl.classList.add('has-appendix-thumb');\n }\n }, [fullMediaData, isOwn, shouldAffectAppendix, isInSelectMode, isSelected, theme]);\n\n const { width, height, isSmall } = dimensions || calculateMediaDimensions(message, noAvatars);\n\n const className = buildClassName(\n 'media-inner',\n !isUploading && !nonInteractive && 'interactive',\n isSmall && 'small-image',\n width === height && 'square-image',\n );\n\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n \n \n {isProtected && }\n {shouldRenderSpinner && !shouldRenderDownloadButton && (\n
\n \n
\n )}\n {shouldRenderDownloadButton && }\n {isTransferring && (\n {Math.round(transferProgress * 100)}%\n )}\n \n );\n};\n\nexport default Photo;\n","import { useCallback, useRef } from '../../../../lib/teact/teact';\n\nimport { fastRaf } from '../../../../util/schedulers';\nimport safePlay from '../../../../util/safePlay';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useHeavyAnimationCheck from '../../../../hooks/useHeavyAnimationCheck';\n\nexport default function useVideoAutoPause(playerRef: { current: HTMLVideoElement | null }, canPlay: boolean) {\n const wasPlaying = useRef(playerRef.current?.paused);\n const canPlayRef = useRef();\n canPlayRef.current = canPlay;\n\n const freezePlaying = useCallback(() => {\n if (!playerRef.current) {\n return;\n }\n\n wasPlaying.current = !playerRef.current.paused;\n\n if (wasPlaying.current) {\n playerRef.current.pause();\n }\n }, [playerRef]);\n\n const unfreezePlaying = useCallback(() => {\n if (\n playerRef.current && wasPlaying.current && canPlayRef.current\n // At this point HTMLVideoElement can be unmounted from the DOM\n && document.body.contains(playerRef.current)\n ) {\n safePlay(playerRef.current);\n }\n }, [playerRef]);\n\n const unfreezePlayingOnRaf = useCallback(() => {\n fastRaf(unfreezePlaying);\n }, [unfreezePlaying]);\n\n useBackgroundMode(freezePlaying, unfreezePlayingOnRaf);\n useHeavyAnimationCheck(freezePlaying, unfreezePlaying);\n}\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat, ApiMessage } from '../../../api/types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { calculateVideoDimensions } from '../../common/helpers/mediaDimensions';\nimport {\n getMediaTransferState,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageVideo,\n getMessageWebPageVideo,\n isForwardedMessage,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport useVideoAutoPause from './hooks/useVideoAutoPause';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection: ObserveFn;\n noAvatars?: boolean;\n canAutoLoad?: boolean;\n canAutoPlay?: boolean;\n uploadProgress?: number;\n dimensions?: IMediaDimensions;\n lastSyncTime?: number;\n isDownloading: boolean;\n isProtected?: boolean;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst Video: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n canAutoLoad,\n canAutoPlay,\n uploadProgress,\n lastSyncTime,\n dimensions,\n onClick,\n onCancelUpload,\n isDownloading,\n isProtected,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const video = (getMessageVideo(message) || getMessageWebPageVideo(message))!;\n const localBlobUrl = video.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isLoadAllowed, setIsLoadAllowed] = useState(canAutoLoad);\n const shouldLoad = Boolean(isLoadAllowed && isIntersecting && lastSyncTime);\n const [isPlayAllowed, setIsPlayAllowed] = useState(canAutoPlay);\n\n const previewBlobUrl = useMedia(\n getMessageMediaHash(message, 'pictogram'),\n !(isIntersecting && lastSyncTime),\n getMessageMediaFormat(message, 'pictogram'),\n lastSyncTime,\n );\n const previewClassNames = useMediaTransition(previewBlobUrl);\n\n const { mediaData, loadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const fullMediaData = localBlobUrl || mediaData;\n const isInline = Boolean(isIntersecting && fullMediaData);\n // Thumbnail is always rendered so we can only disable blur if we have preview\n const thumbRef = useBlurredMediaThumbRef(message, previewBlobUrl);\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'download'),\n !isDownloading,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n\n const { isBuffered, bufferingHandlers } = useBuffering(!canAutoLoad);\n const { isUploading, isTransferring, transferProgress } = getMediaTransferState(\n message,\n uploadProgress || (isDownloading ? downloadProgress : loadProgress),\n (shouldLoad && !isBuffered) || isDownloading,\n );\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasLoadDisabled);\n const {\n shouldRender: shouldRenderPlayButton,\n transitionClassNames: playButtonClassNames,\n } = useShowTransition(isLoadAllowed && !isPlayAllowed && !shouldRenderSpinner);\n\n const [playProgress, setPlayProgress] = useState(0);\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setPlayProgress(Math.max(0, e.currentTarget.currentTime - 1));\n }, []);\n\n const duration = (videoRef.current?.duration) || video.duration || 0;\n\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const { width, height } = dimensions || calculateVideoDimensions(video, isOwn, isForwarded, noAvatars);\n\n useVideoAutoPause(videoRef, isInline);\n useVideoCleanup(videoRef, [isInline]);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (isDownloading) {\n getDispatch().cancelMessageMediaDownload({ message });\n } else if (!fullMediaData) {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n } else if (fullMediaData && !isPlayAllowed) {\n setIsPlayAllowed(true);\n videoRef.current!.play();\n } else if (onClick) {\n onClick(message.id);\n }\n }, [isUploading, isDownloading, fullMediaData, isPlayAllowed, onClick, onCancelUpload, message]);\n\n const className = buildClassName('media-inner dark', !isUploading && 'interactive');\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n \n \n {isInline && (\n \n \n \n )}\n {isProtected && }\n {shouldRenderPlayButton && }\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!isLoadAllowed && (\n \n )}\n {isTransferring ? (\n \n {(isUploading || isDownloading) ? `${Math.round(transferProgress * 100)}%` : '...'}\n \n ) : (\n
\n {video.isGif ? 'GIF' : formatMediaDuration(Math.max(duration - playProgress, 0))}\n
\n )}\n \n );\n};\n\nexport default Video;\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport buildClassName from '../../../util/buildClassName';\n\nimport Avatar from '../../common/Avatar';\n\nimport './Contact.scss';\n\ntype OwnProps = {\n contact: ApiContact;\n};\n\ntype StateProps = {\n user?: ApiUser;\n phoneCodeList: ApiCountryCode[];\n};\n\nconst Contact: FC = ({\n contact, user, phoneCodeList,\n}) => {\n const { openChat } = getDispatch();\n\n const {\n firstName,\n lastName,\n phoneNumber,\n userId,\n } = contact;\n\n const handleClick = useCallback(() => {\n openChat({ id: userId });\n }, [openChat, userId]);\n\n return (\n \n \n
\n
{firstName} {lastName}
\n
{formatPhoneNumberWithCode(phoneCodeList, phoneNumber)}
\n
\n \n );\n};\n\nexport default withGlobal(\n (global, { contact }): StateProps => {\n const { countryList: { phoneCodes: phoneCodeList } } = global;\n return {\n user: selectUser(global, contact.userId),\n phoneCodeList,\n };\n },\n)(Contact);\n","import React, {\n FC, useState, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiPollAnswer, ApiPollResult } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport renderText from '../../common/helpers/renderText';\n\nimport './PollOption.scss';\n\ntype OwnProps = {\n answer: ApiPollAnswer;\n voteResults?: ApiPollResult[];\n totalVoters?: number;\n maxVotersCount?: number;\n correctResults: string[];\n shouldAnimate: boolean;\n};\n\nconst PollOption: FC = ({\n answer,\n voteResults,\n totalVoters,\n maxVotersCount,\n correctResults,\n shouldAnimate,\n}) => {\n const result = voteResults && voteResults.find((r) => r.option === answer.option);\n const correctAnswer = correctResults.length === 0 || correctResults.indexOf(answer.option) !== -1;\n const showIcon = (correctResults.length > 0 && correctAnswer) || (result?.isChosen);\n const answerPercent = result ? getPercentage(result.votersCount, totalVoters || 0) : 0;\n const [finalPercent, setFinalPercent] = useState(shouldAnimate ? 0 : answerPercent);\n // eslint-disable-next-line no-null/no-null\n const lineRef = useRef(null);\n const lineWidth = result ? getPercentage(result.votersCount, maxVotersCount || 0) : 0;\n const isAnimationDoesNotStart = finalPercent < answerPercent;\n\n useEffect(() => {\n if (shouldAnimate) {\n setFinalPercent(answerPercent);\n }\n }, [shouldAnimate, answerPercent]);\n\n useEffect(() => {\n const lineEl = lineRef.current;\n\n if (lineEl && shouldAnimate) {\n const svgEl = lineEl.firstElementChild;\n\n const style = isAnimationDoesNotStart ? '' : 'stroke-dasharray: 100% 200%; stroke-dashoffset: -44';\n if (!svgEl) {\n lineEl.innerHTML = `\n \n \n `;\n } else {\n svgEl.setAttribute('style', style);\n }\n }\n }, [isAnimationDoesNotStart, shouldAnimate]);\n\n if (!voteResults || !result) {\n return undefined;\n }\n\n const lineStyle = `width: ${lineWidth}%; transform:scaleX(${isAnimationDoesNotStart ? 0 : 1})`;\n\n return (\n
\n
\n {answerPercent}%\n {showIcon && (\n \n \n \n )}\n
\n
\n
\n {renderText(answer.text)}\n
\n
\n
\n \n
\n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default PollOption;\n","import React, {\n FC,\n useCallback,\n useEffect,\n useState,\n memo,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiMessage, ApiPoll, ApiUser, ApiPollAnswer,\n} from '../../../api/types';\n\nimport renderText from '../../common/helpers/renderText';\nimport { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport CheckboxGroup from '../../ui/CheckboxGroup';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport Notification from '../../ui/Notification';\nimport PollOption from './PollOption';\n\nimport './Poll.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n poll: ApiPoll;\n onSendVote: (options: string[]) => void;\n};\n\ntype StateProps = {\n recentVoterIds?: number[];\n usersById: Record;\n serverTimeOffset: number;\n};\n\nconst SOLUTION_CONTAINER_ID = '#middle-column-portals';\nconst SOLUTION_DURATION = 5000;\nconst NBSP = '\\u00A0';\n\nconst Poll: FC = ({\n message,\n poll,\n recentVoterIds,\n usersById,\n onSendVote,\n serverTimeOffset,\n}) => {\n const { loadMessage, openPollResults } = getDispatch();\n\n const { id: messageId, chatId } = message;\n const { summary, results } = poll;\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [chosenOptions, setChosenOptions] = useState([]);\n const [isSolutionShown, setIsSolutionShown] = useState(false);\n const [wasSubmitted, setWasSubmitted] = useState(false);\n const [closePeriod, setClosePeriod] = useState(\n !summary.closed && summary.closeDate && summary.closeDate > 0\n ? Math.min(summary.closeDate - Math.floor(Date.now() / 1000) + serverTimeOffset, summary.closePeriod!)\n : 0,\n );\n // eslint-disable-next-line no-null/no-null\n const countdownRef = useRef(null);\n const { results: voteResults, totalVoters } = results;\n const hasVoted = voteResults && voteResults.some((r) => r.isChosen);\n const canVote = !summary.closed && !hasVoted;\n const canViewResult = !canVote && summary.isPublic && Number(results.totalVoters) > 0;\n const isMultiple = canVote && summary.multipleChoice;\n const maxVotersCount = voteResults ? Math.max(...voteResults.map((r) => r.votersCount)) : totalVoters;\n const correctResults = voteResults ? voteResults.reduce((answers: string[], r) => {\n if (r.isCorrect) {\n answers.push(r.option);\n }\n\n return answers;\n }, []) : [];\n const answers = summary.answers.map((a) => ({\n label: a.text,\n value: a.option,\n hidden: Boolean(summary.quiz && summary.closePeriod && closePeriod <= 0),\n }));\n\n useEffect(() => {\n if (\n isSubmitting\n && poll.results.results\n && poll.results.results.some((result) => result.isChosen)\n ) {\n setIsSubmitting(false);\n }\n }, [isSubmitting, poll.results.results]);\n\n useEffect(() => {\n if (closePeriod > 0) {\n setTimeout(() => setClosePeriod(closePeriod - 1), 1000);\n }\n\n const countdownEl = countdownRef.current;\n\n if (countdownEl) {\n const circumference = 6 * 2 * Math.PI;\n const svgEl = countdownEl.lastElementChild;\n const timerEl = countdownEl.firstElementChild;\n if (closePeriod <= 5) {\n countdownEl.classList.add('hurry-up');\n }\n\n if (!svgEl || !timerEl) {\n countdownEl.innerHTML = `\n ${formatMediaDuration(closePeriod)}\n \n \n `;\n } else {\n const strokeDashOffset = ((summary.closePeriod! - closePeriod) / summary.closePeriod!) * circumference;\n timerEl.textContent = formatMediaDuration(closePeriod);\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', `-${strokeDashOffset}`);\n }\n }\n }, [closePeriod, summary.closePeriod]);\n\n useEffect(() => {\n if (summary.quiz && (closePeriod <= 0 || (hasVoted && !summary.closed))) {\n loadMessage({ chatId, messageId });\n }\n }, [chatId, closePeriod, hasVoted, loadMessage, messageId, summary.closed, summary.quiz]);\n\n // If the client time is not synchronized, the poll must be updated after the closePeriod time has expired.\n useEffect(() => {\n let timer: number | undefined;\n\n if (summary.quiz && !summary.closed && summary.closePeriod && summary.closePeriod > 0) {\n timer = window.setTimeout(() => {\n loadMessage({ chatId, messageId });\n }, summary.closePeriod * 1000);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [canVote, chatId, loadMessage, messageId, summary.closePeriod, summary.closed, summary.quiz]);\n\n const recentVoters = useMemo(() => {\n return recentVoterIds ? recentVoterIds.reduce((result: ApiUser[], id) => {\n const user = usersById[id];\n if (user) {\n result.push(user);\n }\n\n return result;\n }, []) : [];\n }, [usersById, recentVoterIds]);\n\n const handleRadioChange = useCallback(\n (option: string) => {\n setChosenOptions([option]);\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote([option]);\n }, [onSendVote],\n );\n\n const handleCheckboxChange = useCallback(\n (options: string[]) => {\n setChosenOptions(options);\n }, [],\n );\n\n const handleVoteClick = useCallback(\n () => {\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote(chosenOptions);\n }, [onSendVote, chosenOptions],\n );\n\n const handleViewResultsClick = useCallback(\n () => {\n openPollResults({ chatId, messageId });\n }, [chatId, messageId, openPollResults],\n );\n\n const handleSolutionShow = useCallback(() => {\n setIsSolutionShown(true);\n }, []);\n\n const handleSolutionHide = useCallback(() => {\n setIsSolutionShown(false);\n setWasSubmitted(false);\n }, []);\n\n // Show the solution to quiz if the answer was incorrect\n useEffect(() => {\n if (wasSubmitted && hasVoted && summary.quiz && results.results && poll.results.solution) {\n const correctResult = results.results.find((r) => r.isChosen && r.isCorrect);\n if (!correctResult) {\n setIsSolutionShown(true);\n }\n }\n }, [hasVoted, wasSubmitted, results.results, summary.quiz, poll.results.solution]);\n\n const lang = useLang();\n\n function renderResultOption(answer: ApiPollAnswer) {\n return (\n \n );\n }\n\n function renderRecentVoters() {\n return (\n recentVoters.length > 0 && (\n
\n {recentVoters.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n function renderSolution() {\n return (\n isSolutionShown && poll.results.solution && (\n \n )\n );\n }\n\n return (\n
\n {renderSolution()}\n
{renderText(summary.question, ['emoji', 'br'])}
\n
\n {lang(getPollTypeString(summary))}\n {renderRecentVoters()}\n {closePeriod > 0 && canVote &&
}\n {summary.quiz && poll.results.solution && !canVote && (\n \n \n \n )}\n
\n {canVote && (\n
\n {isMultiple\n ? (\n \n )\n : (\n \n )}\n
\n )}\n {!canVote && (\n
\n {summary.answers.map(renderResultOption)}\n
\n )}\n {!canViewResult && !isMultiple && (\n
{getReadableVotersCount(lang, summary.quiz, results.totalVoters)}
\n )}\n {isMultiple && (\n \n {lang('PollSubmitVotes')}\n \n )}\n {canViewResult && (\n \n {lang('PollViewResults')}\n \n )}\n
\n );\n};\n\nfunction getPollTypeString(summary: ApiPoll['summary']) {\n // When we just created the poll, some properties don't exist.\n if (typeof summary.isPublic === 'undefined') {\n return NBSP;\n }\n\n if (summary.quiz) {\n return summary.isPublic ? 'QuizPoll' : 'AnonymousQuizPoll';\n }\n\n if (summary.closed) {\n return 'FinalResults';\n }\n\n return summary.isPublic ? 'PublicPoll' : 'AnonymousPoll';\n}\n\nfunction getReadableVotersCount(lang: LangFn, isQuiz: true | undefined, count?: number) {\n if (!count) {\n return lang(isQuiz ? 'Chat.Quiz.TotalVotesEmpty' : 'Chat.Poll.TotalVotesResultEmpty');\n }\n\n return lang(isQuiz ? 'Answer' : 'Vote', count, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { poll }) => {\n const { recentVoterIds } = poll.results;\n const { serverTimeOffset, users: { byId: usersById } } = global;\n if (!recentVoterIds || recentVoterIds.length === 0) {\n return {};\n }\n\n return {\n recentVoterIds,\n usersById,\n serverTimeOffset,\n };\n },\n)(Poll));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport { ISettings } from '../../../types';\n\nimport { getMessageWebPage } from '../../../modules/helpers';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\nimport renderText from '../../common/helpers/renderText';\nimport trimText from '../../../util/trimText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport SafeLink from '../../common/SafeLink';\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './WebPage.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n canAutoLoad?: boolean;\n canAutoPlay?: boolean;\n inPreview?: boolean;\n lastSyncTime?: number;\n isDownloading?: boolean;\n isProtected?: boolean;\n theme: ISettings['theme'];\n onMediaClick?: () => void;\n onCancelMediaTransfer?: () => void;\n};\n\nconst WebPage: FC = ({\n message,\n observeIntersection,\n noAvatars,\n canAutoLoad,\n canAutoPlay,\n inPreview,\n lastSyncTime,\n isDownloading = false,\n isProtected,\n theme,\n onMediaClick,\n onCancelMediaTransfer,\n}) => {\n const webPage = getMessageWebPage(message);\n\n let isSquarePhoto = false;\n if (webPage?.photo && !webPage.video) {\n const { width, height } = calculateMediaDimensions(message);\n isSquarePhoto = width === height;\n }\n\n const handleMediaClick = useCallback(() => {\n onMediaClick!();\n }, [onMediaClick]);\n\n if (!webPage) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n photo,\n video,\n } = webPage;\n const isMediaInteractive = (photo || video) && onMediaClick && !isSquarePhoto;\n const truncatedDescription = trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebPage',\n isSquarePhoto && 'with-square-photo',\n !photo && !video && !inPreview && 'without-media',\n video && 'with-video',\n );\n\n return (\n \n {photo && !video && (\n \n )}\n
\n \n {!inPreview && title && (\n

{renderText(title)}

\n )}\n {truncatedDescription && (\n

{renderText(truncatedDescription, ['emoji', 'br'])}

\n )}\n
\n {!inPreview && video && (\n \n )}\n
\n );\n};\n\nexport default memo(WebPage);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { getMessageInvoice } from '../../../modules/helpers';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './Invoice.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n};\n\nconst Invoice: FC = ({\n message,\n}) => {\n const lang = useLang();\n const invoice = getMessageInvoice(message);\n\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = invoice!;\n\n return (\n \n {title && (\n

{renderText(title)}

\n )}\n {text && (\n

{renderText(text, ['emoji', 'br'])}

\n )}\n
\n {photoUrl && (\n \n )}\n

\n {formatCurrency(amount, currency, lang.code)}\n {isTest && {lang('PaymentTestInvoice')}}\n

\n
\n
\n );\n};\n\nexport default memo(Invoice);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC,\n useCallback,\n useMemo,\n memo,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { OwnProps as PhotoProps } from '../Photo';\nimport { OwnProps as VideoProps } from '../Video';\n\nimport buildClassName from '../../../../util/buildClassName';\nimport {\n selectIsInSelectMode,\n selectIsMessageSelected,\n} from '../../../../modules/selectors';\n\ntype OwnProps =\n PhotoProps\n & VideoProps;\n\ntype StateProps = {\n isInSelectMode?: boolean;\n isSelected?: boolean;\n};\n\nexport default function withSelectControl(WrappedComponent: FC) {\n const ComponentWithSelectControl: FC = (props) => {\n const {\n isInSelectMode,\n isSelected,\n message,\n dimensions,\n } = props;\n const { toggleMessageSelection } = getDispatch();\n\n const handleMessageSelect = useCallback((e: ReactMouseEvent) => {\n e.stopPropagation();\n toggleMessageSelection({ messageId: message.id, withShift: e?.shiftKey });\n }, [toggleMessageSelection, message]);\n\n const newProps = useMemo(() => {\n return {\n ...props,\n isInSelectMode,\n isSelected,\n dimensions: {\n ...props.dimensions,\n x: 0,\n y: 0,\n },\n onClick: isInSelectMode ? undefined : props.onClick,\n };\n }, [props, isInSelectMode, isSelected]);\n\n return (\n \n {isInSelectMode && (\n
\n {isSelected && (\n \n )}\n
\n )}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n \n \n );\n };\n\n return memo(withGlobal(\n (global, ownProps) => {\n const { message } = ownProps;\n return {\n isInSelectMode: selectIsInSelectMode(global),\n isSelected: selectIsMessageSelected(global, message.id),\n };\n },\n )(ComponentWithSelectControl));\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum, ISettings } from '../../../types';\nimport { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout';\n\nimport { getMessageContent } from '../../../modules/helpers';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\nimport withSelectControl from './hocs/withSelectControl';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport {\n selectActiveDownloadIds,\n selectCanAutoLoadMedia,\n selectCanAutoPlayMedia,\n selectTheme,\n} from '../../../modules/selectors';\n\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './Album.scss';\n\nconst PhotoWithSelect = withSelectControl(Photo);\nconst VideoWithSelect = withSelectControl(Video);\n\ntype OwnProps = {\n album: IAlbum;\n observeIntersection: ObserveFn;\n hasCustomAppendix?: boolean;\n lastSyncTime?: number;\n isOwn: boolean;\n isProtected?: boolean;\n albumLayout: IAlbumLayout;\n onMediaClick: (messageId: number) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n uploadsById: GlobalState['fileUploads']['byMessageLocalId'];\n activeDownloadIds: number[];\n};\n\nconst Album: FC = ({\n album,\n observeIntersection,\n hasCustomAppendix,\n lastSyncTime,\n isOwn,\n isProtected,\n albumLayout,\n onMediaClick,\n uploadsById,\n activeDownloadIds,\n theme,\n}) => {\n const { cancelSendingMessage } = getDispatch();\n\n const mediaCount = album.messages.length;\n\n const handleCancelUpload = useCallback((message: ApiMessage) => {\n cancelSendingMessage({ chatId: message.chatId, messageId: message.id });\n }, [cancelSendingMessage]);\n\n function renderAlbumMessage(message: ApiMessage, index: number) {\n const { photo, video } = getMessageContent(message);\n const fileUpload = uploadsById[message.previousLocalId || message.id];\n const uploadProgress = fileUpload?.progress;\n const { dimensions, sides } = albumLayout.layout[index];\n\n // Ignoring global updates is a known drawback here\n const canAutoLoad = selectCanAutoLoadMedia(getGlobal(), message);\n const canAutoPlay = selectCanAutoPlayMedia(getGlobal(), message);\n\n if (photo) {\n const shouldAffectAppendix = hasCustomAppendix && (\n // eslint-disable-next-line no-bitwise\n (isOwn ? index === mediaCount - 1 : Boolean(sides & AlbumRectPart.Left && sides & AlbumRectPart.Bottom))\n );\n\n return (\n \n );\n } else if (video) {\n return (\n \n );\n }\n\n return undefined;\n }\n\n const { width: containerWidth, height: containerHeight } = albumLayout.containerStyle;\n\n return (\n \n {album.messages.map(renderAlbumMessage)}\n \n );\n};\n\nexport default withGlobal(\n (global, { album }): StateProps => {\n const { chatId } = album.mainMessage;\n const theme = selectTheme(global);\n const activeDownloadIds = selectActiveDownloadIds(global, chatId);\n return {\n theme,\n uploadsById: global.fileUploads.byMessageLocalId,\n activeDownloadIds,\n };\n },\n)(Album);\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat, ApiMessage } from '../../../api/types';\n\nimport { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { stopCurrentAudio } from '../../../util/audioPlayer';\nimport safePlay from '../../../util/safePlay';\nimport { fastRaf } from '../../../util/schedulers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport useVideoAutoPause from './hooks/useVideoAutoPause';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './RoundVideo.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n canAutoLoad?: boolean;\n lastSyncTime?: number;\n isDownloading?: boolean;\n};\n\nlet stopPrevious: NoneToVoidFunction;\n\nconst RoundVideo: FC = ({\n message,\n observeIntersection,\n canAutoLoad,\n lastSyncTime,\n isDownloading,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playingProgressRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playerRef = useRef(null);\n\n const video = message.content.video!;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isLoadAllowed, setIsLoadAllowed] = useState(canAutoLoad);\n const shouldLoad = Boolean(isLoadAllowed && isIntersecting && lastSyncTime);\n const { mediaData, loadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'download'),\n !isDownloading,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const thumbRef = useBlurredMediaThumbRef(message, mediaData);\n\n const { isBuffered, bufferingHandlers } = useBuffering();\n const isTransferring = (isLoadAllowed && !isBuffered) || isDownloading;\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n\n const transitionClassNames = useMediaTransition(mediaData);\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring || !isBuffered, undefined, wasLoadDisabled);\n\n const [isActivated, setIsActivated] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useEffect(() => {\n if (!isActivated) {\n return;\n }\n\n const svgCenter = ROUND_VIDEO_DIMENSIONS_PX / 2;\n const svgMargin = 6;\n const circumference = (svgCenter - svgMargin) * 2 * Math.PI;\n const strokeDashOffset = circumference - progress * circumference;\n\n const playerEl = playerRef.current!;\n const playingProgressEl = playingProgressRef.current!;\n const svgEl = playingProgressEl.firstElementChild;\n\n if (!svgEl) {\n playingProgressEl.innerHTML = `\n \n \n `;\n } else {\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, [isActivated, progress]);\n\n const shouldPlay = Boolean(mediaData && isIntersecting);\n\n const stopPlaying = useCallback(() => {\n if (!playerRef.current) {\n return;\n }\n\n setIsActivated(false);\n setProgress(0);\n safePlay(playerRef.current);\n\n fastRaf(() => {\n playingProgressRef.current!.innerHTML = '';\n });\n }, []);\n\n const capturePlaying = useCallback(() => {\n stopPrevious?.();\n stopPrevious = stopPlaying;\n }, [stopPlaying]);\n\n useEffect(() => {\n if (!playerRef.current) {\n return;\n }\n\n if (shouldPlay) {\n safePlay(playerRef.current);\n } else {\n playerRef.current.pause();\n }\n }, [shouldPlay]);\n\n useVideoAutoPause(playerRef, shouldPlay);\n useVideoCleanup(playerRef, [mediaData]);\n\n const handleClick = useCallback(() => {\n if (!mediaData) {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n\n return;\n }\n\n if (isDownloading) {\n getDispatch().cancelMessageMediaDownload({ message });\n return;\n }\n\n const playerEl = playerRef.current!;\n if (isActivated) {\n if (playerEl.paused) {\n safePlay(playerEl);\n stopCurrentAudio();\n } else {\n playerEl.pause();\n }\n } else {\n capturePlaying();\n // Pause is a workaround for iOS Safari – otherwise it stops video after several frames\n playerEl.pause();\n playerEl.currentTime = 0;\n safePlay(playerEl);\n stopCurrentAudio();\n\n setIsActivated(true);\n }\n }, [capturePlaying, isActivated, isDownloading, mediaData, message]);\n\n const handleTimeUpdate = useCallback((e: React.UIEvent) => {\n const playerEl = e.currentTarget;\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, []);\n\n const videoClassName = buildClassName('full-media', transitionClassNames);\n\n return (\n \n
\n \n
\n {mediaData && (\n
\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n \n \n
\n )}\n
\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {!mediaData && !isLoadAllowed && (\n \n )}\n
\n {isActivated ? formatMediaDuration(playerRef.current!.currentTime) : formatMediaDuration(video.duration)}\n {(!isActivated || playerRef.current!.paused) && }\n
\n
\n );\n};\n\nexport default RoundVideo;\n","import React, { FC } from '../../../lib/teact/teact';\n\nimport { ApiKeyboardButton, ApiMessage } from '../../../api/types';\n\nimport { RE_TME_LINK } from '../../../config';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './InlineButtons.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n onClick: ({ button }: { button: ApiKeyboardButton }) => void;\n};\n\nconst InlineButtons: FC = ({ message, onClick }) => {\n const lang = useLang();\n\n return (\n
\n {message.inlineButtons!.map((row) => (\n
\n {row.map((button) => (\n onClick({ button })}\n >\n {renderText(lang(button.text))}\n {button.type === 'buy' && }\n {button.type === 'url' && !button.value!.match(RE_TME_LINK) && }\n \n ))}\n
\n ))}\n
\n );\n};\n\nexport default InlineButtons;\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiThreadInfo, ApiUser,\n} from '../../../api/types';\n\nimport { isUserId } from '../../../modules/helpers';\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\n\nimport './CommentButton.scss';\n\ntype OwnProps = {\n threadInfo: ApiThreadInfo;\n disabled?: boolean;\n};\n\nconst CommentButton: FC = ({\n threadInfo,\n disabled,\n}) => {\n const { openChat } = getDispatch();\n\n const lang = useLang();\n const {\n threadId, chatId, messagesCount, lastMessageId, lastReadInboxMessageId, recentReplierIds,\n } = threadInfo;\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, threadId });\n }, [openChat, chatId, threadId]);\n\n const recentRepliers = useMemo(() => {\n if (!recentReplierIds?.length) {\n return undefined;\n }\n\n // No need for expensive global updates on chats and users, so we avoid them\n const { users: { byId: usersById }, chats: { byId: chatsById } } = getGlobal();\n\n return recentReplierIds.map((peerId) => {\n return isUserId(peerId) ? usersById[peerId] : chatsById[peerId];\n }).filter(Boolean);\n }, [recentReplierIds]);\n\n if (messagesCount === undefined) {\n return undefined;\n }\n\n function renderRecentRepliers() {\n return (\n recentRepliers && recentRepliers.length > 0 && (\n
\n {recentRepliers.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n const hasUnread = Boolean(lastReadInboxMessageId && lastMessageId && lastReadInboxMessageId < lastMessageId);\n\n return (\n \n \n {(!recentRepliers || recentRepliers.length === 0) && }\n {renderRecentRepliers()}\n
\n {messagesCount ? lang('Comments', messagesCount, 'i') : lang('LeaveAComment')}\n
\n \n \n );\n};\n\nexport default memo(CommentButton);\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiAvailableReaction, ApiMessage, ApiReactionCount, ApiUser,\n} from '../../../api/types';\nimport { ActiveReaction } from '../../../global/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\nimport ReactionAnimatedEmoji from './ReactionAnimatedEmoji';\n\nimport './Reactions.scss';\n\nconst MAX_REACTORS_AVATARS = 3;\n\nconst ReactionButton: FC<{\n reaction: ApiReactionCount;\n message: ApiMessage;\n activeReaction?: ActiveReaction;\n availableReactions?: ApiAvailableReaction[];\n}> = ({\n reaction,\n message,\n activeReaction,\n availableReactions,\n}) => {\n const { sendReaction } = getDispatch();\n\n const { recentReactions } = message.reactions!;\n\n const recentReactors = useMemo(() => {\n if (!recentReactions || reaction.count > MAX_REACTORS_AVATARS) {\n return undefined;\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return recentReactions\n .filter((recentReaction) => recentReaction.reaction === reaction.reaction)\n .map((recentReaction) => usersById[recentReaction.userId])\n .filter(Boolean) as ApiUser[];\n }, [reaction, recentReactions]);\n\n const handleClick = useCallback(() => {\n sendReaction({\n reaction: reaction.isChosen ? undefined : reaction.reaction,\n chatId: message.chatId,\n messageId: message.id,\n });\n }, [message, reaction, sendReaction]);\n\n return (\n \n \n {recentReactors?.length ? (\n
\n {recentReactors.map((user) => )}\n
\n ) : formatIntegerCompact(reaction.count)}\n \n );\n};\n\nexport default memo(ReactionButton);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMessage } from '../../../api/types';\nimport { ActiveReaction } from '../../../global/types';\n\nimport buildClassName from '../../../util/buildClassName';\n\nimport ReactionButton from './ReactionButton';\n\nimport './Reactions.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n isOutside?: boolean;\n activeReaction?: ActiveReaction;\n availableReactions?: ApiAvailableReaction[];\n metaChildren?: React.ReactNode;\n};\n\nconst Reactions: FC = ({\n message,\n isOutside,\n activeReaction,\n availableReactions,\n metaChildren,\n}) => {\n return (\n
\n {message.reactions!.results.map((reaction) => (\n \n ))}\n {metaChildren}\n
\n );\n};\n\nexport default memo(Reactions);\n","import React, {\n FC, memo, useEffect, useState,\n} from '../../lib/teact/teact';\n\nimport { ActiveEmojiInteraction } from '../../global/types';\n\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';\nimport useAnimatedEmoji from './hooks/useAnimatedEmoji';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nconst QUALITY = 1;\n\ntype OwnProps = {\n localSticker?: string;\n localEffect?: string;\n isOwn?: boolean;\n soundId?: string;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n messageId?: number;\n chatId?: string;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\nconst LocalAnimatedEmoji: FC = ({\n localSticker,\n localEffect,\n isOwn,\n soundId,\n size = 'medium',\n observeIntersection,\n messageId,\n chatId,\n activeEmojiInteractions,\n}) => {\n const {\n playKey,\n ref,\n style,\n width,\n handleClick,\n markAnimationLoaded,\n } = useAnimatedEmoji(size, chatId, messageId, soundId, activeEmojiInteractions, isOwn, localEffect);\n const id = `local_emoji_${localSticker}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [localStickerAnimationData, setLocalStickerAnimationData] = useState();\n useEffect(() => {\n if (localSticker) {\n getAnimationData(localSticker as keyof typeof ANIMATED_STICKERS_PATHS).then((data) => {\n setLocalStickerAnimationData(data);\n });\n }\n }, [localSticker]);\n\n return (\n \n {localStickerAnimationData && (\n \n )}\n \n );\n};\n\nexport default memo(LocalAnimatedEmoji);\n","import React, {\n FC,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ActiveEmojiInteraction, ActiveReaction, MessageListType } from '../../../global/types';\nimport {\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n ApiChat,\n ApiSticker,\n ApiThreadInfo,\n ApiAvailableReaction,\n} from '../../../api/types';\nimport {\n AudioOrigin, FocusDirection, IAlbum, ISettings,\n} from '../../../types';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment';\nimport {\n selectChat,\n selectChatMessage,\n selectUploadProgress,\n selectIsChatWithSelf,\n selectOutgoingStatus,\n selectUser,\n selectIsMessageFocused,\n selectCurrentTextSearch,\n selectAnimatedEmoji,\n selectIsInSelectMode,\n selectIsMessageSelected,\n selectIsDocumentGroupSelected,\n selectSender,\n selectForwardedSender,\n selectThreadTopMessageId,\n selectCanAutoLoadMedia,\n selectCanAutoPlayMedia,\n selectShouldLoopStickers,\n selectTheme,\n selectAllowedMessageActions,\n selectIsDownloading,\n selectThreadInfo,\n selectAnimatedEmojiEffect,\n selectAnimatedEmojiSound,\n selectMessageIdsByGroupId,\n selectLocalAnimatedEmoji,\n selectIsMessageProtected,\n selectLocalAnimatedEmojiEffect,\n selectDefaultReaction,\n} from '../../../modules/selectors';\nimport {\n getMessageContent,\n isOwnMessage,\n isReplyMessage,\n isAnonymousOwnMessage,\n isMessageLocal,\n isUserId,\n isChatWithRepliesBot,\n getMessageCustomShape,\n isChatChannel,\n getMessageSingleEmoji,\n getSenderTitle,\n getUserColorKey,\n areReactionsEmpty,\n} from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport { renderMessageText } from '../../common/helpers/renderMessageText';\nimport { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions';\nimport { buildContentClassName, isEmojiOnlyMessage } from './helpers/buildContentClassName';\nimport { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimensions';\nimport { calculateAlbumLayout } from './helpers/calculateAlbumLayout';\nimport renderText from '../../common/helpers/renderText';\nimport calculateAuthorWidth from './helpers/calculateAuthorWidth';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport useFocusMessage from './hooks/useFocusMessage';\nimport useOuterHandlers from './hooks/useOuterHandlers';\nimport useInnerHandlers from './hooks/useInnerHandlers';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\nimport Document from '../../common/Document';\nimport Audio from '../../common/Audio';\nimport MessageMeta from './MessageMeta';\nimport ContextMenuContainer from './ContextMenuContainer.async';\nimport Sticker from './Sticker';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\nimport Photo from './Photo';\nimport Video from './Video';\nimport Contact from './Contact';\nimport Poll from './Poll';\nimport WebPage from './WebPage';\nimport Invoice from './Invoice';\nimport Album from './Album';\nimport RoundVideo from './RoundVideo';\nimport InlineButtons from './InlineButtons';\nimport CommentButton from './CommentButton';\nimport Reactions from './Reactions';\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport LocalAnimatedEmoji from '../../common/LocalAnimatedEmoji';\n\nimport './Message.scss';\n\ntype MessagePositionProperties = {\n isFirstInGroup: boolean;\n isLastInGroup: boolean;\n isFirstInDocumentGroup: boolean;\n isLastInDocumentGroup: boolean;\n isLastInList: boolean;\n};\n\ntype OwnProps =\n {\n message: ApiMessage;\n observeIntersectionForBottom: ObserveFn;\n observeIntersectionForMedia: ObserveFn;\n observeIntersectionForAnimatedStickers: ObserveFn;\n album?: IAlbum;\n noAvatars?: boolean;\n withAvatar?: boolean;\n withSenderName?: boolean;\n areReactionsInMeta?: boolean;\n threadId: number;\n messageListType: MessageListType;\n noComments: boolean;\n appearanceOrder: number;\n }\n & MessagePositionProperties;\n\ntype StateProps = {\n theme: ISettings['theme'];\n forceSenderName?: boolean;\n chatUsername?: string;\n sender?: ApiUser | ApiChat;\n originSender?: ApiUser | ApiChat;\n botSender?: ApiUser;\n isThreadTop?: boolean;\n shouldHideReply?: boolean;\n replyMessage?: ApiMessage;\n replyMessageSender?: ApiUser | ApiChat;\n outgoingStatus?: ApiMessageOutgoingStatus;\n uploadProgress?: number;\n isInDocumentGroup: boolean;\n isProtected?: boolean;\n isFocused?: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n isResizingContainer?: boolean;\n isForwarding?: boolean;\n isChatWithSelf?: boolean;\n isRepliesChat?: boolean;\n isChannel?: boolean;\n canReply?: boolean;\n lastSyncTime?: number;\n highlight?: string;\n isSingleEmoji?: boolean;\n animatedEmoji?: ApiSticker;\n localSticker?: string;\n localEffect?: string;\n animatedEmojiEffect?: ApiSticker;\n animatedEmojiSoundId?: string;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n isGroupSelected?: boolean;\n isDownloading: boolean;\n threadId?: number;\n isPinnedList?: boolean;\n canAutoLoadMedia?: boolean;\n canAutoPlayMedia?: boolean;\n shouldLoopStickers?: boolean;\n autoLoadFileMaxSizeMb: number;\n threadInfo?: ApiThreadInfo;\n reactionMessage?: ApiMessage;\n availableReactions?: ApiAvailableReaction[];\n defaultReaction?: string;\n activeReaction?: ActiveReaction;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\ntype MetaPosition =\n 'in-text'\n | 'standalone'\n | 'none';\ntype ReactionsPosition =\n 'inside'\n | 'outside'\n | 'in-meta'\n | 'none';\n\nconst NBSP = '\\u00A0';\n// eslint-disable-next-line max-len\nconst APPENDIX_OWN = { __html: '' };\n// eslint-disable-next-line max-len\nconst APPENDIX_NOT_OWN = { __html: '' };\nconst APPEARANCE_DELAY = 10;\nconst NO_MEDIA_CORNERS_THRESHOLD = 18;\n\nconst Message: FC = ({\n message,\n chatUsername,\n observeIntersectionForBottom,\n observeIntersectionForMedia,\n observeIntersectionForAnimatedStickers,\n album,\n noAvatars,\n withAvatar,\n withSenderName,\n areReactionsInMeta,\n noComments,\n appearanceOrder,\n isFirstInGroup,\n isLastInGroup,\n isFirstInDocumentGroup,\n isLastInDocumentGroup,\n isLastInList,\n theme,\n forceSenderName,\n sender,\n originSender,\n botSender,\n isThreadTop,\n shouldHideReply,\n replyMessage,\n replyMessageSender,\n outgoingStatus,\n uploadProgress,\n isInDocumentGroup,\n isProtected,\n isFocused,\n focusDirection,\n noFocusHighlight,\n isResizingContainer,\n isForwarding,\n isChatWithSelf,\n isRepliesChat,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n animatedEmoji,\n localSticker,\n localEffect,\n animatedEmojiEffect,\n animatedEmojiSoundId,\n isInSelectMode,\n isSelected,\n isGroupSelected,\n threadId,\n reactionMessage,\n availableReactions,\n defaultReaction,\n activeReaction,\n activeEmojiInteractions,\n messageListType,\n isPinnedList,\n isDownloading,\n canAutoLoadMedia,\n canAutoPlayMedia,\n shouldLoopStickers,\n autoLoadFileMaxSizeMb,\n threadInfo,\n}) => {\n const {\n toggleMessageSelection,\n clickInlineButton,\n disableContextMenuHint,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const bottomMarkerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const contentRef = useRef(null);\n\n const lang = useLang();\n\n useOnIntersect(bottomMarkerRef, observeIntersectionForBottom);\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu: onContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref, IS_TOUCH_ENV && isInSelectMode, true, IS_ANDROID);\n\n useEffect(() => {\n if (isContextMenuOpen) {\n disableContextMenuHint();\n }\n }, [isContextMenuOpen, disableContextMenuHint]);\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const {\n id: messageId, chatId, forwardInfo, viaBotId,\n } = message;\n\n const isLocal = isMessageLocal(message);\n const isOwn = isOwnMessage(message);\n const isScheduled = messageListType === 'scheduled' || message.isScheduled;\n const hasReply = isReplyMessage(message) && !shouldHideReply;\n const hasThread = Boolean(threadInfo) && messageListType === 'thread';\n const customShape = getMessageCustomShape(message);\n const hasAnimatedEmoji = localSticker || animatedEmoji;\n const hasReactions = reactionMessage?.reactions && !areReactionsEmpty(reactionMessage.reactions);\n const asForwarded = (\n forwardInfo\n && (!isChatWithSelf || isScheduled)\n && !isRepliesChat\n && !forwardInfo.isLinkedChannelPost\n && !customShape\n );\n const isAlbum = Boolean(album) && album!.messages.length > 1;\n const isInDocumentGroupNotFirst = isInDocumentGroup && !isFirstInDocumentGroup;\n const isInDocumentGroupNotLast = isInDocumentGroup && !isLastInDocumentGroup;\n const isContextMenuShown = contextMenuPosition !== undefined;\n const canShowActionButton = (\n !(isContextMenuShown || isInSelectMode || isForwarding)\n && !isInDocumentGroupNotLast\n );\n const canForward = isChannel && !isScheduled;\n const canFocus = Boolean(isPinnedList\n || (forwardInfo\n && (forwardInfo.isChannelPost || (isChatWithSelf && !isOwn) || isRepliesChat)\n && forwardInfo.fromMessageId\n ));\n\n const withCommentButton = threadInfo && !isInDocumentGroupNotLast && messageListType === 'thread' && !noComments;\n const withQuickReactionButton = !IS_TOUCH_ENV && !isInSelectMode && defaultReaction && !isInDocumentGroupNotLast;\n\n const selectMessage = useCallback((e?: React.MouseEvent, groupedId?: string) => {\n toggleMessageSelection({\n messageId,\n groupedId,\n ...(e?.shiftKey && { withShift: true }),\n ...(isAlbum && { childMessageIds: album!.messages.map(({ id }) => id) }),\n });\n }, [toggleMessageSelection, messageId, isAlbum, album]);\n\n const avatarPeer = forwardInfo && (isChatWithSelf || isRepliesChat || !sender) ? originSender : sender;\n const senderPeer = forwardInfo ? originSender : sender;\n\n const {\n handleMouseDown,\n handleClick,\n handleContextMenu,\n handleDoubleClick,\n handleContentDoubleClick,\n handleMouseMove,\n handleSendQuickReaction,\n handleMouseLeave,\n isSwiped,\n isQuickReactionVisible,\n handleDocumentGroupMouseEnter,\n } = useOuterHandlers(\n selectMessage,\n ref,\n messageId,\n isAlbum,\n Boolean(isInSelectMode),\n Boolean(canReply),\n Boolean(isProtected),\n onContextMenu,\n handleBeforeContextMenu,\n chatId,\n isContextMenuShown,\n contentRef,\n isOwn,\n isInDocumentGroupNotLast,\n );\n\n const {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll,\n } = useInnerHandlers(\n lang,\n selectMessage,\n message,\n chatId,\n threadId,\n isInDocumentGroup,\n asForwarded,\n isScheduled,\n isRepliesChat,\n album,\n avatarPeer,\n senderPeer,\n botSender,\n );\n\n const containerClassName = buildClassName(\n 'Message message-list-item',\n isFirstInGroup && 'first-in-group',\n isProtected && 'is-protected',\n isLastInGroup && 'last-in-group',\n isFirstInDocumentGroup && 'first-in-document-group',\n isLastInDocumentGroup && 'last-in-document-group',\n isLastInList && 'last-in-list',\n isOwn && 'own',\n Boolean(message.views) && 'has-views',\n message.isEdited && 'was-edited',\n hasReply && 'has-reply',\n isContextMenuShown && 'has-menu-open',\n isFocused && !noFocusHighlight && 'focused',\n isForwarding && 'is-forwarding',\n message.isDeleting && 'is-deleting',\n isInDocumentGroup && 'is-in-document-group',\n isAlbum && 'is-album',\n message.hasUnreadMention && 'has-unread-mention',\n isSelected && 'is-selected',\n isInSelectMode && 'is-in-selection-mode',\n isThreadTop && 'is-thread-top',\n Boolean(message.inlineButtons) && 'has-inline-buttons',\n isSwiped && 'is-swiped',\n transitionClassNames,\n Boolean(activeReaction) && 'has-active-reaction',\n );\n const contentClassName = buildContentClassName(message, {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments: threadInfo && threadInfo?.messagesCount > 0,\n hasActionButton: canForward || canFocus,\n hasReactions,\n });\n\n const withAppendix = contentClassName.includes('has-appendix');\n const textParts = renderMessageText(message, highlight, isEmojiOnlyMessage(customShape));\n\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, webPage, invoice,\n } = getMessageContent(message);\n\n let metaPosition!: MetaPosition;\n if (isInDocumentGroupNotLast) {\n metaPosition = 'none';\n } else if (textParts && !hasAnimatedEmoji && !webPage) {\n metaPosition = 'in-text';\n } else {\n metaPosition = 'standalone';\n }\n\n let reactionsPosition!: ReactionsPosition;\n if (areReactionsInMeta) {\n reactionsPosition = 'in-meta';\n } else if (hasReactions) {\n if (customShape || ((photo || video || hasAnimatedEmoji) && !textParts)) {\n reactionsPosition = 'outside';\n } else if (asForwarded) {\n metaPosition = 'standalone';\n reactionsPosition = 'inside';\n } else {\n reactionsPosition = 'inside';\n }\n } else {\n reactionsPosition = 'none';\n }\n\n useEnsureMessage(\n isRepliesChat && message.replyToChatId ? message.replyToChatId : chatId,\n hasReply ? message.replyToMessageId : undefined,\n replyMessage,\n message.id,\n );\n useFocusMessage(ref, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer);\n\n let style = '';\n let calculatedWidth;\n let noMediaCorners = false;\n const albumLayout = useMemo(() => {\n return isAlbum ? calculateAlbumLayout(isOwn, Boolean(asForwarded), Boolean(noAvatars), album!) : undefined;\n }, [isAlbum, isOwn, asForwarded, noAvatars, album]);\n\n const extraPadding = asForwarded ? 28 : 0;\n if (!isAlbum && (photo || video)) {\n let width: number | undefined;\n if (photo) {\n width = calculateMediaDimensions(message, noAvatars).width;\n } else if (video) {\n if (video.isRound) {\n width = ROUND_VIDEO_DIMENSIONS_PX;\n } else {\n width = calculateMediaDimensions(message, noAvatars).width;\n }\n }\n\n if (width) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), width);\n if (calculatedWidth - width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n } else if (albumLayout) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), albumLayout.containerStyle.width);\n if (calculatedWidth - albumLayout.containerStyle.width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n\n if (calculatedWidth) {\n style = `width: ${calculatedWidth + extraPadding}px`;\n }\n\n const signature = (isChannel && message.adminTitle) || (!asForwarded && forwardInfo?.adminTitle) || undefined;\n const metaSafeAuthorWidth = useMemo(() => {\n return signature ? calculateAuthorWidth(signature) : undefined;\n }, [signature]);\n\n function renderAvatar() {\n const isAvatarPeerUser = avatarPeer && isUserId(avatarPeer.id);\n const avatarUser = (avatarPeer && isAvatarPeerUser) ? avatarPeer as ApiUser : undefined;\n const avatarChat = (avatarPeer && !isAvatarPeerUser) ? avatarPeer as ApiChat : undefined;\n const hiddenName = (!avatarPeer && forwardInfo) ? forwardInfo.hiddenUserName : undefined;\n\n return (\n \n );\n }\n\n function renderReactionsAndMeta() {\n const meta = (\n \n );\n\n if (reactionsPosition !== 'inside') {\n return meta;\n }\n\n return (\n \n );\n }\n\n function renderContent() {\n const className = buildClassName(\n 'content-inner',\n asForwarded && 'forwarded-message',\n hasReply && 'reply-message',\n noMediaCorners && 'no-media-corners',\n );\n const hasCustomAppendix = isLastInGroup && !textParts && !asForwarded && !hasThread;\n const textContentClass = buildClassName(\n 'text-content',\n metaPosition === 'in-text' && 'with-meta',\n outgoingStatus && 'with-outgoing-icon',\n );\n\n return (\n
\n {renderSenderName()}\n {hasReply && (\n \n )}\n {sticker && (\n \n )}\n {animatedEmoji && (\n \n )}\n {localSticker && (\n \n )}\n {isAlbum && (\n \n )}\n {!isAlbum && photo && (\n \n )}\n {!isAlbum && video && video.isRound && (\n \n )}\n {!isAlbum && video && !video.isRound && (\n \n )}\n {(audio || voice) && (\n \n )}\n {document && (\n \n )}\n {contact && (\n \n )}\n {poll && (\n \n )}\n {!hasAnimatedEmoji && textParts && (\n

\n {textParts}\n {metaPosition === 'in-text' && renderReactionsAndMeta()}\n

\n )}\n\n {webPage && (\n \n )}\n {invoice && }\n
\n );\n }\n\n function renderSenderName() {\n const shouldRender = !(customShape && !viaBotId) && (\n (withSenderName && !photo && !video) || asForwarded || viaBotId || forceSenderName\n ) && !isInDocumentGroupNotFirst && !(hasReply && customShape);\n\n if (!shouldRender) {\n return undefined;\n }\n\n let senderTitle;\n let senderColor;\n if (senderPeer && !(customShape && viaBotId)) {\n senderTitle = getSenderTitle(lang, senderPeer);\n\n if (!asForwarded) {\n senderColor = `color-${getUserColorKey(senderPeer)}`;\n }\n } else if (forwardInfo?.hiddenUserName) {\n senderTitle = forwardInfo.hiddenUserName;\n }\n\n return (\n
\n {senderTitle ? (\n \n {renderText(senderTitle)}\n \n ) : !botSender ? (\n NBSP\n ) : undefined}\n {botSender && (\n <>\n {lang('ViaBot')}\n \n {renderText(`@${botSender.username}`)}\n \n \n )}\n {forwardInfo?.isLinkedChannelPost ? (\n {lang('DiscussChannel')}\n ) : message.adminTitle && !isChannel ? (\n {message.adminTitle}\n ) : undefined}\n
\n );\n }\n\n return (\n \n \n {!isInDocumentGroup && (\n
\n {isSelected && }\n
\n )}\n {isLastInDocumentGroup && (\n \n {isGroupSelected && (\n \n )}\n \n )}\n {withAvatar && renderAvatar()}\n \n \n {asForwarded && !isInDocumentGroupNotFirst && (\n
{lang('ForwardedMessage')}
\n )}\n {renderContent()}\n {!isInDocumentGroupNotLast && metaPosition === 'standalone' && renderReactionsAndMeta()}\n {canShowActionButton && canForward ? (\n \n \n \n ) : canShowActionButton && canFocus ? (\n \n \n \n ) : undefined}\n {withCommentButton && }\n {withAppendix && (\n
\n )}\n {withQuickReactionButton && (\n \n \n
\n )}\n \n {message.inlineButtons && (\n \n )}\n {reactionsPosition === 'outside' && (\n \n )}\n \n {contextMenuPosition && (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const { focusedMessage, forwardMessages, lastSyncTime } = global;\n const {\n message, album, withSenderName, withAvatar, threadId, messageListType, isLastInDocumentGroup,\n } = ownProps;\n const {\n id, chatId, viaBotId, replyToChatId, replyToMessageId, isOutgoing, threadInfo,\n } = message;\n\n const chat = selectChat(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isRepliesChat = isChatWithRepliesBot(chatId);\n const isChannel = chat && isChatChannel(chat);\n const chatUsername = chat?.username;\n\n const forceSenderName = !isChatWithSelf && isAnonymousOwnMessage(message);\n const canShowSender = withSenderName || withAvatar || forceSenderName;\n const sender = selectSender(global, message);\n const originSender = selectForwardedSender(global, message);\n const botSender = viaBotId ? selectUser(global, viaBotId) : undefined;\n\n const threadTopMessageId = threadId ? selectThreadTopMessageId(global, chatId, threadId) : undefined;\n const isThreadTop = message.id === threadTopMessageId;\n\n const shouldHideReply = replyToMessageId === threadTopMessageId;\n const replyMessage = replyToMessageId && !shouldHideReply\n ? selectChatMessage(global, isRepliesChat && replyToChatId ? replyToChatId : chatId, replyToMessageId)\n : undefined;\n const replyMessageSender = replyMessage && selectSender(global, replyMessage);\n\n const uploadProgress = selectUploadProgress(global, message);\n const isFocused = messageListType === 'thread' && (\n album\n ? album.messages.some((m) => selectIsMessageFocused(global, m))\n : selectIsMessageFocused(global, message)\n );\n\n const {\n direction: focusDirection, noHighlight: noFocusHighlight, isResizingContainer,\n } = (isFocused && focusedMessage) || {};\n\n const isForwarding = forwardMessages.messageIds && forwardMessages.messageIds.includes(id);\n\n const { query: highlight } = selectCurrentTextSearch(global) || {};\n\n const singleEmoji = getMessageSingleEmoji(message);\n let isSelected: boolean;\n\n if (album?.messages) {\n isSelected = album.messages.every(({ id: messageId }) => selectIsMessageSelected(global, messageId));\n } else {\n isSelected = selectIsMessageSelected(global, id);\n }\n\n const { canReply } = (messageListType === 'thread' && selectAllowedMessageActions(global, message, threadId)) || {};\n const isDownloading = selectIsDownloading(global, message);\n const actualThreadInfo = threadInfo\n ? selectThreadInfo(global, threadInfo.chatId, threadInfo.threadId) || threadInfo\n : undefined;\n\n const isInDocumentGroup = Boolean(message.groupedId) && !message.isInAlbum;\n const documentGroupFirstMessageId = isInDocumentGroup\n ? selectMessageIdsByGroupId(global, chatId, message.groupedId!)![0]\n : undefined;\n const reactionMessage = isInDocumentGroup ? (\n isLastInDocumentGroup ? selectChatMessage(global, chatId, documentGroupFirstMessageId!) : undefined\n ) : message;\n\n const localSticker = singleEmoji ? selectLocalAnimatedEmoji(global, singleEmoji) : undefined;\n\n return {\n theme: selectTheme(global),\n chatUsername,\n forceSenderName,\n sender: canShowSender ? sender : undefined,\n originSender,\n botSender,\n shouldHideReply,\n isThreadTop,\n replyMessage,\n replyMessageSender,\n isInDocumentGroup,\n isProtected: selectIsMessageProtected(global, message),\n isFocused,\n isForwarding,\n reactionMessage,\n isChatWithSelf,\n isRepliesChat,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n isSingleEmoji: Boolean(singleEmoji),\n animatedEmoji: singleEmoji ? selectAnimatedEmoji(global, singleEmoji) : undefined,\n animatedEmojiEffect: singleEmoji && isUserId(chatId) ? selectAnimatedEmojiEffect(global, singleEmoji) : undefined,\n animatedEmojiSoundId: singleEmoji ? selectAnimatedEmojiSound(global, singleEmoji) : undefined,\n localSticker,\n localEffect: localSticker && isUserId(chatId) ? selectLocalAnimatedEmojiEffect(localSticker) : undefined,\n isInSelectMode: selectIsInSelectMode(global),\n isSelected,\n isGroupSelected: (\n Boolean(message.groupedId)\n && !message.isInAlbum\n && selectIsDocumentGroupSelected(global, chatId, message.groupedId)\n ),\n threadId,\n isDownloading,\n isPinnedList: messageListType === 'pinned',\n canAutoLoadMedia: selectCanAutoLoadMedia(global, message),\n canAutoPlayMedia: selectCanAutoPlayMedia(global, message),\n autoLoadFileMaxSizeMb: global.settings.byKey.autoLoadFileMaxSizeMb,\n shouldLoopStickers: selectShouldLoopStickers(global),\n threadInfo: actualThreadInfo,\n availableReactions: global.availableReactions,\n defaultReaction: isMessageLocal(message) ? undefined : selectDefaultReaction(global, chatId),\n activeReaction: reactionMessage && global.activeReactions[reactionMessage.id],\n activeEmojiInteractions: global.activeEmojiInteractions,\n ...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),\n ...(typeof uploadProgress === 'number' && { uploadProgress }),\n ...(isFocused && { focusDirection, noFocusHighlight, isResizingContainer }),\n };\n },\n)(Message));\n","import React, { useCallback } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { IAlbum, MediaViewerOrigin } from '../../../../types';\nimport {\n ApiChat, ApiMessage, ApiUser, MAIN_THREAD_ID,\n} from '../../../../api/types';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport default function useInnerHandlers(\n lang: LangFn,\n selectMessage: (e: React.MouseEvent, groupedId?: string) => void,\n message: ApiMessage,\n chatId: string,\n threadId: number,\n isInDocumentGroup: boolean,\n asForwarded?: boolean,\n isScheduled?: boolean,\n isChatWithRepliesBot?: boolean,\n album?: IAlbum,\n avatarPeer?: ApiUser | ApiChat,\n senderPeer?: ApiUser | ApiChat,\n botSender?: ApiUser,\n) {\n const {\n openChat, showNotification, focusMessage, openMediaViewer, openAudioPlayer,\n markMessagesRead, cancelSendingMessage, sendPollVote, openForwardMenu, focusMessageInComments,\n } = getDispatch();\n\n const {\n id: messageId, forwardInfo, replyToMessageId, replyToChatId, replyToTopMessageId, groupedId,\n } = message;\n\n const handleAvatarClick = useCallback(() => {\n if (!avatarPeer) {\n return;\n }\n\n openChat({ id: avatarPeer.id });\n }, [avatarPeer, openChat]);\n\n const handleSenderClick = useCallback(() => {\n if (!senderPeer) {\n showNotification({ message: lang('HidAccount') });\n\n return;\n }\n\n if (asForwarded && forwardInfo?.channelPostId) {\n focusMessage({ chatId: senderPeer.id, messageId: forwardInfo.channelPostId });\n } else {\n openChat({ id: senderPeer.id });\n }\n }, [\n asForwarded, focusMessage, forwardInfo, lang, openChat, senderPeer, showNotification,\n ]);\n\n const handleViaBotClick = useCallback(() => {\n if (!botSender) {\n return;\n }\n\n openChat({ id: botSender.id });\n }, [botSender, openChat]);\n\n const handleReplyClick = useCallback((): void => {\n focusMessage({\n chatId: isChatWithRepliesBot && replyToChatId ? replyToChatId : chatId,\n threadId,\n messageId: replyToMessageId,\n replyMessageId: isChatWithRepliesBot && replyToChatId ? undefined : messageId,\n });\n }, [focusMessage, isChatWithRepliesBot, replyToChatId, chatId, threadId, replyToMessageId, messageId]);\n\n const handleMediaClick = useCallback((): void => {\n openMediaViewer({\n chatId, threadId, messageId, origin: isScheduled ? MediaViewerOrigin.ScheduledInline : MediaViewerOrigin.Inline,\n });\n }, [chatId, threadId, messageId, openMediaViewer, isScheduled]);\n\n const handleAudioPlay = useCallback((): void => {\n openAudioPlayer({ chatId, messageId });\n }, [chatId, messageId, openAudioPlayer]);\n\n const handleAlbumMediaClick = useCallback((albumMessageId: number): void => {\n openMediaViewer({\n chatId,\n threadId,\n messageId: albumMessageId,\n origin: isScheduled ? MediaViewerOrigin.ScheduledAlbum : MediaViewerOrigin.Album,\n });\n }, [chatId, threadId, openMediaViewer, isScheduled]);\n\n const handleReadMedia = useCallback((): void => {\n markMessagesRead({ messageIds: [messageId] });\n }, [messageId, markMessagesRead]);\n\n const handleCancelUpload = useCallback(() => {\n cancelSendingMessage({ chatId, messageId });\n }, [cancelSendingMessage, chatId, messageId]);\n\n const handleVoteSend = useCallback((options: string[]) => {\n sendPollVote({ chatId, messageId, options });\n }, [chatId, messageId, sendPollVote]);\n\n const handleGroupForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, groupedId });\n }, [openForwardMenu, chatId, groupedId]);\n\n const handleForward = useCallback(() => {\n if (album && album.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n }\n }, [album, openForwardMenu, chatId, messageId]);\n\n const handleFocus = useCallback(() => {\n focusMessage({\n chatId, threadId: MAIN_THREAD_ID, messageId,\n });\n }, [focusMessage, chatId, messageId]);\n\n const handleFocusForwarded = useCallback(() => {\n if (isInDocumentGroup) {\n focusMessage({\n chatId: forwardInfo!.fromChatId, groupedId, groupedChatId: chatId,\n });\n return;\n }\n\n if (isChatWithRepliesBot && replyToChatId) {\n focusMessageInComments({\n chatId: replyToChatId,\n threadId: replyToTopMessageId,\n messageId: forwardInfo!.fromMessageId,\n });\n } else {\n focusMessage({\n chatId: forwardInfo!.fromChatId, messageId: forwardInfo!.fromMessageId,\n });\n }\n }, [\n isInDocumentGroup, isChatWithRepliesBot, replyToChatId, focusMessage, forwardInfo, groupedId, chatId,\n focusMessageInComments, replyToTopMessageId,\n ]);\n\n const selectWithGroupedId = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n\n selectMessage(e, groupedId);\n }, [selectMessage, groupedId]);\n\n return {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick: selectWithGroupedId,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll: selectWithGroupedId,\n };\n}\n","import { RefObject } from 'react';\nimport React, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiSponsoredMessage, ApiUser } from '../../../api/types';\n\nimport { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities';\nimport { selectChat, selectSponsoredMessage, selectUser } from '../../../modules/selectors';\nimport { getChatTitle, getUserFullName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport Button from '../../ui/Button';\n\nimport './SponsoredMessage.scss';\n\ntype OwnProps = {\n chatId: string;\n containerRef: RefObject;\n};\n\ntype StateProps = {\n message?: ApiSponsoredMessage;\n bot?: ApiUser;\n channel?: ApiChat;\n};\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst SponsoredMessage: FC = ({\n chatId,\n message,\n containerRef,\n bot,\n channel,\n}) => {\n const {\n viewSponsoredMessage,\n openChat,\n openChatByInvite,\n startBot,\n focusMessage,\n } = getDispatch();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const contentRef = useRef(null);\n const shouldObserve = Boolean(message);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n threshold: 1,\n });\n\n useEffect(() => {\n return shouldObserve ? observeIntersection(contentRef.current!, (target) => {\n if (target.isIntersecting) {\n viewSponsoredMessage({ chatId });\n }\n }) : undefined;\n }, [chatId, shouldObserve, observeIntersection, viewSponsoredMessage]);\n\n if (!message) {\n return undefined;\n }\n\n const handleClick = () => {\n if (message.chatInviteHash) {\n openChatByInvite({ hash: message.chatInviteHash });\n } else if (message.channelPostId) {\n focusMessage({ chatId: message.chatId, messageId: message.channelPostId });\n } else {\n openChat({ id: message.chatId });\n\n if (message.startParam) {\n startBot({\n botId: message.chatId,\n param: message.startParam,\n });\n }\n }\n };\n\n return (\n
\n
\n
\n
\n {bot && renderText(getUserFullName(bot) || '')}\n {channel && renderText(message.chatInviteTitle || getChatTitle(lang, channel, bot) || '')}\n
\n\n

\n \n {renderTextWithEntities(message.text.text, message.text.entities)}\n \n\n \n {lang('SponsoredMessage')}\n \n

\n\n \n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const message = selectSponsoredMessage(global, chatId);\n const { chatId: fromChatId, isBot } = message || {};\n\n return {\n message,\n bot: fromChatId && isBot ? selectUser(global, fromChatId) : undefined,\n channel: !isBot && fromChatId ? selectChat(global, fromChatId) : undefined,\n };\n },\n)(SponsoredMessage));\n","import { RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport { SCHEDULED_WHEN_ONLINE } from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport { compact, flatten } from '../../util/iteratees';\nimport { formatHumanDate } from '../../util/dateFormat';\nimport { getMessageOriginalId, isActionMessage, isOwnMessage } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport { isAlbum, MessageDateGroup } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useScrollHooks from './hooks/useScrollHooks';\nimport useMessageObservers from './hooks/useMessageObservers';\n\nimport Message from './message/Message';\nimport SponsoredMessage from './message/SponsoredMessage';\nimport ActionMessage from './ActionMessage';\nimport { getDispatch } from '../../lib/teact/teactn';\n\ninterface OwnProps {\n chatId: string;\n messageIds: number[];\n messageGroups: MessageDateGroup[];\n isViewportNewest: boolean;\n isUnread: boolean;\n withUsers: boolean;\n noAvatars: boolean;\n containerRef: RefObject;\n anchorIdRef: { current: string | undefined };\n memoUnreadDividerBeforeIdRef: { current: number | undefined };\n memoFirstUnreadIdRef: { current: number | undefined };\n threadId: number;\n type: MessageListType;\n isReady: boolean;\n areReactionsInMeta: boolean;\n isScrollingRef: { current: boolean | undefined };\n isScrollPatchNeededRef: { current: boolean | undefined };\n threadTopMessageId: number | undefined;\n hasLinkedChat: boolean | undefined;\n isSchedule: boolean;\n noAppearanceAnimation: boolean;\n onFabToggle: AnyToVoidFunction;\n onNotchToggle: AnyToVoidFunction;\n}\n\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst MessageListContent: FC = ({\n chatId,\n messageIds,\n messageGroups,\n isViewportNewest,\n isUnread,\n withUsers,\n areReactionsInMeta,\n noAvatars,\n containerRef,\n anchorIdRef,\n memoUnreadDividerBeforeIdRef,\n memoFirstUnreadIdRef,\n threadId,\n type,\n isReady,\n isScrollingRef,\n isScrollPatchNeededRef,\n threadTopMessageId,\n hasLinkedChat,\n isSchedule,\n noAppearanceAnimation,\n onFabToggle,\n onNotchToggle,\n}) => {\n const { openHistoryCalendar } = getDispatch();\n\n const {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n } = useMessageObservers(type, containerRef, memoFirstUnreadIdRef);\n\n const {\n backwardsTriggerRef,\n forwardsTriggerRef,\n fabTriggerRef,\n } = useScrollHooks(\n type,\n containerRef,\n messageIds,\n isViewportNewest,\n isUnread,\n onFabToggle,\n onNotchToggle,\n isReady,\n isScrollingRef,\n isScrollPatchNeededRef,\n );\n\n const lang = useLang();\n\n const unreadDivider = (\n
\n {lang('UnreadMessages')}\n
\n );\n\n const messageCountToAnimate = noAppearanceAnimation ? 0 : messageGroups.reduce((acc, messageGroup) => {\n return acc + flatten(messageGroup.senderGroups).length;\n }, 0);\n let appearanceIndex = 0;\n\n const dateGroups = messageGroups.map((\n dateGroup: MessageDateGroup,\n dateGroupIndex: number,\n dateGroupsArray: MessageDateGroup[],\n ) => {\n const senderGroups = dateGroup.senderGroups.map((\n senderGroup,\n senderGroupIndex,\n senderGroupsArray,\n ) => {\n if (senderGroup.length === 1 && !isAlbum(senderGroup[0]) && isActionMessage(senderGroup[0])) {\n const message = senderGroup[0];\n const isLastInList = (\n senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n );\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n ]);\n }\n\n let currentDocumentGroupId: string | undefined;\n\n return flatten(senderGroup.map((\n messageOrAlbum,\n messageIndex,\n ) => {\n const message = isAlbum(messageOrAlbum) ? messageOrAlbum.mainMessage : messageOrAlbum;\n const album = isAlbum(messageOrAlbum) ? messageOrAlbum : undefined;\n const isOwn = isOwnMessage(message);\n const isMessageAlbum = isAlbum(messageOrAlbum);\n const nextMessage = senderGroup[messageIndex + 1];\n\n if (message.previousLocalId && anchorIdRef.current === `message${message.previousLocalId}`) {\n anchorIdRef.current = `message${message.id}`;\n }\n\n const documentGroupId = !isMessageAlbum && message.groupedId ? message.groupedId : undefined;\n const nextDocumentGroupId = nextMessage && !isAlbum(nextMessage) ? nextMessage.groupedId : undefined;\n\n const position = {\n isFirstInGroup: messageIndex === 0,\n isLastInGroup: messageIndex === senderGroup.length - 1,\n isFirstInDocumentGroup: Boolean(documentGroupId && documentGroupId !== currentDocumentGroupId),\n isLastInDocumentGroup: Boolean(documentGroupId && documentGroupId !== nextDocumentGroupId),\n isLastInList: (\n messageIndex === senderGroup.length - 1\n && senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n ),\n };\n\n currentDocumentGroupId = documentGroupId;\n\n const originalId = getMessageOriginalId(message);\n // Scheduled messages can have local IDs in the middle of the list,\n // and keys should be ordered, so we prefix it with a date.\n // However, this may lead to issues if server date is not synchronized with the local one.\n const key = type !== 'scheduled' ? originalId : `${message.date}_${originalId}`;\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n message.id === threadTopMessageId && (\n
\n {lang('DiscussionStarted')}\n
\n ),\n ]);\n }));\n });\n\n return (\n \n openHistoryCalendar({ selectedAt: dateGroup.datetime }) : undefined}\n >\n \n {isSchedule && dateGroup.originalDate === SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledUntilOnline')\n )}\n {isSchedule && dateGroup.originalDate !== SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledOn', formatHumanDate(lang, dateGroup.datetime, undefined, true))\n )}\n {!isSchedule && formatHumanDate(lang, dateGroup.datetime)}\n \n \n {flatten(senderGroups)}\n \n );\n });\n\n return (\n
\n
\n {flatten(dateGroups)}\n {isViewportNewest && }\n \n \n
\n );\n};\n\nexport default memo(MessageListContent);\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { LoadMoreDirection } from '../../../types';\nimport { MessageListType } from '../../../global/types';\n\nimport { LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../../config';\nimport { IS_SCROLL_PATCH_NEEDED, MESSAGE_LIST_SENSITIVE_AREA } from '../../../util/environment';\nimport { debounce } from '../../../util/schedulers';\nimport { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useOnChange from '../../../hooks/useOnChange';\n\nconst FAB_THRESHOLD = 50;\nconst NOTCH_THRESHOLD = 1; // Notch has zero height so we at least need a 1px margin to intersect\nconst TOOLS_FREEZE_TIMEOUT = 250; // Approximate message sending animation duration\n\nexport default function useScrollHooks(\n type: MessageListType,\n containerRef: RefObject,\n messageIds: number[],\n isViewportNewest: boolean,\n isUnread: boolean,\n onFabToggle: AnyToVoidFunction,\n onNotchToggle: AnyToVoidFunction,\n isReady: boolean,\n isScrollingRef: { current: boolean | undefined },\n isScrollPatchNeededRef: { current: boolean | undefined },\n) {\n const { loadViewportMessages } = getDispatch();\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(\n () => (type === 'thread' ? [\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Backwards }), 1000, true, false),\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Forwards }), 1000, true, false),\n ] : []),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [loadViewportMessages, messageIds],\n );\n\n // eslint-disable-next-line no-null/no-null\n const backwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const forwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const fabTriggerRef = useRef(null);\n\n function toggleScrollTools() {\n if (!isReady) return;\n\n if (!messageIds || !messageIds.length) {\n onFabToggle(false);\n onNotchToggle(false);\n return;\n }\n\n if (!isViewportNewest) {\n onFabToggle(true);\n onNotchToggle(true);\n return;\n }\n\n if (!containerRef.current) {\n return;\n }\n\n const { offsetHeight, scrollHeight, scrollTop } = containerRef.current;\n const scrollBottom = Math.round(scrollHeight - scrollTop - offsetHeight);\n const isNearBottom = scrollBottom <= FAB_THRESHOLD;\n const isAtBottom = scrollBottom <= NOTCH_THRESHOLD;\n\n onFabToggle(isUnread ? !isAtBottom : !isNearBottom);\n onNotchToggle(!isAtBottom);\n }\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: MESSAGE_LIST_SENSITIVE_AREA,\n }, (entries) => {\n if (!loadMoreForwards || !loadMoreBackwards) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isFirstMessageLocal = messageIds[0] >= LOCAL_MESSAGE_ID_BASE;\n if (isFirstMessageLocal) {\n return;\n }\n\n const triggerEntry = entries.find(({ isIntersecting }) => isIntersecting);\n if (!triggerEntry) {\n return;\n }\n\n const { target } = triggerEntry;\n\n if (target.className === 'backwards-trigger') {\n if (\n IS_SCROLL_PATCH_NEEDED && isScrollingRef.current && messageIds.length <= MESSAGE_LIST_SLICE\n ) {\n isScrollPatchNeededRef.current = true;\n }\n\n loadMoreBackwards();\n } else if (target.className === 'forwards-trigger') {\n loadMoreForwards();\n }\n });\n\n useOnIntersect(backwardsTriggerRef, observeIntersection);\n useOnIntersect(forwardsTriggerRef, observeIntersection);\n\n const {\n observe: observeIntersectionForFab,\n freeze: freezeForFab,\n unfreeze: unfreezeForFab,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: FAB_THRESHOLD * 2,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForFab);\n\n const {\n observe: observeIntersectionForNotch,\n freeze: freezeForNotch,\n unfreeze: unfreezeForNotch,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: NOTCH_THRESHOLD,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForNotch);\n\n useOnChange(() => {\n if (isReady) {\n toggleScrollTools();\n }\n }, [isReady]);\n\n // Workaround for FAB and notch flickering with tall incoming message\n useOnChange(() => {\n freezeForFab();\n freezeForNotch();\n\n setTimeout(() => {\n unfreezeForNotch();\n unfreezeForFab();\n }, TOOLS_FREEZE_TIMEOUT);\n }, [messageIds]);\n\n return { backwardsTriggerRef, forwardsTriggerRef, fabTriggerRef };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport { selectChat } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport { getUserIdDividend } from '../../modules/helpers';\n\nimport StickerButton from '../common/StickerButton';\n\nimport './ContactGreeting.scss';\n\ntype OwnProps = {\n userId: string;\n};\n\ntype StateProps = {\n sticker?: ApiSticker;\n lastUnreadMessageId?: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst ContactGreeting: FC = ({\n sticker,\n connectionState,\n lastUnreadMessageId,\n}) => {\n const {\n loadGreetingStickers,\n sendMessage,\n markMessageListRead,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n });\n useEffect(() => {\n if (sticker || connectionState !== 'connectionStateReady') {\n return;\n }\n\n loadGreetingStickers();\n }, [connectionState, loadGreetingStickers, sticker]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && lastUnreadMessageId) {\n markMessageListRead({ maxId: lastUnreadMessageId });\n }\n }, [connectionState, markMessageListRead, lastUnreadMessageId]);\n\n const handleStickerSelect = useCallback((selectedSticker: ApiSticker) => {\n selectedSticker = {\n ...selectedSticker,\n isPreloadedGlobally: true,\n };\n sendMessage({ sticker: selectedSticker });\n }, [sendMessage]);\n\n return (\n
\n
\n

{lang('Conversation.EmptyPlaceholder')}

\n

{lang('Conversation.GreetingText')}

\n\n
\n {sticker && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const { stickers } = global.stickers.greeting;\n const dividend = getUserIdDividend(userId) + getUserIdDividend(global.currentUserId!);\n const sticker = stickers?.length ? stickers[dividend % stickers.length] : undefined;\n const chat = selectChat(global, userId);\n if (!chat) {\n return {};\n }\n\n return {\n sticker,\n lastUnreadMessageId: chat.lastMessage && chat.lastMessage.id !== chat.lastReadInboxMessageId\n ? chat.lastMessage.id\n : undefined,\n connectionState: global.connectionState,\n };\n },\n)(ContactGreeting));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport './NoMessages.scss';\n\ntype OwnProps = {\n chatId: string;\n isChatWithSelf?: boolean;\n type: MessageListType;\n isGroupChatJustCreated?: boolean;\n};\n\nconst NoMessages: FC = ({\n isChatWithSelf, type, isGroupChatJustCreated,\n}) => {\n const lang = useLang();\n\n if (type === 'scheduled') {\n return renderScheduled(lang);\n }\n\n if (isChatWithSelf) {\n return renderSavedMessages(lang);\n }\n\n if (isGroupChatJustCreated) {\n return renderGroup(lang);\n }\n\n return (\n
{lang('NoMessages')}
\n );\n};\n\nfunction renderScheduled(lang: LangFn) {\n return (\n
{lang('ScheduledMessages.EmptyPlaceholder')}
\n );\n}\n\nfunction renderSavedMessages(lang: LangFn) {\n return (\n
\n
\n \n

{lang('Conversation.CloudStorageInfo.Title')}

\n
    \n
  • {lang('Conversation.ClousStorageInfo.Description1')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description2')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description3')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description4')}
  • \n
\n
\n
\n );\n}\n\nfunction renderGroup(lang: LangFn) {\n return (\n
\n
\n

{lang('EmptyGroupInfo.Title')}

\n

{lang('EmptyGroupInfo.Subtitle')}

\n
    \n
  • {lang('EmptyGroupInfo.Line1')}
  • \n
  • {lang('EmptyGroupInfo.Line2')}
  • \n
  • {lang('EmptyGroupInfo.Line3')}
  • \n
  • {lang('EmptyGroupInfo.Line4')}
  • \n
\n
\n
\n );\n}\n\nexport default memo(NoMessages);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { MessageListType } from '../../global/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport { ANIMATION_END_DELAY, LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../config';\nimport {\n selectChatMessages,\n selectIsViewportNewest,\n selectFirstUnreadId,\n selectFocusedMessageId,\n selectChat,\n selectIsInSelectMode,\n selectIsChatWithSelf,\n selectChatBot,\n selectIsChatBotNotStarted,\n selectScrollOffset,\n selectThreadTopMessageId,\n selectFirstMessageId,\n selectScheduledMessages,\n selectCurrentMessageIds,\n} from '../../modules/selectors';\nimport {\n isChatChannel,\n isUserId,\n isChatWithRepliesBot,\n isChatGroup,\n} from '../../modules/helpers';\nimport { orderBy } from '../../util/iteratees';\nimport { fastRaf, debounce, onTickEnd } from '../../util/schedulers';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport buildClassName from '../../util/buildClassName';\nimport { groupMessages } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useOnChange from '../../hooks/useOnChange';\nimport useStickyDates from './hooks/useStickyDates';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport resetScroll, { patchChromiumScroll } from '../../util/resetScroll';\nimport fastSmoothScroll, { isAnimatingScroll } from '../../util/fastSmoothScroll';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useInterval from '../../hooks/useInterval';\nimport useNativeCopySelectedMessages from '../../hooks/useNativeCopySelectedMessages';\n\nimport Loading from '../ui/Loading';\nimport MessageListContent from './MessageListContent';\nimport ContactGreeting from './ContactGreeting';\nimport NoMessages from './NoMessages';\n\nimport './MessageList.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n type: MessageListType;\n canPost: boolean;\n isReady: boolean;\n onFabToggle: (shouldShow: boolean) => void;\n onNotchToggle: (shouldShow: boolean) => void;\n hasTools?: boolean;\n withBottomShift?: boolean;\n};\n\ntype StateProps = {\n isChatLoaded?: boolean;\n isChannelChat?: boolean;\n isGroupChat?: boolean;\n isChatWithSelf?: boolean;\n isRepliesChat?: boolean;\n isCreator?: boolean;\n isBot?: boolean;\n messageIds?: number[];\n messagesById?: Record;\n firstUnreadId?: number;\n isViewportNewest?: boolean;\n isRestricted?: boolean;\n restrictionReason?: ApiRestrictionReason;\n focusingId?: number;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n lastMessage?: ApiMessage;\n botDescription?: string;\n threadTopMessageId?: number;\n threadFirstMessageId?: number;\n hasLinkedChat?: boolean;\n lastSyncTime?: number;\n};\n\nconst MESSAGE_REACTIONS_POLLING_INTERVAL = 15 * 1000;\nconst BOTTOM_THRESHOLD = 20;\nconst UNREAD_DIVIDER_TOP = 10;\nconst UNREAD_DIVIDER_TOP_WITH_TOOLS = 60;\nconst SCROLL_DEBOUNCE = 200;\nconst MESSAGE_ANIMATION_DURATION = 500;\nconst BOTTOM_FOCUS_MARGIN = 20;\nconst SELECT_MODE_ANIMATION_DURATION = 200;\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst runDebouncedForScroll = debounce((cb) => cb(), SCROLL_DEBOUNCE, false);\n\nconst MessageList: FC = ({\n chatId,\n threadId,\n type,\n hasTools,\n onFabToggle,\n onNotchToggle,\n isChatLoaded,\n isChannelChat,\n isGroupChat,\n canPost,\n isReady,\n isChatWithSelf,\n isRepliesChat,\n isCreator,\n isBot,\n messageIds,\n messagesById,\n firstUnreadId,\n isViewportNewest,\n threadFirstMessageId,\n isRestricted,\n restrictionReason,\n focusingId,\n isSelectModeActive,\n lastMessage,\n botDescription,\n threadTopMessageId,\n hasLinkedChat,\n lastSyncTime,\n withBottomShift,\n}) => {\n const {\n loadViewportMessages, setScrollOffset, loadSponsoredMessages, loadMessageReactions, copyMessagesByIds,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n // We update local cached `scrollOffsetRef` when opening chat.\n // Then we update global version every second on scrolling.\n const scrollOffsetRef = useRef((type === 'thread' && selectScrollOffset(getGlobal(), chatId, threadId)) || 0);\n const anchorIdRef = useRef();\n const anchorTopRef = useRef();\n const listItemElementsRef = useRef();\n const memoFirstUnreadIdRef = useRef();\n const memoUnreadDividerBeforeIdRef = useRef();\n const memoFocusingIdRef = useRef();\n const isScrollTopJustUpdatedRef = useRef(false);\n const shouldAnimateAppearanceRef = useRef(Boolean(lastMessage));\n\n const [containerHeight, setContainerHeight] = useState();\n\n const areMessagesLoaded = Boolean(messageIds);\n\n useOnChange(() => {\n // We only need it first time when message list appears\n if (areMessagesLoaded) {\n onTickEnd(() => {\n shouldAnimateAppearanceRef.current = false;\n });\n }\n }, [areMessagesLoaded]);\n\n // Updated every time (to be used from intersection callback closure)\n useOnChange(() => {\n memoFirstUnreadIdRef.current = firstUnreadId;\n }, [firstUnreadId]);\n\n useOnChange(() => {\n if (isChannelChat && isReady && lastSyncTime) {\n loadSponsoredMessages({ chatId });\n }\n }, [chatId, isReady, isChannelChat, lastSyncTime]);\n\n // Updated only once when messages are loaded (as we want the unread divider to keep its position)\n useOnChange(() => {\n if (areMessagesLoaded) {\n memoUnreadDividerBeforeIdRef.current = memoFirstUnreadIdRef.current;\n }\n }, [areMessagesLoaded]);\n\n useOnChange(() => {\n memoFocusingIdRef.current = focusingId;\n }, [focusingId]);\n\n useNativeCopySelectedMessages(copyMessagesByIds);\n\n const messageGroups = useMemo(() => {\n if (!messageIds || !messagesById) {\n return undefined;\n }\n\n const viewportIds = threadTopMessageId && (!messageIds[0] || threadFirstMessageId === messageIds[0])\n ? [threadTopMessageId, ...messageIds]\n : messageIds;\n\n if (!viewportIds.length) {\n return undefined;\n }\n\n const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean);\n return groupMessages(orderBy(listedMessages, ['date', 'id']), memoUnreadDividerBeforeIdRef.current);\n }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId]);\n\n useInterval(() => {\n if (!messageIds || !messagesById) {\n return;\n }\n const ids = messageIds.filter((l) => messagesById[l]?.reactions);\n\n if (!ids.length) return;\n\n loadMessageReactions({ chatId, ids });\n }, MESSAGE_REACTIONS_POLLING_INTERVAL);\n\n const loadMoreAround = useMemo(() => {\n if (type !== 'thread') {\n return undefined;\n }\n\n return debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Around }), 1000, true, false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [loadViewportMessages, messageIds]);\n\n const { isScrolled, updateStickyDates } = useStickyDates();\n\n const isScrollingRef = useRef();\n const isScrollPatchNeededRef = useRef();\n\n const handleScroll = useCallback(() => {\n if (isScrollTopJustUpdatedRef.current) {\n isScrollTopJustUpdatedRef.current = false;\n return;\n }\n\n isScrollingRef.current = true;\n\n const container = containerRef.current!;\n\n if (!memoFocusingIdRef.current) {\n updateStickyDates(container, hasTools);\n }\n\n runDebouncedForScroll(() => {\n isScrollingRef.current = false;\n\n fastRaf(() => {\n if (!container.parentElement) {\n return;\n }\n\n scrollOffsetRef.current = container.scrollHeight - container.scrollTop;\n\n if (type === 'thread') {\n setScrollOffset({ chatId, threadId, scrollOffset: scrollOffsetRef.current });\n }\n });\n });\n }, [updateStickyDates, hasTools, type, setScrollOffset, chatId, threadId]);\n\n // Container resize observer (caused by Composer reply/webpage panels)\n useEffect(() => {\n if (!('ResizeObserver' in window) || process.env.APP_ENV === 'perf') {\n return undefined;\n }\n\n const observer = new ResizeObserver(([entry]) => {\n // During animation\n if (!(entry.target as HTMLDivElement).offsetParent) {\n return;\n }\n\n setContainerHeight(entry.contentRect.height);\n });\n\n observer.observe(containerRef.current!);\n\n return () => {\n observer.disconnect();\n };\n }, []);\n\n // Memorize height for scroll animation\n const { height: windowHeight } = useWindowSize();\n\n useEffect(() => {\n containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight);\n }, [windowHeight, canPost]);\n\n // Initial message loading\n useEffect(() => {\n if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isLastMessageLocal = messageIds && messageIds[messageIds.length - 1] >= LOCAL_MESSAGE_ID_BASE;\n if (isLastMessageLocal) {\n return;\n }\n\n const container = containerRef.current!;\n\n if (!messageIds || (\n messageIds.length < MESSAGE_LIST_SLICE / 2\n && (container.firstElementChild as HTMLDivElement).clientHeight <= container.offsetHeight\n )) {\n loadMoreAround();\n }\n }, [isChatLoaded, messageIds, loadMoreAround, focusingId, isRestricted]);\n\n // Remember scroll position before repositioning it\n useOnChange(() => {\n if (!messageIds || !listItemElementsRef.current) {\n return;\n }\n\n const preservedItemElements = listItemElementsRef.current\n .filter((element) => messageIds.includes(Number(element.dataset.messageId)));\n\n // We avoid the very first item as it may be a partly-loaded album\n // and also because it may be removed when messages limit is reached\n const anchor = preservedItemElements[1] || preservedItemElements[0];\n if (!anchor) {\n return;\n }\n\n anchorIdRef.current = anchor.id;\n anchorTopRef.current = anchor.getBoundingClientRect().top;\n // This should match deps for `useLayoutEffectWithPrevDeps` below\n }, [messageIds, isViewportNewest, containerHeight, hasTools]);\n\n // Handles updated message list, takes care of scroll repositioning\n useLayoutEffectWithPrevDeps(([\n prevMessageIds, prevIsViewportNewest, prevContainerHeight,\n ]) => {\n const container = containerRef.current!;\n listItemElementsRef.current = Array.from(container.querySelectorAll('.message-list-item'));\n\n const hasLastMessageChanged = (\n messageIds && prevMessageIds && messageIds[messageIds.length - 1] !== prevMessageIds[prevMessageIds.length - 1]\n );\n const hasViewportShifted = (\n messageIds?.[0] !== prevMessageIds?.[0] && messageIds?.length === (MESSAGE_LIST_SLICE / 2 + 1)\n );\n const wasMessageAdded = hasLastMessageChanged && !hasViewportShifted;\n const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];\n\n // Add extra height when few messages to allow smooth scroll animation. Uses assumption that `parentElement`\n // is a Transition slide and its CSS class can not be reset in a declarative way.\n const shouldForceScroll = (\n isViewportNewest\n && wasMessageAdded\n && (messageIds && messageIds.length < MESSAGE_LIST_SLICE / 2)\n && !container.parentElement!.classList.contains('force-messages-scroll')\n && (container.firstElementChild as HTMLDivElement)!.clientHeight <= container.offsetHeight * 2\n );\n\n if (shouldForceScroll) {\n container.parentElement!.classList.add('force-messages-scroll');\n\n setTimeout(() => {\n if (container.parentElement) {\n container.parentElement.classList.remove('force-messages-scroll');\n }\n }, MESSAGE_ANIMATION_DURATION);\n }\n\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const scrollOffset = scrollOffsetRef.current;\n const lastItemElement = listItemElementsRef.current[listItemElementsRef.current.length - 1];\n\n let bottomOffset = scrollOffset - (prevContainerHeight || offsetHeight);\n if (wasMessageAdded) {\n // If two new messages come at once (e.g. when bot responds) then the first message will update `scrollOffset`\n // right away (before animation) which creates inconsistency until the animation completes. To workaround that,\n // we calculate `isAtBottom` with a \"buffer\" of the latest message height (this is approximate).\n const lastItemHeight = lastItemElement ? lastItemElement.offsetHeight : 0;\n bottomOffset -= lastItemHeight;\n }\n const isAtBottom = isViewportNewest && prevIsViewportNewest && bottomOffset <= BOTTOM_THRESHOLD;\n\n let newScrollTop!: number;\n\n if (wasMessageAdded && isAtBottom && !isAlreadyFocusing) {\n if (lastItemElement) {\n fastRaf(() => {\n fastSmoothScroll(\n container,\n lastItemElement,\n 'end',\n BOTTOM_FOCUS_MARGIN,\n );\n });\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n scrollOffsetRef.current = Math.max(Math.ceil(scrollHeight - newScrollTop), offsetHeight);\n\n // Scroll still needs to be restored after container resize\n if (!shouldForceScroll) {\n return;\n }\n }\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.time('scrollTop');\n }\n\n const isResized = prevContainerHeight !== undefined && prevContainerHeight !== containerHeight;\n const anchor = anchorIdRef.current && container.querySelector(`#${anchorIdRef.current}`);\n const unreadDivider = (\n !anchor\n && memoUnreadDividerBeforeIdRef.current\n && container.querySelector(`.${UNREAD_DIVIDER_CLASS}`)\n );\n\n if (isAtBottom && isResized) {\n if (isAnimatingScroll()) {\n return;\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n } else if (anchor) {\n if (isScrollPatchNeededRef.current) {\n isScrollPatchNeededRef.current = false;\n patchChromiumScroll(container);\n }\n\n const newAnchorTop = anchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));\n } else if (unreadDivider) {\n newScrollTop = Math.min(\n unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP),\n scrollHeight - scrollOffset,\n );\n } else {\n newScrollTop = scrollHeight - scrollOffset;\n }\n\n resetScroll(container, Math.ceil(newScrollTop));\n\n if (!memoFocusingIdRef.current) {\n isScrollTopJustUpdatedRef.current = true;\n fastRaf(() => {\n isScrollTopJustUpdatedRef.current = false;\n });\n }\n\n scrollOffsetRef.current = Math.max(Math.ceil(scrollHeight - newScrollTop), offsetHeight);\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.timeEnd('scrollTop');\n }\n // This should match deps for `useOnChange` above\n }, [messageIds, isViewportNewest, containerHeight, hasTools] as const);\n\n useEffectWithPrevDeps(([prevIsSelectModeActive]) => {\n if (prevIsSelectModeActive !== undefined) {\n dispatchHeavyAnimationEvent(SELECT_MODE_ANIMATION_DURATION + ANIMATION_END_DELAY);\n }\n }, [isSelectModeActive]);\n\n const lang = useLang();\n\n const isPrivate = Boolean(chatId && isUserId(chatId));\n const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf || isRepliesChat);\n const noAvatars = Boolean(!withUsers || isChannelChat);\n const shouldRenderGreeting = isUserId(chatId) && !isChatWithSelf && !isBot\n && (\n (\n !messageGroups && !lastMessage && messageIds\n // Used to avoid flickering when deleting a greeting that has just been sent\n && (!listItemElementsRef.current || listItemElementsRef.current.length === 0)\n )\n || (messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'contactSignUp')\n || (lastMessage?.content?.action?.type === 'contactSignUp')\n );\n\n const isGroupChatJustCreated = isGroupChat && isCreator\n && messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'chatCreate';\n\n const className = buildClassName(\n 'MessageList custom-scroll',\n noAvatars && 'no-avatars',\n !canPost && 'no-composer',\n type === 'pinned' && 'type-pinned',\n withBottomShift && 'with-bottom-shift',\n isSelectModeActive && 'select-mode-active',\n isScrolled && 'scrolled',\n !isReady && 'is-animating',\n );\n\n return (\n \n {isRestricted ? (\n
\n \n {restrictionReason ? restrictionReason.text : `This is a private ${isChannelChat ? 'channel' : 'chat'}`}\n \n
\n ) : botDescription ? (\n
{renderText(lang(botDescription), ['br', 'emoji', 'links'])}
\n ) : shouldRenderGreeting ? (\n \n ) : messageIds && (!messageGroups || isGroupChatJustCreated) ? (\n \n ) : ((messageIds && messageGroups) || lastMessage) ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, type }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const messageIds = selectCurrentMessageIds(global, chatId, threadId, type);\n const messagesById = type === 'scheduled'\n ? selectScheduledMessages(global, chatId)\n : selectChatMessages(global, chatId);\n const threadTopMessageId = selectThreadTopMessageId(global, chatId, threadId);\n\n if (\n threadId !== MAIN_THREAD_ID\n && !(messagesById && threadTopMessageId && messagesById[threadTopMessageId])\n ) {\n return {};\n }\n\n const { isRestricted, restrictionReason, lastMessage } = chat;\n const focusingId = selectFocusedMessageId(global, chatId);\n\n const withLastMessageWhenPreloading = (\n threadId === MAIN_THREAD_ID\n && !messageIds && !chat.unreadCount && !focusingId && lastMessage && !lastMessage.groupedId\n );\n\n const chatBot = selectChatBot(global, chatId)!;\n let botDescription: string | undefined;\n if (selectIsChatBotNotStarted(global, chatId)) {\n if (chatBot.fullInfo) {\n botDescription = chatBot.fullInfo.botDescription || 'NoMessages';\n } else {\n botDescription = 'Updating bot info...';\n }\n }\n\n return {\n isChatLoaded: true,\n isRestricted,\n restrictionReason,\n isChannelChat: isChatChannel(chat),\n isGroupChat: isChatGroup(chat),\n isCreator: chat.isCreator,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isRepliesChat: isChatWithRepliesBot(chatId),\n isBot: Boolean(chatBot),\n messageIds,\n messagesById,\n firstUnreadId: selectFirstUnreadId(global, chatId, threadId),\n isViewportNewest: type !== 'thread' || selectIsViewportNewest(global, chatId, threadId),\n threadFirstMessageId: selectFirstMessageId(global, chatId, threadId),\n focusingId,\n isSelectModeActive: selectIsInSelectMode(global),\n botDescription,\n threadTopMessageId,\n hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)\n ? Boolean(chat.fullInfo.linkedChatId)\n : undefined,\n lastSyncTime: global.lastSyncTime,\n ...(withLastMessageWhenPreloading && { lastMessage }),\n };\n },\n)(MessageList));\n","import { useEffect } from '../lib/teact/teact';\nimport { IS_MAC_OS } from '../util/environment';\nimport getKeyFromEvent from '../util/getKeyFromEvent';\nimport getMessageIdsForSelectedText from '../util/getMessageIdsForSelectedText';\n\nconst useNativeCopySelectedMessages = (copyMessagesByIds: ({ messageIds }: { messageIds?: number[] }) => void) => {\n useEffect(() => {\n function handleCopy(e: KeyboardEvent) {\n if (((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && getKeyFromEvent(e) === 'c') {\n const messageIds = getMessageIdsForSelectedText();\n\n if (messageIds && messageIds.length > 0) {\n e.preventDefault();\n copyMessagesByIds({ messageIds });\n }\n }\n }\n\n document.addEventListener('keydown', handleCopy, false);\n\n return () => {\n document.removeEventListener('keydown', handleCopy, false);\n };\n }, [copyMessagesByIds]);\n};\n\nexport default useNativeCopySelectedMessages;\n","import { useCallback } from '../../../lib/teact/teact';\n\nimport { fastRaf } from '../../../util/schedulers';\nimport useDebounce from '../../../hooks/useDebounce';\nimport useFlag from '../../../hooks/useFlag';\n\nconst DEBOUNCE = 1000;\nconst STICKY_TOP = 10;\nconst STICKY_TOP_WITH_TOOLS = 60;\n\nexport default function useStickyDates() {\n // For some reason we can not synchronously hide a sticky element (from `useLayoutEffect`) when chat opens\n // so we will add `position: sticky` only after first scroll. There would be no animation on the first show though.\n const [isScrolled, markIsScrolled] = useFlag(false);\n\n const runDebounced = useDebounce(DEBOUNCE, true);\n\n const updateStickyDates = useCallback((container: HTMLDivElement, hasTools?: boolean) => {\n markIsScrolled();\n\n if (!document.body.classList.contains('is-scrolling-messages')) {\n fastRaf(() => {\n document.body.classList.add('is-scrolling-messages');\n });\n }\n\n runDebounced(() => {\n fastRaf(() => {\n const currentStuck = document.querySelector('.stuck');\n if (currentStuck) {\n currentStuck.classList.remove('stuck');\n }\n\n const stuckDateEl = findStuckDate(container, hasTools);\n if (stuckDateEl) {\n stuckDateEl.classList.add('stuck');\n }\n\n document.body.classList.remove('is-scrolling-messages');\n });\n });\n }, [markIsScrolled, runDebounced]);\n\n return {\n isScrolled,\n updateStickyDates,\n };\n}\n\nfunction findStuckDate(container: HTMLElement, hasTools?: boolean) {\n const allElements = container.querySelectorAll('.sticky-date');\n const containerTop = container.scrollTop;\n\n return Array.from(allElements).find((el) => {\n const { offsetTop, offsetHeight } = el;\n const top = offsetTop - containerTop;\n return -offsetHeight <= top && top <= (hasTools ? STICKY_TOP_WITH_TOOLS : STICKY_TOP);\n });\n}\n","import React, {\n FC, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\n\nimport { selectChat, selectCurrentMessageList } from '../../modules/selectors';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport fastSmoothScroll from '../../util/fastSmoothScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ScrollDownButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n canPost?: boolean;\n withExtraShift?: boolean;\n};\n\ntype StateProps = {\n messageListType?: MessageListType;\n unreadCount?: number;\n};\n\nconst FOCUS_MARGIN = 20;\n\nconst ScrollDownButton: FC = ({\n isShown,\n canPost,\n messageListType,\n unreadCount,\n withExtraShift,\n}) => {\n const { focusNextReply } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const elementRef = useRef(null);\n\n const handleClick = useCallback(() => {\n if (!isShown) {\n return;\n }\n\n if (messageListType === 'thread') {\n focusNextReply();\n } else {\n const messagesContainer = elementRef.current!.parentElement!.querySelector('.MessageList')!;\n const messageElements = messagesContainer.querySelectorAll('.message-list-item');\n const lastMessageElement = messageElements[messageElements.length - 1];\n if (!lastMessageElement) {\n return;\n }\n\n fastSmoothScroll(messagesContainer, lastMessageElement, 'end', FOCUS_MARGIN);\n }\n }, [isShown, messageListType, focusNextReply]);\n\n const fabClassName = buildClassName(\n 'ScrollDownButton',\n isShown && 'revealed',\n !canPost && 'no-composer',\n withExtraShift && 'with-extra-shift',\n );\n\n return (\n
\n
\n \n \n \n {Boolean(unreadCount) && (\n
{formatIntegerCompact(unreadCount!)}
\n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return {};\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n\n return {\n messageListType,\n unreadCount: chat && threadId === MAIN_THREAD_ID && messageListType === 'thread' ? chat.unreadCount : undefined,\n };\n },\n)(ScrollDownButton));\n","import { ApiAttachment } from '../../../../api/types';\nimport { SUPPORTED_IMAGE_CONTENT_TYPES, SUPPORTED_VIDEO_CONTENT_TYPES } from '../../../../config';\nimport {\n preloadImage,\n preloadVideo,\n createPosterForVideo,\n fetchBlob,\n} from '../../../../util/files';\nimport { scaleImage } from '../../../../util/imageResize';\n\nconst MAX_QUICK_IMG_SIZE = 1280; // px\nconst FILE_EXT_REGEX = /\\.[^/.]+$/;\n\nexport default async function buildAttachment(\n filename: string, blob: Blob, isQuick: boolean, options?: Partial,\n): Promise {\n const blobUrl = URL.createObjectURL(blob);\n const { type: mimeType, size } = blob;\n let quick;\n let previewBlobUrl;\n\n if (SUPPORTED_IMAGE_CONTENT_TYPES.has(mimeType)) {\n if (isQuick) {\n const img = await preloadImage(blobUrl);\n const { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE || mimeType !== 'image/jpeg') {\n const resizedUrl = await scaleImage(blobUrl, MAX_QUICK_IMG_SIZE / Math.max(width, height), 'image/jpeg');\n URL.revokeObjectURL(blobUrl);\n const newBlob = await fetchBlob(resizedUrl);\n return buildAttachment(filename, newBlob, true, options);\n }\n\n if (mimeType === 'image/jpeg') {\n filename = filename.replace(FILE_EXT_REGEX, '.jpg');\n }\n\n quick = { width, height };\n } else {\n previewBlobUrl = blobUrl;\n }\n } else if (SUPPORTED_VIDEO_CONTENT_TYPES.has(mimeType)) {\n const { videoWidth: width, videoHeight: height, duration } = await preloadVideo(blobUrl);\n quick = { width, height, duration };\n\n previewBlobUrl = await createPosterForVideo(blobUrl);\n }\n\n return {\n blobUrl,\n filename,\n mimeType,\n size,\n quick,\n previewBlobUrl,\n ...options,\n };\n}\n","export default function insertHtmlInSelection(html: string) {\n const selection = window.getSelection();\n\n if (selection?.getRangeAt && selection.rangeCount) {\n const range = selection.getRangeAt(0);\n range.deleteContents();\n\n const fragment = range.createContextualFragment(html);\n const lastInsertedNode = fragment.lastChild;\n range.insertNode(fragment);\n if (lastInsertedNode) {\n range.setStartAfter(lastInsertedNode);\n range.setEndAfter(lastInsertedNode);\n } else {\n range.collapse(false);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet resetInput: HTMLInputElement;\n\nif (IS_IOS) {\n resetInput = document.createElement('input');\n resetInput.classList.add('for-ios-autocapitalization-fix');\n document.body.appendChild(resetInput);\n}\n\n// https://stackoverflow.com/a/55652503\nexport default function applyIosAutoCapitalizationFix(inputEl: HTMLElement) {\n resetInput.focus();\n inputEl.focus();\n}\n","import { IOpusRecorder } from 'opus-recorder';\n\nexport type Result = { blob: Blob; duration: number; waveform: number[] };\n\nconst encoderPath = new URL('opus-recorder/dist/encoderWorker.min', import.meta.url).href;\nconst MIN_RECORDING_TIME = 1000;\nconst POLYFILL_OPTIONS = { encoderPath, reuseWorker: true };\nconst BLOB_PARAMS = { type: 'audio/ogg' };\nconst FFT_SIZE = 64;\nconst MIN_VOLUME = 0.1;\n\nlet opusRecorderPromise: Promise<{ default: IOpusRecorder }>;\nlet OpusRecorder: IOpusRecorder;\nlet mediaRecorder: IOpusRecorder;\n\nexport async function init() {\n if (!opusRecorderPromise) {\n opusRecorderPromise = import('opus-recorder');\n OpusRecorder = (await opusRecorderPromise).default;\n mediaRecorder = new OpusRecorder(POLYFILL_OPTIONS);\n }\n\n return opusRecorderPromise;\n}\n\nexport async function start(analyzerCallback: Function) {\n await startMediaRecorder();\n\n const startedAt = Date.now();\n let pausedAt: number;\n const chunks: Uint8Array[] = [];\n const waveform: number[] = [];\n\n mediaRecorder.ondataavailable = (typedArray) => {\n chunks.push(typedArray);\n };\n\n const releaseAnalyzer = subscribeToAnalyzer(mediaRecorder, (volume: number) => {\n waveform.push(volume * 255);\n analyzerCallback(volume);\n });\n\n return {\n stop: () => new Promise((resolve, reject) => {\n mediaRecorder.onstop = () => {\n resolve({\n blob: new Blob(chunks, BLOB_PARAMS),\n duration: Math.round(((pausedAt || Date.now()) - startedAt) / 1000),\n waveform,\n });\n };\n mediaRecorder.onerror = reject;\n\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.stop();\n releaseAnalyzer();\n }, delayStop);\n }),\n pause: () => {\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.pause();\n pausedAt = Date.now();\n releaseAnalyzer();\n }, delayStop);\n },\n };\n}\n\nasync function startMediaRecorder() {\n await init();\n await mediaRecorder.start();\n}\n\nfunction subscribeToAnalyzer(recorder: IOpusRecorder, cb: Function) {\n const source = recorder.sourceNode;\n const analyser = source.context.createAnalyser();\n analyser.fftSize = FFT_SIZE;\n source.connect(analyser);\n\n const dataLength = analyser.frequencyBinCount;\n const dataArray = new Uint8Array(dataLength);\n let isDestroyed = false;\n\n function tick() {\n if (isDestroyed) {\n return;\n }\n\n analyser.getByteFrequencyData(dataArray);\n\n const sum = dataArray.reduce((acc, current) => acc + current, 0);\n const mean = (sum / dataLength);\n const volume = mean / 255;\n\n cb(volume < MIN_VOLUME ? 0 : volume);\n\n requestAnimationFrame(tick);\n }\n\n tick();\n\n return () => {\n isDestroyed = true;\n };\n}\n","import { StateHookSetter, useEffect } from '../../../../lib/teact/teact';\nimport { ApiAttachment, ApiMessage } from '../../../../api/types';\n\nimport buildAttachment from '../helpers/buildAttachment';\nimport { EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID } from '../../../../config';\nimport getFilesFromDataTransferItems from '../helpers/getFilesFromDataTransferItems';\n\nconst CLIPBOARD_ACCEPTED_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\nconst MAX_MESSAGE_LENGTH = 4096;\n\nconst useClipboardPaste = (\n insertTextAndUpdateCursor: (text: string, inputId?: string) => void,\n setAttachments: StateHookSetter,\n editedMessage: ApiMessage | undefined,\n) => {\n useEffect(() => {\n async function handlePaste(e: ClipboardEvent) {\n if (!e.clipboardData) {\n return;\n }\n\n const input = document.activeElement;\n if (input && ![EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID].includes(input.id)) {\n return;\n }\n\n\n const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);\n const { items } = e.clipboardData;\n let files: File[] = [];\n\n e.preventDefault();\n if (items.length > 0) {\n files = await getFilesFromDataTransferItems(items);\n }\n\n if (files.length === 0 && !pastedText) {\n return;\n }\n\n if (files.length > 0 && !editedMessage) {\n const newAttachments = await Promise.all(files.map((file) => {\n return buildAttachment(file.name, file, files.length === 1 && CLIPBOARD_ACCEPTED_TYPES.includes(file.type));\n }));\n setAttachments((attachments) => attachments.concat(newAttachments));\n }\n\n if (pastedText) {\n insertTextAndUpdateCursor(pastedText, input?.id);\n }\n }\n\n document.addEventListener('paste', handlePaste, false);\n\n return () => {\n document.removeEventListener('paste', handlePaste, false);\n };\n }, [insertTextAndUpdateCursor, editedMessage, setAttachments]);\n};\n\nexport default useClipboardPaste;\n","import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiFormattedText, ApiMessage } from '../../../../api/types';\n\nimport { DRAFT_DEBOUNCE, EDITABLE_INPUT_ID } from '../../../../config';\nimport usePrevious from '../../../../hooks/usePrevious';\nimport { debounce } from '../../../../util/schedulers';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport parseMessageInput from '../../../../util/parseMessageInput';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../../../hooks/useBeforeUnload';\nimport { IS_TOUCH_ENV } from '../../../../util/environment';\nimport { getTextWithEntitiesAsHtml } from '../../../common/helpers/renderTextWithEntities';\n\n// Used to avoid running debounced callbacks when chat changes.\nlet currentChatId: string | undefined;\nlet currentThreadId: number | undefined;\n\nconst useDraft = (\n draft: ApiFormattedText | undefined,\n chatId: string,\n threadId: number,\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n) => {\n const { saveDraft, clearDraft } = getDispatch();\n\n const updateDraft = useCallback((draftChatId: string, draftThreadId: number) => {\n const currentHtml = htmlRef.current;\n if (currentHtml.length && !editedMessage) {\n saveDraft({ chatId: draftChatId, threadId: draftThreadId, draft: parseMessageInput(currentHtml!) });\n } else {\n clearDraft({ chatId: draftChatId, threadId: draftThreadId });\n }\n }, [clearDraft, editedMessage, htmlRef, saveDraft]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const runDebouncedForSaveDraft = useMemo(() => debounce((cb) => cb(), DRAFT_DEBOUNCE, false), [chatId]);\n\n const prevChatId = usePrevious(chatId);\n const prevThreadId = usePrevious(threadId);\n\n // Save draft on chat change\n useEffect(() => {\n currentChatId = chatId;\n currentThreadId = threadId;\n\n return () => {\n currentChatId = undefined;\n currentThreadId = undefined;\n\n updateDraft(chatId, threadId);\n };\n }, [chatId, threadId, updateDraft]);\n\n // Restore draft on chat change\n useEffect(() => {\n if (chatId === prevChatId && threadId === prevThreadId) {\n return;\n }\n\n if (!draft) {\n return;\n }\n\n setHtml(getTextWithEntitiesAsHtml(draft));\n\n if (!IS_TOUCH_ENV) {\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }\n }, [chatId, threadId, draft, setHtml, updateDraft, prevChatId, prevThreadId]);\n\n const html = htmlRef.current;\n // Update draft when input changes\n const prevHtml = usePrevious(html);\n useEffect(() => {\n if (!chatId || !threadId || prevChatId !== chatId || prevThreadId !== threadId || prevHtml === html) {\n return;\n }\n\n if (html.length) {\n runDebouncedForSaveDraft(() => {\n if (currentChatId !== chatId || currentThreadId !== threadId) {\n return;\n }\n\n updateDraft(chatId, threadId);\n });\n } else {\n updateDraft(chatId, threadId);\n }\n }, [chatId, html, prevChatId, prevHtml, prevThreadId, runDebouncedForSaveDraft, threadId, updateDraft]);\n\n const handleBlur = useCallback(() => {\n if (chatId && threadId) {\n updateDraft(chatId, threadId);\n }\n }, [chatId, threadId, updateDraft]);\n\n useBackgroundMode(handleBlur);\n useBeforeUnload(handleBlur);\n};\n\nexport default useDraft;\n","import { useState } from '../lib/teact/teact';\n\nimport useDebounce from './useDebounce';\nimport useOnChange from './useOnChange';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport useFlag from './useFlag';\n\nexport default function useDebouncedMemo(\n resolverFn: () => R, ms: number, dependencies: D,\n): R | undefined {\n const runDebounced = useDebounce(ms, true);\n const [value, setValue] = useState();\n const [isFrozen, freeze, unfreeze] = useFlag();\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useOnChange(() => {\n if (isFrozen) {\n return;\n }\n\n runDebounced(() => {\n setValue(resolverFn());\n });\n }, [...dependencies, isFrozen]);\n\n return value;\n}\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\nimport { InlineBotSettings } from '../../../../types';\nimport useFlag from '../../../../hooks/useFlag';\nimport usePrevious from '../../../../hooks/usePrevious';\nimport useDebouncedMemo from '../../../../hooks/useDebouncedMemo';\n\nconst DEBOUNCE_MS = 300;\nconst INLINE_BOT_QUERY_REGEXP = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+(.*)/i;\nconst HAS_NEW_LINE = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+\\n{2,}/i;\nconst MEMO_NO_RESULT = {\n username: '',\n query: '',\n canShowHelp: false,\n usernameLowered: '',\n};\n\nconst tempEl = document.createElement('div');\n\nexport default function useInlineBotTooltip(\n isAllowed: boolean,\n chatId: string,\n html: string,\n inlineBots?: Record,\n) {\n const { queryInlineBot, resetInlineBot } = getDispatch();\n\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const {\n username, query, canShowHelp, usernameLowered,\n } = useDebouncedMemo(() => parseBotQuery(html), DEBOUNCE_MS, [html]) || {};\n const prevQuery = usePrevious(query);\n const prevUsername = usePrevious(username);\n const inlineBotData = usernameLowered ? inlineBots?.[usernameLowered] : undefined;\n const {\n id: botId,\n switchPm,\n offset,\n results,\n isGallery,\n help,\n } = inlineBotData || {};\n\n useEffect(() => {\n if (prevQuery !== query) {\n unmarkIsOpen();\n }\n }, [prevQuery, query, unmarkIsOpen]);\n\n useEffect(() => {\n if (isAllowed && usernameLowered && chatId) {\n queryInlineBot({ chatId, username: usernameLowered, query });\n }\n }, [query, isAllowed, queryInlineBot, chatId, usernameLowered]);\n\n const loadMore = useCallback(() => {\n queryInlineBot({\n chatId, username: usernameLowered, query, offset,\n });\n }, [offset, chatId, query, queryInlineBot, usernameLowered]);\n\n useEffect(() => {\n if (isAllowed && botId && (switchPm || (results?.length))) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [botId, isAllowed, markIsOpen, results, switchPm, unmarkIsOpen]);\n\n if (prevUsername !== username) {\n resetInlineBot({ username: prevUsername });\n }\n\n return {\n isOpen,\n id: botId,\n isGallery,\n switchPm,\n results,\n closeTooltip: unmarkIsOpen,\n help: canShowHelp && help ? `@${username} ${help}` : undefined,\n loadMore,\n };\n}\n\nfunction parseBotQuery(html: string) {\n const text = getPlainText(html);\n const result = text.match(INLINE_BOT_QUERY_REGEXP);\n if (!result) {\n return MEMO_NO_RESULT;\n }\n\n return {\n username: result[1],\n query: result[2],\n canShowHelp: result[2] === '' && !text.match(HAS_NEW_LINE),\n usernameLowered: result[1].toLowerCase(),\n };\n}\n\nfunction getPlainText(html: string) {\n tempEl.innerHTML = html.replace(/
/g, '\\n');\n\n return tempEl.innerText;\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotCommand } from '../../../../api/types';\n\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport { throttle } from '../../../../util/schedulers';\nimport useFlag from '../../../../hooks/useFlag';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_COMMAND = /^[\\w@]{1,32}\\s?/i;\n\nexport default function useBotCommandTooltip(\n isAllowed: boolean,\n html: string,\n botCommands?: ApiBotCommand[] | false,\n chatBotCommands?: ApiBotCommand[],\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [filteredBotCommands, setFilteredBotCommands] = useState();\n\n const getFilteredCommands = useCallback((filter) => {\n if (!botCommands && !chatBotCommands) {\n setFilteredBotCommands(undefined);\n\n return;\n }\n\n runThrottled(() => {\n const nextFilteredBotCommands = (botCommands || chatBotCommands || [])\n .filter(({ command }) => !filter || command.includes(filter));\n setFilteredBotCommands(\n nextFilteredBotCommands && nextFilteredBotCommands.length ? nextFilteredBotCommands : undefined,\n );\n });\n }, [botCommands, chatBotCommands]);\n\n useEffect(() => {\n if (!isAllowed || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const shouldShowCommands = html.startsWith('/');\n\n if (shouldShowCommands) {\n const filter = prepareForRegExp(html.substr(1)).match(RE_COMMAND);\n getFilteredCommands(filter ? filter[0] : '');\n } else {\n unmarkIsOpen();\n }\n }, [getFilteredCommands, html, isAllowed, unmarkIsOpen]);\n\n useEffect(() => {\n if (filteredBotCommands && filteredBotCommands.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [filteredBotCommands, markIsOpen, unmarkIsOpen]);\n\n return {\n isOpen,\n close: unmarkIsOpen,\n filteredBotCommands,\n };\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './DeleteMessageModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DeleteMessageModalAsync: FC = (props) => {\n const { isOpen } = props;\n const DeleteMessageModal = useModuleLoader(Bundles.Extra, 'DeleteMessageModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DeleteMessageModal ? : undefined;\n};\n\nexport default memo(DeleteMessageModalAsync);\n","import React, {\n FC, useRef, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\ntype OwnProps = {\n onActivate: NoneToVoidFunction;\n} & Omit;\n\nconst BUTTON_ACTIVATE_DELAY = 200;\nlet openTimeout: number | undefined;\nlet isFirstTimeActivation = true;\n\nconst ResponsiveHoverButton: FC = ({ onActivate, ...buttonProps }) => {\n const isMouseInside = useRef(false);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n\n // This is used to counter additional delay caused by asynchronous module loading\n if (isFirstTimeActivation) {\n isFirstTimeActivation = false;\n onActivate();\n return;\n }\n\n if (openTimeout) {\n clearTimeout(openTimeout);\n openTimeout = undefined;\n }\n openTimeout = window.setTimeout(() => {\n if (isMouseInside.current) {\n onActivate();\n }\n }, BUTTON_ACTIVATE_DELAY);\n }, [onActivate]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n }, []);\n\n return (\n \n );\n};\n\nexport default memo(ResponsiveHoverButton);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './CalendarModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst CalendarModalAsync: FC = (props) => {\n const { isOpen } = props;\n const CalendarModal = useModuleLoader(Bundles.Extra, 'CalendarModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CalendarModal ? : undefined;\n};\n\nexport default memo(CalendarModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const AttachMenu = useModuleLoader(Bundles.Extra, 'AttachMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachMenu ? : undefined;\n};\n\nexport default memo(AttachMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './SymbolMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst SymbolMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const SymbolMenu = useModuleLoader(Bundles.Extra, 'SymbolMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SymbolMenu ? : undefined;\n};\n\nexport default memo(SymbolMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './InlineBotTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst InlineBotTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const InlineBotTooltip = useModuleLoader(Bundles.Extra, 'InlineBotTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return InlineBotTooltip ? : undefined;\n};\n\nexport default memo(InlineBotTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './MentionTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst MentionTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const MentionTooltip = useModuleLoader(Bundles.Extra, 'MentionTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MentionTooltip ? : undefined;\n};\n\nexport default memo(MentionTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './CustomSendMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst CustomSendMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const CustomSend = useModuleLoader(Bundles.Extra, 'CustomSendMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CustomSend ? : undefined;\n};\n\nexport default memo(CustomSendMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './StickerTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst StickerTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerTooltip = useModuleLoader(Bundles.Extra, 'StickerTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerTooltip ? : undefined;\n};\n\nexport default memo(StickerTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandTooltip = useModuleLoader(Bundles.Extra, 'BotCommandTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandTooltip ? : undefined;\n};\n\nexport default memo(BotCommandTooltipAsync);\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { selectChatMessage, selectCurrentMessageList } from '../../../modules/selectors';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useFlag from '../../../hooks/useFlag';\n\nimport Menu from '../../ui/Menu';\nimport Button from '../../ui/Button';\n\nimport './BotKeyboardMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageId: number;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n message?: ApiMessage;\n};\n\nconst BotKeyboardMenu: FC = ({\n isOpen, message, onClose,\n}) => {\n const { clickInlineButton } = getDispatch();\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n const { isKeyboardSingleUse } = message || {};\n const [forceOpen, markForceOpen, unmarkForceOpen] = useFlag(true);\n\n const handleClose = () => {\n unmarkForceOpen();\n onClose();\n };\n\n useEffect(() => {\n markForceOpen();\n }, [markForceOpen, message?.keyboardButtons]);\n\n if (!message || !message.keyboardButtons) {\n return undefined;\n }\n\n return (\n \n
\n {message.keyboardButtons.map((row) => (\n
\n {row.map((button) => (\n clickInlineButton({ button })}\n >\n {button.text}\n \n ))}\n
\n ))}\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { messageId }): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return {};\n }\n\n return { message: selectChatMessage(global, chatId, messageId) };\n },\n)(BotKeyboardMenu));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\n\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectForwardedSender,\n selectUser,\n selectCurrentMessageList,\n selectReplyingToId,\n selectEditingId,\n selectEditingScheduledId,\n selectEditingMessage,\n} from '../../../modules/selectors';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport { isUserId } from '../../../modules/helpers';\n\nimport Button from '../../ui/Button';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\n\nimport './ComposerEmbeddedMessage.scss';\n\ntype StateProps = {\n replyingToId?: number;\n editingId?: number;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n shouldAnimate?: boolean;\n forwardedMessagesCount?: number;\n};\n\nconst FORWARD_RENDERING_DELAY = 300;\n\nconst ComposerEmbeddedMessage: FC = ({\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount,\n}) => {\n const {\n setReplyingToId,\n setEditingId,\n focusMessage,\n exitForwardMode,\n } = getDispatch();\n\n const isShown = Boolean(\n ((replyingToId || editingId) && message)\n || (sender && forwardedMessagesCount),\n );\n const canAnimate = useAsyncRendering(\n [forwardedMessagesCount],\n forwardedMessagesCount ? FORWARD_RENDERING_DELAY : undefined,\n );\n\n const {\n shouldRender, transitionClassNames,\n } = useShowTransition(canAnimate && isShown, undefined, !shouldAnimate, undefined, !shouldAnimate);\n\n const clearEmbedded = useCallback(() => {\n if (replyingToId) {\n setReplyingToId({ messageId: undefined });\n } else if (editingId) {\n setEditingId({ messageId: undefined });\n } else if (forwardedMessagesCount) {\n exitForwardMode();\n }\n }, [replyingToId, editingId, forwardedMessagesCount, setReplyingToId, setEditingId, exitForwardMode]);\n\n useEffect(() => (isShown ? captureEscKeyListener(clearEmbedded) : undefined), [isShown, clearEmbedded]);\n\n const handleMessageClick = useCallback((): void => {\n focusMessage({ chatId: message!.chatId, messageId: message!.id });\n }, [focusMessage, message]);\n\n const className = buildClassName('ComposerEmbeddedMessage', transitionClassNames);\n\n const customText = forwardedMessagesCount && forwardedMessagesCount > 1\n ? `${forwardedMessagesCount} forwarded messages`\n : undefined;\n\n if (!shouldRender) {\n return undefined;\n }\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId || !messageListType) {\n return {};\n }\n\n const {\n currentUserId,\n forwardMessages: { fromChatId, toChatId, messageIds: forwardMessageIds },\n } = global;\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const editingId = messageListType === 'scheduled'\n ? selectEditingScheduledId(global, chatId)\n : selectEditingId(global, chatId, threadId);\n const shouldAnimate = global.settings.byKey.animationLevel >= 1;\n const isForwarding = toChatId === chatId;\n\n let message;\n if (replyingToId) {\n message = selectChatMessage(global, chatId, replyingToId);\n } else if (editingId) {\n message = selectEditingMessage(global, chatId, threadId, messageListType);\n } else if (isForwarding && forwardMessageIds!.length === 1) {\n message = selectChatMessage(global, fromChatId!, forwardMessageIds![0]);\n }\n\n let sender: ApiChat | ApiUser | undefined;\n if (replyingToId && message) {\n const { forwardInfo } = message;\n const isChatWithSelf = chatId === currentUserId;\n\n if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {\n sender = selectForwardedSender(global, message);\n }\n\n if (!sender) {\n sender = selectSender(global, message);\n }\n } else if (isForwarding) {\n sender = isUserId(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);\n }\n\n return {\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount: isForwarding ? forwardMessageIds!.length : undefined,\n };\n },\n)(ComposerEmbeddedMessage));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachmentModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachmentModalAsync: FC = (props) => {\n const { attachments } = props;\n const AttachmentModal = useModuleLoader(Bundles.Extra, 'AttachmentModal', !attachments.length);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachmentModal ? : undefined;\n};\n\nexport default memo(AttachmentModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandMenu = useModuleLoader(Bundles.Extra, 'BotCommandMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandMenu ? : undefined;\n};\n\nexport default memo(BotCommandMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './PollModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst PollModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PollModal = useModuleLoader(Bundles.Extra, 'PollModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PollModal ? : undefined;\n};\n\nexport default memo(PollModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './DropArea';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst DropAreaAsync: FC = (props) => {\n const { isOpen } = props;\n const DropArea = useModuleLoader(Bundles.Extra, 'DropArea', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DropArea ? : undefined;\n};\n\nexport default memo(DropAreaAsync);\nexport { DropAreaState } from './DropArea';\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types';\nimport { ISettings } from '../../../types';\n\nimport { RE_LINK_TEMPLATE } from '../../../config';\nimport { selectNoWebPage, selectTheme } from '../../../modules/selectors';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';\nimport useDebouncedMemo from '../../../hooks/useDebouncedMemo';\nimport buildClassName from '../../../util/buildClassName';\n\nimport WebPage from '../message/WebPage';\nimport Button from '../../ui/Button';\n\nimport './WebPagePreview.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n messageText: string;\n disabled?: boolean;\n};\n\ntype StateProps = {\n webPagePreview?: ApiWebPage;\n noWebPage?: boolean;\n theme: ISettings['theme'];\n};\n\nconst DEBOUNCE_MS = 300;\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\n\nconst WebPagePreview: FC = ({\n chatId,\n threadId,\n messageText,\n disabled,\n webPagePreview,\n noWebPage,\n theme,\n}) => {\n const {\n loadWebPagePreview,\n clearWebPagePreview,\n toggleMessageWebPage,\n } = getDispatch();\n\n const link = useDebouncedMemo(() => {\n const { text, entities } = parseMessageInput(messageText);\n\n const linkEntity = entities && entities.find(({ type }) => type === ApiMessageEntityTypes.TextUrl);\n if (linkEntity) {\n return linkEntity.url;\n }\n\n const textMatch = text.match(RE_LINK);\n if (textMatch) {\n return textMatch[0];\n }\n\n return undefined;\n }, DEBOUNCE_MS, [messageText]);\n\n useEffect(() => {\n if (link) {\n loadWebPagePreview({ text: link });\n } else {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }\n }, [chatId, toggleMessageWebPage, clearWebPagePreview, link, loadWebPagePreview, threadId]);\n\n useOnChange(() => {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }, [chatId]);\n\n const isShown = Boolean(webPagePreview && messageText.length && !noWebPage && !disabled);\n const { shouldRender, transitionClassNames } = useShowTransition(isShown);\n\n const renderingWebPage = useCurrentOrPrev(webPagePreview, true);\n\n if (!shouldRender || !renderingWebPage) {\n return undefined;\n }\n\n const handleClearWebpagePreview = () => {\n toggleMessageWebPage({ chatId, threadId, noWebPage: true });\n };\n\n // TODO Refactor so `WebPage` can be used without message\n const { photo, ...webPageWithoutPhoto } = renderingWebPage;\n const messageStub = {\n content: {\n webPage: webPageWithoutPhoto,\n },\n } as ApiMessage;\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId }): StateProps => {\n const noWebPage = selectNoWebPage(global, chatId, threadId);\n return {\n theme: selectTheme(global),\n webPagePreview: global.webPagePreview,\n noWebPage,\n };\n },\n)(WebPagePreview));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './SendAsMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst SendAsMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const SendAsMenu = useModuleLoader(Bundles.Extra, 'SendAsMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SendAsMenu ? : undefined;\n};\n\nexport default memo(SendAsMenuAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState, MessageListType } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiBotInlineResult,\n ApiBotInlineMediaResult,\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessage,\n ApiFormattedText,\n ApiChat,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n ApiBotCommand,\n} from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport {\n BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_ID, REPLIES_USER_ID, SCHEDULED_WHEN_ONLINE, SEND_MESSAGE_ACTION_INTERVAL,\n} from '../../../config';\nimport { IS_VOICE_RECORDING_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT, IS_IOS } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport {\n selectChat,\n selectIsRightColumnShown,\n selectIsInSelectMode,\n selectNewestMessageWithBotKeyboardButtons,\n selectDraft,\n selectScheduledIds,\n selectEditingMessage,\n selectIsChatWithSelf,\n selectChatBot,\n selectChatUser,\n selectChatMessage,\n selectUser,\n selectUserStatus,\n} from '../../../modules/selectors';\nimport {\n getAllowedAttachmentOptions,\n getChatSlowModeOptions,\n isUserId,\n isChatAdmin,\n isChatSuperGroup,\n} from '../../../modules/helpers';\nimport { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport buildAttachment from './helpers/buildAttachment';\nimport renderText from '../../common/helpers/renderText';\nimport insertHtmlInSelection from '../../../util/insertHtmlInSelection';\nimport deleteLastCharacterOutsideSelection from '../../../util/deleteLastCharacterOutsideSelection';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport applyIosAutoCapitalizationFix from './helpers/applyIosAutoCapitalizationFix';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport useFlag from '../../../hooks/useFlag';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useStickerTooltip from './hooks/useStickerTooltip';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport useLang from '../../../hooks/useLang';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\nimport useInterval from '../../../hooks/useInterval';\nimport useOnChange from '../../../hooks/useOnChange';\nimport { useStateRef } from '../../../hooks/useStateRef';\nimport useVoiceRecording from './hooks/useVoiceRecording';\nimport useClipboardPaste from './hooks/useClipboardPaste';\nimport useDraft from './hooks/useDraft';\nimport useEditing from './hooks/useEditing';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useInlineBotTooltip from './hooks/useInlineBotTooltip';\nimport useBotCommandTooltip from './hooks/useBotCommandTooltip';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal.async';\nimport Button from '../../ui/Button';\nimport ResponsiveHoverButton from '../../ui/ResponsiveHoverButton';\nimport Spinner from '../../ui/Spinner';\nimport CalendarModal from '../../common/CalendarModal.async';\nimport Avatar from '../../common/Avatar';\nimport AttachMenu from './AttachMenu.async';\nimport SymbolMenu from './SymbolMenu.async';\nimport InlineBotTooltip from './InlineBotTooltip.async';\nimport MentionTooltip from './MentionTooltip.async';\nimport CustomSendMenu from './CustomSendMenu.async';\nimport StickerTooltip from './StickerTooltip.async';\nimport EmojiTooltip from './EmojiTooltip.async';\nimport BotCommandTooltip from './BotCommandTooltip.async';\nimport BotKeyboardMenu from './BotKeyboardMenu';\nimport MessageInput from './MessageInput';\nimport ComposerEmbeddedMessage from './ComposerEmbeddedMessage';\nimport AttachmentModal from './AttachmentModal.async';\nimport BotCommandMenu from './BotCommandMenu.async';\nimport PollModal from './PollModal.async';\nimport DropArea, { DropAreaState } from './DropArea.async';\nimport WebPagePreview from './WebPagePreview';\nimport SendAsMenu from './SendAsMenu.async';\n\nimport './Composer.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId: number;\n messageListType: MessageListType;\n dropAreaState: string;\n isReady: boolean;\n onDropHide: NoneToVoidFunction;\n};\n\ntype StateProps =\n {\n editingMessage?: ApiMessage;\n chat?: ApiChat;\n draft?: ApiFormattedText;\n isChatWithBot?: boolean;\n isChatWithSelf?: boolean;\n isRightColumnShown?: boolean;\n isSelectModeActive?: boolean;\n isForwarding?: boolean;\n isPollModalOpen?: boolean;\n botKeyboardMessageId?: number;\n botKeyboardPlaceholder?: string;\n withScheduledButton?: boolean;\n shouldSchedule?: boolean;\n canScheduleUntilOnline?: boolean;\n stickersForEmoji?: ApiSticker[];\n groupChatMembers?: ApiChatMember[];\n currentUserId?: string;\n recentEmojis: string[];\n lastSyncTime?: number;\n contentToBeScheduled?: GlobalState['messages']['contentToBeScheduled'];\n shouldSuggestStickers?: boolean;\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n serverTimeOffset: number;\n topInlineBotIds?: string[];\n isInlineBotLoading: boolean;\n inlineBots?: Record;\n botCommands?: ApiBotCommand[] | false;\n chatBotCommands?: ApiBotCommand[];\n sendAsUser?: ApiUser;\n sendAsChat?: ApiChat;\n sendAsId?: string;\n }\n & Pick;\n\nenum MainButtonState {\n Send = 'send',\n Record = 'record',\n Edit = 'edit',\n Schedule = 'schedule',\n}\n\nconst VOICE_RECORDING_FILENAME = 'wonderful-voice-message.ogg';\n// When voice recording is active, composer placeholder will hide to prevent overlapping\nconst SCREEN_WIDTH_TO_HIDE_PLACEHOLDER = 600; // px\n\nconst MOBILE_KEYBOARD_HIDE_DELAY_MS = 100;\nconst SELECT_MODE_TRANSITION_MS = 200;\nconst MESSAGE_MAX_LENGTH = 4096;\nconst CAPTION_MAX_LENGTH = 1024;\nconst SENDING_ANIMATION_DURATION = 350;\n// eslint-disable-next-line max-len\nconst APPENDIX = '';\n\nconst Composer: FC = ({\n dropAreaState,\n shouldSchedule,\n canScheduleUntilOnline,\n isReady,\n onDropHide,\n editingMessage,\n chatId,\n threadId,\n messageListType,\n draft,\n chat,\n connectionState,\n isChatWithBot,\n isChatWithSelf,\n isRightColumnShown,\n isSelectModeActive,\n isForwarding,\n isPollModalOpen,\n botKeyboardMessageId,\n botKeyboardPlaceholder,\n withScheduledButton,\n stickersForEmoji,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n lastSyncTime,\n contentToBeScheduled,\n shouldSuggestStickers,\n baseEmojiKeywords,\n emojiKeywords,\n serverTimeOffset,\n recentEmojis,\n inlineBots,\n isInlineBotLoading,\n botCommands,\n chatBotCommands,\n sendAsUser,\n sendAsChat,\n sendAsId,\n}) => {\n const {\n sendMessage,\n clearDraft,\n showDialog,\n setStickerSearchQuery,\n setGifSearchQuery,\n forwardMessages,\n openPollModal,\n closePollModal,\n loadScheduledHistory,\n openChat,\n addRecentEmoji,\n sendInlineBotResult,\n loadSendAs,\n loadFullChat,\n } = getDispatch();\n const lang = useLang();\n\n // eslint-disable-next-line no-null/no-null\n const appendixRef = useRef(null);\n const [html, setHtml] = useState('');\n const htmlRef = useStateRef(html);\n const lastMessageSendTimeSeconds = useRef();\n const prevDropAreaState = usePrevious(dropAreaState);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n const [\n scheduledMessageArgs, setScheduledMessageArgs,\n ] = useState();\n const { width: windowWidth } = windowSize.get();\n const sendAsIds = chat?.sendAsIds;\n const canShowSendAs = sendAsIds && (sendAsIds.length > 1 || !sendAsIds.includes(currentUserId!));\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n useEffect(() => {\n lastMessageSendTimeSeconds.current = undefined;\n }, [chatId]);\n\n useEffect(() => {\n if (chatId && lastSyncTime && threadId === MAIN_THREAD_ID && isReady) {\n loadScheduledHistory({ chatId });\n }\n }, [isReady, chatId, loadScheduledHistory, lastSyncTime, threadId]);\n\n useEffect(() => {\n if (chatId && chat && lastSyncTime && !sendAsIds && isReady && isChatSuperGroup(chat)) {\n loadSendAs({ chatId });\n }\n }, [chat, chatId, isReady, lastSyncTime, loadSendAs, sendAsIds]);\n\n useEffect(() => {\n if (chatId && chat && lastSyncTime && !chat.fullInfo && isReady && isChatSuperGroup(chat)) {\n loadFullChat({ chatId });\n }\n }, [chat, chatId, isReady, lastSyncTime, loadFullChat]);\n\n const shouldAnimateSendAsButtonRef = useRef(false);\n useOnChange(([prevChatId, prevSendAsIds]) => {\n // We only animate send-as button if `sendAsIds` was missing when opening the chat\n shouldAnimateSendAsButtonRef.current = Boolean(chatId === prevChatId && sendAsIds && !prevSendAsIds);\n }, [chatId, sendAsIds]);\n\n useLayoutEffect(() => {\n if (!appendixRef.current) return;\n\n appendixRef.current.innerHTML = APPENDIX;\n }, []);\n\n useEffect(() => {\n if (contentToBeScheduled) {\n setScheduledMessageArgs(contentToBeScheduled);\n openCalendar();\n }\n }, [contentToBeScheduled, openCalendar]);\n\n const [attachments, setAttachments] = useState([]);\n\n const [isBotKeyboardOpen, openBotKeyboard, closeBotKeyboard] = useFlag();\n const [isBotCommandMenuOpen, openBotCommandMenu, closeBotCommandMenu] = useFlag();\n const [isAttachMenuOpen, openAttachMenu, closeAttachMenu] = useFlag();\n const [isSymbolMenuOpen, openSymbolMenu, closeSymbolMenu] = useFlag();\n const [isSendAsMenuOpen, openSendAsMenu, closeSendAsMenu] = useFlag();\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isSymbolMenuLoaded, onSymbolMenuLoadingComplete] = useFlag();\n const [isHoverDisabled, disableHover, enableHover] = useFlag();\n\n const {\n startRecordingVoice,\n stopRecordingVoice,\n pauseRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef: mainButtonRef,\n startRecordTimeRef,\n } = useVoiceRecording();\n\n useInterval(() => {\n sendMessageAction({ type: 'recordAudio' });\n }, activeVoiceRecording && SEND_MESSAGE_ACTION_INTERVAL);\n\n useEffect(() => {\n if (!activeVoiceRecording) {\n sendMessageAction({ type: 'cancel' });\n }\n }, [activeVoiceRecording, sendMessageAction]);\n\n const mainButtonState = editingMessage ? MainButtonState.Edit\n : (!IS_VOICE_RECORDING_SUPPORTED || activeVoiceRecording || (html && !attachments.length) || isForwarding)\n ? (shouldSchedule ? MainButtonState.Schedule : MainButtonState.Send)\n : MainButtonState.Record;\n const canShowCustomSendMenu = !shouldSchedule;\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n !attachments.length,\n htmlRef,\n setHtml,\n undefined,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n );\n\n const {\n isOpen: isInlineBotTooltipOpen,\n id: inlineBotId,\n isGallery: isInlineBotTooltipGallery,\n switchPm: inlineBotSwitchPm,\n results: inlineBotResults,\n closeTooltip: closeInlineBotTooltip,\n help: inlineBotHelp,\n loadMore: loadMoreForInlineBot,\n } = useInlineBotTooltip(\n Boolean(!attachments.length && lastSyncTime),\n chatId,\n html,\n inlineBots,\n );\n\n const {\n isOpen: isBotCommandTooltipOpen,\n close: closeBotCommandTooltip,\n filteredBotCommands: botTooltipCommands,\n } = useBotCommandTooltip(\n Boolean((botCommands && botCommands.length) || (chatBotCommands && chatBotCommands.length)),\n html,\n botCommands,\n chatBotCommands,\n );\n\n const {\n isContextMenuOpen: isCustomSendMenuOpen,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n } = useContextMenuHandlers(mainButtonRef, !(mainButtonState === MainButtonState.Send && canShowCustomSendMenu));\n\n const {\n canSendStickers, canSendGifs, canAttachMedia, canAttachPolls, canAttachEmbedLinks,\n } = useMemo(() => getAllowedAttachmentOptions(chat, isChatWithBot), [chat, isChatWithBot]);\n\n const isAdmin = chat && isChatAdmin(chat);\n const slowMode = getChatSlowModeOptions(chat);\n\n const { isStickerTooltipOpen, closeStickerTooltip } = useStickerTooltip(\n Boolean(shouldSuggestStickers && canSendStickers && !attachments.length),\n html,\n stickersForEmoji,\n !isReady,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n Boolean(shouldSuggestStickers && canSendStickers && !attachments.length),\n htmlRef,\n recentEmojis,\n undefined,\n setHtml,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n const insertTextAndUpdateCursor = useCallback((text: string, inputId: string = EDITABLE_INPUT_ID) => {\n const selection = window.getSelection()!;\n const messageInput = document.getElementById(inputId)!;\n const newHtml = renderText(text, ['escape_html', 'emoji_html', 'br_html'])\n .join('')\n .replace(/\\u200b+/g, '\\u200b');\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, inputId)) {\n insertHtmlInSelection(newHtml);\n messageInput.dispatchEvent(new Event('input', { bubbles: true }));\n return;\n }\n }\n\n setHtml(`${htmlRef.current!}${newHtml}`);\n\n // If selection is outside of input, set cursor at the end of input\n requestAnimationFrame(() => {\n focusEditableElement(messageInput);\n });\n }, [htmlRef]);\n\n const removeSymbol = useCallback(() => {\n const selection = window.getSelection()!;\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, EDITABLE_INPUT_ID)) {\n document.execCommand('delete', false);\n return;\n }\n }\n\n setHtml(deleteLastCharacterOutsideSelection(htmlRef.current!));\n }, [htmlRef]);\n\n const resetComposer = useCallback((shouldPreserveInput = false) => {\n if (!shouldPreserveInput) {\n setHtml('');\n }\n setAttachments(MEMO_EMPTY_ARRAY);\n closeStickerTooltip();\n closeCalendar();\n setScheduledMessageArgs(undefined);\n closeMentionTooltip();\n closeEmojiTooltip();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // @optimization\n setTimeout(() => closeSymbolMenu(), SENDING_ANIMATION_DURATION);\n } else {\n closeSymbolMenu();\n }\n }, [closeStickerTooltip, closeCalendar, closeMentionTooltip, closeEmojiTooltip, closeSymbolMenu]);\n\n // Handle chat change (ref is used to avoid redundant effect calls)\n const stopRecordingVoiceRef = useRef();\n stopRecordingVoiceRef.current = stopRecordingVoice;\n useEffect(() => {\n return () => {\n stopRecordingVoiceRef.current!();\n resetComposer();\n };\n }, [chatId, resetComposer, stopRecordingVoiceRef]);\n\n const handleEditComplete = useEditing(htmlRef, setHtml, editingMessage, resetComposer, openDeleteModal);\n useDraft(draft, chatId, threadId, htmlRef, setHtml, editingMessage);\n useClipboardPaste(insertTextAndUpdateCursor, setAttachments, editingMessage);\n\n const handleFileSelect = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments(await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))));\n }, []);\n\n const handleAppendFiles = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments([\n ...attachments,\n ...await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))),\n ]);\n }, [attachments]);\n\n const handleClearAttachment = useCallback(() => {\n setAttachments(MEMO_EMPTY_ARRAY);\n }, []);\n\n const handleSend = useCallback(async (isSilent = false, scheduledAt?: number) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n let currentAttachments = attachments;\n\n if (activeVoiceRecording) {\n const record = await stopRecordingVoice();\n if (record) {\n const { blob, duration, waveform } = record;\n currentAttachments = [await buildAttachment(\n VOICE_RECORDING_FILENAME,\n blob,\n false,\n { voice: { duration, waveform } },\n )];\n }\n }\n\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!currentAttachments.length && !text && !isForwarding) {\n return;\n }\n\n const maxLength = currentAttachments.length ? CAPTION_MAX_LENGTH : MESSAGE_MAX_LENGTH;\n if (text?.length > maxLength) {\n const extraLength = text.length - maxLength;\n showDialog({\n data: {\n message: 'MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS',\n textParams: {\n '{EXTRA_CHARS_COUNT}': extraLength,\n '{PLURAL_S}': extraLength > 1 ? 's' : '',\n },\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (currentAttachments.length || text) {\n if (slowMode && !isAdmin) {\n const nowSeconds = getServerTime(serverTimeOffset);\n const secondsSinceLastMessage = lastMessageSendTimeSeconds.current\n && Math.floor(nowSeconds - lastMessageSendTimeSeconds.current);\n const nextSendDateNotReached = slowMode.nextSendDate && slowMode.nextSendDate > nowSeconds;\n\n if (\n (secondsSinceLastMessage && secondsSinceLastMessage < slowMode.seconds)\n || nextSendDateNotReached\n ) {\n const secondsRemaining = nextSendDateNotReached\n ? slowMode.nextSendDate! - nowSeconds\n : slowMode.seconds - secondsSinceLastMessage!;\n showDialog({\n data: {\n message: lang('SlowModeHint', formatMediaDuration(secondsRemaining)),\n isSlowMode: true,\n hasErrorKey: false,\n },\n });\n\n messageInput.blur();\n\n return;\n }\n }\n\n sendMessage({\n text,\n entities,\n attachments: currentAttachments,\n scheduledAt,\n isSilent,\n });\n }\n\n if (isForwarding) {\n forwardMessages({\n scheduledAt,\n isSilent,\n });\n }\n\n lastMessageSendTimeSeconds.current = getServerTime(serverTimeOffset);\n\n clearDraft({ chatId, localOnly: true });\n\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n // Wait until message animation starts\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [\n connectionState, attachments, activeVoiceRecording, isForwarding, clearDraft, chatId, serverTimeOffset,\n resetComposer, stopRecordingVoice, showDialog, slowMode, isAdmin, sendMessage, forwardMessages, lang, htmlRef,\n ]);\n\n const handleActivateBotCommandMenu = useCallback(() => {\n closeSymbolMenu();\n openBotCommandMenu();\n }, [closeSymbolMenu, openBotCommandMenu]);\n\n const handleActivateSymbolMenu = useCallback(() => {\n closeBotCommandMenu();\n closeSendAsMenu();\n openSymbolMenu();\n }, [closeBotCommandMenu, closeSendAsMenu, openSymbolMenu]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker, shouldPreserveInput = false) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n if (shouldSchedule) {\n setScheduledMessageArgs({ sticker });\n openCalendar();\n } else {\n sendMessage({ sticker });\n requestAnimationFrame(() => {\n resetComposer(shouldPreserveInput);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleGifSelect = useCallback((gif: ApiVideo) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ gif });\n openCalendar();\n } else {\n sendMessage({ gif });\n requestAnimationFrame(() => {\n resetComposer(true);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleInlineBotSelect = useCallback((inlineResult: ApiBotInlineResult | ApiBotInlineMediaResult) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n sendInlineBotResult({\n id: inlineResult.id,\n queryId: inlineResult.queryId,\n });\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, connectionState, resetComposer, sendInlineBotResult]);\n\n const handleBotCommandSelect = useCallback(() => {\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, resetComposer]);\n\n const handlePollSend = useCallback((poll: ApiNewPoll) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ poll });\n closePollModal();\n openCalendar();\n } else {\n sendMessage({ poll });\n closePollModal();\n }\n }, [closePollModal, openCalendar, sendMessage, shouldSchedule]);\n\n const handleSilentSend = useCallback(() => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ isSilent: true });\n openCalendar();\n } else {\n void handleSend(true);\n }\n }, [handleSend, openCalendar, shouldSchedule]);\n\n const handleMessageSchedule = useCallback((date: Date, isWhenOnline = false) => {\n const { isSilent, ...restArgs } = scheduledMessageArgs || {};\n\n // Scheduled time can not be less than 10 seconds in future\n const scheduledAt = Math.round(Math.max(date.getTime(), Date.now() + 60 * 1000) / 1000)\n + (isWhenOnline ? 0 : serverTimeOffset);\n\n if (!scheduledMessageArgs || Object.keys(restArgs).length === 0) {\n void handleSend(Boolean(isSilent), scheduledAt);\n } else {\n sendMessage({\n ...scheduledMessageArgs,\n scheduledAt,\n });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }\n closeCalendar();\n }, [closeCalendar, handleSend, resetComposer, scheduledMessageArgs, sendMessage, serverTimeOffset]);\n\n const handleMessageScheduleUntilOnline = useCallback(() => {\n handleMessageSchedule(new Date(SCHEDULED_WHEN_ONLINE * 1000), true);\n }, [handleMessageSchedule]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n setScheduledMessageArgs(undefined);\n }, [closeCalendar]);\n\n const handleSearchOpen = useCallback((type: 'stickers' | 'gifs') => {\n if (type === 'stickers') {\n setStickerSearchQuery({ query: '' });\n setGifSearchQuery({ query: undefined });\n } else {\n setGifSearchQuery({ query: '' });\n setStickerSearchQuery({ query: undefined });\n }\n }, [setStickerSearchQuery, setGifSearchQuery]);\n\n const handleSymbolMenuOpen = useCallback(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (!IS_SINGLE_COLUMN_LAYOUT || messageInput !== document.activeElement) {\n openSymbolMenu();\n return;\n }\n\n messageInput.blur();\n setTimeout(() => {\n closeBotCommandMenu();\n openSymbolMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [openSymbolMenu, closeBotCommandMenu]);\n\n const handleSendAsMenuOpen = useCallback(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (!IS_SINGLE_COLUMN_LAYOUT || messageInput !== document.activeElement) {\n closeBotCommandMenu();\n closeSymbolMenu();\n openSendAsMenu();\n return;\n }\n\n messageInput.blur();\n setTimeout(() => {\n closeBotCommandMenu();\n closeSymbolMenu();\n openSendAsMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [closeBotCommandMenu, closeSymbolMenu, openSendAsMenu]);\n\n const handleAllScheduledClick = useCallback(() => {\n openChat({ id: chatId, threadId, type: 'scheduled' });\n }, [openChat, chatId, threadId]);\n\n useEffect(() => {\n if (isRightColumnShown && IS_SINGLE_COLUMN_LAYOUT) {\n closeSymbolMenu();\n }\n }, [isRightColumnShown, closeSymbolMenu]);\n\n useEffect(() => {\n if (!isReady) return;\n\n if (isSelectModeActive) {\n disableHover();\n } else {\n setTimeout(() => {\n enableHover();\n }, SELECT_MODE_TRANSITION_MS);\n }\n }, [isSelectModeActive, enableHover, disableHover, isReady]);\n\n const mainButtonHandler = useCallback(() => {\n switch (mainButtonState) {\n case MainButtonState.Send:\n handleSend();\n break;\n case MainButtonState.Record:\n void startRecordingVoice();\n break;\n case MainButtonState.Edit:\n handleEditComplete();\n break;\n case MainButtonState.Schedule:\n if (activeVoiceRecording) {\n pauseRecordingVoice();\n }\n openCalendar();\n break;\n default:\n break;\n }\n }, [\n mainButtonState, handleSend, startRecordingVoice, handleEditComplete,\n activeVoiceRecording, openCalendar, pauseRecordingVoice,\n ]);\n\n const areVoiceMessagesNotAllowed = mainButtonState === MainButtonState.Record && !canAttachMedia;\n\n const prevEditedMessage = usePrevious(editingMessage, true);\n const renderedEditedMessage = editingMessage || prevEditedMessage;\n\n const scheduledDefaultDate = new Date();\n scheduledDefaultDate.setSeconds(0);\n scheduledDefaultDate.setMilliseconds(0);\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n let sendButtonAriaLabel = 'SendMessage';\n switch (mainButtonState) {\n case MainButtonState.Edit:\n sendButtonAriaLabel = 'Save edited message';\n break;\n case MainButtonState.Record:\n sendButtonAriaLabel = areVoiceMessagesNotAllowed\n ? 'Conversation.DefaultRestrictedMedia'\n : 'AccDescrVoiceMessage';\n }\n\n const className = buildClassName(\n 'Composer',\n !isSelectModeActive && 'shown',\n isHoverDisabled && 'hover-disabled',\n );\n\n const symbolMenuButtonClassName = buildClassName(\n 'mobile-symbol-menu-button',\n !isReady && 'not-ready',\n isSymbolMenuLoaded\n ? (isSymbolMenuOpen && 'menu-opened')\n : (isSymbolMenuOpen && 'is-loading'),\n );\n\n const onSend = mainButtonState === MainButtonState.Edit\n ? handleEditComplete\n : mainButtonState === MainButtonState.Schedule ? openCalendar\n : handleSend;\n\n return (\n
\n {canAttachMedia && isReady && (\n \n )}\n \n \n {renderedEditedMessage && (\n \n )}\n \n \n \n \n
\n
\n \n \n
\n {isChatWithBot && botCommands !== false && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {canShowSendAs && (sendAsUser || sendAsChat) && (\n \n \n \n )}\n {IS_SINGLE_COLUMN_LAYOUT ? (\n \n \n \n {isSymbolMenuOpen && !isSymbolMenuLoaded && }\n \n ) : (\n \n \n \n )}\n \n {isInlineBotLoading && Boolean(inlineBotId) && (\n \n )}\n {withScheduledButton && (\n \n \n \n )}\n {botKeyboardMessageId && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {!activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {activeVoiceRecording && currentRecordTime && (\n \n {formatVoiceRecordDuration(currentRecordTime - startRecordTimeRef.current!)}\n \n )}\n \n \n \n {botKeyboardMessageId && (\n \n )}\n {botCommands && (\n \n )}\n \n
\n
\n {activeVoiceRecording && (\n \n \n \n )}\n \n \n \n \n \n \n {canShowCustomSendMenu && (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const chatUser = chat && selectChatUser(global, chat);\n const chatBot = chatId !== REPLIES_USER_ID ? selectChatBot(global, chatId) : undefined;\n const isChatWithBot = Boolean(chatBot);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const messageWithActualBotKeyboard = isChatWithBot && selectNewestMessageWithBotKeyboardButtons(global, chatId);\n const scheduledIds = selectScheduledIds(global, chatId);\n const { language, shouldSuggestStickers } = global.settings.byKey;\n const baseEmojiKeywords = global.emojiKeywords[BASE_EMOJI_KEYWORD_LANG];\n const emojiKeywords = language !== BASE_EMOJI_KEYWORD_LANG ? global.emojiKeywords[language] : undefined;\n const botKeyboardMessageId = messageWithActualBotKeyboard ? messageWithActualBotKeyboard.id : undefined;\n const keyboardMessage = botKeyboardMessageId ? selectChatMessage(global, chatId, botKeyboardMessageId) : undefined;\n const { currentUserId } = global;\n const defaultSendAsId = chat?.fullInfo ? chat?.fullInfo?.sendAsId || currentUserId : undefined;\n const sendAsId = chat?.sendAsIds && defaultSendAsId && chat.sendAsIds.includes(defaultSendAsId)\n ? defaultSendAsId\n : (chat?.adminRights?.anonymous ? chat?.id : undefined);\n const sendAsUser = sendAsId ? selectUser(global, sendAsId) : undefined;\n const sendAsChat = !sendAsUser && sendAsId ? selectChat(global, sendAsId) : undefined;\n\n return {\n editingMessage: selectEditingMessage(global, chatId, threadId, messageListType),\n connectionState: global.connectionState,\n draft: selectDraft(global, chatId, threadId),\n chat,\n isChatWithBot,\n isChatWithSelf,\n canScheduleUntilOnline: Boolean(\n !isChatWithSelf && !isChatWithBot && chat && chatUser\n && isUserId(chatId) && selectUserStatus(global, chatId)?.wasOnline,\n ),\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n withScheduledButton: (\n threadId === MAIN_THREAD_ID\n && messageListType === 'thread'\n && Boolean(scheduledIds?.length)\n ),\n shouldSchedule: messageListType === 'scheduled',\n botKeyboardMessageId,\n botKeyboardPlaceholder: keyboardMessage?.keyboardPlaceholder,\n isForwarding: chatId === global.forwardMessages.toChatId,\n isPollModalOpen: global.isPollModalOpen,\n stickersForEmoji: global.stickers.forEmoji.stickers,\n groupChatMembers: chat?.fullInfo?.members,\n topInlineBotIds: global.topInlineBots?.userIds,\n currentUserId,\n lastSyncTime: global.lastSyncTime,\n contentToBeScheduled: global.messages.contentToBeScheduled,\n shouldSuggestStickers,\n recentEmojis: global.recentEmojis,\n baseEmojiKeywords: baseEmojiKeywords?.keywords,\n emojiKeywords: emojiKeywords?.keywords,\n serverTimeOffset: global.serverTimeOffset,\n inlineBots: global.inlineBots.byUsername,\n isInlineBotLoading: global.inlineBots.isLoading,\n chatBotCommands: chat && chat.fullInfo && chat.fullInfo.botCommands,\n botCommands: chatBot && chatBot.fullInfo ? (chatBot.fullInfo.botCommands || false) : undefined,\n sendAsUser,\n sendAsChat,\n sendAsId,\n };\n },\n)(Composer));\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\n\nimport { IS_SAFARI, IS_VOICE_RECORDING_SUPPORTED } from '../../../../util/environment';\nimport * as voiceRecording from '../../../../util/voiceRecording';\nimport captureEscKeyListener from '../../../../util/captureEscKeyListener';\n\ntype ActiveVoiceRecording = { stop: () => Promise; pause: NoneToVoidFunction } | undefined;\n\nconst useVoiceRecording = () => {\n // eslint-disable-next-line no-null/no-null\n const recordButtonRef = useRef(null);\n const [activeVoiceRecording, setActiveVoiceRecording] = useState();\n const startRecordTimeRef = useRef();\n const [currentRecordTime, setCurrentRecordTime] = useState();\n\n useEffect(() => {\n // Preloading worker fixes silent first record on iOS\n if (IS_SAFARI && IS_VOICE_RECORDING_SUPPORTED) {\n void voiceRecording.init();\n }\n }, []);\n\n const startRecordingVoice = useCallback(async () => {\n try {\n const { stop, pause } = await voiceRecording.start((tickVolume: number) => {\n if (recordButtonRef.current) {\n if (startRecordTimeRef.current && Date.now() % 4 === 0) {\n recordButtonRef.current.style.boxShadow = `0 0 0 ${(tickVolume || 0) * 50}px rgba(0,0,0,.15)`;\n }\n setCurrentRecordTime(Date.now());\n }\n });\n startRecordTimeRef.current = Date.now();\n setCurrentRecordTime(Date.now());\n\n setActiveVoiceRecording({ stop, pause });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }, []);\n\n const pauseRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n try {\n return activeVoiceRecording!.pause();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n const stopRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n setActiveVoiceRecording(undefined);\n startRecordTimeRef.current = undefined;\n setCurrentRecordTime(undefined);\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n try {\n return activeVoiceRecording!.stop();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n useEffect(() => {\n return activeVoiceRecording ? captureEscKeyListener(stopRecordingVoice) : undefined;\n }, [activeVoiceRecording, stopRecordingVoice]);\n\n return {\n startRecordingVoice,\n pauseRecordingVoice,\n stopRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef,\n startRecordTimeRef,\n };\n};\n\nexport default useVoiceRecording;\n","import { useEffect, useMemo } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/environment';\n\nimport parseEmojiOnlyString from '../../../common/helpers/parseEmojiOnlyString';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\n\nexport default function useStickerTooltip(\n isAllowed: boolean,\n html: string,\n stickers?: ApiSticker[],\n isDisabled = false,\n) {\n const cleanHtml = useMemo(() => prepareForRegExp(html).trim(), [html]);\n const { loadStickersForEmoji, clearStickersForEmoji } = getDispatch();\n const isSingleEmoji = (\n (IS_EMOJI_SUPPORTED && parseEmojiOnlyString(cleanHtml) === 1)\n || (!IS_EMOJI_SUPPORTED && Boolean(html.match(/^]*?>$/g)))\n );\n const hasStickers = Boolean(stickers) && isSingleEmoji;\n\n useEffect(() => {\n if (isDisabled) return;\n\n if (isAllowed && isSingleEmoji) {\n loadStickersForEmoji({\n emoji: IS_EMOJI_SUPPORTED ? cleanHtml : cleanHtml.match(/alt=\"(.+)\"/)?.[1],\n });\n } else if (hasStickers || !isSingleEmoji) {\n clearStickersForEmoji();\n }\n // We omit `hasStickers` here to prevent re-fetching after manually closing tooltip (via ).\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [html, isSingleEmoji, clearStickersForEmoji, loadStickersForEmoji, isAllowed, isDisabled]);\n\n return {\n isStickerTooltipOpen: hasStickers,\n closeStickerTooltip: clearStickersForEmoji,\n };\n}\n","export default function deleteLastCharacterOutsideSelection(html: string) {\n const tempInput = document.createElement('div');\n tempInput.contentEditable = 'true';\n tempInput.style.position = 'absolute';\n tempInput.style.left = '-10000px';\n tempInput.style.top = '-10000px';\n tempInput.innerHTML = html;\n document.body.appendChild(tempInput);\n let element = tempInput.lastChild!;\n\n if (element.lastChild) {\n // Selects the last and the deepest child of the element.\n while (element.lastChild) {\n element = element.lastChild;\n }\n }\n\n // Gets length of the element's content.\n const textLength = element.textContent!.length;\n const range = document.createRange();\n const selection = window.getSelection()!;\n\n // Sets selection position to the end of the element.\n range.setStart(element, textLength);\n range.setEnd(element, textLength);\n selection.removeAllRanges();\n selection.addRange(range);\n document.execCommand('delete', false);\n\n const result = tempInput.innerHTML;\n document.body.removeChild(tempInput);\n\n return result;\n}\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../../api/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport parseMessageInput from '../../../../util/parseMessageInput';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport { hasMessageMedia } from '../../../../modules/helpers';\nimport { getTextWithEntitiesAsHtml } from '../../../common/helpers/renderTextWithEntities';\n\nconst useEditing = (\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n resetComposer: () => void,\n openDeleteModal: () => void,\n) => {\n const { editMessage } = getDispatch();\n\n // TODO useOnChange\n // Handle editing message\n useEffect(() => {\n if (!editedMessage) {\n setHtml('');\n return;\n }\n\n setHtml(getTextWithEntitiesAsHtml(editedMessage.content.text));\n\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }, [editedMessage, setHtml]);\n\n const handleEditComplete = useCallback(() => {\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!editedMessage) {\n return;\n }\n\n if (!text && !hasMessageMedia(editedMessage)) {\n openDeleteModal();\n return;\n }\n\n editMessage({\n messageId: editedMessage.id,\n text,\n entities,\n });\n\n resetComposer();\n }, [editMessage, editedMessage, htmlRef, openDeleteModal, resetComposer]);\n\n return handleEditComplete;\n};\n\nexport default useEditing;\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './MobileSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MobileSearchAsync: FC = (props) => {\n const { isActive } = props;\n const MobileSearch = useModuleLoader(Bundles.Extra, 'MobileSearch', !isActive, true);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MobileSearch ? : undefined;\n};\n\nexport default memo(MobileSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './MessageSelectToolbar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MessageSelectToolbarAsync: FC = (props) => {\n const { isActive } = props;\n const MessageSelectToolbar = useModuleLoader(Bundles.Extra, 'MessageSelectToolbar', !isActive);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MessageSelectToolbar ? : undefined;\n};\n\nexport default memo(MessageSelectToolbarAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './UnpinAllMessagesModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst UnpinAllMessagesModalAsync: FC = (props) => {\n const { isOpen } = props;\n const UnpinAllMessagesModal = useModuleLoader(Bundles.Extra, 'UnpinAllMessagesModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return UnpinAllMessagesModal ? : undefined;\n};\n\nexport default memo(UnpinAllMessagesModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './PaymentModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst PaymentModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PaymentModal = useModuleLoader(Bundles.Extra, 'PaymentModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PaymentModal ? : undefined;\n};\n\nexport default memo(PaymentModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ReceiptModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ReceiptModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ReceiptModal = useModuleLoader(Bundles.Extra, 'ReceiptModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ReceiptModal ? : undefined;\n};\n\nexport default memo(ReceiptModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './SeenByModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst SeenByModalAsync: FC = (props) => {\n const { isOpen } = props;\n const SeenByModal = useModuleLoader(Bundles.Extra, 'SeenByModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SeenByModal ? : undefined;\n};\n\nexport default memo(SeenByModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './EmojiInteractionAnimation';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst EmojiInteractionAnimationAsync: FC = (props) => {\n const { activeEmojiInteraction } = props;\n const EmojiInteractionAnimation = useModuleLoader(Bundles.Extra, 'EmojiInteractionAnimation',\n !activeEmojiInteraction);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return EmojiInteractionAnimation ? : undefined;\n};\n\nexport default memo(EmojiInteractionAnimationAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ReactorListModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ReactorListModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ReactorListModal = useModuleLoader(Bundles.Extra, 'ReactorListModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ReactorListModal ? : undefined;\n};\n\nexport default memo(ReactorListModalAsync);\n","import React, {\n FC, useEffect, useState, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';\nimport {\n MessageListType,\n MessageList as GlobalMessageList,\n ActiveEmojiInteraction,\n} from '../../global/types';\nimport { ThemeKey } from '../../types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n ANIMATION_LEVEL_MAX,\n ANIMATION_END_DELAY,\n DARK_THEME_BG_COLOR,\n LIGHT_THEME_BG_COLOR,\n ANIMATION_LEVEL_MIN,\n SUPPORTED_IMAGE_CONTENT_TYPES,\n} from '../../config';\nimport {\n IS_SINGLE_COLUMN_LAYOUT,\n IS_TABLET_COLUMN_LAYOUT,\n IS_TOUCH_ENV,\n MASK_IMAGE_DISABLED,\n} from '../../util/environment';\nimport { DropAreaState } from './composer/DropArea';\nimport {\n selectChat,\n selectChatBot,\n selectCurrentMessageList,\n selectCurrentTextSearch,\n selectIsChatBotNotStarted,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectIsUserBlocked,\n selectPinnedIds,\n selectTheme,\n} from '../../modules/selectors';\nimport {\n getCanPostInChat, getMessageSendingRestrictionReason, isChatChannel, isChatSuperGroup, isUserId,\n} from '../../modules/helpers';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport buildClassName from '../../util/buildClassName';\nimport { createMessageHash } from '../../util/routing';\nimport useCustomBackground from '../../hooks/useCustomBackground';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport usePrevious from '../../hooks/usePrevious';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport useOnChange from '../../hooks/useOnChange';\nimport calculateMiddleFooterTransforms from './helpers/calculateMiddleFooterTransforms';\n\nimport Transition from '../ui/Transition';\nimport MiddleHeader from './MiddleHeader';\nimport MessageList from './MessageList';\nimport ScrollDownButton from './ScrollDownButton';\nimport Composer from './composer/Composer';\nimport Button from '../ui/Button';\nimport MobileSearch from './MobileSearch.async';\nimport MessageSelectToolbar from './MessageSelectToolbar.async';\nimport UnpinAllMessagesModal from '../common/UnpinAllMessagesModal.async';\nimport PaymentModal from '../payment/PaymentModal.async';\nimport ReceiptModal from '../payment/ReceiptModal.async';\nimport SeenByModal from '../common/SeenByModal.async';\nimport EmojiInteractionAnimation from './EmojiInteractionAnimation.async';\nimport ReactorListModal from './ReactorListModal.async';\n\nimport './MiddleColumn.scss';\n\ntype StateProps = {\n chatId?: string;\n threadId?: number;\n messageListType?: MessageListType;\n isPrivate?: boolean;\n isPinnedMessageList?: boolean;\n isScheduledMessageList?: boolean;\n canPost?: boolean;\n currentUserBannedRights?: ApiChatBannedRights;\n defaultBannedRights?: ApiChatBannedRights;\n hasPinnedOrAudioPlayer?: boolean;\n pinnedMessagesCount?: number;\n theme: ThemeKey;\n customBackground?: string;\n backgroundColor?: string;\n patternColor?: string;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n isBackgroundBlurred?: boolean;\n isMobileSearchActive?: boolean;\n isSelectModeActive?: boolean;\n isPaymentModalOpen?: boolean;\n isReceiptModalOpen?: boolean;\n isSeenByModalOpen: boolean;\n isReactorListModalOpen: boolean;\n animationLevel?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n messageLists?: GlobalMessageList[];\n isChannel?: boolean;\n canSubscribe?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\nconst CLOSE_ANIMATION_DURATION = IS_SINGLE_COLUMN_LAYOUT ? 450 + ANIMATION_END_DELAY : undefined;\n\nfunction isImage(item: DataTransferItem) {\n return item.kind === 'file' && item.type && SUPPORTED_IMAGE_CONTENT_TYPES.has(item.type);\n}\n\nconst MiddleColumn: FC = ({\n chatId,\n threadId,\n messageListType,\n isPrivate,\n isPinnedMessageList,\n messageLists,\n canPost,\n currentUserBannedRights,\n defaultBannedRights,\n hasPinnedOrAudioPlayer,\n pinnedMessagesCount,\n customBackground,\n theme,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown,\n isBackgroundBlurred,\n isMobileSearchActive,\n isSelectModeActive,\n isPaymentModalOpen,\n isReceiptModalOpen,\n isSeenByModalOpen,\n isReactorListModalOpen,\n animationLevel,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n isChannel,\n canSubscribe,\n canStartBot,\n canRestartBot,\n activeEmojiInteractions,\n}) => {\n const {\n openChat,\n unpinAllMessages,\n loadUser,\n closeLocalTextSearch,\n exitMessageSelectMode,\n closePaymentModal,\n clearReceipt,\n joinChannel,\n sendBotCommand,\n restartBot,\n } = getDispatch();\n\n const { width: windowWidth } = useWindowSize();\n\n const lang = useLang();\n const [dropAreaState, setDropAreaState] = useState(DropAreaState.None);\n const [isFabShown, setIsFabShown] = useState();\n const [isNotchShown, setIsNotchShown] = useState();\n const [isUnpinModalOpen, setIsUnpinModalOpen] = useState(false);\n\n const hasTools = hasPinnedOrAudioPlayer && (\n windowWidth < MOBILE_SCREEN_MAX_WIDTH\n || (\n isRightColumnShown && windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ) || (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n )\n );\n\n const renderingChatId = usePrevDuringAnimation(chatId, CLOSE_ANIMATION_DURATION);\n const renderingThreadId = usePrevDuringAnimation(threadId, CLOSE_ANIMATION_DURATION);\n const renderingMessageListType = usePrevDuringAnimation(messageListType, CLOSE_ANIMATION_DURATION);\n const renderingCanSubscribe = usePrevDuringAnimation(canSubscribe, CLOSE_ANIMATION_DURATION);\n const renderingCanStartBot = usePrevDuringAnimation(canStartBot, CLOSE_ANIMATION_DURATION);\n const renderingCanRestartBot = usePrevDuringAnimation(canRestartBot, CLOSE_ANIMATION_DURATION);\n const renderingCanPost = usePrevDuringAnimation(canPost, CLOSE_ANIMATION_DURATION)\n && !renderingCanRestartBot && !renderingCanStartBot && !renderingCanSubscribe;\n const renderingHasTools = usePrevDuringAnimation(hasTools, CLOSE_ANIMATION_DURATION);\n const renderingIsFabShown = usePrevDuringAnimation(isFabShown, CLOSE_ANIMATION_DURATION);\n const renderingIsChannel = usePrevDuringAnimation(isChannel, CLOSE_ANIMATION_DURATION);\n\n const prevTransitionKey = usePrevious(currentTransitionKey);\n\n const cleanupExceptionKey = (\n prevTransitionKey !== undefined && prevTransitionKey < currentTransitionKey ? prevTransitionKey : undefined\n );\n\n const { isReady, handleOpenEnd, handleSlideStop } = useIsReady(\n !shouldSkipHistoryAnimations && animationLevel !== ANIMATION_LEVEL_MIN,\n currentTransitionKey,\n prevTransitionKey,\n chatId,\n );\n\n useEffect(() => {\n return chatId\n ? captureEscKeyListener(() => {\n openChat({ id: undefined });\n })\n : undefined;\n }, [chatId, openChat]);\n\n useOnChange(() => {\n setDropAreaState(DropAreaState.None);\n setIsFabShown(undefined);\n setIsNotchShown(undefined);\n }, [chatId]);\n\n // Fix for mobile virtual keyboard\n useEffect(() => {\n const { visualViewport } = window as any;\n if (!visualViewport) {\n return undefined;\n }\n\n const handleResize = () => {\n if (window.visualViewport.height !== document.documentElement.clientHeight) {\n document.body.classList.add('keyboard-visible');\n } else {\n document.body.classList.remove('keyboard-visible');\n }\n };\n\n visualViewport.addEventListener('resize', handleResize);\n\n return () => {\n visualViewport.removeEventListener('resize', handleResize);\n };\n }, []);\n\n useEffect(() => {\n if (isPrivate) {\n loadUser({ userId: chatId });\n }\n }, [chatId, isPrivate, loadUser]);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n const { items } = e.dataTransfer || {};\n const shouldDrawQuick = items && items.length > 0 && Array.from(items)\n // Filter unnecessary element for drag and drop images in Firefox (https://github.com/Ajaxy/telegram-tt/issues/49)\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#image\n .filter((item) => item.type !== 'text/uri-list')\n // As of September 2021, native clients suggest \"send quick, but compressed\" only for images\n .every(isImage);\n\n setDropAreaState(shouldDrawQuick ? DropAreaState.QuickFile : DropAreaState.Document);\n }, []);\n\n const handleHideDropArea = useCallback(() => {\n setDropAreaState(DropAreaState.None);\n }, []);\n\n const handleOpenUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(true);\n }, []);\n\n const closeUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(false);\n }, []);\n\n const handleUnpinAllMessages = useCallback(() => {\n unpinAllMessages({ chatId });\n closeUnpinModal();\n openChat({ id: chatId });\n }, [unpinAllMessages, openChat, closeUnpinModal, chatId]);\n\n const handleTabletFocus = useCallback(() => {\n openChat({ id: chatId });\n }, [openChat, chatId]);\n\n const handleSubscribeClick = useCallback(() => {\n joinChannel({ chatId });\n }, [joinChannel, chatId]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const customBackgroundValue = useCustomBackground(theme, customBackground);\n\n const className = buildClassName(\n renderingHasTools && 'has-header-tools',\n customBackground && 'custom-bg-image',\n backgroundColor && 'custom-bg-color',\n customBackground && isBackgroundBlurred && 'blurred',\n MASK_IMAGE_DISABLED ? 'mask-image-disabled' : 'mask-image-enabled',\n );\n\n const messagingDisabledClassName = buildClassName(\n 'messaging-disabled',\n !isSelectModeActive && 'shown',\n );\n\n const messageSendingRestrictionReason = getMessageSendingRestrictionReason(\n lang, currentUserBannedRights, defaultBannedRights,\n );\n\n // CSS Variables calculation doesn't work properly with transforms, so we calculate transform values in JS\n const {\n composerHiddenScale, toolbarHiddenScale,\n composerTranslateX, toolbarTranslateX,\n unpinHiddenScale, toolbarForUnpinHiddenScale,\n } = useMemo(\n () => calculateMiddleFooterTransforms(windowWidth, renderingCanPost),\n [renderingCanPost, windowWidth],\n );\n\n const footerClassName = buildClassName(\n 'middle-column-footer',\n !renderingCanPost && 'no-composer',\n renderingCanPost && isNotchShown && !isSelectModeActive && 'with-notch',\n );\n\n const closeChat = () => {\n openChat({ id: undefined }, { forceSyncOnIOs: true });\n };\n\n useHistoryBack(\n renderingChatId && renderingThreadId,\n closeChat, undefined, undefined, undefined,\n messageLists?.map(createMessageHash) || [],\n );\n\n useHistoryBack(isMobileSearchActive, closeLocalTextSearch);\n useHistoryBack(isSelectModeActive, exitMessageSelectMode);\n\n const isMessagingDisabled = Boolean(\n !isPinnedMessageList && !renderingCanPost && !renderingCanRestartBot && !renderingCanStartBot\n && !renderingCanSubscribe && messageSendingRestrictionReason,\n );\n const withMessageListBottomShift = Boolean(\n renderingCanRestartBot || renderingCanSubscribe || renderingCanStartBot || isPinnedMessageList,\n );\n const withExtraShift = Boolean(isMessagingDisabled || isSelectModeActive || isPinnedMessageList);\n\n return (\n \n \n
\n {renderingChatId && renderingThreadId && (\n <>\n
\n \n \n \n
\n {renderingCanPost && (\n \n )}\n {isPinnedMessageList && (\n
\n \n \n {lang('Chat.Pinned.UnpinAll', pinnedMessagesCount, 'i')}\n \n
\n )}\n {isMessagingDisabled && (\n
\n
\n \n {messageSendingRestrictionReason}\n \n
\n
\n )}\n {IS_SINGLE_COLUMN_LAYOUT && renderingCanSubscribe && (\n
\n \n {lang(renderingIsChannel ? 'ProfileJoinChannel' : 'ProfileJoinGroup')}\n \n
\n )}\n {IS_SINGLE_COLUMN_LAYOUT && renderingCanStartBot && (\n
\n \n {lang('BotStart')}\n \n
\n )}\n {IS_SINGLE_COLUMN_LAYOUT && renderingCanRestartBot && (\n
\n \n {lang('BotRestart')}\n \n
\n )}\n \n \n \n \n \n
\n \n\n \n
\n {IS_SINGLE_COLUMN_LAYOUT && }\n \n )}\n {chatId && (\n \n )}\n
\n {activeEmojiInteractions?.map((activeEmojiInteraction, i) => (\n \n ))}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const {\n isBlurred: isBackgroundBlurred, background: customBackground, backgroundColor, patternColor,\n } = global.settings.themes[theme] || {};\n\n const { messageLists } = global.messages;\n const currentMessageList = selectCurrentMessageList(global);\n const { isLeftColumnShown, chats: { listIds }, activeEmojiInteractions } = global;\n\n const state: StateProps = {\n theme,\n customBackground,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isBackgroundBlurred,\n isMobileSearchActive: Boolean(IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global)),\n isSelectModeActive: selectIsInSelectMode(global),\n isPaymentModalOpen: global.payment.isPaymentModalOpen,\n isReceiptModalOpen: Boolean(global.payment.receipt),\n isSeenByModalOpen: Boolean(global.seenByModal),\n isReactorListModalOpen: Boolean(global.reactorModal),\n animationLevel: global.settings.byKey.animationLevel,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n activeEmojiInteractions,\n };\n\n if (!currentMessageList || !listIds.active) {\n return state;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const bot = selectChatBot(global, chatId);\n const pinnedIds = selectPinnedIds(global, chatId);\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n\n const canPost = chat && getCanPostInChat(chat, threadId);\n const isBotNotStarted = selectIsChatBotNotStarted(global, chatId);\n const isPinnedMessageList = messageListType === 'pinned';\n const isScheduledMessageList = messageListType === 'scheduled';\n const isMainThread = messageListType === 'thread' && threadId === MAIN_THREAD_ID;\n const isChannel = Boolean(chat && isChatChannel(chat));\n const canSubscribe = Boolean(\n chat && isMainThread && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canRestartBot = Boolean(bot && selectIsUserBlocked(global, bot.id));\n const canStartBot = !canRestartBot && isBotNotStarted;\n\n return {\n ...state,\n chatId,\n threadId,\n messageListType,\n isPrivate: isUserId(chatId),\n canPost: !isPinnedMessageList && (!chat || canPost) && !isBotNotStarted,\n isPinnedMessageList,\n isScheduledMessageList,\n currentUserBannedRights: chat?.currentUserBannedRights,\n defaultBannedRights: chat?.defaultBannedRights,\n hasPinnedOrAudioPlayer: (\n threadId !== MAIN_THREAD_ID\n || Boolean(!isPinnedMessageList && pinnedIds?.length)\n || Boolean(audioChatId && audioMessageId)\n ),\n pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n messageLists,\n isChannel,\n canSubscribe,\n canStartBot,\n canRestartBot,\n };\n },\n)(MiddleColumn));\n\nfunction useIsReady(\n withAnimations?: boolean,\n currentTransitionKey?: number,\n prevTransitionKey?: number,\n chatId?: string,\n) {\n const [isReady, setIsReady] = useState(!IS_SINGLE_COLUMN_LAYOUT);\n const forceUpdate = useForceUpdate();\n\n const willSwitchMessageList = prevTransitionKey !== undefined && prevTransitionKey !== currentTransitionKey;\n if (willSwitchMessageList) {\n if (withAnimations) {\n setIsReady(false);\n } else {\n forceUpdate();\n }\n }\n\n useOnChange(() => {\n if (!withAnimations) {\n setIsReady(true);\n }\n }, [withAnimations]);\n\n function handleOpenEnd(e: React.TransitionEvent) {\n if (e.propertyName === 'transform' && e.target === e.currentTarget) {\n setIsReady(Boolean(chatId));\n }\n }\n\n function handleSlideStop() {\n setIsReady(true);\n }\n\n return {\n isReady: isReady && !willSwitchMessageList,\n handleOpenEnd: withAnimations ? handleOpenEnd : undefined,\n handleSlideStop: withAnimations ? handleSlideStop : undefined,\n };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ManagementScreens, ProfileState } from '../../types';\nimport { ApiExportedInvite } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectChat,\n selectCurrentGifSearch,\n selectCurrentStickerSearch,\n selectCurrentTextSearch,\n selectIsChatWithSelf,\n selectUser,\n} from '../../modules/selectors';\nimport {\n getCanAddContact, isChatAdmin, isChatChannel, isUserId,\n} from '../../modules/helpers';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\nimport { getDayStartAt } from '../../util/dateFormat';\n\nimport SearchInput from '../ui/SearchInput';\nimport Button from '../ui/Button';\nimport Transition from '../ui/Transition';\nimport ConfirmDialog from '../ui/ConfirmDialog';\n\nimport './RightHeader.scss';\n\ntype OwnProps = {\n chatId?: string;\n isColumnOpen?: boolean;\n isProfile?: boolean;\n isSearch?: boolean;\n isManagement?: boolean;\n isStickerSearch?: boolean;\n isGifSearch?: boolean;\n isPollResults?: boolean;\n isAddingChatMembers?: boolean;\n shouldSkipAnimation?: boolean;\n profileState?: ProfileState;\n managementScreen?: ManagementScreens;\n onClose: () => void;\n onScreenSelect: (screen: ManagementScreens) => void;\n};\n\ntype StateProps = {\n canAddContact?: boolean;\n canManage?: boolean;\n isChannel?: boolean;\n userId?: string;\n messageSearchQuery?: string;\n stickerSearchQuery?: string;\n gifSearchQuery?: string;\n isEditingInvite?: boolean;\n currentInviteInfo?: ApiExportedInvite;\n};\n\nconst COLUMN_CLOSE_DELAY_MS = 300;\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nenum HeaderContent {\n Profile,\n MemberList,\n SharedMedia,\n Search,\n Management,\n ManageInitial,\n ManageChannelSubscribers,\n ManageChatAdministrators,\n ManageChatPrivacyType,\n ManageDiscussion,\n ManageGroupPermissions,\n ManageGroupRemovedUsers,\n ManageChannelRemovedUsers,\n ManageGroupUserPermissionsCreate,\n ManageGroupUserPermissions,\n ManageGroupRecentActions,\n ManageGroupAdminRights,\n ManageGroupNewAdminRights,\n ManageGroupMembers,\n ManageGroupAddAdmins,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n ManageInvites,\n ManageEditInvite,\n ManageReactions,\n ManageInviteInfo,\n ManageJoinRequests,\n}\n\nconst RightHeader: FC = ({\n chatId,\n isColumnOpen,\n isProfile,\n isSearch,\n isManagement,\n isStickerSearch,\n isGifSearch,\n isPollResults,\n isAddingChatMembers,\n profileState,\n managementScreen,\n canAddContact,\n userId,\n canManage,\n isChannel,\n onClose,\n onScreenSelect,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n shouldSkipAnimation,\n isEditingInvite,\n currentInviteInfo,\n}) => {\n const {\n setLocalTextSearchQuery,\n setStickerSearchQuery,\n setGifSearchQuery,\n searchTextMessagesLocal,\n toggleManagement,\n openHistoryCalendar,\n addContact,\n setEditingExportedInvite,\n deleteExportedChatInvite,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const backButtonRef = useRef(null);\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n\n const handleEditInviteClick = useCallback(() => {\n setEditingExportedInvite({ chatId: chatId!, invite: currentInviteInfo! });\n onScreenSelect(ManagementScreens.EditInvite);\n }, [chatId, currentInviteInfo, onScreenSelect, setEditingExportedInvite]);\n\n const handleDeleteInviteClick = useCallback(() => {\n deleteExportedChatInvite({ chatId: chatId!, link: currentInviteInfo!.link });\n onScreenSelect(ManagementScreens.Invites);\n closeDeleteDialog();\n }, [chatId, closeDeleteDialog, currentInviteInfo, deleteExportedChatInvite, onScreenSelect]);\n\n const handleMessageSearchQueryChange = useCallback((query: string) => {\n setLocalTextSearchQuery({ query });\n\n if (query.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleStickerSearchQueryChange = useCallback((query: string) => {\n setStickerSearchQuery({ query });\n }, [setStickerSearchQuery]);\n\n const handleGifSearchQueryChange = useCallback((query: string) => {\n setGifSearchQuery({ query });\n }, [setGifSearchQuery]);\n\n const handleAddContact = useCallback(() => {\n addContact({ userId });\n }, [addContact, userId]);\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isColumnOpen);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isColumnOpen);\n }, COLUMN_CLOSE_DELAY_MS);\n }, [isColumnOpen]);\n\n const lang = useLang();\n const contentKey = isProfile ? (\n profileState === ProfileState.Profile ? (\n HeaderContent.Profile\n ) : profileState === ProfileState.SharedMedia ? (\n HeaderContent.SharedMedia\n ) : profileState === ProfileState.MemberList ? (\n HeaderContent.MemberList\n ) : -1 // Never reached\n ) : isSearch ? (\n HeaderContent.Search\n ) : isPollResults ? (\n HeaderContent.PollResults\n ) : isStickerSearch ? (\n HeaderContent.StickerSearch\n ) : isGifSearch ? (\n HeaderContent.GifSearch\n ) : isAddingChatMembers ? (\n HeaderContent.AddingMembers\n ) : isManagement ? (\n managementScreen === ManagementScreens.Initial ? (\n HeaderContent.ManageInitial\n ) : managementScreen === ManagementScreens.ChatPrivacyType ? (\n HeaderContent.ManageChatPrivacyType\n ) : managementScreen === ManagementScreens.Discussion ? (\n HeaderContent.ManageDiscussion\n ) : managementScreen === ManagementScreens.ChannelSubscribers ? (\n HeaderContent.ManageChannelSubscribers\n ) : managementScreen === ManagementScreens.GroupPermissions ? (\n HeaderContent.ManageGroupPermissions\n ) : managementScreen === ManagementScreens.ChatAdministrators ? (\n HeaderContent.ManageChatAdministrators\n ) : managementScreen === ManagementScreens.GroupRemovedUsers ? (\n HeaderContent.ManageGroupRemovedUsers\n ) : managementScreen === ManagementScreens.ChannelRemovedUsers ? (\n HeaderContent.ManageChannelRemovedUsers\n ) : managementScreen === ManagementScreens.GroupUserPermissionsCreate ? (\n HeaderContent.ManageGroupUserPermissionsCreate\n ) : managementScreen === ManagementScreens.GroupUserPermissions ? (\n HeaderContent.ManageGroupUserPermissions\n ) : managementScreen === ManagementScreens.GroupRecentActions ? (\n HeaderContent.ManageGroupRecentActions\n ) : managementScreen === ManagementScreens.ChatAdminRights ? (\n HeaderContent.ManageGroupAdminRights\n ) : managementScreen === ManagementScreens.ChatNewAdminRights ? (\n HeaderContent.ManageGroupNewAdminRights\n ) : managementScreen === ManagementScreens.GroupMembers ? (\n HeaderContent.ManageGroupMembers\n ) : managementScreen === ManagementScreens.Invites ? (\n HeaderContent.ManageInvites\n ) : managementScreen === ManagementScreens.EditInvite ? (\n HeaderContent.ManageEditInvite\n ) : managementScreen === ManagementScreens.GroupAddAdmins ? (\n HeaderContent.ManageGroupAddAdmins\n ) : managementScreen === ManagementScreens.Reactions ? (\n HeaderContent.ManageReactions\n ) : managementScreen === ManagementScreens.InviteInfo ? (\n HeaderContent.ManageInviteInfo\n ) : managementScreen === ManagementScreens.JoinRequests ? (\n HeaderContent.ManageJoinRequests\n ) : undefined // Never reached\n ) : undefined; // When column is closed\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true) ?? -1;\n\n function renderHeaderContent() {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case HeaderContent.PollResults:\n return

{lang('PollResults')}

;\n case HeaderContent.Search:\n return (\n <>\n \n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n \n );\n case HeaderContent.AddingMembers:\n return

{lang(isChannel ? 'ChannelAddSubscribers' : 'GroupAddMembers')}

;\n case HeaderContent.ManageInitial:\n return

{lang('Edit')}

;\n case HeaderContent.ManageChatPrivacyType:\n return

{lang(isChannel ? 'ChannelTypeHeader' : 'GroupTypeHeader')}

;\n case HeaderContent.ManageDiscussion:\n return

{lang('Discussion')}

;\n case HeaderContent.ManageChatAdministrators:\n return

{lang('ChannelAdministrators')}

;\n case HeaderContent.ManageGroupRecentActions:\n return

{lang('Group.Info.AdminLog')}

;\n case HeaderContent.ManageGroupAdminRights:\n return

{lang('EditAdminRights')}

;\n case HeaderContent.ManageGroupNewAdminRights:\n return

{lang('SetAsAdmin')}

;\n case HeaderContent.ManageGroupPermissions:\n return

{lang('ChannelPermissions')}

;\n case HeaderContent.ManageGroupRemovedUsers:\n return

{lang('BlockedUsers')}

;\n case HeaderContent.ManageChannelRemovedUsers:\n return

{lang('ChannelBlockedUsers')}

;\n case HeaderContent.ManageGroupUserPermissionsCreate:\n return

{lang('ChannelAddException')}

;\n case HeaderContent.ManageGroupUserPermissions:\n return

{lang('UserRestrictions')}

;\n case HeaderContent.ManageInvites:\n return

{lang('lng_group_invite_title')}

;\n case HeaderContent.ManageEditInvite:\n return

{isEditingInvite ? lang('EditLink') : lang('NewLink')}

;\n case HeaderContent.ManageInviteInfo:\n return (\n <>\n

{lang('InviteLink')}

\n
\n {currentInviteInfo && !currentInviteInfo.isRevoked && (\n \n \n \n )}\n {currentInviteInfo && currentInviteInfo.isRevoked && (\n <>\n \n \n \n \n \n )}\n
\n \n );\n case HeaderContent.ManageJoinRequests:\n return

{isChannel ? lang('SubscribeRequests') : lang('MemberRequests')}

;\n case HeaderContent.ManageGroupAddAdmins:\n return

{lang('Channel.Management.AddModerator')}

;\n case HeaderContent.StickerSearch:\n return (\n \n );\n case HeaderContent.GifSearch:\n return (\n \n );\n case HeaderContent.SharedMedia:\n return

{lang('SharedMedia')}

;\n case HeaderContent.ManageChannelSubscribers:\n return

{lang('ChannelSubscribers')}

;\n case HeaderContent.MemberList:\n case HeaderContent.ManageGroupMembers:\n return

{lang('GroupMembers')}

;\n case HeaderContent.ManageReactions:\n return

{lang('Reactions')}

;\n default:\n return (\n <>\n

Profile

\n
\n {canAddContact && (\n \n \n \n )}\n {canManage && (\n \n \n \n )}\n
\n \n );\n }\n }\n\n const isBackButton = (\n IS_SINGLE_COLUMN_LAYOUT\n || contentKey === HeaderContent.SharedMedia\n || contentKey === HeaderContent.MemberList\n || contentKey === HeaderContent.AddingMembers\n || isManagement\n );\n\n const buttonClassName = buildClassName(\n 'animated-close-icon',\n isBackButton && 'state-back',\n (shouldSkipTransition || shouldSkipAnimation) && 'no-transition',\n );\n\n return (\n
\n \n
\n \n \n {renderHeaderContent()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isProfile, isManagement }): StateProps => {\n const { query: messageSearchQuery } = selectCurrentTextSearch(global) || {};\n const { query: stickerSearchQuery } = selectCurrentStickerSearch(global) || {};\n const { query: gifSearchQuery } = selectCurrentGifSearch(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChannel = chat && isChatChannel(chat);\n const user = isProfile && chatId && isUserId(chatId) ? selectUser(global, chatId) : undefined;\n\n const canAddContact = user && getCanAddContact(user);\n const canManage = Boolean(\n !isManagement\n && isProfile\n && !canAddContact\n && chat\n && !selectIsChatWithSelf(global, chat.id)\n // chat.isCreator is for Basic Groups\n && (isUserId(chat.id) || ((isChatAdmin(chat) || chat.isCreator) && !chat.isNotJoined)),\n );\n const isEditingInvite = Boolean(chatId && global.management.byChatId[chatId]?.editingInvite);\n const currentInviteInfo = chatId ? global.management.byChatId[chatId]?.inviteInfo?.invite : undefined;\n\n return {\n canManage,\n canAddContact,\n isChannel,\n userId: user?.id,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n isEditingInvite,\n currentInviteInfo,\n };\n },\n)(RightHeader));\n","import { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport {\n ApiChat, ApiChatMember, ApiMessage, ApiUser, ApiUserStatus,\n} from '../../../api/types';\nimport { ProfileTabType, SharedMediaType } from '../../../types';\n\nimport { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { getMessageContentIds, sortChatIds, sortUserIds } from '../../../modules/helpers';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nexport default function useProfileViewportIds(\n isRightColumnShown: boolean,\n loadMoreMembers: AnyToVoidFunction,\n loadCommonChats: AnyToVoidFunction,\n searchMessages: AnyToVoidFunction,\n tabType: ProfileTabType,\n mediaSearchType?: SharedMediaType,\n groupChatMembers?: ApiChatMember[],\n commonChatIds?: string[],\n usersById?: Record,\n userStatusesById?: Record,\n chatsById?: Record,\n chatMessages?: Record,\n foundIds?: number[],\n chatId?: string,\n lastSyncTime?: number,\n serverTimeOffset = 0,\n) {\n const resultType = tabType === 'members' || !mediaSearchType ? tabType : mediaSearchType;\n\n const memberIds = useMemo(() => {\n if (!groupChatMembers || !usersById || !userStatusesById) {\n return undefined;\n }\n\n return sortUserIds(\n groupChatMembers.map(({ userId }) => userId),\n usersById,\n userStatusesById,\n undefined,\n serverTimeOffset,\n );\n }, [groupChatMembers, serverTimeOffset, usersById, userStatusesById]);\n\n const chatIds = useMemo(() => {\n if (!commonChatIds || !chatsById) {\n return undefined;\n }\n\n return sortChatIds(commonChatIds, chatsById, true);\n }, [chatsById, commonChatIds]);\n\n const [memberViewportIds, getMoreMembers, noProfileInfoForMembers] = useInfiniteScrollForLoadableItems(\n resultType, loadMoreMembers, lastSyncTime, memberIds,\n );\n\n const [mediaViewportIds, getMoreMedia, noProfileInfoForMedia] = useInfiniteScrollForSharedMedia(\n 'media', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [documentViewportIds, getMoreDocuments, noProfileInfoForDocuments] = useInfiniteScrollForSharedMedia(\n 'documents', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [linkViewportIds, getMoreLinks, noProfileInfoForLinks] = useInfiniteScrollForSharedMedia(\n 'links', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [audioViewportIds, getMoreAudio, noProfileInfoForAudio] = useInfiniteScrollForSharedMedia(\n 'audio', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [voiceViewportIds, getMoreVoices, noProfileInfoForVoices] = useInfiniteScrollForSharedMedia(\n 'voice', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [commonChatViewportIds, getMoreCommonChats, noProfileInfoForCommonChats] = useInfiniteScrollForLoadableItems(\n resultType, loadCommonChats, lastSyncTime, chatIds,\n );\n\n let viewportIds: number[] | string[] | undefined;\n let getMore: AnyToVoidFunction | undefined;\n let noProfileInfo = false;\n\n switch (resultType) {\n case 'members':\n viewportIds = memberViewportIds;\n getMore = getMoreMembers;\n noProfileInfo = noProfileInfoForMembers;\n break;\n case 'commonChats':\n viewportIds = commonChatViewportIds;\n getMore = getMoreCommonChats;\n noProfileInfo = noProfileInfoForCommonChats;\n break;\n case 'media':\n viewportIds = mediaViewportIds;\n getMore = getMoreMedia;\n noProfileInfo = noProfileInfoForMedia;\n break;\n case 'documents':\n viewportIds = documentViewportIds;\n getMore = getMoreDocuments;\n noProfileInfo = noProfileInfoForDocuments;\n break;\n case 'links':\n viewportIds = linkViewportIds;\n getMore = getMoreLinks;\n noProfileInfo = noProfileInfoForLinks;\n break;\n case 'audio':\n viewportIds = audioViewportIds;\n getMore = getMoreAudio;\n noProfileInfo = noProfileInfoForAudio;\n break;\n case 'voice':\n viewportIds = voiceViewportIds;\n getMore = getMoreVoices;\n noProfileInfo = noProfileInfoForVoices;\n break;\n }\n\n return [resultType, viewportIds, getMore, noProfileInfo] as const;\n}\n\nfunction useInfiniteScrollForLoadableItems(\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n itemIds?: string[],\n) {\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n itemIds,\n undefined,\n MEMBERS_SLICE,\n );\n\n const isOnTop = !viewportIds || !itemIds || viewportIds[0] === itemIds[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n\nfunction useInfiniteScrollForSharedMedia(\n forSharedMediaType: SharedMediaType,\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n chatMessages?: Record,\n foundIds?: number[],\n) {\n const messageIdsRef = useRef();\n\n useOnChange(() => {\n if (currentResultType === forSharedMediaType && chatMessages && foundIds) {\n messageIdsRef.current = getMessageContentIds(\n chatMessages,\n foundIds,\n forSharedMediaType,\n );\n }\n }, [chatMessages, foundIds, currentResultType, forSharedMediaType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n messageIdsRef.current,\n undefined,\n forSharedMediaType === 'media' ? SHARED_MEDIA_SLICE : MESSAGE_SEARCH_SLICE,\n );\n\n const isOnTop = !viewportIds || !messageIdsRef.current || viewportIds[0] === messageIdsRef.current[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nimport { ProfileState } from '../../../types';\n\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport { throttle } from '../../../util/schedulers';\nimport useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps';\n\nconst TRANSITION_DURATION = 300;\nconst PROGRAMMATIC_SCROLL_TIMEOUT_MS = 350;\n\nconst runThrottledForScroll = throttle((cb) => cb(), 250, false);\n\nlet isScrollingProgrammatically = false;\n\nexport default function useProfileState(\n containerRef: { current: HTMLDivElement | null },\n tabType: string,\n profileState: ProfileState,\n onProfileStateChange: (state: ProfileState) => void,\n) {\n // Scroll to tabs if needed\n useEffectWithPrevDeps(([prevTabType]) => {\n if (prevTabType && prevTabType !== tabType) {\n const container = containerRef.current!;\n const tabsEl = container.querySelector('.TabList')!;\n if (container.scrollTop < tabsEl.offsetTop) {\n onProfileStateChange(tabType === 'members' ? ProfileState.MemberList : ProfileState.SharedMedia);\n isScrollingProgrammatically = true;\n fastSmoothScroll(container, tabsEl, 'start', undefined, undefined, undefined, TRANSITION_DURATION);\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n }\n }\n }, [tabType, onProfileStateChange]);\n\n // Scroll to top\n useEffectWithPrevDeps(([prevProfileState]) => {\n if (profileState !== ProfileState.Profile || profileState === prevProfileState) {\n return;\n }\n\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl || tabListEl.offsetTop > container.scrollTop) {\n return;\n }\n\n isScrollingProgrammatically = true;\n fastSmoothScroll(\n container,\n container.firstElementChild as HTMLElement,\n 'start',\n undefined,\n container.offsetHeight * 2,\n );\n\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n\n onProfileStateChange(profileState);\n }, [profileState]);\n\n const determineProfileState = useCallback(() => {\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl) {\n return;\n }\n\n let state: ProfileState = ProfileState.Profile;\n if (container.scrollTop >= tabListEl.offsetTop) {\n state = tabType === 'members'\n ? ProfileState.MemberList\n : ProfileState.SharedMedia;\n }\n\n onProfileStateChange(state);\n }, [containerRef, onProfileStateChange, tabType]);\n\n // Determine profile state when switching tabs\n useEffect(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n determineProfileState();\n }, [determineProfileState, tabType]);\n\n // Determine profile state when scrolling\n const handleScroll = useCallback(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n runThrottledForScroll(determineProfileState);\n }, [determineProfileState]);\n\n return { handleScroll };\n}\n","import React, {\n FC, useCallback, useEffect, useMemo, useRef, useState, memo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n MAIN_THREAD_ID,\n ApiMessage,\n ApiChat,\n ApiChatMember,\n ApiUser,\n ApiUserStatus,\n} from '../../api/types';\nimport {\n NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType, AudioOrigin,\n} from '../../types';\n\nimport {\n MEMBERS_SLICE,\n PROFILE_SENSITIVE_AREA,\n SHARED_MEDIA_SLICE,\n SLIDE_TRANSITION_DURATION,\n} from '../../config';\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isUserBot, isUserId,\n} from '../../modules/helpers';\nimport {\n selectChatMessages,\n selectChat,\n selectCurrentMediaSearch,\n selectIsRightColumnShown,\n selectTheme,\n selectActiveDownloadIds,\n selectUser,\n} from '../../modules/selectors';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport { getSenderName } from '../left/search/helpers/getSenderName';\nimport useCacheBuster from '../../hooks/useCacheBuster';\nimport useProfileViewportIds from './hooks/useProfileViewportIds';\nimport useProfileState from './hooks/useProfileState';\nimport useTransitionFixes from './hooks/useTransitionFixes';\nimport useAsyncRendering from './hooks/useAsyncRendering';\nimport useLang from '../../hooks/useLang';\n\nimport Transition from '../ui/Transition';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport TabList from '../ui/TabList';\nimport Spinner from '../ui/Spinner';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport ProfileInfo from '../common/ProfileInfo';\nimport Document from '../common/Document';\nimport Audio from '../common/Audio';\nimport ChatExtra from '../common/ChatExtra';\nimport Media from '../common/Media';\nimport WebLink from '../common/WebLink';\nimport NothingFound from '../common/NothingFound';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport DeleteMemberModal from './DeleteMemberModal';\nimport GroupChatInfo from '../common/GroupChatInfo';\n\nimport './Profile.scss';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\n\ntype OwnProps = {\n chatId: string;\n profileState: ProfileState;\n onProfileStateChange: (state: ProfileState) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n isChannel?: boolean;\n currentUserId?: string;\n resolvedUserId?: string;\n chatMessages?: Record;\n foundIds?: number[];\n mediaSearchType?: SharedMediaType;\n hasCommonChatsTab?: boolean;\n hasMembersTab?: boolean;\n areMembersHidden?: boolean;\n canAddMembers?: boolean;\n canDeleteMembers?: boolean;\n members?: ApiChatMember[];\n commonChatIds?: string[];\n chatsById: Record;\n usersById: Record;\n userStatusesById: Record;\n isRightColumnShown: boolean;\n isRestricted?: boolean;\n lastSyncTime?: number;\n serverTimeOffset: number;\n activeDownloadIds: number[];\n isChatProtected?: boolean;\n};\n\nconst TABS = [\n { type: 'media', title: 'SharedMediaTab2' },\n { type: 'documents', title: 'SharedFilesTab2' },\n { type: 'links', title: 'SharedLinksTab2' },\n { type: 'audio', title: 'SharedMusicTab2' },\n { type: 'voice', title: 'SharedVoiceTab2' },\n];\n\nconst HIDDEN_RENDER_DELAY = 1000;\nconst INTERSECTION_THROTTLE = 500;\n\nconst Profile: FC = ({\n chatId,\n profileState,\n onProfileStateChange,\n theme,\n isChannel,\n resolvedUserId,\n currentUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasCommonChatsTab,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n commonChatIds,\n members,\n usersById,\n userStatusesById,\n chatsById,\n isRightColumnShown,\n isRestricted,\n lastSyncTime,\n activeDownloadIds,\n serverTimeOffset,\n isChatProtected,\n}) => {\n const {\n setLocalMediaSearchType,\n loadMoreMembers,\n loadCommonChats,\n openChat,\n searchMediaMessagesLocal,\n openMediaViewer,\n openAudioPlayer,\n focusMessage,\n loadProfilePhotos,\n setNewChatMembersDialogState,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(0);\n const [deletingUserId, setDeletingUserId] = useState();\n\n const tabs = useMemo(() => ([\n ...(hasMembersTab ? [{\n type: 'members', title: isChannel ? 'ChannelSubscribers' : 'GroupMembers',\n }] : []),\n ...TABS,\n ...(hasCommonChatsTab ? [{\n type: 'commonChats', title: 'SharedGroupsTab2',\n }] : []),\n ]), [hasCommonChatsTab, hasMembersTab, isChannel]);\n const tabType = tabs[activeTab].type as ProfileTabType;\n\n const [resultType, viewportIds, getMore, noProfileInfo] = useProfileViewportIds(\n isRightColumnShown, loadMoreMembers, loadCommonChats, searchMediaMessagesLocal, tabType, mediaSearchType, members,\n commonChatIds, usersById, userStatusesById, chatsById, chatMessages, foundIds, chatId, lastSyncTime,\n serverTimeOffset,\n );\n const activeKey = tabs.findIndex(({ type }) => type === resultType);\n\n const { handleScroll } = useProfileState(containerRef, tabType, profileState, onProfileStateChange);\n\n const { applyTransitionFix, releaseTransitionFix } = useTransitionFixes(containerRef);\n\n const [cacheBuster, resetCacheBuster] = useCacheBuster();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleTransitionStop = useCallback(() => {\n releaseTransitionFix();\n resetCacheBuster();\n }, [releaseTransitionFix, resetCacheBuster]);\n\n const handleNewMemberDialogOpen = useCallback(() => {\n setNewChatMembersDialogState(NewChatMembersProgress.InProgress);\n }, [setNewChatMembersDialogState]);\n\n // Update search type when switching tabs\n useEffect(() => {\n setLocalMediaSearchType({ mediaType: tabType });\n }, [setLocalMediaSearchType, tabType]);\n\n const profileId = resolvedUserId || chatId;\n\n useEffect(() => {\n if (lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [loadProfilePhotos, profileId, lastSyncTime]);\n\n const handleSelectMedia = useCallback((messageId: number) => {\n openMediaViewer({\n chatId: profileId,\n threadId: MAIN_THREAD_ID,\n messageId,\n origin: MediaViewerOrigin.SharedMedia,\n });\n }, [profileId, openMediaViewer]);\n\n const handlePlayAudio = useCallback((messageId: number) => {\n openAudioPlayer({ chatId: profileId, messageId });\n }, [profileId, openAudioPlayer]);\n\n const handleMemberClick = useCallback((id: string) => {\n openChat({ id });\n }, [openChat]);\n\n const handleMessageFocus = useCallback((messageId: number) => {\n focusMessage({ chatId: profileId, messageId });\n }, [profileId, focusMessage]);\n\n const handleDeleteMembersModalClose = useCallback(() => {\n setDeletingUserId(undefined);\n }, []);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.Profile',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveTab(Math.min(activeTab + 1, tabs.length - 1));\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveTab(Math.max(0, activeTab - 1));\n return true;\n }\n\n return false;\n }),\n });\n }, [activeTab, tabs.length]);\n\n let renderingDelay;\n const isFirstTab = resultType === 'members' || (!hasMembersTab && resultType === 'media');\n // @optimization Used to unparallelize rendering of message list and profile media\n if (isFirstTab) {\n renderingDelay = !isRightColumnShown ? HIDDEN_RENDER_DELAY : 0;\n // @optimization Used to delay first render of secondary tabs while animating\n } else if (!viewportIds) {\n renderingDelay = SLIDE_TRANSITION_DURATION;\n }\n const canRenderContent = useAsyncRendering([chatId, resultType], renderingDelay);\n\n function getMemberContextAction(memberId: string) {\n return memberId === currentUserId || !canDeleteMembers ? undefined : [{\n title: lang('lng_context_remove_from_group'),\n icon: 'stop',\n handler: () => {\n setDeletingUserId(memberId);\n },\n }];\n }\n\n function renderContent() {\n if (!viewportIds || !canRenderContent || !chatMessages) {\n const noSpinner = isFirstTab && !canRenderContent;\n\n return (\n
\n {!noSpinner && }\n
\n );\n }\n\n if (!viewportIds.length) {\n let text: string;\n\n switch (resultType) {\n case 'members':\n text = areMembersHidden ? 'You have no access to group members list.' : 'No members found';\n break;\n case 'commonChats':\n text = lang('NoGroupsInCommon');\n break;\n case 'documents':\n text = lang('lng_media_file_empty');\n break;\n case 'links':\n text = lang('lng_media_link_empty');\n break;\n case 'audio':\n text = lang('lng_media_song_empty');\n break;\n case 'voice':\n text = lang('lng_media_audio_empty');\n break;\n default:\n text = lang('SharedMedia.EmptyTitle');\n }\n\n return (\n
\n \n
\n );\n }\n\n return (\n \n {resultType === 'media' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'documents' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'links' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'audio' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'voice' ? (\n (viewportIds as number[])!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'members' ? (\n (viewportIds as string[])!.map((id, i) => (\n handleMemberClick(id)}\n contextActions={getMemberContextAction(id)}\n >\n \n \n ))\n ) : resultType === 'commonChats' ? (\n (viewportIds as string[])!.map((id, i) => (\n openChat({ id })}\n >\n \n \n ))\n ) : undefined}\n
\n );\n }\n\n return (\n \n {!noProfileInfo && renderProfileInfo(chatId, resolvedUserId)}\n {!isRestricted && (\n \n \n {renderContent()}\n \n \n
\n )}\n\n {canAddMembers && (\n \n \n \n )}\n {canDeleteMembers && (\n \n )}\n \n );\n};\n\nfunction renderProfileInfo(chatId: string, resolvedUserId?: string) {\n return (\n
\n \n \n
\n );\n}\n\nfunction buildInfiniteScrollItemSelector(resultType: string) {\n return [\n // Used on first render\n `.shared-media-transition > div:only-child > .${resultType}-list > .scroll-item`,\n // Used after transition\n `.shared-media-transition > .Transition__slide--active > .${resultType}-list > .scroll-item`,\n ].join(', ');\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const chatMessages = selectChatMessages(global, chatId);\n const { currentType: mediaSearchType, resultsByType } = selectCurrentMediaSearch(global) || {};\n const { foundIds } = (resultsByType && mediaSearchType && resultsByType[mediaSearchType]) || {};\n\n const { byId: usersById, statusesById: userStatusesById } = global.users;\n const { byId: chatsById } = global.chats;\n\n const isGroup = chat && isChatGroup(chat);\n const isChannel = chat && isChatChannel(chat);\n const hasMembersTab = isGroup || (isChannel && isChatAdmin(chat!));\n const members = chat?.fullInfo?.members;\n const areMembersHidden = hasMembersTab && chat && chat.fullInfo && !chat.fullInfo.canViewMembers;\n const canAddMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'inviteUsers') || chat.isCreator);\n const canDeleteMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'banUsers') || chat.isCreator);\n const activeDownloadIds = selectActiveDownloadIds(global, chatId);\n\n let hasCommonChatsTab;\n let resolvedUserId;\n let user;\n if (isUserId(chatId)) {\n resolvedUserId = chatId;\n user = selectUser(global, resolvedUserId);\n hasCommonChatsTab = user && !user.isSelf && !isUserBot(user);\n }\n\n return {\n theme: selectTheme(global),\n isChannel,\n resolvedUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasCommonChatsTab,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n currentUserId: global.currentUserId,\n isRightColumnShown: selectIsRightColumnShown(global),\n isRestricted: chat?.isRestricted,\n lastSyncTime: global.lastSyncTime,\n serverTimeOffset: global.serverTimeOffset,\n activeDownloadIds,\n usersById,\n userStatusesById,\n chatsById,\n isChatProtected: chat?.isProtected,\n ...(hasMembersTab && members && { members }),\n ...(hasCommonChatsTab && user && { commonChatIds: user.commonChats?.ids }),\n };\n },\n)(Profile));\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nexport default function useTransitionFixes(\n containerRef: { current: HTMLDivElement | null },\n transitionElSelector = '.Transition.shared-media-transition',\n) {\n // Set `min-height` for shared media container to prevent jumping when switching tabs\n useEffect(() => {\n function setMinHeight() {\n const container = containerRef.current!;\n const transitionEl = container.querySelector(transitionElSelector);\n const tabsEl = container.querySelector('.TabList');\n if (transitionEl && tabsEl) {\n transitionEl.style.minHeight = `${container.offsetHeight - tabsEl.offsetHeight}px`;\n }\n }\n\n setMinHeight();\n\n window.addEventListener('resize', setMinHeight, false);\n\n return () => {\n window.removeEventListener('resize', setMinHeight, false);\n };\n }, [containerRef, transitionElSelector]);\n\n // Workaround for scrollable content flickering during animation.\n const applyTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n if (container.style.overflowY !== 'hidden') {\n const scrollBarWidth = container.offsetWidth - container.clientWidth;\n container.style.overflowY = 'hidden';\n container.style.marginRight = `${scrollBarWidth}px`;\n }\n }, [containerRef]);\n\n const releaseTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n container.style.overflowY = 'scroll';\n container.style.marginRight = '0';\n }, [containerRef]);\n\n return { applyTransitionFix, releaseTransitionFix };\n}\n","import { useCallback, useState } from '../lib/teact/teact';\n\nconst useCacheBuster = () => {\n const [cacheBuster, setCacheBuster] = useState(false);\n\n const updateCacheBuster = useCallback(() => {\n setCacheBuster((current) => !current);\n }, []);\n\n return [cacheBuster, updateCacheBuster] as const;\n};\n\nexport default useCacheBuster;\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './RightSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst RightSearchAsync: FC = (props) => {\n const RightSearch = useModuleLoader(Bundles.Extra, 'RightSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return RightSearch ? : ;\n};\n\nexport default memo(RightSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Management';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nimport Loading from '../../ui/Loading';\n\nconst ManagementAsync: FC = (props) => {\n const Management = useModuleLoader(Bundles.Extra, 'Management');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Management ? : ;\n};\n\nexport default memo(ManagementAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst StickerSearchAsync: FC = () => {\n const StickerSearch = useModuleLoader(Bundles.Extra, 'StickerSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSearch ? : ;\n};\n\nexport default memo(StickerSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst GifSearchAsync: FC = () => {\n const GifSearch = useModuleLoader(Bundles.Extra, 'GifSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return GifSearch ? : ;\n};\n\nexport default memo(GifSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst PollResultsAsync: FC = () => {\n const PollResults = useModuleLoader(Bundles.Extra, 'PollResults');\n\n return PollResults ? : ;\n};\n\nexport default memo(PollResultsAsync);\n","import React, {\n FC, useCallback, useMemo, memo, useState, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiChatMember, ApiUpdateConnectionStateType,\n} from '../../api/types';\nimport { NewChatMembersProgress } from '../../types';\n\nimport { unique } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport {\n filterUsersByName, isChatChannel, isUserBot, sortChatIds,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Picker from '../common/Picker';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport Spinner from '../ui/Spinner';\n\nimport './AddChatMembers.scss';\n\nexport type OwnProps = {\n chatId: string;\n isActive: boolean;\n onNextStep: (memberIds: string[]) => void;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n isChannel?: boolean;\n members?: ApiChatMember[];\n currentUserId?: string;\n chatsById: Record;\n localContactIds?: string[];\n searchQuery?: string;\n isLoading: boolean;\n isSearching?: boolean;\n localUserIds?: string[];\n globalUserIds?: string[];\n};\n\nconst AddChatMembers: FC = ({\n isChannel,\n connectionState,\n members,\n onNextStep,\n currentUserId,\n chatsById,\n localContactIds,\n isLoading,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n onClose,\n isActive,\n}) => {\n const { setUserSearchQuery, loadContactList } = getDispatch();\n\n const lang = useLang();\n const [selectedMemberIds, setSelectedMemberIds] = useState([]);\n const prevSelectedMemberIds = usePrevious(selectedMemberIds);\n const noPickerScrollRestore = prevSelectedMemberIds === selectedMemberIds;\n\n useEffect(() => {\n if (isActive && connectionState === 'connectionStateReady') {\n loadContactList();\n }\n }, [connectionState, isActive, loadContactList]);\n\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n return members ? members.map((member) => member.userId) : [];\n }, [members]);\n\n const handleFilterChange = useCallback((query: string) => {\n setUserSearchQuery({ query });\n }, [setUserSearchQuery]);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const filteredContactIds = localContactIds ? filterUsersByName(localContactIds, usersById, searchQuery) : [];\n\n return sortChatIds(\n unique([\n ...filteredContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((userId) => {\n const user = usersById[userId];\n\n // The user can be added to the chat if the following conditions are met:\n // the user has not yet been added to the current chat\n // AND it is not the current user,\n // AND (it is not found (user from global search) OR it is not a bot OR it is a bot,\n // but the current chat is not a channel AND the appropriate permission is set).\n return (\n !memberIds.includes(userId)\n && userId !== currentUserId\n && (!user || !isUserBot(user) || (!isChannel && user.canBeInvitedToGroup))\n );\n }),\n chatsById,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, currentUserId, memberIds, isChannel,\n ]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length) {\n setUserSearchQuery({ query: '' });\n onNextStep(selectedMemberIds);\n }\n }, [selectedMemberIds, setUserSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: chatsById } = global.chats;\n const { currentUserId, newChatMembersProgress, connectionState } = global;\n const isChannel = chat && isChatChannel(chat);\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalUserIds,\n localUserIds,\n } = global.userSearch;\n\n return {\n isChannel,\n members: chat?.fullInfo?.members,\n currentUserId,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n isLoading: newChatMembersProgress === NewChatMembersProgress.Loading,\n globalUserIds,\n localUserIds,\n connectionState,\n };\n },\n)(AddChatMembers));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ManagementScreens, NewChatMembersProgress, ProfileState, RightColumnContent,\n} from '../../types';\n\nimport { MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport {\n selectAreActiveChatsLoaded,\n selectCurrentMessageList,\n selectRightColumnContentKey,\n} from '../../modules/selectors';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport RightHeader from './RightHeader';\nimport Profile from './Profile';\nimport Transition from '../ui/Transition';\nimport RightSearch from './RightSearch.async';\nimport Management from './management/Management.async';\nimport StickerSearch from './StickerSearch.async';\nimport GifSearch from './GifSearch.async';\nimport PollResults from './PollResults.async';\nimport AddChatMembers from './AddChatMembers';\n\nimport './RightColumn.scss';\n\ntype StateProps = {\n contentKey?: RightColumnContent;\n chatId?: string;\n threadId?: number;\n isChatSelected: boolean;\n shouldSkipHistoryAnimations?: boolean;\n nextManagementScreen?: ManagementScreens;\n};\n\nconst CLOSE_ANIMATION_DURATION = 300;\nconst MAIN_SCREENS_COUNT = Object.keys(RightColumnContent).length / 2;\nconst MANAGEMENT_SCREENS_COUNT = Object.keys(ManagementScreens).length / 2;\n\nfunction blurSearchInput() {\n const searchInput = document.querySelector('.RightHeader .SearchInput input') as HTMLInputElement;\n if (searchInput) {\n searchInput.blur();\n }\n}\n\nconst RightColumn: FC = ({\n contentKey,\n chatId,\n threadId,\n isChatSelected,\n shouldSkipHistoryAnimations,\n nextManagementScreen,\n}) => {\n const {\n toggleChatInfo,\n toggleManagement,\n closeLocalTextSearch,\n setStickerSearchQuery,\n setGifSearchQuery,\n closePollResults,\n addChatMembers,\n setNewChatMembersDialogState,\n setEditingExportedInvite,\n setOpenedInviteInfo,\n requestNextManagementScreen,\n } = getDispatch();\n\n const { width: windowWidth } = useWindowSize();\n const [profileState, setProfileState] = useState(ProfileState.Profile);\n const [managementScreen, setManagementScreen] = useState(ManagementScreens.Initial);\n const [selectedChatMemberId, setSelectedChatMemberId] = useState();\n const [isPromotedByCurrentUser, setIsPromotedByCurrentUser] = useState();\n const isScrolledDown = profileState !== ProfileState.Profile;\n\n const isOpen = contentKey !== undefined;\n const isProfile = contentKey === RightColumnContent.ChatInfo;\n const isSearch = contentKey === RightColumnContent.Search;\n const isManagement = contentKey === RightColumnContent.Management;\n const isStickerSearch = contentKey === RightColumnContent.StickerSearch;\n const isGifSearch = contentKey === RightColumnContent.GifSearch;\n const isPollResults = contentKey === RightColumnContent.PollResults;\n const isAddingChatMembers = contentKey === RightColumnContent.AddingMembers;\n const isOverlaying = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN;\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isOpen);\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true, !isChatSelected) ?? -1;\n\n const close = useCallback((shouldScrollUp = true) => {\n switch (contentKey) {\n case RightColumnContent.AddingMembers:\n setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n break;\n case RightColumnContent.ChatInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n toggleChatInfo(undefined, { forceSyncOnIOs: true });\n break;\n case RightColumnContent.Management: {\n switch (managementScreen) {\n case ManagementScreens.Initial:\n toggleManagement();\n break;\n case ManagementScreens.ChatPrivacyType:\n case ManagementScreens.Discussion:\n case ManagementScreens.GroupPermissions:\n case ManagementScreens.GroupType:\n case ManagementScreens.ChatAdministrators:\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n case ManagementScreens.Invites:\n case ManagementScreens.Reactions:\n case ManagementScreens.JoinRequests:\n case ManagementScreens.ChannelRemovedUsers:\n setManagementScreen(ManagementScreens.Initial);\n break;\n case ManagementScreens.GroupUserPermissionsCreate:\n case ManagementScreens.GroupRemovedUsers:\n case ManagementScreens.GroupUserPermissions:\n setManagementScreen(ManagementScreens.GroupPermissions);\n setSelectedChatMemberId(undefined);\n setIsPromotedByCurrentUser(undefined);\n break;\n case ManagementScreens.ChatAdminRights:\n case ManagementScreens.ChatNewAdminRights:\n case ManagementScreens.GroupAddAdmins:\n case ManagementScreens.GroupRecentActions:\n setManagementScreen(ManagementScreens.ChatAdministrators);\n break;\n case ManagementScreens.EditInvite:\n case ManagementScreens.InviteInfo:\n setManagementScreen(ManagementScreens.Invites);\n setOpenedInviteInfo({ invite: undefined });\n setEditingExportedInvite({ chatId, invite: undefined });\n break;\n }\n\n break;\n }\n case RightColumnContent.Search: {\n blurSearchInput();\n closeLocalTextSearch();\n break;\n }\n case RightColumnContent.StickerSearch:\n blurSearchInput();\n setStickerSearchQuery({ query: undefined });\n break;\n case RightColumnContent.GifSearch: {\n blurSearchInput();\n setGifSearchQuery({ query: undefined });\n break;\n }\n case RightColumnContent.PollResults:\n closePollResults();\n break;\n }\n }, [\n contentKey, isScrolledDown, toggleChatInfo, closePollResults, setNewChatMembersDialogState,\n managementScreen, toggleManagement, closeLocalTextSearch, setStickerSearchQuery, setGifSearchQuery,\n setEditingExportedInvite, chatId, setOpenedInviteInfo,\n ]);\n\n const handleSelectChatMember = useCallback((memberId, isPromoted) => {\n setSelectedChatMemberId(memberId);\n setIsPromotedByCurrentUser(isPromoted);\n }, []);\n\n const handleAppendingChatMembers = useCallback((memberIds: string[]) => {\n addChatMembers({ chatId, memberIds });\n }, [addChatMembers, chatId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(close) : undefined), [isOpen, close]);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isOpen);\n }, CLOSE_ANIMATION_DURATION);\n }, [isOpen]);\n\n useEffect(() => {\n if (nextManagementScreen) {\n setManagementScreen(nextManagementScreen);\n requestNextManagementScreen(undefined);\n }\n }, [nextManagementScreen, requestNextManagementScreen]);\n\n // Close Right Column when it transforms into overlayed state on screen resize\n useEffect(() => {\n if (isOpen && isOverlaying) {\n close();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOverlaying]);\n\n // We need to clear profile state and management screen state, when changing chats\n useLayoutEffectWithPrevDeps(([prevChatId]) => {\n if (prevChatId !== chatId ) {\n setProfileState(ProfileState.Profile);\n setManagementScreen(ManagementScreens.Initial);\n }\n }, [chatId]);\n\n useHistoryBack(isChatSelected && (\n contentKey === RightColumnContent.ChatInfo\n || contentKey === RightColumnContent.Management\n || contentKey === RightColumnContent.AddingMembers\n ), () => close(false), toggleChatInfo);\n\n // eslint-disable-next-line consistent-return\n function renderContent(isActive: boolean) {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case RightColumnContent.AddingMembers:\n return (\n \n );\n case RightColumnContent.ChatInfo:\n return (\n \n );\n case RightColumnContent.Search:\n return ;\n case RightColumnContent.Management:\n return (\n \n );\n\n case RightColumnContent.StickerSearch:\n return ;\n case RightColumnContent.GifSearch:\n return ;\n case RightColumnContent.PollResults:\n return ;\n }\n }\n\n return (\n \n {isOverlaying && (\n
\n )}\n
\n \n \n {renderContent}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n const nextManagementScreen = chatId ? global.management.byChatId[chatId]?.nextScreen : undefined;\n\n return {\n contentKey: selectRightColumnContentKey(global),\n chatId,\n threadId,\n isChatSelected: Boolean(chatId && areActiveChatsLoaded),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n nextManagementScreen,\n };\n },\n)(RightColumn));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { Bundles } from '../../util/moduleLoader';\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\ninterface OwnProps {\n isOpen: boolean;\n}\n\nconst MediaViewerAsync: FC = ({ isOpen }) => {\n const MediaViewer = useModuleLoader(Bundles.Extra, 'MediaViewer', !isOpen);\n\n return MediaViewer ? : undefined;\n};\n\nexport default memo(MediaViewerAsync);\n","export default function download(url: string, filename: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n try {\n link.click();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err); // Suppress redundant \"Blob loading failed\" error popup on IOS\n }\n}\n","import { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { Thread } from '../../global/types';\nimport { ApiMediaFormat, ApiMessage } from '../../api/types';\n\nimport * as mediaLoader from '../../util/mediaLoader';\nimport download from '../../util/download';\nimport {\n getMessageContentFilename, getMessageMediaHash,\n} from '../../modules/helpers';\n\ntype StateProps = {\n activeDownloads: Record;\n messages: Record;\n threadsById: Record;\n }>;\n};\n\nconst startedDownloads = new Set();\n\nconst DownloadManager: FC = ({\n activeDownloads,\n messages,\n}) => {\n const { cancelMessageMediaDownload } = getDispatch();\n\n useEffect(() => {\n Object.entries(activeDownloads).forEach(([chatId, messageIds]) => {\n const activeMessages = messageIds.map((id) => messages[Number(chatId)].byId[id]);\n activeMessages.forEach((message) => {\n const downloadHash = getMessageMediaHash(message, 'download');\n if (!downloadHash) {\n cancelMessageMediaDownload({ message });\n return;\n }\n\n if (!startedDownloads.has(downloadHash)) {\n const mediaData = mediaLoader.getFromMemory(downloadHash);\n if (mediaData) {\n startedDownloads.delete(downloadHash);\n download(mediaData, getMessageContentFilename(message));\n cancelMessageMediaDownload({ message });\n return;\n }\n\n mediaLoader.fetch(downloadHash, ApiMediaFormat.BlobUrl, true).then((result) => {\n startedDownloads.delete(downloadHash);\n if (result) {\n download(result, getMessageContentFilename(message));\n }\n cancelMessageMediaDownload({ message });\n });\n\n startedDownloads.add(downloadHash);\n }\n });\n });\n }, [\n cancelMessageMediaDownload,\n messages,\n activeDownloads,\n ]);\n\n return undefined;\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const activeDownloads = global.activeDownloads.byChatId;\n const messages = global.messages.byChatId;\n return {\n activeDownloads,\n messages,\n };\n },\n)(DownloadManager));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst NotificationsAsync: FC = ({ isOpen }) => {\n const Notifications = useModuleLoader(Bundles.Extra, 'Notifications', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Notifications ? : undefined;\n};\n\nexport default memo(NotificationsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DialogsAsync: FC = ({ isOpen }) => {\n const Dialogs = useModuleLoader(Bundles.Extra, 'Dialogs', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Dialogs ? : undefined;\n};\n\nexport default memo(DialogsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './ForwardPicker';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ForwardPickerAsync: FC = (props) => {\n const { isOpen } = props;\n const ForwardPicker = useModuleLoader(Bundles.Extra, 'ForwardPicker', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ForwardPicker ? : undefined;\n};\n\nexport default memo(ForwardPickerAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './SafeLinkModal';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst SafeLinkModalAsync: FC = (props) => {\n const { url } = props;\n const SafeLinkModal = useModuleLoader(Bundles.Extra, 'SafeLinkModal', !url);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SafeLinkModal ? : undefined;\n};\n\nexport default memo(SafeLinkModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './HistoryCalendar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HistoryCalendarAsync: FC = (props) => {\n const { isOpen } = props;\n const HistoryCalendar = useModuleLoader(Bundles.Extra, 'HistoryCalendar', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HistoryCalendar ? : undefined;\n};\n\nexport default memo(HistoryCalendarAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './GroupCall';\n\nconst GroupCallAsync: FC = (props) => {\n const { groupCallId } = props;\n const GroupCall = useModuleLoader(Bundles.Calls, 'GroupCall', !groupCallId);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return GroupCall ? : undefined;\n};\n\nexport default memo(GroupCallAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport { Bundles } from '../../util/moduleLoader';\n\ntype OwnProps = {\n groupCallId?: string;\n};\n\nconst ActiveCallHeaderAsync: FC = (props) => {\n const { groupCallId } = props;\n const ActiveCallHeader = useModuleLoader(Bundles.Calls, 'ActiveCallHeader', !groupCallId);\n\n return ActiveCallHeader ? : undefined;\n};\n\nexport default memo(ActiveCallHeaderAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport { Bundles } from '../../util/moduleLoader';\n\ntype OwnProps = {\n isOpen: boolean;\n};\n\nconst CallFallbackConfirmAsync: FC = ({ isOpen }) => {\n const CallFallbackConfirm = useModuleLoader(Bundles.Calls, 'CallFallbackConfirm', !isOpen);\n\n return CallFallbackConfirm ? : undefined;\n};\n\nexport default memo(CallFallbackConfirmAsync);\n","import React, {\n FC, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { LangCode } from '../../types';\nimport { ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport '../../modules/actions/all';\nimport {\n BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE,\n} from '../../config';\nimport {\n selectChatMessage,\n selectIsForwardModalOpen,\n selectIsMediaViewerOpen,\n selectIsRightColumnShown,\n selectIsServiceChatReady,\n} from '../../modules/selectors';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport buildClassName from '../../util/buildClassName';\nimport { fastRaf } from '../../util/schedulers';\nimport { waitForTransitionEnd } from '../../util/cssAnimationEndListeners';\nimport { processDeepLink } from '../../util/deeplink';\nimport stopEvent from '../../util/stopEvent';\nimport windowSize from '../../util/windowSize';\nimport { getAllNotificationsCount } from '../../util/folderManager';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../hooks/useBeforeUnload';\nimport useOnChange from '../../hooks/useOnChange';\nimport usePreventPinchZoomGesture from '../../hooks/usePreventPinchZoomGesture';\nimport { LOCATION_HASH } from '../../hooks/useHistoryBack';\n\nimport StickerSetModal from '../common/StickerSetModal.async';\nimport UnreadCount from '../common/UnreadCounter';\nimport LeftColumn from '../left/LeftColumn';\nimport MiddleColumn from '../middle/MiddleColumn';\nimport RightColumn from '../right/RightColumn';\nimport MediaViewer from '../mediaViewer/MediaViewer.async';\nimport AudioPlayer from '../middle/AudioPlayer';\nimport DownloadManager from './DownloadManager';\nimport Notifications from './Notifications.async';\nimport Dialogs from './Dialogs.async';\nimport ForwardPicker from './ForwardPicker.async';\nimport SafeLinkModal from './SafeLinkModal.async';\nimport HistoryCalendar from './HistoryCalendar.async';\nimport GroupCall from '../calls/group/GroupCall.async';\nimport ActiveCallHeader from '../calls/ActiveCallHeader.async';\nimport CallFallbackConfirm from '../calls/CallFallbackConfirm.async';\n\nimport './Main.scss';\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n authState?: ApiUpdateAuthorizationStateType;\n lastSyncTime?: number;\n isLeftColumnShown: boolean;\n isRightColumnShown: boolean;\n isMediaViewerOpen: boolean;\n isForwardModalOpen: boolean;\n hasNotifications: boolean;\n hasDialogs: boolean;\n audioMessage?: ApiMessage;\n safeLinkModalUrl?: string;\n isHistoryCalendarOpen: boolean;\n shouldSkipHistoryAnimations?: boolean;\n openedStickerSetShortName?: string;\n activeGroupCallId?: string;\n isServiceChatReady?: boolean;\n animationLevel: number;\n language?: LangCode;\n wasTimeFormatSetManually?: boolean;\n isCallFallbackConfirmOpen: boolean;\n addedSetIds?: string[];\n};\n\nconst NOTIFICATION_INTERVAL = 1000;\n\nlet notificationInterval: number | undefined;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_isLogged = false;\n\nconst Main: FC = ({\n connectionState,\n authState,\n lastSyncTime,\n isLeftColumnShown,\n isRightColumnShown,\n isMediaViewerOpen,\n isForwardModalOpen,\n hasNotifications,\n hasDialogs,\n audioMessage,\n activeGroupCallId,\n safeLinkModalUrl,\n isHistoryCalendarOpen,\n shouldSkipHistoryAnimations,\n openedStickerSetShortName,\n isServiceChatReady,\n animationLevel,\n language,\n wasTimeFormatSetManually,\n isCallFallbackConfirmOpen,\n addedSetIds,\n}) => {\n const {\n sync,\n loadAnimatedEmojis,\n loadNotificationSettings,\n loadNotificationExceptions,\n updateIsOnline,\n loadTopInlineBots,\n loadEmojiKeywords,\n loadCountryList,\n loadAvailableReactions,\n loadStickerSets,\n loadAddedStickers,\n loadFavoriteStickers,\n ensureTimeFormat,\n openStickerSetShortName,\n checkVersionNotification,\n loadAppConfig,\n } = getDispatch();\n\n if (DEBUG && !DEBUG_isLogged) {\n DEBUG_isLogged = true;\n // eslint-disable-next-line no-console\n console.log('>>> RENDER MAIN');\n }\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && authState === 'authorizationStateReady') {\n sync();\n }\n }, [connectionState, authState, sync]);\n\n // Initial API calls\n useEffect(() => {\n if (lastSyncTime) {\n updateIsOnline(true);\n loadAppConfig();\n loadAvailableReactions();\n loadAnimatedEmojis();\n loadNotificationSettings();\n loadNotificationExceptions();\n loadTopInlineBots();\n loadEmojiKeywords({ language: BASE_EMOJI_KEYWORD_LANG });\n }\n }, [\n lastSyncTime, loadAnimatedEmojis, loadEmojiKeywords, loadNotificationExceptions, loadNotificationSettings,\n loadTopInlineBots, updateIsOnline, loadAvailableReactions, loadAppConfig,\n ]);\n\n // Language-based API calls\n useEffect(() => {\n if (lastSyncTime) {\n if (language !== BASE_EMOJI_KEYWORD_LANG) {\n loadEmojiKeywords({ language });\n }\n\n loadCountryList({ langCode: language });\n }\n }, [language, lastSyncTime, loadCountryList, loadEmojiKeywords]);\n\n // Sticker sets\n useEffect(() => {\n if (lastSyncTime) {\n if (!addedSetIds) {\n loadStickerSets();\n loadFavoriteStickers();\n } else {\n loadAddedStickers();\n }\n }\n }, [lastSyncTime, addedSetIds, loadStickerSets, loadFavoriteStickers, loadAddedStickers]);\n\n // Check version when service chat is ready\n useEffect(() => {\n if (lastSyncTime && isServiceChatReady) {\n checkVersionNotification();\n }\n }, [lastSyncTime, isServiceChatReady, checkVersionNotification]);\n\n // Ensure time format\n useEffect(() => {\n if (lastSyncTime && !wasTimeFormatSetManually) {\n ensureTimeFormat();\n }\n }, [lastSyncTime, wasTimeFormatSetManually, ensureTimeFormat]);\n\n // Parse deep link\n useEffect(() => {\n if (lastSyncTime && LOCATION_HASH.startsWith('#?tgaddr=')) {\n processDeepLink(decodeURIComponent(LOCATION_HASH.substr('#?tgaddr='.length)));\n }\n }, [lastSyncTime]);\n\n // Prevent refresh by accidentally rotating device when listening to a voice chat\n useEffect(() => {\n if (!activeGroupCallId) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [activeGroupCallId]);\n\n const {\n transitionClassNames: middleColumnTransitionClassNames,\n } = useShowTransition(!isLeftColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const {\n transitionClassNames: rightColumnTransitionClassNames,\n } = useShowTransition(isRightColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const className = buildClassName(\n middleColumnTransitionClassNames.replace(/([\\w-]+)/g, 'middle-column-$1'),\n rightColumnTransitionClassNames.replace(/([\\w-]+)/g, 'right-column-$1'),\n shouldSkipHistoryAnimations && 'history-animation-disabled',\n );\n\n // Dispatch heavy transition event when opening middle column\n useOnChange(([prevIsLeftColumnShown]) => {\n if (prevIsLeftColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('MiddleColumn')!, dispatchHeavyAnimationEnd);\n }, [isLeftColumnShown]);\n\n // Dispatch heavy transition event and add body class when opening right column\n useOnChange(([prevIsRightColumnShown]) => {\n if (prevIsRightColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n fastRaf(() => {\n document.body.classList.add('animating-right-column');\n });\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('RightColumn')!, () => {\n dispatchHeavyAnimationEnd();\n\n fastRaf(() => {\n document.body.classList.remove('animating-right-column');\n });\n });\n }, [isRightColumnShown]);\n\n const handleBlur = useCallback(() => {\n updateIsOnline(false);\n\n const initialUnread = getAllNotificationsCount();\n let index = 0;\n\n clearInterval(notificationInterval);\n notificationInterval = window.setInterval(() => {\n if (document.title.includes(INACTIVE_MARKER)) {\n updateIcon(false);\n return;\n }\n\n if (index % 2 === 0) {\n const newUnread = getAllNotificationsCount() - initialUnread;\n if (newUnread > 0) {\n updatePageTitle(`${newUnread} notification${newUnread > 1 ? 's' : ''}`);\n updateIcon(true);\n }\n } else {\n updatePageTitle(PAGE_TITLE);\n updateIcon(false);\n }\n\n index++;\n }, NOTIFICATION_INTERVAL);\n }, [updateIsOnline]);\n\n const handleFocus = useCallback(() => {\n updateIsOnline(true);\n\n clearInterval(notificationInterval);\n notificationInterval = undefined;\n\n if (!document.title.includes(INACTIVE_MARKER)) {\n updatePageTitle(PAGE_TITLE);\n }\n\n updateIcon(false);\n }, [updateIsOnline]);\n\n const handleStickerSetModalClose = useCallback(() => {\n openStickerSetShortName({ stickerSetShortName: undefined });\n }, [openStickerSetShortName]);\n\n // Online status and browser tab indicators\n useBackgroundMode(handleBlur, handleFocus);\n useBeforeUnload(handleBlur);\n\n usePreventPinchZoomGesture(isMediaViewerOpen);\n\n return (\n
\n \n \n \n \n \n \n \n {audioMessage && }\n \n \n \n {activeGroupCallId && (\n <>\n \n \n \n )}\n \n \n \n
\n );\n};\n\nfunction updateIcon(asUnread: boolean) {\n document.querySelectorAll('link[rel=\"icon\"], link[rel=\"alternate icon\"]')\n .forEach((link) => {\n if (asUnread) {\n if (!link.href.includes('favicon-unread')) {\n link.href = link.href.replace('favicon', 'favicon-unread');\n }\n } else {\n link.href = link.href.replace('favicon-unread', 'favicon');\n }\n });\n}\n\n// For some reason setting `document.title` to the same value\n// causes increment of Chrome Dev Tools > Performance Monitor > DOM Nodes counter\nfunction updatePageTitle(nextTitle: string) {\n if (document.title !== nextTitle) {\n document.title = nextTitle;\n }\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { settings: { byKey: { animationLevel, language, wasTimeFormatSetManually } } } = global;\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n return {\n connectionState: global.connectionState,\n authState: global.authState,\n lastSyncTime: global.lastSyncTime,\n isLeftColumnShown: global.isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isMediaViewerOpen: selectIsMediaViewerOpen(global),\n isForwardModalOpen: selectIsForwardModalOpen(global),\n hasNotifications: Boolean(global.notifications.length),\n hasDialogs: Boolean(global.dialogs.length),\n audioMessage,\n safeLinkModalUrl: global.safeLinkModalUrl,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n openedStickerSetShortName: global.openedStickerSetShortName,\n isServiceChatReady: selectIsServiceChatReady(global),\n activeGroupCallId: global.groupCalls.activeGroupCallId,\n animationLevel,\n language,\n wasTimeFormatSetManually,\n isCallFallbackConfirmOpen: Boolean(global.groupCalls.isFallbackConfirmOpen),\n addedSetIds: global.stickers.added.setIds,\n };\n },\n)(Main));\n","import { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { DEBUG } from '../config';\n\nexport { default as Main } from '../components/main/Main';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH LOAD MAIN BUNDLE');\n}\n\nif (!getGlobal().connectionState) {\n getDispatch().initApi();\n}\n"],"names":["closeLocalTextSearch","global","chatId","threadId","selectCurrentMessageList","updateLocalTextSearch","replaceLocalTextSearchResults","undefined","addReducer","actions","payload","query","chatThreadKey","buildChatThreadKey","currentQuery","localTextSearch","byChatThreadKey","MEMO_EMPTY_ARRAY","mediaType","updateLocalMediaSearchType","id","type","shouldReplaceHistory","currentMessageList","replaceThreadParam","exitMessageSelectMode","messages","contentToBeScheduled","forwardMessages","toChatId","setGlobal","updateCurrentMessageList","isChatInfoShown","openChat","chatCreation","newChatMembersProgress","targetIndexDelta","orderedIds","position","indexOf","nextId","FOCUS_NO_HIGHLIGHT_DURATION","FAST_SMOOTH_MAX_DURATION","ANIMATION_END_DELAY","blurTimeout","copyTextForMessages","messageIds","lang","langProvider","chatMessages","selectChatMessages","result","map","filter","message","selectAllowedMessageActions","canCopy","sort","message1","message2","reduce","acc","sender","selectSender","push","getSenderTitle","getMessageSummaryText","copyTextToClipboard","join","scrollOffset","messageId","paramName","viewportIds","selectViewportIds","lastOwnEditableMessageId","findLast","Boolean","canEdit","replyingToId","selectReplyingToId","selectIsViewportNewest","chatMessageKeys","Object","keys","newIndex","toString","length","Number","MAIN_THREAD_ID","chat","selectChat","lastMessage","threadInfo","selectThreadInfo","lastMessageId","setReplyingToId","focusMessage","avatarOwnerId","profilePhotoIndex","origin","mediaViewer","volume","playbackRate","isMuted","audioPlayer","selectIsRightColumnShown","pollResults","voters","window","setTimeout","newGlobal","getGlobal","noHighlight","replyStack","selectReplyStack","pop","focusLastMessage","messageListType","groupedId","groupedChatId","replyMessageId","isResizingContainer","ids","selectForwardedMessageIdsByGroupId","shouldSwitchChat","clearTimeout","updateFocusedMessage","updateFocusDirection","FocusDirection","includes","direction","loadViewportMessages","fromChatId","groupedMessageIds","selectMessageIdsByGroupId","isModalShown","closeMediaViewer","selectedMessages","openForwardMenu","byChatId","activeDownloads","canDownload","forEach","downloadMessageMedia","selectCurrentChat","enterMessageSelectMode","childMessageIds","withShift","toggleMessageSelection","shouldShowContextMenuHint","disableContextMenuHint","showNotification","IS_TOUCH_ENV","isPollModalOpen","currentVersion","APP_VERSION","slice","serviceNotifications","find","version","SERVICE_NOTIFICATIONS_USER_ID","date","getServerTime","serverTimeOffset","content","text","parseMessageInput","versionNotification","isOutgoing","createServiceNotification","serviceChat","maxId","Math","max","fractionalPart","floor","serviceNotification","isUnread","apiUpdate","reactorModal","seenByModal","globalSearch","updateGlobalSearch","globalResults","localResults","resultsByType","fetchingStatus","chats","recentlyFoundChatIds","newRecentIds","unshift","updateGlobalSearchContent","stickers","search","resultIds","gifs","offsetId","results","updateUserSearch","globalUserIds","localUserIds","action","leftColumnWidth","management","isActive","screen","nextScreen","IS_SINGLE_COLUMN_LAYOUT","IS_TABLET_COLUMN_LAYOUT","isLeftColumnShown","messageLists","emoji","recentEmojis","newEmojis","e","sticker","recent","hash","newStickers","s","notification","localId","generateIdFor","newNotifications","notifications","existingNotificationIndex","findIndex","n","splice","data","hasErrorKey","getReadableErrorText","newDialogs","dialogs","existingErrorIndex","err","url","safeLinkModalUrl","selectedAt","historyCalendarSelectedAt","payment","isPaymentModalOpen","clearPayment","closeInvoice","error","uploadProgressCallbacks","Map","runDebouncedForMarkRead","debounce","cb","async","isOutlying","isBudgetPreload","addOffset","LoadMoreDirection","round","MESSAGE_LIST_SLICE","callApi","selectThreadOriginChat","limit","users","threadInfos","localMessages","allMessages","concat","byId","buildCollectionByKey","addChatMessagesById","updateOutlyingIds","updateListedIds","addUsers","addChats","updateThreadInfos","listedIds","selectListedIds","outlyingIds","selectOutlyingIds","areSortedArraysIntersecting","historyIds","newViewportIds","getViewportSlice","safeReplaceViewportIds","sourceIds","index","i","findClosestIndex","indexForDirection","from","to","areSomeLocal","areAllLocal","sendMessage","params","progressCallback","attachment","progress","messageLocalId","has","set","fileUploads","byMessageLocalId","replyingTo","IS_IOS","rafPromise","selectThreadTopMessageId","delete","isRestricted","Promise","resolve","loadWithBudget","selectFocusedMessageId","selectRealLastReadId","replyOriginForId","threadUpdate","MESSAGE_DELETED","replyMessage","selectChatMessage","updateChatMessage","replyToMessageId","loadMessage","isDeleting","updateThreadUnreadFromForwardedMessage","scheduledAt","noWebPage","selectNoWebPage","sendAs","selectSendAs","clearWebPagePreview","value","isSingle","attachments","isGrouped","restParams","entities","commonParams","groupedAttachments","split","MAX_MEDIA_FILES_FOR_ALBUM","firstAttachment","restAttachments","Date","now","selectEditingMessage","setEditingId","get","previousLocalId","cancelApiProgress","draft","replyToMsgId","updateChat","draftDate","localOnly","selectDraft","isUnpin","isOneSide","isSilent","unpinAllMessages","shouldDeleteForAll","editingId","selectEditingId","selectEditingScheduledId","activeChat","reason","description","peer","currentUserId","minId","selectFirstUnreadId","unreadCount","readCount","count","l","countSortedIds","lastReadInboxMessageId","webPagePreview","loadWebPagePreview","options","option","offset","shouldResetVoters","unique","user","offsets","nextOffset","loadPollOptionResults","fromChat","toChat","a","b","realMessages","m","isServiceNotificationMessage","poll","replaceScheduledMessages","loadScheduledHistory","selectScheduledMessage","loadPinnedMessages","seenByUserIds","sendAsId","sendAsChat","selectUser","fullInfo","sendAsIds","updateSponsoredMessage","selectSponsoredMessage","random","randomId","searchThrottled","throttle","searchGifs","updateGifSearch","added","addedStickers","updateStickerSets","sets","loadStickerSets","setIds","addedSetIds","cached","setsById","loadStickers","stickerSetId","pause","recentStickers","loadRecentStickers","favorite","favoriteStickers","loadFavoriteStickers","greeting","featured","featuredStickers","loadFeaturedStickers","stickerSetShortName","stickerSetAccessHash","stickerSet","selectStickerSet","accessHash","packs","updateStickerSet","currentEmoji","forEmoji","rebuildStickersForEmoji","replaceAnimatedEmojis","loadAnimatedEmojis","animatedEmojiEffects","loadAnimatedEmojiEffects","saved","savedGifs","loadSavedGifs","unfave","unfaveSticker","installedDate","language","currentEmojiKeywords","emojiKeywords","isLoading","fromVersion","keywords","searchStickers","title","searchWords","updateStickersForEmoji","loadStickersForEmoji","openedStickerSetShortName","searchMessagesGlobal","offsetRate","maxDate","minDate","localResult","GLOBAL_SEARCH_SLICE","totalCount","nextOffsetId","nextRate","currentSearchQuery","selectCurrentGlobalSearchQuery","updateGlobalSearchFetchingStatus","addMessages","updateGlobalSearchResults","searchSharedMedia","SHARED_MEDIA_SLICE","newFoundIds","currentSearch","selectCurrentMediaSearch","updateLocalMediaSearchResults","localChats","localUsers","globalChats","globalUsers","chatIds","userIds","searchChats","timestampPlusDay","foundIds","selectCurrentTextSearch","topMessageId","MESSAGE_SEARCH_SLICE","updateLocalTextSearchResults","searchTextMessages","currentType","currentResults","timestamp","getDispatch","searchMessagesByDate","ManagementProgress","username","updateManagementProgress","updateManagement","isUsernameAvailable","isChatBasicGroup","invite","editingInvite","update","inviteInfo","adminId","isRevoked","admin","revokedInvites","invites","link","expireDate","usageLimit","isRequestNeeded","oldInvite","newInvite","current","managementState","offsetDate","offsetUserId","offsetUser","currentInviteInfo","importers","isRequested","requesters","joinRequests","userId","isApproved","targetChat","importer","recentRequesterIds","requestsPending","releaseStatusTimeout","loadTopMessages","DEBUG","console","log","isSyncing","loadAllChats","preloadTopChatMessages","listType","shouldReplace","onReplace","areMessagesLoaded","draftsByChatId","currentChatId","currentThreadId","currentChat","newCurrentChatId","currentMessageListInfo","originChannelId","currentMessageListInfoOrigin","resultOrigin","byIdOrigin","listedIdsOrigin","threadsById","updateChats","updateUsers","audioChatId","audioMessageId","closeAudioPlayer","loadAndReplaceMessages","lastSyncTime","initFolderManager","runDebouncedForFetchFullUser","runThrottledForSearch","replaceInlineBotSettings","inlineBotSettings","inlineBots","byUsername","replaceInlineBotsIsLoading","userStatusesById","replaceUserStatuses","statusesById","topPeers","lastRequestedAt","loadTopUsers","contactList","getCompareString","lastName","firstName","collator","Intl","Collator","sortedUsers","compare","isSelf","loadContactList","isUserBot","commonChats","isFullyLoaded","updateUser","updateChatMutedState","phoneNumber","phone","updateContact","deleteContact","profileId","isPrivate","isUserId","photos","userSearch","updateUserSearchFetchingStatus","searchUsers","pick","runDebouncedForSearch","sendBotCommand","command","button","match","RE_TME_LINK","RE_TG_LINK","openTelegramLink","toggleSafeLinkModal","showDialog","alert","isError","answerCallbackButton","openPollModal","getReceipt","receiptMessageId","getPaymentForm","setInvoiceMessageInfo","openPaymentModal","bot","selectChatBot","removeBlockedContact","topInlineBots","inlineBotData","inlineBot","switchPm","canLoadMore","shouldReplaceSettings","newInlineBotData","currentIds","Set","newResults","help","isGallery","searchInlineBot","queryId","resultId","botId","param","startParam","replaceSettings","hasPassword","updateTwoFaSettings","hint","currentPassword","onSuccess","isSuccess","password","email","waitingEmailCodeLength","code","requestInfo","saveInfo","selectPaymentChatId","selectPaymentMessageId","shouldSave","shippingOptions","setRequestInfoId","updateShippingOptions","setPaymentStep","PaymentStep","validateRequestedInfo","setPaymentForm","step","invoice","shippingAddressRequested","nameRequested","phoneRequested","emailRequested","setReceipt","receipt","nativeProvider","credentials","publishableKey","selectProviderPublishableKey","k","buildQueryString","cardNumber","expiryMonth","expiryYear","cvv","zip","country","response","fetch","method","headers","Authorization","json","getStripeError","setStripeCardInfo","sendStripeCredentials","publicToken","selectProviderPublicToken","card","number","replace","expiration_month","expiration_year","security_code","DEBUG_PAYMENT_SMART_GLOCAL","Accept","body","JSON","stringify","status","setSmartGlocalCardInfo","token","sendSmartGlocalCredentials","shippingOptionId","saveCredentials","formId","selectPaymentFormId","requestInfoId","selectPaymentRequestId","requestedInfoId","sendPaymentForm","save","selectStripeCredentials","selectSmartGlocalCredentials","MAX_MESSAGES_LIST_WIDTH","SIDE_COLUMN_MAX_WIDTH","MIN_LEFT_COLUMN_WIDTH","subtractXForEmojiInteraction","x","windowWidth","windowSize","width","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","min","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","interactionLocalId","availableReaction","aroundAnimation","mediaLoader","ApiMediaFormat","centerIcon","availableReactions","y","localEffect","startSize","isReversed","activeEmojiInteraction","animatedEffect","INTERACTION_RANDOM_OFFSET","activeEmojiInteractions","interactions","emoticon","selectLocalAnimatedEmojiEffectByName","timestamps","reaction","selectDefaultReaction","isMessageLocal","sendReaction","isInDocumentGroup","isInAlbum","documentGroupFirstMessageId","reactions","some","isChosen","animationLevel","settings","byKey","ANIMATION_LEVEL_MAX","activeReactions","omit","recentReactions","canSeeList","addMessageReaction","appConfig","defaultReaction","reactors","areDeepEqual","value1","value2","type1","isArray1","Array","isArray","array1","array2","every","member1","object1","object2","key1","noTopChatsRequest","selectIsChatListed","loadTopChats","newProfilePhoto","closeMessageNotifications","selectChatListType","updateChatListIds","isNotJoined","requestChatUpdate","leaveChat","typingStatus","senderId","isFromScheduled","hasUnreadMention","unreadMentionsCount","notifyAboutMessage","getMessageRecentReaction","messageUpdate","channelId","selectCommonBoxChatId","folderId","ARCHIVED_FOLDER_ID","orderedPinnedIds","isPinned","newOrderedPinnedIds","MAX_ACTIVE_PINNED_CHATS","listIds","active","pinnedId","updateChatListType","folder","chatFoldersById","chatFolders","newChatFoldersById","newOrderedIds","orderedId","folders","recommended","replacedMembers","addedMember","deletedMemberId","shouldUpdate","members","deleteIndex","adminMembers","isOwner","isAdmin","membersCount","photo","formattedText","loadChatJoinRequests","ANIMATION_DELAY","updateWithLocalMedia","isScheduled","currentMessage","video","document","getMessageContent","blobUrl","thumbnail","isPreloadedGlobally","previewBlobUrl","updateScheduledMessage","updateThreadUnread","selectThreadByMessage","originMessage","updateListedAndViewportIds","firstMessageId","isUnreadChatNotLoaded","addViewportId","messagesCount","firstUnreadId","updateChatLastMessage","force","currentLastMessage","findLastMessage","deleteMessages","newLastMessage","threadIdsToUpdate","deleteChatMessages","requestThreadInfoUpdate","chatsIdsToUpdate","commonBoxChatId","shouldForceReply","updateThreadInfo","newMessage","isMessageInCurrentMessageList","delayedGlobal","getMessageText","localEmoji","selectLocalAnimatedEmoji","selectLocalAnimatedEmojiEffect","scheduledIds","selectScheduledIds","selectIsChatWithBot","selectScheduledMessages","deleteChatScheduledMessages","thread","markMessageListRead","currentPinnedIds","selectPinnedIds","newPinnedIds","newTheadInfo","messagesById","loadFullChat","scheduledMessages","deleteScheduledMessages","pollId","pollUpdate","selectChatMessageByPollId","updatedPoll","updatedResults","chosenAnswers","chosenAnswer","chosenAnswerIndex","recentVoterIds","totalVoters","newRecentVoterIds","newTotalVoters","targetOption","targetOptionIndex","updatedOption","votersCount","selectIsServiceChatReady","currentReactions","shouldNotify","checkIfReactionAdded","flushStatusUpdatesThrottled","pendingStatusUpdates","statusUpdate","targetUser","isBlocked","addBlockedContact","privacy","key","rules","setConfirmPaymentUrl","updateNotifySettings","peerType","shouldShowPreviews","addNotifyException","twoFaSettings","call","connectionState","groupCalls","activeGroupCallId","leaveGroupCall","shouldRemove","removeGroupCall","updateGroupCall","participantsCount","groupCallId","participants","participant","updateGroupCallParticipant","useBeforeUnload","callback","useEffect","onBeforeUnload","metaViewport","querySelector","defaultViewportContent","getAttribute","allowedZoomViewportContent","preventEvent","preventDefault","memo","isForAppBadge","useFolderManagerForUnreadCounters","unreadNotificationsCount","getAllNotificationsCount","updateAppBadge","className","formatIntegerCompact","ConnectionStatus","useConnectionStatus","hasMiddleHeader","isMinimized","isDisabled","isOnline","setIsOnline","useState","navigator","onLine","handleChange","addEventListener","removeEventListener","useBrowserOnline","syncing","online","waitingForNetwork","toLowerCase","connectionStatus","connectionStatusPosition","connectionStatusText","onClick","useLang","dir","isRtl","Spinner","color","Transition","activeKey","name","Button","size","ANIMATION_LEVEL_OPTIONS","withGlobal","searchQuery","chatsById","isConnectionStatusMinimized","globalSearchChatId","searchDate","theme","selectTheme","isMessageListOpen","areChatsLoaded","contactsFilter","onSearchQuery","onSelectSettings","onSelectContacts","onSelectArchived","onReset","shouldSkipTransition","openTipsChat","setGlobalSearchDate","setSettingOption","setGlobalSearchChatId","hasMenu","LeftColumnContent","selectedSearchDate","useMemo","formatDateToString","archivedUnreadChatsCount","values","total","isChatArchived","withOtherVersions","location","hostname","MainButton","onTrigger","isOpen","ripple","ariaLabel","buildClassName","handleSearchFocus","useCallback","toggleConnectionStatus","handleSelectSaved","handleDarkModeToggle","stopPropagation","newTheme","shouldUseSystemTheme","switchTheme","handleAnimationLevelChange","newLevel","_","classList","toggle","isSearchFocused","searchInputPlaceholder","DropdownMenu","trigger","footer","APP_NAME","APP_REVISION","MenuItem","icon","Switcher","label","checked","noAnimation","langCode","href","FEEDBACK_URL","setPermanentWebVersion","clearWebsync","disableHistoryBack","SearchInput","inputId","parentContainerClassName","focused","spinnerColor","spinnerBackgroundColor","placeholder","autoComplete","canClose","onChange","onFocus","onSpinnerClick","PickerSelectedItem","clickArg","chatOrUserId","ShowTransition","isCustom","orderedFolderIds","activeChatFolder","shouldSkipHistoryAnimations","foldersDispatch","onScreenSelect","loadChatFolders","setActiveChatFolder","transitionRef","useRef","displayedFolders","folderCountersById","folderTabs","ALL_FOLDER_ID","badgeCount","chatsCount","isBadgeActive","notificationsCount","handleSwitchTab","forceOnHeavyAnimation","captureEvents","selectorToPreventScroll","onSwipe","SwipeDirection","isNotInAllTabRef","captureEscKeyListener","useHistoryBack","handleKeyDown","ctrlKey","shiftKey","startsWith","digit","shouldRender","shouldRenderPlaceholder","transitionClassNames","useShowTransition","renderCurrentTab","activeFolder","ChatList","folderType","TabList","tabs","activeTab","onSwitchTab","ref","renderCount","props","LeftSearch","useModuleLoader","Bundles","Loading","ContactList","isShown","onNewPrivateChat","onNewChannel","onNewGroup","isMenuOpen","setIsMenuOpen","fabClassName","tabIndex","Menu","positionX","positionY","autoClose","onClose","TRANSITION_RENDER_COUNT","closeTimeout","onContentChange","isNewChatButtonShown","setIsNewChatButtonShown","isMouseInside","handleSelectSettings","handleSelectContacts","handleSelectNewChannel","handleSelectNewGroup","handleSelectArchived","handleMouseEnter","handleMouseLeave","autoCloseTimeout","shouldRenderUpdateButton","updateButtonClassNames","handleUpdateClick","isAppOutdated","markIsAppOutdated","useFlag","timeout","reload","useAppOutdatedCheck","onMouseEnter","onMouseLeave","shouldCleanup","cleanupExceptionKey","fluid","pill","Settings","NewChat","ArchivedChats","ContentType","RENDER_COUNT","setGlobalSearchQuery","resetChatCreation","loadPasswordInfo","clearTwoFaError","setLeftColumnWidth","resetLeftColumnWidth","resizeRef","setContent","settingsScreen","setSettingsScreen","SettingsScreens","setContactsFilter","foldersState","useFoldersReducer","lastResetTime","setLastResetTime","contentType","Main","Archived","NewChannel","NewGroup","handleReset","forceReturnToChatList","pickerSearchInput","getElementById","blur","handleSearchQuery","IS_MAC_OS","metaKey","getKeyFromEvent","initResize","resetResize","handleMouseUp","elementRef","onResize","initialWidth","markIsActive","unmarkIsActive","initialMouseX","setInitialMouseX","initialElementWidth","setInitialElementWidth","remove","style","handleMouseMove","event","newWidth","ceil","clientX","stopDrag","cleanup","offsetWidth","add","useResize","handleSettingsScreenSelect","LAYERS_ANIMATION_NAME","currentScreen","isChannel","onMouseDown","onMouseUp","onDoubleClick","setSize","handleResize","HeaderMenuContainer","isChatChannel","selectIsInSelectMode","noMenu","isChatWithSelf","selectIsChatWithSelf","isMainThread","isDiscussionThread","isRightColumnShown","canRestartBot","selectIsUserBlocked","canStartBot","selectIsChatBotNotStarted","canSubscribe","isChatSuperGroup","canSearch","canCall","ARE_CALLS_SUPPORTED","canMute","canLeave","canEnterVoiceChat","isCallActive","canCreateVoiceChat","adminRights","manageCall","isCreator","pendingJoinRequests","canExpandActions","joinChannel","openLocalTextSearch","restartBot","openCallFallbackConfirm","requestNextManagementScreen","menuButtonRef","menuPosition","setMenuPosition","handleHeaderMenuOpen","rect","getBoundingClientRect","right","bottom","handleHeaderMenuClose","handleHeaderMenuHide","handleSubscribeClick","handleStartBot","handleRestartBot","handleJoinRequestsClick","ManagementScreens","handleSearchClick","focus","searchInput","IS_PWA","disabled","anchor","withExtraActions","onSubscribeChannel","onSearchClick","onCloseAnimationEnd","useWebpThumbnail","thumbDataUri","getMessageMediaThumbDataUri","shouldDecodeThumbnail","isWebpSupported","thumbnailDecoded","setThumbnailDecoded","EMPTY_IMAGE_DATA_URI","useLayoutEffect","webpToPngBase64","then","catch","drawRect","height","radius","containerRef","markupParams","reverseIndex","barHeight","getBarHeight","markHeight","getMarkHeight","trackHeight","getTrackHeight","clipPathId","clipPath","d","getClipPath","markTranslateY","getMarkTranslateY","trackTranslateY","getTrackTranslateY","calculateMarkup","firstChild","firstElementChild","currentElement","transform","svg","div","defs","innerHTML","customTitle","onUnpinMessage","onAllPinnedClick","mediaThumbnail","mediaBlobUrl","useMedia","getMessageMediaHash","renderMessageSummary","isUnpinDialogOpen","openUnpinDialog","closeUnpinDialog","handleUnpinMessage","ConfirmDialog","confirmLabel","confirmHandler","getPictogramDimensions","src","alt","renderPictogram","RippleEffect","scaleImage","image","ratio","outputType","Blob","URL","createObjectURL","img","Image","onload","scale","blob","Error","finally","revokeObjectURL","steppedScale","bitmap","createImageBitmap","resizeWidth","resizeHeight","resizeQuality","res","canvas","createElement","ctx","getContext","transferFromImageBitmap","drawImage","toBlob","oc","octx","mul","cur","LOGO_DIMENSIONS","MINIMAL_SIZE","audio","voice","fileName","artist","performer","getTranslation","album","getChatTitle","audioCoverHash","getAudioHasCover","avatarHash","getChatAvatarHash","media","thumbnailSizes","preferred","AVATAR_FULL_DIMENSIONS","getCoverSize","fn","deps","defaultValue","setIsLoading","setError","setResult","wasCancelled","telegramLogoPath","resizeImage","makeGoodArtwork","useAsync","buildMediaMetadata","artwork","noUi","setAudioPlayerVolume","setAudioPlayerPlaybackRate","setAudioPlayerMuted","isVoice","senderName","mediaData","mediaMetadata","useMessageMediaMetadata","playPause","stop","isPlaying","requestNextTrack","requestPreviousTrack","isFirst","isLast","setVolume","toggleMuted","setPlaybackRate","useAudioPlayer","makeTrackId","getMediaDuration","isVoicePlaying","handleClick","handleClose","clearMediaSession","handleVolumeChange","handleVolumeClick","handlePlaybackClick","volumeIcon","renderText","renderAudio","subtitle","renderVoice","withClickPropagation","RangeSlider","groupCall","selectChatGroupCall","usersById","isLoaded","isCallNotEmpty","hasPinnedOffset","joinGroupCall","subscribeToGroupCallUpdates","handleJoinGroupCall","fetchedParticipants","isUser","subscribed","p","Avatar","audioMessage","pinnedIds","state","isSelectModeActive","isChatWithBot","currentTransitionKey","assign","pinnedMessageId","topMessageSender","selectForwardedSender","pinnedMessageIds","canUnpin","firstPinnedMessage","isReady","openChatWithInfo","pinMessage","openPreviousChat","toggleLeftColumn","isBackButtonActive","pinnedMessageIndex","setPinnedMessageIndex","pinnedMessage","pinnedMessagesCount","chatTitleLength","topMessageTitle","useEnsureMessage","useWindowSize","isLeftColumnHideable","shouldShowCloseButton","componentRef","shouldAnimateTools","handleHeaderClick","handlePinnedMessageClick","cycleRestrict","handleAllPinnedClick","setBackButtonActive","handleBackClick","messageInput","EDITABLE_INPUT_ID","canToolsCollideWithChatInfo","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MOBILE_SCREEN_MAX_WIDTH","shouldUseStackedToolsClass","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","shouldRenderAudioPlayer","audioPlayerClassNames","renderingAudioMessage","useCurrentOrPrev","shouldRenderPinnedMessage","pinnedMessageClassNames","renderingPinnedMessage","renderingPinnedMessagesCount","renderingCanUnpin","renderingPinnedMessageTitle","canRevealTools","componentEl","renderBackButton","asClose","withUnreadCounter","isAudioPlayerRendered","PrivateChatInfo","withDots","withFullInfo","withMediaViewer","withUpdatingStatus","noRtl","GroupChatInfo","getMessageKey","isAlbum","messageOrAlbum","groupMessages","currentAlbum","currentSenderGroup","currentDateGroup","originalDate","datetime","getDayStart","senderGroups","dateGroups","mainMessage","albumId","nextMessage","nextMessageDayStartsAt","isActionMessage","forwardInfo","senderUserId","hiddenUserName","inlineButtons","INTERSECTION_THROTTLE_FOR_MEDIA","IS_ANDROID","INTERSECTION_MARGIN_FOR_MEDIA","isEmojiOnlyMessage","customShape","getMinMediaWidth","hasText","hasCommentButton","calculateMediaDimensions","noAvatars","isOwn","isOwnMessage","isForwarded","isForwardedMessage","getMessagePhoto","getMessageWebPagePhoto","getMessageVideo","isWebPagePhoto","calculateInlineImageDimensions","calculateVideoDimensions","minMediaWidth","stretchFactor","finalWidth","finalHeight","isSmall","accumulate","list","initValue","accumulator","item","clamp","num","low","high","calculateContainerSize","layout","styles","dimensions","sides","calculateAlbumLayout","ratios","getRatios","proportions","getProportions","averageRatio","getAverageRatio","albumCount","forceCalc","maxWidth","getAvailableWidth","REM","minWidth","maxHeight","spacing","originalRatios","cropRatios","attempts","pushAttempt","lineCounts","heights","currentCount","attemptCount","sum","multiHeight","first","second","third","fourth","optimalAttempt","optimalDiff","lineCount","totalHeight","bad1","bad2","line","diff","abs","optimalCounts","optimalHeights","rowCount","row","colCount","lineHeight","col","layoutWithComplexLayouter","AlbumRectPart","layoutTwoTopBottom","layoutTwoLeftRightEqual","minimalWidth","secondWidth","firstWidth","layoutTwoLeftRight","layoutTwo","firstHeight","thirdHeight","secondHeight","rightWidth","leftWidth","layoutThreeLeftAndOther","layoutThreeTopAndOther","layoutThree","w","h0","h","w0","w2","w1","h1","layoutFourTopAndOther","h2","layoutFourLeftAndOther","layoutFour","containerStyle","element","calculateAuthorWidth","font","whiteSpace","left","opacity","appendChild","useFocusMessage","isFocused","focusDirection","noFocusHighlight","messagesContainer","closest","fastSmoothScroll","QUICK_REACTION_AREA_WIDTH","QUICK_REACTION_AREA_HEIGHT","GROUP_MESSAGE_HOVER_ATTRIBUTE","useOuterHandlers","selectMessage","isInSelectMode","canReply","isProtected","onContextMenu","handleBeforeContextMenu","isContextMenuShown","contentRef","shouldHandleMouseLeave","sendDefaultReaction","isQuickReactionVisible","markQuickReactionVisible","unmarkQuickReactionVisible","isSwiped","markSwiped","unmarkSwiped","doubleTapTimeoutRef","startedAt","onRelease","handleMouseDown","preventMessageInputBlur","clearInterval","pageX","pageY","handleDoubleTap","target","contains","handleTap","handleContextMenu","stopEvent","matches","handleDoubleClick","handleContentDoubleClick","container","clientY","isVisibleX","isVisibleY","handleSendQuickReaction","currentTarget","lastGroupElement","getLastElementInDocumentGroup","removeAttribute","handleDocumentGroupMouseLeave","handleDocumentGroupMouseEnter","setAttribute","nextElementSibling","ContextMenuContainer","targetUserIds","targetChatId","targetMessageId","targetMessage","selectIsMessageFocused","focusedMessage","isChat","senderUser","senderChat","observeIntersection","isEmbedded","appearanceOrder","isLastInList","useOnIntersect","noAppearanceAnimation","markShown","targetUsers","renderActionMessageText","asTextWithSpoilers","isContextMenuOpen","contextMenuPosition","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","customText","isIntersecting","useIsIntersecting","pictogramId","isRoundVideo","getMessageRoundVideo","senderTitle","draggable","activeReaction","isInMeta","stopActiveReaction","r","centerIconId","effectId","mediaDataCenterIcon","mediaDataEffect","shouldPlay","shouldRenderAnimation","animationClassNames","handleEnded","isAnimationLoaded","markAnimationLoaded","unmarkAnimationLoaded","shouldRenderStatic","ReactionStaticEmoji","AnimatedSticker","animationData","play","noLoop","onLoad","onEnded","outgoingStatus","signature","withReactions","withReactionOffset","reactionMessage","isActivated","markActivated","createDateTime","formatDateTimeToString","editDateTime","isEdited","editDate","forwardedDateTime","views","formatTime","MessageOutgoingStatus","observeIntersectionForPlaying","shouldLoop","isModalOpen","openModal","closeModal","isLottie","isGif","canDisplayGif","IS_WEBM_SUPPORTED","isMemojiSticker","NO_STICKER_SET_ID","shouldLoad","mediaHash","previewMediaHash","previewUrl","getMessageMediaFormat","isMediaLoaded","isLottieLoaded","markLottieLoaded","isMediaReady","useMediaTransition","getStickerDimensions","thumbClassName","stickerClassName","safePlay","autoPlay","playsInline","loop","muted","fromSticker","useBlurredMediaThumbRef","fullMediaData","useCanvasBlur","IS_CANVAS_FILTER_SUPPORTED","SELECTED_APPENDIX_COLORS","dark","outgoing","incoming","light","canAutoLoad","isSelected","uploadProgress","nonInteractive","shouldAffectAppendix","isDownloading","onCancelUpload","localBlobUrl","isLoadAllowed","setIsLoadAllowed","loadProgress","useMediaWithLoadProgress","thumbRef","downloadProgress","isUploading","isTransferring","transferProgress","getMediaTransferState","wasLoadDisabled","usePrevious","shouldRenderSpinner","spinnerClassNames","shouldRenderDownloadButton","downloadButtonClassNames","isAllowed","contentEl","inSelectMode","getImageData","getAppendixColorFromImage","getCustomAppendixBg","appendixBg","setProperty","ProgressSpinner","useVideoAutoPause","playerRef","canPlay","wasPlaying","paused","canPlayRef","freezePlaying","unfreezePlaying","unfreezePlayingOnRaf","fastRaf","useBackgroundMode","useHeavyAnimationCheck","canAutoPlay","videoRef","getMessageWebPageVideo","isPlayAllowed","setIsPlayAllowed","previewClassNames","isInline","isBuffered","bufferingHandlers","useBuffering","shouldRenderPlayButton","playButtonClassNames","playProgress","setPlayProgress","handleTimeUpdate","currentTime","duration","useVideoCleanup","cancelMessageMediaDownload","onTimeUpdate","formatMediaDuration","contact","countryList","phoneCodes","phoneCodeList","formatPhoneNumberWithCode","getPercentage","toFixed","answer","voteResults","maxVotersCount","correctResults","shouldAnimate","correctAnswer","showIcon","answerPercent","finalPercent","setFinalPercent","lineRef","lineWidth","isAnimationDoesNotStart","lineEl","svgEl","lineStyle","onSendVote","openPollResults","summary","isSubmitting","setIsSubmitting","chosenOptions","setChosenOptions","isSolutionShown","setIsSolutionShown","wasSubmitted","setWasSubmitted","closePeriod","setClosePeriod","closed","closeDate","countdownRef","hasVoted","canVote","canViewResult","isPublic","isMultiple","multipleChoice","answers","isCorrect","hidden","quiz","countdownEl","circumference","PI","lastElementChild","timerEl","strokeDashOffset","textContent","timer","recentVoters","handleRadioChange","handleCheckboxChange","handleVoteClick","handleViewResultsClick","handleSolutionShow","handleSolutionHide","solution","Notification","renderTextWithEntities","solutionEntities","onDismiss","containerId","question","getPollTypeString","CheckboxGroup","loadingOptions","RadioGroup","loadingOption","isQuiz","getReadableVotersCount","isText","inPreview","onMediaClick","onCancelMediaTransfer","webPage","getMessageWebPage","isSquarePhoto","handleMediaClick","siteName","displayUrl","isMediaInteractive","truncatedDescription","trimText","SafeLink","getMessageInvoice","amount","currency","isTest","photoUrl","formatCurrency","withSelectControl","WrappedComponent","ownProps","selectIsMessageSelected","handleMessageSelect","newProps","PhotoWithSelect","Photo","VideoWithSelect","Video","activeDownloadIds","selectActiveDownloadIds","uploadsById","hasCustomAppendix","albumLayout","cancelSendingMessage","mediaCount","handleCancelUpload","containerWidth","containerHeight","fileUpload","selectCanAutoLoadMedia","selectCanAutoPlayMedia","stopPrevious","playingProgressRef","shouldSpinnerRender","setIsActivated","setProgress","svgCenter","ROUND_VIDEO_DIMENSIONS_PX","playerEl","playingProgressEl","stopPlaying","capturePlaying","stopCurrentAudio","videoClassName","recentReplierIds","recentRepliers","peerId","hasUnread","recentReactors","recentReaction","isOutside","metaChildren","localSticker","soundId","playKey","useAnimatedEmoji","localStickerAnimationData","setLocalStickerAnimationData","getAnimationData","quality","APPENDIX_OWN","__html","APPENDIX_NOT_OWN","withSenderName","withAvatar","isLastInDocumentGroup","viaBotId","replyToChatId","isRepliesChat","isChatWithRepliesBot","chatUsername","forceSenderName","isAnonymousOwnMessage","canShowSender","originSender","botSender","threadTopMessageId","isThreadTop","shouldHideReply","replyMessageSender","selectUploadProgress","isForwarding","highlight","singleEmoji","getMessageSingleEmoji","selectIsDownloading","actualThreadInfo","selectIsMessageProtected","isSingleEmoji","animatedEmoji","selectAnimatedEmoji","animatedEmojiEffect","selectAnimatedEmojiEffect","animatedEmojiSoundId","selectAnimatedEmojiSound","isGroupSelected","selectIsDocumentGroupSelected","isPinnedList","canAutoLoadMedia","canAutoPlayMedia","autoLoadFileMaxSizeMb","shouldLoopStickers","selectShouldLoopStickers","selectOutgoingStatus","observeIntersectionForBottom","observeIntersectionForMedia","observeIntersectionForAnimatedStickers","areReactionsInMeta","noComments","isFirstInGroup","isLastInGroup","isFirstInDocumentGroup","clickInlineButton","bottomMarkerRef","isLocal","hasReply","isReplyMessage","hasThread","getMessageCustomShape","hasAnimatedEmoji","hasReactions","areReactionsEmpty","asForwarded","isLinkedChannelPost","isInDocumentGroupNotFirst","isInDocumentGroupNotLast","canShowActionButton","canForward","canFocus","isChannelPost","fromMessageId","withCommentButton","withQuickReactionButton","avatarPeer","senderPeer","handleAvatarClick","handleSenderClick","handleViaBotClick","handleReplyClick","handleAudioPlay","handleAlbumMediaClick","handleMetaClick","handleReadMedia","handleVoteSend","handleGroupForward","handleForward","handleFocus","handleFocusForwarded","handleDocumentGroupSelectAll","openMediaViewer","openAudioPlayer","markMessagesRead","sendPollVote","focusMessageInComments","replyToTopMessageId","channelPostId","MediaViewerOrigin","albumMessageId","selectWithGroupedId","useInnerHandlers","containerClassName","contentClassName","hasComments","hasActionButton","classNames","isMedia","isMediaWithNoText","isViaBot","isRound","buildContentClassName","withAppendix","textParts","renderMessageText","metaPosition","reactionsPosition","calculatedWidth","noMediaCorners","extraPadding","adminTitle","metaSafeAuthorWidth","renderReactionsAndMeta","meta","onMouseMove","isAvatarPeerUser","avatarUser","avatarChat","hiddenName","renderAvatar","textContentClass","senderColor","getUserColorKey","renderSenderName","AnimatedEmoji","effect","forceLoadPreview","Audio","AudioOrigin","isSelectable","onPlay","onReadMedia","Document","renderContent","dangerouslySetInnerHTML","isBot","channel","viewSponsoredMessage","openChatByInvite","startBot","shouldObserve","observe","useIntersectionObserver","rootRef","debounceMs","threshold","getUserFullName","chatInviteTitle","chatInviteHash","messageGroups","isViewportNewest","withUsers","anchorIdRef","memoUnreadDividerBeforeIdRef","memoFirstUnreadIdRef","isScrollingRef","isScrollPatchNeededRef","hasLinkedChat","isSchedule","onFabToggle","onNotchToggle","openHistoryCalendar","observeIntersectionForReading","throttleMs","margin","freeze","freezeForReading","unfreeze","unfreezeForReading","entries","mentionIds","entry","dataset","useMessageObservers","backwardsTriggerRef","forwardsTriggerRef","fabTriggerRef","loadMoreBackwards","loadMoreForwards","toggleScrollTools","offsetHeight","scrollHeight","scrollTop","scrollBottom","isAtBottom","MESSAGE_LIST_SENSITIVE_AREA","LOCAL_MESSAGE_ID_BASE","triggerEntry","IS_SCROLL_PATCH_NEEDED","observeIntersectionForFab","freezeForFab","unfreezeForFab","FAB_THRESHOLD","observeIntersectionForNotch","freezeForNotch","unfreezeForNotch","useOnChange","useScrollHooks","unreadDivider","messageCountToAnimate","messageGroup","flatten","appearanceIndex","dateGroup","dateGroupIndex","dateGroupsArray","senderGroup","senderGroupIndex","senderGroupsArray","compact","currentDocumentGroupId","messageIndex","isMessageAlbum","documentGroupId","nextDocumentGroupId","originalId","getMessageOriginalId","teactFastList","SCHEDULED_WHEN_ONLINE","formatHumanDate","dividend","getUserIdDividend","lastUnreadMessageId","loadGreetingStickers","handleStickerSelect","selectedSticker","StickerButton","isGroupChatJustCreated","renderScheduled","renderSavedMessages","renderGroup","runDebouncedForScroll","selectCurrentMessageIds","restrictionReason","focusingId","withLastMessageWhenPreloading","chatBot","botDescription","isChatLoaded","isChannelChat","isGroupChat","isChatGroup","threadFirstMessageId","selectFirstMessageId","linkedChatId","hasTools","canPost","withBottomShift","setScrollOffset","loadSponsoredMessages","loadMessageReactions","copyMessagesByIds","scrollOffsetRef","selectScrollOffset","anchorTopRef","listItemElementsRef","memoFocusingIdRef","isScrollTopJustUpdatedRef","shouldAnimateAppearanceRef","setContainerHeight","onTickEnd","handleCopy","getMessageIdsForSelectedText","useNativeCopySelectedMessages","listedMessages","orderBy","useInterval","loadMoreAround","isScrolled","updateStickyDates","markIsScrolled","runDebounced","useDebounce","currentStuck","stuckDateEl","allElements","querySelectorAll","containerTop","el","offsetTop","top","findStuckDate","useStickyDates","handleScroll","parentElement","observer","ResizeObserver","offsetParent","contentRect","disconnect","windowHeight","normalHeight","String","clientHeight","preservedItemElements","useLayoutEffectWithPrevDeps","prevMessageIds","prevIsViewportNewest","prevContainerHeight","hasLastMessageChanged","hasViewportShifted","wasMessageAdded","isAlreadyFocusing","shouldForceScroll","lastItemElement","bottomOffset","newScrollTop","isResized","isAnimatingScroll","patchChromiumScroll","resetScroll","useEffectWithPrevDeps","prevIsSelectModeActive","dispatchHeavyAnimationEvent","shouldRenderGreeting","onScroll","backgroundColor","withExtraShift","focusNextReply","messageElements","lastMessageElement","MAX_QUICK_IMG_SIZE","FILE_EXT_REGEX","buildAttachment","filename","isQuick","mimeType","quick","SUPPORTED_IMAGE_CONTENT_TYPES","preloadImage","resizedUrl","fetchBlob","SUPPORTED_VIDEO_CONTENT_TYPES","videoWidth","videoHeight","preloadVideo","createPosterForVideo","insertHtmlInSelection","html","selection","getSelection","getRangeAt","rangeCount","range","deleteContents","fragment","createContextualFragment","lastInsertedNode","lastChild","insertNode","setStartAfter","setEndAfter","collapse","removeAllRanges","addRange","resetInput","applyIosAutoCapitalizationFix","inputEl","POLYFILL_OPTIONS","encoderPath","reuseWorker","BLOB_PARAMS","opusRecorderPromise","OpusRecorder","mediaRecorder","init","default","start","analyzerCallback","startMediaRecorder","pausedAt","chunks","waveform","ondataavailable","typedArray","releaseAnalyzer","recorder","source","sourceNode","analyser","context","createAnalyser","fftSize","connect","dataLength","frequencyBinCount","dataArray","Uint8Array","isDestroyed","tick","getByteFrequencyData","requestAnimationFrame","subscribeToAnalyzer","reject","onstop","onerror","delayStop","CLIPBOARD_ACCEPTED_TYPES","useDebouncedMemo","resolverFn","ms","dependencies","setValue","isFrozen","INLINE_BOT_QUERY_REGEXP","HAS_NEW_LINE","MEMO_NO_RESULT","canShowHelp","usernameLowered","tempEl","runThrottled","RE_COMMAND","DeleteMessageModal","openTimeout","isFirstTimeActivation","onActivate","buttonProps","CalendarModal","AttachMenu","SymbolMenu","InlineBotTooltip","MentionTooltip","CustomSend","StickerTooltip","BotCommandTooltip","useMouseInside","isKeyboardSingleUse","forceOpen","markForceOpen","unmarkForceOpen","keyboardButtons","noCompact","forwardMessageIds","forwardedMessagesCount","exitForwardMode","canAnimate","useAsyncRendering","clearEmbedded","handleMessageClick","faded","AttachmentModal","BotCommandMenu","PollModal","DropArea","RE_LINK","RegExp","RE_LINK_TEMPLATE","messageText","toggleMessageWebPage","linkEntity","ApiMessageEntityTypes","textMatch","renderingWebPage","webPageWithoutPhoto","messageStub","SendAsMenu","MainButtonState","VOICE_RECORDING_FILENAME","chatUser","selectChatUser","REPLIES_USER_ID","messageWithActualBotKeyboard","selectNewestMessageWithBotKeyboardButtons","shouldSuggestStickers","baseEmojiKeywords","BASE_EMOJI_KEYWORD_LANG","botKeyboardMessageId","keyboardMessage","defaultSendAsId","anonymous","sendAsUser","editingMessage","canScheduleUntilOnline","selectUserStatus","wasOnline","withScheduledButton","shouldSchedule","botKeyboardPlaceholder","keyboardPlaceholder","stickersForEmoji","groupChatMembers","topInlineBotIds","isInlineBotLoading","chatBotCommands","botCommands","dropAreaState","onDropHide","clearDraft","setStickerSearchQuery","setGifSearchQuery","closePollModal","addRecentEmoji","sendInlineBotResult","loadSendAs","appendixRef","setHtml","htmlRef","useStateRef","lastMessageSendTimeSeconds","prevDropAreaState","isCalendarOpen","openCalendar","closeCalendar","scheduledMessageArgs","setScheduledMessageArgs","canShowSendAs","sendMessageAction","useSendMessageAction","shouldAnimateSendAsButtonRef","prevChatId","prevSendAsIds","setAttachments","isBotKeyboardOpen","openBotKeyboard","closeBotKeyboard","isBotCommandMenuOpen","openBotCommandMenu","closeBotCommandMenu","isAttachMenuOpen","openAttachMenu","closeAttachMenu","isSymbolMenuOpen","openSymbolMenu","closeSymbolMenu","isSendAsMenuOpen","openSendAsMenu","closeSendAsMenu","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isSymbolMenuLoaded","onSymbolMenuLoadingComplete","isHoverDisabled","disableHover","enableHover","startRecordingVoice","stopRecordingVoice","pauseRecordingVoice","activeVoiceRecording","currentRecordTime","recordButtonRef","mainButtonRef","startRecordTimeRef","setActiveVoiceRecording","setCurrentRecordTime","IS_SAFARI","IS_VOICE_RECORDING_SUPPORTED","voiceRecording","tickVolume","boxShadow","useVoiceRecording","SEND_MESSAGE_ACTION_INTERVAL","mainButtonState","Edit","Schedule","Send","Record","canShowCustomSendMenu","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","isInlineBotTooltipOpen","inlineBotId","isInlineBotTooltipGallery","inlineBotSwitchPm","inlineBotResults","closeTooltip","closeInlineBotTooltip","inlineBotHelp","loadMore","loadMoreForInlineBot","queryInlineBot","resetInlineBot","markIsOpen","unmarkIsOpen","innerText","getPlainText","parseBotQuery","prevQuery","prevUsername","useInlineBotTooltip","isBotCommandTooltipOpen","close","closeBotCommandTooltip","filteredBotCommands","botTooltipCommands","setFilteredBotCommands","getFilteredCommands","nextFilteredBotCommands","prepareForRegExp","substr","useBotCommandTooltip","isCustomSendMenuOpen","canSendStickers","canSendGifs","canAttachMedia","canAttachPolls","canAttachEmbedLinks","getAllowedAttachmentOptions","isChatAdmin","slowMode","getChatSlowModeOptions","isStickerTooltipOpen","closeStickerTooltip","cleanHtml","trim","clearStickersForEmoji","IS_EMOJI_SUPPORTED","parseEmojiOnlyString","hasStickers","useStickerTooltip","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","insertTextAndUpdateCursor","newHtml","selectionRange","isSelectionInsideInput","dispatchEvent","Event","bubbles","focusEditableElement","removeSymbol","execCommand","tempInput","contentEditable","textLength","createRange","setStart","setEnd","removeChild","deleteLastCharacterOutsideSelection","resetComposer","shouldPreserveInput","stopRecordingVoiceRef","handleEditComplete","editedMessage","editMessage","getTextWithEntitiesAsHtml","hasMessageMedia","useEditing","saveDraft","updateDraft","draftChatId","draftThreadId","currentHtml","runDebouncedForSaveDraft","DRAFT_DEBOUNCE","prevThreadId","prevHtml","handleBlur","useDraft","handlePaste","clipboardData","input","activeElement","EDITABLE_INPUT_MODAL_ID","pastedText","getData","substring","items","files","getFilesFromDataTransferItems","newAttachments","all","file","useClipboardPaste","handleFileSelect","handleAppendFiles","handleClearAttachment","handleSend","currentAttachments","record","maxLength","extraLength","textParams","nowSeconds","secondsSinceLastMessage","nextSendDateNotReached","nextSendDate","seconds","secondsRemaining","isSlowMode","handleActivateBotCommandMenu","handleActivateSymbolMenu","handleGifSelect","gif","handleInlineBotSelect","inlineResult","handleBotCommandSelect","handlePollSend","handleSilentSend","handleMessageSchedule","isWhenOnline","restArgs","getTime","handleMessageScheduleUntilOnline","handleCloseCalendar","handleSearchOpen","handleSymbolMenuOpen","handleSendAsMenuOpen","handleAllScheduledClick","mainButtonHandler","areVoiceMessagesNotAllowed","prevEditedMessage","renderedEditedMessage","scheduledDefaultDate","setSeconds","setMilliseconds","scheduledMaxDate","setFullYear","getFullYear","sendButtonAriaLabel","symbolMenuButtonClassName","onSend","DropAreaState","withQuick","onHide","onFileSelect","caption","onCaptionUpdate","onFileAppend","onClear","selectedSendAsId","onInsertUserName","filteredUsers","onSelectResult","withUsername","MessageInput","forcedPlaceholder","canAutoFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","formatVoiceRecordDuration","onStickerSelect","emojis","onEmojiSelect","onPollCreate","onGifSelect","onRemoveSymbol","onSearchOpen","onSilentSend","onScheduleSend","withTimePicker","maxAt","getDayStartAt","isFutureMode","secondButtonLabel","onSubmit","onSecondButtonClick","MobileSearch","MessageSelectToolbar","UnpinAllMessagesModal","PaymentModal","ReceiptModal","SeenByModal","EmojiInteractionAnimation","ReactorListModal","CLOSE_ANIMATION_DURATION","isImage","kind","isBlurred","isBackgroundBlurred","background","customBackground","patternColor","themes","isMobileSearchActive","isReceiptModalOpen","isSeenByModalOpen","isReactorListModalOpen","getCanPostInChat","isBotNotStarted","isPinnedMessageList","isScheduledMessageList","currentUserBannedRights","defaultBannedRights","hasPinnedOrAudioPlayer","loadUser","closePaymentModal","clearReceipt","setDropAreaState","isFabShown","setIsFabShown","isNotchShown","setIsNotchShown","isUnpinModalOpen","setIsUnpinModalOpen","renderingChatId","usePrevDuringAnimation","renderingThreadId","renderingMessageListType","renderingCanSubscribe","renderingCanStartBot","renderingCanRestartBot","renderingCanPost","renderingHasTools","renderingIsFabShown","renderingIsChannel","prevTransitionKey","handleOpenEnd","handleSlideStop","withAnimations","setIsReady","forceUpdate","useForceUpdate","willSwitchMessageList","propertyName","useIsReady","ANIMATION_LEVEL_MIN","visualViewport","documentElement","handleDragEnter","dataTransfer","shouldDrawQuick","handleHideDropArea","handleOpenUnpinModal","closeUnpinModal","handleUnpinAllMessages","handleTabletFocus","customBackgroundValue","settingValue","cacheApi","CUSTOM_BG_CACHE_NAME","Type","useCustomBackground","MASK_IMAGE_DISABLED","messagingDisabledClassName","messageSendingRestrictionReason","getMessageSendingRestrictionReason","composerHiddenScale","toolbarHiddenScale","composerTranslateX","toolbarTranslateX","unpinHiddenScale","toolbarForUnpinHiddenScale","sidePadding","messageListWidth","rightColumnWidth","getMessageListWidth","sendButtonWidth","composerWidth","toolbarWidth","calculateMiddleFooterTransforms","footerClassName","forceSyncOnIOs","createMessageHash","isMessagingDisabled","withMessageListBottomShift","onTransitionEnd","DARK_THEME_BG_COLOR","LIGHT_THEME_BG_COLOR","onDragEnter","onStop","onUnpin","teactOrderKey","HeaderContent","isProfile","isManagement","messageSearchQuery","stickerSearchQuery","selectCurrentStickerSearch","gifSearchQuery","selectCurrentGifSearch","canAddContact","getCanAddContact","canManage","isEditingInvite","isColumnOpen","isSearch","isStickerSearch","isGifSearch","isPollResults","isAddingChatMembers","profileState","managementScreen","shouldSkipAnimation","setLocalTextSearchQuery","searchTextMessagesLocal","toggleManagement","addContact","setEditingExportedInvite","deleteExportedChatInvite","backButtonRef","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","handleEditInviteClick","handleDeleteInviteClick","handleMessageSearchQueryChange","handleStickerSearchQueryChange","handleGifSearchQueryChange","handleAddContact","setShouldSkipTransition","contentKey","ProfileState","Profile","SharedMedia","MemberList","Search","PollResults","StickerSearch","GifSearch","AddingMembers","ManageInitial","ManageChatPrivacyType","ManageDiscussion","ManageChannelSubscribers","ManageGroupPermissions","ManageChatAdministrators","ManageGroupRemovedUsers","ManageChannelRemovedUsers","ManageGroupUserPermissionsCreate","ManageGroupUserPermissions","ManageGroupRecentActions","ManageGroupAdminRights","ManageGroupNewAdminRights","ManageGroupMembers","ManageInvites","ManageEditInvite","ManageGroupAddAdmins","ManageReactions","ManageInviteInfo","ManageJoinRequests","renderingContentKey","isBackButton","buttonClassName","confirmIsDestructive","autoFocusSearch","renderHeaderContent","useInfiniteScrollForLoadableItems","currentResultType","handleLoadMore","itemIds","getMore","useInfiniteScroll","MEMBERS_SLICE","useInfiniteScrollForSharedMedia","forSharedMediaType","messageIdsRef","getMessageContentIds","runThrottledForScroll","isScrollingProgrammatically","TABS","buildInfiniteScrollItemSelector","resultType","mediaSearchType","isGroup","hasMembersTab","areMembersHidden","canViewMembers","canAddMembers","getHasAdminRight","canDeleteMembers","hasCommonChatsTab","resolvedUserId","isChatProtected","commonChatIds","onProfileStateChange","setLocalMediaSearchType","loadMoreMembers","loadCommonChats","searchMediaMessagesLocal","loadProfilePhotos","setNewChatMembersDialogState","setActiveTab","deletingUserId","setDeletingUserId","tabType","noProfileInfo","searchMessages","memberIds","sortUserIds","sortChatIds","memberViewportIds","getMoreMembers","noProfileInfoForMembers","mediaViewportIds","getMoreMedia","noProfileInfoForMedia","documentViewportIds","getMoreDocuments","noProfileInfoForDocuments","linkViewportIds","getMoreLinks","noProfileInfoForLinks","audioViewportIds","getMoreAudio","noProfileInfoForAudio","voiceViewportIds","getMoreVoices","noProfileInfoForVoices","commonChatViewportIds","getMoreCommonChats","noProfileInfoForCommonChats","useProfileViewportIds","prevTabType","tabsEl","prevProfileState","tabListEl","determineProfileState","useProfileState","applyTransitionFix","releaseTransitionFix","transitionElSelector","setMinHeight","transitionEl","minHeight","overflowY","scrollBarWidth","clientWidth","marginRight","useTransitionFixes","cacheBuster","resetCacheBuster","setCacheBuster","useCacheBuster","handleTransitionStop","handleNewMemberDialogOpen","NewChatMembersProgress","handleSelectMedia","handlePlayAudio","handleMemberClick","handleMessageFocus","handleDeleteMembersModalClose","renderingDelay","isFirstTab","SLIDE_TRANSITION_DURATION","canRenderContent","InfiniteScroll","itemSelector","sensitiveArea","PROFILE_SENSITIVE_AREA","preloadBackwards","noScrollRestoreOnTop","noFastList","onLoadMore","ProfileInfo","ChatExtra","renderProfileInfo","shouldRestoreHeight","onStart","noSpinner","NothingFound","Media","withDate","smaller","onDateClick","WebLink","onMessageClick","getSenderName","ListItem","contextActions","memberId","handler","forceShowSelf","big","FloatingActionButton","DeleteMemberModal","RightSearch","Management","localContactIds","isSearching","onNextStep","setUserSearchQuery","selectedMemberIds","setSelectedMemberIds","noPickerScrollRestore","member","handleFilterChange","displayedIds","filteredContactIds","filterUsersByName","canBeInvitedToGroup","handleNextStep","Picker","selectedIds","filterValue","filterPlaceholder","searchInputId","onSelectedIdsChange","onFilterChange","noScrollRestore","MAIN_SCREENS_COUNT","RightColumnContent","MANAGEMENT_SCREENS_COUNT","blurSearchInput","areActiveChatsLoaded","selectAreActiveChatsLoaded","nextManagementScreen","selectRightColumnContentKey","isChatSelected","toggleChatInfo","closePollResults","addChatMembers","setOpenedInviteInfo","setProfileState","setManagementScreen","selectedChatMemberId","setSelectedChatMemberId","isPromotedByCurrentUser","setIsPromotedByCurrentUser","isScrolledDown","isOverlaying","shouldScrollUp","handleSelectChatMember","isPromoted","handleAppendingChatMembers","onChatMemberSelect","MediaViewer","download","click","startedDownloads","downloadHash","getMessageContentFilename","Notifications","Dialogs","ForwardPicker","SafeLinkModal","HistoryCalendar","GroupCall","ActiveCallHeader","CallFallbackConfirm","notificationInterval","DEBUG_isLogged","updateIcon","asUnread","updatePageTitle","nextTitle","wasTimeFormatSetManually","authState","isMediaViewerOpen","selectIsMediaViewerOpen","isForwardModalOpen","selectIsForwardModalOpen","hasNotifications","hasDialogs","isHistoryCalendarOpen","isServiceChatReady","isCallFallbackConfirmOpen","isFallbackConfirmOpen","sync","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","loadCountryList","loadAvailableReactions","loadAddedStickers","ensureTimeFormat","openStickerSetShortName","checkVersionNotification","loadAppConfig","LOCATION_HASH","processDeepLink","decodeURIComponent","middleColumnTransitionClassNames","rightColumnTransitionClassNames","prevIsLeftColumnShown","dispatchHeavyAnimationEnd","waitForTransitionEnd","prevIsRightColumnShown","initialUnread","setInterval","INACTIVE_MARKER","newUnread","PAGE_TITLE","handleStickerSetModalClose","usePreventPinchZoomGesture","onDrop","onDragOver","initApi"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/302.317a243801f66d9ed028.js b/dist/302.cf81ea852f516bfc252f.js similarity index 99% rename from dist/302.317a243801f66d9ed028.js rename to dist/302.cf81ea852f516bfc252f.js index 71695eea..53625fef 100644 --- a/dist/302.317a243801f66d9ed028.js +++ b/dist/302.cf81ea852f516bfc252f.js @@ -1,2 +1,2 @@ "use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[302],{2275:(t,e,a)=>{a.d(e,{Z:()=>h});var s=a(4050),n=a(5116),o=a(9066),i=a(8415),d=a(2340),r=a(9107),c=a(3103),l=a(231);const h=(0,s.X$)((0,n.c$)(((t,e)=>{let{userId:a}=e;const s=(0,o.jr)(t),n=a&&(0,o.dy)(t,a);return{chat:s,contactName:n?(0,i.Vl)(n):void 0}}))((t=>{let{isOpen:e,chat:a,userId:o,contactName:i,onClose:h}=t;const{deleteChatMember:u}=(0,n.uC)(),p=(0,r.Z)(),f=(0,s.I4)((()=>{u({chatId:a.id,userId:o}),h()}),[a,u,h,o]);if(a&&o)return s.ZP.createElement(c.Z,{isOpen:e,onClose:h,onEnter:f,className:"delete",title:p("GroupRemoved.Remove")},s.ZP.createElement("p",null,(0,d.Z)(p("PeerInfo.Confirm.RemovePeer",i))),s.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:f},p("lng_box_remove")),s.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:h},p("Cancel")))})))},6204:(t,e,a)=>{a.d(e,{f:()=>y,C:()=>b});var s=a(5116),n=a(6137),o=a(1713),i=a(3716),d=a(1226),r=a(9959),c=a(9066),l=a(782),h=a(9118),u=a(8415),p=a(3551),f=a(4446),C=a(2607),I=a(6974);const m=(0,h.P2)((t=>t()),3e3,!0),g=(0,h.Ds)((t=>t()),500,!1,!0);async function v(t,e,a){var o;let h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=(0,s.Rd)();const p=await(0,d.t9)("fetchChats",{limit:i.Ov,offsetDate:a,archived:"archived"===t,withPinned:h,serverTimeOffset:u.serverTimeOffset,lastLocalServiceMessage:null===(o=(0,c.VF)(u))||void 0===o?void 0:o.message});if(!p)return;const{chatIds:f}=p;if(f.length>0&&f[0]===e&&f.shift(),u=(0,s.Rd)(),h&&"active"===t){const e=(0,c.jr)(u),a=e?[e]:[],s=(0,c.P2)(u)||[];u.currentUserId&&u.users.byId[u.currentUserId]&&s.push(u.users.byId[u.currentUserId]),u=(0,r.s5)(u,(0,l.ee)(s.concat(p.users),"id")),u=(0,r.ps)(u,p.userStatusesById),u=(0,r.SL)(u,(0,l.ee)(a.concat(p.chats),"id")),u=(0,r.Mg)(u,t,f)}else h&&"archived"===t?(u=(0,r.Sh)(u,(0,l.ee)(p.users,"id")),u=(0,r.zn)(u,p.userStatusesById),u=(0,r.GL)(u,(0,l.ee)(p.chats,"id")),u=(0,r.Mg)(u,t,f)):(u=(0,r.Sh)(u,(0,l.ee)(p.users,"id")),u=(0,r.zn)(u,p.userStatusesById),u=(0,r.GL)(u,(0,l.ee)(p.chats,"id")),u=(0,r.B1)(u,t,f));u=(0,r.vv)(u,t,p),Object.keys(p.draftsById).forEach((t=>{u=(0,r.pf)(u,t,n._f,"draft",p.draftsById[t])})),Object.keys(p.replyingToById).forEach((t=>{u=(0,r.pf)(u,t,n._f,"replyingToId",p.replyingToById[t])})),0!==f.length||u.chats.isFullyLoaded[t]||(u={...u,chats:{...u.chats,isFullyLoaded:{...u.chats.isFullyLoaded,[t]:!0}}}),(0,s.R3)(u)}async function y(t){const e=await(0,d.t9)("fetchFullChat",t);if(!e)return;const{users:a,fullInfo:n,groupCall:o}=e;let i=(0,s.Rd)();if(a&&(i=(0,r.Sh)(i,(0,l.ee)(a,"id"))),o){const t=(0,C.$5)(i,o.id);i=(0,f.AH)(i,o.id,(0,l.CE)(o,["connectionState"]),void 0,t?void 0:o.participantsCount)}return i=(0,r.a4)(i,t.id,{fullInfo:n}),(0,s.R3)(i),e}async function b(t){const e=(0,s.Rd)(),a=(0,c.DI)(e,t);if(a&&!a.isMin)return a;const n=await(0,d.t9)("getChatByUsername",t);return n?((0,s.R3)((0,r.a4)((0,s.Rd)(),n.id,n)),n):void 0}(0,s.Q6)("preloadTopChatMessages",((t,e)=>{(async()=>{const a=new Set;for(let s=0;st!==s&&!a.has(t)));if(!d)return;a.add(d),e.loadViewportMessages({chatId:d,threadId:n._f})}})()})),(0,s.Q6)("openChat",((t,e,a)=>{const{id:s,threadId:o}=a,{currentUserId:i}=t,r=(0,c.Z1)(t,s);if(null!=r&&r.hasUnreadMark&&e.toggleChatUnread({id:s}),r&&r.lastMessage&&r.lastMessage.threadInfo&&e.requestThreadInfoUpdate({chatId:r.lastMessage.threadInfo.chatId,threadId:r.lastMessage.threadInfo.threadId}),r)(0,u.Hp)(r)&&!r.isMin&&e.requestChatUpdate({chatId:s});else if(s===i)(0,d.t9)("fetchChat",{type:"self"});else{const e=(0,c.dy)(t,s);e&&(0,d.t9)("fetchChat",{type:"user",user:e})}o!==n._f&&((0,c.qS)(t,s,o)||e.requestThreadInfoUpdate({chatId:s,threadId:o}))})),(0,s.Q6)("openLinkedChat",((t,e,a)=>{const{id:s}=a,n=(0,c.Z1)(t,s);n&&(async()=>{var t;const a=await(0,d.t9)("fetchFullChat",n);null!=a&&null!==(t=a.fullInfo)&&void 0!==t&&t.linkedChatId&&e.openChat({id:a.fullInfo.linkedChatId})})()})),(0,s.Q6)("focusMessageInComments",((t,e,a)=>{const{chatId:s,threadId:n,messageId:o}=a,i=(0,c.Z1)(t,s);i&&(async()=>{await(0,d.t9)("requestThreadInfoUpdate",{chat:i,threadId:n})&&e.focusMessage({chatId:s,threadId:n,messageId:o})})()})),(0,s.Q6)("openSupportChat",((t,e)=>{const a=(0,c.P_)(t);a?e.openChat({id:a.id,shouldReplaceHistory:!0}):(e.openChat({id:i.AJ,shouldReplaceHistory:!0}),(async()=>{const t=await(0,d.t9)("fetchChat",{type:"support"});t&&e.openChat({id:t.chatId,shouldReplaceHistory:!0})})())})),(0,s.Q6)("openTipsChat",((t,e,a)=>{const{langCode:s}=a,n="pt-br"===s?"BR":i.Db.includes(s)?s.toUpperCase():"";e.openChatByUsername({username:`${i.vi}${n}`})})),(0,s.Q6)("loadAllChats",((t,e,a)=>{const n=a.listType;let{shouldReplace:o,onReplace:d}=a,r=0;(async()=>{for(;o||!(0,s.Rd)().chats.isFullyLoaded[n];){if(r++>=100)return void(i.eM&&console.error("`actions/loadAllChats`: Infinite loop detected"));if("connectionStateReady"!==(t=(0,s.Rd)()).connectionState||"authorizationStateReady"!==t.authState)return;const e=!o&&t.chats.listIds[n],a=e?e.map((e=>t.chats.byId[e])).filter((e=>Boolean(null==e?void 0:e.lastMessage)&&!(0,c.ep)(t,e.id))).sort(((t,e)=>t.lastMessage.date-e.lastMessage.date))[0]:void 0;await v(n,null==a?void 0:a.id,null==a?void 0:a.lastMessage.date,o),o&&(null==d||d(),o=!1)}})()})),(0,s.Q6)("loadFullChat",((t,e,a)=>{const{chatId:s,force:n}=a,o=(0,c.Z1)(t,s);o&&(n?y(o):g((()=>y(o))))})),(0,s.Q6)("loadTopChats",(()=>{m((()=>v("active")))})),(0,s.Q6)("requestChatUpdate",((t,e,a)=>{var s;const{serverTimeOffset:n}=t,{chatId:o}=a,r=(0,c.Z1)(t,o);r&&(0,d.t9)("requestChatUpdate",{chat:r,serverTimeOffset:n,...o===i.aw&&{lastLocalMessage:null===(s=(0,c.VF)(t))||void 0===s?void 0:s.message}})})),(0,s.Q6)("updateChatMutedState",((t,e,a)=>{const{serverTimeOffset:n}=t,{chatId:o,isMuted:i}=a,l=(0,c.Z1)(t,o);l&&((0,s.R3)((0,r.a4)(t,o,{isMuted:i})),(0,d.t9)("updateChatMutedState",{chat:l,isMuted:i,serverTimeOffset:n}))})),(0,s.Q6)("createChannel",((t,e,a)=>{const{title:n,about:i,photo:l,memberIds:h}=a;!async function(t,e,a,n){(0,s.R3)({...(0,s.Rd)(),chatCreation:{progress:o.Nh.InProgress}});const i=await(0,d.t9)("createChannel",{title:t,about:a,users:e});if(!i)return;const{id:c,accessHash:l}=i;let h=(0,s.Rd)();h=(0,r.a4)(h,c,i),h={...h,chatCreation:{...h.chatCreation,progress:i?o.Nh.Complete:o.Nh.Error}},(0,s.R3)(h),(0,s.uC)().openChat({id:c,shouldReplaceHistory:!0}),c&&l&&n&&await(0,d.t9)("editChatPhoto",{chatId:c,accessHash:l,photo:n})}(n,h.map((e=>(0,c.dy)(t,e))).filter(Boolean),i,l)})),(0,s.Q6)("joinChannel",((t,e,a)=>{const{chatId:s}=a,n=(0,c.Z1)(t,s);if(!n)return;const{id:o,accessHash:i}=n;o&&i&&(0,d.t9)("joinChannel",{channelId:o,accessHash:i})})),(0,s.Q6)("deleteChatUser",((t,e,a)=>{var n;const{chatId:o,userId:i}=a,l=(0,c.Z1)(t,o),h=(0,c.dy)(t,i);l&&h&&(t=(0,r.Dd)(t,o),(0,s.R3)(t),(null===(n=(0,c.Bt)(t))||void 0===n?void 0:n.chatId)===o&&e.openChat({id:void 0}),(0,d.t9)("deleteChatUser",{chat:l,user:h}))})),(0,s.Q6)("deleteChat",((t,e,a)=>{var n;const{chatId:o}=a,i=(0,c.Z1)(t,o);i&&(t=(0,r.Dd)(t,o),(0,s.R3)(t),(null===(n=(0,c.Bt)(t))||void 0===n?void 0:n.chatId)===o&&e.openChat({id:void 0}),(0,d.t9)("deleteChat",{chatId:i.id}))})),(0,s.Q6)("leaveChannel",((t,e,a)=>{var n;const{chatId:o}=a,i=(0,c.Z1)(t,o);if(!i)return;t=(0,r.Dd)(t,o),(0,s.R3)(t),(null===(n=(0,c.Bt)(t))||void 0===n?void 0:n.chatId)===o&&e.openChat({id:void 0});const{id:l,accessHash:h}=i;l&&h&&(0,d.t9)("leaveChannel",{channelId:l,accessHash:h})})),(0,s.Q6)("deleteChannel",((t,e,a)=>{var n;const{chatId:o}=a,i=(0,c.Z1)(t,o);if(!i)return;t=(0,r.Dd)(t,o),(0,s.R3)(t),(null===(n=(0,c.Bt)(t))||void 0===n?void 0:n.chatId)===o&&e.openChat({id:void 0});const{id:l,accessHash:h}=i;l&&h&&(0,d.t9)("deleteChannel",{channelId:l,accessHash:h})})),(0,s.Q6)("createGroupChat",((t,e,a)=>{const{title:n,memberIds:i,photo:l}=a;!async function(t,e,a){(0,s.R3)({...(0,s.Rd)(),chatCreation:{progress:o.Nh.InProgress}});try{const n=await(0,d.t9)("createGroupChat",{title:t,users:e});if(!n)return;const{id:i}=n;let c=(0,s.Rd)();c=(0,r.a4)(c,i,n),c={...c,chatCreation:{...c.chatCreation,progress:n?o.Nh.Complete:o.Nh.Error}},(0,s.R3)(c),(0,s.uC)().openChat({id:i,shouldReplaceHistory:!0}),i&&a&&await(0,d.t9)("editChatPhoto",{chatId:i,photo:a})}catch(t){if("USERS_TOO_FEW"===t.message){const t=(0,s.Rd)();(0,s.R3)({...t,chatCreation:{...t.chatCreation,progress:o.Nh.Error,error:"CreateGroupError"}})}}}(n,i.map((e=>(0,c.dy)(t,e))).filter(Boolean),l)})),(0,s.Q6)("toggleChatPinned",((t,e,a)=>{const{id:s,folderId:n}=a,o=(0,c.Z1)(t,s);if(o)if(n){const e=(0,c.Mw)(t,n);if(e){const a=!(0,c.ep)(t,s,n),{pinnedChatIds:o,includedChatIds:i}=e,r=a?[s,...o||[]]:(o||[]).filter((t=>t!==s)),l=[s,...i];(0,d.t9)("editChatFolder",{id:n,folderUpdate:{...e,pinnedChatIds:r,includedChatIds:l}})}}else{const e=(0,c.Ek)(t,s),a=(0,c.ep)(t,s,"archived"===e?i.WS:void 0);(0,d.t9)("toggleChatPinned",{chat:o,shouldBePinned:!a})}})),(0,s.Q6)("toggleChatArchived",((t,e,a)=>{const{id:s}=a,n=(0,c.Z1)(t,s);n&&(0,d.t9)("toggleChatArchived",{chat:n,folderId:(0,u.pE)(n)?0:i.WS})})),(0,s.Q6)("loadChatFolders",(()=>{!async function(){const t=await(0,d.t9)("fetchChatFolders");if(t){const e=(0,s.Rd)();(0,s.R3)({...e,chatFolders:{...e.chatFolders,...t}})}}()})),(0,s.Q6)("loadRecommendedChatFolders",(()=>{!async function(){const t=await(0,d.t9)("fetchRecommendedChatFolders");if(t){const e=(0,s.Rd)();(0,s.R3)({...e,chatFolders:{...e.chatFolders,recommended:t}})}}()})),(0,s.Q6)("editChatFolders",((t,e,a)=>{const{chatId:s,idsToRemove:n,idsToAdd:o}=a;n.forEach((async e=>{const a=(0,c.Mw)(t,e);var n;a&&await(0,d.t9)("editChatFolder",{id:e,folderUpdate:{...a,pinnedChatIds:null===(n=a.pinnedChatIds)||void 0===n?void 0:n.filter((t=>t!==s)),includedChatIds:a.includedChatIds.filter((t=>t!==s))}})})),o.forEach((async e=>{const a=(0,c.Mw)(t,e);a&&await(0,d.t9)("editChatFolder",{id:e,folderUpdate:{...a,includedChatIds:a.includedChatIds.concat(s)}})}))})),(0,s.Q6)("editChatFolder",((t,e,a)=>{const{id:s,folderUpdate:n}=a,o=(0,c.Mw)(t,s);o&&(0,d.t9)("editChatFolder",{id:s,folderUpdate:{id:s,emoticon:o.emoticon,pinnedChatIds:o.pinnedChatIds,...n}})})),(0,s.Q6)("addChatFolder",((t,e,a)=>{const{folder:n}=a,{orderedIds:o}=t.chatFolders;!async function(t,e){const{id:a,description:n,...o}=t;if(await(0,d.t9)("editChatFolder",{id:e+1,folderUpdate:{id:e+1,...o}}),!n)return;const i=(0,s.Rd)(),{recommended:r}=i.chatFolders;r&&(0,s.R3)({...i,chatFolders:{...i.chatFolders,recommended:r.filter((t=>{let{id:e}=t;return e!==a}))}})}(n,null!=o&&o.length?Math.max.apply(Math.max,o):i.WS)})),(0,s.Q6)("deleteChatFolder",((t,e,a)=>{const{id:s}=a;(0,c.Mw)(t,s)&&async function(t){await(0,d.t9)("deleteChatFolder",t)}(s)})),(0,s.Q6)("toggleChatUnread",((t,e,a)=>{const{id:s}=a,{serverTimeOffset:o}=t,i=(0,c.Z1)(t,s);i&&(i.unreadCount?(0,d.t9)("markMessageListRead",{serverTimeOffset:o,chat:i,threadId:n._f}):(0,d.t9)("toggleDialogUnread",{chat:i,hasUnreadMark:!i.hasUnreadMark}))})),(0,s.Q6)("openChatByInvite",((t,e,a)=>{const{hash:s}=a;(async()=>{const t=await(0,d.t9)("openChatByInvite",s);t&&e.openChat({id:t.chatId})})()})),(0,s.Q6)("openTelegramLink",((t,e,a)=>{const{url:s}=a;if(s.match(i.g$))return void(0,p.o)(s.match(i.g$)[0]);const n=new URL(s.startsWith("http")?s:`https://${s}`),[o,d,r]=n.pathname.split("/").filter(Boolean).map((t=>decodeURI(t))),l=Object.fromEntries(n.searchParams);let h;if("joinchat"===o&&(h=d),(o.startsWith(" ")||o.startsWith("+"))&&(h=o.substr(1,o.length-1)),h)return void e.openChatByInvite({hash:h});if("addstickers"===o)return void e.openStickerSetShortName({stickerSetShortName:d});const u=d||void 0,f=r?Number(r):void 0,C=l.comment?Number(l.comment):void 0;if(l.hasOwnProperty("voicechat")||l.hasOwnProperty("livestream"))e.joinVoiceChatByLink({username:o,inviteHash:l.voicechat||l.livestream});else if("c"===o&&u&&f){const a=`-${u}`;if(!(0,c.Z1)(t,a))return void e.showNotification({message:"Chat does not exist"});e.focusMessage({chatId:a,messageId:f})}else e.openChatByUsername({username:o,messageId:f||Number(u),commentId:C,startParam:l.start})})),(0,s.Q6)("acceptInviteConfirmation",((t,e,a)=>{const{hash:s}=a;(async()=>{const t=await(0,d.t9)("importChatInvite",{hash:s});t&&e.openChat({id:t.id})})()})),(0,s.Q6)("openChatByUsername",((t,e,a)=>{const{username:n,messageId:o,commentId:r,startParam:l}=a;(async()=>{const a=(0,c.jr)(t);if(!r)return a&&a.username===n?void e.focusMessage({chatId:a.id,messageId:o}):void await async function(t,e,a,s){t.openChat({id:i.AJ});const n=await b(e);if(!n)return t.openPreviousChat(),void t.showNotification({message:"User does not exist"});a?t.focusMessage({chatId:n.id,messageId:a}):t.openChat({id:n.id}),s&&t.startBot({botId:n.id,param:s})}(e,n,o,l);const{chatId:h,type:u}=(0,c.Bt)(t)||{},p=(0,c.DI)(t,n);if(h&&p&&"thread"===u){const a=(0,c.tZ)(t,h,o);if(a&&a.chatId===h)return void e.focusMessage({chatId:a.chatId,threadId:a.threadId,messageId:r})}o&&await async function(t,e,a,n){t.openChat({id:i.AJ});const o=await b(e);if(!o)return;const r=(0,s.Rd)(),l=(0,c.tZ)(r,o.id,a);let h;if(l)h=l.chatId;else{const t=await(0,d.t9)("requestThreadInfoUpdate",{chat:o,threadId:a});if(!t)return;h=t.discussionChatId}h&&t.focusMessage({chatId:h,threadId:a,messageId:Number(n)})}(e,n,o,r)})()})),(0,s.Q6)("togglePreHistoryHidden",((t,e,a)=>{const{chatId:s,isEnabled:n}=a;let o=(0,c.Z1)(t,s);o&&(async()=>{if((0,u.G9)(o)){if(o=await(0,d.t9)("migrateChat",o),!o)return;e.openChat({id:o.id})}(0,d.t9)("togglePreHistoryHidden",{chat:o,isEnabled:n})})()})),(0,s.Q6)("updateChatDefaultBannedRights",((t,e,a)=>{const{chatId:s,bannedRights:n}=a,o=(0,c.Z1)(t,s);o&&(0,d.t9)("updateChatDefaultBannedRights",{chat:o,bannedRights:n})})),(0,s.Q6)("updateChatMemberBannedRights",((t,e,a)=>{const{chatId:n,userId:o,bannedRights:i}=a;let l=(0,c.Z1)(t,n);const h=(0,c.dy)(t,o);l&&h&&(async()=>{if((0,u.G9)(l)){if(l=await(0,d.t9)("migrateChat",l),!l)return;e.openChat({id:l.id})}await(0,d.t9)("updateChatMemberBannedRights",{chat:l,user:h,bannedRights:i});const t=(0,s.Rd)(),a=(0,c.Z1)(t,n);if(!a||!a.fullInfo)return;const{members:p,kickedMembers:f}=a.fullInfo,C=Boolean(i.viewMessages),I=!Object.keys(i).length;(0,s.R3)((0,r.a4)(t,n,{fullInfo:{...a.fullInfo,...p&&C&&{members:p.filter((t=>t.userId!==o))},...p&&!C&&{members:p.map((t=>t.userId===o?{...t,bannedRights:i}:t))},...I&&f&&{kickedMembers:f.filter((t=>t.userId!==o))}}}))})()})),(0,s.Q6)("updateChatAdmin",((t,e,a)=>{const{chatId:n,userId:o,adminRights:i,customTitle:l}=a;let h=(0,c.Z1)(t,n);const p=(0,c.dy)(t,o);h&&p&&(async()=>{if((0,u.G9)(h)){if(h=await(0,d.t9)("migrateChat",h),!h)return;e.openChat({id:h.id})}await(0,d.t9)("updateChatAdmin",{chat:h,user:p,adminRights:i,customTitle:l});const t=await(0,d.t9)("fetchFullChat",h),a=(0,s.Rd)();if(!t||!t.fullInfo)return;const{adminMembers:c}=t.fullInfo,f=!Object.keys(i).length;(0,s.R3)((0,r.a4)(a,n,{fullInfo:{...t.fullInfo,...c&&f&&{adminMembers:c.filter((t=>t.userId!==o))},...c&&!f&&{adminMembers:c.map((t=>t.userId===o?{...t,adminRights:i,customTitle:l}:t))}}}))})()})),(0,s.Q6)("updateChat",((t,e,a)=>{const{chatId:n,title:i,about:l,photo:h}=a,u=(0,c.Z1)(t,n);u&&(async()=>{(0,s.R3)((0,r.H9)((0,s.Rd)(),o.wv.InProgress)),await Promise.all([u.title!==i?(0,d.t9)("updateChatTitle",u,i):void 0,u.fullInfo&&u.fullInfo.about!==l?(0,d.t9)("updateChatAbout",u,l):void 0,h?(0,d.t9)("editChatPhoto",{chatId:n,accessHash:u.accessHash,photo:h}):void 0]),(0,s.R3)((0,r.H9)((0,s.Rd)(),o.wv.Complete))})()})),(0,s.Q6)("toggleSignatures",((t,e,a)=>{const{chatId:s,isEnabled:n}=a,o=(0,c.Z1)(t,s);o&&(0,d.t9)("toggleSignatures",{chat:o,isEnabled:n})})),(0,s.Q6)("loadGroupsForDiscussion",(()=>{(async()=>{const t=await(0,d.t9)("fetchGroupsForDiscussion");if(!t)return;const e=t.reduce(((t,e)=>(e&&(t[e.id]=e),t)),{}),a=(0,r.fZ)((0,s.Rd)(),e);(0,s.R3)({...a,chats:{...a.chats,forDiscussionIds:Object.keys(e)}})})()})),(0,s.Q6)("linkDiscussionGroup",((t,e,a)=>{const{channelId:s,chatId:n}=a,o=(0,c.Z1)(t,s);let i=(0,c.Z1)(t,n);o&&i&&(async()=>{if((0,u.G9)(i)){if(i=await(0,d.t9)("migrateChat",i),!i)return;e.openChat({id:i.id})}let{fullInfo:t}=i;if(!t){const e=await(0,d.t9)("fetchFullChat",i);if(!e)return;t=e.fullInfo}t.isPreHistoryHidden&&await(0,d.t9)("togglePreHistoryHidden",{chat:i,isEnabled:!1}),(0,d.t9)("setDiscussionGroup",{channel:o,chat:i})})()})),(0,s.Q6)("unlinkDiscussionGroup",((t,e,a)=>{var s;const{channelId:n}=a,o=(0,c.Z1)(t,n);if(!o)return;let i;null!==(s=o.fullInfo)&&void 0!==s&&s.linkedChatId&&(i=(0,c.Z1)(t,o.fullInfo.linkedChatId)),(async()=>{await(0,d.t9)("setDiscussionGroup",{channel:o}),i&&y(i)})()})),(0,s.Q6)("setActiveChatFolder",((t,e,a)=>({...t,chatFolders:{...t.chatFolders,activeChatFolder:a}}))),(0,s.Q6)("loadMoreMembers",(t=>{(async()=>{var e,a;const{chatId:n}=(0,c.Bt)(t)||{},o=n?(0,c.Z1)(t,n):void 0;if(!o||(0,u.G9)(o))return;const i=(null===(e=o.fullInfo)||void 0===e||null===(a=e.members)||void 0===a?void 0:a.length)||void 0,h=await(0,d.t9)("fetchMembers",o.id,o.accessHash,"recent",i);if(!h)return;const{members:p,users:f}=h;p&&p.length&&(t=(0,s.Rd)(),t=(0,r.Sh)(t,(0,l.ee)(f,"id")),t=(0,r.a4)(t,o.id,{fullInfo:{...o.fullInfo,members:[...(o.fullInfo||{}).members||[],...p||[]]}}),(0,s.R3)(t))})()})),(0,s.Q6)("addChatMembers",((t,e,a)=>{const{chatId:s,memberIds:n}=a,i=(0,c.Z1)(t,s),r=n.map((e=>(0,c.dy)(t,e))).filter(Boolean);i&&r.length&&(e.setNewChatMembersDialogState(o.WB.Loading),(async()=>{await(0,d.t9)("addChatMembers",i,r),e.setNewChatMembersDialogState(o.WB.Closed),y(i)})())})),(0,s.Q6)("deleteChatMember",((t,e,a)=>{const{chatId:s,userId:n}=a,o=(0,c.Z1)(t,s),i=(0,c.dy)(t,n);o&&i&&(async()=>{await(0,d.t9)("deleteChatMember",o,i),y(o)})()})),(0,s.Q6)("toggleIsProtected",((t,e,a)=>{const{chatId:s,isProtected:n}=a,o=(0,c.Z1)(t,s);o&&(0,d.t9)("toggleIsProtected",{chat:o,isProtected:n})})),(0,s.Q6)("setChatEnabledReactions",((t,e,a)=>{const{chatId:s,enabledReactions:n}=a,o=(0,c.Z1)(t,s);o&&(async()=>{await(0,d.t9)("setChatEnabledReactions",{chat:o,enabledReactions:n}),await y(o)})()}))},1689:(t,e,a)=>{a.d(e,{FF:()=>M,NH:()=>Q,Mt:()=>Z});var s=a(5116),n=a(2607),o=a(1226),i=a(9066),d=a(4319),r=a(4446),c=a(782),l=a(9959),h=a(6204),u=a(4753),p=a(7361),f=a(711);let C,I;const m=new Audio("./voicechat_join.mp3"),g=new Audio("./voicechat_connecting.mp3");g.loop=!0;const v=new Audio("./voicechat_leave.mp3"),y={join:m,allowTalk:new Audio("./voicechat_onallowtalk.mp3"),leave:v,connecting:g};let b=Promise.resolve();async function w(t){const e=await(0,o.t9)("getGroupCall",{call:t});if(!e)return;let a=(0,s.Rd)();const i=(0,n.$5)(a,t.id);return a=(0,r.AH)(a,t.id,(0,c.CE)(e.groupCall,["connectionState"]),void 0,null!=i&&i.isLoaded?void 0:e.groupCall.participantsCount),a=(0,l.Sh)(a,(0,c.ee)(e.users,"id")),a=(0,l.fZ)(a,(0,c.ee)(e.chats,"id")),(0,s.R3)(a),e.groupCall}async function R(t,e){const a=await(0,o.t9)("fetchGroupCallParticipants",{call:t,offset:e});if(!a)return;let n=(0,s.Rd)();n=(0,l.Sh)(n,(0,c.ee)(a.users,"id")),n=(0,l.fZ)(n,(0,c.ee)(a.chats,"id")),(0,s.R3)(n)}function M(){return C}function Q(){return I}function Z(){var t;null===(t=C)||void 0===t||t.pause(),I=void 0,C=void 0}(0,s.Q6)("toggleGroupCallPanel",(t=>({...t,groupCalls:{...t.groupCalls,isGroupCallPanelHidden:!t.groupCalls.isGroupCallPanelHidden}}))),(0,s.Q6)("subscribeToGroupCallUpdates",((t,e,a)=>{const{subscribed:s,id:i}=a,d=(0,n.$5)(t,i);d&&(async()=>{s&&(await w(d),await R(d)),await(0,o.t9)("toggleGroupCallStartSubscription",{subscribed:s,call:d})})()})),(0,s.Q6)("createGroupCall",((t,e,a)=>{const{chatId:n}=a,d=(0,i.Z1)(t,n);d&&(async()=>{const a=await(0,o.t9)("createGroupCall",{peer:d});a&&(t=(0,s.Rd)(),(0,s.R3)((0,r.AH)(t,a.id,{...a,chatId:n})),e.joinGroupCall({id:a.id,accessHash:a.accessHash}))})()})),(0,s.Q6)("createGroupCallInviteLink",((t,e)=>{const a=(0,n.mU)(t);if(!a||!a.chatId)return;const s=(0,i.Z1)(t,a.chatId);if(!s)return;const r=Boolean(s.username);(async()=>{let{inviteLink:t}=s.fullInfo;r&&(t=await(0,o.t9)("exportGroupCallInvite",{call:a,canSelfUnmute:!1})),t&&((0,d.TE)(t),e.showNotification({message:"Link copied to clipboard"}))})()})),(0,s.Q6)("joinVoiceChatByLink",((t,e,a)=>{const{username:s,inviteHash:n}=a;(async()=>{const t=await(0,h.C)(s);if(!t)return void e.showNotification({message:f.i0("NoUsernameFound")});const a=await(0,h.f)(t);null!=a&&a.groupCall&&e.joinGroupCall({id:a.groupCall.id,accessHash:a.groupCall.accessHash,inviteHash:n})})()})),(0,s.Q6)("joinGroupCall",((t,e,a)=>{if(!p.Bi)return;const{chatId:o,id:i,accessHash:d,inviteHash:c}=a;!function(){const t=new(window.AudioContext||window.webkitAudioContext);C=new Audio,I=t,C.srcObject=(t=>{const e=t.createOscillator(),a=e.connect(t.createMediaStreamDestination());return e.start(),new MediaStream([Object.assign(a.stream.getAudioTracks()[0],{enabled:!1})])})(t),(0,u.Z)(C)}(),(async()=>{var l;await(b?(b=Promise.all(Object.values(y).map((t=>(t.muted=!0,t.volume=1e-4,t.play().then((()=>{t.pause(),t.volume=1,t.currentTime=0,t.muted=!1})))))).then((()=>{b=void 0})),b):Promise.resolve());const{groupCalls:{activeGroupCallId:h}}=t;let u=i?(0,n.$5)(t,i):(0,n.Bj)(t,o);(null===(l=u)||void 0===l?void 0:l.id)!==h?h?e.leaveGroupCall({rejoin:a}):u&&h===u.id?e.toggleGroupCallPanel():(u||i&&d||(u=await w({id:i,accessHash:d})),u&&(t=(0,s.Rd)(),t=(0,r.AH)(t,u.id,{...u,inviteHash:c},void 0,u.participantsCount+1),(0,s.R3)({...t,groupCalls:{...t.groupCalls,activeGroupCallId:u.id,isGroupCallPanelHidden:!1}}))):e.toggleGroupCallPanel()})()})),(0,s.Q6)("playGroupCallSound",((t,e,a)=>{const{sound:s}=a;y[s]&&(b?b.then((()=>{(0,u.Z)(y[s])})):("connecting"!==s&&y.connecting.pause(),(0,u.Z)(y[s])))})),(0,s.Q6)("loadMoreGroupCallParticipants",(t=>{const e=(0,n.mU)(t);e&&R(e,e.nextOffset)})),(0,s.Q6)("openCallFallbackConfirm",(t=>({...t,groupCalls:{...t.groupCalls,isFallbackConfirmOpen:!0}}))),(0,s.Q6)("closeCallFallbackConfirm",(t=>({...t,groupCalls:{...t.groupCalls,isFallbackConfirmOpen:!1}})))},4446:(t,e,a)=>{a.d(e,{AH:()=>d,dc:()=>r,Ic:()=>c,B6:()=>l});var s=a(2607),n=a(782),o=a(6788),i=a(9066);function d(t,e,a,s,o){var i;const d=Object.values({...null===(i=t.groupCalls.byId[e])||void 0===i?void 0:i.participants,...a.participants}).filter((t=>!t.isLeft)).reduce(((t,e)=>(t[e.id]=e,t)),{});return{...t,groupCalls:{...t.groupCalls,byId:{...t.groupCalls.byId,[e]:{...t.groupCalls.byId[e],...(0,n.CE)(a,["participantsCount"]),...s&&{participantsCount:t.groupCalls.byId[e].participantsCount+s},...void 0!==o&&{participantsCount:o},participants:d}}}}}function r(t,e){const a=(0,s.$5)(t,e);if(a&&a.chatId){const e=(0,i.Z1)(t,a.chatId);e&&(t=(0,o.a4)(t,a.chatId,{fullInfo:{...e.fullInfo,groupCallId:void 0}}))}return{...t,groupCalls:{...t.groupCalls,byId:{...(0,n.CE)(t.groupCalls.byId,[e.toString()])}}}}function c(t,e,a){return t.groupCalls.activeGroupCallId?d(t,t.groupCalls.activeGroupCallId,e,void 0,a):t}function l(t,e,a,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const i=(0,s.$5)(t,e);return i?d(t,e,{participants:{...i.participants,[a]:{...i.participants[a],...n}}},n.isLeft?o?0:-1:i.participants[a]||o?0:1):t}},2607:(t,e,a)=>{a.d(e,{Bj:()=>i,$5:()=>d,GU:()=>r,Ht:()=>c,mU:()=>l,oq:()=>h});var s=a(8857),n=a(8415),o=a(6376);function i(t,e){const a=(0,s.Z1)(t,e);if(a&&a.fullInfo&&a.fullInfo.groupCallId)return d(t,a.fullInfo.groupCallId)}function d(t,e){return t.groupCalls.byId[e]}function r(t,e,a){var s;return null===(s=d(t,e))||void 0===s?void 0:s.participants[a]}function c(t){var e,a;const o=null===(e=l(t))||void 0===e?void 0:e.chatId;if(!o)return!1;const i=(0,s.Z1)(t,o);return!!i&&((0,n.G9)(i)&&i.isCreator||Boolean(null===(a=i.adminRights)||void 0===a?void 0:a.manageCall))}function l(t){const{groupCalls:{activeGroupCallId:e}}=t;if(e)return d(t,e)}function h(t){const e=(0,o.dy)(t,t.currentUserId);return`Calls: ${(0,n.Js)(e)}`}},3551:(t,e,a)=>{a.d(e,{o:()=>o});var s=a(5116),n=a(7361);const o=t=>{const{protocol:e,searchParams:a,pathname:o,hostname:i}=new URL(t);if("tg:"!==e)return;const{openChatByInvite:d,openChatByUsername:r,openStickerSetShortName:c,focusMessage:l,joinVoiceChatByLink:h}=(0,s.uC)(),u=(n.s$?i:o).replace(/^\/\//,""),p={};switch(a.forEach(((t,e)=>{p[e]=t})),u){case"resolve":{const{domain:t,post:e,comment:a,voicechat:s,livestream:n,start:o}=p;"telegrampassport"!==t&&(p.hasOwnProperty("voicechat")||p.hasOwnProperty("livestream")?h({username:t,inviteHash:s||n}):r({username:t,messageId:Number(e),commentId:Number(a),startParam:o}));break}case"privatepost":{const{post:t,channel:e}=p;l({chatId:`-${e}`,id:t});break}case"bg":case"share":case"msg":case"login":default:break;case"join":{const{invite:t}=p;d({hash:t});break}case"addstickers":{const{set:t}=p;c({stickerSetShortName:t});break}}}}}]); -//# sourceMappingURL=302.317a243801f66d9ed028.js.map \ No newline at end of file +//# sourceMappingURL=302.cf81ea852f516bfc252f.js.map \ No newline at end of file diff --git a/dist/302.317a243801f66d9ed028.js.map b/dist/302.cf81ea852f516bfc252f.js.map similarity index 99% rename from dist/302.317a243801f66d9ed028.js.map rename to dist/302.cf81ea852f516bfc252f.js.map index a65a4581..d20e9e9c 100644 --- a/dist/302.317a243801f66d9ed028.js.map +++ b/dist/302.cf81ea852f516bfc252f.js.map @@ -1 +1 @@ -{"version":3,"file":"302.317a243801f66d9ed028.js","mappings":"2MAwBA,MAqCA,GAAeA,EAAAA,EAAAA,KAAKC,EAAAA,EAAAA,KAClB,CAACC,EAAD,KAAoC,IAA3B,OAAEC,GAAyB,EAClC,MAAMC,GAAOC,EAAAA,EAAAA,IAAkBH,GACzBI,EAAOH,IAAUI,EAAAA,EAAAA,IAAWL,EAAQC,GAG1C,MAAO,CACLC,KAAAA,EACAI,YAJkBF,GAAOG,EAAAA,EAAAA,IAAuBH,QAAQI,KAJ1CT,EArCiC,IAM/C,IANgD,OACpDU,EADoD,KAEpDP,EAFoD,OAGpDD,EAHoD,YAIpDK,EAJoD,QAKpDI,GACI,EACJ,MAAM,iBAAEC,IAAqBC,EAAAA,EAAAA,MAEvBC,GAAOC,EAAAA,EAAAA,KAEPC,GAAyBC,EAAAA,EAAAA,KAAY,KACzCL,EAAiB,CAAEM,OAAQf,EAAMgB,GAAIjB,OAAAA,IACrCS,MACC,CAACR,EAAMS,EAAkBD,EAAST,IAErC,GAAKC,GAASD,EAId,OACE,mBAAC,IAAD,CACEQ,OAAQA,EACRC,QAASA,EACTS,QAASJ,EACTK,UAAU,SACVC,MAAOR,EAAK,wBAEZ,6BAAIS,EAAAA,EAAAA,GAAWT,EAAK,8BAA+BP,KACnD,mBAAC,IAAD,CAAQiB,MAAM,SAASH,UAAU,wBAAwBI,QAAM,EAACC,QAASV,GACtEF,EAAK,mBAER,mBAAC,IAAD,CAAQO,UAAU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C5ClB,EAEW,qBAAX6J,IACE7J,EAAOW,eAAe,cAAgBX,EAAOW,eAAe,cAC9DC,EAAoB,CAClB9I,SAAU+R,EACVhJ,WAAYC,GAAaC,IAG3BpG,EAAmB,CACjB7C,SAAU+R,EACV3P,UAAWsG,OAAOsJ,GAClBrJ,UAAWD,OAAOE,GAClBO,WAAYC,KAIlB,MAEF,IAAK,cAAe,CAClB,MAAM,KACJ4I,EADI,QACEzG,GACJrD,EAEJ7F,EAAa,CACX/G,OAAS,IAAGiQ,IACZhQ,GAAIyW,IAEN,MAEF,IAAK,KAoBL,IAAK,QACL,IAAK,MAIL,IAAK,QAIL,QAGE,MA1BF,IAAK,OAAQ,CACX,MAAM,OAAEC,GAAW/J,EAEnBI,EAAiB,CAAEnB,KAAM8K,IACzB,MAEF,IAAK,cAAe,CAClB,MAAM,IAAEC,GAAQhK,EAEhBK,EAAwB,CACtBC,oBAAqB0J,IAEvB","sources":["webpack://telegram-t/./src/components/right/DeleteMemberModal.tsx","webpack://telegram-t/./src/modules/actions/api/chats.ts","webpack://telegram-t/./src/modules/actions/ui/calls.ts","webpack://telegram-t/./src/modules/reducers/calls.ts","webpack://telegram-t/./src/modules/selectors/calls.ts","webpack://telegram-t/./src/util/deeplink.ts"],"sourcesContent":["import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\n\nimport { selectCurrentChat, selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n userId?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n}) => {\n const { deleteChatMember } = getDispatch();\n\n const lang = useLang();\n\n const handleDeleteChatMember = useCallback(() => {\n deleteChatMember({ chatId: chat!.id, userId });\n onClose();\n }, [chat, deleteChatMember, onClose, userId]);\n\n if (!chat || !userId) {\n return undefined;\n }\n\n return (\n \n

{renderText(lang('PeerInfo.Confirm.RemovePeer', contactName))}

\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const chat = selectCurrentChat(global);\n const user = userId && selectUser(global, userId);\n const contactName = user ? getUserFirstOrLastName(user) : undefined;\n\n return {\n chat,\n contactName,\n };\n },\n)(DeleteMemberModal));\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n ARCHIVED_FOLDER_ID,\n TOP_CHAT_MESSAGES_PRELOAD_LIMIT,\n CHAT_LIST_LOAD_SLICE,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n RE_TG_LINK,\n SERVICE_NOTIFICATIONS_USER_ID,\n TMP_CHAT_ID, ALL_FOLDER_ID, DEBUG,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats, addUsers, addUserStatuses, replaceThreadParam,\n updateChatListIds, updateChats, updateChat, updateChatListSecondaryInfo,\n updateManagementProgress, leaveChat, replaceUsers, replaceUserStatuses,\n replaceChats, replaceChatListIds,\n} from '../../reducers';\nimport {\n selectChat, selectUser, selectChatListType, selectIsChatPinned,\n selectChatFolder, selectSupportChat, selectChatByUsername, selectThreadTopMessageId,\n selectCurrentMessageList, selectThreadInfo, selectCurrentChat, selectLastServiceNotification,\n selectVisibleUsers,\n} from '../../selectors';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, isChatBasicGroup,\n} from '../../helpers';\nimport { processDeepLink } from '../../../util/deeplink';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { selectGroupCall } from '../../selectors/calls';\nimport { getOrderedIds } from '../../../util/folderManager';\n\nconst TOP_CHAT_MESSAGES_PRELOAD_INTERVAL = 100;\nconst INFINITE_LOOP_MARKER = 100;\n\nconst runThrottledForLoadTopChats = throttle((cb) => cb(), 3000, true);\nconst runDebouncedForLoadFullChat = debounce((cb) => cb(), 500, false, true);\n\naddReducer('preloadTopChatMessages', (global, actions) => {\n (async () => {\n const preloadedChatIds = new Set();\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHAT_MESSAGES_PRELOAD_INTERVAL);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const folderAllOrderedIds = getOrderedIds(ALL_FOLDER_ID);\n const nextChatId = folderAllOrderedIds?.find((id) => id !== currentChatId && !preloadedChatIds.has(id));\n if (!nextChatId) {\n return;\n }\n\n preloadedChatIds.add(nextChatId);\n\n actions.loadViewportMessages({ chatId: nextChatId, threadId: MAIN_THREAD_ID });\n }\n })();\n});\n\naddReducer('openChat', (global, actions, payload) => {\n const { id, threadId } = payload!;\n const { currentUserId } = global;\n const chat = selectChat(global, id);\n\n if (chat?.hasUnreadMark) {\n actions.toggleChatUnread({ id });\n }\n\n // Please telegram send us some updates about linked chat 🙏\n if (chat && chat.lastMessage && chat.lastMessage.threadInfo) {\n actions.requestThreadInfoUpdate({\n chatId: chat.lastMessage.threadInfo.chatId,\n threadId: chat.lastMessage.threadInfo.threadId,\n });\n }\n\n if (!chat) {\n if (id === currentUserId) {\n void callApi('fetchChat', { type: 'self' });\n } else {\n const user = selectUser(global, id);\n if (user) {\n void callApi('fetchChat', { type: 'user', user });\n }\n }\n } else if (isChatSummaryOnly(chat) && !chat.isMin) {\n actions.requestChatUpdate({ chatId: id });\n }\n\n if (threadId !== MAIN_THREAD_ID) {\n const topMessageId = selectThreadTopMessageId(global, id, threadId);\n if (!topMessageId) {\n actions.requestThreadInfoUpdate({ chatId: id, threadId });\n }\n }\n});\n\naddReducer('openLinkedChat', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n (async () => {\n const chatFullInfo = await callApi('fetchFullChat', chat);\n\n if (chatFullInfo?.fullInfo?.linkedChatId) {\n actions.openChat({ id: chatFullInfo.fullInfo.linkedChatId });\n }\n })();\n});\n\naddReducer('focusMessageInComments', (global, actions, payload) => {\n const { chatId, threadId, messageId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId });\n if (!result) {\n return;\n }\n\n actions.focusMessage({ chatId, threadId, messageId });\n })();\n});\n\naddReducer('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n if (chat) {\n actions.openChat({ id: chat.id, shouldReplaceHistory: true });\n return;\n }\n\n actions.openChat({ id: TMP_CHAT_ID, shouldReplaceHistory: true });\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId, shouldReplaceHistory: true });\n }\n })();\n});\n\naddReducer('openTipsChat', (global, actions, payload) => {\n const { langCode } = payload;\n\n const usernamePostfix = langCode === 'pt-br'\n ? 'BR'\n : LOCALIZED_TIPS.includes(langCode) ? (langCode as string).toUpperCase() : '';\n\n actions.openChatByUsername({ username: `${TIPS_USERNAME}${usernamePostfix}` });\n});\n\naddReducer('loadAllChats', (global, actions, payload) => {\n const listType = payload.listType as 'active' | 'archived';\n let { shouldReplace, onReplace } = payload;\n let i = 0;\n\n (async () => {\n while (shouldReplace || !getGlobal().chats.isFullyLoaded[listType]) {\n if (i++ >= INFINITE_LOOP_MARKER) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('`actions/loadAllChats`: Infinite loop detected');\n }\n\n return;\n }\n\n global = getGlobal();\n\n if (global.connectionState !== 'connectionStateReady' || global.authState !== 'authorizationStateReady') {\n return;\n }\n\n const listIds = !shouldReplace && global.chats.listIds[listType];\n const oldestChat = listIds\n ? listIds\n /* eslint-disable @typescript-eslint/no-loop-func */\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(global, chat.id))\n /* eslint-enable @typescript-eslint/no-loop-func */\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n await loadChats(listType, oldestChat?.id, oldestChat?.lastMessage!.date, shouldReplace);\n\n if (shouldReplace) {\n onReplace?.();\n shouldReplace = false;\n }\n }\n })();\n});\n\naddReducer('loadFullChat', (global, actions, payload) => {\n const { chatId, force } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (force) {\n loadFullChat(chat);\n } else {\n runDebouncedForLoadFullChat(() => loadFullChat(chat));\n }\n});\n\naddReducer('loadTopChats', () => {\n runThrottledForLoadTopChats(() => loadChats('active'));\n});\n\naddReducer('requestChatUpdate', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void callApi('requestChatUpdate', {\n chat,\n serverTimeOffset,\n ...(chatId === SERVICE_NOTIFICATIONS_USER_ID && {\n lastLocalMessage: selectLastServiceNotification(global)?.message,\n }),\n });\n});\n\naddReducer('updateChatMutedState', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId, isMuted } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateChat(global, chatId, { isMuted }));\n void callApi('updateChatMutedState', { chat, isMuted, serverTimeOffset });\n});\n\naddReducer('createChannel', (global, actions, payload) => {\n const {\n title, about, photo, memberIds,\n } = payload!;\n\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createChannel(title, members, about, photo);\n});\n\naddReducer('joinChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n void callApi('joinChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChatUser', (global, actions, payload) => {\n const { chatId, userId }: { chatId: string; userId: string } = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChatUser', { chat, user });\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n const { chatId }: { chatId: string } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChat', { chatId: chat.id });\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('leaveChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('deleteChannel', { channelId, accessHash });\n }\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createGroupChat(title, members, photo);\n});\n\naddReducer('toggleChatPinned', (global, actions, payload) => {\n const { id, folderId } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n if (folderId) {\n const folder = selectChatFolder(global, folderId);\n if (folder) {\n const shouldBePinned = !selectIsChatPinned(global, id, folderId);\n\n const { pinnedChatIds, includedChatIds } = folder;\n const newPinnedIds = shouldBePinned\n ? [id, ...(pinnedChatIds || [])]\n : (pinnedChatIds || []).filter((pinnedId) => pinnedId !== id);\n\n // With both Pin and Unpin we need to re-add a user to the included group\n const newIncludedChatIds = [id, ...includedChatIds];\n\n void callApi('editChatFolder', {\n id: folderId,\n folderUpdate: {\n ...folder,\n pinnedChatIds: newPinnedIds,\n includedChatIds: newIncludedChatIds,\n },\n });\n }\n } else {\n const listType = selectChatListType(global, id);\n const isPinned = selectIsChatPinned(global, id, listType === 'archived' ? ARCHIVED_FOLDER_ID : undefined);\n void callApi('toggleChatPinned', { chat, shouldBePinned: !isPinned });\n }\n});\n\naddReducer('toggleChatArchived', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (chat) {\n void callApi('toggleChatArchived', {\n chat,\n folderId: isChatArchived(chat) ? 0 : ARCHIVED_FOLDER_ID,\n });\n }\n});\n\naddReducer('loadChatFolders', () => {\n void loadChatFolders();\n});\n\naddReducer('loadRecommendedChatFolders', () => {\n void loadRecommendedChatFolders();\n});\n\naddReducer('editChatFolders', (global, actions, payload) => {\n const { chatId, idsToRemove, idsToAdd } = payload!;\n\n (idsToRemove as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n pinnedChatIds: folder.pinnedChatIds?.filter((pinnedId) => pinnedId !== chatId),\n includedChatIds: folder.includedChatIds.filter((includedId) => includedId !== chatId),\n },\n });\n }\n });\n\n (idsToAdd as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n includedChatIds: folder.includedChatIds.concat(chatId),\n },\n });\n }\n });\n});\n\naddReducer('editChatFolder', (global, actions, payload) => {\n const { id, folderUpdate } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void callApi('editChatFolder', {\n id,\n folderUpdate: {\n id,\n emoticon: folder.emoticon,\n pinnedChatIds: folder.pinnedChatIds,\n ...folderUpdate,\n },\n });\n }\n});\n\naddReducer('addChatFolder', (global, actions, payload) => {\n const { folder } = payload!;\n const { orderedIds } = global.chatFolders;\n const maxId = orderedIds?.length ? Math.max.apply(Math.max, orderedIds) : ARCHIVED_FOLDER_ID;\n\n void createChatFolder(folder, maxId);\n});\n\naddReducer('deleteChatFolder', (global, actions, payload) => {\n const { id } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void deleteChatFolder(id);\n }\n});\n\naddReducer('toggleChatUnread', (global, actions, payload) => {\n const { id } = payload!;\n const { serverTimeOffset } = global;\n const chat = selectChat(global, id);\n if (chat) {\n if (chat.unreadCount) {\n void callApi('markMessageListRead', { serverTimeOffset, chat, threadId: MAIN_THREAD_ID });\n } else {\n void callApi('toggleDialogUnread', {\n chat,\n hasUnreadMark: !chat.hasUnreadMark,\n });\n }\n }\n});\n\naddReducer('openChatByInvite', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('openChatByInvite', hash);\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.chatId });\n })();\n});\n\naddReducer('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n if (url.match(RE_TG_LINK)) {\n processDeepLink(url.match(RE_TG_LINK)[0]);\n return;\n }\n\n const uri = new URL(url.startsWith('http') ? url : `https://${url}`);\n const [part1, part2, part3] = uri.pathname.split('/').filter(Boolean).map((l) => decodeURI(l));\n const params = Object.fromEntries(uri.searchParams);\n\n let hash: string | undefined;\n if (part1 === 'joinchat') {\n hash = part2;\n }\n\n if (part1.startsWith(' ') || part1.startsWith('+')) {\n hash = part1.substr(1, part1.length - 1);\n }\n\n if (hash) {\n actions.openChatByInvite({ hash });\n return;\n }\n\n if (part1 === 'addstickers') {\n actions.openStickerSetShortName({\n stickerSetShortName: part2,\n });\n return;\n }\n\n const chatOrChannelPostId = part2 || undefined;\n const messageId = part3 ? Number(part3) : undefined;\n const commentId = params.comment ? Number(params.comment) : undefined;\n\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n actions.joinVoiceChatByLink({\n username: part1,\n inviteHash: params.voicechat || params.livestream,\n });\n } else if (part1 === 'c' && chatOrChannelPostId && messageId) {\n const chatId = `-${chatOrChannelPostId}`;\n const chat = selectChat(global, chatId);\n if (!chat) {\n actions.showNotification({ message: 'Chat does not exist' });\n return;\n }\n\n actions.focusMessage({\n chatId,\n messageId,\n });\n } else {\n actions.openChatByUsername({\n username: part1,\n messageId: messageId || Number(chatOrChannelPostId),\n commentId,\n startParam: params.start,\n });\n }\n});\n\naddReducer('acceptInviteConfirmation', (global, actions, payload) => {\n const { hash } = payload!;\n (async () => {\n const result = await callApi('importChatInvite', { hash });\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.id });\n })();\n});\n\naddReducer('openChatByUsername', (global, actions, payload) => {\n const {\n username, messageId, commentId, startParam,\n } = payload!;\n\n (async () => {\n const chat = selectCurrentChat(global);\n\n if (!commentId) {\n if (chat && chat.username === username) {\n actions.focusMessage({ chatId: chat.id, messageId });\n return;\n }\n await openChatByUsername(actions, username, messageId, startParam);\n return;\n }\n\n const { chatId, type } = selectCurrentMessageList(global) || {};\n const usernameChat = selectChatByUsername(global, username);\n if (chatId && usernameChat && type === 'thread') {\n const threadInfo = selectThreadInfo(global, chatId, messageId);\n\n if (threadInfo && threadInfo.chatId === chatId) {\n actions.focusMessage({\n chatId: threadInfo.chatId,\n threadId: threadInfo.threadId,\n messageId: commentId,\n });\n return;\n }\n }\n\n if (!messageId) return;\n\n await openCommentsByUsername(actions, username, messageId, commentId);\n })();\n});\n\naddReducer('togglePreHistoryHidden', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n let chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n void callApi('togglePreHistoryHidden', { chat, isEnabled });\n })();\n});\n\naddReducer('updateChatDefaultBannedRights', (global, actions, payload) => {\n const { chatId, bannedRights } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('updateChatDefaultBannedRights', { chat, bannedRights });\n});\n\naddReducer('updateChatMemberBannedRights', (global, actions, payload) => {\n const { chatId, userId, bannedRights } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatMemberBannedRights', { chat, user, bannedRights });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { members, kickedMembers } = chatAfterUpdate.fullInfo;\n\n const isBanned = Boolean(bannedRights.viewMessages);\n const isUnblocked = !Object.keys(bannedRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(members && isBanned && {\n members: members.filter((m) => m.userId !== userId),\n }),\n ...(members && !isBanned && {\n members: members.map((m) => (\n m.userId === userId\n ? { ...m, bannedRights }\n : m\n )),\n }),\n ...(isUnblocked && kickedMembers && {\n kickedMembers: kickedMembers.filter((m) => m.userId !== userId),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChatAdmin', (global, actions, payload) => {\n const {\n chatId, userId, adminRights, customTitle,\n } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatAdmin', {\n chat, user, adminRights, customTitle,\n });\n\n const chatAfterUpdate = await callApi('fetchFullChat', chat);\n const newGlobal = getGlobal();\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { adminMembers } = chatAfterUpdate.fullInfo;\n\n const isDismissed = !Object.keys(adminRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(adminMembers && isDismissed && {\n adminMembers: adminMembers.filter((m) => m.userId !== userId),\n }),\n ...(adminMembers && !isDismissed && {\n adminMembers: adminMembers.map((m) => (\n m.userId === userId\n ? { ...m, adminRights, customTitle }\n : m\n )),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChat', (global, actions, payload) => {\n const {\n chatId, title, about, photo,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n await Promise.all([\n chat.title !== title\n ? callApi('updateChatTitle', chat, title)\n : undefined,\n chat.fullInfo && chat.fullInfo.about !== about\n ? callApi('updateChatAbout', chat, about)\n : undefined,\n photo\n ? callApi('editChatPhoto', { chatId, accessHash: chat.accessHash, photo })\n : undefined,\n ]);\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n })();\n});\n\naddReducer('toggleSignatures', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleSignatures', { chat, isEnabled });\n});\n\naddReducer('loadGroupsForDiscussion', () => {\n (async () => {\n const groups = await callApi('fetchGroupsForDiscussion');\n if (!groups) {\n return;\n }\n\n const addedById = groups.reduce((result, group) => {\n if (group) {\n result[group.id] = group;\n }\n\n return result;\n }, {} as Record);\n\n const global = addChats(getGlobal(), addedById);\n setGlobal({\n ...global,\n chats: {\n ...global.chats,\n forDiscussionIds: Object.keys(addedById),\n },\n });\n })();\n});\n\naddReducer('linkDiscussionGroup', (global, actions, payload) => {\n const { channelId, chatId } = payload!;\n\n const channel = selectChat(global, channelId);\n let chat = selectChat(global, chatId);\n if (!channel || !chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n let { fullInfo } = chat;\n if (!fullInfo) {\n const fullChat = await callApi('fetchFullChat', chat);\n if (!fullChat) {\n return;\n }\n\n fullInfo = fullChat.fullInfo;\n }\n\n if (fullInfo!.isPreHistoryHidden) {\n await callApi('togglePreHistoryHidden', { chat, isEnabled: false });\n }\n\n void callApi('setDiscussionGroup', { channel, chat });\n })();\n});\n\naddReducer('unlinkDiscussionGroup', (global, actions, payload) => {\n const { channelId } = payload!;\n\n const channel = selectChat(global, channelId);\n if (!channel) {\n return;\n }\n\n let chat: ApiChat | undefined;\n if (channel.fullInfo?.linkedChatId) {\n chat = selectChat(global, channel.fullInfo.linkedChatId);\n }\n\n (async () => {\n await callApi('setDiscussionGroup', { channel });\n if (chat) {\n loadFullChat(chat);\n }\n })();\n});\n\naddReducer('setActiveChatFolder', (global, actions, payload) => {\n return {\n ...global,\n chatFolders: {\n ...global.chatFolders,\n activeChatFolder: payload,\n },\n };\n});\n\naddReducer('loadMoreMembers', (global) => {\n (async () => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n if (!chat || isChatBasicGroup(chat)) {\n return;\n }\n\n const offset = (chat.fullInfo?.members?.length) || undefined;\n const result = await callApi('fetchMembers', chat.id, chat.accessHash!, 'recent', offset);\n if (!result) {\n return;\n }\n\n const { members, users } = result;\n if (!members || !members.length) {\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateChat(global, chat.id, {\n fullInfo: {\n ...chat.fullInfo,\n members: [\n ...((chat.fullInfo || {}).members || []),\n ...(members || []),\n ],\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('addChatMembers', (global, actions, payload) => {\n const { chatId, memberIds } = payload;\n const chat = selectChat(global, chatId);\n const users = (memberIds as string[]).map((userId) => selectUser(global, userId)).filter(Boolean as any);\n\n if (!chat || !users.length) {\n return;\n }\n\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Loading);\n (async () => {\n await callApi('addChatMembers', chat, users);\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n loadFullChat(chat);\n })();\n});\n\naddReducer('deleteChatMember', (global, actions, payload) => {\n const { chatId, userId } = payload;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n await callApi('deleteChatMember', chat, user);\n loadFullChat(chat);\n })();\n});\n\naddReducer('toggleIsProtected', (global, actions, payload) => {\n const { chatId, isProtected } = payload;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleIsProtected', { chat, isProtected });\n});\n\naddReducer('setChatEnabledReactions', (global, actions, payload) => {\n const { chatId, enabledReactions } = payload;\n const chat = selectChat(global, chatId);\n\n if (!chat) return;\n\n (async () => {\n await callApi('setChatEnabledReactions', {\n chat,\n enabledReactions,\n });\n\n await loadFullChat(chat);\n })();\n});\n\nasync function loadChats(\n listType: 'active' | 'archived', offsetId?: string, offsetDate?: number, shouldReplace = false,\n) {\n let global = getGlobal();\n\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: shouldReplace,\n serverTimeOffset: global.serverTimeOffset,\n lastLocalServiceMessage: selectLastServiceNotification(global)?.message,\n });\n\n if (!result) {\n return;\n }\n\n const { chatIds } = result;\n\n if (chatIds.length > 0 && chatIds[0] === offsetId) {\n chatIds.shift();\n }\n\n global = getGlobal();\n\n if (shouldReplace && listType === 'active') {\n const currentChat = selectCurrentChat(global);\n const visibleChats = currentChat ? [currentChat] : [];\n\n const visibleUsers = selectVisibleUsers(global) || [];\n if (global.currentUserId && global.users.byId[global.currentUserId]) {\n visibleUsers.push(global.users.byId[global.currentUserId]);\n }\n\n global = replaceUsers(global, buildCollectionByKey(visibleUsers.concat(result.users), 'id'));\n global = replaceUserStatuses(global, result.userStatusesById);\n global = replaceChats(global, buildCollectionByKey(visibleChats.concat(result.chats), 'id'));\n global = replaceChatListIds(global, listType, chatIds);\n } else if (shouldReplace && listType === 'archived') {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addUserStatuses(global, result.userStatusesById);\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, listType, chatIds);\n } else {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addUserStatuses(global, result.userStatusesById);\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n }\n\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n if (chatIds.length === 0 && !global.chats.isFullyLoaded[listType]) {\n global = {\n ...global,\n chats: {\n ...global.chats,\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [listType]: true,\n },\n },\n };\n }\n\n setGlobal(global);\n}\n\nexport async function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return undefined;\n }\n\n const { users, fullInfo, groupCall } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (groupCall) {\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(groupCall, ['connectionState']),\n undefined,\n existingGroupCall ? undefined : groupCall.participantsCount,\n );\n }\n\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\n\n return result;\n}\n\nasync function createChannel(title: string, users: ApiUser[], about?: string, photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChannel = await callApi('createChannel', { title, about, users });\n if (!createdChannel) {\n return;\n }\n\n const { id: channelId, accessHash } = createdChannel;\n\n let global = getGlobal();\n global = updateChat(global, channelId, createdChannel);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChannel ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: channelId, shouldReplaceHistory: true });\n\n if (channelId && accessHash && photo) {\n await callApi('editChatPhoto', { chatId: channelId, accessHash, photo });\n }\n}\n\nasync function createGroupChat(title: string, users: ApiUser[], photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n try {\n const createdChat = await callApi('createGroupChat', {\n title,\n users,\n });\n\n if (!createdChat) {\n return;\n }\n\n const { id: chatId } = createdChat;\n\n let global = getGlobal();\n global = updateChat(global, chatId, createdChat);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChat ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch()\n .openChat({\n id: chatId,\n shouldReplaceHistory: true,\n });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', {\n chatId,\n photo,\n });\n }\n } catch (e: any) {\n if (e.message === 'USERS_TOO_FEW') {\n const global = getGlobal();\n setGlobal({\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: ChatCreationProgress.Error,\n error: 'CreateGroupError',\n },\n });\n }\n }\n}\n\nasync function loadChatFolders() {\n const chatFolders = await callApi('fetchChatFolders');\n\n if (chatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n ...chatFolders,\n },\n });\n }\n}\n\nasync function loadRecommendedChatFolders() {\n const recommendedChatFolders = await callApi('fetchRecommendedChatFolders');\n\n if (recommendedChatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommendedChatFolders,\n },\n });\n }\n}\n\nasync function createChatFolder(folder: ApiChatFolder, maxId: number) {\n // Clear fields from recommended folders\n const { id: recommendedId, description, ...newFolder } = folder;\n\n await callApi('editChatFolder', {\n id: maxId + 1,\n folderUpdate: {\n id: maxId + 1,\n ...newFolder,\n },\n });\n\n if (!description) {\n return;\n }\n\n const global = getGlobal();\n const { recommended } = global.chatFolders;\n\n if (recommended) {\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommended.filter(({ id }) => id !== recommendedId),\n },\n });\n }\n}\n\nasync function deleteChatFolder(id: number) {\n await callApi('deleteChatFolder', id);\n}\n\nexport async function fetchChatByUsername(\n username: string,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n return localChat;\n }\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n return undefined;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n return chat;\n}\n\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n startParam?: string,\n) {\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.openPreviousChat();\n actions.showNotification({ message: 'User does not exist' });\n return;\n }\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\n }\n if (startParam) {\n actions.startBot({ botId: chat.id, param: startParam });\n }\n}\n\nasync function openCommentsByUsername(\n actions: GlobalActions,\n username: string,\n messageId: number,\n commentId: number,\n) {\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) return;\n\n const global = getGlobal();\n\n const threadInfo = selectThreadInfo(global, chat.id, messageId);\n let discussionChatId: string | undefined;\n\n if (!threadInfo) {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId: messageId });\n if (!result) return;\n\n discussionChatId = result.discussionChatId;\n } else {\n discussionChatId = threadInfo.chatId;\n }\n\n if (!discussionChatId) return;\n\n actions.focusMessage({\n chatId: discussionChatId,\n threadId: messageId,\n messageId: Number(commentId),\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport { selectActiveGroupCall, selectChatGroupCall, selectGroupCall } from '../../selectors/calls';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat } from '../../selectors';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { ApiGroupCall } from '../../../api/types';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { addChats, addUsers } from '../../reducers';\nimport { fetchChatByUsername, loadFullChat } from '../api/chats';\nimport safePlay from '../../../util/safePlay';\nimport { ARE_CALLS_SUPPORTED } from '../../../util/environment';\nimport * as langProvider from '../../../util/langProvider';\n\n// Workaround for Safari not playing audio without user interaction\nlet audioElement: HTMLAudioElement | undefined;\nlet audioContext: AudioContext | undefined;\n\nconst joinAudio = new Audio('./voicechat_join.mp3');\nconst connectingAudio = new Audio('./voicechat_connecting.mp3');\nconnectingAudio.loop = true;\nconst leaveAudio = new Audio('./voicechat_leave.mp3');\nconst allowTalkAudio = new Audio('./voicechat_onallowtalk.mp3');\n\nconst sounds: Record = {\n join: joinAudio,\n allowTalk: allowTalkAudio,\n leave: leaveAudio,\n connecting: connectingAudio,\n};\n\nlet initializationPromise: Promise | undefined = Promise.resolve();\n\nconst initializeSoundsForSafari = () => {\n if (!initializationPromise) return Promise.resolve();\n\n initializationPromise = Promise.all(Object.values(sounds).map((l) => {\n l.muted = true;\n l.volume = 0.0001;\n return l.play().then(() => {\n l.pause();\n l.volume = 1;\n l.currentTime = 0;\n l.muted = false;\n });\n })).then(() => {\n initializationPromise = undefined;\n });\n\n return initializationPromise;\n};\n\nasync function fetchGroupCall(groupCall: Partial) {\n const result = await callApi('getGroupCall', {\n call: groupCall,\n });\n\n if (!result) return undefined;\n\n let global = getGlobal();\n\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(result.groupCall, ['connectionState']),\n undefined,\n existingGroupCall?.isLoaded ? undefined : result.groupCall.participantsCount,\n );\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n\n return result.groupCall;\n}\n\nasync function fetchGroupCallParticipants(groupCall: Partial, nextOffset?: string) {\n const result = await callApi('fetchGroupCallParticipants', {\n call: groupCall as ApiGroupCall,\n offset: nextOffset,\n });\n\n if (!result) return;\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n}\n\naddReducer('toggleGroupCallPanel', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: !global.groupCalls.isGroupCallPanelHidden,\n },\n };\n});\n\naddReducer('subscribeToGroupCallUpdates', (global, actions, payload) => {\n const { subscribed, id } = payload!;\n const groupCall = selectGroupCall(global, id);\n\n if (!groupCall) return;\n\n (async () => {\n if (subscribed) {\n await fetchGroupCall(groupCall);\n await fetchGroupCallParticipants(groupCall);\n }\n\n await callApi('toggleGroupCallStartSubscription', {\n subscribed,\n call: groupCall,\n });\n })();\n});\n\naddReducer('createGroupCall', (global, actions, payload) => {\n const { chatId } = payload;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('createGroupCall', {\n peer: chat,\n });\n\n if (!result) return;\n\n global = getGlobal();\n setGlobal(updateGroupCall(global, result.id, {\n ...result,\n chatId,\n }));\n\n actions.joinGroupCall({ id: result.id, accessHash: result.accessHash });\n })();\n});\n\naddReducer('createGroupCallInviteLink', (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n\n if (!groupCall || !groupCall.chatId) {\n return;\n }\n\n const chat = selectChat(global, groupCall.chatId);\n if (!chat) {\n return;\n }\n\n const canInvite = Boolean(chat.username);\n\n (async () => {\n let { inviteLink } = chat.fullInfo!;\n if (canInvite) {\n inviteLink = await callApi('exportGroupCallInvite', {\n call: groupCall,\n canSelfUnmute: false,\n });\n }\n\n if (!inviteLink) {\n return;\n }\n\n copyTextToClipboard(inviteLink);\n actions.showNotification({\n message: 'Link copied to clipboard',\n });\n })();\n});\n\naddReducer('joinVoiceChatByLink', (global, actions, payload) => {\n const { username, inviteHash } = payload!;\n\n (async () => {\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.showNotification({ message: langProvider.getTranslation('NoUsernameFound') });\n return;\n }\n\n const full = await loadFullChat(chat);\n\n if (full?.groupCall) {\n actions.joinGroupCall({ id: full.groupCall.id, accessHash: full.groupCall.accessHash, inviteHash });\n }\n })();\n});\n\naddReducer('joinGroupCall', (global, actions, payload) => {\n if (!ARE_CALLS_SUPPORTED) return;\n\n const {\n chatId, id, accessHash, inviteHash,\n } = payload;\n\n createAudioElement();\n\n (async () => {\n await initializeSoundsForSafari();\n const { groupCalls: { activeGroupCallId } } = global;\n let groupCall = id ? selectGroupCall(global, id) : selectChatGroupCall(global, chatId);\n\n if (groupCall?.id === activeGroupCallId) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (activeGroupCallId) {\n actions.leaveGroupCall({\n rejoin: payload,\n });\n return;\n }\n\n if (groupCall && activeGroupCallId === groupCall.id) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (!groupCall && (!id || !accessHash)) {\n groupCall = await fetchGroupCall({\n id,\n accessHash,\n });\n }\n\n if (!groupCall) return;\n\n global = getGlobal();\n\n global = updateGroupCall(\n global,\n groupCall.id,\n {\n ...groupCall,\n inviteHash,\n },\n undefined,\n groupCall.participantsCount + 1,\n );\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n activeGroupCallId: groupCall.id,\n isGroupCallPanelHidden: false,\n },\n });\n })();\n});\n\naddReducer('playGroupCallSound', (global, actions, payload) => {\n const { sound } = payload!;\n\n if (!sounds[sound]) {\n return;\n }\n\n if (initializationPromise) {\n initializationPromise.then(() => {\n safePlay(sounds[sound]);\n });\n } else {\n if (sound !== 'connecting') {\n sounds.connecting.pause();\n }\n safePlay(sounds[sound]);\n }\n});\n\naddReducer('loadMoreGroupCallParticipants', (global) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n void fetchGroupCallParticipants(groupCall, groupCall.nextOffset);\n});\n\nfunction createAudioContext() {\n return (new (window.AudioContext || (window as any).webkitAudioContext)());\n}\n\nconst silence = (ctx: AudioContext) => {\n const oscillator = ctx.createOscillator();\n const dst = oscillator.connect(ctx.createMediaStreamDestination());\n oscillator.start();\n return new MediaStream([Object.assign((dst as any).stream.getAudioTracks()[0], { enabled: false })]);\n};\n\nfunction createAudioElement() {\n const ctx = createAudioContext();\n audioElement = new Audio();\n audioContext = ctx;\n audioElement.srcObject = silence(ctx);\n safePlay(audioElement);\n}\n\nexport function getGroupCallAudioElement() {\n return audioElement;\n}\n\nexport function getGroupCallAudioContext() {\n return audioContext;\n}\n\nexport function removeGroupCallAudioElement() {\n audioElement?.pause();\n audioContext = undefined;\n audioElement = undefined;\n}\n\naddReducer('openCallFallbackConfirm', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isFallbackConfirmOpen: true,\n },\n };\n});\n\naddReducer('closeCallFallbackConfirm', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isFallbackConfirmOpen: false,\n },\n };\n});\n","import { GroupCallParticipant } from '../../lib/secret-sauce';\nimport { GlobalState } from '../../global/types';\nimport { ApiGroupCall } from '../../api/types';\nimport { selectGroupCall } from '../selectors/calls';\nimport { omit } from '../../util/iteratees';\nimport { updateChat } from './chats';\nimport { selectChat } from '../selectors';\n\nexport function updateGroupCall(\n global: GlobalState,\n groupCallId: string,\n groupCallUpdate: Partial,\n addToParticipantCount?: number,\n resetParticipantCount?: number,\n): GlobalState {\n const unfiltered = Object.values({\n ...global.groupCalls.byId[groupCallId]?.participants,\n ...groupCallUpdate.participants,\n });\n const filtered = unfiltered.filter((l) => !l.isLeft);\n const participants = filtered.reduce((acc: Record, el) => {\n acc[el.id] = el;\n return acc;\n }, {});\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...global.groupCalls.byId,\n [groupCallId]: {\n ...global.groupCalls.byId[groupCallId],\n ...omit(groupCallUpdate, ['participantsCount']),\n ...(addToParticipantCount && {\n participantsCount: global.groupCalls.byId[groupCallId].participantsCount + addToParticipantCount,\n }),\n ...(resetParticipantCount !== undefined && {\n participantsCount: resetParticipantCount,\n }),\n participants,\n },\n },\n },\n };\n}\n\nexport function removeGroupCall(\n global: GlobalState,\n groupCallId: string,\n): GlobalState {\n const groupCall = selectGroupCall(global, groupCallId);\n if (groupCall && groupCall.chatId) {\n const chat = selectChat(global, groupCall.chatId);\n if (chat) {\n global = updateChat(global, groupCall.chatId, {\n fullInfo: {\n ...chat.fullInfo,\n groupCallId: undefined,\n },\n });\n }\n }\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...omit(global.groupCalls.byId, [groupCallId.toString()]),\n },\n },\n };\n}\n\nexport function updateActiveGroupCall(\n global: GlobalState,\n groupCallUpdate: Partial,\n resetParticipantCount?: number,\n): GlobalState {\n if (!global.groupCalls.activeGroupCallId) {\n return global;\n }\n\n return updateGroupCall(global,\n global.groupCalls.activeGroupCallId,\n groupCallUpdate,\n undefined,\n resetParticipantCount);\n}\n\nexport function updateGroupCallParticipant(\n global: GlobalState,\n groupCallId: string,\n userId: string,\n participantUpdate: Partial,\n noUpdateCount = false,\n) {\n const groupCall = selectGroupCall(global, groupCallId);\n if (!groupCall) {\n return global;\n }\n\n return updateGroupCall(global, groupCallId, {\n participants: {\n ...groupCall.participants,\n [userId]: {\n ...groupCall.participants[userId],\n ...participantUpdate,\n },\n },\n }, participantUpdate.isLeft\n ? (noUpdateCount ? 0 : -1)\n : (groupCall.participants[userId] || noUpdateCount ? 0 : 1));\n}\n","import { GlobalState } from '../../global/types';\nimport { selectChat } from './chats';\nimport { getUserFullName, isChatBasicGroup } from '../helpers';\nimport { selectUser } from './users';\n\nexport function selectChatGroupCall(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.fullInfo || !chat.fullInfo.groupCallId) return undefined;\n\n return selectGroupCall(global, chat.fullInfo.groupCallId);\n}\n\nexport function selectGroupCall(global: GlobalState, groupCallId: string) {\n return global.groupCalls.byId[groupCallId];\n}\n\nexport function selectGroupCallParticipant(global: GlobalState, groupCallId: string, participantId: string) {\n return selectGroupCall(global, groupCallId)?.participants[participantId];\n}\n\nexport function selectIsAdminInActiveGroupCall(global: GlobalState): boolean {\n const chatId = selectActiveGroupCall(global)?.chatId;\n\n if (!chatId) return false;\n\n const chat = selectChat(global, chatId);\n if (!chat) return false;\n\n return (isChatBasicGroup(chat) && chat.isCreator) || Boolean(chat.adminRights?.manageCall);\n}\n\nexport function selectActiveGroupCall(global: GlobalState) {\n const { groupCalls: { activeGroupCallId } } = global;\n if (!activeGroupCallId) {\n return undefined;\n }\n\n return selectGroupCall(global, activeGroupCallId);\n}\n\nexport function selectCallFallbackChannelTitle(global: GlobalState) {\n const currentUser = selectUser(global, global.currentUserId!);\n\n return `Calls: ${getUserFullName(currentUser!)}`;\n}\n","import { getDispatch } from '../lib/teact/teactn';\nimport { IS_SAFARI } from './environment';\n\ntype DeepLinkMethod = 'resolve' | 'login' | 'passport' | 'settings' | 'join' | 'addstickers' | 'setlanguage' |\n'addtheme' | 'confirmphone' | 'socks' | 'proxy' | 'privatepost' | 'bg' | 'share' | 'msg' | 'msg_url';\n\nexport const processDeepLink = (url: string) => {\n const {\n protocol, searchParams, pathname, hostname,\n } = new URL(url);\n\n if (protocol !== 'tg:') return;\n\n const {\n openChatByInvite,\n openChatByUsername,\n openStickerSetShortName,\n focusMessage,\n joinVoiceChatByLink,\n } = getDispatch();\n\n // Safari thinks the path in tg://path links is hostname for some reason\n const method = (IS_SAFARI ? hostname : pathname).replace(/^\\/\\//, '') as DeepLinkMethod;\n const params: Record = {};\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n switch (method) {\n case 'resolve': {\n const {\n domain, post, comment, voicechat, livestream, start,\n } = params;\n\n if (domain !== 'telegrampassport') {\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n joinVoiceChatByLink({\n username: domain,\n inviteHash: voicechat || livestream,\n });\n } else {\n openChatByUsername({\n username: domain,\n messageId: Number(post),\n commentId: Number(comment),\n startParam: start,\n });\n }\n }\n break;\n }\n case 'privatepost': {\n const {\n post, channel,\n } = params;\n\n focusMessage({\n chatId: `-${channel}`,\n id: post,\n });\n break;\n }\n case 'bg': {\n // const {\n // slug, color, rotation, mode, intensity, bg_color: bgColor, gradient,\n // } = params;\n break;\n }\n case 'join': {\n const { invite } = params;\n\n openChatByInvite({ hash: invite });\n break;\n }\n case 'addstickers': {\n const { set } = params;\n\n openStickerSetShortName({\n stickerSetShortName: set,\n });\n break;\n }\n case 'share':\n case 'msg': {\n // const { url, text } = params;\n break;\n }\n case 'login': {\n // const { code, token } = params;\n break;\n }\n default:\n // Unsupported deeplink\n\n break;\n }\n};\n"],"names":["memo","withGlobal","global","userId","chat","selectCurrentChat","user","selectUser","contactName","getUserFirstOrLastName","undefined","isOpen","onClose","deleteChatMember","getDispatch","lang","useLang","handleDeleteChatMember","useCallback","chatId","id","onEnter","className","title","renderText","color","isText","onClick","runThrottledForLoadTopChats","throttle","cb","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetId","offsetDate","shouldReplace","getGlobal","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","serverTimeOffset","lastLocalServiceMessage","selectLastServiceNotification","message","chatIds","length","shift","currentChat","visibleChats","visibleUsers","selectVisibleUsers","currentUserId","users","byId","push","replaceUsers","buildCollectionByKey","concat","replaceUserStatuses","userStatusesById","replaceChats","chats","replaceChatListIds","addUsers","addUserStatuses","updateChats","updateChatListIds","updateChatListSecondaryInfo","Object","keys","draftsById","forEach","replaceThreadParam","MAIN_THREAD_ID","replyingToById","isFullyLoaded","setGlobal","loadFullChat","fullInfo","groupCall","existingGroupCall","selectGroupCall","updateGroupCall","omit","participantsCount","updateChat","fetchChatByUsername","username","localChat","selectChatByUsername","isMin","addReducer","actions","preloadedChatIds","Set","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","currentChatId","selectCurrentMessageList","folderAllOrderedIds","getOrderedIds","ALL_FOLDER_ID","nextChatId","find","has","add","loadViewportMessages","threadId","payload","selectChat","hasUnreadMark","toggleChatUnread","lastMessage","threadInfo","requestThreadInfoUpdate","isChatSummaryOnly","requestChatUpdate","type","selectThreadTopMessageId","chatFullInfo","linkedChatId","openChat","messageId","focusMessage","selectSupportChat","shouldReplaceHistory","TMP_CHAT_ID","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","openChatByUsername","TIPS_USERNAME","onReplace","DEBUG","console","error","connectionState","authState","listIds","oldestChat","map","filter","Boolean","selectIsChatPinned","sort","chat1","chat2","date","force","SERVICE_NOTIFICATIONS_USER_ID","lastLocalMessage","isMuted","about","photo","memberIds","chatCreation","progress","ChatCreationProgress","createdChannel","channelId","accessHash","createChannel","leaveChat","createdChat","e","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","idsToRemove","idsToAdd","includedId","emoticon","orderedIds","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","hash","url","match","RE_TG_LINK","processDeepLink","uri","URL","startsWith","part1","part2","part3","pathname","split","l","decodeURI","params","fromEntries","searchParams","substr","openChatByInvite","openStickerSetShortName","stickerSetShortName","chatOrChannelPostId","Number","commentId","comment","hasOwnProperty","joinVoiceChatByLink","inviteHash","voicechat","livestream","showNotification","startParam","start","channelPostId","openPreviousChat","startBot","botId","param","usernameChat","selectThreadInfo","discussionChatId","openCommentsByUsername","isEnabled","isChatBasicGroup","bannedRights","newGlobal","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","isProtected","enabledReactions","audioElement","audioContext","joinAudio","Audio","connectingAudio","loop","leaveAudio","sounds","join","allowTalk","leave","connecting","initializationPromise","resolve","fetchGroupCall","call","isLoaded","fetchGroupCallParticipants","nextOffset","getGroupCallAudioElement","getGroupCallAudioContext","removeGroupCallAudioElement","groupCalls","isGroupCallPanelHidden","subscribed","peer","joinGroupCall","selectActiveGroupCall","canInvite","inviteLink","canSelfUnmute","copyTextToClipboard","langProvider","full","ARE_CALLS_SUPPORTED","ctx","window","AudioContext","webkitAudioContext","srcObject","oscillator","createOscillator","dst","connect","createMediaStreamDestination","MediaStream","assign","stream","getAudioTracks","enabled","silence","safePlay","createAudioElement","values","muted","volume","play","then","currentTime","activeGroupCallId","selectChatGroupCall","leaveGroupCall","rejoin","toggleGroupCallPanel","sound","isFallbackConfirmOpen","groupCallId","groupCallUpdate","addToParticipantCount","resetParticipantCount","participants","isLeft","acc","el","removeGroupCall","toString","updateActiveGroupCall","updateGroupCallParticipant","participantUpdate","noUpdateCount","selectGroupCallParticipant","participantId","selectIsAdminInActiveGroupCall","isCreator","manageCall","selectCallFallbackChannelTitle","currentUser","getUserFullName","protocol","hostname","method","IS_SAFARI","replace","value","key","domain","post","invite","set"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"302.cf81ea852f516bfc252f.js","mappings":"2MAwBA,MAqCA,GAAeA,EAAAA,EAAAA,KAAKC,EAAAA,EAAAA,KAClB,CAACC,EAAD,KAAoC,IAA3B,OAAEC,GAAyB,EAClC,MAAMC,GAAOC,EAAAA,EAAAA,IAAkBH,GACzBI,EAAOH,IAAUI,EAAAA,EAAAA,IAAWL,EAAQC,GAG1C,MAAO,CACLC,KAAAA,EACAI,YAJkBF,GAAOG,EAAAA,EAAAA,IAAuBH,QAAQI,KAJ1CT,EArCiC,IAM/C,IANgD,OACpDU,EADoD,KAEpDP,EAFoD,OAGpDD,EAHoD,YAIpDK,EAJoD,QAKpDI,GACI,EACJ,MAAM,iBAAEC,IAAqBC,EAAAA,EAAAA,MAEvBC,GAAOC,EAAAA,EAAAA,KAEPC,GAAyBC,EAAAA,EAAAA,KAAY,KACzCL,EAAiB,CAAEM,OAAQf,EAAMgB,GAAIjB,OAAAA,IACrCS,MACC,CAACR,EAAMS,EAAkBD,EAAST,IAErC,GAAKC,GAASD,EAId,OACE,mBAAC,IAAD,CACEQ,OAAQA,EACRC,QAASA,EACTS,QAASJ,EACTK,UAAU,SACVC,MAAOR,EAAK,wBAEZ,6BAAIS,EAAAA,EAAAA,GAAWT,EAAK,8BAA+BP,KACnD,mBAAC,IAAD,CAAQiB,MAAM,SAASH,UAAU,wBAAwBI,QAAM,EAACC,QAASV,GACtEF,EAAK,mBAER,mBAAC,IAAD,CAAQO,UAAU,wBAAwBI,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W,qBAAX6J,IACE7J,EAAOW,eAAe,cAAgBX,EAAOW,eAAe,cAC9DC,EAAoB,CAClB9I,SAAU+R,EACVhJ,WAAYC,GAAaC,IAG3BpG,EAAmB,CACjB7C,SAAU+R,EACV3P,UAAWsG,OAAOsJ,GAClBrJ,UAAWD,OAAOE,GAClBO,WAAYC,KAIlB,MAEF,IAAK,cAAe,CAClB,MAAM,KACJ4I,EADI,QACEzG,GACJrD,EAEJ7F,EAAa,CACX/G,OAAS,IAAGiQ,IACZhQ,GAAIyW,IAEN,MAEF,IAAK,KAoBL,IAAK,QACL,IAAK,MAIL,IAAK,QAIL,QAGE,MA1BF,IAAK,OAAQ,CACX,MAAM,OAAEC,GAAW/J,EAEnBI,EAAiB,CAAEnB,KAAM8K,IACzB,MAEF,IAAK,cAAe,CAClB,MAAM,IAAEC,GAAQhK,EAEhBK,EAAwB,CACtBC,oBAAqB0J,IAEvB","sources":["webpack://telegram-t/./src/components/right/DeleteMemberModal.tsx","webpack://telegram-t/./src/modules/actions/api/chats.ts","webpack://telegram-t/./src/modules/actions/ui/calls.ts","webpack://telegram-t/./src/modules/reducers/calls.ts","webpack://telegram-t/./src/modules/selectors/calls.ts","webpack://telegram-t/./src/util/deeplink.ts"],"sourcesContent":["import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\n\nimport { selectCurrentChat, selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n userId?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n}) => {\n const { deleteChatMember } = getDispatch();\n\n const lang = useLang();\n\n const handleDeleteChatMember = useCallback(() => {\n deleteChatMember({ chatId: chat!.id, userId });\n onClose();\n }, [chat, deleteChatMember, onClose, userId]);\n\n if (!chat || !userId) {\n return undefined;\n }\n\n return (\n \n

{renderText(lang('PeerInfo.Confirm.RemovePeer', contactName))}

\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const chat = selectCurrentChat(global);\n const user = userId && selectUser(global, userId);\n const contactName = user ? getUserFirstOrLastName(user) : undefined;\n\n return {\n chat,\n contactName,\n };\n },\n)(DeleteMemberModal));\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n ARCHIVED_FOLDER_ID,\n TOP_CHAT_MESSAGES_PRELOAD_LIMIT,\n CHAT_LIST_LOAD_SLICE,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n RE_TG_LINK,\n SERVICE_NOTIFICATIONS_USER_ID,\n TMP_CHAT_ID, ALL_FOLDER_ID, DEBUG,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats, addUsers, addUserStatuses, replaceThreadParam,\n updateChatListIds, updateChats, updateChat, updateChatListSecondaryInfo,\n updateManagementProgress, leaveChat, replaceUsers, replaceUserStatuses,\n replaceChats, replaceChatListIds,\n} from '../../reducers';\nimport {\n selectChat, selectUser, selectChatListType, selectIsChatPinned,\n selectChatFolder, selectSupportChat, selectChatByUsername, selectThreadTopMessageId,\n selectCurrentMessageList, selectThreadInfo, selectCurrentChat, selectLastServiceNotification,\n selectVisibleUsers,\n} from '../../selectors';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, isChatBasicGroup,\n} from '../../helpers';\nimport { processDeepLink } from '../../../util/deeplink';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { selectGroupCall } from '../../selectors/calls';\nimport { getOrderedIds } from '../../../util/folderManager';\n\nconst TOP_CHAT_MESSAGES_PRELOAD_INTERVAL = 100;\nconst INFINITE_LOOP_MARKER = 100;\n\nconst runThrottledForLoadTopChats = throttle((cb) => cb(), 3000, true);\nconst runDebouncedForLoadFullChat = debounce((cb) => cb(), 500, false, true);\n\naddReducer('preloadTopChatMessages', (global, actions) => {\n (async () => {\n const preloadedChatIds = new Set();\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHAT_MESSAGES_PRELOAD_INTERVAL);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const folderAllOrderedIds = getOrderedIds(ALL_FOLDER_ID);\n const nextChatId = folderAllOrderedIds?.find((id) => id !== currentChatId && !preloadedChatIds.has(id));\n if (!nextChatId) {\n return;\n }\n\n preloadedChatIds.add(nextChatId);\n\n actions.loadViewportMessages({ chatId: nextChatId, threadId: MAIN_THREAD_ID });\n }\n })();\n});\n\naddReducer('openChat', (global, actions, payload) => {\n const { id, threadId } = payload!;\n const { currentUserId } = global;\n const chat = selectChat(global, id);\n\n if (chat?.hasUnreadMark) {\n actions.toggleChatUnread({ id });\n }\n\n // Please telegram send us some updates about linked chat 🙏\n if (chat && chat.lastMessage && chat.lastMessage.threadInfo) {\n actions.requestThreadInfoUpdate({\n chatId: chat.lastMessage.threadInfo.chatId,\n threadId: chat.lastMessage.threadInfo.threadId,\n });\n }\n\n if (!chat) {\n if (id === currentUserId) {\n void callApi('fetchChat', { type: 'self' });\n } else {\n const user = selectUser(global, id);\n if (user) {\n void callApi('fetchChat', { type: 'user', user });\n }\n }\n } else if (isChatSummaryOnly(chat) && !chat.isMin) {\n actions.requestChatUpdate({ chatId: id });\n }\n\n if (threadId !== MAIN_THREAD_ID) {\n const topMessageId = selectThreadTopMessageId(global, id, threadId);\n if (!topMessageId) {\n actions.requestThreadInfoUpdate({ chatId: id, threadId });\n }\n }\n});\n\naddReducer('openLinkedChat', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n (async () => {\n const chatFullInfo = await callApi('fetchFullChat', chat);\n\n if (chatFullInfo?.fullInfo?.linkedChatId) {\n actions.openChat({ id: chatFullInfo.fullInfo.linkedChatId });\n }\n })();\n});\n\naddReducer('focusMessageInComments', (global, actions, payload) => {\n const { chatId, threadId, messageId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId });\n if (!result) {\n return;\n }\n\n actions.focusMessage({ chatId, threadId, messageId });\n })();\n});\n\naddReducer('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n if (chat) {\n actions.openChat({ id: chat.id, shouldReplaceHistory: true });\n return;\n }\n\n actions.openChat({ id: TMP_CHAT_ID, shouldReplaceHistory: true });\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId, shouldReplaceHistory: true });\n }\n })();\n});\n\naddReducer('openTipsChat', (global, actions, payload) => {\n const { langCode } = payload;\n\n const usernamePostfix = langCode === 'pt-br'\n ? 'BR'\n : LOCALIZED_TIPS.includes(langCode) ? (langCode as string).toUpperCase() : '';\n\n actions.openChatByUsername({ username: `${TIPS_USERNAME}${usernamePostfix}` });\n});\n\naddReducer('loadAllChats', (global, actions, payload) => {\n const listType = payload.listType as 'active' | 'archived';\n let { shouldReplace, onReplace } = payload;\n let i = 0;\n\n (async () => {\n while (shouldReplace || !getGlobal().chats.isFullyLoaded[listType]) {\n if (i++ >= INFINITE_LOOP_MARKER) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('`actions/loadAllChats`: Infinite loop detected');\n }\n\n return;\n }\n\n global = getGlobal();\n\n if (global.connectionState !== 'connectionStateReady' || global.authState !== 'authorizationStateReady') {\n return;\n }\n\n const listIds = !shouldReplace && global.chats.listIds[listType];\n const oldestChat = listIds\n ? listIds\n /* eslint-disable @typescript-eslint/no-loop-func */\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(global, chat.id))\n /* eslint-enable @typescript-eslint/no-loop-func */\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n await loadChats(listType, oldestChat?.id, oldestChat?.lastMessage!.date, shouldReplace);\n\n if (shouldReplace) {\n onReplace?.();\n shouldReplace = false;\n }\n }\n })();\n});\n\naddReducer('loadFullChat', (global, actions, payload) => {\n const { chatId, force } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (force) {\n loadFullChat(chat);\n } else {\n runDebouncedForLoadFullChat(() => loadFullChat(chat));\n }\n});\n\naddReducer('loadTopChats', () => {\n runThrottledForLoadTopChats(() => loadChats('active'));\n});\n\naddReducer('requestChatUpdate', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void callApi('requestChatUpdate', {\n chat,\n serverTimeOffset,\n ...(chatId === SERVICE_NOTIFICATIONS_USER_ID && {\n lastLocalMessage: selectLastServiceNotification(global)?.message,\n }),\n });\n});\n\naddReducer('updateChatMutedState', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId, isMuted } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateChat(global, chatId, { isMuted }));\n void callApi('updateChatMutedState', { chat, isMuted, serverTimeOffset });\n});\n\naddReducer('createChannel', (global, actions, payload) => {\n const {\n title, about, photo, memberIds,\n } = payload!;\n\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createChannel(title, members, about, photo);\n});\n\naddReducer('joinChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n void callApi('joinChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChatUser', (global, actions, payload) => {\n const { chatId, userId }: { chatId: string; userId: string } = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChatUser', { chat, user });\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n const { chatId }: { chatId: string } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChat', { chatId: chat.id });\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('leaveChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('deleteChannel', { channelId, accessHash });\n }\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createGroupChat(title, members, photo);\n});\n\naddReducer('toggleChatPinned', (global, actions, payload) => {\n const { id, folderId } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n if (folderId) {\n const folder = selectChatFolder(global, folderId);\n if (folder) {\n const shouldBePinned = !selectIsChatPinned(global, id, folderId);\n\n const { pinnedChatIds, includedChatIds } = folder;\n const newPinnedIds = shouldBePinned\n ? [id, ...(pinnedChatIds || [])]\n : (pinnedChatIds || []).filter((pinnedId) => pinnedId !== id);\n\n // With both Pin and Unpin we need to re-add a user to the included group\n const newIncludedChatIds = [id, ...includedChatIds];\n\n void callApi('editChatFolder', {\n id: folderId,\n folderUpdate: {\n ...folder,\n pinnedChatIds: newPinnedIds,\n includedChatIds: newIncludedChatIds,\n },\n });\n }\n } else {\n const listType = selectChatListType(global, id);\n const isPinned = selectIsChatPinned(global, id, listType === 'archived' ? ARCHIVED_FOLDER_ID : undefined);\n void callApi('toggleChatPinned', { chat, shouldBePinned: !isPinned });\n }\n});\n\naddReducer('toggleChatArchived', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (chat) {\n void callApi('toggleChatArchived', {\n chat,\n folderId: isChatArchived(chat) ? 0 : ARCHIVED_FOLDER_ID,\n });\n }\n});\n\naddReducer('loadChatFolders', () => {\n void loadChatFolders();\n});\n\naddReducer('loadRecommendedChatFolders', () => {\n void loadRecommendedChatFolders();\n});\n\naddReducer('editChatFolders', (global, actions, payload) => {\n const { chatId, idsToRemove, idsToAdd } = payload!;\n\n (idsToRemove as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n pinnedChatIds: folder.pinnedChatIds?.filter((pinnedId) => pinnedId !== chatId),\n includedChatIds: folder.includedChatIds.filter((includedId) => includedId !== chatId),\n },\n });\n }\n });\n\n (idsToAdd as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n includedChatIds: folder.includedChatIds.concat(chatId),\n },\n });\n }\n });\n});\n\naddReducer('editChatFolder', (global, actions, payload) => {\n const { id, folderUpdate } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void callApi('editChatFolder', {\n id,\n folderUpdate: {\n id,\n emoticon: folder.emoticon,\n pinnedChatIds: folder.pinnedChatIds,\n ...folderUpdate,\n },\n });\n }\n});\n\naddReducer('addChatFolder', (global, actions, payload) => {\n const { folder } = payload!;\n const { orderedIds } = global.chatFolders;\n const maxId = orderedIds?.length ? Math.max.apply(Math.max, orderedIds) : ARCHIVED_FOLDER_ID;\n\n void createChatFolder(folder, maxId);\n});\n\naddReducer('deleteChatFolder', (global, actions, payload) => {\n const { id } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void deleteChatFolder(id);\n }\n});\n\naddReducer('toggleChatUnread', (global, actions, payload) => {\n const { id } = payload!;\n const { serverTimeOffset } = global;\n const chat = selectChat(global, id);\n if (chat) {\n if (chat.unreadCount) {\n void callApi('markMessageListRead', { serverTimeOffset, chat, threadId: MAIN_THREAD_ID });\n } else {\n void callApi('toggleDialogUnread', {\n chat,\n hasUnreadMark: !chat.hasUnreadMark,\n });\n }\n }\n});\n\naddReducer('openChatByInvite', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('openChatByInvite', hash);\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.chatId });\n })();\n});\n\naddReducer('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n if (url.match(RE_TG_LINK)) {\n processDeepLink(url.match(RE_TG_LINK)[0]);\n return;\n }\n\n const uri = new URL(url.startsWith('http') ? url : `https://${url}`);\n const [part1, part2, part3] = uri.pathname.split('/').filter(Boolean).map((l) => decodeURI(l));\n const params = Object.fromEntries(uri.searchParams);\n\n let hash: string | undefined;\n if (part1 === 'joinchat') {\n hash = part2;\n }\n\n if (part1.startsWith(' ') || part1.startsWith('+')) {\n hash = part1.substr(1, part1.length - 1);\n }\n\n if (hash) {\n actions.openChatByInvite({ hash });\n return;\n }\n\n if (part1 === 'addstickers') {\n actions.openStickerSetShortName({\n stickerSetShortName: part2,\n });\n return;\n }\n\n const chatOrChannelPostId = part2 || undefined;\n const messageId = part3 ? Number(part3) : undefined;\n const commentId = params.comment ? Number(params.comment) : undefined;\n\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n actions.joinVoiceChatByLink({\n username: part1,\n inviteHash: params.voicechat || params.livestream,\n });\n } else if (part1 === 'c' && chatOrChannelPostId && messageId) {\n const chatId = `-${chatOrChannelPostId}`;\n const chat = selectChat(global, chatId);\n if (!chat) {\n actions.showNotification({ message: 'Chat does not exist' });\n return;\n }\n\n actions.focusMessage({\n chatId,\n messageId,\n });\n } else {\n actions.openChatByUsername({\n username: part1,\n messageId: messageId || Number(chatOrChannelPostId),\n commentId,\n startParam: params.start,\n });\n }\n});\n\naddReducer('acceptInviteConfirmation', (global, actions, payload) => {\n const { hash } = payload!;\n (async () => {\n const result = await callApi('importChatInvite', { hash });\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.id });\n })();\n});\n\naddReducer('openChatByUsername', (global, actions, payload) => {\n const {\n username, messageId, commentId, startParam,\n } = payload!;\n\n (async () => {\n const chat = selectCurrentChat(global);\n\n if (!commentId) {\n if (chat && chat.username === username) {\n actions.focusMessage({ chatId: chat.id, messageId });\n return;\n }\n await openChatByUsername(actions, username, messageId, startParam);\n return;\n }\n\n const { chatId, type } = selectCurrentMessageList(global) || {};\n const usernameChat = selectChatByUsername(global, username);\n if (chatId && usernameChat && type === 'thread') {\n const threadInfo = selectThreadInfo(global, chatId, messageId);\n\n if (threadInfo && threadInfo.chatId === chatId) {\n actions.focusMessage({\n chatId: threadInfo.chatId,\n threadId: threadInfo.threadId,\n messageId: commentId,\n });\n return;\n }\n }\n\n if (!messageId) return;\n\n await openCommentsByUsername(actions, username, messageId, commentId);\n })();\n});\n\naddReducer('togglePreHistoryHidden', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n let chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n void callApi('togglePreHistoryHidden', { chat, isEnabled });\n })();\n});\n\naddReducer('updateChatDefaultBannedRights', (global, actions, payload) => {\n const { chatId, bannedRights } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('updateChatDefaultBannedRights', { chat, bannedRights });\n});\n\naddReducer('updateChatMemberBannedRights', (global, actions, payload) => {\n const { chatId, userId, bannedRights } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatMemberBannedRights', { chat, user, bannedRights });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { members, kickedMembers } = chatAfterUpdate.fullInfo;\n\n const isBanned = Boolean(bannedRights.viewMessages);\n const isUnblocked = !Object.keys(bannedRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(members && isBanned && {\n members: members.filter((m) => m.userId !== userId),\n }),\n ...(members && !isBanned && {\n members: members.map((m) => (\n m.userId === userId\n ? { ...m, bannedRights }\n : m\n )),\n }),\n ...(isUnblocked && kickedMembers && {\n kickedMembers: kickedMembers.filter((m) => m.userId !== userId),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChatAdmin', (global, actions, payload) => {\n const {\n chatId, userId, adminRights, customTitle,\n } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatAdmin', {\n chat, user, adminRights, customTitle,\n });\n\n const chatAfterUpdate = await callApi('fetchFullChat', chat);\n const newGlobal = getGlobal();\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { adminMembers } = chatAfterUpdate.fullInfo;\n\n const isDismissed = !Object.keys(adminRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(adminMembers && isDismissed && {\n adminMembers: adminMembers.filter((m) => m.userId !== userId),\n }),\n ...(adminMembers && !isDismissed && {\n adminMembers: adminMembers.map((m) => (\n m.userId === userId\n ? { ...m, adminRights, customTitle }\n : m\n )),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChat', (global, actions, payload) => {\n const {\n chatId, title, about, photo,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n await Promise.all([\n chat.title !== title\n ? callApi('updateChatTitle', chat, title)\n : undefined,\n chat.fullInfo && chat.fullInfo.about !== about\n ? callApi('updateChatAbout', chat, about)\n : undefined,\n photo\n ? callApi('editChatPhoto', { chatId, accessHash: chat.accessHash, photo })\n : undefined,\n ]);\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n })();\n});\n\naddReducer('toggleSignatures', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleSignatures', { chat, isEnabled });\n});\n\naddReducer('loadGroupsForDiscussion', () => {\n (async () => {\n const groups = await callApi('fetchGroupsForDiscussion');\n if (!groups) {\n return;\n }\n\n const addedById = groups.reduce((result, group) => {\n if (group) {\n result[group.id] = group;\n }\n\n return result;\n }, {} as Record);\n\n const global = addChats(getGlobal(), addedById);\n setGlobal({\n ...global,\n chats: {\n ...global.chats,\n forDiscussionIds: Object.keys(addedById),\n },\n });\n })();\n});\n\naddReducer('linkDiscussionGroup', (global, actions, payload) => {\n const { channelId, chatId } = payload!;\n\n const channel = selectChat(global, channelId);\n let chat = selectChat(global, chatId);\n if (!channel || !chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n let { fullInfo } = chat;\n if (!fullInfo) {\n const fullChat = await callApi('fetchFullChat', chat);\n if (!fullChat) {\n return;\n }\n\n fullInfo = fullChat.fullInfo;\n }\n\n if (fullInfo!.isPreHistoryHidden) {\n await callApi('togglePreHistoryHidden', { chat, isEnabled: false });\n }\n\n void callApi('setDiscussionGroup', { channel, chat });\n })();\n});\n\naddReducer('unlinkDiscussionGroup', (global, actions, payload) => {\n const { channelId } = payload!;\n\n const channel = selectChat(global, channelId);\n if (!channel) {\n return;\n }\n\n let chat: ApiChat | undefined;\n if (channel.fullInfo?.linkedChatId) {\n chat = selectChat(global, channel.fullInfo.linkedChatId);\n }\n\n (async () => {\n await callApi('setDiscussionGroup', { channel });\n if (chat) {\n loadFullChat(chat);\n }\n })();\n});\n\naddReducer('setActiveChatFolder', (global, actions, payload) => {\n return {\n ...global,\n chatFolders: {\n ...global.chatFolders,\n activeChatFolder: payload,\n },\n };\n});\n\naddReducer('loadMoreMembers', (global) => {\n (async () => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n if (!chat || isChatBasicGroup(chat)) {\n return;\n }\n\n const offset = (chat.fullInfo?.members?.length) || undefined;\n const result = await callApi('fetchMembers', chat.id, chat.accessHash!, 'recent', offset);\n if (!result) {\n return;\n }\n\n const { members, users } = result;\n if (!members || !members.length) {\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateChat(global, chat.id, {\n fullInfo: {\n ...chat.fullInfo,\n members: [\n ...((chat.fullInfo || {}).members || []),\n ...(members || []),\n ],\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('addChatMembers', (global, actions, payload) => {\n const { chatId, memberIds } = payload;\n const chat = selectChat(global, chatId);\n const users = (memberIds as string[]).map((userId) => selectUser(global, userId)).filter(Boolean as any);\n\n if (!chat || !users.length) {\n return;\n }\n\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Loading);\n (async () => {\n await callApi('addChatMembers', chat, users);\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n loadFullChat(chat);\n })();\n});\n\naddReducer('deleteChatMember', (global, actions, payload) => {\n const { chatId, userId } = payload;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n await callApi('deleteChatMember', chat, user);\n loadFullChat(chat);\n })();\n});\n\naddReducer('toggleIsProtected', (global, actions, payload) => {\n const { chatId, isProtected } = payload;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleIsProtected', { chat, isProtected });\n});\n\naddReducer('setChatEnabledReactions', (global, actions, payload) => {\n const { chatId, enabledReactions } = payload;\n const chat = selectChat(global, chatId);\n\n if (!chat) return;\n\n (async () => {\n await callApi('setChatEnabledReactions', {\n chat,\n enabledReactions,\n });\n\n await loadFullChat(chat);\n })();\n});\n\nasync function loadChats(\n listType: 'active' | 'archived', offsetId?: string, offsetDate?: number, shouldReplace = false,\n) {\n let global = getGlobal();\n\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: shouldReplace,\n serverTimeOffset: global.serverTimeOffset,\n lastLocalServiceMessage: selectLastServiceNotification(global)?.message,\n });\n\n if (!result) {\n return;\n }\n\n const { chatIds } = result;\n\n if (chatIds.length > 0 && chatIds[0] === offsetId) {\n chatIds.shift();\n }\n\n global = getGlobal();\n\n if (shouldReplace && listType === 'active') {\n const currentChat = selectCurrentChat(global);\n const visibleChats = currentChat ? [currentChat] : [];\n\n const visibleUsers = selectVisibleUsers(global) || [];\n if (global.currentUserId && global.users.byId[global.currentUserId]) {\n visibleUsers.push(global.users.byId[global.currentUserId]);\n }\n\n global = replaceUsers(global, buildCollectionByKey(visibleUsers.concat(result.users), 'id'));\n global = replaceUserStatuses(global, result.userStatusesById);\n global = replaceChats(global, buildCollectionByKey(visibleChats.concat(result.chats), 'id'));\n global = replaceChatListIds(global, listType, chatIds);\n } else if (shouldReplace && listType === 'archived') {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addUserStatuses(global, result.userStatusesById);\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, listType, chatIds);\n } else {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addUserStatuses(global, result.userStatusesById);\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n }\n\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n if (chatIds.length === 0 && !global.chats.isFullyLoaded[listType]) {\n global = {\n ...global,\n chats: {\n ...global.chats,\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [listType]: true,\n },\n },\n };\n }\n\n setGlobal(global);\n}\n\nexport async function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return undefined;\n }\n\n const { users, fullInfo, groupCall } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (groupCall) {\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(groupCall, ['connectionState']),\n undefined,\n existingGroupCall ? undefined : groupCall.participantsCount,\n );\n }\n\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\n\n return result;\n}\n\nasync function createChannel(title: string, users: ApiUser[], about?: string, photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChannel = await callApi('createChannel', { title, about, users });\n if (!createdChannel) {\n return;\n }\n\n const { id: channelId, accessHash } = createdChannel;\n\n let global = getGlobal();\n global = updateChat(global, channelId, createdChannel);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChannel ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: channelId, shouldReplaceHistory: true });\n\n if (channelId && accessHash && photo) {\n await callApi('editChatPhoto', { chatId: channelId, accessHash, photo });\n }\n}\n\nasync function createGroupChat(title: string, users: ApiUser[], photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n try {\n const createdChat = await callApi('createGroupChat', {\n title,\n users,\n });\n\n if (!createdChat) {\n return;\n }\n\n const { id: chatId } = createdChat;\n\n let global = getGlobal();\n global = updateChat(global, chatId, createdChat);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChat ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch()\n .openChat({\n id: chatId,\n shouldReplaceHistory: true,\n });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', {\n chatId,\n photo,\n });\n }\n } catch (e: any) {\n if (e.message === 'USERS_TOO_FEW') {\n const global = getGlobal();\n setGlobal({\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: ChatCreationProgress.Error,\n error: 'CreateGroupError',\n },\n });\n }\n }\n}\n\nasync function loadChatFolders() {\n const chatFolders = await callApi('fetchChatFolders');\n\n if (chatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n ...chatFolders,\n },\n });\n }\n}\n\nasync function loadRecommendedChatFolders() {\n const recommendedChatFolders = await callApi('fetchRecommendedChatFolders');\n\n if (recommendedChatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommendedChatFolders,\n },\n });\n }\n}\n\nasync function createChatFolder(folder: ApiChatFolder, maxId: number) {\n // Clear fields from recommended folders\n const { id: recommendedId, description, ...newFolder } = folder;\n\n await callApi('editChatFolder', {\n id: maxId + 1,\n folderUpdate: {\n id: maxId + 1,\n ...newFolder,\n },\n });\n\n if (!description) {\n return;\n }\n\n const global = getGlobal();\n const { recommended } = global.chatFolders;\n\n if (recommended) {\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommended.filter(({ id }) => id !== recommendedId),\n },\n });\n }\n}\n\nasync function deleteChatFolder(id: number) {\n await callApi('deleteChatFolder', id);\n}\n\nexport async function fetchChatByUsername(\n username: string,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n return localChat;\n }\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n return undefined;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n return chat;\n}\n\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n startParam?: string,\n) {\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.openPreviousChat();\n actions.showNotification({ message: 'User does not exist' });\n return;\n }\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\n }\n if (startParam) {\n actions.startBot({ botId: chat.id, param: startParam });\n }\n}\n\nasync function openCommentsByUsername(\n actions: GlobalActions,\n username: string,\n messageId: number,\n commentId: number,\n) {\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) return;\n\n const global = getGlobal();\n\n const threadInfo = selectThreadInfo(global, chat.id, messageId);\n let discussionChatId: string | undefined;\n\n if (!threadInfo) {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId: messageId });\n if (!result) return;\n\n discussionChatId = result.discussionChatId;\n } else {\n discussionChatId = threadInfo.chatId;\n }\n\n if (!discussionChatId) return;\n\n actions.focusMessage({\n chatId: discussionChatId,\n threadId: messageId,\n messageId: Number(commentId),\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport { selectActiveGroupCall, selectChatGroupCall, selectGroupCall } from '../../selectors/calls';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat } from '../../selectors';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { ApiGroupCall } from '../../../api/types';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { addChats, addUsers } from '../../reducers';\nimport { fetchChatByUsername, loadFullChat } from '../api/chats';\nimport safePlay from '../../../util/safePlay';\nimport { ARE_CALLS_SUPPORTED } from '../../../util/environment';\nimport * as langProvider from '../../../util/langProvider';\n\n// Workaround for Safari not playing audio without user interaction\nlet audioElement: HTMLAudioElement | undefined;\nlet audioContext: AudioContext | undefined;\n\nconst joinAudio = new Audio('./voicechat_join.mp3');\nconst connectingAudio = new Audio('./voicechat_connecting.mp3');\nconnectingAudio.loop = true;\nconst leaveAudio = new Audio('./voicechat_leave.mp3');\nconst allowTalkAudio = new Audio('./voicechat_onallowtalk.mp3');\n\nconst sounds: Record = {\n join: joinAudio,\n allowTalk: allowTalkAudio,\n leave: leaveAudio,\n connecting: connectingAudio,\n};\n\nlet initializationPromise: Promise | undefined = Promise.resolve();\n\nconst initializeSoundsForSafari = () => {\n if (!initializationPromise) return Promise.resolve();\n\n initializationPromise = Promise.all(Object.values(sounds).map((l) => {\n l.muted = true;\n l.volume = 0.0001;\n return l.play().then(() => {\n l.pause();\n l.volume = 1;\n l.currentTime = 0;\n l.muted = false;\n });\n })).then(() => {\n initializationPromise = undefined;\n });\n\n return initializationPromise;\n};\n\nasync function fetchGroupCall(groupCall: Partial) {\n const result = await callApi('getGroupCall', {\n call: groupCall,\n });\n\n if (!result) return undefined;\n\n let global = getGlobal();\n\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(result.groupCall, ['connectionState']),\n undefined,\n existingGroupCall?.isLoaded ? undefined : result.groupCall.participantsCount,\n );\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n\n return result.groupCall;\n}\n\nasync function fetchGroupCallParticipants(groupCall: Partial, nextOffset?: string) {\n const result = await callApi('fetchGroupCallParticipants', {\n call: groupCall as ApiGroupCall,\n offset: nextOffset,\n });\n\n if (!result) return;\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n}\n\naddReducer('toggleGroupCallPanel', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: !global.groupCalls.isGroupCallPanelHidden,\n },\n };\n});\n\naddReducer('subscribeToGroupCallUpdates', (global, actions, payload) => {\n const { subscribed, id } = payload!;\n const groupCall = selectGroupCall(global, id);\n\n if (!groupCall) return;\n\n (async () => {\n if (subscribed) {\n await fetchGroupCall(groupCall);\n await fetchGroupCallParticipants(groupCall);\n }\n\n await callApi('toggleGroupCallStartSubscription', {\n subscribed,\n call: groupCall,\n });\n })();\n});\n\naddReducer('createGroupCall', (global, actions, payload) => {\n const { chatId } = payload;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('createGroupCall', {\n peer: chat,\n });\n\n if (!result) return;\n\n global = getGlobal();\n setGlobal(updateGroupCall(global, result.id, {\n ...result,\n chatId,\n }));\n\n actions.joinGroupCall({ id: result.id, accessHash: result.accessHash });\n })();\n});\n\naddReducer('createGroupCallInviteLink', (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n\n if (!groupCall || !groupCall.chatId) {\n return;\n }\n\n const chat = selectChat(global, groupCall.chatId);\n if (!chat) {\n return;\n }\n\n const canInvite = Boolean(chat.username);\n\n (async () => {\n let { inviteLink } = chat.fullInfo!;\n if (canInvite) {\n inviteLink = await callApi('exportGroupCallInvite', {\n call: groupCall,\n canSelfUnmute: false,\n });\n }\n\n if (!inviteLink) {\n return;\n }\n\n copyTextToClipboard(inviteLink);\n actions.showNotification({\n message: 'Link copied to clipboard',\n });\n })();\n});\n\naddReducer('joinVoiceChatByLink', (global, actions, payload) => {\n const { username, inviteHash } = payload!;\n\n (async () => {\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.showNotification({ message: langProvider.getTranslation('NoUsernameFound') });\n return;\n }\n\n const full = await loadFullChat(chat);\n\n if (full?.groupCall) {\n actions.joinGroupCall({ id: full.groupCall.id, accessHash: full.groupCall.accessHash, inviteHash });\n }\n })();\n});\n\naddReducer('joinGroupCall', (global, actions, payload) => {\n if (!ARE_CALLS_SUPPORTED) return;\n\n const {\n chatId, id, accessHash, inviteHash,\n } = payload;\n\n createAudioElement();\n\n (async () => {\n await initializeSoundsForSafari();\n const { groupCalls: { activeGroupCallId } } = global;\n let groupCall = id ? selectGroupCall(global, id) : selectChatGroupCall(global, chatId);\n\n if (groupCall?.id === activeGroupCallId) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (activeGroupCallId) {\n actions.leaveGroupCall({\n rejoin: payload,\n });\n return;\n }\n\n if (groupCall && activeGroupCallId === groupCall.id) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (!groupCall && (!id || !accessHash)) {\n groupCall = await fetchGroupCall({\n id,\n accessHash,\n });\n }\n\n if (!groupCall) return;\n\n global = getGlobal();\n\n global = updateGroupCall(\n global,\n groupCall.id,\n {\n ...groupCall,\n inviteHash,\n },\n undefined,\n groupCall.participantsCount + 1,\n );\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n activeGroupCallId: groupCall.id,\n isGroupCallPanelHidden: false,\n },\n });\n })();\n});\n\naddReducer('playGroupCallSound', (global, actions, payload) => {\n const { sound } = payload!;\n\n if (!sounds[sound]) {\n return;\n }\n\n if (initializationPromise) {\n initializationPromise.then(() => {\n safePlay(sounds[sound]);\n });\n } else {\n if (sound !== 'connecting') {\n sounds.connecting.pause();\n }\n safePlay(sounds[sound]);\n }\n});\n\naddReducer('loadMoreGroupCallParticipants', (global) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n void fetchGroupCallParticipants(groupCall, groupCall.nextOffset);\n});\n\nfunction createAudioContext() {\n return (new (window.AudioContext || (window as any).webkitAudioContext)());\n}\n\nconst silence = (ctx: AudioContext) => {\n const oscillator = ctx.createOscillator();\n const dst = oscillator.connect(ctx.createMediaStreamDestination());\n oscillator.start();\n return new MediaStream([Object.assign((dst as any).stream.getAudioTracks()[0], { enabled: false })]);\n};\n\nfunction createAudioElement() {\n const ctx = createAudioContext();\n audioElement = new Audio();\n audioContext = ctx;\n audioElement.srcObject = silence(ctx);\n safePlay(audioElement);\n}\n\nexport function getGroupCallAudioElement() {\n return audioElement;\n}\n\nexport function getGroupCallAudioContext() {\n return audioContext;\n}\n\nexport function removeGroupCallAudioElement() {\n audioElement?.pause();\n audioContext = undefined;\n audioElement = undefined;\n}\n\naddReducer('openCallFallbackConfirm', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isFallbackConfirmOpen: true,\n },\n };\n});\n\naddReducer('closeCallFallbackConfirm', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isFallbackConfirmOpen: false,\n },\n };\n});\n","import { GroupCallParticipant } from '../../lib/secret-sauce';\nimport { GlobalState } from '../../global/types';\nimport { ApiGroupCall } from '../../api/types';\nimport { selectGroupCall } from '../selectors/calls';\nimport { omit } from '../../util/iteratees';\nimport { updateChat } from './chats';\nimport { selectChat } from '../selectors';\n\nexport function updateGroupCall(\n global: GlobalState,\n groupCallId: string,\n groupCallUpdate: Partial,\n addToParticipantCount?: number,\n resetParticipantCount?: number,\n): GlobalState {\n const unfiltered = Object.values({\n ...global.groupCalls.byId[groupCallId]?.participants,\n ...groupCallUpdate.participants,\n });\n const filtered = unfiltered.filter((l) => !l.isLeft);\n const participants = filtered.reduce((acc: Record, el) => {\n acc[el.id] = el;\n return acc;\n }, {});\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...global.groupCalls.byId,\n [groupCallId]: {\n ...global.groupCalls.byId[groupCallId],\n ...omit(groupCallUpdate, ['participantsCount']),\n ...(addToParticipantCount && {\n participantsCount: global.groupCalls.byId[groupCallId].participantsCount + addToParticipantCount,\n }),\n ...(resetParticipantCount !== undefined && {\n participantsCount: resetParticipantCount,\n }),\n participants,\n },\n },\n },\n };\n}\n\nexport function removeGroupCall(\n global: GlobalState,\n groupCallId: string,\n): GlobalState {\n const groupCall = selectGroupCall(global, groupCallId);\n if (groupCall && groupCall.chatId) {\n const chat = selectChat(global, groupCall.chatId);\n if (chat) {\n global = updateChat(global, groupCall.chatId, {\n fullInfo: {\n ...chat.fullInfo,\n groupCallId: undefined,\n },\n });\n }\n }\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...omit(global.groupCalls.byId, [groupCallId.toString()]),\n },\n },\n };\n}\n\nexport function updateActiveGroupCall(\n global: GlobalState,\n groupCallUpdate: Partial,\n resetParticipantCount?: number,\n): GlobalState {\n if (!global.groupCalls.activeGroupCallId) {\n return global;\n }\n\n return updateGroupCall(global,\n global.groupCalls.activeGroupCallId,\n groupCallUpdate,\n undefined,\n resetParticipantCount);\n}\n\nexport function updateGroupCallParticipant(\n global: GlobalState,\n groupCallId: string,\n userId: string,\n participantUpdate: Partial,\n noUpdateCount = false,\n) {\n const groupCall = selectGroupCall(global, groupCallId);\n if (!groupCall) {\n return global;\n }\n\n return updateGroupCall(global, groupCallId, {\n participants: {\n ...groupCall.participants,\n [userId]: {\n ...groupCall.participants[userId],\n ...participantUpdate,\n },\n },\n }, participantUpdate.isLeft\n ? (noUpdateCount ? 0 : -1)\n : (groupCall.participants[userId] || noUpdateCount ? 0 : 1));\n}\n","import { GlobalState } from '../../global/types';\nimport { selectChat } from './chats';\nimport { getUserFullName, isChatBasicGroup } from '../helpers';\nimport { selectUser } from './users';\n\nexport function selectChatGroupCall(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.fullInfo || !chat.fullInfo.groupCallId) return undefined;\n\n return selectGroupCall(global, chat.fullInfo.groupCallId);\n}\n\nexport function selectGroupCall(global: GlobalState, groupCallId: string) {\n return global.groupCalls.byId[groupCallId];\n}\n\nexport function selectGroupCallParticipant(global: GlobalState, groupCallId: string, participantId: string) {\n return selectGroupCall(global, groupCallId)?.participants[participantId];\n}\n\nexport function selectIsAdminInActiveGroupCall(global: GlobalState): boolean {\n const chatId = selectActiveGroupCall(global)?.chatId;\n\n if (!chatId) return false;\n\n const chat = selectChat(global, chatId);\n if (!chat) return false;\n\n return (isChatBasicGroup(chat) && chat.isCreator) || Boolean(chat.adminRights?.manageCall);\n}\n\nexport function selectActiveGroupCall(global: GlobalState) {\n const { groupCalls: { activeGroupCallId } } = global;\n if (!activeGroupCallId) {\n return undefined;\n }\n\n return selectGroupCall(global, activeGroupCallId);\n}\n\nexport function selectCallFallbackChannelTitle(global: GlobalState) {\n const currentUser = selectUser(global, global.currentUserId!);\n\n return `Calls: ${getUserFullName(currentUser!)}`;\n}\n","import { getDispatch } from '../lib/teact/teactn';\nimport { IS_SAFARI } from './environment';\n\ntype DeepLinkMethod = 'resolve' | 'login' | 'passport' | 'settings' | 'join' | 'addstickers' | 'setlanguage' |\n'addtheme' | 'confirmphone' | 'socks' | 'proxy' | 'privatepost' | 'bg' | 'share' | 'msg' | 'msg_url';\n\nexport const processDeepLink = (url: string) => {\n const {\n protocol, searchParams, pathname, hostname,\n } = new URL(url);\n\n if (protocol !== 'tg:') return;\n\n const {\n openChatByInvite,\n openChatByUsername,\n openStickerSetShortName,\n focusMessage,\n joinVoiceChatByLink,\n } = getDispatch();\n\n // Safari thinks the path in tg://path links is hostname for some reason\n const method = (IS_SAFARI ? hostname : pathname).replace(/^\\/\\//, '') as DeepLinkMethod;\n const params: Record = {};\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n switch (method) {\n case 'resolve': {\n const {\n domain, post, comment, voicechat, livestream, start,\n } = params;\n\n if (domain !== 'telegrampassport') {\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n joinVoiceChatByLink({\n username: domain,\n inviteHash: voicechat || livestream,\n });\n } else {\n openChatByUsername({\n username: domain,\n messageId: Number(post),\n commentId: Number(comment),\n startParam: start,\n });\n }\n }\n break;\n }\n case 'privatepost': {\n const {\n post, channel,\n } = params;\n\n focusMessage({\n chatId: `-${channel}`,\n id: post,\n });\n break;\n }\n case 'bg': {\n // const {\n // slug, color, rotation, mode, intensity, bg_color: bgColor, gradient,\n // } = params;\n break;\n }\n case 'join': {\n const { invite } = params;\n\n openChatByInvite({ hash: invite });\n break;\n }\n case 'addstickers': {\n const { set } = params;\n\n openStickerSetShortName({\n stickerSetShortName: set,\n });\n break;\n }\n case 'share':\n case 'msg': {\n // const { url, text } = params;\n break;\n }\n case 'login': {\n // const { code, token } = params;\n break;\n }\n default:\n // Unsupported deeplink\n\n break;\n }\n};\n"],"names":["memo","withGlobal","global","userId","chat","selectCurrentChat","user","selectUser","contactName","getUserFirstOrLastName","undefined","isOpen","onClose","deleteChatMember","getDispatch","lang","useLang","handleDeleteChatMember","useCallback","chatId","id","onEnter","className","title","renderText","color","isText","onClick","runThrottledForLoadTopChats","throttle","cb","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetId","offsetDate","shouldReplace","getGlobal","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","serverTimeOffset","lastLocalServiceMessage","selectLastServiceNotification","message","chatIds","length","shift","currentChat","visibleChats","visibleUsers","selectVisibleUsers","currentUserId","users","byId","push","replaceUsers","buildCollectionByKey","concat","replaceUserStatuses","userStatusesById","replaceChats","chats","replaceChatListIds","addUsers","addUserStatuses","updateChats","updateChatListIds","updateChatListSecondaryInfo","Object","keys","draftsById","forEach","replaceThreadParam","MAIN_THREAD_ID","replyingToById","isFullyLoaded","setGlobal","loadFullChat","fullInfo","groupCall","existingGroupCall","selectGroupCall","updateGroupCall","omit","participantsCount","updateChat","fetchChatByUsername","username","localChat","selectChatByUsername","isMin","addReducer","actions","preloadedChatIds","Set","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","currentChatId","selectCurrentMessageList","folderAllOrderedIds","getOrderedIds","ALL_FOLDER_ID","nextChatId","find","has","add","loadViewportMessages","threadId","payload","selectChat","hasUnreadMark","toggleChatUnread","lastMessage","threadInfo","requestThreadInfoUpdate","isChatSummaryOnly","requestChatUpdate","type","selectThreadTopMessageId","chatFullInfo","linkedChatId","openChat","messageId","focusMessage","selectSupportChat","shouldReplaceHistory","TMP_CHAT_ID","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","openChatByUsername","TIPS_USERNAME","onReplace","DEBUG","console","error","connectionState","authState","listIds","oldestChat","map","filter","Boolean","selectIsChatPinned","sort","chat1","chat2","date","force","SERVICE_NOTIFICATIONS_USER_ID","lastLocalMessage","isMuted","about","photo","memberIds","chatCreation","progress","ChatCreationProgress","createdChannel","channelId","accessHash","createChannel","leaveChat","createdChat","e","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","idsToRemove","idsToAdd","includedId","emoticon","orderedIds","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","hash","url","match","RE_TG_LINK","processDeepLink","uri","URL","startsWith","part1","part2","part3","pathname","split","l","decodeURI","params","fromEntries","searchParams","substr","openChatByInvite","openStickerSetShortName","stickerSetShortName","chatOrChannelPostId","Number","commentId","comment","hasOwnProperty","joinVoiceChatByLink","inviteHash","voicechat","livestream","showNotification","startParam","start","channelPostId","openPreviousChat","startBot","botId","param","usernameChat","selectThreadInfo","discussionChatId","openCommentsByUsername","isEnabled","isChatBasicGroup","bannedRights","newGlobal","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","isProtected","enabledReactions","audioElement","audioContext","joinAudio","Audio","connectingAudio","loop","leaveAudio","sounds","join","allowTalk","leave","connecting","initializationPromise","resolve","fetchGroupCall","call","isLoaded","fetchGroupCallParticipants","nextOffset","getGroupCallAudioElement","getGroupCallAudioContext","removeGroupCallAudioElement","groupCalls","isGroupCallPanelHidden","subscribed","peer","joinGroupCall","selectActiveGroupCall","canInvite","inviteLink","canSelfUnmute","copyTextToClipboard","langProvider","full","ARE_CALLS_SUPPORTED","ctx","window","AudioContext","webkitAudioContext","srcObject","oscillator","createOscillator","dst","connect","createMediaStreamDestination","MediaStream","assign","stream","getAudioTracks","enabled","silence","safePlay","createAudioElement","values","muted","volume","play","then","currentTime","activeGroupCallId","selectChatGroupCall","leaveGroupCall","rejoin","toggleGroupCallPanel","sound","isFallbackConfirmOpen","groupCallId","groupCallUpdate","addToParticipantCount","resetParticipantCount","participants","isLeft","acc","el","removeGroupCall","toString","updateActiveGroupCall","updateGroupCallParticipant","participantUpdate","noUpdateCount","selectGroupCallParticipant","participantId","selectIsAdminInActiveGroupCall","isCreator","manageCall","selectCallFallbackChannelTitle","currentUser","getUserFullName","protocol","hostname","method","IS_SAFARI","replace","value","key","domain","post","invite","set"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/347.595121c92ffb31ae37da.css b/dist/347.b7e411d2828cadec556d.css similarity index 99% rename from dist/347.595121c92ffb31ae37da.css rename to dist/347.b7e411d2828cadec556d.css index c91f52cd..35604e66 100644 --- a/dist/347.595121c92ffb31ae37da.css +++ b/dist/347.b7e411d2828cadec556d.css @@ -37,4 +37,4 @@ .TextFormatter{transform:translate(-50%, -3.25rem)}.TextFormatter,.TextFormatter-link-control{position:absolute;background:var(--color-background);border-radius:var(--border-radius-messages);padding:.5rem .375rem;box-shadow:0 1px 2px var(--color-default-shadow)}.TextFormatter-link-control{left:0;top:0;opacity:0;pointer-events:none;transition:opacity .3s ease}.Modal .TextFormatter-link-control{max-width:100%}@media(max-width: 600px){.TextFormatter-link-control{max-width:calc(100vw - var(--text-formatter-left) + 3rem)}}.TextFormatter-link-control input{border:none !important;outline:none !important;width:100%;color:var(--color-text);background-color:var(--color-background)}.TextFormatter-buttons,.TextFormatter-link-url-confirm{display:flex;flex-wrap:nowrap;align-items:center}.TextFormatter-divider{width:1px;height:1.75rem;margin:0 .25rem;background-color:var(--color-borders)}.TextFormatter-link-url-input-wrapper{width:20rem;position:relative;max-width:100%}@media(max-width: 600px){.TextFormatter-link-url-input-wrapper{max-width:90vw}}.TextFormatter-link-url-input-wrapper::before,.TextFormatter-link-url-input-wrapper::after{content:"";display:block;position:absolute;top:0;bottom:0;width:1rem;z-index:2;opacity:0;transition:opacity .2s ease}.TextFormatter-link-url-input-wrapper::before{left:0;background:linear-gradient(to right, var(--color-background) 0.25rem, transparent 1rem)}.TextFormatter-link-url-input-wrapper::after{right:0;background:linear-gradient(to left, var(--color-background) 0.25rem, transparent 1rem)}.TextFormatter-link-url-input-wrapper.mask-left::before{opacity:1}.TextFormatter-link-url-input-wrapper.mask-right::after{opacity:1}.TextFormatter-link-url-confirm{flex-shrink:0;opacity:0;transition:opacity .3s ease}.TextFormatter-link-url-confirm.shown{opacity:1}.TextFormatter.link-control-shown .TextFormatter-link-control{opacity:1;pointer-events:all}.TextFormatter .Button{width:2rem;height:2rem;padding:.25rem;font-size:1.5rem;margin:0 .125rem;border-radius:var(--border-radius-messages-small);flex-shrink:0;cursor:pointer}.TextFormatter .Button.active{background-color:var(--color-primary) !important;color:#fff}.TextFormatter .Button.disabled{opacity:.5;pointer-events:none} .Picker{height:100%;display:flex;flex-direction:column;overflow:hidden}.Picker .picker-header{padding:0 1rem .25rem .75rem;border-bottom:1px solid var(--color-borders);display:flex;flex-flow:row wrap;flex-shrink:0;overflow-y:auto;max-height:20rem}.Picker .picker-header .input-group{margin-bottom:.5rem;margin-left:.5rem;flex-grow:1}.Picker .picker-header .form-control{height:2rem;border:none;border-radius:0;padding:0;box-shadow:none}.Picker .picker-list{flex-grow:1;overflow-y:auto;overflow-x:hidden;padding:.5rem}@media(max-width: 600px){.Picker .picker-list{padding-left:0 !important;padding-right:0 !important}}.Picker .no-results{height:100%;margin:0;padding:1rem 1rem;display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary)} -/*# sourceMappingURL=347.595121c92ffb31ae37da.css.map*/ \ No newline at end of file +/*# sourceMappingURL=347.b7e411d2828cadec556d.css.map*/ \ No newline at end of file diff --git a/dist/347.595121c92ffb31ae37da.css.map b/dist/347.b7e411d2828cadec556d.css.map similarity index 99% rename from dist/347.595121c92ffb31ae37da.css.map rename to dist/347.b7e411d2828cadec556d.css.map index e0fa8303..337cfb67 100644 --- a/dist/347.595121c92ffb31ae37da.css.map +++ b/dist/347.b7e411d2828cadec556d.css.map @@ -1 +1 @@ -{"version":3,"file":"347.595121c92ffb31ae37da.css","mappings":"AAAA,YACE,kBAEA,cACE,WACA,YACA,wCACA,gCAEA,oCAEE,kBACA,MACA,OAGF,kEACE,wBAKJ,kCACE,2BAMF,4DAEE,eACA,0FAEE,+BAGF,gFACE,kBACA,yBACA,MACA,OACA,6CACA,mBAKF,sBACE,2BAIA,kCACE,4CAGF,gCACE,2CAMJ,gCACE,4BAIA,4CACE,qDAGF,0CACE,sDAMJ,0BACE,4BAIA,sCACE,4CAGF,oCACE,2CAKF,oCACE,2BAIA,gDACE,qDAGF,8CACE,sDAWN,2BACE,wCAGF,6BACE,4BAIA,yCACE,gCAGF,uCACE,+BAMJ,uCACE,6BAIA,mDACE,yCAGF,iDACE,0CASJ,6BACE,sBACA,wBACA,UAGF,2BACE,sBACA,6BACA,UAIA,uCACE,+FAGF,qCACE,6FAMJ,uCACE,wBACA,UAGF,qCACE,8BACA,UAIA,iDACE,iHAIF,+CACE,mHAUJ,4BACE,wBACA,mBACA,UAGF,0BACE,wBACA,UAMA,sCACE,qCAGF,oCACE,gEAMJ,sCACE,mBAGF,oCACE,sBAIA,gDACE,mFAGF,8CACE,sFASJ,uBACE,UAGF,qBACE,UAIA,iCACE,qCAGF,+BACE,oCASN,yBACE,4CACA,gBAEA,6BACE,mCAGF,6BACE,2BAIA,yCACE,mDAGF,uCACE,2CAMJ,uCACE,2BACA,YAIA,mDACE,qDAGF,iDACE,6DAUJ,2BACE,mCAGF,6BACE,wBACA,mBACA,UAEA,4CACE,uCAEA,qEACE,wCAKN,2BACE,2BAIA,uCACE,mCAGF,qCACE,uCAMJ,qCACE,qBAIA,iDACE,iDAGF,+CACE,6CASJ,uBACE,gEAIA,iCACE,kCAMJ,mCACE,0DAGF,iCACE,sCAIA,6CACE,6CAGF,2CACE,eASR,2BACE,GACE,UAEF,KACE,WAIJ,4BACE,GACE,UAEF,KACE,WAIJ,qCACE,GACE,UAEF,KACE,WAIJ,sCACE,GACE,UAEF,KACE,WAOJ,oBACE,GACE,2BAEF,KACE,yBAIJ,qBACE,GACE,wBAEF,KACE,6BAIJ,8BACE,GACE,wBAEF,KACE,4BAIJ,+BACE,GACE,4BAEF,KACE,yBAOJ,uBACE,GACE,4BAEF,KACE,yBAIJ,wBACE,GACE,wBAEF,KACE,8BAIJ,iCACE,GACE,wBAEF,KACE,6BAIJ,kCACE,GACE,6BAEF,KACE,yBAOJ,8BACE,GACE,6BAEF,KACE,yBAIJ,+BACE,GACE,wBAEF,KACE,+BAIJ,wCACE,GACE,wBAEF,KACE,8BAIJ,yCACE,GACE,8BAEF,KACE,yBAOJ,6BACE,GACE,qBAEF,KACE,oBAIJ,uCACE,GACE,mBAEF,KACE,sBAIJ,wCACE,GACE,sBAEF,KACE,oBAOJ,4BACE,GACE,wBACA,UAEF,KACE,2BACA,iDAIJ,sCACE,GACE,2BACA,gDAEF,KACE,wBACA,WAQJ,oBACE,GACE,mBACA,UAEF,KACE,qBACA,WAIJ,8BACE,GACE,qBACA,UAEF,KACE,mBACA,WAOJ,wBACE,GACE,2BAEF,KACE,yBAIJ,kCACE,GACE,wBAEF,KACE,4BAOJ,qBACE,GACE,gEAEF,KACE,2DAOJ,+BACE,GACE,0DAEF,KACE,iE;AC7qBJ,iBACE,kBACA,UACA,eACA,gBACA,qFAGA,kBACA,eAEA,0BACE,kCACA,oBAGF,wBACE,sBAEA,+BACE,WACA,kBACA,eACA,gBACA,sBACA,sBACA,SACA,QACA,qCAIJ,gDAEE,WACA,YAEA,iFAIA,8DACE,sBACA,aACA,cAIJ,yBACE,cACA,eAEA,6BACE,WACA,YACA,eAGF,gCACE,iBAIJ,6BACE,wCAGF,qBACE,cACA,yBACA,yBACA,yDAGF,wBACE,iCAIJ,oCACE,KACE,uBAEF,GACE,0+B;ACpFJ,QACE,mCACA,UACA,mBACA,uBACA,eACA,gBACA,kBACA,wEACA,WACA,iBACA,aACA,mBACA,0CAEA,wBACE,kBACA,WACA,YAGF,eACE,WACA,YAGF,UACE,iBAEA,4BACE,qBAIJ,mBACE,WACA,YACA,gBAEA,0BACE,eACA,gBAIJ,kBACE,WACA,YACA,kBAEA,yBACE,cACA,eAIJ,mBACE,eACA,gBACA,kBAEA,0BACE,cACA,eAIJ,oBACE,cACA,eACA,oBAEA,2BACE,WACA,YAIJ,mBACE,oBAEA,qBACE,iBAGF,0BACE,gBACA,iBAIJ,mBACE,aACA,cACA,iBAEA,qBACE,eAGF,0BACE,aACA,cAIJ,eACE,kBAEA,sBACE,WACA,cACA,kBACA,gBACA,eACA,cACA,eACA,kBACA,yCACA,yBACA,cAIJ,oBACE,e;AC7HJ,OACE,kBACA,uBAOE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDAEE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,oBACE,oBACA,4BACA,qBACA,uBACA,gBAGF,mBACE,kCACA,mBACA,gBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;AC/KJ,UACE,kBAIE,oGACE,WACA,kBACA,SACA,YACA,QAEA,YACA,iCAGF,oFACE,cAGF,8EACE,OAMF,oDACE,gBACA,uBAIJ,2BACE,WACA,yCACA,uBACA,2BACA,wBACA,aACA,aACA,kBACA,gBACA,mBACA,mBACA,wBACA,2CACA,oCAEA,6BACE,iBACA,kBACA,kCAIJ,oFAIE,mBACA,uBAIA,uCACE,kBACA,WAIJ,mBACE,oBAEA,oCACE,WAKF,0DACE,eAEA,gFACE,4BAGF,qBACE,gIAEE,6CAIJ,yBACE,iEACE,6CAMR,yBAGI,4HACE,yDAKN,yCACE,4CAGF,iBACE,qBAEA,kCACE,mBAIJ,mBACE,oBAGF,gBACE,4CAIA,uCACE,yBAEA,yCACE,cAKN,uBACE,kBAEA,+BACE,WAEA,gDACE,6BACA,8BAMJ,sFAEE,0DAGF,+CACE,iBAGF,sCACE,cACA,mBAGF,oCACE,YACA,gBAGF,6EAEE,gBACA,aACA,2BACA,mBAGF,gKAIE,eACA,sBACA,SACA,gBACA,mBACA,uBACA,mBAIA,wCACE,gBAGF,mDACE,cACA,eACA,mBAGF,4CACE,2BACA,wBACA,cAIJ,6FAEE,kBACA,oBACA,kCAGF,wCACE,aACA,mBACA,YACA,gBAEA,uGAEE,kBACA,oBACA,kCACA,qBAEA,qHACE,2BAGF,oPAEE,mBACA,WAGF,gTAEE,kBAKN,6PAME,mBACA,uBAMA,4UAEE,mBAKF,wDACE,4CAGF,+CACE,kBACA,eAGF,qDACE,WAMJ,uCACE,sBAGF,mCACE,cAGF,6EAEE,eACA,mBACA,gBACA,mBACA,uBACA,gBACA,cAGF,iDACE,iBACA,eAGF,0CACE,kCAEA,mEACE,wBACA,mBACA,qBACA,kBACA,qBAEA,+EACE,mBAMJ,0DACE,cACA,kBAGF,mDACE,eACA,cAKN,2BACE,SAEA,4CACE,eACA,aACA,mBAGF,mCACE,WACA,YAGF,qCACE,cACA,cACA,SACA,kBAIA,8CACE,eACA,mBAKN,0BACE,YACA,oBACA,gBAEA,qEAEE,cACA,mBAGF,iCACE,oBACA,gBACA,uBAGF,oCACE,kBACA,mBACA,kCAEA,8CACE,oBAGF,0CACE,wBAMJ,sCACE,iBACA,e;ACnZN,cACE,qBACA,cACA,aACA,cACA,yDACA,4BACA,qBACA,gC;ACRF,cACE,oBACA,qBAEA,wBACE,aACA,WACA,gBAEA,+BACE,cACA,oDAEA,0FAEE,iCAMR,yBACE,KACE,6BAIJ,6BACE,KACE,4B;AC7BJ,2BACE,qBACA,oCAGE,WACE,kCACA,C;ACPN,wBACE,kBACA,YACA,gBACA,mBACA,8BAEA,0BAPF,wBAQI,8CAGF,sCACE,mBAEA,wDACE,oBAKN,cACE,4FAGA,uBACA,2CACA,4CACA,WACA,eAEA,6GAGE,sBACA,0BAGF,uBACE,iBACA,sBACA,+e;ACxCJ,OACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,gBACE,oBACA,WAGF,qBACE,eAEE,iFAEE,kBAKN,aACE,kBACA,uBACA,UAIA,qDAEE,WACA,cACA,kBACA,eACA,QACA,cACA,eACA,2BAGF,2BACE,4CACA,kBACA,yCACA,UACA,kDAGF,0BACE,cACA,cACA,eACA,kBACA,gCACA,UACA,4BAGF,0BACE,cACA,sBACA,uBACA,gBAGF,6BACE,cACA,kBACA,iBACA,kCACA,uBAKF,yCACE,kCAGF,wCACE,UAKF,qEAEE,qBAGF,wBACE,kBACA,eACA,QACA,2BACA,UACA,oCACA,wBAIJ,gBACE,eACA,qBAEA,4BACE,iBAEA,oCACE,UACA,gBAGF,mCACE,UACA,eAIJ,iDAEE,iBAGF,iCACE,UACA,gBAKN,mBACE,KACE,UAEF,GACE,W;AC3IJ,qBACE,WACA,c;ACFF,KACE,aACA,uBACA,cACA,wCACA,gBACA,WACA,SACA,YACA,uBACA,gBACA,kCACA,eACA,2DACA,4DAEA,4BAGE,aAGF,aACE,eACA,2BAEA,eACE,qBAIJ,qBACE,6BACE,mDAIJ,yBACE,8BACE,mDAIJ,UACE,kBACA,aACA,mBACA,mBAGF,YACE,kBACA,eACA,0BACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,kDAEE,oBAIJ,oBACE,2CAGF,OACE,kBACA,6BACA,OACA,UACA,sCACA,gBACA,WACA,oCACA,oBACA,uBACA,sBAEA,eACE,6CAEA,sCACE,2B;AC3FR,SACE,gBACA,MACA,cACA,aACA,8BACA,qBACA,kBACA,iBACA,+CACA,yCACA,gBACA,kBAEA,qBACA,8BAEA,aACE,eACA,kCAGF,4BACE,SAGF,kCACE,+BAEA,yC;AC5BF,+BACE,gBAGF,+BACE,2BAGF,+CACE,oBAGF,gCACE,sBAGF,wCACE,uB;AClBJ,aACE,kBACA,WACA,iDACA,yCACA,yCACA,uBACA,kCAEA,8BACE,aAEA,2CACE,aAGF,oCACE,mBAIA,6CACE,oBACA,eAKN,uBACE,kCACA,iCACA,yCAGE,+BACE,2BAKN,mBACE,cACA,gBACA,uBACA,uBACA,wCACA,2BACA,wJAGA,gCACE,gCAIJ,eACE,kBACA,UACA,YACA,mBACA,oBAGF,sBACE,kBACA,MACA,QACA,cACA,aAEA,+BACE,uBAIJ,qBACE,kBACA,YACA,cACA,eAGF,yBACE,mBACE,cACA,sBACA,kDAGF,eACE,WAKF,4BACE,cAGF,wBACE,UACA,aAGF,+BACE,WACA,WAGF,8BACE,aACA,W;AC/GN,oBACE,aACA,mBACA,mCACA,YACA,eACA,kBACA,oBACA,mBACA,mBACA,eACA,kBACA,gBACA,cACA,sCAEA,4BAEA,8BACE,gBAGF,0BACE,0CAGF,oCACE,oDAEA,iDACE,UAGF,2FAEE,UAKF,6CACE,gCAGF,sCACE,mCAGF,2CACE,kBAIJ,iCACE,cACA,kBACA,WACA,eAEA,kCAGF,2DAEE,WACA,YACA,UACA,cACA,6BAEA,+DACE,eAIJ,+BACE,aACA,mBACA,uBACA,gBACA,kBACA,sCACA,WAEA,iCACE,kBACA,kBACA,SAIJ,+BACE,kBACA,mBACA,gBACA,uBAEA,kDACE,eACA,gBACA,yBACA,oBAIJ,iCACE,kBACA,OACA,MACA,WACA,YACA,kBACA,aACA,mBACA,uBACA,oCACA,iBACA,WACA,UACA,6BAGF,6BACE,kBACA,gBAEA,uCACE,gBACA,eAGF,0CACE,UACA,gBAGF,wCACE,cACA,mBAGF,0CACE,UACA,Q;AC/IN,UACE,oBACA,mBACA,kBACA,SAEA,mBACE,oBACA,WAGF,mBACE,oBAKA,8JAEE,2BAGF,kGACE,eAIJ,gBACE,SACA,QACA,kBACA,kBACA,uBACA,UAGF,kBACE,eACA,mBACA,eACA,eACA,6BACA,qBACA,oBACA,kBACA,kCAGF,wBACE,WACA,kBACA,cACA,OACA,eACA,gBACA,mCACA,qBACA,wBACA,uCAGF,gCACE,gCAGF,sCACE,2BACA,6CACA,kCAGF,+BACE,c;ACxEJ,uBACE,gBACA,iBACA,gBACA,qBACA,cACA,oBAEA,yBACE,mCAGF,+CACE,qBAGF,mCACE,WACA,Y;AClBJ,iBACE,sBACA,2BACA,cACA,iBACA,cACA,aACA,mBAEA,wCACE,qCACA,qBACA,mBAEA,oDACE,wBAIJ,uBACE,6BACA,qB;ACrBJ,kBACE,UACA,2DAEA,6BACE,mBACA,UAGF,8BACE,aAGF,0BACE,uDAIJ,eACE,aAEA,sBACE,0BAIJ,OACE,iBACA,cACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,qBACE,mBAGF,mBACE,qBACA,mBACA,gBACA,kBAGF,yCAEE,8BACA,yBAGF,2BACE,0BACA,uBACA,aACA,UAEA,6BACE,iBAIJ,eACE,aACA,eAEA,iBACE,eACA,qBAGF,2BACE,eACA,eAEA,6BACE,kB;AChFR,qCACE,0BACA,6BACA,2BACA,0BACA,2BACA,6BACA,2BACA,6BACA,6BAGF,qCACE,uBACA,6BACA,2BACA,6BACA,wBACA,6BACA,2BACA,6BACA,0BAIF,gBACE,kBACA,UACA,SACA,WACA,YACA,kBACA,yBACA,yCACA,gBAEA,2BACE,WACA,YACA,aACA,mBACA,uBACA,kBACA,+BACE,UACA,WACA,mCACA,kBACA,WACA,sBACA,wBAEF,8CACE,sBAEF,+CACE,uBAIJ,yBACE,oCACA,sCACA,wCACE,0CAKF,qDACE,yDAGF,sDACE,yD;AC3EN,MACE,4CAOA,kBACA,MACA,OACA,SACA,WATA,sCAEE,gDASF,sBACE,oBACA,gCAGF,wBACE,sBACA,kCAKA,qFACE,qCAIJ,yBACE,eACE,uDAEA,qCACE,sCAKN,yBACE,oCAEE,wDAEA,gFACE,iDACA,8BAGF,sEACE,wDACA,iCACA,8CACA,sCACA,2CACA,kCACA,mCAGF,4DACE,oCAGF,4EACE,8BACA,gCAKN,yBACE,uBACE,4BAIJ,cACE,kBACA,cAIA,sBACE,qBAGF,eACE,WACA,cAGF,wBACE,kBACA,mBACA,sBACA,cAEA,oCACE,aACA,mBAIJ,6BACE,iBAEA,yCACE,kBACA,eAIJ,qDAEE,qBACA,YACA,kCACA,uBAEA,uEACE,gBAGF,+EACE,wBAGF,mEACE,yBAMA,wCACE,aAIJ,iCACE,yBAGF,8BACE,cACA,eACA,iBACA,sBACA,wBACA,yBAEA,0CACE,eACA,gBACA,0BAGF,oCACE,sBAIJ,uCACE,WACA,YACA,yBAGF,qCACE,kBACA,qBACA,iBACA,WACA,6BACA,wBACA,gBAEA,iDACE,8BACA,SAQJ,sCACE,cACA,kBAGF,2DAEE,qBACA,gBAGF,iCACE,cACA,oBAGF,uEAEE,mBACA,gBACA,iBACA,uB;AClNR,eACE,eACA,qBAEA,mBACE,kBACA,WACA,YAGF,sCACE,qB;ACXJ,aACE,WACA,WACA,aACA,mBACA,uBACA,sBAEA,0BARF,aASI,aAGF,sBACE,YACA,uBAGF,oBACE,kBACA,sBAGF,0BACE,kBACA,kCAEA,8EAEE,wCAIJ,0BACE,mBACA,gBACA,4BACA,uBAEA,4BACE,0BACA,iB;ACxCN,cACE,aACA,mBACA,uBACA,6BAEA,+BACE,sBAGF,+BACE,cAGF,2BACE,kCACA,kBACA,kBACA,gBACA,uB;ACnBJ,OACE,SACA,oBACA,gBACA,kBACA,eAEA,uBACE,kBACA,YACA,WACA,2BACA,WACA,iBACA,mBACA,uBACA,qBAGF,WACE,kBACA,OACA,MACA,WACA,YACA,iB;ACzBJ,SACE,gBACA,2BACA,kBACA,qBACA,kBAEA,kBACE,kBAGF,+BACE,2BACA,WACA,YACA,kBACA,OACA,MACA,yDACA,WACA,aACA,mBACA,uBACA,kDACA,yBACA,gBACA,iBAGF,gBACE,kBACA,OACA,MACA,WACA,YACA,0BACA,gCACA,6DAGF,oEAGE,sBACA,mBAGF,oBACE,cACA,yBACA,gBACA,mBACA,gBACA,uBAGF,qBACE,eACA,gBACA,uBACA,sBAGF,iDAEE,gBACA,kCACA,qBACA,mBACA,oBACA,qBACA,4BACA,gBAGF,sBACE,kBAGF,kCACE,sBACA,uBAGF,kBACE,2BAEA,iEAEE,UACA,QAGF,2BACE,iB;AC9FN,oDACE,aAaA,mBACA,oBAZA,0CACE,sBAGF,eACE,0BACA,qBAFF,eAGI,6BAOJ,iBACE,2DAGF,cAGE,gBACA,yBACA,kDACA,gCACA,aACA,mBACA,uBACA,sBAGF,iBACE,MACA,OACA,kBAGF,yBACE,qBACA,cACA,kBACA,WACA,4BAEA,cACE,gBACA,wBACA,yBAGF,UACE,cACA,kBACA,MACA,QACA,iCACA,2BACA,qFACA,mCACA,mBACA,qCACA,qBAIJ,sBACE,gBACA,qEAEA,yBAEE,kDACA,yBAGF,gBACE,oBAIJ,UACE,iBACA,kBACA,MACA,eACA,gBACA,aACA,mBACA,uBACA,UACA,wBACA,wCAGF,cACE,gEAGE,cACE,2DAGF,SACE,kEAEA,SACE,wDAIJ,SACE,kBAKN,mBACE,qBACA,mBACA,gBACA,YACA,wBAEA,gBACE,kCACA,kBACA,mBACA,mBAIJ,cACE,mBACA,gBACA,gBACA,uBACA,0BAEA,mBACE,sBAIJ,iBACE,qBACA,6BACA,eACA,gBACA,uBACA,wCAGE,aACE,eAKN,2CACE,0CACA,8GAEA,UAIE,YACA,0BAGF,sBACE,iCAEA,0BACE,0BAIJ,oBACE,2BAGF,eACE,8BAGF,gBACE,2KAMF,kBAGE,eACA,qDAGF,gBACE,iEAEA,cACE,mBACA,yDAIJ,SACE,QACA,+CAQJ,mCACE,qDAGF,qCACE,mDAGF,wCACE,C;ACvOJ,OACE,aACA,uBACA,kBAEA,sBACE,kBACA,oBAEA,kCACE,mBAIJ,WACE,4CACA,oDACA,qEACA,qEAEA,uBACE,sCACA,uCAGF,mBACE,yCACA,0CACA,wDACA,2CAEA,+BACE,4BACA,mCAKN,oBACE,wBAEA,sCACE,2BAGF,4BACE,WACA,YACA,yBAEA,8BACE,mBAEA,yCACE,oBAKN,sBACE,kBAEA,gCACE,qBACA,yBAFF,gCAGI,qBAKN,+DAEE,UACA,mBACA,uEAGF,yJAIE,UACA,qBAIJ,wBACE,kBACA,2BACA,4BACA,UACA,eACA,cACA,6CACA,UAEA,0BACE,mBAIJ,+BACE,UACA,SACA,6CAGF,gBACE,kBACA,YACA,YACA,mBAGF,oBACE,aACA,8BAGF,cACE,gBACA,SACA,iBACA,mBACA,gBACA,uBAGF,cACE,YAGF,uBACE,kBACA,kBACA,kCACA,kCACA,aACA,qBAEA,qCACE,WACA,kBACA,0BACA,eACA,gBACA,kBACA,qCAKF,iDACE,uBAIJ,sCACE,2BAGF,iBACE,eACA,gBACA,kBAGF,4CAGE,kBACA,kCACA,SACA,gBACA,mBACA,uBACA,uBAGF,iBACE,kBACA,kCACA,mBACA,gBACA,uBACA,cACA,kCAGF,aACE,aACA,mBACA,mBACA,yBAEA,kBACE,YACA,mBACA,gBACA,uBAGF,wBACE,cAGF,qCACE,0BAGF,qBACE,gBACA,cAIJ,iBACE,YACA,eACA,kBACA,QACA,eACA,kBAEA,yBACE,WACA,kBACA,WACA,QACA,WACA,mDACA,kBAIJ,kEAEE,kBACA,WACA,kBACA,gBACA,WACA,QAEA,sEACE,kBACA,WACA,iDACA,WACA,kBACA,WAIJ,qCACE,8DAGF,uBACE,kBACA,WACA,QACA,OAEA,yBACE,oBACA,kBACA,WACA,WAEA,gCACE,WACA,kBACA,SACA,WACA,WACA,YACA,kBACA,2CAMJ,qBACE,mBACA,gBACA,uBACA,gBACA,mBAGF,oBACE,eAGF,6CAEE,sBAGF,wBACE,iBAGF,6BACE,aACA,cAIA,sCACE,qBACA,QAKN,mCACE,cACA,eAIA,2BACE,sBAGF,6BACE,kBACA,eAEA,qCACE,mBACA,eAIJ,6CACE,4BAGF,mDAEE,iBAGF,iCACE,UACA,WAKN,6BACE,uB;ACnWF,cACE,WACA,YACA,eACA,kBAEA,8BACE,WACA,iBAGF,iCACE,kBACA,OACA,MACA,WAGF,+BACE,WACA,YAGF,mJAKE,aACA,mBACA,uBACA,yBACA,wEACA,eAGF,uBACE,gBAGF,6FAGE,gB;AC3CJ,aACE,iBACA,kBAEA,kCACE,qBACE,WACA,iBACA,WAGF,oBACE,cACA,WACA,YAIJ,4BACE,WACA,kBACA,OACA,MACA,SAEA,wCACE,WACA,YAIJ,2BACE,kBACA,WACA,eACA,kBACA,UAEA,aACA,UACA,OAGF,yBACE,cACA,oCACA,YACA,sBACA,iBAEA,iCACE,YAIJ,yBACE,kBACA,MACA,SACA,UACA,YACA,UACA,SACA,wCACA,iCACA,wBACA,YACA,wBACA,aACA,eACA,UAEA,sEAEE,UAGF,8BACE,OACA,yDACA,gCAGF,8BACE,QACA,yDACA,6CAIJ,mBACE,kBACA,SACA,OACA,WACA,iBACA,uBACA,+EACA,yBACA,aACA,sBACA,yBACA,oBAGE,oCACE,iBACA,uBAKF,oCACE,iBACA,uBAKN,oBACE,aACA,mBAEA,uBACE,gBACA,kBACA,qBACA,qBACA,sBACA,qBAGF,kCACE,mBACA,qBAGF,2BACE,aACA,cACA,uBAIJ,qBACE,kBACA,WAIA,uCACE,UACA,QACA,qBAGF,uCACE,OACA,WACA,qBAIJ,kBACE,wBACA,gBAEA,wBACE,SAGF,qCACE,UAGF,wBACE,sBAGF,0BACE,+C;ACpLN,YACE,2CACA,mCACA,gBACA,cACA,WACA,mBACA,iBACA,kBACA,uBACA,aACA,cACA,iDAEA,0BAdF,YAeI,gBAGF,oCACE,2BACA,mDAGF,wBACE,oBAGF,uBACE,gBAGF,4BACE,oBACA,2CACA,oBACA,cACA,aACA,sBACA,mBACA,uBACA,oCAGF,kBACE,kBACA,sBACA,sBAEA,0BALF,kBAMI,kBACA,mBACA,oBAGF,0BAXF,kBAYI,eACA,iBACA,oBACA,mBAIJ,mBACE,oBACA,gBACA,uBAEA,0BALF,mBAMI,gBAIJ,yBACE,eACA,oBAEA,0BAJF,yBAKI,mB;AC7EN,sBACE,kBACA,WACA,YACA,yEACA,4DAEA,6CACE,2BAGF,+BACE,yE;ACKJ,aACE,qCAEA,mBAEA,sBACE,oBACA,4CAGF,6BACE,aACA,8BACA,sBAEA,oCACE,cACA,iBACA,kCAIA,6CACE,cACA,kBAKN,0BACE,kBACA,UAEA,kCACE,WACA,kBACA,WACA,OACA,aACA,eACA,sCACA,sBACA,WACA,WAIJ,gCACE,kBACA,WACA,OACA,aACA,eACA,qCACA,sBACA,oBCvDF,+BACE,wBACA,cACA,WACA,cACA,oBACA,uBAEA,qCACE,aAGF,0CACE,WACA,eAEA,uBACA,yBACA,kBAGF,qDACE,wBAGF,kDACE,qBAGF,8DACE,eAGF,qGACE,eD+BF,qDA/EF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,oFAEA,2DACE,qBAyEA,iDAnFF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,iFAEA,uDACE,qBA6EA,0CAvFF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,gFAEA,gDACE,qBAkFF,6BACE,aACA,wBACA,sBACA,sBAGF,4BACE,mBACA,kBACA,eACA,kCACA,0BAEA,qEAEE,wBAGF,mCACE,gBAGF,wCACE,gBAGF,uCACE,iB;AE3HN,UACE,kBACA,MACA,QACA,OACA,aACA,2BACA,uBAEA,aACA,sBAEA,kCACE,iD;ACbJ,eACE,qBACA,WACA,YACA,aACA,kDACA,wCACA,wBACA,kEACA,kBAEA,2BACE,eAEA,iCACE,wDAEA,wDACE,UAKN,yBAvBF,eAwBI,eAGF,0BACE,yBACA,eACA,eAGF,qBACE,YACA,aACA,SAGF,wEAGE,kBACA,MACA,OACA,WACA,YAGF,wCAEE,mBAGF,sCACE,kBACA,YACA,cACA,cACA,eACA,gBAMA,UAJA,wCACE,e;AC/DN,eACE,oCAEA,2CAEE,kBACA,mCACA,4CACA,sBACA,iDAGF,4BACE,OACA,MACA,UACA,oBACA,4BAEA,mCACE,eAGF,yBAXF,4BAYI,2DAGF,kCACE,uBACA,wBACA,WACA,wBACA,yCAIJ,uDAEE,aACA,iBACA,mBAGF,uBACE,UACA,eACA,gBACA,sCAGF,sCACE,YACA,kBACA,eAEA,yBALF,sCAMI,gBAGF,2FAEE,WACA,cACA,kBACA,MACA,SACA,WACA,UACA,UACA,4BAGF,8CACE,OACA,wFAGF,6CACE,QACA,uFAIA,wDACE,UAKF,wDACE,UAKN,gCACE,cACA,UACA,4BAEA,sCACE,UAKF,8DACE,UACA,mBAIJ,uBACE,WACA,YACA,eACA,iBACA,iBACA,kDACA,cACA,eAEA,8BACE,iDACA,WAGF,gCACE,WACA,oB;ACjIN,QACE,YACA,aACA,sBACA,gBAEA,uBACE,6BACA,6CACA,aACA,mBACA,cAEA,gBACA,iBAEA,oCACE,oBACA,kBACA,YAGF,qCACE,YACA,YACA,gBACA,UACA,gBAIJ,qBACE,YACA,gBACA,kBACA,cAEA,yBANF,qBAOI,0BACA,4BAIJ,oBACE,YACA,SACA,kBACA,aACA,mBACA,uBACA,kC","sources":["webpack://telegram-t/./src/components/ui/Transition.scss","webpack://telegram-t/./src/components/ui/ProgressSpinner.scss","webpack://telegram-t/./src/components/common/Avatar.scss","webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/ui/ListItem.scss","webpack://telegram-t/./src/components/common/VerifiedIcon.scss","webpack://telegram-t/./src/components/common/DotAnimation.scss","webpack://telegram-t/./src/components/common/TypingStatus.scss","webpack://telegram-t/./src/components/ui/Notification.scss","webpack://telegram-t/./src/components/ui/Radio.scss","webpack://telegram-t/./src/components/common/ReactionStaticEmoji.scss","webpack://telegram-t/./src/components/ui/Tab.scss","webpack://telegram-t/./src/components/ui/TabList.scss","webpack://telegram-t/./src/components/common/DeleteChatModal.scss","webpack://telegram-t/./src/components/ui/SearchInput.scss","webpack://telegram-t/./src/components/common/PickerSelectedItem.scss","webpack://telegram-t/./src/components/ui/Switcher.scss","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.scss","webpack://telegram-t/./src/components/common/LastMessageMeta.scss","webpack://telegram-t/./src/components/left/main/Badge.scss","webpack://telegram-t/./src/components/left/main/ChatCallStatus.scss","webpack://telegram-t/./src/components/left/main/Chat.scss","webpack://telegram-t/./src/components/common/AnimatedEmoji.scss","webpack://telegram-t/./src/components/left/main/EmptyFolder.scss","webpack://telegram-t/./src/components/common/NothingFound.scss","webpack://telegram-t/./src/components/common/Media.scss","webpack://telegram-t/./src/components/common/WebLink.scss","webpack://telegram-t/./src/components/common/File.scss","webpack://telegram-t/./src/components/common/Audio.scss","webpack://telegram-t/./src/components/common/ProfilePhoto.scss","webpack://telegram-t/./src/components/common/ProfileInfo.scss","webpack://telegram-t/./src/components/middle/composer/DropTarget.scss","webpack://telegram-t/./src/components/ui/FloatingActionButton.scss","webpack://telegram-t/./src/components/ui/RangeSlider.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/middle/composer/DropArea.scss","webpack://telegram-t/./src/components/common/StickerButton.scss","webpack://telegram-t/./src/components/middle/composer/TextFormatter.scss","webpack://telegram-t/./src/components/common/Picker.scss"],"sourcesContent":[".Transition {\n position: relative;\n\n > * {\n width: 100%;\n height: 100%;\n animation-fill-mode: forwards !important;\n transition: background-color 0.2s;\n\n &.from,\n &.to {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n &:not(.Transition__slide--active):not(.from):not(.to) {\n display: none !important; // Best performance when animating container\n //transform: scale(0); // Shortest initial delay\n }\n }\n\n &.skip-slide-transition {\n transition: none !important;\n }\n\n /*\n * slide\n */\n &.slide-optimized,\n &.slide-optimized-rtl {\n contain: strict;\n body.is-safari & {\n // Create a new composite layer to reduce the page repaint area when switching a tab (as `contain` is not supported in Safari)\n transform: translate3d(0, 0, 0);\n }\n\n #root & > div {\n position: absolute;\n display: block !important;\n top: 0;\n left: 0;\n transition: transform var(--slide-transition);\n transform: scale(0);\n }\n }\n\n &.slide {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n }\n\n &.slide.backwards {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n\n &.slide-rtl {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n\n &.backwards {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n }\n\n /*\n * mv-slide\n */\n\n &.mv-slide {\n > * > div {\n animation-fill-mode: forwards !important;\n }\n\n > .to > div {\n transform: translateX(100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-out 0.4s ease;\n }\n\n > .to > div {\n animation: mv-slide-in 0.4s ease;\n }\n }\n }\n\n &.mv-slide.backwards {\n > .to > div {\n transform: translateX(-100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-in-backwards 0.4s ease;\n }\n\n > .to > div {\n animation: mv-slide-out-backwards 0.4s ease;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.slide-fade {\n > .from {\n transform-origin: left;\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform-origin: left;\n transform: translateX(1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity var(--slide-transition), slide-fade-out-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-in-opacity var(--slide-transition), slide-fade-in-move var(--slide-transition);\n }\n }\n }\n\n &.slide-fade.backwards {\n > .from {\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform: translateX(-1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity var(--slide-transition),\n slide-fade-in-backwards-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-out-backwards-opacity var(--slide-transition),\n slide-fade-out-backwards-move var(--slide-transition);\n }\n }\n }\n\n /*\n * zoom-fade\n */\n &.zoom-fade {\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n }\n\n > .to {\n transform-origin: center;\n opacity: 0;\n // We can omit `transform: scale(1.1);` here because `opacity` is 0.\n // We need to for proper position calculation in `InfiniteScroll`.\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity 0.15s ease;\n }\n\n > .to {\n animation: fade-in-opacity 0.15s ease, zoom-fade-in-move 0.15s ease;\n }\n }\n }\n\n &.zoom-fade.backwards {\n > .from {\n transform: scale(1);\n }\n\n > .to {\n transform: scale(0.95);\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity 0.1s ease, zoom-fade-in-backwards-move 0.15s ease;\n }\n\n > .to {\n animation: fade-out-backwards-opacity 0.15s ease, zoom-fade-out-backwards-move 0.15s ease;\n }\n }\n }\n\n /*\n * fade\n */\n &.fade {\n > .from {\n opacity: 1;\n }\n\n > .to {\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity 0.15s ease;\n }\n\n > .to {\n animation: fade-in-opacity 0.15s ease;\n }\n }\n }\n\n /*\n * slide-layers\n */\n\n &.slide-layers {\n --background-color: var(--color-background);\n background: black;\n\n > div {\n background: var(--background-color);\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-layers-out var(--layer-transition);\n }\n\n > .to {\n animation: slide-in var(--layer-transition);\n }\n }\n }\n\n &.slide-layers.backwards {\n > .to {\n transform: translateX(-20%);\n opacity: 0.75;\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--layer-transition);\n }\n\n > .to {\n animation: slide-layers-out-backwards var(--layer-transition);\n }\n }\n }\n\n /*\n * push-slide\n */\n\n &.push-slide {\n > div {\n background: var(--color-background);\n }\n\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n\n .custom-scroll {\n scrollbar-color: transparent !important;\n\n &::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n }\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: push-out 0.3s ease-in-out;\n }\n\n > .to {\n animation: slide-in-200 0.3s ease-in-out;\n }\n }\n }\n\n &.push-slide.backwards {\n > .to {\n transform: scale(0.7);\n }\n\n &.animating {\n > .from {\n animation: slide-in-200-backwards 0.3s ease-in-out;\n }\n\n > .to {\n animation: push-out-backwards 0.3s ease-in-out;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.reveal {\n > .to {\n clip-path: inset(0 100% 0 0);\n }\n\n &.animating {\n > .to {\n animation: reveal-in 350ms ease-in;\n }\n }\n }\n\n &.reveal.backwards {\n > .from {\n clip-path: inset(0 0 0 0);\n }\n\n > .to {\n clip-path: none;\n }\n\n &.animating {\n > .from {\n animation: reveal-in-backwards 350ms ease-out;\n }\n\n > .to {\n animation: none;\n }\n }\n }\n}\n\n/*\n * common\n */\n@keyframes fade-in-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes fade-out-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-in-backwards-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-out-backwards-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n@keyframes slide-out-backwards {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * mv-slide\n */\n@keyframes mv-slide-in {\n 0% {\n transform: translateX(100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes mv-slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100vw);\n }\n}\n\n@keyframes mv-slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100vw);\n }\n}\n\n@keyframes mv-slide-out-backwards {\n 0% {\n transform: translateX(-100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * slide-fade\n */\n@keyframes slide-fade-in-move {\n 0% {\n transform: translateX(1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-fade-out-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-1.5rem);\n }\n}\n\n@keyframes slide-fade-in-backwards-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(1.5rem);\n }\n}\n\n@keyframes slide-fade-out-backwards-move {\n 0% {\n transform: translateX(-1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * zoom-fade\n */\n@keyframes zoom-fade-in-move {\n 0% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes zoom-fade-in-backwards-move {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(1.1);\n }\n}\n\n@keyframes zoom-fade-out-backwards-move {\n 0% {\n transform: scale(0.95);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n/*\n * slide-layers\n */\n@keyframes slide-layers-out {\n 0% {\n transform: translateX(0);\n opacity: 1;\n }\n 100% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n}\n\n@keyframes slide-layers-out-backwards {\n 0% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n 100% {\n transform: translateX(0);\n opacity: 1;\n }\n}\n\n/*\n * push-slide\n */\n\n@keyframes push-out {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 100% {\n transform: scale(0.7);\n opacity: 0;\n }\n}\n\n@keyframes push-out-backwards {\n 0% {\n transform: scale(0.7);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in-200 {\n 0% {\n transform: translateX(200%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-in-200-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(200%);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in {\n 0% {\n clip-path: inset(0 100% 0 0);\n }\n 100% {\n clip-path: inset(0 0 0 0);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in-backwards {\n 0% {\n clip-path: inset(0 0 0 0);\n }\n 100% {\n clip-path: inset(0 100% 0 0);\n }\n}\n",".ProgressSpinner {\n position: relative;\n z-index: 1;\n width: 3.375rem;\n height: 3.375rem;\n background: rgba(0, 0, 0, 0.25)\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjcxNyA5Ljc1TDE4LjMgMi4xNjdhLjY4NC42ODQgMCAxMC0uOTY3LS45NjdMOS43NSA4Ljc4MyAyLjE2NyAxLjJhLjY4NC42ODQgMCAxMC0uOTY3Ljk2N0w4Ljc4MyA5Ljc1IDEuMiAxNy4zMzNhLjY4NC42ODQgMCAxMC45NjcuOTY3bDcuNTgzLTcuNTgzIDcuNTgzIDcuNTgzYS42ODEuNjgxIDAgMDAuOTY3IDAgLjY4NC42ODQgMCAwMDAtLjk2N0wxMC43MTcgOS43NXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii43NSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==)\n no-repeat 49% 49%;\n border-radius: 50%;\n cursor: pointer;\n\n &.no-cross {\n background: transparent !important;\n pointer-events: none;\n }\n\n &.square {\n background-image: none;\n\n &::after {\n content: \"\";\n position: absolute;\n width: 0.8125rem;\n height: 0.8125rem;\n border-radius: 0.125rem;\n background-color: #fff;\n left: 50%;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n }\n\n &.size-s,\n &.size-m {\n width: auto;\n height: auto;\n /* stylelint-disable-next-line scss/operator-no-unspaced */\n background: transparent\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+)\n no-repeat 49% 49%;\n\n &.square {\n background-image: none;\n width: 0.75rem;\n height: 0.75rem;\n }\n }\n\n &.size-xl {\n width: 3.25rem;\n height: 3.25rem;\n\n svg {\n width: 3rem;\n height: 3rem;\n margin: 0.125rem;\n }\n\n circle {\n stroke-width: 3px;\n }\n }\n\n &.transparent {\n background-color: transparent !important;\n }\n\n svg {\n display: block;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n animation: 4s linear 0s infinite ProgressSpinnerAnimation;\n }\n\n circle {\n transition: stroke-dashoffset 0.5s;\n }\n}\n\n@keyframes ProgressSpinnerAnimation {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",".Avatar {\n --color-user: var(--color-primary);\n flex: none;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n color: white;\n font-weight: bold;\n display: flex;\n white-space: nowrap;\n user-select: none;\n\n img:not(.emoji) {\n border-radius: 50%;\n width: 100%;\n height: 100%;\n }\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n\n i {\n font-size: 2.5rem;\n\n &.icon-reply-filled {\n transform: scale(0.7);\n }\n }\n\n &.size-micro {\n width: 1rem;\n height: 1rem;\n font-size: 0.5rem;\n\n .emoji {\n width: 0.5625rem;\n height: 0.5625rem;\n }\n }\n\n &.size-tiny {\n width: 2rem;\n height: 2rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-small {\n width: 2.125rem;\n height: 2.125rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-medium {\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.1875rem;\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n }\n\n &.size-large {\n font-size: 1.3125rem;\n\n i {\n font-size: 3.5rem;\n }\n\n .emoji {\n width: 1.3125rem;\n height: 1.3125rem;\n }\n }\n\n &.size-jumbo {\n width: 7.5rem;\n height: 7.5rem;\n font-size: 3.5rem;\n\n i {\n font-size: 6rem;\n }\n\n .emoji {\n width: 3.5rem;\n height: 3.5rem;\n }\n }\n\n &.online {\n position: relative;\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n bottom: 0.0625rem;\n right: 0.0625rem;\n width: 0.875rem;\n height: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--color-background);\n background-color: #0ac630;\n flex-shrink: 0;\n }\n }\n\n &.interactive {\n cursor: pointer;\n }\n}\n",".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete,\n &.error,\n &.confirm,\n &.pin,\n &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, 0.25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform 0.2s ease, opacity 0.2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header,\n %modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend %modal-header;\n padding: 0.5rem 1.25rem 0 0.9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n max-height: 90vh;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .modal-about {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .modal-help {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.3;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n",".ListItem {\n position: relative;\n\n body.is-ios &,\n body.is-android & {\n &:not(:last-of-type)::after {\n content: \"\";\n position: absolute;\n bottom: 0;\n left: 4.5rem;\n right: 0;\n /* stylelint-disable-next-line plugin/whole-pixel */\n height: 0.5px;\n background: var(--color-dividers);\n }\n\n &.small-icon::after {\n left: 3.875rem;\n }\n\n &.no-icon::after {\n left: 0;\n }\n }\n\n // Using half-pixel height is efficient on iOS but not supported on Android, so `transform` is used instead\n body.is-android & {\n &:not(:last-of-type)::after {\n height: 0.0625rem;\n transform: scaleY(0.25);\n }\n }\n\n .ListItem-button {\n width: 100%;\n background-color: var(--background-color);\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n border-radius: var(--border-radius-default);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n > i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n }\n\n .user-status,\n .group-status,\n .title,\n .subtitle {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n &.multiline {\n .ListItem-button > i {\n position: relative;\n top: 0.25rem;\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n .ListItem-button {\n opacity: 0.5;\n }\n }\n\n &:not(.disabled):not(.is-static) {\n .ListItem-button {\n cursor: pointer;\n\n body.cursor-ew-resize & {\n cursor: ew-resize !important;\n }\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n --background-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.active {\n --background-color: var(--color-chat-hover);\n }\n }\n }\n }\n\n @media (min-width: 600px) {\n &:not(.has-ripple):not(.is-static),\n body.animation-level-0 & {\n .ListItem-button:active {\n --background-color: var(--color-item-active) !important;\n }\n }\n }\n\n &.has-menu-open .ListItem-button {\n --background-color: var(--color-chat-hover);\n }\n\n &.narrow {\n margin-bottom: 0.75rem;\n\n .ListItem-button {\n padding: 0.5rem 1rem;\n }\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n &.focus {\n --background-color: var(--color-chat-hover);\n }\n\n &.destructive {\n .ListItem-button {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n }\n\n &-context-menu {\n position: absolute;\n\n .bubble {\n width: auto;\n\n .MenuItem button {\n padding-left: 1rem !important;\n padding-right: 2rem !important;\n }\n }\n }\n\n &.chat-item-clickable {\n body.is-ios &,\n body.is-macos & {\n --color-text-secondary: var(--color-text-secondary-apple);\n }\n\n .ListItem-button {\n padding: 0.5625rem;\n }\n\n .Avatar {\n flex-shrink: 0;\n margin-right: 0.5rem;\n }\n\n .info {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title,\n .subtitle {\n overflow: hidden;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n }\n\n h3,\n .last-message,\n .status,\n .typing-status {\n font-size: 1rem;\n line-height: 1.6875rem;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: initial;\n }\n\n .title {\n h3 {\n font-weight: 500;\n }\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n }\n\n .emoji {\n vertical-align: text-bottom;\n background-position: 0 0;\n flex-shrink: 0;\n }\n }\n\n .contact-phone,\n .contact-username {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n }\n\n .ChatInfo {\n display: flex;\n align-items: center;\n flex-grow: 1;\n overflow: hidden;\n\n .status,\n .typing-status {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n display: inline-block;\n\n &.online {\n color: var(--color-primary);\n }\n\n &[dir=\"rtl\"],\n &[dir=\"auto\"] {\n text-align: initial;\n width: 100%;\n }\n\n .group-status:only-child,\n .user-status:only-child {\n display: flow-root;\n }\n }\n }\n\n .contact-phone,\n .contact-username,\n h3,\n .last-message,\n .status,\n .typing-status {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n .last-message,\n .status,\n .typing-status {\n body.is-ios &,\n body.is-macos & {\n font-size: 0.9375rem;\n }\n }\n\n &[dir=\"rtl\"] {\n .ListItem-button {\n padding: 0.5625rem 0.5625rem 0.5625rem 0.6875rem;\n }\n\n .Avatar {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n\n .info > .status {\n width: 100%;\n }\n }\n }\n\n &.search-result-message {\n .title {\n padding-right: 0.125rem;\n }\n\n h3 {\n max-width: 80%;\n }\n\n h3,\n .subtitle {\n font-size: 1rem;\n line-height: 1.5rem;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: left;\n display: block;\n }\n\n .LastMessageMeta {\n margin-left: auto;\n margin-right: 0;\n }\n\n .subtitle {\n color: var(--color-text-secondary);\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #cae3f7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n display: inline-block;\n\n .theme-dark & {\n --color-text: #000;\n }\n }\n }\n\n &[dir=\"rtl\"] {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .subtitle {\n margin-right: 0;\n display: block;\n }\n }\n }\n\n &.picker-list-item {\n margin: 0;\n\n .ListItem-button {\n padding-left: 0;\n display: flex;\n align-items: center;\n }\n\n .Avatar {\n width: 3rem;\n height: 3rem;\n }\n\n .Checkbox {\n flex-shrink: 0;\n height: 1.5rem;\n margin: 0;\n padding-left: 4rem;\n }\n\n &[dir=\"rtl\"] {\n .Checkbox {\n padding-left: 0;\n padding-right: 4rem;\n }\n }\n }\n\n .multiline-item {\n flex-grow: 1;\n white-space: initial;\n overflow: hidden;\n\n .title,\n .subtitle {\n display: block;\n text-align: initial;\n }\n\n .title {\n line-height: 1.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .subtitle {\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: var(--color-text-secondary);\n\n & + .subtitle {\n margin-top: -0.25rem;\n }\n\n &.black {\n color: var(--color-text);\n }\n }\n }\n\n &[dir=\"rtl\"] {\n .ListItem-button > i {\n margin-left: 2rem;\n margin-right: 0;\n }\n }\n}\n",".VerifiedIcon {\n display: inline-block;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n background-image: url('../../assets/icon-verified.svg');\n background-repeat: no-repeat;\n background-size: 100%;\n background-position: center;\n}\n",".DotAnimation {\n display: inline-flex;\n align-items: baseline;\n\n .ellipsis {\n display: flex;\n width: 1rem;\n overflow: hidden;\n\n &::after {\n content: \"...\";\n animation: dot-animation 1s steps(4, start) infinite;\n\n html[lang=\"ar\"] &,\n html[lang=\"fa\"] & {\n animation-name: dot-animation-rtl;\n }\n }\n }\n}\n\n@keyframes dot-animation {\n from {\n transform: translateX(-1rem);\n }\n}\n\n@keyframes dot-animation-rtl {\n from {\n transform: translateX(1rem);\n }\n}\n",".typing-status {\n display: flex;\n align-items: baseline;\n\n .sender-name {\n &::after {\n content: '\\00a0';\n color: var(--color-text-secondary);\n }\n }\n}\n",".Notification-container {\n position: relative;\n width: 24rem;\n max-width: 100vw;\n margin: 0.25rem auto;\n z-index: var(--z-notification);\n\n @media (min-width: 1276px) {\n transition: transform var(--layer-transition);\n }\n\n &:first-of-type {\n margin-top: 4.25rem;\n\n .has-header-tools & {\n margin-top: 7.375rem;\n }\n }\n}\n\n.Notification {\n background: rgba(32, 32, 32, 0.8)\n url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGRkYiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBjeD0iMTIiIGN5PSI2LjUiIHI9IjEuNSIvPjxwYXRoIGQ9Ik0xMiA5LjVjLS41NTIgMC0xIC4zNy0xIC44MjZ2Ny4zNDhjMCAuNDU2LjQ0OC44MjYgMSAuODI2czEtLjM3IDEtLjgyNnYtNy4zNDhjMC0uNDU2LS40NDgtLjgyNi0xLS44MjZ6IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+\")\n no-repeat 0.9375rem 50%;\n background-size: 1.5rem;\n border-radius: var(--border-radius-default);\n padding: 0.9375rem 0.9375rem 0.9375rem 3.375rem;\n color: #fff;\n margin: 0 0.5rem;\n\n .text-entity-link,\n .text-entity-link:hover,\n .text-entity-link:active {\n color: #fff !important;\n text-decoration: underline;\n }\n\n .content {\n line-height: 1.25;\n word-break: break-word;\n font-size: 0.9375rem;\n }\n}\n",".Radio {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.hidden-widget {\n cursor: default;\n .Radio-main {\n &::before,\n &::after {\n visibility: hidden;\n }\n }\n }\n\n > input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Radio-main {\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n width: 1.25rem;\n height: 1.25rem;\n transform: translateY(-50%);\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: 50%;\n background-color: var(--color-background);\n opacity: 1;\n transition: border-color 0.1s ease, opacity 0.1s ease;\n }\n\n &::after {\n left: 1.375rem;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 50%;\n background: var(--color-primary);\n opacity: 0;\n transition: opacity 0.1s ease;\n }\n\n .label {\n display: block;\n word-break: break-word;\n unicode-bidi: plaintext;\n text-align: left;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n }\n }\n\n input:checked ~ .Radio-main {\n &::before {\n border-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &.loading {\n .Radio-main::before,\n .Radio-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0;\n animation: fade-in 0.2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &[dir=\"rtl\"] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n .Radio-main {\n text-align: right;\n\n &::before {\n left: auto;\n right: 1.0625rem;\n }\n\n &::after {\n left: auto;\n right: 1.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n &.loading .Spinner {\n left: auto;\n right: 1.0625rem;\n }\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".ReactionStaticEmoji {\n width: 1rem;\n display: block;\n}\n",".Tab {\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n appearance: none;\n background: none;\n width: auto;\n margin: 0;\n border: none;\n padding: 0.625rem 0.25rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n cursor: pointer;\n border-top-left-radius: var(--border-radius-messages-small);\n border-top-right-radius: var(--border-radius-messages-small);\n\n &,\n &:active,\n &:focus {\n outline: none;\n }\n\n &--active {\n cursor: default;\n color: var(--color-primary);\n\n i {\n opacity: 1 !important;\n }\n }\n\n @media (hover: hover) {\n &:not(&--active):hover {\n background: var(--color-interactive-element-hover);\n }\n }\n\n @media (max-width: 600px) {\n &:not(&--active):active {\n background: var(--color-interactive-element-hover);\n }\n }\n\n > span {\n position: relative;\n display: flex;\n align-items: center;\n white-space: nowrap;\n }\n\n .badge {\n min-width: 1.25rem;\n height: 1.25rem;\n margin-inline-start: 0.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 0.3125rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.3125rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-ios &,\n body.is-macos & {\n line-height: 1.25rem;\n }\n }\n\n &__badge--active {\n background: var(--color-primary) !important;\n }\n\n i {\n position: absolute;\n bottom: calc(-0.625rem - 1px);\n left: 0;\n opacity: 0;\n background-color: var(--color-primary);\n height: 0.1875rem;\n width: 100%;\n border-radius: 0.1875rem 0.1875rem 0 0;\n pointer-events: none;\n box-sizing: content-box;\n transform-origin: left;\n\n &.animate {\n transition: transform var(--slide-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n }\n}\n",".TabList {\n position: sticky;\n top: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n font-size: 0.875rem;\n flex-wrap: nowrap;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background-color: var(--color-background);\n overflow-x: auto;\n overflow-y: hidden;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &.big {\n font-size: 1rem;\n --border-radius-messages-small: 0;\n }\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n // `box-shadow` prevents repaint on macOS when hovering out of scrollable container\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.01);\n }\n}\n",".DeleteChatModal {\n .modal-dialog {\n max-width: 20rem;\n }\n\n .modal-header {\n padding: 1.125rem 1.25rem 0;\n }\n\n .modal-title:not(:only-child) {\n margin: 0 0 0 0.75rem;\n }\n\n .modal-content {\n padding: 0.5rem 1.25rem;\n }\n\n .confirm-dialog-button {\n margin-right: -0.625rem;\n }\n}\n",".SearchInput {\n position: relative;\n width: 100%;\n color: rgba(var(--color-text-secondary-rgb), 0.5);\n background-color: var(--color-chat-hover);\n border: 2px solid var(--color-chat-hover);\n border-radius: 1.375rem;\n transition: border-color 0.15s ease;\n\n &.with-picker-item {\n display: flex;\n\n .icon-search {\n display: none;\n }\n\n input {\n padding-left: 0.5rem;\n }\n\n &[dir=\"rtl\"] {\n input {\n padding-right: 0.5rem;\n padding-left: 0;\n }\n }\n }\n\n &.has-focus {\n border-color: var(--color-primary);\n caret-color: var(--color-primary);\n background-color: var(--color-background);\n\n input {\n & + i {\n color: var(--color-primary);\n }\n }\n }\n\n input {\n height: 2.5rem;\n margin-bottom: 0;\n border: none !important;\n border-radius: 1.375rem;\n background-color: transparent !important;\n box-shadow: none !important;\n padding: calc(0.4375rem - var(--border-width)) calc(2.625rem - var(--border-width))\n calc(0.5rem - var(--border-width)) calc(2.75rem - var(--border-width));\n\n &::placeholder {\n color: var(--color-placeholders);\n }\n }\n\n > i {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n font-size: 1.375rem;\n pointer-events: none;\n }\n\n .Loading {\n position: absolute;\n top: 0;\n right: 0;\n height: 2.5rem;\n width: 2.5rem;\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n }\n\n .Button {\n position: absolute;\n top: 0.125rem;\n right: 0.125rem;\n font-size: 1rem;\n }\n\n @media (max-width: 600px) {\n input {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding-left: calc(2.625rem - var(--border-width));\n }\n\n i {\n top: 0.5rem;\n }\n }\n\n &[dir=\"rtl\"] {\n input {\n direction: rtl;\n }\n\n > i {\n left: auto;\n right: 0.75rem;\n }\n\n .Loading {\n left: 0.5rem;\n right: auto;\n }\n\n .Button {\n left: 0.125rem;\n right: auto;\n }\n }\n}\n",".PickerSelectedItem {\n display: flex;\n align-items: center;\n background: var(--color-chat-hover);\n height: 2rem;\n min-width: 2rem;\n margin-left: 0.5rem;\n margin-bottom: 0.5rem;\n padding-right: 1rem;\n border-radius: 1rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n flex-shrink: 1;\n transition: background-color 0.15s ease;\n\n max-width: calc(50% - 0.5rem);\n\n &.minimized {\n padding-right: 0;\n }\n\n &:hover {\n background-color: var(--color-item-active);\n }\n\n &.closeable:hover {\n background-color: rgba(var(--color-error-rgb), 0.16);\n\n .item-remove {\n opacity: 1;\n }\n\n .Avatar,\n .item-icon {\n opacity: 0;\n }\n }\n\n &.search-date {\n .item-remove {\n background: var(--color-primary);\n }\n\n &:hover {\n background: var(--color-chat-hover);\n }\n\n .item-name {\n font-size: 0.875rem;\n }\n }\n\n .SearchInput & {\n flex: 1 0 auto;\n position: relative;\n top: 0.25rem;\n left: -0.125rem;\n\n color: var(--color-text-secondary);\n }\n\n .Avatar,\n .item-icon {\n width: 2rem;\n height: 2rem;\n opacity: 1;\n flex-shrink: 0;\n transition: opacity 0.15s ease;\n\n i {\n font-size: 2rem;\n }\n }\n\n .item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.375rem;\n border-radius: 50%;\n background-color: var(--color-primary);\n color: white;\n\n i {\n font-size: 1.25rem;\n position: relative;\n top: -1px;\n }\n }\n\n .item-name {\n margin-left: 0.5rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji.emoji-small {\n width: 1.125rem;\n height: 1.125rem;\n background-size: 1.125rem;\n vertical-align: -2px;\n }\n }\n\n .item-remove {\n position: absolute;\n left: 0;\n top: 0;\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--color-error);\n font-size: 1.5rem;\n color: white;\n opacity: 0;\n transition: opacity 0.15s ease;\n }\n\n &[dir=\"rtl\"] {\n padding-left: 1rem;\n padding-right: 0;\n\n &.minimized {\n padding-right: 0;\n padding-left: 0;\n }\n\n .SearchInput & {\n left: auto;\n right: -0.125rem;\n }\n\n .item-name {\n margin-left: 0;\n margin-right: 0.5rem;\n }\n\n .item-remove {\n left: auto;\n right: 0;\n }\n }\n}\n",".Switcher {\n display: inline-flex;\n align-items: center;\n position: relative;\n margin: 0;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n body.animation-level-0 &,\n &.no-animation {\n .widget,\n .widget::after {\n transition: none !important;\n }\n\n .widget:active:after {\n width: 1.125rem;\n }\n }\n\n input {\n height: 0;\n width: 0;\n visibility: hidden;\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .widget {\n cursor: pointer;\n text-indent: -999px;\n width: 2.125rem;\n height: 0.875rem;\n background: var(--color-gray);\n display: inline-block;\n border-radius: 0.5rem;\n position: relative;\n transition: background 0.2s ease-in;\n }\n\n .widget:after {\n content: \"\";\n position: absolute;\n top: -0.125rem;\n left: 0;\n width: 1.125rem;\n height: 1.125rem;\n background: var(--color-background);\n border-radius: 0.75rem;\n transition: 0.2s ease-out;\n border: 0.125rem solid var(--color-gray);\n }\n\n input:checked + .widget {\n background: var(--color-primary);\n }\n\n input:checked + .widget:after {\n left: calc(100% - 1.125rem);\n transform: translateX(calc(-100% + 1.125rem));\n border-color: var(--color-primary);\n }\n\n .widget:active:after {\n width: 1.25rem;\n }\n}\n",".MessageOutgoingStatus {\n width: 1.1875rem;\n height: 1.1875rem;\n overflow: hidden;\n display: inline-block;\n line-height: 1;\n font-size: 1.1875rem;\n\n i {\n background: var(--background-color);\n }\n\n .icon-message-succeeded {\n padding-left: 0.125rem;\n }\n\n .Transition {\n width: 100%;\n height: 100%;\n }\n}\n",".LastMessageMeta {\n margin-right: 0.1875rem;\n padding: 0.3125rem 0 0.125rem;\n flex-shrink: 0;\n font-size: 0.75rem;\n line-height: 1;\n display: flex;\n align-items: center;\n\n .MessageOutgoingStatus {\n color: var(--color-text-meta-colored);\n margin-right: 0.125rem;\n font-size: 1.125rem;\n\n body.is-ios & {\n margin-bottom: -0.125rem;\n }\n }\n\n .time {\n color: var(--color-text-meta);\n line-height: 1.125rem;\n }\n}\n",".Badge-transition {\n opacity: 1;\n transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n &:not(.open) {\n transform: scale(0);\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.closing {\n transition: transform 0.2s ease-out, opacity 0.2s ease-out;\n }\n}\n\n.Badge-wrapper {\n display: flex;\n\n .Badge {\n margin-inline-start: 0.5rem;\n }\n}\n\n.Badge {\n min-width: 1.5rem;\n height: 1.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 0.4375rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5625rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-macos & {\n line-height: 1.5rem;\n }\n\n body.is-ios & {\n line-height: 1.375rem;\n min-width: 1.375rem;\n height: 1.375rem;\n padding: 0 0.375rem;\n }\n\n &.mention,\n &.unread:not(.muted) {\n background: var(--color-green);\n color: var(--color-white);\n }\n\n &.pinned:not(.unread) {\n color: var(--color-pinned);\n background: transparent;\n width: 1.5rem;\n padding: 0;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.mention {\n width: 1.5rem;\n padding: 0.25rem;\n\n i {\n font-size: 1rem;\n vertical-align: super;\n }\n\n body.is-ios & {\n width: 1.375rem;\n padding: 0.25rem;\n\n i {\n font-size: 0.875rem;\n }\n }\n }\n}\n","\n@keyframes bar-animation-transform-1 {\n 0% { transform: scaleY(0.33); }\n 12.5% { transform: scaleY(1.66); }\n 25% { transform: scaleY(0.33); }\n 37.5% { transform: scaleY(1); }\n 50% { transform: scaleY(0.33); }\n 62.5% { transform: scaleY(1.66); }\n 75% { transform: scaleY(0.33); }\n 87.5% { transform: scaleY(1.66); }\n 100% { transform: scaleY(0.33); }\n}\n\n@keyframes bar-animation-transform-2 {\n 0% { transform: scaleY(1); }\n 12.5% { transform: scaleY(0.33); }\n 25% { transform: scaleY(1.66); }\n 37.5% { transform: scaleY(0.33); }\n 50% { transform: scaleY(1); }\n 62.5% { transform: scaleY(0.33); }\n 75% { transform: scaleY(1.66); }\n 87.5% { transform: scaleY(0.33); }\n 100% { transform: scaleY(1); }\n}\n\n\n.ChatCallStatus {\n position: absolute;\n right: 6px;\n bottom: 0;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background-color: #0ac630;\n border: 2px solid var(--color-background);\n overflow: hidden;\n\n .indicator {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n & > div {\n width: 2px;\n height: 6px;\n background: var(--color-background);\n border-radius: 1px;\n margin: 1px;\n will-change: transform;\n transform: translateZ(0);\n }\n & > div:nth-child(odd) {\n transform: scaleY(0.8);\n }\n & > div:nth-child(even) {\n transform: scaleY(1.33);\n }\n }\n\n &.selected {\n background-color: var(--color-white);\n border-color: var(--color-chat-active);\n .indicator div{\n background-color: var(--color-chat-active);\n }\n }\n\n &.active .indicator {\n div:nth-child(odd) {\n animation: bar-animation-transform-2 3.2s normal infinite;\n }\n\n div:nth-child(even) {\n animation: bar-animation-transform-1 3.2s normal infinite;\n }\n }\n\n}\n",".Chat {\n --background-color: var(--color-background);\n\n body.is-ios &,\n body.is-macos & {\n --color-text-meta: var(--color-text-meta-apple);\n }\n\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n width: 100%;\n\n &.animate-opacity {\n will-change: opacity;\n transition: opacity 0.2s ease-out;\n }\n\n &.animate-transform {\n will-change: transform;\n transition: transform 0.2s ease-out;\n }\n\n &:hover,\n &.ListItem.has-menu-open {\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.selected {\n --background-color: var(--color-chat-hover) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n }\n\n @media (min-width: 600px) {\n &.selected,\n &.selected:hover {\n --background-color: var(--color-chat-active) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-active) !important;\n background: var(--color-white);\n }\n\n .ListItem-button {\n --background-color: var(--color-chat-active) !important;\n --color-text: var(--color-white);\n --color-text-meta-colored: var(--color-white);\n --color-text-meta: var(--color-white);\n --color-text-secondary: var(--color-white);\n --color-error: var(--color-white);\n --color-pinned: var(--color-white);\n }\n\n .icon-muted {\n color: var(--color-white) !important;\n }\n\n .Badge:not(.pinned) {\n background: var(--color-white);\n color: var(--color-chat-active);\n }\n }\n }\n\n @media (max-width: 600px) {\n .ListItem-button {\n border-radius: 0 !important;\n }\n }\n\n .status {\n position: relative;\n flex-shrink: 0;\n }\n\n .info {\n .subtitle {\n margin-top: -0.125rem;\n }\n\n h3 {\n width: auto;\n max-width: 80%;\n }\n\n .icon-muted {\n font-size: 1.25rem;\n margin-left: 0.25rem;\n margin-top: -0.0625rem;\n color: #c6c8ca;\n\n body.is-ios & {\n margin-top: 0;\n margin-right: 0.5rem;\n }\n }\n\n .LastMessageMeta {\n margin-left: auto;\n\n body.is-ios & {\n font-size: 0.875rem;\n margin-right: 0;\n }\n }\n\n .last-message,\n .typing-status {\n padding-right: 0.25rem;\n flex-grow: 1;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n\n &[dir=\"ltr\"] {\n text-align: left;\n }\n\n .sender-name {\n color: var(--color-text);\n }\n\n .draft {\n color: var(--color-error);\n }\n }\n\n .last-message {\n .draft {\n &::after {\n content: \": \";\n }\n }\n\n .colon {\n margin-inline-end: 0.25rem;\n }\n\n img {\n width: 1.25rem;\n height: 1.25rem;\n object-fit: cover;\n border-radius: 0.125rem;\n vertical-align: -0.25rem;\n margin-inline-end: 0.25rem;\n\n body.is-ios & {\n width: 1.125rem;\n height: 1.125rem;\n vertical-align: -0.1875rem;\n }\n\n &.round {\n border-radius: 0.625rem;\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n vertical-align: -0.125rem;\n }\n\n .icon-play {\n position: relative;\n display: inline-block;\n font-size: 0.75rem;\n color: #fff;\n margin-inline-start: -1.25rem;\n margin-inline-end: 0.5rem;\n bottom: 0.0625rem;\n\n body.is-ios & {\n margin-inline-start: -1.125rem;\n bottom: 0;\n }\n }\n }\n }\n\n &[dir=\"rtl\"] {\n .info {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .title,\n .subtitle {\n padding-left: 0.125rem;\n padding-right: 0;\n }\n\n .icon-muted {\n margin-left: 0;\n margin-right: 0.25rem;\n }\n\n .last-message,\n .typing-status {\n padding-left: 0.5rem;\n padding-right: 0;\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n}\n",".AnimatedEmoji {\n cursor: pointer;\n margin-bottom: 0.75rem;\n\n img {\n position: absolute;\n width: 100%;\n height: 100%;\n }\n\n &.like-sticker-thumb img {\n transform: scale(0.8);\n }\n}\n",".EmptyFolder {\n width: 100%;\n height: 80%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n @media (max-height: 480px) {\n height: 100%;\n }\n\n .sticker {\n height: 8rem;\n margin-bottom: 1.875rem;\n }\n\n .title {\n font-size: 1.25rem;\n margin-bottom: 0.125rem;\n }\n\n .description {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n\n body.is-ios &,\n body.is-macos & {\n color: var(--color-text-secondary-apple);\n }\n }\n\n .Button.pill {\n margin-top: 0.625rem;\n font-weight: 500;\n padding-inline-start: 0.75rem;\n unicode-bidi: plaintext;\n\n i {\n margin-inline-end: 0.625rem;\n font-size: 1.5rem;\n }\n }\n}\n",".NothingFound {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-meta);\n\n &.with-description {\n flex-direction: column;\n }\n\n .AnimatedSticker {\n margin: 0 auto;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: 0.875rem;\n text-align: center;\n margin: 1rem 0 0;\n unicode-bidi: plaintext;\n }\n}\n",".Media {\n height: 0;\n padding-bottom: 100%;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n\n .video-duration {\n position: absolute;\n left: 0.25rem;\n top: 0.25rem;\n background: rgba(0, 0, 0, 0.25);\n color: #fff;\n font-size: 0.75rem;\n padding: 0 0.3125rem;\n border-radius: 0.1875rem;\n line-height: 1.125rem;\n }\n\n img {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n",".WebLink {\n min-height: 3rem;\n padding: 0.25rem 0 0 3.75rem;\n font-size: 0.875rem;\n line-height: 1.125rem;\n position: relative;\n\n & + & {\n margin-top: 1.5rem;\n }\n\n &.without-media::before {\n content: attr(data-initial);\n width: 3rem;\n height: 3rem;\n position: absolute;\n left: 0;\n top: 0;\n background-color: var(--color-webpage-initial-background);\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--border-radius-messages-small);\n text-transform: uppercase;\n font-weight: 500;\n font-size: 1.5rem;\n }\n\n .Media {\n position: absolute;\n left: 0;\n top: 0;\n width: 3rem;\n height: 3rem;\n cursor: default !important;\n padding-bottom: unset !important;\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n text-align: initial;\n }\n\n .site-name {\n display: block;\n color: var(--color-links);\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .site-title {\n font-size: 1rem;\n font-weight: 400;\n margin-bottom: 0.0625rem;\n line-height: 1.3125rem;\n }\n\n .sender-name,\n .site-description {\n margin-bottom: 0;\n color: var(--color-text-secondary);\n line-height: 1.125rem;\n max-height: 2.25rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .sender-name {\n margin-top: 0.25rem;\n }\n\n .site-description .emoji {\n width: 1rem !important;\n height: 1rem !important;\n }\n\n &[dir=\"rtl\"] {\n padding: 0.25rem 3.75rem 0 0;\n\n .Media,\n &.without-media::before {\n left: auto;\n right: 0;\n }\n\n .content {\n text-align: right;\n }\n }\n}\n",".File {\n --secondary-color: var(--color-text-secondary);\n\n .Message.own & {\n --secondary-color: var(--color-text-green);\n }\n\n .content-inner & {\n min-width: 14rem;\n @media (max-width: 340px) {\n min-width: 11rem;\n }\n }\n\n display: flex;\n align-items: center;\n\n .file-icon-container {\n position: relative;\n }\n\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3.375rem;\n height: 3.375rem;\n margin-inline-end: 0.75rem;\n border-radius: var(--border-radius-messages-small);\n background: var(--color-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .file-progress {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .file-icon {\n padding: 1rem 0.75rem 0.5rem;\n align-items: flex-end;\n flex-shrink: 0;\n position: relative;\n color: white;\n\n .file-ext {\n font-size: 1rem;\n font-weight: 500;\n transition: opacity 0.15s;\n }\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n border-bottom-left-radius: 0.25rem;\n background: rgba(black, 0.25);\n border-color: transparent var(--background-color) transparent var(--background-color);\n border-width: 0 1.125rem 1.125rem 0;\n border-style: solid;\n transition: border-width 0.15s ease-in;\n }\n }\n\n .file-preview {\n background: transparent;\n overflow: hidden;\n\n & + .action-icon,\n & + .file-progress {\n background: rgba(black, 0.5);\n border-radius: var(--border-radius-messages-small);\n }\n\n img {\n object-fit: cover;\n }\n }\n\n .action-icon {\n color: #fff;\n font-size: 1.5rem;\n position: absolute;\n top: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.25s;\n }\n\n &.interactive .file-icon-container {\n cursor: pointer;\n\n &:hover {\n .file-icon::after {\n border-width: 0;\n }\n\n .action-icon {\n opacity: 1;\n\n &.hidden {\n opacity: 0;\n }\n }\n\n .file-ext {\n opacity: 0;\n }\n }\n }\n\n .file-info {\n margin-top: 0.1875rem;\n margin-right: 0.125rem;\n white-space: nowrap;\n overflow: hidden;\n flex-grow: 1;\n\n & + .Link {\n font-size: 0.75rem;\n color: var(--color-text-secondary);\n padding-left: 1rem;\n white-space: nowrap;\n }\n }\n\n .file-title {\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji {\n vertical-align: -4px;\n }\n }\n\n .file-subtitle {\n font-size: 0.875rem;\n line-height: 0.9375rem;\n color: var(--secondary-color);\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n\n span + span {\n &::before {\n content: \"\\00a0\\2022\\00a0\";\n }\n }\n }\n\n &.smaller {\n --background-color: var(--color-background);\n --border-radius-messages-small: 0.3125rem;\n\n .action-icon,\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3rem;\n height: 3rem;\n }\n\n .file-icon {\n padding-bottom: 0.375rem;\n\n &::after {\n border-width: 0 1rem 1rem 0;\n }\n }\n\n .file-info {\n margin-top: -0.125rem;\n }\n\n .file-title {\n font-weight: 400;\n }\n\n .file-subtitle {\n line-height: 1rem;\n }\n }\n\n &:dir(rtl),\n &[dir=\"rtl\"] {\n .file-progress,\n .file-icon,\n .file-preview {\n margin-left: 0.75rem;\n margin-right: 0;\n }\n\n .file-info {\n text-align: right;\n\n & + .Link {\n padding-left: 0;\n padding-right: 1rem;\n }\n }\n\n .action-icon {\n left: auto;\n right: 0;\n }\n }\n}\n\n// Document extension colors\n.File .file-progress,\n.File .file-icon {\n &.red {\n background-color: var(--color-error);\n }\n\n &.orange {\n background-color: var(--color-warning);\n }\n\n &.green {\n background-color: var(--color-text-green);\n }\n}\n",".Audio {\n display: flex;\n align-items: flex-start;\n position: relative;\n\n .media-loading {\n position: absolute;\n pointer-events: none;\n\n &.interactive {\n pointer-events: all;\n }\n }\n\n &.own {\n --color-text-secondary: var(--accent-color);\n --color-interactive-active: var(--color-text-green);\n --color-interactive-inactive: rgba(var(--color-text-green-rgb), 0.4);\n --color-interactive-buffered: rgba(var(--color-text-green-rgb), 0.4); // Overlays underlying inactive color\n\n .theme-dark & {\n --color-text-green-rgb: 255, 255, 255;\n --color-text-green: var(--color-white);\n }\n\n .Button {\n --color-primary: var(--color-text-green);\n --color-primary-shade: var(--color-green);\n --color-primary-shade-darker: var(--color-green-darker);\n --color-white: var(--color-background-own);\n\n .theme-dark & {\n --color-primary-shade: #fff;\n --color-primary-shade-darker: #fff;\n }\n }\n }\n\n .toggle-play {\n margin-inline-end: 0.5rem;\n\n &.translucent-white {\n color: rgba(255, 255, 255, 0.8);\n }\n\n &.smaller {\n width: 3rem;\n height: 3rem;\n margin-inline-end: 0.75rem;\n\n i {\n font-size: 1.625rem;\n\n &.icon-pause {\n font-size: 1.5625rem;\n }\n }\n }\n\n i {\n position: absolute;\n\n &.icon-play {\n margin-left: 0.1875rem;\n @media (max-width: 600px) {\n margin-left: 0.125rem;\n }\n }\n }\n\n .icon-play,\n .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.4s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(0.5);\n }\n }\n\n .download-button {\n position: absolute;\n width: 1.1875rem !important;\n height: 1.1875rem !important;\n padding: 0;\n left: 1.9375rem;\n top: 1.9375rem;\n border: 0.125rem solid var(--background-color);\n z-index: 1;\n\n i {\n font-size: 0.8125rem;\n }\n }\n\n &.bigger .download-button {\n left: 2rem;\n top: 2rem;\n border: 0.125rem solid var(--color-background);\n }\n\n .content {\n align-self: center;\n min-width: 0;\n flex-grow: 1;\n text-align: initial;\n }\n\n .content-row {\n display: flex;\n justify-content: space-between;\n }\n\n .title {\n font-weight: 500;\n margin: 0;\n line-height: 1.25;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n canvas {\n height: 23px;\n }\n\n .voice-duration {\n margin: 0.25rem 0 0;\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n font-variant-numeric: tabular-nums;\n display: flex;\n align-items: flex-end;\n\n &.unread::after {\n content: \"\";\n position: relative;\n margin: 0 0 0.375rem 0.25rem;\n width: 0.4375rem;\n height: 0.4375rem;\n border-radius: 50%;\n background-color: var(--accent-color);\n }\n }\n\n body.is-ios & {\n .voice-duration.unread::after {\n margin-bottom: 0.4375rem;\n }\n }\n\n &:not(.own) .voice-duration span {\n color: var(--color-primary);\n }\n\n .waveform {\n cursor: pointer;\n margin-left: 1px;\n touch-action: none;\n }\n\n .meta,\n .performer,\n .date {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n unicode-bidi: plaintext;\n }\n\n .duration {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n font-variant-numeric: tabular-nums;\n }\n\n .meta {\n display: flex;\n align-items: center;\n margin-top: 0.125rem;\n padding-inline-end: 0.5rem;\n\n & > span {\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .performer {\n flex-shrink: 0;\n }\n\n .duration.with-seekline {\n margin-inline-end: 0.625rem;\n }\n\n .bullet {\n margin: 0 0.25rem;\n flex-shrink: 0;\n }\n }\n\n .seekline {\n flex-grow: 1;\n height: 1.25rem;\n position: relative;\n top: 3px;\n cursor: pointer;\n touch-action: none;\n\n &::before {\n content: \"\";\n position: absolute;\n width: 100%;\n top: 6px;\n height: 2px;\n background-color: var(--color-interactive-inactive);\n border-radius: 2px;\n }\n }\n\n .seekline-buffered-progress,\n .seekline-play-progress {\n position: absolute;\n height: 2px;\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n top: 6px;\n\n i {\n position: absolute;\n width: 100%;\n background-color: var(--color-interactive-active);\n height: 2px;\n border-radius: 2px;\n right: 100%;\n }\n }\n\n .seekline-buffered-progress i {\n background-color: var(--color-interactive-buffered) !important;\n }\n\n .seekline-thumb {\n position: absolute;\n width: 100%;\n top: 7px;\n left: 0;\n\n i {\n pointer-events: none;\n position: absolute;\n width: 100%;\n right: 100%;\n\n &::after {\n content: \"\";\n position: absolute;\n top: -6px;\n right: -6px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n background: var(--color-interactive-active);\n }\n }\n }\n\n &.bigger {\n .title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 400;\n line-height: 1.5rem;\n }\n\n .meta {\n height: 1.25rem;\n }\n\n .performer,\n .date {\n line-height: 1.0625rem;\n }\n\n .duration {\n line-height: 1rem;\n }\n\n .media-loading {\n top: 0.1875rem;\n left: 0.1875rem;\n }\n\n &[dir=\"rtl\"] {\n .media-loading {\n left: auto !important;\n right: 0;\n }\n }\n }\n\n .ProgressSpinner.size-s svg {\n width: 2.25rem;\n height: 2.25rem;\n }\n\n &[dir=\"rtl\"] {\n &:last-child {\n margin-bottom: 0.625rem;\n }\n\n .toggle-play {\n margin-left: 0.5rem;\n margin-right: 0;\n\n &.smaller {\n margin-left: 0.75rem;\n margin-right: 0;\n }\n }\n\n .meta.duration.with-seekline {\n margin-inline-start: 0.625rem;\n }\n\n .content,\n .duration {\n text-align: right;\n }\n\n .download-button {\n left: auto;\n right: 2rem;\n }\n }\n}\n\n.has-replies .Audio[dir=\"rtl\"] {\n margin-bottom: 1.625rem;\n}\n",".ProfilePhoto {\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n img:not(.emoji) {\n width: 100%;\n object-fit: cover;\n }\n\n .prev-avatar-media {\n position: absolute;\n left: 0;\n top: 0;\n z-index: -1;\n }\n\n .spinner-wrapper {\n width: 100%;\n height: 100%;\n }\n\n .spinner-wrapper,\n &.deleted-account,\n &.replies-bot-account,\n &.no-photo,\n &.saved-messages {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-white);\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n cursor: default;\n }\n\n &.no-photo {\n font-size: 14rem;\n }\n\n &.replies-bot-account,\n &.deleted-account,\n &.saved-messages {\n font-size: 20rem;\n }\n}\n",".ProfileInfo {\n aspect-ratio: 1 / 1;\n position: relative;\n\n @supports not (aspect-ratio: 1 / 1) {\n &::before {\n float: left;\n padding-top: 100%;\n content: \"\";\n }\n\n &::after {\n display: block;\n content: \"\";\n clear: both;\n }\n }\n\n .photo-wrapper {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n\n > .Transition {\n width: 100%;\n height: 100%;\n }\n }\n\n .photo-dashes {\n position: absolute;\n width: 100%;\n height: 0.125rem;\n padding: 0 0.375rem;\n z-index: 1;\n\n display: flex;\n top: 0.5rem;\n left: 0;\n }\n\n .photo-dash {\n flex: 1 1 auto;\n background-color: var(--color-white);\n opacity: 0.25;\n border-radius: 0.125rem;\n margin: 0 0.125rem;\n\n &.current {\n opacity: 0.75;\n }\n }\n\n .navigation {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 25%;\n border: none;\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent no-repeat;\n background-size: 1.25rem;\n opacity: 0.25;\n transition: opacity 0.15s;\n outline: none;\n cursor: pointer;\n z-index: 1;\n\n &:hover,\n .is-touch-env & {\n opacity: 1;\n }\n\n &.prev {\n left: 0;\n background-image: url(\"../../assets/media_navigation_previous.svg\");\n background-position: 1.25rem 50%;\n }\n\n &.next {\n right: 0;\n background-image: url(\"../../assets/media_navigation_next.svg\");\n background-position: calc(100% - 1.25rem) 50%;\n }\n }\n\n .info {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n min-height: 100px;\n padding: 0 1.5rem 0.5rem;\n background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);\n color: var(--color-white);\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n pointer-events: none;\n\n &:dir(rtl) {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n\n &[dir=\"rtl\"] {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n\n .title {\n display: flex;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 1.375rem;\n white-space: pre-wrap;\n word-break: break-word;\n margin-bottom: 0.25rem;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-top: -0.125rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n opacity: 0.5;\n }\n\n &[dir=\"rtl\"] {\n .navigation.prev {\n left: auto;\n right: 0;\n transform: scaleX(-1);\n }\n\n .navigation.next {\n left: 0;\n right: auto;\n transform: scaleX(-1);\n }\n }\n\n &.self {\n margin: 0 -0.5rem 0.75rem;\n overflow: hidden;\n\n &.ghost {\n margin: 0;\n }\n\n .prev-avatar-media {\n z-index: 0;\n }\n\n .info {\n padding-bottom: 0.75rem;\n }\n\n .status {\n line-height: 1rem;\n }\n }\n}\n",".DropTarget {\n border-radius: var(--border-radius-default);\n background: var(--color-background);\n padding: 1.25rem;\n flex: 1 1 auto;\n width: 100%;\n max-width: 43.75rem;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 0.3125rem;\n display: flex;\n color: #a4acb3;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n @media (max-height: 350px) {\n padding: 0.75rem;\n }\n\n &.hovered .target-content {\n color: var(--color-primary);\n background-image: var(--drag-target-border-hovered);\n }\n\n & + & {\n margin-top: 0.3125rem;\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .target-content {\n pointer-events: none;\n background-image: var(--drag-target-border);\n border-radius: 0.5rem;\n flex: 1 1 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: 0.2s color, 0.2s background;\n }\n\n .icon {\n font-size: 6.25rem;\n line-height: 4.6875rem;\n margin-bottom: 2.25rem;\n\n @media (max-height: 520px) {\n font-size: 4.25rem;\n line-height: 3.5rem;\n margin-bottom: 1rem;\n }\n\n @media (max-height: 450px) {\n font-size: 2rem;\n line-height: 1rem;\n margin-bottom: 0.5rem;\n margin-top: 0.25rem;\n }\n }\n\n .title {\n font-size: 1.3125rem;\n font-weight: 500;\n letter-spacing: -0.18px;\n\n @media (max-height: 450px) {\n font-size: 1rem;\n }\n }\n\n .description {\n font-size: 1rem;\n letter-spacing: 0.3px;\n\n @media (max-height: 450px) {\n font-size: 0.875rem;\n }\n }\n}\n",".FloatingActionButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(calc(5rem - var(--group-call-header-height, 0rem)));\n transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &.revealed {\n transform: translateY(calc(0rem - var(--group-call-header-height, 0rem)));\n }\n}\n","@import \"../../styles/mixins\";\n\n@mixin thumb-styles() {\n background: var(--slider-color);\n border: none;\n height: 0.75rem;\n width: 0.75rem;\n border-radius: 50%;\n cursor: pointer;\n transform: scale(1);\n transition: transform 0.25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.RangeSlider {\n --slider-color: var(--color-primary);\n\n margin-bottom: 1rem;\n\n &.disabled {\n pointer-events: none;\n --slider-color: var(--color-text-secondary);\n }\n\n .slider-top-row {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.625rem;\n\n .value {\n flex-shrink: 0;\n margin-left: 1rem;\n color: var(--color-text-secondary);\n }\n\n &[dir=\"rtl\"] {\n .value {\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n\n .slider-main {\n position: relative;\n z-index: 1;\n\n &::before {\n content: \"\";\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--color-borders);\n border-radius: 0.125rem;\n opacity: 0.5;\n z-index: -1;\n }\n }\n\n .slider-fill-track {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--slider-color);\n border-radius: 0.125rem;\n pointer-events: none;\n }\n\n // Reset range input browser styles\n @include reset-range();\n\n // Apply custom styles\n input[type=\"range\"] {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n\n .slider-options {\n display: grid;\n grid-template-rows: auto;\n grid-auto-columns: 1fr;\n grid-auto-flow: column;\n }\n\n .slider-option {\n font-size: 0.8125rem;\n text-align: center;\n cursor: pointer;\n color: var(--color-text-secondary);\n transition: color 0.2s ease;\n\n &:hover,\n &.active {\n color: var(--color-text);\n }\n\n &.active {\n font-weight: 500;\n }\n\n &:first-child {\n text-align: left;\n }\n\n &:last-child {\n text-align: right;\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n",".DropArea {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 100vh;\n z-index: var(--z-drop-area);\n padding: 80px 20px 20px;\n\n display: flex;\n flex-direction: column;\n\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n}\n",".StickerButton {\n display: inline-block;\n width: 4rem;\n height: 4rem;\n margin: 0.5rem;\n border-radius: var(--border-radius-messages-small);\n background: transparent no-repeat center;\n background-size: contain;\n transition: background-color 0.15s ease, opacity 0.3s ease !important;\n position: relative;\n\n &.interactive {\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n\n .sticker-unfave-button {\n opacity: 1;\n }\n }\n }\n\n @media (max-width: 600px) {\n margin: 0.25rem;\n }\n\n &.set-button {\n width: 2.75rem !important;\n height: 2.75rem;\n margin: 0 0.5rem;\n }\n\n &.large {\n width: 10rem;\n height: 10rem;\n margin: 0;\n }\n\n .AnimatedSticker,\n img,\n video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n img,\n video {\n object-fit: contain;\n }\n\n .sticker-unfave-button {\n position: absolute;\n top: -0.5rem;\n right: -0.5rem;\n width: 1.25rem;\n height: 1.25rem;\n padding: 0.125rem;\n\n i {\n font-size: 1rem;\n }\n\n opacity: 0;\n }\n}\n",".TextFormatter {\n transform: translate(-50%, -3.25rem);\n\n &,\n &-link-control {\n position: absolute;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0.375rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &-link-control {\n left: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s ease;\n\n .Modal & {\n max-width: 100%;\n }\n\n @media (max-width: 600px) {\n max-width: calc(100vw - var(--text-formatter-left) + 3rem);\n }\n\n input {\n border: none !important;\n outline: none !important;\n width: 100%;\n color: var(--color-text);\n background-color: var(--color-background);\n }\n }\n\n &-buttons,\n &-link-url-confirm {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n }\n\n &-divider {\n width: 1px;\n height: 1.75rem;\n margin: 0 0.25rem;\n background-color: var(--color-borders);\n }\n\n &-link-url-input-wrapper {\n width: 20rem;\n position: relative;\n max-width: 100%;\n\n @media (max-width: 600px) {\n max-width: 90vw;\n }\n\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1rem;\n z-index: 2;\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(to right, var(--color-background) 0.25rem, transparent 1rem);\n }\n\n &::after {\n right: 0;\n background: linear-gradient(to left, var(--color-background) 0.25rem, transparent 1rem);\n }\n\n &.mask-left {\n &::before {\n opacity: 1;\n }\n }\n\n &.mask-right {\n &::after {\n opacity: 1;\n }\n }\n }\n\n &-link-url-confirm {\n flex-shrink: 0;\n opacity: 0;\n transition: opacity 0.3s ease;\n\n &.shown {\n opacity: 1;\n }\n }\n\n &.link-control-shown {\n .TextFormatter-link-control {\n opacity: 1;\n pointer-events: all;\n }\n }\n\n .Button {\n width: 2rem;\n height: 2rem;\n padding: 0.25rem;\n font-size: 1.5rem;\n margin: 0 0.125rem;\n border-radius: var(--border-radius-messages-small);\n flex-shrink: 0;\n cursor: pointer;\n\n &.active {\n background-color: var(--color-primary) !important;\n color: white;\n }\n\n &.disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n }\n}\n",".Picker {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .picker-header {\n padding: 0 1rem 0.25rem 0.75rem;\n border-bottom: 1px solid var(--color-borders);\n display: flex;\n flex-flow: row wrap;\n flex-shrink: 0;\n\n overflow-y: auto;\n max-height: 20rem;\n\n .input-group {\n margin-bottom: 0.5rem;\n margin-left: 0.5rem;\n flex-grow: 1;\n }\n\n .form-control {\n height: 2rem;\n border: none;\n border-radius: 0;\n padding: 0;\n box-shadow: none;\n }\n }\n\n .picker-list {\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n }\n\n .no-results {\n height: 100%;\n margin: 0;\n padding: 1rem 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"347.b7e411d2828cadec556d.css","mappings":"AAAA,YACE,kBAEA,cACE,WACA,YACA,wCACA,gCAEA,oCAEE,kBACA,MACA,OAGF,kEACE,wBAKJ,kCACE,2BAMF,4DAEE,eACA,0FAEE,+BAGF,gFACE,kBACA,yBACA,MACA,OACA,6CACA,mBAKF,sBACE,2BAIA,kCACE,4CAGF,gCACE,2CAMJ,gCACE,4BAIA,4CACE,qDAGF,0CACE,sDAMJ,0BACE,4BAIA,sCACE,4CAGF,oCACE,2CAKF,oCACE,2BAIA,gDACE,qDAGF,8CACE,sDAWN,2BACE,wCAGF,6BACE,4BAIA,yCACE,gCAGF,uCACE,+BAMJ,uCACE,6BAIA,mDACE,yCAGF,iDACE,0CASJ,6BACE,sBACA,wBACA,UAGF,2BACE,sBACA,6BACA,UAIA,uCACE,+FAGF,qCACE,6FAMJ,uCACE,wBACA,UAGF,qCACE,8BACA,UAIA,iDACE,iHAIF,+CACE,mHAUJ,4BACE,wBACA,mB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KACE,mBACA,WAOJ,wBACE,GACE,2BAEF,KACE,yBAIJ,kCACE,GACE,wBAEF,KACE,4BAOJ,qBACE,GACE,gEAEF,KACE,2DAOJ,+BACE,GACE,0DAEF,KACE,iE;AC7qBJ,iBACE,kBACA,UACA,eACA,gBACA,qFAGA,kBACA,eAEA,0BACE,kCACA,oBAGF,wBACE,sBAEA,+BACE,WACA,kBACA,eACA,gBACA,sBACA,sBACA,SACA,QACA,qCAIJ,gDAEE,WACA,YAEA,iFAIA,8DACE,sBACA,aACA,cAIJ,yBACE,cACA,eAEA,6BACE,WACA,YACA,eAGF,gCACE,iBAIJ,6BACE,wCAGF,qBACE,cACA,yBACA,yBACA,yDAGF,wBACE,iCAIJ,oCACE,KACE,uBAEF,GACE,0+B;ACpFJ,QACE,mCACA,UACA,mBACA,uBACA,eACA,gBACA,kBACA,wEACA,WACA,iBACA,aACA,mBACA,0CAEA,wBACE,kBACA,WACA,YAGF,eACE,WACA,YAGF,UACE,iBAEA,4BACE,qBAIJ,mBACE,WACA,YACA,gBAEA,0BACE,eACA,gBAIJ,kBACE,WACA,YACA,kBAEA,yBACE,cACA,eAIJ,mBACE,eACA,gBACA,kBAEA,0BACE,cACA,eAIJ,oBACE,cACA,eACA,oBAEA,2BACE,WACA,YAIJ,mBACE,oBAEA,qBACE,iBAGF,0BACE,gBACA,iBAIJ,mBACE,aACA,cACA,iBAEA,qBACE,eAGF,0BACE,aACA,cAIJ,eACE,kBAEA,sBACE,WACA,cACA,kBACA,gBACA,eACA,cACA,eACA,kBACA,yCACA,yBACA,cAIJ,oBACE,e;AC7HJ,OACE,kBACA,uBAOE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDAEE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,oBACE,oBACA,4BACA,qBACA,uBACA,gBAGF,mBACE,kCACA,mBACA,gBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;AC/KJ,UACE,kBAIE,oGACE,WACA,kBACA,SACA,YACA,QAEA,YACA,iCAGF,oFACE,cAGF,8EACE,OAMF,oDACE,gBACA,uBAIJ,2BACE,WACA,yCACA,uBACA,2BACA,wBACA,aACA,aACA,kBACA,gBACA,mBACA,mBACA,wBACA,2CACA,oCAEA,6BACE,iBACA,kBACA,kCAIJ,oFAIE,mBACA,uBAIA,uCACE,kBACA,WAIJ,mBACE,oBAEA,oCACE,WAKF,0DACE,eAEA,gFACE,4BAGF,qBACE,gIAEE,6CAIJ,yBACE,iEACE,6CAMR,yBAGI,4HACE,yDAKN,yCACE,4CAGF,iBACE,qBAEA,kCACE,mBAIJ,mBACE,oBAGF,gBACE,4CAIA,uCACE,yBAEA,yCACE,cAKN,uBACE,kBAEA,+BACE,WAEA,gDACE,6BACA,8BAMJ,sFAEE,0DAGF,+CACE,iBAGF,sCACE,cACA,mBAGF,oCACE,YACA,gBAGF,6EAEE,gBACA,aACA,2BACA,mBAGF,gKAIE,eACA,sBACA,SACA,gBACA,mBACA,uBACA,mBAIA,wCACE,gBAGF,mDACE,cACA,eACA,mBAGF,4CACE,2BACA,wBACA,cAIJ,6FAEE,kBACA,oBACA,kCAGF,wCACE,aACA,mBACA,YACA,gBAEA,uGAEE,kBACA,oBACA,kCACA,qBAEA,qHACE,2BAGF,oPAEE,mBACA,WAGF,gTAEE,kBAKN,6PAME,mBACA,uBAMA,4UAEE,mBAKF,wDACE,4CAGF,+CACE,kBACA,eAGF,qDACE,WAMJ,uCACE,sBAGF,mCACE,cAGF,6EAEE,eACA,mBACA,gBACA,mBACA,uBACA,gBACA,cAGF,iDACE,iBACA,eAGF,0CACE,kCAEA,mEACE,wBACA,mBACA,qBACA,kBACA,qBAEA,+EACE,mBAMJ,0DACE,cACA,kBAGF,mDACE,eACA,cAKN,2BACE,SAEA,4CACE,eACA,aACA,mBAGF,mCACE,WACA,YAGF,qCACE,cACA,cACA,SACA,kBAIA,8CACE,eACA,mBAKN,0BACE,YACA,oBACA,gBAEA,qEAEE,cACA,mBAGF,iCACE,oBACA,gBACA,uBAGF,oCACE,kBACA,mBACA,kCAEA,8CACE,oBAGF,0CACE,wBAMJ,sCACE,iBACA,e;ACnZN,cACE,qBACA,cACA,aACA,cACA,yDACA,4BACA,qBACA,gC;ACRF,cACE,oBACA,qBAEA,wBACE,aACA,WACA,gBAEA,+BACE,cACA,oDAEA,0FAEE,iCAMR,yBACE,KACE,6BAIJ,6BACE,KACE,4B;AC7BJ,2BACE,qBACA,oCAGE,WACE,kCACA,C;ACPN,wBACE,kBACA,YACA,gBACA,mBACA,8BAEA,0BAPF,wBAQI,8CAGF,sCACE,mBAEA,wDACE,oBAKN,cACE,4FAGA,uBACA,2CACA,4CACA,WACA,eAEA,6GAGE,sBACA,0BAGF,uBACE,iBACA,sBACA,+e;ACxCJ,OACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,gBACE,oBACA,WAGF,qBACE,eAEE,iFAEE,kBAKN,aACE,kBACA,uBACA,UAIA,qDAEE,WACA,cACA,kBACA,eACA,QACA,cACA,eACA,2BAGF,2BACE,4CACA,kBACA,yCACA,UACA,kDAGF,0BACE,cACA,cACA,eACA,kBACA,gCACA,UACA,4BAGF,0BACE,cACA,sBACA,uBACA,gBAGF,6BACE,cACA,kBACA,iBACA,kCACA,uBAKF,yCACE,kCAGF,wCACE,UAKF,qEAEE,qBAGF,wBACE,kBACA,eACA,QACA,2BACA,UACA,oCACA,wBAIJ,gBACE,eACA,qBAEA,4BACE,iBAEA,oCACE,UACA,gBAGF,mCACE,UACA,eAIJ,iDAEE,iBAGF,iCACE,UACA,gBAKN,mBACE,KACE,UAEF,GACE,W;AC3IJ,qBACE,WACA,c;ACFF,KACE,aACA,uBACA,cACA,wCACA,gBACA,WACA,SACA,YACA,uBACA,gBACA,kCACA,eACA,2DACA,4DAEA,4BAGE,aAGF,aACE,eACA,2BAEA,eACE,qBAIJ,qBACE,6BACE,mDAIJ,yBACE,8BACE,mDAIJ,UACE,kBACA,aACA,mBACA,mBAGF,YACE,kBACA,eACA,0BACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,kDAEE,oBAIJ,oBACE,2CAGF,OACE,kBACA,6BACA,OACA,UACA,sCACA,gBACA,WACA,oCACA,oBACA,uBACA,sBAEA,eACE,6CAEA,sCACE,2B;AC3FR,SACE,gBACA,MACA,cACA,aACA,8BACA,qBACA,kBACA,iBACA,+CACA,yCACA,gBACA,kBAEA,qBACA,8BAEA,aACE,eACA,kCAGF,4BACE,SAGF,kCACE,+BAEA,yC;AC5BF,+BACE,gBAGF,+BACE,2BAGF,+CACE,oBAGF,gCACE,sBAGF,wCACE,uB;AClBJ,aACE,kBACA,WACA,iDACA,yCACA,yCACA,uBACA,kCAEA,8BACE,aAEA,2CACE,aAGF,oCACE,mBAIA,6CACE,oBACA,eAKN,uBACE,kCACA,iCACA,yCAGE,+BACE,2BAKN,mBACE,cACA,gBACA,uBACA,uBACA,wCACA,2BACA,wJAGA,gCACE,gCAIJ,eACE,kBACA,UACA,YACA,mBACA,oBAGF,sBACE,kBACA,MACA,QACA,cACA,aAEA,+BACE,uBAIJ,qBACE,kBACA,YACA,cACA,eAGF,yBACE,mBACE,cACA,sBACA,kDAGF,eACE,WAKF,4BACE,cAGF,wBACE,UACA,aAGF,+BACE,WACA,WAGF,8BACE,aACA,W;AC/GN,oBACE,aACA,mBACA,mCACA,YACA,eACA,kBACA,oBACA,mBACA,mBACA,eACA,kBACA,gBACA,cACA,sCAEA,4BAEA,8BACE,gBAGF,0BACE,0CAGF,oCACE,oDAEA,iDACE,UAGF,2FAEE,UAKF,6CACE,gCAGF,sCACE,mCAGF,2CACE,kBAIJ,iCACE,cACA,kBACA,WACA,eAEA,kCAGF,2DAEE,WACA,YACA,UACA,cACA,6BAEA,+DACE,eAIJ,+BACE,aACA,mBACA,uBACA,gBACA,kBACA,sCACA,WAEA,iCACE,kBACA,kBACA,SAIJ,+BACE,kBACA,mBACA,gBACA,uBAEA,kDACE,eACA,gBACA,yBACA,oBAIJ,iCACE,kBACA,OACA,MACA,WACA,YACA,kBACA,aACA,mBACA,uBACA,oCACA,iBACA,WACA,UACA,6BAGF,6BACE,kBACA,gBAEA,uCACE,gBACA,eAGF,0CACE,UACA,gBAGF,wCACE,cACA,mBAGF,0CACE,UACA,Q;AC/IN,UACE,oBACA,mBACA,kBACA,SAEA,mBACE,oBACA,WAGF,mBACE,oBAKA,8JAEE,2BAGF,kGACE,eAIJ,gBACE,SACA,QACA,kBACA,kBACA,uBACA,UAGF,kBACE,eACA,mBACA,eACA,eACA,6BACA,qBACA,oBACA,kBACA,kCAGF,wBACE,WACA,kBACA,cACA,OACA,eACA,gBACA,mCACA,qBACA,wBACA,uCAGF,gCACE,gCAGF,sCACE,2BACA,6CACA,kCAGF,+BACE,c;ACxEJ,uBACE,gBACA,iBACA,gBACA,qBACA,cACA,oBAEA,yBACE,mCAGF,+CACE,qBAGF,mCACE,WACA,Y;AClBJ,iBACE,sBACA,2BACA,cACA,iBACA,cACA,aACA,mBAEA,wCACE,qCACA,qBACA,mBAEA,oDACE,wBAIJ,uBACE,6BACA,qB;ACrBJ,kBACE,UACA,2DAEA,6BACE,mBACA,UAGF,8BACE,aAGF,0BACE,uDAIJ,eACE,aAEA,sBACE,0BAIJ,OACE,iBACA,cACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,qBACE,mBAGF,mBACE,qBACA,mBACA,gBACA,kBAGF,yCAEE,8BACA,yBAGF,2BACE,0BACA,uBACA,aACA,UAEA,6BACE,iBAIJ,eACE,aACA,eAEA,iBACE,eACA,qBAGF,2BACE,eACA,eAEA,6BACE,kB;AChFR,qCACE,0BACA,6BACA,2BACA,0BACA,2BACA,6BACA,2BACA,6BACA,6BAGF,qCACE,uBACA,6BACA,2BACA,6BACA,wBACA,6BACA,2BACA,6BACA,0BAIF,gBACE,kBACA,UACA,SACA,WACA,YACA,kBACA,yBACA,yCACA,gBAEA,2BACE,WACA,YACA,aACA,mBACA,uBACA,kBACA,+BACE,UACA,WACA,mCACA,kBACA,WACA,sBACA,wBAEF,8CACE,sBAEF,+CACE,uBAIJ,yBACE,oCACA,sCACA,wCACE,0CAKF,qDACE,yDAGF,sDACE,yD;AC3EN,MACE,4CAOA,kBACA,MACA,OACA,SACA,WATA,sCAEE,gDASF,sBACE,oBACA,gCAGF,wBACE,sBACA,kCAKA,qFACE,qCAIJ,yBACE,eACE,uDAEA,qCACE,sCAKN,yBACE,oCAEE,wDAEA,gFACE,iDACA,8BAGF,sEACE,wDACA,iCACA,8CACA,sCACA,2CACA,kCACA,mCAGF,4DACE,oCAGF,4EACE,8BACA,gCAKN,yBACE,uBACE,4BAIJ,cACE,kBACA,cAIA,sBACE,qBAGF,eACE,WACA,cAGF,wBACE,kBACA,mBACA,sBACA,cAEA,oCACE,aACA,mBAIJ,6BACE,iBAEA,yCACE,kBACA,eAIJ,qDAEE,qBACA,YACA,kCACA,uBAEA,uEACE,gBAGF,+EACE,wBAGF,mEACE,yBAMA,wCACE,aAIJ,iCACE,yBAGF,8BACE,cACA,eACA,iBACA,sBACA,wBACA,yBAEA,0CACE,eACA,gBACA,0BAGF,oCACE,sBAIJ,uCACE,WACA,YACA,yBAGF,qCACE,kBACA,qBACA,iBACA,WACA,6BACA,wBACA,gBAEA,iDACE,8BACA,SAQJ,sCACE,cACA,kBAGF,2DAEE,qBACA,gBAGF,iCACE,cACA,oBAGF,uEAEE,mBACA,gBACA,iBACA,uB;AClNR,eACE,eACA,qBAEA,mBACE,kBACA,WACA,YAGF,sCACE,qB;ACXJ,aACE,WACA,WACA,aACA,mBACA,uBACA,sBAEA,0BARF,aASI,aAGF,sBACE,YACA,uBAGF,oBACE,kBACA,sBAGF,0BACE,kBACA,kCAEA,8EAEE,wCAIJ,0BACE,mBACA,gBACA,4BACA,uBAEA,4BACE,0BACA,iB;ACxCN,cACE,aACA,mBACA,uBACA,6BAEA,+BACE,sBAGF,+BACE,cAGF,2BACE,kCACA,kBACA,kBACA,gBACA,uB;ACnBJ,OACE,SACA,oBACA,gBACA,kBACA,eAEA,uBACE,kBACA,YACA,WACA,2BACA,WACA,iBACA,mBACA,uBACA,qBAGF,WACE,kBACA,OACA,MACA,WACA,YACA,iB;ACzBJ,SACE,gBACA,2BACA,kBACA,qBACA,kBAEA,kBACE,kBAGF,+BACE,2BACA,WACA,YACA,kBACA,OACA,MACA,yDACA,WACA,aACA,mBACA,uBACA,kDACA,yBACA,gBACA,iBAGF,gBACE,kBACA,OACA,MACA,WACA,YACA,0BACA,gCACA,6DAGF,oEAGE,sBACA,mBAGF,oBACE,cACA,yBACA,gBACA,mBACA,gBACA,uBAGF,qBACE,eACA,gBACA,uBACA,sBAGF,iDAEE,gBACA,kCACA,qBACA,mBACA,oBACA,qBACA,4BACA,gBAGF,sBACE,kBAGF,kCACE,sBACA,uBAGF,kBACE,2BAEA,iEAEE,UACA,QAGF,2BACE,iB;AC9FN,oDACE,aAaA,mBACA,oBAZA,0CACE,sBAGF,eACE,0BACA,qBAFF,eAGI,6BAOJ,iBACE,2DAGF,cAGE,gBACA,yBACA,kDACA,gCACA,aACA,mBACA,uBACA,sBAGF,iBACE,MACA,OACA,kBAGF,yBACE,qBACA,cACA,kBACA,WACA,4BAEA,cACE,gBACA,wBACA,yBAGF,UACE,cACA,kBACA,MACA,QACA,iCACA,2BACA,qFACA,mCACA,mBACA,qCACA,qBAIJ,sBACE,gBACA,qEAEA,yBAEE,kDACA,yBAGF,gBACE,oBAIJ,UACE,iBACA,kBACA,MACA,eACA,gBACA,aACA,mBACA,uBACA,UACA,wBACA,wCAGF,cACE,gEAGE,cACE,2DAGF,SACE,kEAEA,SACE,wDAIJ,SACE,kBAKN,mBACE,qBACA,mBACA,gBACA,YACA,wBAEA,gBACE,kCACA,kBACA,mBACA,mBAIJ,cACE,mBACA,gBACA,gBACA,uBACA,0BAEA,mBACE,sBAIJ,iBACE,qBACA,6BACA,eACA,gBACA,uBACA,wCAGE,aACE,eAKN,2CACE,0CACA,8GAEA,UAIE,YACA,0BAGF,sBACE,iCAEA,0BACE,0BAIJ,oBACE,2BAGF,eACE,8BAGF,gBACE,2KAMF,kBAGE,eACA,qDAGF,gBACE,iEAEA,cACE,mBACA,yDAIJ,SACE,QACA,+CAQJ,mCACE,qDAGF,qCACE,mDAGF,wCACE,C;ACvOJ,OACE,aACA,uBACA,kBAEA,sBACE,kBACA,oBAEA,kCACE,mBAIJ,WACE,4CACA,oDACA,qEACA,qEAEA,uBACE,sCACA,uCAGF,mBACE,yCACA,0CACA,wDACA,2CAEA,+BACE,4BACA,mCAKN,oBACE,wBAEA,sCACE,2BAGF,4BACE,WACA,YACA,yBAEA,8BACE,mBAEA,yCACE,oBAKN,sBACE,kBAEA,gCACE,qBACA,yBAFF,gCAGI,qBAKN,+DAEE,UACA,mBACA,uEAGF,yJAIE,UACA,qBAIJ,wBACE,kBACA,2BACA,4BACA,UACA,eACA,cACA,6CACA,UAEA,0BACE,mBAIJ,+BACE,UACA,SACA,6CAGF,gBACE,kBACA,YACA,YACA,mBAGF,oBACE,aACA,8BAGF,cACE,gBACA,SACA,iBACA,mBACA,gBACA,uBAGF,cACE,YAGF,uBACE,kBACA,kBACA,kCACA,kCACA,aACA,qBAEA,qCACE,WACA,kBACA,0BACA,eACA,gBACA,kBACA,qCAKF,iDACE,uBAIJ,sCACE,2BAGF,iBACE,eACA,gBACA,kBAGF,4CAGE,kBACA,kCACA,SACA,gBACA,mBACA,uBACA,uBAGF,iBACE,kBACA,kCACA,mBACA,gBACA,uBACA,cACA,kCAGF,aACE,aACA,mBACA,mBACA,yBAEA,kBACE,YACA,mBACA,gBACA,uBAGF,wBACE,cAGF,qCACE,0BAGF,qBACE,gBACA,cAIJ,iBACE,YACA,eACA,kBACA,QACA,eACA,kBAEA,yBACE,WACA,kBACA,WACA,QACA,WACA,mDACA,kBAIJ,kEAEE,kBACA,WACA,kBACA,gBACA,WACA,QAEA,sEACE,kBACA,WACA,iDACA,WACA,kBACA,WAIJ,qCACE,8DAGF,uBACE,kBACA,WACA,QACA,OAEA,yBACE,oBACA,kBACA,WACA,WAEA,gCACE,WACA,kBACA,SACA,WACA,WACA,YACA,kBACA,2CAMJ,qBACE,mBACA,gBACA,uBACA,gBACA,mBAGF,oBACE,eAGF,6CAEE,sBAGF,wBACE,iBAGF,6BACE,aACA,cAIA,sCACE,qBACA,QAKN,mCACE,cACA,eAIA,2BACE,sBAGF,6BACE,kBACA,eAEA,qCACE,mBACA,eAIJ,6CACE,4BAGF,mDAEE,iBAGF,iCACE,UACA,WAKN,6BACE,uB;ACnWF,cACE,WACA,YACA,eACA,kBAEA,8BACE,WACA,iBAGF,iCACE,kBACA,OACA,MACA,WAGF,+BACE,WACA,YAGF,mJAKE,aACA,mBACA,uBACA,yBACA,wEACA,eAGF,uBACE,gBAGF,6FAGE,gB;AC3CJ,aACE,iBACA,kBAEA,kCACE,qBACE,WACA,iBACA,WAGF,oBACE,cACA,WACA,YAIJ,4BACE,WACA,kBACA,OACA,MACA,SAEA,wCACE,WACA,YAIJ,2BACE,kBACA,WACA,eACA,kBACA,UAEA,aACA,UACA,OAGF,yBACE,cACA,oCACA,YACA,sBACA,iBAEA,iCACE,YAIJ,yBACE,kBACA,MACA,SACA,UACA,YACA,UACA,SACA,wCACA,iCACA,wBACA,YACA,wBACA,aACA,eACA,UAEA,sEAEE,UAGF,8BACE,OACA,yDACA,gCAGF,8BACE,QACA,yDACA,6CAIJ,mBACE,kBACA,SACA,OACA,WACA,iBACA,uBACA,+EACA,yBACA,aACA,sBACA,yBACA,oBAGE,oCACE,iBACA,uBAKF,oCACE,iBACA,uBAKN,oBACE,aACA,mBAEA,uBACE,gBACA,kBACA,qBACA,qBACA,sBACA,qBAGF,kCACE,mBACA,qBAGF,2BACE,aACA,cACA,uBAIJ,qBACE,kBACA,WAIA,uCACE,UACA,QACA,qBAGF,uCACE,OACA,WACA,qBAIJ,kBACE,wBACA,gBAEA,wBACE,SAGF,qCACE,UAGF,wBACE,sBAGF,0BACE,+C;ACpLN,YACE,2CACA,mCACA,gBACA,cACA,WACA,mBACA,iBACA,kBACA,uBACA,aACA,cACA,iDAEA,0BAdF,YAeI,gBAGF,oCACE,2BACA,mDAGF,wBACE,oBAGF,uBACE,gBAGF,4BACE,oBACA,2CACA,oBACA,cACA,aACA,sBACA,mBACA,uBACA,oCAGF,kBACE,kBACA,sBACA,sBAEA,0BALF,kBAMI,kBACA,mBACA,oBAGF,0BAXF,kBAYI,eACA,iBACA,oBACA,mBAIJ,mBACE,oBACA,gBACA,uBAEA,0BALF,mBAMI,gBAIJ,yBACE,eACA,oBAEA,0BAJF,yBAKI,mB;AC7EN,sBACE,kBACA,WACA,YACA,yEACA,4DAEA,6CACE,2BAGF,+BACE,yE;ACKJ,aACE,qCAEA,mBAEA,sBACE,oBACA,4CAGF,6BACE,aACA,8BACA,sBAEA,oCACE,cACA,iBACA,kCAIA,6CACE,cACA,kBAKN,0BACE,kBACA,UAEA,kCACE,WACA,kBACA,WACA,OACA,aACA,eACA,sCACA,sBACA,WACA,WAIJ,gCACE,kBACA,WACA,OACA,aACA,eACA,qCACA,sBACA,oBCvDF,+BACE,wBACA,cACA,WACA,cACA,oBACA,uBAEA,qCACE,aAGF,0CACE,WACA,eAEA,uBACA,yBACA,kBAGF,qDACE,wBAGF,kDACE,qBAGF,8DACE,eAGF,qGACE,eD+BF,qDA/EF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,oFAEA,2DACE,qBAyEA,iDAnFF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,iFAEA,uDACE,qBA6EA,0CAvFF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,gFAEA,gDACE,qBAkFF,6BACE,aACA,wBACA,sBACA,sBAGF,4BACE,mBACA,kBACA,eACA,kCACA,0BAEA,qEAEE,wBAGF,mCACE,gBAGF,wCACE,gBAGF,uCACE,iB;AE3HN,UACE,kBACA,MACA,QACA,OACA,aACA,2BACA,uBAEA,aACA,sBAEA,kCACE,iD;ACbJ,eACE,qBACA,WACA,YACA,aACA,kDACA,wCACA,wBACA,kEACA,kBAEA,2BACE,eAEA,iCACE,wDAEA,wDACE,UAKN,yBAvBF,eAwBI,eAGF,0BACE,yBACA,eACA,eAGF,qBACE,YACA,aACA,SAGF,wEAGE,kBACA,MACA,OACA,WACA,YAGF,wCAEE,mBAGF,sCACE,kBACA,YACA,cACA,cACA,eACA,gBAMA,UAJA,wCACE,e;AC/DN,eACE,oCAEA,2CAEE,kBACA,mCACA,4CACA,sBACA,iDAGF,4BACE,OACA,MACA,UACA,oBACA,4BAEA,mCACE,eAGF,yBAXF,4BAYI,2DAGF,kCACE,uBACA,wBACA,WACA,wBACA,yCAIJ,uDAEE,aACA,iBACA,mBAGF,uBACE,UACA,eACA,gBACA,sCAGF,sCACE,YACA,kBACA,eAEA,yBALF,sCAMI,gBAGF,2FAEE,WACA,cACA,kBACA,MACA,SACA,WACA,UACA,UACA,4BAGF,8CACE,OACA,wFAGF,6CACE,QACA,uFAIA,wDACE,UAKF,wDACE,UAKN,gCACE,cACA,UACA,4BAEA,sCACE,UAKF,8DACE,UACA,mBAIJ,uBACE,WACA,YACA,eACA,iBACA,iBACA,kDACA,cACA,eAEA,8BACE,iDACA,WAGF,gCACE,WACA,oB;ACjIN,QACE,YACA,aACA,sBACA,gBAEA,uBACE,6BACA,6CACA,aACA,mBACA,cAEA,gBACA,iBAEA,oCACE,oBACA,kBACA,YAGF,qCACE,YACA,YACA,gBACA,UACA,gBAIJ,qBACE,YACA,gBACA,kBACA,cAEA,yBANF,qBAOI,0BACA,4BAIJ,oBACE,YACA,SACA,kBACA,aACA,mBACA,uBACA,kC","sources":["webpack://telegram-t/./src/components/ui/Transition.scss","webpack://telegram-t/./src/components/ui/ProgressSpinner.scss","webpack://telegram-t/./src/components/common/Avatar.scss","webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/ui/ListItem.scss","webpack://telegram-t/./src/components/common/VerifiedIcon.scss","webpack://telegram-t/./src/components/common/DotAnimation.scss","webpack://telegram-t/./src/components/common/TypingStatus.scss","webpack://telegram-t/./src/components/ui/Notification.scss","webpack://telegram-t/./src/components/ui/Radio.scss","webpack://telegram-t/./src/components/common/ReactionStaticEmoji.scss","webpack://telegram-t/./src/components/ui/Tab.scss","webpack://telegram-t/./src/components/ui/TabList.scss","webpack://telegram-t/./src/components/common/DeleteChatModal.scss","webpack://telegram-t/./src/components/ui/SearchInput.scss","webpack://telegram-t/./src/components/common/PickerSelectedItem.scss","webpack://telegram-t/./src/components/ui/Switcher.scss","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.scss","webpack://telegram-t/./src/components/common/LastMessageMeta.scss","webpack://telegram-t/./src/components/left/main/Badge.scss","webpack://telegram-t/./src/components/left/main/ChatCallStatus.scss","webpack://telegram-t/./src/components/left/main/Chat.scss","webpack://telegram-t/./src/components/common/AnimatedEmoji.scss","webpack://telegram-t/./src/components/left/main/EmptyFolder.scss","webpack://telegram-t/./src/components/common/NothingFound.scss","webpack://telegram-t/./src/components/common/Media.scss","webpack://telegram-t/./src/components/common/WebLink.scss","webpack://telegram-t/./src/components/common/File.scss","webpack://telegram-t/./src/components/common/Audio.scss","webpack://telegram-t/./src/components/common/ProfilePhoto.scss","webpack://telegram-t/./src/components/common/ProfileInfo.scss","webpack://telegram-t/./src/components/middle/composer/DropTarget.scss","webpack://telegram-t/./src/components/ui/FloatingActionButton.scss","webpack://telegram-t/./src/components/ui/RangeSlider.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/middle/composer/DropArea.scss","webpack://telegram-t/./src/components/common/StickerButton.scss","webpack://telegram-t/./src/components/middle/composer/TextFormatter.scss","webpack://telegram-t/./src/components/common/Picker.scss"],"sourcesContent":[".Transition {\n position: relative;\n\n > * {\n width: 100%;\n height: 100%;\n animation-fill-mode: forwards !important;\n transition: background-color 0.2s;\n\n &.from,\n &.to {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n &:not(.Transition__slide--active):not(.from):not(.to) {\n display: none !important; // Best performance when animating container\n //transform: scale(0); // Shortest initial delay\n }\n }\n\n &.skip-slide-transition {\n transition: none !important;\n }\n\n /*\n * slide\n */\n &.slide-optimized,\n &.slide-optimized-rtl {\n contain: strict;\n body.is-safari & {\n // Create a new composite layer to reduce the page repaint area when switching a tab (as `contain` is not supported in Safari)\n transform: translate3d(0, 0, 0);\n }\n\n #root & > div {\n position: absolute;\n display: block !important;\n top: 0;\n left: 0;\n transition: transform var(--slide-transition);\n transform: scale(0);\n }\n }\n\n &.slide {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n }\n\n &.slide.backwards {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n\n &.slide-rtl {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n\n &.backwards {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n }\n\n /*\n * mv-slide\n */\n\n &.mv-slide {\n > * > div {\n animation-fill-mode: forwards !important;\n }\n\n > .to > div {\n transform: translateX(100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-out 0.4s ease;\n }\n\n > .to > div {\n animation: mv-slide-in 0.4s ease;\n }\n }\n }\n\n &.mv-slide.backwards {\n > .to > div {\n transform: translateX(-100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-in-backwards 0.4s ease;\n }\n\n > .to > div {\n animation: mv-slide-out-backwards 0.4s ease;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.slide-fade {\n > .from {\n transform-origin: left;\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform-origin: left;\n transform: translateX(1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity var(--slide-transition), slide-fade-out-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-in-opacity var(--slide-transition), slide-fade-in-move var(--slide-transition);\n }\n }\n }\n\n &.slide-fade.backwards {\n > .from {\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform: translateX(-1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity var(--slide-transition),\n slide-fade-in-backwards-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-out-backwards-opacity var(--slide-transition),\n slide-fade-out-backwards-move var(--slide-transition);\n }\n }\n }\n\n /*\n * zoom-fade\n */\n &.zoom-fade {\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n }\n\n > .to {\n transform-origin: center;\n opacity: 0;\n // We can omit `transform: scale(1.1);` here because `opacity` is 0.\n // We need to for proper position calculation in `InfiniteScroll`.\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity 0.15s ease;\n }\n\n > .to {\n animation: fade-in-opacity 0.15s ease, zoom-fade-in-move 0.15s ease;\n }\n }\n }\n\n &.zoom-fade.backwards {\n > .from {\n transform: scale(1);\n }\n\n > .to {\n transform: scale(0.95);\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity 0.1s ease, zoom-fade-in-backwards-move 0.15s ease;\n }\n\n > .to {\n animation: fade-out-backwards-opacity 0.15s ease, zoom-fade-out-backwards-move 0.15s ease;\n }\n }\n }\n\n /*\n * fade\n */\n &.fade {\n > .from {\n opacity: 1;\n }\n\n > .to {\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity 0.15s ease;\n }\n\n > .to {\n animation: fade-in-opacity 0.15s ease;\n }\n }\n }\n\n /*\n * slide-layers\n */\n\n &.slide-layers {\n --background-color: var(--color-background);\n background: black;\n\n > div {\n background: var(--background-color);\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-layers-out var(--layer-transition);\n }\n\n > .to {\n animation: slide-in var(--layer-transition);\n }\n }\n }\n\n &.slide-layers.backwards {\n > .to {\n transform: translateX(-20%);\n opacity: 0.75;\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--layer-transition);\n }\n\n > .to {\n animation: slide-layers-out-backwards var(--layer-transition);\n }\n }\n }\n\n /*\n * push-slide\n */\n\n &.push-slide {\n > div {\n background: var(--color-background);\n }\n\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n\n .custom-scroll {\n scrollbar-color: transparent !important;\n\n &::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n }\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: push-out 0.3s ease-in-out;\n }\n\n > .to {\n animation: slide-in-200 0.3s ease-in-out;\n }\n }\n }\n\n &.push-slide.backwards {\n > .to {\n transform: scale(0.7);\n }\n\n &.animating {\n > .from {\n animation: slide-in-200-backwards 0.3s ease-in-out;\n }\n\n > .to {\n animation: push-out-backwards 0.3s ease-in-out;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.reveal {\n > .to {\n clip-path: inset(0 100% 0 0);\n }\n\n &.animating {\n > .to {\n animation: reveal-in 350ms ease-in;\n }\n }\n }\n\n &.reveal.backwards {\n > .from {\n clip-path: inset(0 0 0 0);\n }\n\n > .to {\n clip-path: none;\n }\n\n &.animating {\n > .from {\n animation: reveal-in-backwards 350ms ease-out;\n }\n\n > .to {\n animation: none;\n }\n }\n }\n}\n\n/*\n * common\n */\n@keyframes fade-in-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes fade-out-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-in-backwards-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-out-backwards-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n@keyframes slide-out-backwards {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * mv-slide\n */\n@keyframes mv-slide-in {\n 0% {\n transform: translateX(100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes mv-slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100vw);\n }\n}\n\n@keyframes mv-slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100vw);\n }\n}\n\n@keyframes mv-slide-out-backwards {\n 0% {\n transform: translateX(-100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * slide-fade\n */\n@keyframes slide-fade-in-move {\n 0% {\n transform: translateX(1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-fade-out-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-1.5rem);\n }\n}\n\n@keyframes slide-fade-in-backwards-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(1.5rem);\n }\n}\n\n@keyframes slide-fade-out-backwards-move {\n 0% {\n transform: translateX(-1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * zoom-fade\n */\n@keyframes zoom-fade-in-move {\n 0% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes zoom-fade-in-backwards-move {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(1.1);\n }\n}\n\n@keyframes zoom-fade-out-backwards-move {\n 0% {\n transform: scale(0.95);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n/*\n * slide-layers\n */\n@keyframes slide-layers-out {\n 0% {\n transform: translateX(0);\n opacity: 1;\n }\n 100% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n}\n\n@keyframes slide-layers-out-backwards {\n 0% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n 100% {\n transform: translateX(0);\n opacity: 1;\n }\n}\n\n/*\n * push-slide\n */\n\n@keyframes push-out {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 100% {\n transform: scale(0.7);\n opacity: 0;\n }\n}\n\n@keyframes push-out-backwards {\n 0% {\n transform: scale(0.7);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in-200 {\n 0% {\n transform: translateX(200%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-in-200-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(200%);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in {\n 0% {\n clip-path: inset(0 100% 0 0);\n }\n 100% {\n clip-path: inset(0 0 0 0);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in-backwards {\n 0% {\n clip-path: inset(0 0 0 0);\n }\n 100% {\n clip-path: inset(0 100% 0 0);\n }\n}\n",".ProgressSpinner {\n position: relative;\n z-index: 1;\n width: 3.375rem;\n height: 3.375rem;\n background: rgba(0, 0, 0, 0.25)\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjcxNyA5Ljc1TDE4LjMgMi4xNjdhLjY4NC42ODQgMCAxMC0uOTY3LS45NjdMOS43NSA4Ljc4MyAyLjE2NyAxLjJhLjY4NC42ODQgMCAxMC0uOTY3Ljk2N0w4Ljc4MyA5Ljc1IDEuMiAxNy4zMzNhLjY4NC42ODQgMCAxMC45NjcuOTY3bDcuNTgzLTcuNTgzIDcuNTgzIDcuNTgzYS42ODEuNjgxIDAgMDAuOTY3IDAgLjY4NC42ODQgMCAwMDAtLjk2N0wxMC43MTcgOS43NXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii43NSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==)\n no-repeat 49% 49%;\n border-radius: 50%;\n cursor: pointer;\n\n &.no-cross {\n background: transparent !important;\n pointer-events: none;\n }\n\n &.square {\n background-image: none;\n\n &::after {\n content: \"\";\n position: absolute;\n width: 0.8125rem;\n height: 0.8125rem;\n border-radius: 0.125rem;\n background-color: #fff;\n left: 50%;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n }\n\n &.size-s,\n &.size-m {\n width: auto;\n height: auto;\n /* stylelint-disable-next-line scss/operator-no-unspaced */\n background: transparent\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+)\n no-repeat 49% 49%;\n\n &.square {\n background-image: none;\n width: 0.75rem;\n height: 0.75rem;\n }\n }\n\n &.size-xl {\n width: 3.25rem;\n height: 3.25rem;\n\n svg {\n width: 3rem;\n height: 3rem;\n margin: 0.125rem;\n }\n\n circle {\n stroke-width: 3px;\n }\n }\n\n &.transparent {\n background-color: transparent !important;\n }\n\n svg {\n display: block;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n animation: 4s linear 0s infinite ProgressSpinnerAnimation;\n }\n\n circle {\n transition: stroke-dashoffset 0.5s;\n }\n}\n\n@keyframes ProgressSpinnerAnimation {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",".Avatar {\n --color-user: var(--color-primary);\n flex: none;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n color: white;\n font-weight: bold;\n display: flex;\n white-space: nowrap;\n user-select: none;\n\n img:not(.emoji) {\n border-radius: 50%;\n width: 100%;\n height: 100%;\n }\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n\n i {\n font-size: 2.5rem;\n\n &.icon-reply-filled {\n transform: scale(0.7);\n }\n }\n\n &.size-micro {\n width: 1rem;\n height: 1rem;\n font-size: 0.5rem;\n\n .emoji {\n width: 0.5625rem;\n height: 0.5625rem;\n }\n }\n\n &.size-tiny {\n width: 2rem;\n height: 2rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-small {\n width: 2.125rem;\n height: 2.125rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-medium {\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.1875rem;\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n }\n\n &.size-large {\n font-size: 1.3125rem;\n\n i {\n font-size: 3.5rem;\n }\n\n .emoji {\n width: 1.3125rem;\n height: 1.3125rem;\n }\n }\n\n &.size-jumbo {\n width: 7.5rem;\n height: 7.5rem;\n font-size: 3.5rem;\n\n i {\n font-size: 6rem;\n }\n\n .emoji {\n width: 3.5rem;\n height: 3.5rem;\n }\n }\n\n &.online {\n position: relative;\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n bottom: 0.0625rem;\n right: 0.0625rem;\n width: 0.875rem;\n height: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--color-background);\n background-color: #0ac630;\n flex-shrink: 0;\n }\n }\n\n &.interactive {\n cursor: pointer;\n }\n}\n",".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete,\n &.error,\n &.confirm,\n &.pin,\n &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, 0.25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform 0.2s ease, opacity 0.2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header,\n %modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend %modal-header;\n padding: 0.5rem 1.25rem 0 0.9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n max-height: 90vh;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .modal-about {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .modal-help {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.3;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n",".ListItem {\n position: relative;\n\n body.is-ios &,\n body.is-android & {\n &:not(:last-of-type)::after {\n content: \"\";\n position: absolute;\n bottom: 0;\n left: 4.5rem;\n right: 0;\n /* stylelint-disable-next-line plugin/whole-pixel */\n height: 0.5px;\n background: var(--color-dividers);\n }\n\n &.small-icon::after {\n left: 3.875rem;\n }\n\n &.no-icon::after {\n left: 0;\n }\n }\n\n // Using half-pixel height is efficient on iOS but not supported on Android, so `transform` is used instead\n body.is-android & {\n &:not(:last-of-type)::after {\n height: 0.0625rem;\n transform: scaleY(0.25);\n }\n }\n\n .ListItem-button {\n width: 100%;\n background-color: var(--background-color);\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n border-radius: var(--border-radius-default);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n > i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n }\n\n .user-status,\n .group-status,\n .title,\n .subtitle {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n &.multiline {\n .ListItem-button > i {\n position: relative;\n top: 0.25rem;\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n .ListItem-button {\n opacity: 0.5;\n }\n }\n\n &:not(.disabled):not(.is-static) {\n .ListItem-button {\n cursor: pointer;\n\n body.cursor-ew-resize & {\n cursor: ew-resize !important;\n }\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n --background-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.active {\n --background-color: var(--color-chat-hover);\n }\n }\n }\n }\n\n @media (min-width: 600px) {\n &:not(.has-ripple):not(.is-static),\n body.animation-level-0 & {\n .ListItem-button:active {\n --background-color: var(--color-item-active) !important;\n }\n }\n }\n\n &.has-menu-open .ListItem-button {\n --background-color: var(--color-chat-hover);\n }\n\n &.narrow {\n margin-bottom: 0.75rem;\n\n .ListItem-button {\n padding: 0.5rem 1rem;\n }\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n &.focus {\n --background-color: var(--color-chat-hover);\n }\n\n &.destructive {\n .ListItem-button {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n }\n\n &-context-menu {\n position: absolute;\n\n .bubble {\n width: auto;\n\n .MenuItem button {\n padding-left: 1rem !important;\n padding-right: 2rem !important;\n }\n }\n }\n\n &.chat-item-clickable {\n body.is-ios &,\n body.is-macos & {\n --color-text-secondary: var(--color-text-secondary-apple);\n }\n\n .ListItem-button {\n padding: 0.5625rem;\n }\n\n .Avatar {\n flex-shrink: 0;\n margin-right: 0.5rem;\n }\n\n .info {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title,\n .subtitle {\n overflow: hidden;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n }\n\n h3,\n .last-message,\n .status,\n .typing-status {\n font-size: 1rem;\n line-height: 1.6875rem;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: initial;\n }\n\n .title {\n h3 {\n font-weight: 500;\n }\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n }\n\n .emoji {\n vertical-align: text-bottom;\n background-position: 0 0;\n flex-shrink: 0;\n }\n }\n\n .contact-phone,\n .contact-username {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n }\n\n .ChatInfo {\n display: flex;\n align-items: center;\n flex-grow: 1;\n overflow: hidden;\n\n .status,\n .typing-status {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n display: inline-block;\n\n &.online {\n color: var(--color-primary);\n }\n\n &[dir=\"rtl\"],\n &[dir=\"auto\"] {\n text-align: initial;\n width: 100%;\n }\n\n .group-status:only-child,\n .user-status:only-child {\n display: flow-root;\n }\n }\n }\n\n .contact-phone,\n .contact-username,\n h3,\n .last-message,\n .status,\n .typing-status {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n .last-message,\n .status,\n .typing-status {\n body.is-ios &,\n body.is-macos & {\n font-size: 0.9375rem;\n }\n }\n\n &[dir=\"rtl\"] {\n .ListItem-button {\n padding: 0.5625rem 0.5625rem 0.5625rem 0.6875rem;\n }\n\n .Avatar {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n\n .info > .status {\n width: 100%;\n }\n }\n }\n\n &.search-result-message {\n .title {\n padding-right: 0.125rem;\n }\n\n h3 {\n max-width: 80%;\n }\n\n h3,\n .subtitle {\n font-size: 1rem;\n line-height: 1.5rem;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: left;\n display: block;\n }\n\n .LastMessageMeta {\n margin-left: auto;\n margin-right: 0;\n }\n\n .subtitle {\n color: var(--color-text-secondary);\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #cae3f7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n display: inline-block;\n\n .theme-dark & {\n --color-text: #000;\n }\n }\n }\n\n &[dir=\"rtl\"] {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .subtitle {\n margin-right: 0;\n display: block;\n }\n }\n }\n\n &.picker-list-item {\n margin: 0;\n\n .ListItem-button {\n padding-left: 0;\n display: flex;\n align-items: center;\n }\n\n .Avatar {\n width: 3rem;\n height: 3rem;\n }\n\n .Checkbox {\n flex-shrink: 0;\n height: 1.5rem;\n margin: 0;\n padding-left: 4rem;\n }\n\n &[dir=\"rtl\"] {\n .Checkbox {\n padding-left: 0;\n padding-right: 4rem;\n }\n }\n }\n\n .multiline-item {\n flex-grow: 1;\n white-space: initial;\n overflow: hidden;\n\n .title,\n .subtitle {\n display: block;\n text-align: initial;\n }\n\n .title {\n line-height: 1.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .subtitle {\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: var(--color-text-secondary);\n\n & + .subtitle {\n margin-top: -0.25rem;\n }\n\n &.black {\n color: var(--color-text);\n }\n }\n }\n\n &[dir=\"rtl\"] {\n .ListItem-button > i {\n margin-left: 2rem;\n margin-right: 0;\n }\n }\n}\n",".VerifiedIcon {\n display: inline-block;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n background-image: url('../../assets/icon-verified.svg');\n background-repeat: no-repeat;\n background-size: 100%;\n background-position: center;\n}\n",".DotAnimation {\n display: inline-flex;\n align-items: baseline;\n\n .ellipsis {\n display: flex;\n width: 1rem;\n overflow: hidden;\n\n &::after {\n content: \"...\";\n animation: dot-animation 1s steps(4, start) infinite;\n\n html[lang=\"ar\"] &,\n html[lang=\"fa\"] & {\n animation-name: dot-animation-rtl;\n }\n }\n }\n}\n\n@keyframes dot-animation {\n from {\n transform: translateX(-1rem);\n }\n}\n\n@keyframes dot-animation-rtl {\n from {\n transform: translateX(1rem);\n }\n}\n",".typing-status {\n display: flex;\n align-items: baseline;\n\n .sender-name {\n &::after {\n content: '\\00a0';\n color: var(--color-text-secondary);\n }\n }\n}\n",".Notification-container {\n position: relative;\n width: 24rem;\n max-width: 100vw;\n margin: 0.25rem auto;\n z-index: var(--z-notification);\n\n @media (min-width: 1276px) {\n transition: transform var(--layer-transition);\n }\n\n &:first-of-type {\n margin-top: 4.25rem;\n\n .has-header-tools & {\n margin-top: 7.375rem;\n }\n }\n}\n\n.Notification {\n background: rgba(32, 32, 32, 0.8)\n url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGRkYiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBjeD0iMTIiIGN5PSI2LjUiIHI9IjEuNSIvPjxwYXRoIGQ9Ik0xMiA5LjVjLS41NTIgMC0xIC4zNy0xIC44MjZ2Ny4zNDhjMCAuNDU2LjQ0OC44MjYgMSAuODI2czEtLjM3IDEtLjgyNnYtNy4zNDhjMC0uNDU2LS40NDgtLjgyNi0xLS44MjZ6IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+\")\n no-repeat 0.9375rem 50%;\n background-size: 1.5rem;\n border-radius: var(--border-radius-default);\n padding: 0.9375rem 0.9375rem 0.9375rem 3.375rem;\n color: #fff;\n margin: 0 0.5rem;\n\n .text-entity-link,\n .text-entity-link:hover,\n .text-entity-link:active {\n color: #fff !important;\n text-decoration: underline;\n }\n\n .content {\n line-height: 1.25;\n word-break: break-word;\n font-size: 0.9375rem;\n }\n}\n",".Radio {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.hidden-widget {\n cursor: default;\n .Radio-main {\n &::before,\n &::after {\n visibility: hidden;\n }\n }\n }\n\n > input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Radio-main {\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n width: 1.25rem;\n height: 1.25rem;\n transform: translateY(-50%);\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: 50%;\n background-color: var(--color-background);\n opacity: 1;\n transition: border-color 0.1s ease, opacity 0.1s ease;\n }\n\n &::after {\n left: 1.375rem;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 50%;\n background: var(--color-primary);\n opacity: 0;\n transition: opacity 0.1s ease;\n }\n\n .label {\n display: block;\n word-break: break-word;\n unicode-bidi: plaintext;\n text-align: left;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n }\n }\n\n input:checked ~ .Radio-main {\n &::before {\n border-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &.loading {\n .Radio-main::before,\n .Radio-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0;\n animation: fade-in 0.2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &[dir=\"rtl\"] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n .Radio-main {\n text-align: right;\n\n &::before {\n left: auto;\n right: 1.0625rem;\n }\n\n &::after {\n left: auto;\n right: 1.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n &.loading .Spinner {\n left: auto;\n right: 1.0625rem;\n }\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".ReactionStaticEmoji {\n width: 1rem;\n display: block;\n}\n",".Tab {\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n appearance: none;\n background: none;\n width: auto;\n margin: 0;\n border: none;\n padding: 0.625rem 0.25rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n cursor: pointer;\n border-top-left-radius: var(--border-radius-messages-small);\n border-top-right-radius: var(--border-radius-messages-small);\n\n &,\n &:active,\n &:focus {\n outline: none;\n }\n\n &--active {\n cursor: default;\n color: var(--color-primary);\n\n i {\n opacity: 1 !important;\n }\n }\n\n @media (hover: hover) {\n &:not(&--active):hover {\n background: var(--color-interactive-element-hover);\n }\n }\n\n @media (max-width: 600px) {\n &:not(&--active):active {\n background: var(--color-interactive-element-hover);\n }\n }\n\n > span {\n position: relative;\n display: flex;\n align-items: center;\n white-space: nowrap;\n }\n\n .badge {\n min-width: 1.25rem;\n height: 1.25rem;\n margin-inline-start: 0.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 0.3125rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.3125rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-ios &,\n body.is-macos & {\n line-height: 1.25rem;\n }\n }\n\n &__badge--active {\n background: var(--color-primary) !important;\n }\n\n i {\n position: absolute;\n bottom: calc(-0.625rem - 1px);\n left: 0;\n opacity: 0;\n background-color: var(--color-primary);\n height: 0.1875rem;\n width: 100%;\n border-radius: 0.1875rem 0.1875rem 0 0;\n pointer-events: none;\n box-sizing: content-box;\n transform-origin: left;\n\n &.animate {\n transition: transform var(--slide-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n }\n}\n",".TabList {\n position: sticky;\n top: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n font-size: 0.875rem;\n flex-wrap: nowrap;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background-color: var(--color-background);\n overflow-x: auto;\n overflow-y: hidden;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &.big {\n font-size: 1rem;\n --border-radius-messages-small: 0;\n }\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n // `box-shadow` prevents repaint on macOS when hovering out of scrollable container\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.01);\n }\n}\n",".DeleteChatModal {\n .modal-dialog {\n max-width: 20rem;\n }\n\n .modal-header {\n padding: 1.125rem 1.25rem 0;\n }\n\n .modal-title:not(:only-child) {\n margin: 0 0 0 0.75rem;\n }\n\n .modal-content {\n padding: 0.5rem 1.25rem;\n }\n\n .confirm-dialog-button {\n margin-right: -0.625rem;\n }\n}\n",".SearchInput {\n position: relative;\n width: 100%;\n color: rgba(var(--color-text-secondary-rgb), 0.5);\n background-color: var(--color-chat-hover);\n border: 2px solid var(--color-chat-hover);\n border-radius: 1.375rem;\n transition: border-color 0.15s ease;\n\n &.with-picker-item {\n display: flex;\n\n .icon-search {\n display: none;\n }\n\n input {\n padding-left: 0.5rem;\n }\n\n &[dir=\"rtl\"] {\n input {\n padding-right: 0.5rem;\n padding-left: 0;\n }\n }\n }\n\n &.has-focus {\n border-color: var(--color-primary);\n caret-color: var(--color-primary);\n background-color: var(--color-background);\n\n input {\n & + i {\n color: var(--color-primary);\n }\n }\n }\n\n input {\n height: 2.5rem;\n margin-bottom: 0;\n border: none !important;\n border-radius: 1.375rem;\n background-color: transparent !important;\n box-shadow: none !important;\n padding: calc(0.4375rem - var(--border-width)) calc(2.625rem - var(--border-width))\n calc(0.5rem - var(--border-width)) calc(2.75rem - var(--border-width));\n\n &::placeholder {\n color: var(--color-placeholders);\n }\n }\n\n > i {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n font-size: 1.375rem;\n pointer-events: none;\n }\n\n .Loading {\n position: absolute;\n top: 0;\n right: 0;\n height: 2.5rem;\n width: 2.5rem;\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n }\n\n .Button {\n position: absolute;\n top: 0.125rem;\n right: 0.125rem;\n font-size: 1rem;\n }\n\n @media (max-width: 600px) {\n input {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding-left: calc(2.625rem - var(--border-width));\n }\n\n i {\n top: 0.5rem;\n }\n }\n\n &[dir=\"rtl\"] {\n input {\n direction: rtl;\n }\n\n > i {\n left: auto;\n right: 0.75rem;\n }\n\n .Loading {\n left: 0.5rem;\n right: auto;\n }\n\n .Button {\n left: 0.125rem;\n right: auto;\n }\n }\n}\n",".PickerSelectedItem {\n display: flex;\n align-items: center;\n background: var(--color-chat-hover);\n height: 2rem;\n min-width: 2rem;\n margin-left: 0.5rem;\n margin-bottom: 0.5rem;\n padding-right: 1rem;\n border-radius: 1rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n flex-shrink: 1;\n transition: background-color 0.15s ease;\n\n max-width: calc(50% - 0.5rem);\n\n &.minimized {\n padding-right: 0;\n }\n\n &:hover {\n background-color: var(--color-item-active);\n }\n\n &.closeable:hover {\n background-color: rgba(var(--color-error-rgb), 0.16);\n\n .item-remove {\n opacity: 1;\n }\n\n .Avatar,\n .item-icon {\n opacity: 0;\n }\n }\n\n &.search-date {\n .item-remove {\n background: var(--color-primary);\n }\n\n &:hover {\n background: var(--color-chat-hover);\n }\n\n .item-name {\n font-size: 0.875rem;\n }\n }\n\n .SearchInput & {\n flex: 1 0 auto;\n position: relative;\n top: 0.25rem;\n left: -0.125rem;\n\n color: var(--color-text-secondary);\n }\n\n .Avatar,\n .item-icon {\n width: 2rem;\n height: 2rem;\n opacity: 1;\n flex-shrink: 0;\n transition: opacity 0.15s ease;\n\n i {\n font-size: 2rem;\n }\n }\n\n .item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.375rem;\n border-radius: 50%;\n background-color: var(--color-primary);\n color: white;\n\n i {\n font-size: 1.25rem;\n position: relative;\n top: -1px;\n }\n }\n\n .item-name {\n margin-left: 0.5rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji.emoji-small {\n width: 1.125rem;\n height: 1.125rem;\n background-size: 1.125rem;\n vertical-align: -2px;\n }\n }\n\n .item-remove {\n position: absolute;\n left: 0;\n top: 0;\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--color-error);\n font-size: 1.5rem;\n color: white;\n opacity: 0;\n transition: opacity 0.15s ease;\n }\n\n &[dir=\"rtl\"] {\n padding-left: 1rem;\n padding-right: 0;\n\n &.minimized {\n padding-right: 0;\n padding-left: 0;\n }\n\n .SearchInput & {\n left: auto;\n right: -0.125rem;\n }\n\n .item-name {\n margin-left: 0;\n margin-right: 0.5rem;\n }\n\n .item-remove {\n left: auto;\n right: 0;\n }\n }\n}\n",".Switcher {\n display: inline-flex;\n align-items: center;\n position: relative;\n margin: 0;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n body.animation-level-0 &,\n &.no-animation {\n .widget,\n .widget::after {\n transition: none !important;\n }\n\n .widget:active:after {\n width: 1.125rem;\n }\n }\n\n input {\n height: 0;\n width: 0;\n visibility: hidden;\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .widget {\n cursor: pointer;\n text-indent: -999px;\n width: 2.125rem;\n height: 0.875rem;\n background: var(--color-gray);\n display: inline-block;\n border-radius: 0.5rem;\n position: relative;\n transition: background 0.2s ease-in;\n }\n\n .widget:after {\n content: \"\";\n position: absolute;\n top: -0.125rem;\n left: 0;\n width: 1.125rem;\n height: 1.125rem;\n background: var(--color-background);\n border-radius: 0.75rem;\n transition: 0.2s ease-out;\n border: 0.125rem solid var(--color-gray);\n }\n\n input:checked + .widget {\n background: var(--color-primary);\n }\n\n input:checked + .widget:after {\n left: calc(100% - 1.125rem);\n transform: translateX(calc(-100% + 1.125rem));\n border-color: var(--color-primary);\n }\n\n .widget:active:after {\n width: 1.25rem;\n }\n}\n",".MessageOutgoingStatus {\n width: 1.1875rem;\n height: 1.1875rem;\n overflow: hidden;\n display: inline-block;\n line-height: 1;\n font-size: 1.1875rem;\n\n i {\n background: var(--background-color);\n }\n\n .icon-message-succeeded {\n padding-left: 0.125rem;\n }\n\n .Transition {\n width: 100%;\n height: 100%;\n }\n}\n",".LastMessageMeta {\n margin-right: 0.1875rem;\n padding: 0.3125rem 0 0.125rem;\n flex-shrink: 0;\n font-size: 0.75rem;\n line-height: 1;\n display: flex;\n align-items: center;\n\n .MessageOutgoingStatus {\n color: var(--color-text-meta-colored);\n margin-right: 0.125rem;\n font-size: 1.125rem;\n\n body.is-ios & {\n margin-bottom: -0.125rem;\n }\n }\n\n .time {\n color: var(--color-text-meta);\n line-height: 1.125rem;\n }\n}\n",".Badge-transition {\n opacity: 1;\n transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n &:not(.open) {\n transform: scale(0);\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.closing {\n transition: transform 0.2s ease-out, opacity 0.2s ease-out;\n }\n}\n\n.Badge-wrapper {\n display: flex;\n\n .Badge {\n margin-inline-start: 0.5rem;\n }\n}\n\n.Badge {\n min-width: 1.5rem;\n height: 1.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 0.4375rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5625rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-macos & {\n line-height: 1.5rem;\n }\n\n body.is-ios & {\n line-height: 1.375rem;\n min-width: 1.375rem;\n height: 1.375rem;\n padding: 0 0.375rem;\n }\n\n &.mention,\n &.unread:not(.muted) {\n background: var(--color-green);\n color: var(--color-white);\n }\n\n &.pinned:not(.unread) {\n color: var(--color-pinned);\n background: transparent;\n width: 1.5rem;\n padding: 0;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.mention {\n width: 1.5rem;\n padding: 0.25rem;\n\n i {\n font-size: 1rem;\n vertical-align: super;\n }\n\n body.is-ios & {\n width: 1.375rem;\n padding: 0.25rem;\n\n i {\n font-size: 0.875rem;\n }\n }\n }\n}\n","\n@keyframes bar-animation-transform-1 {\n 0% { transform: scaleY(0.33); }\n 12.5% { transform: scaleY(1.66); }\n 25% { transform: scaleY(0.33); }\n 37.5% { transform: scaleY(1); }\n 50% { transform: scaleY(0.33); }\n 62.5% { transform: scaleY(1.66); }\n 75% { transform: scaleY(0.33); }\n 87.5% { transform: scaleY(1.66); }\n 100% { transform: scaleY(0.33); }\n}\n\n@keyframes bar-animation-transform-2 {\n 0% { transform: scaleY(1); }\n 12.5% { transform: scaleY(0.33); }\n 25% { transform: scaleY(1.66); }\n 37.5% { transform: scaleY(0.33); }\n 50% { transform: scaleY(1); }\n 62.5% { transform: scaleY(0.33); }\n 75% { transform: scaleY(1.66); }\n 87.5% { transform: scaleY(0.33); }\n 100% { transform: scaleY(1); }\n}\n\n\n.ChatCallStatus {\n position: absolute;\n right: 6px;\n bottom: 0;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background-color: #0ac630;\n border: 2px solid var(--color-background);\n overflow: hidden;\n\n .indicator {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n & > div {\n width: 2px;\n height: 6px;\n background: var(--color-background);\n border-radius: 1px;\n margin: 1px;\n will-change: transform;\n transform: translateZ(0);\n }\n & > div:nth-child(odd) {\n transform: scaleY(0.8);\n }\n & > div:nth-child(even) {\n transform: scaleY(1.33);\n }\n }\n\n &.selected {\n background-color: var(--color-white);\n border-color: var(--color-chat-active);\n .indicator div{\n background-color: var(--color-chat-active);\n }\n }\n\n &.active .indicator {\n div:nth-child(odd) {\n animation: bar-animation-transform-2 3.2s normal infinite;\n }\n\n div:nth-child(even) {\n animation: bar-animation-transform-1 3.2s normal infinite;\n }\n }\n\n}\n",".Chat {\n --background-color: var(--color-background);\n\n body.is-ios &,\n body.is-macos & {\n --color-text-meta: var(--color-text-meta-apple);\n }\n\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n width: 100%;\n\n &.animate-opacity {\n will-change: opacity;\n transition: opacity 0.2s ease-out;\n }\n\n &.animate-transform {\n will-change: transform;\n transition: transform 0.2s ease-out;\n }\n\n &:hover,\n &.ListItem.has-menu-open {\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.selected {\n --background-color: var(--color-chat-hover) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n }\n\n @media (min-width: 600px) {\n &.selected,\n &.selected:hover {\n --background-color: var(--color-chat-active) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-active) !important;\n background: var(--color-white);\n }\n\n .ListItem-button {\n --background-color: var(--color-chat-active) !important;\n --color-text: var(--color-white);\n --color-text-meta-colored: var(--color-white);\n --color-text-meta: var(--color-white);\n --color-text-secondary: var(--color-white);\n --color-error: var(--color-white);\n --color-pinned: var(--color-white);\n }\n\n .icon-muted {\n color: var(--color-white) !important;\n }\n\n .Badge:not(.pinned) {\n background: var(--color-white);\n color: var(--color-chat-active);\n }\n }\n }\n\n @media (max-width: 600px) {\n .ListItem-button {\n border-radius: 0 !important;\n }\n }\n\n .status {\n position: relative;\n flex-shrink: 0;\n }\n\n .info {\n .subtitle {\n margin-top: -0.125rem;\n }\n\n h3 {\n width: auto;\n max-width: 80%;\n }\n\n .icon-muted {\n font-size: 1.25rem;\n margin-left: 0.25rem;\n margin-top: -0.0625rem;\n color: #c6c8ca;\n\n body.is-ios & {\n margin-top: 0;\n margin-right: 0.5rem;\n }\n }\n\n .LastMessageMeta {\n margin-left: auto;\n\n body.is-ios & {\n font-size: 0.875rem;\n margin-right: 0;\n }\n }\n\n .last-message,\n .typing-status {\n padding-right: 0.25rem;\n flex-grow: 1;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n\n &[dir=\"ltr\"] {\n text-align: left;\n }\n\n .sender-name {\n color: var(--color-text);\n }\n\n .draft {\n color: var(--color-error);\n }\n }\n\n .last-message {\n .draft {\n &::after {\n content: \": \";\n }\n }\n\n .colon {\n margin-inline-end: 0.25rem;\n }\n\n img {\n width: 1.25rem;\n height: 1.25rem;\n object-fit: cover;\n border-radius: 0.125rem;\n vertical-align: -0.25rem;\n margin-inline-end: 0.25rem;\n\n body.is-ios & {\n width: 1.125rem;\n height: 1.125rem;\n vertical-align: -0.1875rem;\n }\n\n &.round {\n border-radius: 0.625rem;\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n vertical-align: -0.125rem;\n }\n\n .icon-play {\n position: relative;\n display: inline-block;\n font-size: 0.75rem;\n color: #fff;\n margin-inline-start: -1.25rem;\n margin-inline-end: 0.5rem;\n bottom: 0.0625rem;\n\n body.is-ios & {\n margin-inline-start: -1.125rem;\n bottom: 0;\n }\n }\n }\n }\n\n &[dir=\"rtl\"] {\n .info {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .title,\n .subtitle {\n padding-left: 0.125rem;\n padding-right: 0;\n }\n\n .icon-muted {\n margin-left: 0;\n margin-right: 0.25rem;\n }\n\n .last-message,\n .typing-status {\n padding-left: 0.5rem;\n padding-right: 0;\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n}\n",".AnimatedEmoji {\n cursor: pointer;\n margin-bottom: 0.75rem;\n\n img {\n position: absolute;\n width: 100%;\n height: 100%;\n }\n\n &.like-sticker-thumb img {\n transform: scale(0.8);\n }\n}\n",".EmptyFolder {\n width: 100%;\n height: 80%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n @media (max-height: 480px) {\n height: 100%;\n }\n\n .sticker {\n height: 8rem;\n margin-bottom: 1.875rem;\n }\n\n .title {\n font-size: 1.25rem;\n margin-bottom: 0.125rem;\n }\n\n .description {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n\n body.is-ios &,\n body.is-macos & {\n color: var(--color-text-secondary-apple);\n }\n }\n\n .Button.pill {\n margin-top: 0.625rem;\n font-weight: 500;\n padding-inline-start: 0.75rem;\n unicode-bidi: plaintext;\n\n i {\n margin-inline-end: 0.625rem;\n font-size: 1.5rem;\n }\n }\n}\n",".NothingFound {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-meta);\n\n &.with-description {\n flex-direction: column;\n }\n\n .AnimatedSticker {\n margin: 0 auto;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: 0.875rem;\n text-align: center;\n margin: 1rem 0 0;\n unicode-bidi: plaintext;\n }\n}\n",".Media {\n height: 0;\n padding-bottom: 100%;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n\n .video-duration {\n position: absolute;\n left: 0.25rem;\n top: 0.25rem;\n background: rgba(0, 0, 0, 0.25);\n color: #fff;\n font-size: 0.75rem;\n padding: 0 0.3125rem;\n border-radius: 0.1875rem;\n line-height: 1.125rem;\n }\n\n img {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n",".WebLink {\n min-height: 3rem;\n padding: 0.25rem 0 0 3.75rem;\n font-size: 0.875rem;\n line-height: 1.125rem;\n position: relative;\n\n & + & {\n margin-top: 1.5rem;\n }\n\n &.without-media::before {\n content: attr(data-initial);\n width: 3rem;\n height: 3rem;\n position: absolute;\n left: 0;\n top: 0;\n background-color: var(--color-webpage-initial-background);\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--border-radius-messages-small);\n text-transform: uppercase;\n font-weight: 500;\n font-size: 1.5rem;\n }\n\n .Media {\n position: absolute;\n left: 0;\n top: 0;\n width: 3rem;\n height: 3rem;\n cursor: default !important;\n padding-bottom: unset !important;\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n text-align: initial;\n }\n\n .site-name {\n display: block;\n color: var(--color-links);\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .site-title {\n font-size: 1rem;\n font-weight: 400;\n margin-bottom: 0.0625rem;\n line-height: 1.3125rem;\n }\n\n .sender-name,\n .site-description {\n margin-bottom: 0;\n color: var(--color-text-secondary);\n line-height: 1.125rem;\n max-height: 2.25rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .sender-name {\n margin-top: 0.25rem;\n }\n\n .site-description .emoji {\n width: 1rem !important;\n height: 1rem !important;\n }\n\n &[dir=\"rtl\"] {\n padding: 0.25rem 3.75rem 0 0;\n\n .Media,\n &.without-media::before {\n left: auto;\n right: 0;\n }\n\n .content {\n text-align: right;\n }\n }\n}\n",".File {\n --secondary-color: var(--color-text-secondary);\n\n .Message.own & {\n --secondary-color: var(--color-text-green);\n }\n\n .content-inner & {\n min-width: 14rem;\n @media (max-width: 340px) {\n min-width: 11rem;\n }\n }\n\n display: flex;\n align-items: center;\n\n .file-icon-container {\n position: relative;\n }\n\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3.375rem;\n height: 3.375rem;\n margin-inline-end: 0.75rem;\n border-radius: var(--border-radius-messages-small);\n background: var(--color-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .file-progress {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .file-icon {\n padding: 1rem 0.75rem 0.5rem;\n align-items: flex-end;\n flex-shrink: 0;\n position: relative;\n color: white;\n\n .file-ext {\n font-size: 1rem;\n font-weight: 500;\n transition: opacity 0.15s;\n }\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n border-bottom-left-radius: 0.25rem;\n background: rgba(black, 0.25);\n border-color: transparent var(--background-color) transparent var(--background-color);\n border-width: 0 1.125rem 1.125rem 0;\n border-style: solid;\n transition: border-width 0.15s ease-in;\n }\n }\n\n .file-preview {\n background: transparent;\n overflow: hidden;\n\n & + .action-icon,\n & + .file-progress {\n background: rgba(black, 0.5);\n border-radius: var(--border-radius-messages-small);\n }\n\n img {\n object-fit: cover;\n }\n }\n\n .action-icon {\n color: #fff;\n font-size: 1.5rem;\n position: absolute;\n top: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.25s;\n }\n\n &.interactive .file-icon-container {\n cursor: pointer;\n\n &:hover {\n .file-icon::after {\n border-width: 0;\n }\n\n .action-icon {\n opacity: 1;\n\n &.hidden {\n opacity: 0;\n }\n }\n\n .file-ext {\n opacity: 0;\n }\n }\n }\n\n .file-info {\n margin-top: 0.1875rem;\n margin-right: 0.125rem;\n white-space: nowrap;\n overflow: hidden;\n flex-grow: 1;\n\n & + .Link {\n font-size: 0.75rem;\n color: var(--color-text-secondary);\n padding-left: 1rem;\n white-space: nowrap;\n }\n }\n\n .file-title {\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji {\n vertical-align: -4px;\n }\n }\n\n .file-subtitle {\n font-size: 0.875rem;\n line-height: 0.9375rem;\n color: var(--secondary-color);\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n\n span + span {\n &::before {\n content: \"\\00a0\\2022\\00a0\";\n }\n }\n }\n\n &.smaller {\n --background-color: var(--color-background);\n --border-radius-messages-small: 0.3125rem;\n\n .action-icon,\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3rem;\n height: 3rem;\n }\n\n .file-icon {\n padding-bottom: 0.375rem;\n\n &::after {\n border-width: 0 1rem 1rem 0;\n }\n }\n\n .file-info {\n margin-top: -0.125rem;\n }\n\n .file-title {\n font-weight: 400;\n }\n\n .file-subtitle {\n line-height: 1rem;\n }\n }\n\n &:dir(rtl),\n &[dir=\"rtl\"] {\n .file-progress,\n .file-icon,\n .file-preview {\n margin-left: 0.75rem;\n margin-right: 0;\n }\n\n .file-info {\n text-align: right;\n\n & + .Link {\n padding-left: 0;\n padding-right: 1rem;\n }\n }\n\n .action-icon {\n left: auto;\n right: 0;\n }\n }\n}\n\n// Document extension colors\n.File .file-progress,\n.File .file-icon {\n &.red {\n background-color: var(--color-error);\n }\n\n &.orange {\n background-color: var(--color-warning);\n }\n\n &.green {\n background-color: var(--color-text-green);\n }\n}\n",".Audio {\n display: flex;\n align-items: flex-start;\n position: relative;\n\n .media-loading {\n position: absolute;\n pointer-events: none;\n\n &.interactive {\n pointer-events: all;\n }\n }\n\n &.own {\n --color-text-secondary: var(--accent-color);\n --color-interactive-active: var(--color-text-green);\n --color-interactive-inactive: rgba(var(--color-text-green-rgb), 0.4);\n --color-interactive-buffered: rgba(var(--color-text-green-rgb), 0.4); // Overlays underlying inactive color\n\n .theme-dark & {\n --color-text-green-rgb: 255, 255, 255;\n --color-text-green: var(--color-white);\n }\n\n .Button {\n --color-primary: var(--color-text-green);\n --color-primary-shade: var(--color-green);\n --color-primary-shade-darker: var(--color-green-darker);\n --color-white: var(--color-background-own);\n\n .theme-dark & {\n --color-primary-shade: #fff;\n --color-primary-shade-darker: #fff;\n }\n }\n }\n\n .toggle-play {\n margin-inline-end: 0.5rem;\n\n &.translucent-white {\n color: rgba(255, 255, 255, 0.8);\n }\n\n &.smaller {\n width: 3rem;\n height: 3rem;\n margin-inline-end: 0.75rem;\n\n i {\n font-size: 1.625rem;\n\n &.icon-pause {\n font-size: 1.5625rem;\n }\n }\n }\n\n i {\n position: absolute;\n\n &.icon-play {\n margin-left: 0.1875rem;\n @media (max-width: 600px) {\n margin-left: 0.125rem;\n }\n }\n }\n\n .icon-play,\n .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.4s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(0.5);\n }\n }\n\n .download-button {\n position: absolute;\n width: 1.1875rem !important;\n height: 1.1875rem !important;\n padding: 0;\n left: 1.9375rem;\n top: 1.9375rem;\n border: 0.125rem solid var(--background-color);\n z-index: 1;\n\n i {\n font-size: 0.8125rem;\n }\n }\n\n &.bigger .download-button {\n left: 2rem;\n top: 2rem;\n border: 0.125rem solid var(--color-background);\n }\n\n .content {\n align-self: center;\n min-width: 0;\n flex-grow: 1;\n text-align: initial;\n }\n\n .content-row {\n display: flex;\n justify-content: space-between;\n }\n\n .title {\n font-weight: 500;\n margin: 0;\n line-height: 1.25;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n canvas {\n height: 23px;\n }\n\n .voice-duration {\n margin: 0.25rem 0 0;\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n font-variant-numeric: tabular-nums;\n display: flex;\n align-items: flex-end;\n\n &.unread::after {\n content: \"\";\n position: relative;\n margin: 0 0 0.375rem 0.25rem;\n width: 0.4375rem;\n height: 0.4375rem;\n border-radius: 50%;\n background-color: var(--accent-color);\n }\n }\n\n body.is-ios & {\n .voice-duration.unread::after {\n margin-bottom: 0.4375rem;\n }\n }\n\n &:not(.own) .voice-duration span {\n color: var(--color-primary);\n }\n\n .waveform {\n cursor: pointer;\n margin-left: 1px;\n touch-action: none;\n }\n\n .meta,\n .performer,\n .date {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n unicode-bidi: plaintext;\n }\n\n .duration {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n font-variant-numeric: tabular-nums;\n }\n\n .meta {\n display: flex;\n align-items: center;\n margin-top: 0.125rem;\n padding-inline-end: 0.5rem;\n\n & > span {\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .performer {\n flex-shrink: 0;\n }\n\n .duration.with-seekline {\n margin-inline-end: 0.625rem;\n }\n\n .bullet {\n margin: 0 0.25rem;\n flex-shrink: 0;\n }\n }\n\n .seekline {\n flex-grow: 1;\n height: 1.25rem;\n position: relative;\n top: 3px;\n cursor: pointer;\n touch-action: none;\n\n &::before {\n content: \"\";\n position: absolute;\n width: 100%;\n top: 6px;\n height: 2px;\n background-color: var(--color-interactive-inactive);\n border-radius: 2px;\n }\n }\n\n .seekline-buffered-progress,\n .seekline-play-progress {\n position: absolute;\n height: 2px;\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n top: 6px;\n\n i {\n position: absolute;\n width: 100%;\n background-color: var(--color-interactive-active);\n height: 2px;\n border-radius: 2px;\n right: 100%;\n }\n }\n\n .seekline-buffered-progress i {\n background-color: var(--color-interactive-buffered) !important;\n }\n\n .seekline-thumb {\n position: absolute;\n width: 100%;\n top: 7px;\n left: 0;\n\n i {\n pointer-events: none;\n position: absolute;\n width: 100%;\n right: 100%;\n\n &::after {\n content: \"\";\n position: absolute;\n top: -6px;\n right: -6px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n background: var(--color-interactive-active);\n }\n }\n }\n\n &.bigger {\n .title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 400;\n line-height: 1.5rem;\n }\n\n .meta {\n height: 1.25rem;\n }\n\n .performer,\n .date {\n line-height: 1.0625rem;\n }\n\n .duration {\n line-height: 1rem;\n }\n\n .media-loading {\n top: 0.1875rem;\n left: 0.1875rem;\n }\n\n &[dir=\"rtl\"] {\n .media-loading {\n left: auto !important;\n right: 0;\n }\n }\n }\n\n .ProgressSpinner.size-s svg {\n width: 2.25rem;\n height: 2.25rem;\n }\n\n &[dir=\"rtl\"] {\n &:last-child {\n margin-bottom: 0.625rem;\n }\n\n .toggle-play {\n margin-left: 0.5rem;\n margin-right: 0;\n\n &.smaller {\n margin-left: 0.75rem;\n margin-right: 0;\n }\n }\n\n .meta.duration.with-seekline {\n margin-inline-start: 0.625rem;\n }\n\n .content,\n .duration {\n text-align: right;\n }\n\n .download-button {\n left: auto;\n right: 2rem;\n }\n }\n}\n\n.has-replies .Audio[dir=\"rtl\"] {\n margin-bottom: 1.625rem;\n}\n",".ProfilePhoto {\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n img:not(.emoji) {\n width: 100%;\n object-fit: cover;\n }\n\n .prev-avatar-media {\n position: absolute;\n left: 0;\n top: 0;\n z-index: -1;\n }\n\n .spinner-wrapper {\n width: 100%;\n height: 100%;\n }\n\n .spinner-wrapper,\n &.deleted-account,\n &.replies-bot-account,\n &.no-photo,\n &.saved-messages {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-white);\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n cursor: default;\n }\n\n &.no-photo {\n font-size: 14rem;\n }\n\n &.replies-bot-account,\n &.deleted-account,\n &.saved-messages {\n font-size: 20rem;\n }\n}\n",".ProfileInfo {\n aspect-ratio: 1 / 1;\n position: relative;\n\n @supports not (aspect-ratio: 1 / 1) {\n &::before {\n float: left;\n padding-top: 100%;\n content: \"\";\n }\n\n &::after {\n display: block;\n content: \"\";\n clear: both;\n }\n }\n\n .photo-wrapper {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n\n > .Transition {\n width: 100%;\n height: 100%;\n }\n }\n\n .photo-dashes {\n position: absolute;\n width: 100%;\n height: 0.125rem;\n padding: 0 0.375rem;\n z-index: 1;\n\n display: flex;\n top: 0.5rem;\n left: 0;\n }\n\n .photo-dash {\n flex: 1 1 auto;\n background-color: var(--color-white);\n opacity: 0.25;\n border-radius: 0.125rem;\n margin: 0 0.125rem;\n\n &.current {\n opacity: 0.75;\n }\n }\n\n .navigation {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 25%;\n border: none;\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent no-repeat;\n background-size: 1.25rem;\n opacity: 0.25;\n transition: opacity 0.15s;\n outline: none;\n cursor: pointer;\n z-index: 1;\n\n &:hover,\n .is-touch-env & {\n opacity: 1;\n }\n\n &.prev {\n left: 0;\n background-image: url(\"../../assets/media_navigation_previous.svg\");\n background-position: 1.25rem 50%;\n }\n\n &.next {\n right: 0;\n background-image: url(\"../../assets/media_navigation_next.svg\");\n background-position: calc(100% - 1.25rem) 50%;\n }\n }\n\n .info {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n min-height: 100px;\n padding: 0 1.5rem 0.5rem;\n background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);\n color: var(--color-white);\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n pointer-events: none;\n\n &:dir(rtl) {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n\n &[dir=\"rtl\"] {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n\n .title {\n display: flex;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 1.375rem;\n white-space: pre-wrap;\n word-break: break-word;\n margin-bottom: 0.25rem;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-top: -0.125rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n opacity: 0.5;\n }\n\n &[dir=\"rtl\"] {\n .navigation.prev {\n left: auto;\n right: 0;\n transform: scaleX(-1);\n }\n\n .navigation.next {\n left: 0;\n right: auto;\n transform: scaleX(-1);\n }\n }\n\n &.self {\n margin: 0 -0.5rem 0.75rem;\n overflow: hidden;\n\n &.ghost {\n margin: 0;\n }\n\n .prev-avatar-media {\n z-index: 0;\n }\n\n .info {\n padding-bottom: 0.75rem;\n }\n\n .status {\n line-height: 1rem;\n }\n }\n}\n",".DropTarget {\n border-radius: var(--border-radius-default);\n background: var(--color-background);\n padding: 1.25rem;\n flex: 1 1 auto;\n width: 100%;\n max-width: 43.75rem;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 0.3125rem;\n display: flex;\n color: #a4acb3;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n @media (max-height: 350px) {\n padding: 0.75rem;\n }\n\n &.hovered .target-content {\n color: var(--color-primary);\n background-image: var(--drag-target-border-hovered);\n }\n\n & + & {\n margin-top: 0.3125rem;\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .target-content {\n pointer-events: none;\n background-image: var(--drag-target-border);\n border-radius: 0.5rem;\n flex: 1 1 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: 0.2s color, 0.2s background;\n }\n\n .icon {\n font-size: 6.25rem;\n line-height: 4.6875rem;\n margin-bottom: 2.25rem;\n\n @media (max-height: 520px) {\n font-size: 4.25rem;\n line-height: 3.5rem;\n margin-bottom: 1rem;\n }\n\n @media (max-height: 450px) {\n font-size: 2rem;\n line-height: 1rem;\n margin-bottom: 0.5rem;\n margin-top: 0.25rem;\n }\n }\n\n .title {\n font-size: 1.3125rem;\n font-weight: 500;\n letter-spacing: -0.18px;\n\n @media (max-height: 450px) {\n font-size: 1rem;\n }\n }\n\n .description {\n font-size: 1rem;\n letter-spacing: 0.3px;\n\n @media (max-height: 450px) {\n font-size: 0.875rem;\n }\n }\n}\n",".FloatingActionButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(calc(5rem - var(--group-call-header-height, 0rem)));\n transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &.revealed {\n transform: translateY(calc(0rem - var(--group-call-header-height, 0rem)));\n }\n}\n","@import \"../../styles/mixins\";\n\n@mixin thumb-styles() {\n background: var(--slider-color);\n border: none;\n height: 0.75rem;\n width: 0.75rem;\n border-radius: 50%;\n cursor: pointer;\n transform: scale(1);\n transition: transform 0.25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.RangeSlider {\n --slider-color: var(--color-primary);\n\n margin-bottom: 1rem;\n\n &.disabled {\n pointer-events: none;\n --slider-color: var(--color-text-secondary);\n }\n\n .slider-top-row {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.625rem;\n\n .value {\n flex-shrink: 0;\n margin-left: 1rem;\n color: var(--color-text-secondary);\n }\n\n &[dir=\"rtl\"] {\n .value {\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n\n .slider-main {\n position: relative;\n z-index: 1;\n\n &::before {\n content: \"\";\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--color-borders);\n border-radius: 0.125rem;\n opacity: 0.5;\n z-index: -1;\n }\n }\n\n .slider-fill-track {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--slider-color);\n border-radius: 0.125rem;\n pointer-events: none;\n }\n\n // Reset range input browser styles\n @include reset-range();\n\n // Apply custom styles\n input[type=\"range\"] {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n\n .slider-options {\n display: grid;\n grid-template-rows: auto;\n grid-auto-columns: 1fr;\n grid-auto-flow: column;\n }\n\n .slider-option {\n font-size: 0.8125rem;\n text-align: center;\n cursor: pointer;\n color: var(--color-text-secondary);\n transition: color 0.2s ease;\n\n &:hover,\n &.active {\n color: var(--color-text);\n }\n\n &.active {\n font-weight: 500;\n }\n\n &:first-child {\n text-align: left;\n }\n\n &:last-child {\n text-align: right;\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n",".DropArea {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 100vh;\n z-index: var(--z-drop-area);\n padding: 80px 20px 20px;\n\n display: flex;\n flex-direction: column;\n\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n}\n",".StickerButton {\n display: inline-block;\n width: 4rem;\n height: 4rem;\n margin: 0.5rem;\n border-radius: var(--border-radius-messages-small);\n background: transparent no-repeat center;\n background-size: contain;\n transition: background-color 0.15s ease, opacity 0.3s ease !important;\n position: relative;\n\n &.interactive {\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n\n .sticker-unfave-button {\n opacity: 1;\n }\n }\n }\n\n @media (max-width: 600px) {\n margin: 0.25rem;\n }\n\n &.set-button {\n width: 2.75rem !important;\n height: 2.75rem;\n margin: 0 0.5rem;\n }\n\n &.large {\n width: 10rem;\n height: 10rem;\n margin: 0;\n }\n\n .AnimatedSticker,\n img,\n video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n img,\n video {\n object-fit: contain;\n }\n\n .sticker-unfave-button {\n position: absolute;\n top: -0.5rem;\n right: -0.5rem;\n width: 1.25rem;\n height: 1.25rem;\n padding: 0.125rem;\n\n i {\n font-size: 1rem;\n }\n\n opacity: 0;\n }\n}\n",".TextFormatter {\n transform: translate(-50%, -3.25rem);\n\n &,\n &-link-control {\n position: absolute;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0.375rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &-link-control {\n left: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s ease;\n\n .Modal & {\n max-width: 100%;\n }\n\n @media (max-width: 600px) {\n max-width: calc(100vw - var(--text-formatter-left) + 3rem);\n }\n\n input {\n border: none !important;\n outline: none !important;\n width: 100%;\n color: var(--color-text);\n background-color: var(--color-background);\n }\n }\n\n &-buttons,\n &-link-url-confirm {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n }\n\n &-divider {\n width: 1px;\n height: 1.75rem;\n margin: 0 0.25rem;\n background-color: var(--color-borders);\n }\n\n &-link-url-input-wrapper {\n width: 20rem;\n position: relative;\n max-width: 100%;\n\n @media (max-width: 600px) {\n max-width: 90vw;\n }\n\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1rem;\n z-index: 2;\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(to right, var(--color-background) 0.25rem, transparent 1rem);\n }\n\n &::after {\n right: 0;\n background: linear-gradient(to left, var(--color-background) 0.25rem, transparent 1rem);\n }\n\n &.mask-left {\n &::before {\n opacity: 1;\n }\n }\n\n &.mask-right {\n &::after {\n opacity: 1;\n }\n }\n }\n\n &-link-url-confirm {\n flex-shrink: 0;\n opacity: 0;\n transition: opacity 0.3s ease;\n\n &.shown {\n opacity: 1;\n }\n }\n\n &.link-control-shown {\n .TextFormatter-link-control {\n opacity: 1;\n pointer-events: all;\n }\n }\n\n .Button {\n width: 2rem;\n height: 2rem;\n padding: 0.25rem;\n font-size: 1.5rem;\n margin: 0 0.125rem;\n border-radius: var(--border-radius-messages-small);\n flex-shrink: 0;\n cursor: pointer;\n\n &.active {\n background-color: var(--color-primary) !important;\n color: white;\n }\n\n &.disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n }\n}\n",".Picker {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .picker-header {\n padding: 0 1rem 0.25rem 0.75rem;\n border-bottom: 1px solid var(--color-borders);\n display: flex;\n flex-flow: row wrap;\n flex-shrink: 0;\n\n overflow-y: auto;\n max-height: 20rem;\n\n .input-group {\n margin-bottom: 0.5rem;\n margin-left: 0.5rem;\n flex-grow: 1;\n }\n\n .form-control {\n height: 2rem;\n border: none;\n border-radius: 0;\n padding: 0;\n box-shadow: none;\n }\n }\n\n .picker-list {\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n }\n\n .no-results {\n height: 100%;\n margin: 0;\n padding: 1rem 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/347.595121c92ffb31ae37da.js b/dist/347.b7e411d2828cadec556d.js similarity index 99% rename from dist/347.595121c92ffb31ae37da.js rename to dist/347.b7e411d2828cadec556d.js index a34aa4c8..c4d60f8f 100644 --- a/dist/347.595121c92ffb31ae37da.js +++ b/dist/347.b7e411d2828cadec556d.js @@ -1,2 +1,2 @@ "use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[347],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),i=n(6752),s=n(3657),o=n(6202),l=n(692),c=n(5296),d=n(4399),u=n(7799);const m=(0,a.X$)((e=>{var t;let{sticker:n,effect:m,isOwn:h,soundId:v,size:f="medium",observeIntersection:p,lastSyncTime:g,forceLoadPreview:Z,messageId:E,chatId:P,activeEmojiInteractions:y}=e;const{markAnimationLoaded:C,isAnimationLoaded:b,ref:N,width:w,style:k,handleClick:I,playKey:T}=(0,c.Z)(f,P,E,v,y,h,void 0,null==m?void 0:m.emoji),S=`sticker${n.id}`,M=(0,s.Op)(N,p),L=null===(t=n.thumbnail)||void 0===t?void 0:t.dataUri,x=(0,o.Z)(`${S}?size=m`,!M&&!Z,r.IU.BlobUrl,g),$=(0,l.Z)(x),O=(0,o.Z)(S,!M,r.IU.Lottie,g),A=Boolean(O);return a.ZP.createElement("div",{ref:N,className:(0,i.Z)("AnimatedEmoji media-inner",n.id===d.wB&&"like-sticker-thumb"),style:k,onClick:I},!b&&L&&a.ZP.createElement("img",{src:L,alt:""}),!b&&x&&a.ZP.createElement("img",{src:x,className:$,alt:""}),A&&S&&a.ZP.createElement(u.Z,{key:S,id:S,animationData:O,size:w,quality:1,play:M&&T,forceOnHeavyAnimation:!0,noLoop:!0,onLoad:C}))}))},4752:(e,t,n)=>{n.d(t,{Z:()=>L});var a=n(4050),r=n(5116),i=n(6137),s=n(1713),o=n(7361),l=n(790),c=n(8415);function d(e,t,n,a){let{peak:r,fillStyle:i,progressFillStyle:s}=a;const o=4*t.length;e.width=2*o,e.height=46,e.style.width=`${o}px`,e.style.height="23px";const l=e.getContext("2d");l.scale(2,2),t.forEach(((e,a)=>{l.globalAlpha=a/t.length>=n?.5:1,l.fillStyle=n>a/t.length?s:i;const o=Math.max(2,e/Math.max(1,r)*23);!function(e,t,n,a,r,i){2<2*i&&(i=1),r<2*i&&(i=r/2),e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+2,n,t+2,n-r,i),e.arcTo(t+2,n-r,t,n-r,i),e.arcTo(t,n-r,t,n,i),e.arcTo(t,n,t+2,n,i),e.closePath()}(l,4*a,23,0,o,1),l.fill()}))}var u=n(6752),m=n(2340),h=n(5376);function v(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),i=r[t]+(r[t+1]<<8);a[e]=i>>n&31}const i=Math.floor(5*(n-1)/8),s=Math.floor(5*(n-1)%8),o=r[i]+(r[i+1]<<8);return a[n-1]=o>>s&31,a}function f(e,t){let n=0;const a=new Array(t),r=e.length/t,i=e[0],s=e[e.length-1];for(let d=0;d{let{theme:t,message:n,senderTitle:L,uploadProgress:x,origin:$,date:O,lastSyncTime:A,className:F,isSelectable:R,isSelected:D,isDownloading:U,onPlay:B,onReadMedia:X,onCancelUpload:z,onDateClick:V}=e;const{content:{audio:j,voice:Y,video:K},isMediaUnread:H}=n,W=Boolean(Y||K),q=(0,a.sO)(!1),J=(0,a.sO)(!1),_=(0,a.sO)(null),G=(0,P.Z)(),{isRtl:Q}=G,ee=(0,r.uC)(),[te,ne]=(0,a.eJ)(!1),ae=A,re=(0,c.Ti)(n,"pictogram"),ie=(0,C.Z)(re,!1,i.IU.BlobUrl),se=(0,C.Z)((0,c.Ti)(n,"inline"),!ae,(0,c.kG)(n,"inline")),{loadProgress:oe}=(0,p.Z)((0,c.Ti)(n,"download"),!U),le=(0,a.I4)((()=>{ne(!0),B(n.id,n.chatId)}),[n,B]),ce=(0,a.I4)((()=>{ne(!1)}),[]),{isBuffered:de,bufferedProgress:ue,bufferingHandlers:me,checkBuffering:he}=(0,Z.Z)(),{isPlaying:ve,playProgress:fe,playPause:pe,play:ge,pause:Ze,setCurrentTime:Ee,duration:Pe}=(0,E.Z)((0,b.An)(n),(0,c.XV)(n),W?"voice":"audio",se,me,void 0,he,te,le,ce,(0,c.CI)(n)),ye=(0,c.B4)(n),Ce=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=(0,a.sO)(null),{data:s,peak:o}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const a=Math.min(n/10,1),r=Math.round(T+(S-T)*a);return f(v(new Uint8Array(e)),r)}),[t])||{};return(0,a.bt)((()=>{const t=i.current;t&&s&&void 0!==o&&d(t,s,n,{peak:o,fillStyle:r?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:r?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[r,o,n,s,e]),i}(t,Y,H&&!ye?1:fe,ye),be=ve||fe>0&&fe<1;(0,a.d4)((()=>{ne(ve)}),[ve]);const Ne=te&&!de,{isUploading:we,isTransferring:ke,transferProgress:Ie}=(0,c.Sc)(n,x||oe,Ne||U),{shouldRender:Te,transitionClassNames:Se}=(0,g.Z)(ke),Me=Te&&(Ne||we),Le=(0,a.I4)((()=>{we?null==z||z():(ve||B(n.id,n.chatId),(0,r.uC)().setAudioPlayerOrigin({origin:$}),ne(!te),pe())}),[we,ve,te,pe,z,B,n.id,n.chatId,$]);(0,a.d4)((()=>{X&&H&&(ve||U)&&X()}),[ve,H,X,U]);const xe=(0,a.I4)((()=>{U?ee.cancelMessageMediaDownload({message:n}):ee.downloadMessageMedia({message:n})}),[ee,U,n]),$e=(0,a.I4)((e=>{if(q.current&&_.current){const{width:t,left:n}=_.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ee(Math.max(Math.min(Pe*((a-n)/t),Pe-.1),.001))}}),[Pe,Ee]),Oe=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(q.current=!0,J.current=ve,Ze(),$e(e))}),[$e,Ze,ve]),Ae=(0,a.I4)((()=>{q.current=!1,J.current&&ge()}),[ge]),Fe=(0,a.I4)((()=>{V(n.id,n.chatId)}),[V,n.id,n.chatId]);function Re(){if(W)return L||"Voice";const{title:e,fileName:t}=j;return e||t}(0,a.d4)((()=>{if(_.current&&be)return(0,y.sf)(_.current,{onCapture:Oe,onRelease:Ae,onClick:Ae,onDrag:$e})}),[be,Oe,$e,Ae]);const De=(0,u.Z)("Audio",F,ye&&$===s.Cr.Inline&&"own",($===s.Cr.Search||$===s.Cr.SharedMedia)&&"bigger",D&&"audio-is-selected"),Ue=["toggle-play"];Me?Ue.push("loading"):ve?Ue.push("pause"):ve||Ue.push("play");const Be=(0,u.Z)("content",be&&"with-seekline");function Xe(){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:Be},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:Re()},(0,m.Z)(Re())),a.ZP.createElement("div",{className:"message-date"},O&&a.ZP.createElement(I.Z,{className:"date",onClick:Fe},(0,l.VX)(G,1e3*O)))),be&&a.ZP.createElement("div",{className:"meta search-result",dir:Q?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},fe<1&&`${(0,l.k9)(Pe*fe,Pe)}`),M(fe,ue,_)),!be&&function(){if(W)return a.ZP.createElement("div",{className:"meta",dir:Q?"rtl":void 0},(0,l.k9)((Y||K).duration));const{performer:e}=j;return a.ZP.createElement("div",{className:"meta",dir:Q?"rtl":void 0},(0,l.k9)(Pe),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,m.Z)(e)),e&&L&&a.ZP.createElement("span",{className:"bullet"},"•"),L&&a.ZP.createElement("span",{title:L},(0,m.Z)(L)))}()))}return a.ZP.createElement("div",{className:De,dir:G.isRtl?"rtl":"ltr"},R&&a.ZP.createElement("div",{className:"message-select-control"},D&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement(w.Z,{round:!0,ripple:!o.wB,size:"smaller",color:ie?"translucent-white":"primary",className:Ue.join(" "),ariaLabel:ve?"Pause audio":"Play audio",onClick:Le,isRtl:G.isRtl,backgroundImage:ie},a.ZP.createElement("i",{className:"icon-play"}),a.ZP.createElement("i",{className:"icon-pause"})),Te&&a.ZP.createElement("div",{className:(0,u.Z)("media-loading",Se,Me&&"interactive")},a.ZP.createElement(k.Z,{progress:Ie,transparent:!0,size:"m",onClick:Me?Le:void 0,noCross:!Me})),j&&!we&&a.ZP.createElement(w.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:U?"Cancel download":"Download",onClick:xe},a.ZP.createElement("i",{className:U?"icon-close":"icon-arrow-down"})),$===s.Cr.Search&&Xe(),$!==s.Cr.Search&&j&&function(e,t,n,r,i,s,o,c,d,u,v){const{title:f,performer:p,fileName:g}=t,Z=r||i>0&&i<1,{isRtl:E}=N.i0;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:f},(0,m.Z)(f||g)),Z&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,l.k9)(n*i,n)),M(i,s,o)),!Z&&c&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},u?`${(0,h.yW)(t.size*u)} / `:void 0,(0,h.yW)(t.size)),!Z&&!c&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,l.k9)(n)),a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:p},(0,m.Z)(p||"Unknown")),d&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(I.Z,{className:"date",onClick:v},(0,l.ZK)(e,1e3*d,!0)))))}(G,j,Pe,ve,fe,ue,_,U||we,O,Ie,V?Fe:void 0),$===s.Cr.SharedMedia&&(Y||K)&&Xe(),$===s.Cr.Inline&&Y&&function(e,t,n,r,i){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),a.ZP.createElement("p",{className:(0,u.Z)("voice-duration",i&&"unread"),dir:"auto"},0===r?(0,l.k9)(e.duration):(0,l.k9)(e.duration*r)))}(Y,_,Ce,fe,H))}))},180:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),i=n(9066),s=n(8415),o=n(2340),l=n(4319),c=n(6272),d=n(9107),u=n(1876),m=n(3321);const h=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatOrUserId:n}=t;const{lastSyncTime:a,countryList:{phoneCodes:r}}=e,o=n?(0,i.Z1)(e,n):void 0,l=(0,s.YC)(n)?(0,i.dy)(e,n):void 0,c=o&&(0,s.i4)(o,(0,i.dZ)(e),(0,i.NJ)(e));return{lastSyncTime:a,phoneCodeList:r,chat:o,user:l,canInviteUsers:o&&!l&&(!(0,s.eA)(o)&&!(0,s.Mg)(o,"inviteUsers")||(0,s.VE)(o,"inviteUsers")),isMuted:c}}))((e=>{let{lastSyncTime:t,user:n,chat:i,forceShowSelf:h,canInviteUsers:v,isMuted:f,phoneCodeList:p}=e;const{loadFullUser:g,showNotification:Z,updateChatMutedState:E}=(0,r.uC)(),{id:P,fullInfo:y,username:C,phoneNumber:b,isSelf:N}=n||{},{id:w}=i||{},k=(0,d.Z)();(0,a.d4)((()=>{t&&P&&g({userId:P})}),[g,P,t]);const I=(0,a.I4)((()=>{E({chatId:w,isMuted:!f})}),[w,f,E]);if(!i||i.isRestricted||N&&!h)return;function T(e,t){(0,l.TE)(e),Z({message:`${t} was copied`})}const S=b&&(0,c.WZ)(p,b),M=(0,s.hu)(i),L=(null==y?void 0:y.bio)||(0,s.GM)(i);return a.ZP.createElement("div",{className:"ChatExtra"},S&&Boolean(S.length)&&a.ZP.createElement(u.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>T(S,k("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},S),a.ZP.createElement("span",{className:"subtitle"},k("Phone"))),C&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>T(`@${C}`,k("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(C)),a.ZP.createElement("span",{className:"subtitle"},k("Username"))),L&&Boolean(L.length)&&a.ZP.createElement(u.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(L,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},k(P?"UserBio":"Info"))),(v||!C)&&M&&a.ZP.createElement(u.Z,{icon:i.username?"mention":"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>T(M,k("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},M),a.ZP.createElement("span",{className:"subtitle"},k("SetUrlPlaceholder"))),!h&&a.ZP.createElement(u.Z,{icon:"unmute",ripple:!0,onClick:I},a.ZP.createElement("span",null,k("Notifications")),a.ZP.createElement(m.Z,{id:"group-notifications",label:P?"Toggle User Notifications":"Toggle Chat Notifications",checked:!f,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),i=n(9066),s=n(8415),o=n(9107),l=n(2340),c=n(172),d=n(3103),u=n(231);const m=(0,a.X$)((0,r.c$)(((e,t)=>{let{chat:n}=t;const a=(0,s.YC)(n.id),r=(0,i.FM)(e,n.id),o=a&&(0,i.dy)(e,(0,s.zX)(n)),l=o&&(0,s.cS)(o)&&!n.isSupport,c=a&&!r&&!l,d=a?(0,s.Vl)((0,i.dy)(e,(0,s.zX)(n))):void 0;return{isPrivateChat:a,isChatWithSelf:r,isBot:l,isChannel:(0,s.eA)(n),isBasicGroup:(0,s.G9)(n),isSuperGroup:(0,s.ZV)(n),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:d}}))((e=>{let{isOpen:t,chat:n,isChannel:i,isPrivateChat:m,isChatWithSelf:h,isBot:v,isBasicGroup:f,isSuperGroup:p,currentUserId:g,canDeleteForAll:Z,contactName:E,onClose:P,onCloseAnimationEnd:y}=e;const{leaveChannel:C,deleteHistory:b,deleteChannel:N,deleteChatUser:w,blockContact:k}=(0,r.uC)(),I=(0,o.Z)(),T=(0,s.U)(I,n),S=(0,a.I4)((()=>{b({chatId:n.id,shouldDeleteForAll:!0}),P()}),[b,n.id,P]),M=(0,a.I4)((()=>{b({chatId:n.id,shouldDeleteForAll:!0}),k({contactId:n.id,accessHash:n.accessHash}),P()}),[b,n.id,n.accessHash,k,P]),L=(0,a.I4)((()=>{m?b({chatId:n.id,shouldDeleteForAll:!1}):f?(w({chatId:n.id,userId:g}),b({chatId:n.id,shouldDeleteForAll:!1})):!i&&!p||n.isCreator?(i||p)&&n.isCreator&&N({chatId:n.id}):C({chatId:n.id}),P()}),[m,f,i,p,g,n.isCreator,n.id,P,b,w,C,N]);return a.ZP.createElement(d.Z,{isOpen:t,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:I.isRtl?"rtl":void 0},a.ZP.createElement(c.Z,{size:"tiny",chat:n,isSavedMessages:h}),a.ZP.createElement("h3",{className:"modal-title"},I(i&&!n.isCreator?"LeaveChannel":i&&n.isCreator?"ChannelDelete":f||p?"Group.LeaveGroup":"DeleteChatUser"))),onClose:P,onCloseAnimationEnd:y},i&&n.isCreator?a.ZP.createElement("p",null,(0,l.Z)(I("ChatList.DeleteAndLeaveGroupConfirmation",T),["simple_markdown"])):i&&!n.isCreator||f||p?a.ZP.createElement("p",null,(0,l.Z)(I("ChannelLeaveAlertWithName",T),["simple_markdown"])):a.ZP.createElement("p",null,(0,l.Z)(I("ChatList.DeleteChatConfirmation",E),["simple_markdown"])),v&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},I("DeleteAndStop")),Z&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},E?(0,l.Z)(I("ChatList.DeleteForEveryone",E)):I("DeleteForAll")),a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:L},I(i&&!n.isCreator?"LeaveChannel":i&&n.isCreator?"Chat.Input.Delete":f||p?"Group.LeaveGroup":Z?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:P},I("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),i=n(5376),s=n(8415),o=n(3657),l=n(2566),c=n(6202),d=n(706),u=n(7002);const m=(0,a.X$)((e=>{let{message:t,observeIntersection:n,smaller:m,canAutoLoad:h,autoLoadFileMaxSizeMb:v,uploadProgress:f,withDate:p,datetime:g,className:Z,sender:E,isSelected:P,isSelectable:y,onCancelUpload:C,onMediaClick:b,onDateClick:N,isDownloading:w}=e;const k=(0,r.uC)(),I=(0,a.sO)(null),T=t.content.document,{fileName:S,size:M,timestamp:L}=T,x=(0,i.K2)(T)||"",$=(0,o.Op)(I,n),[O,A]=(0,d.Z)();(0,a.d4)((()=>{$&&A()}),[$,A]);const[F,R]=(0,a.eJ)(h&&(!v||M<=1048576*v)),D=Boolean(w||F&&O),U=(0,s.Ti)(t,"download"),{loadProgress:B,mediaData:X}=(0,l.Z)(U,!D,void 0,void 0,void 0,!0),z=Boolean(X),{isUploading:V,isTransferring:j,transferProgress:Y}=(0,s.Sc)(t,f||B,D&&!z),K=(0,i.v6)(T),H=K?(0,s.DH)(t):void 0,W=K?T.previewBlobUrl:void 0,q=(0,c.Z)((0,s.Ti)(t,"pictogram"),!$),J=b&&Boolean(T.mediaType),_=(0,a.I4)((()=>{V?C&&C():w?k.cancelMessageMediaDownload({message:t}):j?R(!1):J?b():k.downloadMessageMedia({message:t})}),[V,w,j,J,C,k,t,b]),G=(0,a.I4)((()=>{N(t.id,t.chatId)}),[N,t.id,t.chatId]);return a.ZP.createElement(u.Z,{ref:I,name:S,extension:x,size:M,timestamp:p?g||L:void 0,thumbnailDataUri:H,previewData:W||q,smaller:m,isTransferring:j,isUploading:V,transferProgress:Y,className:Z,sender:E,isSelectable:y,isSelected:P,actionIcon:J?(0,s.hC)(t)?"icon-play":"icon-eye":"icon-download",onClick:_,onDateClick:N?G:void 0})}))},8780:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9107),i=n(6752);const s=e=>{let{content:t,className:n}=e;const s=(0,r.Z)();return a.ZP.createElement("span",{className:(0,i.Z)("DotAnimation",n),dir:s.isRtl?"rtl":"auto"},t,a.ZP.createElement("span",{className:"ellipsis"}))}},7002:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(1212),i=n(692),s=n(6752),o=n(790),l=n(5376),c=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const v=(0,a.X$)((e=>{let{ref:t,name:n,size:v,extension:f="",timestamp:p,sender:g,thumbnailDataUri:Z,previewData:E,className:P,smaller:y,isTransferring:C,isUploading:b,isSelectable:N,isSelected:w,transferProgress:k,actionIcon:I,onClick:T,onDateClick:S}=e;const M=(0,u.Z)();let L=(0,a.sO)(null);t&&(L=t);const x=(0,i.Z)(E),{shouldRender:$,transitionClassNames:O}=(0,r.Z)(C,void 0,!0),A=(0,l.Oh)(f),F=(0,l.yW)(v),{width:R,height:D}=(0,c.lE)(y),U=(0,s.Z)("File",P,y&&"smaller",T&&!b&&"interactive",w&&"file-is-selected");return a.ZP.createElement("div",{ref:L,className:U,dir:M.isRtl?"rtl":void 0},N&&a.ZP.createElement("div",{className:"message-select-control"},w&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:b?void 0:T},Z||E?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:Z,width:R,height:D,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:E,className:(0,s.Z)("full-media",x),width:R,height:D,alt:""})):a.ZP.createElement("div",{className:`file-icon ${A}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),$&&a.ZP.createElement("div",{className:(0,s.Z)("file-progress",A,O)},a.ZP.createElement(m.Z,{progress:k,size:y?"s":"m",onClick:b?T:void 0})),T&&a.ZP.createElement("i",{className:(0,s.Z)("action-icon",I||"icon-download",$&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(n)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,C&&k?`${Math.round(100*k)}%`:F),g&&a.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(g)),!g&&p&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(h.Z,{onClick:S},(0,o.ZK)(M,1e3*p,!0))))),g&&p&&a.ZP.createElement(h.Z,{onClick:S},(0,o.VX)(M,1e3*p)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(5116),i=n(1713),s=n(8415),o=n(9066),l=n(2340),c=n(9107),d=n(172),u=n(9411),m=n(8729),h=n(8780);const v=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatId:n}=t;const{lastSyncTime:a}=e,r=(0,o.Z1)(e,n);return{lastSyncTime:a,chat:r,onlineCount:r?(0,o.YK)(e,r):void 0,areMessagesLoaded:Boolean((0,o.Zw)(e,n))}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:o,withDots:v,withMediaViewer:f,withUsername:p,withFullInfo:g,withUpdatingStatus:Z,withChatType:E,noRtl:P,chat:y,onlineCount:C,areMessagesLoaded:b,lastSyncTime:N}=e;const{loadFullChat:w,openMediaViewer:k}=(0,r.uC)(),I=y&&(0,s.ZV)(y),{id:T,isMin:S,isRestricted:M}=y||{};(0,a.d4)((()=>{T&&!S&&g&&N&&w({chatId:T})}),[T,S,N,g,w,I]);const L=(0,a.I4)(((e,t)=>{y&&t&&(e.stopPropagation(),k({avatarOwnerId:y.id,origin:"jumbo"===n?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))}),[y,n,k]),x=(0,c.Z)();if(y)return a.ZP.createElement("div",{className:"ChatInfo",dir:!P&&x.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:y.id,size:n,chat:y,onClick:f?L:void 0}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,l.Z)((0,s.U)(x,y))),y.isVerified&&a.ZP.createElement(u.Z,null)),function(){if(o)return v?a.ZP.createElement(h.Z,{className:"status",content:o}):a.ZP.createElement("span",{className:"status",dir:"auto"},o);if(Z&&!b&&!M)return a.ZP.createElement(h.Z,{className:"status",content:x("Updating")});if(!y)return;if(t)return a.ZP.createElement(m.Z,{typingStatus:t});if(E)return a.ZP.createElement("span",{className:"status",dir:"auto"},x((0,s.l6)(y)));const e=p?y.username:void 0,n=function(e,t){const n=e((0,s.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(x,y),r=C?`, ${x("OnlineCount",C,"i")}`:void 0;return a.ZP.createElement("span",{className:"status"},e&&a.ZP.createElement("span",{className:"handle"},e),a.ZP.createElement("span",{className:"group-status"},n),r&&a.ZP.createElement("span",{className:"online-status"},r))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(790),i=n(9107),s=n(8018);const o=(0,a.X$)((e=>{let{message:t,outgoingStatus:n}=e;const o=(0,i.Z)();return a.ZP.createElement("div",{className:"LastMessageMeta"},n&&a.ZP.createElement(s.Z,{status:n}),a.ZP.createElement("span",{className:"time"},(0,r.VX)(o,1e3*t.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(790),i=n(3227),s=n(8415),o=n(6752),l=n(6202),c=n(692),d=n(3657);const u=(0,a.X$)((e=>{let{message:t,idPrefix:n="shared-media",isProtected:u,observeIntersection:m,onClick:h}=e;const v=(0,a.sO)(null),f=(0,d.Op)(v,m),p=(0,s.DH)(t),g=(0,l.Z)((0,s.Ti)(t,"pictogram"),!f),Z=(0,c.Z)(g),E=(0,s.b7)(t),P=(0,a.I4)((()=>{h(t.id,t.chatId)}),[t.id,t.chatId,h]);return a.ZP.createElement("div",{ref:v,id:`${n}${t.id}`,className:"Media scroll-item",onClick:h?P:void 0},a.ZP.createElement("img",{src:p,alt:"",draggable:!u,decoding:"async",onContextMenu:u?i.Z:void 0}),a.ZP.createElement("img",{src:g,className:(0,o.Z)("full-media",Z),alt:"",draggable:!u,decoding:"async",onContextMenu:u?i.Z:void 0}),E&&a.ZP.createElement("span",{className:"video-duration"},E.isGif?"GIF":(0,r.k9)(E.duration)),u&&a.ZP.createElement("span",{className:"protector"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>s});var a,r=n(4050),i=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));const s=(0,r.X$)((e=>{let{status:t}=e;return r.ZP.createElement("div",{className:"MessageOutgoingStatus"},r.ZP.createElement(i.Z,{name:"reveal",activeKey:a[t]},r.ZP.createElement("i",{className:`icon-message-${t}`})))}))},7262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6752),i=n(1212),s=n(2340),o=n(9107);const l="Nothing found.",c=(0,a.X$)((e=>{let{text:t=l,description:n}=e;const c=(0,o.Z)(),{transitionClassNames:d}=(0,i.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",d,n&&"with-description")},t,n&&a.ZP.createElement("p",{className:"description"},(0,s.Z)(c(n),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(8415),i=n(1273),s=n(4605),o=n(7687),l=n(1876),c=n(6058),d=n(8799),u=n(9187),m=n(7407),h=n(9107),v=n(4288);const f=(0,a.X$)((e=>{let{itemIds:t,selectedIds:n,filterValue:f,filterPlaceholder:p,notFoundText:g,searchInputId:Z,isLoading:E,noScrollRestore:P,onSelectedIdsChange:y,onFilterChange:C,onLoadMore:b}=e;const N=(0,a.sO)(null),w=n.length>10;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{N.current.focus()}))}),500)}),[]);const k=(0,a.I4)((e=>{const t=[...n];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),y(t),C("")}),[n,y,C]),I=(0,a.I4)((e=>{const{value:t}=e.currentTarget;C(t)}),[C]),[T,S]=(0,m.Z)(b,t,Boolean(f)),M=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:M.isRtl?"rtl":void 0},n.map(((e,t)=>a.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:w&&ta.ZP.createElement(l.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>k(e),ripple:!0},a.ZP.createElement(s.Z,{label:"",checked:n.includes(e)}),(0,r.YC)(e)?a.ZP.createElement(c.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):E||!T||T.length?a.ZP.createElement(v.Z,null):a.ZP.createElement("p",{className:"no-results"},g||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(5116),i=n(9066),s=n(8415),o=n(2340),l=n(6752),c=n(9107),d=n(172);const u=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatOrUserId:n}=t;return n?{chat:n?(0,i.Z1)(e,n):void 0,user:(0,s.YC)(n)?(0,i.dy)(e,n):void 0}:{}}))((e=>{let{icon:t,title:n,isMinimized:r,canClose:i,onClick:u,clickArg:m,chat:h,user:v,className:f}=e;const p=(0,c.Z)();let g,Z;if(t&&n)g=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${t}`})),Z=n;else if(h||v){g=a.ZP.createElement(d.Z,{chat:h,user:v,size:"small",isSavedMessages:null==v?void 0:v.isSelf});const e=!h||v&&!v.isSelf?(0,s.Vl)(v):(0,s.U)(p,h,v);Z=e?(0,o.Z)(e):void 0}const E=(0,l.Z)("PickerSelectedItem",f,r&&"minimized",i&&"closeable");return a.ZP.createElement("div",{className:E,onClick:()=>u(m),title:r?Z:void 0,dir:p.isRtl?"rtl":void 0},g,!r&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},Z),i&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(5116),i=n(1713),s=n(9066),o=n(8415),l=n(2340),c=n(9107),d=n(172),u=n(9411),m=n(8729),h=n(8780);const v=(0,a.X$)((0,r.c$)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{lastSyncTime:r,serverTimeOffset:i}=e,o=(0,s.dy)(e,n);return{lastSyncTime:r,user:o,userStatus:(0,s.ss)(e,n),isSavedMessages:!a&&o&&o.isSelf,areMessagesLoaded:Boolean((0,s.Zw)(e,n)),serverTimeOffset:i}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:s,withDots:v,withMediaViewer:f,withUsername:p,withFullInfo:g,withUpdatingStatus:Z,noStatusOrTyping:E,noRtl:P,user:y,userStatus:C,isSavedMessages:b,areMessagesLoaded:N,lastSyncTime:w,serverTimeOffset:k}=e;const{loadFullUser:I,openMediaViewer:T}=(0,r.uC)(),{id:S}=y||{},M=(0,o.Js)(y);(0,a.d4)((()=>{g&&w&&S&&I({userId:S})}),[S,I,w,g]);const L=(0,a.I4)(((e,t)=>{y&&t&&(e.stopPropagation(),T({avatarOwnerId:y.id,origin:"jumbo"===n?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))}),[y,n,T]),x=(0,c.Z)();if(y)return a.ZP.createElement("div",{className:"ChatInfo",dir:!P&&x.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:y.id,size:n,user:y,isSavedMessages:b,onClick:f?L:void 0}),a.ZP.createElement("div",{className:"info"},b?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,x("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},M&&(0,l.Z)(M)),(null==y?void 0:y.isVerified)&&a.ZP.createElement(u.Z,null)),(s||!b&&!E)&&(s?v?a.ZP.createElement(h.Z,{className:"status",content:s}):a.ZP.createElement("span",{className:"status",dir:"auto"},s):Z&&!N?a.ZP.createElement(h.Z,{className:"status",content:x("Updating")}):y?t?a.ZP.createElement(m.Z,{typingStatus:t}):a.ZP.createElement("span",{className:"status "+((0,o.kM)(y,C)?"online":"")},p&&y.username&&a.ZP.createElement("span",{className:"handle"},y.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,o.Tq)(x,y,C,k))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>b});var a=n(4050),r=n(5116),i=n(1713),s=n(7361),o=n(9066),l=n(8415),c=n(2340),d=n(1174),u=n(6752),m=n(6137),h=n(647),v=n(9107),f=n(9411),p=n(2155),g=n(6202),Z=n(2937),E=n(7204),P=n(9204);const y=(0,a.X$)((e=>{let{chat:t,user:n,photo:r,isFirstPhoto:i,isSavedMessages:s,lastSyncTime:o,onClick:d}=e;const h=(0,v.Z)(),f=n&&(0,l.NB)(n),y=t&&(0,l.pK)(t.id);function C(e,a){if(r&&!a)return`photo${r.id}?size=c`;let i;return s||f||y||(n?i=(0,l.RT)(n,e):t&&(i=(0,l.RT)(t,e))),i}const b=(0,g.Z)(C("big"),!1,m.IU.BlobUrl,o),N=i&&!b?C("normal",!0):void 0,w=(0,g.Z)(N,!1,m.IU.BlobUrl,o),k=(0,Z.Z)(!b&&r&&r.thumbnail&&r.thumbnail.dataUri),I=b||w||k,T=(0,E.Z)(I);let S="";if(s)S=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(f)S=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(y)S=a.ZP.createElement("i",{className:"icon-reply-filled"});else if(I)S=a.ZP.createElement("img",{src:I,className:"avatar-media",alt:"",decoding:"async"});else if(!I&&n){const e=(0,l.Js)(n);S=e?(0,p.Xv)(e,2):void 0}else if(!I&&t){const e=(0,l.U)(h,t);S=e&&(0,p.Xv)(e,(0,l.YC)(t.id)?2:1)}else S=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(P.Z,{color:"white"}));const M=(0,u.Z)("ProfilePhoto",`color-bg-${(0,l.Rs)(n||t)}`,s&&"saved-messages",f&&"deleted-account",y&&"replies-bot-account",!s&&!I&&"no-photo");return a.ZP.createElement("div",{className:M,onClick:I?d:void 0},T&&I&&T!==I&&a.ZP.createElement("img",{src:T,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof S?(0,c.Z)(S,["hq_emoji"]):S)}));var C=n(2255);const b=(0,a.X$)((0,r.c$)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{connectionState:r,serverTimeOffset:i}=e,s=(0,o.dy)(e,n),l=(0,o.ss)(e,n),c=(0,o.Z1)(e,n),d=!a&&s&&s.isSelf,{animationLevel:u}=e.settings.byKey;return{connectionState:r,user:s,userStatus:l,chat:c,isSavedMessages:d,animationLevel:u,serverTimeOffset:i}}))((e=>{var t;let{forceShowSelf:n,user:o,userStatus:p,chat:g,isSavedMessages:Z,connectionState:E,animationLevel:P,serverTimeOffset:b}=e;const{loadFullUser:N,openMediaViewer:w}=(0,r.uC)(),k=(0,v.Z)(),{id:I}=o||{},{id:T}=g||{},S=o?(0,l.Js)(o):g?g.title:"",M=(null==o?void 0:o.photos)||(null==g?void 0:g.photos)||[],L=P>=1?k.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[x,$]=(0,a.eJ)(0),O=Z||M.length<=1||0===x,A=Z||M.length<=1||x===M.length-1;(0,a.d4)((()=>{x>M.length&&$(Math.max(0,M.length-1))}),[x,M.length]),(0,a.d4)((()=>{"connectionStateReady"===E&&I&&!n&&N({userId:I})}),[I,N,E,n]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{h.UV(`photo${e.id}?size=c`)||h.he(`photo${e.id}?size=c`,m.IU.BlobUrl)}))}),[n,t])}(0,M,x);const F=(0,a.I4)((()=>{w({avatarOwnerId:I||T,profilePhotoIndex:x,origin:n?i.bZ.SettingsAvatar:i.bZ.ProfileAvatar})}),[w,I,T,x,n]),R=(0,a.I4)((()=>{O||$(x-1)}),[x,O]),D=(0,a.I4)((()=>{A||$(x+1)}),[x,A]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,d.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:s.$b?(e,t)=>t===d.eM.Right?(R(),!0):t===d.eM.Left&&(D(),!0):void 0})}),[D,R]),!o&&!g)return;const U=null===(t=o||g)||void 0===t?void 0:t.isVerified;return a.ZP.createElement("div",{className:(0,u.Z)("ProfileInfo",n&&"self"),dir:k.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(Z||!M||M.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},M.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===x?"current":"")}))))}(),a.ZP.createElement(C.Z,{activeKey:x,name:L,className:"profile-slide-container"},function(){const e=!Z&&M&&M.length>0?M[x]:void 0;return a.ZP.createElement(y,{key:x,user:o,chat:g,photo:e,isSavedMessages:Z,isFirstPhoto:O,onClick:F})}()),!O&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":k("AccDescrPrevious"),onClick:R}),!A&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":k("Next"),onClick:D})),a.ZP.createElement("div",{className:"info",dir:k.isRtl?"rtl":"auto"},Z?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},k("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},S&&(0,c.Z)(S)),U&&a.ZP.createElement(f.Z,null)),!Z&&(o?a.ZP.createElement("div",{className:"status "+((0,l.kM)(o,p)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,l.Tq)(k,o,p,b))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,l.eA)(g)?k("Subscribers",null!==(B=g.membersCount)&&void 0!==B?B:0,"i"):k("Members",null!==(X=g.membersCount)&&void 0!==X?X:0,"i")))));var B,X})))},8198:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(5116),i=n(6137),s=n(6202),o=n(6752);const l=(0,a.X$)((e=>{var t,n,l;let{reaction:c,ref:d,className:u}=e;const m=null===(t=(0,r.Rd)().availableReactions)||void 0===t||null===(n=t.find((e=>e.reaction===c)))||void 0===n||null===(l=n.staticIcon)||void 0===l?void 0:l.id,h=(0,s.Z)(`document${m}`,!m,i.IU.BlobUrl);return a.ZP.createElement("img",{className:(0,o.Z)("ReactionStaticEmoji",u),ref:d,src:h,alt:""})}))},3547:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(6137),i=n(3657),s=n(6202),o=n(1212),l=n(706),c=n(6752),d=n(386),u=n(4753),m=n(7361),h=n(7799),v=n(231);const f=(0,a.X$)((e=>{let{sticker:t,size:n,observeIntersection:f,noAnimate:p,title:g,className:Z,onClick:E,clickArg:P,onUnfaveClick:y}=e;const C=(0,a.sO)(null),b=`sticker${t.id}`,N=`sticker-button-${t.id}`,w=(0,i.Op)(C,f),k=t.thumbnail?t.thumbnail.dataUri:void 0,I=(0,s.Z)(`${b}?size=m`,!w,r.IU.BlobUrl),T=w&&!p,S=(0,s.Z)(t.isLottie&&b,!T,r.IU.Lottie),[M,L,x]=(0,l.Z)(Boolean(S)),$=M&&T,O=t.isGif&&m.Hh,A=(0,s.Z)(O&&b,!T,r.IU.BlobUrl),F=Boolean(O&&A&&T),{transitionClassNames:R}=(0,o.Z)(Boolean(I||$),void 0,void 0,"slow");(0,a.d4)((()=>{T||x()}),[x,T]),(0,a.d4)((()=>{if(!O||!C.current)return;const e=C.current.querySelector("video");e&&(F?(0,u.Z)(e):e.pause())}),[O,F]);const D=(0,c.Z)("StickerButton",E&&"interactive",N,Z),U=!k||$||F?"":`background-image: url('${k}');`;return a.ZP.createElement("div",{ref:C,className:D,title:g||(null==t?void 0:t.emoji),style:U,"data-sticker-id":t.id,onMouseDown:d.b,onClick:function(){E&&E(P)}},!$&&!F&&a.ZP.createElement("img",{src:I,className:R}),O&&a.ZP.createElement("video",{className:R,src:A,autoPlay:F,loop:!0,playsInline:!0,muted:!0}),T&&S&&a.ZP.createElement(h.Z,{id:b,animationData:S,play:!0,size:n,isLowPriority:!0,onLoad:L}),y&&a.ZP.createElement(v.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(e){e.stopPropagation(),e.preventDefault(),y(t)}},a.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9203),i=n(8778);const s=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,i.Z)(r.gl.Extra,"StickerSetModal",!t);return n?a.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(5116),i=n(9066),s=n(8415),o=n(2340),l=n(9107),c=n(8780);const d=(0,a.X$)((0,r.c$)(((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,i.dy)(e,n.userId)}:{}}))((e=>{let{typingStatus:t,typingUser:n}=e;const r=(0,l.Z)(),i=n&&!n.isSelf&&(0,s.Vl)(n),d=r(t.action).replace("{user}","").replace("{emoji}",t.emoji).trim();return a.ZP.createElement("p",{className:"typing-status",dir:r.isRtl?"rtl":"auto"},i&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,o.Z)(i)),a.ZP.createElement(c.Z,{content:d}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=()=>a.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(8415),i=n(6752),s=n(8035),o=n(2340),l=n(790),c=n(9107),d=n(996),u=n(3709),m=n(8033),h=n(88);const v=(0,a.X$)((e=>{let{message:t,senderTitle:n,isProtected:v,observeIntersection:f,onMessageClick:p}=e;const g=(0,c.Z)();let Z=(0,r.s1)(t);if(!Z){const e=(0,r.T7)(t);if(e){const{url:n,domain:a}=e;Z={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,r.UD)(t)!==n?(0,d.e)(g,t,void 0,void 0,170):void 0}}}const E=(0,a.I4)((()=>{p(t.id,t.chatId)}),[p,t.id,t.chatId]);if(!Z)return;const{siteName:P,url:y,displayUrl:C,title:b,description:N,formattedDescription:w,photo:k,video:I}=Z,T=!n&&N&&(0,s.Z)(N,170),S=(0,i.Z)("WebLink scroll-item",!k&&!I&&"without-media");return a.ZP.createElement("div",{className:S,"data-initial":(P||C)[0],dir:g.isRtl?"rtl":void 0},k&&a.ZP.createElement(u.Z,{message:t,isProtected:v,observeIntersection:f}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(m.Z,{isRtl:g.isRtl,className:"site-title",onClick:E},(0,o.Z)(b||P||C)),(T||w)&&a.ZP.createElement(m.Z,{isRtl:g.isRtl,className:"site-description",onClick:E},w||T&&(0,o.Z)(T)),a.ZP.createElement(h.Z,{url:y,className:"site-name",text:"",isRtl:g.isRtl},y.replace("mailto:","")||C),n&&a.ZP.createElement("div",{className:"sender-name"},(0,o.Z)(n))),n&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(m.Z,{className:"date",onClick:E,isRtl:g.isRtl},(0,l.VX)(g,1e3*t.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>o,Gw:()=>l,Rj:()=>c,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>Z,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>N,jg:()=>w});var a=n(3716),r=n(7361),i=n(3858),s=n(8415);const o="(max-height: 640px)",l=parseInt(getComputedStyle(document.documentElement).fontSize,10),c=240,d={width:640,height:640},u="4986041492570112461",m={width:100,height:100};let h,v,f;function p(e,t,n,a){const s=t||n?1.625:0,o=function(e,t){const n=e?30:29;if(!r.wB)return n;const{width:a}=i.Z.get();return h||(h=Math.min(30,a/l-4.5)),v||(v=Math.min(29,a/l-7)),f||(f=Math.min(29,a/l-4.5)),e?h:t?f:v}(e,a)-s;return o*l}function g(e){let{width:t,height:n,fromOwnMessage:a,isForwarded:r,isWebPagePhoto:i,isGif:s,noAvatars:o}=e;const c=n/t,d=p(a,r,i,o),u=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*l:27*l}(s,c),m=s?Math.max(300,t):t;return w(d,u,m,s?n*(m/t):n)}function Z(e,t){const n=window.matchMedia(o),{width:a,height:s}=i.Z.get();let c=t&&n.matches?10:8.25;return e&&!r.$b&&(c=n.matches?10:12.5),{width:a,height:s-c*l}}function E(e,t,n,a,r){const{width:i,height:o}=(0,s.HV)(e)||m;return g({width:i,height:o,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function P(e,t,n,a){const{width:r,height:i}=(0,s.jC)(e)||m;return g({width:r,height:i,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function y(){return{width:2*l,height:2*l}}function C(e){return e?{width:3*l,height:3*l}:{width:3.375*l,height:3.375*l}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const i=n&&t&&n/t,s=l*(r.wB?a.w7:a.K7),o=i?s*i:s;return i&&o>s?{width:Math.round(s/i),height:s}:{width:s,height:o}}function N(e,t){let{width:n,height:a}=e,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{width:i,height:s}=Z(t,r);return w(i,s,n,a)}function w(e,t,n,a){const r=a/n,i=Math.min(n,e);return Math.round(i*r)>t?{width:Math.round(t/r),height:t}:{width:i,height:Math.round(i*r)}}},5296:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(4753),i=n(5116),s=n(6202),o=n(706),l=n(9066);const c={large:160,medium:128,small:104};function d(e,t,n,d,u,m,h,v){const{interactWithAnimatedEmoji:f,sendEmojiInteraction:p,sendWatchingEmojiInteraction:g}=(0,i.uC)(),Z=h||v,[E,P]=(0,o.Z)(),y=(0,a.sO)(null),C=(0,a.sO)(null),b=(0,s.Z)(d?`document${d}`:void 0,!d),N=c[e],w=`width: ${N}px; height: ${N}px;`,[k,I]=(0,a.eJ)(String(Math.random())),T=(0,a.sO)(void 0),S=(0,a.sO)(void 0),M=(0,a.I4)((()=>{y.current&&(p({chatId:t,messageId:n,localEffect:h,emoji:v,interactions:T.current}),S.current=void 0,T.current=void 0)}),[p,t,n,h,v]),L=(0,a.I4)((()=>{I(String(Math.random()));const e=C.current;b&&(e&&(e.pause(),e.remove()),C.current=new Audio,C.current.src=b,(0,r.Z)(C.current),C.current.addEventListener("ended",(()=>{C.current=void 0}),{once:!0}))}),[b]),x=(0,a.I4)((()=>{L();const e=y.current;if(!(Z&&e&&n&&t))return;const{x:a,y:r}=e.getBoundingClientRect();f({localEffect:h,emoji:v,x:a,y:r,startSize:N,isReversed:!m}),T.current||(T.current=[],S.current=performance.now(),setTimeout(M,1e3)),T.current.push(S.current?(performance.now()-S.current)/1e3:0)}),[t,v,Z,f,m,h,n,L,M,N]);return(0,a.d4)((()=>{const e=y.current;e&&u&&u.forEach((a=>{let{id:r,startSize:i,messageId:s}=a;if(i||n!==s)return;const{x:o,y:c}=e.getBoundingClientRect();g({id:r,chatId:t,emoticon:h?(0,l.ji)(h):v,startSize:N,x:o,y:c,isReversed:!m}),L()}))}),[u,t,v,m,h,n,L,g,N]),{playKey:k,ref:y,style:w,width:N,handleClick:x,markAnimationLoaded:P,isAnimationLoaded:E}}},742:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9203),i=n(8778);const s=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,i.Z)(r.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}))},1080:(e,t,n)=>{n.d(t,{Z:()=>j});var a=n(4050),r=n(5116),i=n(3716),s=n(7361),o=n(782),l=n(6974),c=n(7204),d=n(7407),u=n(5616);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(1273),v=n(4288),f=n(9107),p=n(6137),g=n(8415),Z=n(9066),E=n(8005),P=n(2340),y=n(9118),C=n(6752),b=n(5790),N=n(1470),w=n(706),k=n(6202),I=n(996),T=n(172),S=n(9411),M=n(8729),L=n(6844),x=n(329),$=n(1876),O=n(2155),A=n(126);const F=(0,a.X$)((e=>{let{chat:t,isPinned:n,isMuted:r}=e;const i=Boolean(t.unreadCount||t.hasUnreadMark||n),s=(0,C.Z)("Badge",r&&"muted",n&&"pinned",Boolean(t.unreadCount||t.hasUnreadMark)&&"unread");return a.ZP.createElement(A.Z,{isCustom:!0,className:"Badge-transition",isOpen:i},t.unreadCount?t.unreadMentionsCount?a.ZP.createElement("div",{className:"Badge-wrapper"},a.ZP.createElement("div",{className:"Badge mention"},a.ZP.createElement("i",{className:"icon-mention"})),a.ZP.createElement("div",{className:s},(0,O.bi)(t.unreadCount))):a.ZP.createElement("div",{className:s},(0,O.bi)(t.unreadCount)):t.hasUnreadMark?a.ZP.createElement("div",{className:s}):n?a.ZP.createElement("div",{className:s},a.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0)}));var R=n(742);const D=(0,a.X$)((e=>{let{isSelected:t,isActive:n}=e;return a.ZP.createElement("div",{className:(0,C.Z)("ChatCallStatus",n&&"active",t&&!s.wB&&"selected")},a.ZP.createElement("div",{className:"indicator"},a.ZP.createElement("div",null),a.ZP.createElement("div",null),a.ZP.createElement("div",null)))})),U=(0,a.X$)((0,r.c$)(((e,t)=>{var n;let{chatId:a}=t;const r=(0,Z.Z1)(e,a);if(!r||!r.lastMessage)return{};const{senderId:i,replyToMessageId:s,isOutgoing:o}=r.lastMessage,l=i?(0,Z.dy)(e,i):void 0,c=(0,g.N5)(r.lastMessage),d=c&&s?(0,Z.hj)(e,r.id,s):void 0,{targetUserIds:u,targetChatId:m}=c||{},h=(0,g.zX)(r),{chatId:v,threadId:f,type:E}=(0,Z.Bt)(e)||{},P=a===v&&f===p._f;return{chat:r,isMuted:(0,g.i4)(r,(0,Z.dZ)(e),(0,Z.NJ)(e)),lastMessageSender:l,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:d,draft:(0,Z.Ms)(e,a,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:P,canScrollDown:P&&"thread"===E,canChangeFolder:Boolean(null===(n=e.chatFolders.orderedIds)||void 0===n?void 0:n.length),lastSyncTime:e.lastSyncTime,...o&&{lastMessageOutgoingStatus:(0,Z.dT)(e,r.lastMessage)},...h&&{user:(0,Z.dy)(e,h),userStatus:(0,Z.ss)(e,h)}}}))((e=>{let{style:t,chatId:n,folderId:o,orderDiff:l,animationType:c,isPinned:d,chat:u,isMuted:h,user:v,userStatus:p,actionTargetUserIds:Z,lastMessageSender:O,lastMessageOutgoingStatus:A,actionTargetMessage:U,actionTargetChatId:B,draft:X,animationLevel:z,isSelected:V,canScrollDown:j,canChangeFolder:Y,lastSyncTime:K}=e;const{openChat:H,focusLastMessage:W}=(0,r.uC)(),q=(0,a.sO)(null),[J,_,G]=(0,w.Z)(),[Q,ee,te]=(0,w.Z)(),[ne,ae,re]=(0,w.Z)(),[ie,se,oe]=(0,w.Z)(),{lastMessage:le,typingStatus:ce}=u||{},de=le&&(0,g.Lo)(le);(0,b.Z)(n,de?le.replyToMessageId:void 0,U);const ue=le&&!(0,g.bf)(le)?(0,g.DH)(le):void 0,me=(0,k.Z)(le?(0,g.Ti)(le,"micro"):void 0),he=Boolean(le&&(0,g.Y5)(le)),ve=(0,a.Ye)((()=>{if(!Z)return;const e=(0,r.Rd)().users.byId;return Z.map((t=>e[t])).filter(Boolean)}),[Z]);(0,a.bt)((()=>{const e=q.current;if(0!==z&&e){if(c===m.Opacity)e.style.opacity="0",(0,y.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(c!==m.Move)return;e.style.transform=`translate3d(0, ${100*-l}%, 0)`,(0,y.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,y.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+i.fK)}}),[z,l,c]);const fe=(0,a.I4)((()=>{H({id:n,shouldReplaceHistory:!0}),V&&j&&W()}),[V,j,H,n,W]),pe=(0,N.Z)({chat:u,user:v,handleDelete:function(){ae(),_()},handleChatFolderChange:function(){se(),ee()},folderId:o,isPinned:d,isMuted:h,canChangeFolder:Y}),ge=(0,f.Z)();if(!u)return;const Ze=(0,C.Z)("Chat chat-item-clickable",(0,g.YC)(n)?"private":"group",V&&"selected");return a.ZP.createElement($.Z,{ref:q,className:Ze,style:t,ripple:!s.wB,contextActions:pe,onClick:fe},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(T.Z,{chat:u,user:v,userStatus:p,isSavedMessages:null==v?void 0:v.isSelf,lastSyncTime:K}),u.isCallActive&&u.isCallNotEmpty&&a.ZP.createElement(D,{isSelected:V,isActive:0!==z})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,P.Z)((0,g.U)(ge,u,v))),u.isVerified&&a.ZP.createElement(S.Z,null),h&&a.ZP.createElement("i",{className:"icon-muted"}),u.lastMessage&&a.ZP.createElement(L.Z,{message:u.lastMessage,outgoingStatus:A})),a.ZP.createElement("div",{className:"subtitle"},function(){if(ce&&le&&ce.timestamp>1e3*le.date)return a.ZP.createElement(M.Z,{typingStatus:ce});if(null!=X&&X.text.length)return a.ZP.createElement("p",{className:"last-message",dir:ge.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},ge("Draft")),(0,P.Z)(X.text));if(!le)return;if(de){const e=u&&((0,g.eA)(u)||le.senderId===le.chatId);return a.ZP.createElement("p",{className:"last-message",dir:ge.isRtl?"auto":"ltr"},(0,E.D)(ge,le,e?void 0:O,e?u:void 0,ve,U,B,{asTextWithSpoilers:!0}))}const e=(0,g.zF)(ge,n,O);return a.ZP.createElement("p",{className:"last-message",dir:ge.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,P.Z)(e)),a.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:r?"round":void 0}),(0,g.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,I.e)(e,t,!0)):(0,I.e)(e,t)}(ge,le,me||ue,he))}(),a.ZP.createElement(F,{chat:u,isPinned:d,isMuted:h}))),ne&&a.ZP.createElement(x.Z,{isOpen:J,onClose:G,onCloseAnimationEnd:re,chat:u}),ie&&a.ZP.createElement(R.Z,{isOpen:Q,onClose:te,onCloseAnimationEnd:oe,chatId:n}))})));var B=n(1713),X=n(231),z=n(7854);const V=(0,a.X$)((0,r.c$)(((e,t)=>{let{folderId:n,folderType:a}=t;return{chatFolder:n&&"folder"===a?(0,Z.Mw)(e,n):void 0,animatedEmoji:(0,Z.zB)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:r,onScreenSelect:i}=e;const o=(0,f.Z)(),l=(0,a.I4)((()=>{r({type:"editFolder",payload:t}),i(B.MT.FoldersEditFolderFromChatList)}),[t,r,i]);return a.ZP.createElement("div",{className:"EmptyFolder"},a.ZP.createElement("div",{className:"sticker"},n&&a.ZP.createElement(z.Z,{sticker:n})),a.ZP.createElement("h3",{className:"title",dir:"auto"},o("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"description",dir:"auto"},o(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),t&&r&&i&&a.ZP.createElement(X.Z,{ripple:!s.wB,fluid:!0,pill:!0,onClick:l,size:"smaller",isRtl:o.isRtl},a.ZP.createElement("i",{className:"icon-settings"}),o("ChatList.EmptyChatListEditFilter")))}))),j=(0,a.X$)((e=>{let{folderType:t,folderId:n,isActive:f,foldersDispatch:p,onScreenSelect:g}=e;const{openChat:Z,openNextChat:E}=(0,r.uC)(),P="all"===t?i.Nf:"archived"===t?i.WS:n,y=(0,u.d7)(P),C=(0,a.Ye)((()=>{if(y)return y.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[y]),b=(0,c.Z)(C),N=(0,a.Ye)((()=>C&&b?(0,o.Q8)(C,((e,t)=>void 0!==b[t]?e-b[t]:-1/0)):{}),[C,b]),[w,k]=(0,d.Z)(void 0,y,void 0,i.t_);(0,a.d4)((()=>{if(f&&y)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if(s.fl&&(s.jm&&e.metaKey||!s.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>y.length-1)return;Z({id:y[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),E({targetIndexDelta:t,orderedIds:y})}}}),[f,Z,E,y]);const I=function(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const r=e[t];return 0===r?m.None:r===1/0||r===-1/0||n<=a&&r<0||a0?m.Opacity:m.Move}}),[e])}(N);return a.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:w,preloadBackwards:i.t_,withAbsolutePositioning:!0,maxHeight:((null==y?void 0:y.length)||0)*i.rS,onLoadMore:k},null!=w&&w.length?function(){const e=y.indexOf(w[0]),t=(0,l.aE)(P)||0;return w.map(((r,s)=>a.ZP.createElement(U,{key:r,teactOrderKey:s,chatId:r,isPinned:e+s{n.d(t,{F:()=>r});var a=n(8415);function r(e,t,n,r){const{senderId:i}=t;if(!i)return;const s=(0,a.YC)(i)?r[i]:n[i];let o=(0,a.OU)(e,s);const l=n[t.chatId];return l&&((0,a.YC)(i)&&s.isSelf?o=`${e("FromYou")} → ${(0,a.U)(e,l)}`:(0,a.Bf)(l)&&(o+=` → ${(0,a.U)(e,l)}`)),o}},2420:(e,t,n)=>{n.d(t,{t:()=>m,Z:()=>h});var a=n(4050),r=n(1212),i=n(6752),s=n(1262),o=n(3989),l=n(7204),c=n(2898),d=n(706);const u=(0,a.X$)((e=>{let{isQuick:t,onFileSelect:n}=e;const[r,s,o]=(0,d.Z)(),l=(0,i.Z)("DropTarget",r&&"hovered");return a.ZP.createElement("div",{className:l,onDrop:n,onDragEnter:()=>{s()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),o()}},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(t?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),a.ZP.createElement("div",{className:"description"},t?"in a quick way":"without compression")))}));let m;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(m||(m={}));const h=(0,a.X$)((e=>{let{isOpen:t,withQuick:n,onHide:d,onFileSelect:m}=e;const h=(0,a.sO)(null),v=(0,l.Z)(n),{shouldRender:f,transitionClassNames:p}=(0,r.Z)(t);(0,a.d4)((()=>t?(0,o.Z)(d):void 0),[t,d]);const g=(0,a.I4)((async e=>{const{dataTransfer:t}=e;let n=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,s.Z)(t.items);e.length&&(n=n.concat(e))}}else n=n.concat(Array.from(t.files));d(),m(n,!1)}),[m,d]),Z=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(d(),m(Array.from(t.files),!0))}),[m,d]),E=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;t.matches(".DropTarget, .DropArea")&&!n&&(h.current=window.setTimeout((()=>{d()}),150))}),[d]);if(!f)return;const P=(0,i.Z)("DropArea",p);return a.ZP.createElement(c.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:P,onDragLeave:E,onDragOver:()=>{h.current&&window.clearTimeout(h.current)},onDrop:d},a.ZP.createElement(u,{onFileSelect:g}),(n||v)&&a.ZP.createElement(u,{onFileSelect:Z,isQuick:!0})))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9203),i=n(8778);const s=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,i.Z)(r.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(4050),r=n(5116),i=n(3716),s=n(9066),o=n(9118),l=n(5723),c=n(6752),d=n(7361),u=n(517),m=n(2645),h=n(706),v=n(8674),f=n(6389),p=n(9107),g=n(4784),Z=n(6391),E=n(2340),P=n(3283);const y=d.wB?256:416,C=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatId:n,threadId:a}=t;const{messageSendKeyCombo:r}=e.settings.byKey;return{messageSendKeyCombo:r,replyingToId:n&&a?(0,s.Yy)(e,n,a):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}))((e=>{let{id:t,chatId:n,threadId:s,isAttachmentModalInput:C,editableInputId:b,html:N,placeholder:w,forcedPlaceholder:k,canAutoFocus:I,shouldSuppressFocus:T,shouldSuppressTextFormatter:S,replyingToId:M,noTabCapture:L,messageSendKeyCombo:x,onUpdate:$,onSuppressedFocus:O,onSend:A}=e;const{editLastMessage:F,replyToNextMessage:R}=(0,r.uC)(),D=(0,a.sO)(null),U=(0,a.sO)(null),B=(0,p.Z)(),X=(0,a.sO)(!1),[z,V,j]=(0,h.Z)(),[Y,K]=(0,a.eJ)(),[H,W]=(0,a.eJ)(),q=(0,f.Z)(n,s);(0,a.d4)((()=>{C&&ee(!1)}),[C]),(0,m.Z)((e=>{let[t]=e;N!==D.current.innerHTML&&(D.current.innerHTML=N),N!==U.current.innerHTML&&(U.current.innerHTML=N),void 0!==t&&t!==N&&ee(!N.length)}),[N]),(0,a.sO)(n).current=n;const J=(0,a.I4)((()=>{D.current&&((0,v.zG)()?setTimeout(J,350):(0,l.Z)(D.current))}),[]),_=(0,a.I4)((()=>{j(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[j]);function G(){if(d.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||X.current)return j(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(S||!(0,Z.R)(t,b||i.R2)||!n||(0,g.Z)(n)||!t.START_TO_END)||(j(),!1)}function Q(){if(!G())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=D.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),K({x:a,y:t.top-n.top}),W(e),V()}function ee(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=D.current,n=U.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,y);if(r===a)return;const i=Math.round(50*Math.log(Math.abs(r-a))),s=()=>{t.style.height=`${r}px`,t.style.transitionDuration=`${i}ms`,t.classList.toggle("overflown",n.scrollHeight>y)};e?requestAnimationFrame(s):s()}(0,a.d4)((()=>{d.$b||I&&J()}),[n,J,M,I]),(0,a.d4)((()=>{if(L)return;const e=(0,o.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(J))}),2e3,!0,!1);return(0,u.Z)({onTab:e})}),[J,L]),(0,a.d4)((()=>{const e=D.current;function t(){e.blur()}return T&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[T]);const te=(0,c.Z)("form-control custom-scroll",N.length>0&&"touched",T&&"focus-disabled");return a.ZP.createElement("div",{id:t,onClick:T?O:void 0,dir:B.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:D,id:b||i.R2,className:te,contentEditable:!0,dir:"auto",onClick:J,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if($("
"===t?"":t),q({type:"typing"}),!d.$b&&(!n||!n.length)&&(d.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(D.current.blur(),e.removeAllRanges(),(0,l.Z)(D.current,!0))}},onKeyDown:function(e){if(!N.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void R({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||N.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",(function t(){Q(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),F()):d.cj||d.wZ||!("enter"===x&&!e.shiftKey||"ctrl-enter"===x&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),j(),A())},onMouseDown:function(e){2===e.button?!0!==X.current&&(X.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{X.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{X.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){Q(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:d.wZ?function(e){G()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:d.wZ?Q:void 0}),a.ZP.createElement("div",{ref:U,className:(0,c.Z)(te,"clone"),dir:"auto"}),!k&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},w),a.ZP.createElement(P.Z,{isOpen:z,anchorPosition:Y,selectedRange:H,setSelectedRange:W,onClose:_}),k&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,E.Z)(k)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(4050),r=n(6137),i=n(3716),s=n(6752),o=n(1396),l=n(3989),c=n(7529),d=n(1212),u=n(8758),m=n(706),h=n(9107),v=n(231);const f={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},p=document.createElement("div"),g=(0,a.X$)((e=>{let{isOpen:t,anchorPosition:n,selectedRange:g,setSelectedRange:Z,onClose:E}=e;const P=(0,a.sO)(null),y=(0,a.sO)(null),{shouldRender:C,transitionClassNames:b}=(0,d.Z)(t),[N,w,k]=(0,m.Z)(),[I,T]=(0,a.eJ)(""),[S,M]=(0,a.eJ)(!1),[L,x]=(0,a.eJ)(),[$,O]=(0,a.eJ)({});(0,a.d4)((()=>t?(0,l.Z)(E):void 0),[t,E]),(0,u.Z)(t,P,E),(0,a.d4)((()=>{N?y.current.focus():(T(""),M(!1))}),[N]),(0,a.d4)((()=>{C||(k(),O({}),x(void 0))}),[k,C]),(0,a.d4)((()=>{if(!t||!g)return;const e={};let{parentElement:n}=g.commonAncestorContainer;for(;n&&n.id!==i.R2;){const t=f[n.tagName];t&&(e[t]=!0),n=n.parentElement}O(e)}),[t,g,w]);const A=(0,a.I4)((()=>{const e=window.getSelection();e&&Z(e.getRangeAt(0))}),[Z]),F=(0,a.I4)((()=>{if(g)return p.innerText=g.toString(),p.innerHTML}),[g]),R=(0,a.I4)((()=>{if(g)return g.commonAncestorContainer.parentElement}),[g]);function D(){const e=y.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void x(void 0);let r="";a0&&(r+=" mask-left"),x(r)}function U(e){if($[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys($).some((t=>t!==e&&Boolean($[t]))))return"disabled"}else if($.monospace||$.strikethrough)return"disabled"}const B=(0,a.I4)((()=>{if($.spoiler){const e=R();if(!g||!e||e.dataset.entityType!==r.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void O((e=>({...e,spoiler:!1})))}const e=F();document.execCommand("insertHTML",!1,`${e}`),E()}),[R,F,E,g,$.spoiler]),X=(0,a.I4)((()=>{O((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!Boolean(e[t])||document.execCommand(t)})),A(),{...e,bold:!e.bold})))}),[A]),z=(0,a.I4)((()=>{document.execCommand("italic"),A(),O((e=>({...e,italic:!e.italic})))}),[A]),V=(0,a.I4)((()=>{document.execCommand("underline"),A(),O((e=>({...e,underline:!e.underline})))}),[A]),j=(0,a.I4)((()=>{if($.strikethrough){const e=R();if(!g||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void O((e=>({...e,strikethrough:!1})))}const e=F();document.execCommand("insertHTML",!1,`${e}`),E()}),[R,F,E,g,$.strikethrough]),Y=(0,a.I4)((()=>{if($.monospace){const e=R();if(!g||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void O((e=>({...e,monospace:!1})))}const e=F();document.execCommand("insertHTML",!1,`${e}`),E()}),[R,F,E,g,$.monospace]);function K(){const e=encodeURI((0,o.X)(I)||"");if(S){const t=R();if(!t||"A"!==t.tagName)return;return t.href=e,void E()}const t=F();!function(){if(!g)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(g))}(),document.execCommand("insertHTML",!1,`${t}`),E()}const H=(0,a.I4)((e=>{const t={k:w,b:X,u:V,i:z,m:Y,s:j,p:B}[(0,c.Z)(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[w,X,V,z,Y,j,B]);(0,a.d4)((()=>(t&&document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H))),[t,H]);const W=(0,h.Z)();if(!C)return;const q=(0,s.Z)("TextFormatter",b,N&&"link-control-shown"),J=(0,s.Z)("TextFormatter-link-url-confirm",Boolean(I.length)&&"shown"),_=n?`left: ${n.x}px; top: ${n.y}px;--text-formatter-left: ${n.x}px;`:"";return a.ZP.createElement("div",{ref:P,className:q,style:_,onKeyDown:function(e){"Enter"===e.key&&N&&(K(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:"Spoiler text",className:U("spoiler"),onClick:B},a.ZP.createElement("i",{className:"icon-eye-closed"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:"Bold text",className:U("bold"),onClick:X},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:"Italic text",className:U("italic"),onClick:z},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:"Underlined text",className:U("underline"),onClick:V},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:U("strikethrough"),onClick:j},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:"Monospace text",className:U("monospace"),onClick:Y},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:W("TextFormat.AddLinkTitle"),onClick:w},a.ZP.createElement("i",{className:"icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:W("Cancel"),onClick:k},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",L)},a.ZP.createElement("input",{ref:y,className:"TextFormatter-link-url-input",type:"text",value:I,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){T(e.target.value),D()},onScroll:D})),a.ZP.createElement("div",{className:J},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(v.Z,{color:"translucent",ariaLabel:W("Save"),className:"color-primary",onClick:K},a.ZP.createElement("i",{className:"icon-check"}))))))}))},1262:(e,t,n)=>{async function a(e){const t=[];function n(e,a){return new Promise((r=>{if(e instanceof File)t.push(e),r(e);else if(e.isFile){const n=a.getAsFile();e.file((e=>{t.push(e),r(e)}),(()=>{n&&t.push(n),r(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{let t=[];for(let r of e)t.push(n(r,a));r(Promise.all(t))}))}))}let a=[];for(let t of e)if("file"===t.kind){const e=t.webkitGetAsEntry()||t.getAsFile();e&&a.push(n(e,t))}return await Promise.all(a),t}n.d(t,{Z:()=>a})},2400:(e,t,n)=>{n.d(t,{_:()=>o});const a=/(
|)/g,r=/( |\u00A0)/g,i=/(
|<\/div>)/gi,s=/\n$/i;function o(e){return e.replace(r," ").replace(a,"\n").replace(i,"").replace(s,"")}},6391:(e,t,n)=>{function a(e,t){const{commonAncestorContainer:n}=e;let a=n,r=1;for(;a&&a.id!==t&&r<5;)a=a.parentElement,r++;return Boolean(a&&a.id===t)}n.d(t,{R:()=>a})},3575:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(4050),r=n(3716),i=n(735),s=n(2400),o=n(4284),l=n(5723),c=n(782);const d=new WeakMap;function u(e){return function(){const t=d.get(e);for(var n=arguments.length,a=new Array(n),r=0;rObject.values((0,c.q0)(r,e)))):{},s=n?(0,c.Q8)(n,(e=>Object.values((0,c.q0)(r,e)))):{},o={...i,...s},l=[].concat(Object.keys(i),Object.keys(s)),d=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});return{byKeyword:o,keywords:l,byName:d,names:Object.keys(d)}})),P=u((function(e,t,n){const{byKeyword:a,keywords:r,byName:s,names:o}=e;let l=i.D;const d=r.filter((e=>e.startsWith(t))).sort();l=l.concat((0,c.xH)(Object.values((0,c.q0)(a,d))));const u=o.filter((e=>e.startsWith(t)));return l=l.concat((0,c.xH)(Object.values((0,c.q0)(s,u)))),l=(0,c.Tw)(l),l.slice(0,n)}));try{g=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){g=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function y(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.R2,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const[v,f,g]=(0,m.Z)(),[y,N]=(0,a.eJ)(),[w,k]=(0,a.eJ)(!1),[I,T]=(0,a.eJ)(i.D);(0,a.d4)((()=>{if(u)return;const e=()=>{N(p.emojis)};p?e():b().then(e)}),[u]);const S=t.current;(0,a.d4)((()=>{if(!e||!S||!y||u)return void g();const t=S.includes(":")&&C(S);if(!t)return T(i.D),void g();const a=t.length>2&&t.endsWith(":"),r=t.substr(1,a?t.length-2:void 0);let s=i.D;if(k(a),r){if(r.length>=2){const e=E(y,c,d);s=P(e,r,36)}}else s=Z(y,n,36);s.length?(a||f(),T(s)):g()}),[y,S,e,f,n,g,k,u,c,d]);const M=(0,a.I4)(((e,n)=>{const a=t.current,r=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==r){o(`${a.substr(0,r)}${(0,h.Z)(e,["emoji_html"])}`);const t=document.getElementById(s);requestAnimationFrame((()=>{(0,l.Z)(t,!0,!0)}))}g()}),[t,s,o,g]);return(0,a.d4)((()=>{v&&w&&I.length&&M(I[0].native,!0)}),[I,M,v,w]),{isEmojiTooltipOpen:v,closeEmojiTooltip:g,filteredEmojis:I,insertEmoji:M}}function C(e){const t=(0,s._)(e).match(g);return t?t[0].trim():void 0}async function b(){return v||(v=n.e(501).then(n.t.bind(n,7501,19)),f=(await v).default,p=(0,o.NM)(f)),v}},9295:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(5116),i=n(6137),s=n(3716),o=n(8415),l=n(2400),c=n(5723),d=n(706),u=n(782);const m=(0,n(9118).P2)((e=>e()),500,!0);let h;try{h=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){h=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function v(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.R2,h=arguments.length>4?arguments[4]:void 0,v=arguments.length>5?arguments[5]:void 0,g=arguments.length>6?arguments[6]:void 0;const[Z,E,P]=(0,d.Z)(),[y,C]=(0,a.eJ)(),b=(0,a.I4)(((e,t)=>{const n=(0,r.Rd)().users.byId;(h||v)&&n?m((()=>{const a=null==h?void 0:h.reduce(((e,t)=>(t.userId!==g&&e.push(t.userId),e)),[]),r=(0,o.kK)((0,u.Tw)([...t&&v||[],...a||[]]),n,e);C(Object.values((0,u.q0)(n,r)))})):C(void 0)}),[g,h,v]),N=t.current;(0,a.d4)((()=>{if(!e||!N.length)return void P();const t=N.includes("@")&&f(N);if(t){const e=t?t.substr(1):"";b(e,p(N))}else P()}),[e,b,E,P,N]),(0,a.d4)((()=>{null!=y&&y.length?E():P()}),[E,P,y]);const w=(0,a.I4)((function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.username&&!(0,o.Vl)(e))return;const r=e.username?`@${e.username}`:`${(0,o.Vl)(e)}`,s=t.current,d=s.lastIndexOf("@");if(-1!==d){n(`${s.substr(0,d)}${r} `);const e=document.getElementById(l);requestAnimationFrame((()=>{(0,c.Z)(e,a)}))}P()}),[t,l,n,P]);return{isMentionTooltipOpen:Z,closeMentionTooltip:P,insertMention:w,mentionFilteredUsers:y}}function f(e){const t=(0,l._)(e).match(h);return t?t[0].trim():void 0}function p(e){return e.startsWith("@")}},7891:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9290),i=n(5326);function s(e,t){const n=void 0===t,s=(0,a.sO)(n),o=(0,a.sO)(),l=(0,i.Z)();return(0,r.Z)((()=>{n||(s.current=!1,o.current&&(clearTimeout(o.current),o.current=void 0))}),e),(0,a.d4)((()=>{if(n||s.current)return;const e=()=>{s.current=!0,l()};t>0?o.current=window.setTimeout(e,t):e()}),e),s.current}},1218:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(4605);const i=(0,a.X$)((e=>{let{id:t,options:n,selected:i=[],disabled:s,round:o,loadingOptions:l,onChange:c}=e;const[d,u]=(0,a.eJ)(i||[]),m=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...d,t]:d.filter((e=>e!==t)),u(a),c(a)}),[c,d]);return a.ZP.createElement("div",{id:t,className:"radio-group"},n.map((e=>a.ZP.createElement(r.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==i.indexOf(e.value),disabled:s,round:o,isLoading:l?-1!==l.indexOf(e.value):void 0,onChange:m}))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(6752),i=n(231);const s=e=>{let{isShown:t,className:n,color:s="primary",ariaLabel:o,disabled:l,onClick:c,children:d}=e;const u=(0,r.Z)("FloatingActionButton",t&&"revealed",n);return a.ZP.createElement(i.Z,{className:u,color:s,round:!0,disabled:l,onClick:t&&!l?c:void 0,ariaLabel:o,tabIndex:-1},d)}},1876:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(7361),i=n(9118),s=n(6752),o=n(7240),l=n(3394),c=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964),v=n(231);const f=e=>{let{ref:t,buttonRef:n,icon:f,secondaryIcon:p,className:g,style:Z,children:E,disabled:P,ripple:y,narrow:C,inactive:b,focus:N,destructive:w,multiline:k,isStatic:I,contextActions:T,onMouseDown:S,onClick:M,onSecondaryIconClick:L}=e,x=(0,a.sO)(null);t&&(x=t);const[$,O,A]=(0,c.Z)(),{isContextMenuOpen:F,contextMenuPosition:R,handleBeforeContextMenu:D,handleContextMenu:U,handleContextMenuClose:B,handleContextMenuHide:X}=(0,o.Z)(x,!T),z=(0,a.I4)((()=>x.current),[]),V=(0,a.I4)((()=>x.current.closest(".custom-scroll")),[]),j=(0,a.I4)((()=>x.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:Y,positionY:K,transformOriginX:H,transformOriginY:W,style:q}=(0,l.Z)(R,z,V,j),J=(0,a.I4)((e=>{!P&&M&&(M(e),r.$b&&!y&&(O(),(0,i.T2)(A)))}),[P,O,M,y,A]),_=e=>{P||0!==e.button||!L&&!T||(e.stopPropagation(),L?L(e):U(e))},G=(0,a.I4)((e=>{b||r.$b||(!T||2!==e.button&&M||D(e),0===e.button&&(M?J(e):U(e)))}),[b,T,M,D,U,J]),Q=(0,d.Z)(),ee=(0,s.Z)("ListItem",g,!I&&"no-selection",y&&"has-ripple",C&&"narrow",P&&"disabled",b&&"inactive",R&&"has-menu-open",N&&"focus",w&&"destructive",k&&"multiline",I&&"is-static");return a.ZP.createElement("div",{ref:x,className:ee,dir:Q.isRtl?"rtl":void 0,style:Z,onMouseDown:S},a.ZP.createElement("div",{className:(0,s.Z)("ListItem-button",$&&"active"),role:"button",ref:n,tabIndex:0,onClick:!b&&r.$b?J:void 0,onMouseDown:G,onContextMenu:!b&&T?U:void 0},f&&a.ZP.createElement("i",{className:`icon-${f}`}),k&&a.ZP.createElement("div",{className:"multiline-item"},E),!k&&E,!P&&!b&&y&&a.ZP.createElement(u.Z,null),p&&a.ZP.createElement(v.Z,{className:"secondary-icon",round:!0,color:"translucent",size:"smaller",onClick:r.$b?_:void 0,onMouseDown:r.$b?void 0:_},a.ZP.createElement("i",{className:`icon-${p}`}))),T&&void 0!==R&&a.ZP.createElement(m.Z,{isOpen:F,transformOriginX:H,transformOriginY:W,positionX:Y,positionY:K,style:q,className:"ListItem-context-menu",autoClose:!0,onClose:B,onCloseAnimationEnd:X},T.map((e=>a.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(3716),i=n(1212),s=n(6752),o=n(3989),l=n(2898);const c=3e3,d=e=>{let{message:t,duration:n=c,containerId:d,onDismiss:u}=e;const[m,h]=(0,a.eJ)(!0),v=(0,a.sO)(null),{transitionClassNames:f}=(0,i.Z)(m),p=(0,a.I4)((()=>{h(!1),setTimeout(u,150+r.fK)}),[u]);(0,a.d4)((()=>m?(0,o.Z)(p):void 0),[m,p]),(0,a.d4)((()=>(v.current=window.setTimeout(p,n),()=>{v.current&&(clearTimeout(v.current),v.current=void 0)})),[n,p]);const g=(0,a.I4)((()=>{v.current&&(clearTimeout(v.current),v.current=void 0)}),[]),Z=(0,a.I4)((()=>{v.current=window.setTimeout(p,n)}),[n,p]);return a.ZP.createElement(l.Z,{className:"Notification-container",containerId:d},a.ZP.createElement("div",{className:(0,s.Z)("Notification",f),onClick:p,onMouseEnter:g,onMouseLeave:Z},a.ZP.createElement("div",{className:"content"},t)))}},9196:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(6752);const i={s:22,m:25,l:28,xl:20},s=(0,a.X$)((e=>{let{progress:t=0,size:n="l",square:s,transparent:o,noCross:l,onClick:c}=e;const d=i[n],u=d-4,m=d-1,h=2*u*Math.PI,v=(0,a.sO)(null);(0,a.d4)((()=>{if(!v.current)return;const e=v.current.firstElementChild,n=h-Math.min(Math.max(.05,t),1)*h;e?e.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):v.current.innerHTML=`\n \n `}),[v,h,m,u,t]);const f=(0,r.Z)(`ProgressSpinner size-${n}`,o&&"transparent",s&&"square",l&&"no-cross");return a.ZP.createElement("div",{ref:v,className:f,onClick:c})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(6752),i=n(9107),s=n(9204);const o=(0,a.X$)((e=>{let{id:t,label:n,subLabel:o,value:l,name:c,checked:d,disabled:u,hidden:m,isLoading:h,onChange:v}=e;const f=(0,i.Z)(),p=(0,r.Z)("Radio",u&&"disabled",m&&"hidden-widget",h&&"loading");return a.ZP.createElement("label",{className:p,dir:f.isRtl?"rtl":void 0},a.ZP.createElement("input",{type:"radio",name:c,value:l,id:t,checked:d,onChange:v,disabled:u||m}),a.ZP.createElement("div",{className:"Radio-main"},a.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},n),o&&a.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},o)),h&&a.ZP.createElement(s.Z,null))})),l=(0,a.X$)((e=>{let{id:t,name:n,options:r,selected:i,disabled:s,loadingOption:l,onChange:c}=e;const d=(0,a.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return a.ZP.createElement("div",{id:t,className:"radio-group"},r.map((e=>a.ZP.createElement(o,{name:n,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===i,hidden:e.hidden,disabled:s,isLoading:l?l===e.value:void 0,onChange:d}))))}))},8051:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(6752),i=n(9107);const s=(0,a.X$)((e=>{let{options:t,min:n=0,max:s=(t?t.length-1:100),step:o=1,label:l,value:c,renderValue:d,disabled:u,onChange:m}=e;const h=(0,i.Z)(),v=(0,a.I4)((e=>{m(Number(e.currentTarget.value))}),[m]),f=(0,r.Z)("RangeSlider",u&&"disabled"),p=(0,a.Ye)((()=>t?c/(t.length-1)*100:(c-n)/((s-n)/o)*100),[t,c,s,n,o]);return a.ZP.createElement("div",{className:f},l&&a.ZP.createElement("div",{className:"slider-top-row",dir:h.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},l),!t&&a.ZP.createElement("span",{className:"value",dir:"auto"},d?d(c):c)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${p}%`}),a.ZP.createElement("input",{min:n,max:s,value:c,step:o,type:"range",onChange:v}),t&&a.ZP.createElement("div",{className:"slider-options"},t.map(((e,t)=>a.ZP.createElement("div",{className:(0,r.Z)("slider-option no-selection",t===c&&"active"),onClick:()=>m(t)},e))))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(6752),i=n(706),s=n(9107),o=n(2515),l=n(4288),c=n(231),d=n(126);const u=(0,a.X$)((e=>{let{ref:t,children:n,parentContainerClassName:u,value:m,inputId:h,className:v,focused:f,isLoading:p,spinnerColor:g,spinnerBackgroundColor:Z,placeholder:E,disabled:P,autoComplete:y,canClose:C,autoFocusSearch:b,onChange:N,onReset:w,onFocus:k,onBlur:I,onSpinnerClick:T}=e,S=(0,a.sO)(null);t&&(S=t);const[M,L,x]=(0,i.Z)(f);(0,o.Z)(S,b,x),(0,a.d4)((()=>{S.current&&(f?S.current.focus():S.current.blur())}),[f,E]);const $=(0,s.Z)(),O=(0,a.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${u} .ListItem-button`);e&&e.focus()}}),[u]);return a.ZP.createElement("div",{className:(0,r.Z)("SearchInput",v,M&&"has-focus"),dir:$.isRtl?"rtl":void 0},n,a.ZP.createElement("input",{ref:S,id:h,type:"text",dir:"auto",placeholder:E||$("Search"),className:"form-control",value:m,disabled:P,autoComplete:y,onChange:function(e){const{currentTarget:t}=e;N(t.value)},onFocus:function(){L(),k&&k()},onBlur:function(){x(),I&&I()},onKeyDown:O}),a.ZP.createElement("i",{className:"icon-search"}),a.ZP.createElement(d.Z,{isOpen:Boolean(p),className:"slow"},a.ZP.createElement(l.Z,{color:g,backgroundColor:Z,onClick:T})),!p&&(m||C)&&w&&a.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:w},a.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(1212),i=n(7204),s=n(6752);const o=e=>{let{isOpen:t,isCustom:n,id:o,className:l,onClick:c,children:d}=e;const{shouldRender:u,transitionClassNames:m}=(0,r.Z)(t,void 0,void 0,!n&&void 0),h=(0,i.Z)(t),v=(0,i.Z)(d),f=(0,a.sO)();return h&&!t&&(f.current=v),u&&a.ZP.createElement("div",{id:o,className:(0,s.Z)(l,m),onClick:c},t?d:f.current)}},3321:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752);const i=(0,a.X$)((e=>{let{id:t,name:n,value:i,label:s,checked:o=!1,disabled:l,inactive:c,noAnimation:d,onChange:u,onCheck:m}=e;const h=(0,a.I4)((e=>{u&&u(e),m&&m(e.currentTarget.checked)}),[u,m]),v=(0,r.Z)("Switcher",l&&"disabled",c&&"inactive",d&&"no-animation");return a.ZP.createElement("label",{className:v,title:s},a.ZP.createElement("input",{type:"checkbox",id:t,name:n,value:i,checked:o,disabled:l,onChange:h}),a.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(7361),i=n(1367),s=n(7204),o=n(8781),l=n(9107),c=n(6752),d=n(2972),u=n(2340);const m="Tab--active",h=(0,a.X$)((e=>{let{className:t,title:n,isActive:r,badgeCount:i,isBadgeActive:s,previousActiveTab:o,onClick:l,clickArg:h}=e;const v=(0,a.sO)(null);return(0,a.d4)((()=>{if(r&&void 0===o&&v.current&&v.current.classList.add(m),!r||void 0===o)return;const e=v.current,t=e.parentElement.children[o];if(!t)return;const n=e.querySelector("i"),a=t.querySelector("i"),i=a.parentElement.offsetLeft-n.parentElement.offsetLeft,s=a.clientWidth/n.clientWidth;a.classList.remove("animate"),n.classList.remove("animate"),n.style.transform=`translate3d(${i}px, 0, 0) scale3d(${s}, 1, 1)`,(0,d.Z)(n),n.classList.add("animate"),n.style.transform="none",t.classList.remove(m),e.classList.add(m)}),[r,o]),a.ZP.createElement("div",{className:(0,c.Z)("Tab",t),onClick:()=>l(h),ref:v},a.ZP.createElement("span",null,(0,u.Z)(n),Boolean(i)&&a.ZP.createElement("span",{className:(0,c.Z)("badge",s&&"Tab__badge--active")},i),a.ZP.createElement("i",null)))})),v=r.cj?450:r.wZ?400:300,f=(0,a.X$)((e=>{let{tabs:t,activeTab:n,big:r,onSwitchTab:c}=e;const d=(0,a.sO)(null),u=(0,s.Z)(n);(0,o.Z)(d.current),(0,a.d4)((()=>{const e=d.current,{scrollWidth:t,offsetWidth:a,scrollLeft:r}=e;if(t<=a)return;const s=e.childNodes[n];if(!s)return;const{offsetLeft:o,offsetWidth:l}=s,c=o-a/2+l/2;Math.abs(c-r)<16||(0,i.Z)(e,c,v)}),[n]);const m=(0,l.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(r?"big":""),ref:d,dir:m.isRtl?"rtl":void 0},t.map(((e,t)=>a.ZP.createElement(h,{key:e.title,title:m(e.title),isActive:t===n,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:c,clickArg:t}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),i=n(3716),s=n(6752),o=n(2972),l=n(1279),c=n(5326),d=n(7204),u=n(8674);const m="Transition__slide--active",h=e=>{let{ref:t,activeKey:n,name:h,direction:v="auto",renderCount:f,shouldRestoreHeight:p,shouldCleanup:g,cleanupExceptionKey:Z,id:E,className:P,onStart:y,onStop:C,children:b}=e;const{animationLevel:N}=(0,r.Rd)().settings.byKey,w=(0,a.sO)();let k=(0,a.sO)(null);t&&(k=t);const I=(0,a.sO)({}),T=(0,d.Z)(n),S=(0,c.Z)(),M=void 0!==T&&n!==T;!f&&M&&(I.current={[T]:I.current[T]}),I.current[n]=b,(0,a.bt)((()=>{function e(){if(!g)return;const e=void 0!==Z?I.current[Z]:void 0;I.current=e?{[Z]:e}:{},S()}const t=k.current,a=t.children;if(1===a.length&&!M)return h.startsWith("slide-optimized")&&(a[0].style.transition="none",a[0].style.transform="translate3d(0, 0, 0)"),void a[0].classList.add(m);const r=Array.from(t.childNodes);if(!M||!r.length)return;w.current=n;const s=-1===v||"auto"===v&&T>n||"inverse"===v&&T{null==h||h(),p.style.transition="none",p.style.transform="translate3d(0, 0, 0)",f.style.transition="none",f.style.transform=`translate3d(${n?"-":""}100%, 0, 0)`,(0,o.Z)(f),p.style.transition="",p.style.transform=`translate3d(${n?"":"-"}100%, 0, 0)`,f.style.transition="",f.style.transform="translate3d(0, 0, 0)",p.classList.remove(m),f.classList.add(m),(0,l.L)(p,(()=>{r===s.current&&(p.style.transition="none",p.style.transform="",d&&(f.style.height="auto",c.style.height=`${f.clientHeight}px`),null==v||v(),g(),a())}))}))}(N,h,s,e,n,w,t,p,y,C,r[E],r[d]);if(t.classList.remove("animating"),t.classList.toggle("backwards",s),"none"===h||N===i.oB)return r.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(m,t===E))})),void e();r.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove(m),e.classList.toggle("from",t===d),e.classList.toggle("through",t>d&&tE),e.classList.toggle("to",t===E))}));const P=(0,u.YW)();requestAnimationFrame((()=>{var a;function i(){requestAnimationFrame((()=>{if(n===w.current){if(t.classList.remove("animating","backwards"),r.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(m,t===E))})),p){const e=t.querySelector(`.${m}`);e&&(e.style.height="auto",t.style.height=`${e.clientHeight}px`)}null==C||C(),P(),e()}}))}t.classList.add("animating"),null==y||y();const o="mv-slide"===h?null===(a=r[E])||void 0===a?void 0:a.firstChild:"reveal"===h&&s?r[d]:r[E];o?(0,l.f)(o,i):i()}))}),[n,T,M,v,h,y,C,f,p,g,Z,N,S]),(0,a.bt)((()=>{if(p){const e=k.current,t=e.querySelector(`.${m}`)||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[p,b]);const L=I.current,x=Object.keys(f?new Array(f).fill(void 0):L).map(Number).map((e=>{const t=L[e];if(t)return a.ZP.createElement("div",{key:e,teactOrderKey:e},"function"==typeof t?t(e===n,e===T,n):t)}));return a.ZP.createElement("div",{ref:k,id:E,className:(0,s.Z)("Transition",P,h),teactFastList:!f&&!g},x)}},3455:(e,t,n)=>{n.d(t,{fi:()=>i,Yy:()=>s,vb:()=>c,ZP:()=>h});var a=n(1090),r=n(782);const i=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],s=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],o=["includedChatIds","bots","channels","groups","contacts","nonContacts"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a=[],i=[];if("included"===t){const{includedChatIds:t,...s}=n?e.includeFilters||{}:(0,r.ei)(e.folder,o);a=t||[],i=Object.keys(s).filter((e=>Boolean(s[e])))}else{const{excludedChatIds:t,...s}=n?e.excludeFilters||{}:(0,r.ei)(e.folder,l);a=t||[],i=Object.keys(s).filter((e=>Boolean(s[e])))}return{selectedChatIds:a,selectedChatTypes:i}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,r.ei)(e.folder,o)};case"editExcludeFilters":return{...e,excludeFilters:(0,r.ei)(e.folder,l)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,r.CE)(e.folder,o),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,r.CE)(e.folder,l),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(5116),i=n(396),s=n(274),o=n(5266),l=n(9290),c=n(4532);function d(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:i,proxy:s,requestNextTrack:o,requestPreviousTrack:l,isFirst:c,isLast:d}=e.current;t={play:()=>{n(s.src)},pause:()=>{a()},stop:()=>{a(),i(0),(0,r.uC)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;i(Math.max(s.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;i(Math.min(s.currentTime+t,s.duration))},seekTo:e=>{e.seekTime&&i(e.seekTime)}},d()||(t.nexttrack=()=>{o()}),c()||(t.previoustrack=()=>{l()})}return t}const u=function(e,t,n,u,m,h,v){let f=arguments.length>7&&void 0!==arguments[7]&&arguments[7],p=arguments.length>8?arguments[8]:void 0,g=arguments.length>9?arguments[9]:void 0,Z=arguments.length>10&&void 0!==arguments[10]&&arguments[10],E=arguments.length>11&&void 0!==arguments[11]&&arguments[11];const P=(0,a.sO)(null),[y,C]=(0,a.eJ)(!1);let b=y;const[N,w]=(0,a.eJ)(0),k=(0,a.I4)((()=>{C(!1),g&&g()}),[g]);(0,l.Z)((()=>{P.current=(0,i.z2)(e,n,((e,a)=>{var i;switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:t,toggleMuted:a,proxy:i}=P.current;C(!0),(0,c.N)(h,d(P)),(0,c.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),a(Boolean((0,r.Rd)().audioPlayer.isMuted)),"voice"===n&&t((0,r.Rd)().audioPlayer.playbackRate),(0,c.NS)({duration:i.duration||0,playbackRate:i.playbackRate,position:i.currentTime});break}case"onRateChange":{const{proxy:e}=P.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":C(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=P.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;E||w(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}null==m||null===(i=m[e])||void 0===i||i.call(m,a)}),p,k);const{proxy:a}=P.current;y||a.paused||(C(!0),b=!0),v&&v(a)}),[e]),(0,a.d4)((()=>{y&&h&&(0,c.Ym)(h)}),[h,y]);const{play:I,pause:T,setCurrentTime:S,proxy:M,destroy:L,setVolume:x,stop:$,isFirst:O,isLast:A,requestNextTrack:F,requestPreviousTrack:R,setPlaybackRate:D,toggleMuted:U}=P.current,B=M.duration&&Number.isFinite(M.duration)?M.duration:t;(0,a.d4)((()=>{!B||(0,o.z)(M)||E||w(M.currentTime/B)}),[B,N,M,E]),(0,a.d4)((()=>()=>{L(Z)}),[L,Z]),(0,s.Z)((e=>{let[t,n]=e;t===f&&u===n||M.src&&M.paused||f&&u&&!y&&I(u)}),[f,u,y,I,M.src,M.paused]);const X=(0,a.I4)((()=>{u&&I(u)}),[u,I]),z=(0,a.I4)((()=>{y?T():X()}),[T,X,y]),V=(0,a.I4)((e=>{S(e),B&&w(M.currentTime/B)}),[B,M,S]);return{isPlaying:b,playProgress:N,playPause:z,pause:T,play:X,stop:$,setCurrentTime:V,setVolume:x,audioProxy:M,duration:B,requestNextTrack:F,requestPreviousTrack:R,isFirst:O,isLast:A,setPlaybackRate:D,toggleMuted:U}}},2937:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6264),i=n(9290),s=n(1394),o=n(5326);const l=new Map;function c(e){const t=(0,a.sO)();let n=!1;(0,i.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const a=new Image;if(a.src=e,!a.width)return;const i=(0,s.ao)(a);(0,r.Z)(i.getContext("2d"),0,0,i.width,i.height,2,2),t.current=i.toDataURL()}),[e]);const c=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=(0,a.sO)(e?l.get(e):void 0),c=(0,a.sO)(),d=(0,o.Z)();return c.current&&t&&(clearTimeout(c.current),c.current=void 0),(0,a.d4)((()=>{if(!e||i.current||t)return;const a=new Image;a.onload=()=>{const t=(0,s.ao)(a);(0,r.Z)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();i.current=n,d(),l.size>=1e3&&l.clear(),l.set(e,n)},n?c.current=window.setTimeout((()=>{a.src=e}),n):a.src=e}),[e,n,d,t]),i.current}(e||void 0,Boolean(t.current));return t.current||!n&&c||e||void 0}},2019:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118),i=n(5266);const s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[t,n]=(0,a.eJ)(!e),[s,o]=(0,a.eJ)(0),l=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),c=(0,a.I4)((e=>{const t=e.currentTarget;(0,i.z)(t)||(t.buffered.length&&o(t.buffered.end(0)/t.duration),l(t.readyState>=3||t.currentTime>0))}),[l]),d={onLoadedData:c,onPlaying:c,onLoadStart:c,onPause:c,onTimeUpdate:c,onProgress:c};return{isBuffered:t,bufferedProgress:s,bufferingHandlers:d,checkBuffering(e){l(e.readyState>=3)}}}},5866:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(6264),i=n(5326),s=n(7361);function o(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const o=(0,a.sO)(null),l=(0,i.Z)();return(0,a.d4)((()=>{const a=o.current;if(!e||!a||t)return;const i=new Image,l=()=>{a.width=i.width,a.height=i.height;const e=a.getContext("2d",{alpha:!1});s.vX&&(e.filter="blur(2px)"),e.drawImage(i,-4,-4,a.width+8,a.height+8),s.vX||(0,r.Z)(e,0,0,a.width,a.height,2,2)};i.onload=()=>{n?requestAnimationFrame(l):l()},i.src=e}),[o,e,l,t,n]),o}},1470:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(5116),i=n(3716),s=n(8415),o=n(782),l=n(9107);const c=function(e){let{chat:t,user:n,folderId:c,isPinned:d,isMuted:u,canChangeFolder:m,handleDelete:h,handleChatFolderChange:v}=e,f=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const p=(0,l.Z)(),{isSelf:g}=n||{},Z=(null==n?void 0:n.id)===i.aw;return(0,a.Ye)((()=>{if(!t)return;const{toggleChatPinned:e,updateChatMutedState:n,toggleChatArchived:a,toggleChatUnread:i}=(0,r.uC)(),l=m?{title:p("ChatList.Filter.AddToFolder"),icon:"folder",handler:v}:void 0,E=d?{title:p("UnpinFromTop"),icon:"unpin",handler:()=>e({id:t.id,folderId:c})}:{title:p("PinToTop"),icon:"pin",handler:()=>e({id:t.id,folderId:c})};if(f)return(0,o.oA)([E,l]);const P=t.unreadCount||t.hasUnreadMark?{title:p("MarkAsRead"),icon:"readchats",handler:()=>i({id:t.id})}:{title:p("MarkAsUnread"),icon:"unread",handler:()=>i({id:t.id})},y=u?{title:p("ChatList.Unmute"),icon:"unmute",handler:()=>n({chatId:t.id,isMuted:!1})}:{title:p("ChatList.Mute"),icon:"mute",handler:()=>n({chatId:t.id,isMuted:!0})},C=(0,s.pE)(t)?{title:p("Unarchive"),icon:"unarchive",handler:()=>a({id:t.id})}:{title:p("Archive"),icon:"archive",handler:()=>a({id:t.id})},b={title:(0,s.YC)(t.id)?p("Delete"):p((0,s.cc)(t)?"DeleteChat":(0,s.eA)(t)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:h},N=void 0!==c;return(0,o.oA)([l,P,E,!g&&y,!g&&!Z&&!N&&C,b])}),[t,m,p,v,d,f,u,h,c,g,Z])}},7240:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7361);function i(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const s=(e,t,n,s)=>{const[o,l]=(0,a.eJ)(!1),[c,d]=(0,a.eJ)(void 0),u=(0,a.I4)((e=>{t||2!==e.button||e.target.classList.add("no-selection")}),[t]),m=(0,a.I4)((e=>{e.target.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(l(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,c]),h=(0,a.I4)((()=>{l(!1)}),[]),v=(0,a.I4)((()=>{d(void 0),document.body.classList.remove("no-selection")}),[]);return(0,a.d4)((()=>{if(t||!r.$b||s)return;const a=e.current;if(!a)return;let o;const u=()=>{o&&(clearTimeout(o),o=void 0)},m=e=>{t||r.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(u(),o=window.setTimeout((()=>(e=>{u();const{clientX:t,clientY:s,target:o}=e.touches[0];c||n&&o.matches("a[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),i(t)}),!0),r.fl&&r.cj&&a.addEventListener("mousedown",(function e(t){a.removeEventListener("mousedown",e,!0),i(t)}),!0),document.body.classList.add("no-selection"),l(!0),d({x:t,y:s}))})(e)),200))};return a.addEventListener("touchstart",m,{passive:!0}),a.addEventListener("touchcancel",u,!0),a.addEventListener("touchend",u,!0),a.addEventListener("touchmove",u,{passive:!0}),()=>{u(),a.removeEventListener("touchstart",m),a.removeEventListener("touchcancel",u,!0),a.removeEventListener("touchend",u,!0),a.removeEventListener("touchmove",u)}}),[c,t,s,e,n]),{isContextMenuOpen:o,contextMenuPosition:c,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:v}}},3394:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050);const r={width:0,left:0,height:0,top:0};function i(e,t,n,i,s){const[o,l]=(0,a.eJ)("right"),[c,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(),[h,v]=(0,a.eJ)(),[f,p]=(0,a.eJ)(!1),[g,Z]=(0,a.eJ)(""),[E,P]=(0,a.eJ)("opacity: 0;");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:o,y:c}=e;const u=o,h=c,f=i(),g=n(),{extraPaddingX:E=0,extraTopPadding:y=0,marginSides:C=0,extraMarginTop:b=0}=(null==s?void 0:s())||{},N=f?parseInt(getComputedStyle(f).marginTop,10)+b:void 0,w=f?{width:f.offsetWidth,height:f.offsetHeight+N}:r,k=g?g.getBoundingClientRect():r;let I,T;o+w.width+E0?(I="right",o-=3):(I="left",o=16),l(I),C&&"right"===I&&o+E+C>=k.width+k.left&&(o-=C),C&&"left"===I&&(o+E+C+w.width>=k.width+k.left?o-=C:o-C<=0&&(o+=C)),c+w.height{n.d(t,{Z:()=>i});var a=n(4050),r=n(9118);function i(e,t,n){return(0,a.Ye)((()=>(0,r.Ds)((e=>e()),e,!t,!n)),[e,t,n])}},5790:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(5116),i=n(9118);const s=(e,t,n,s)=>{const{loadMessage:o}=(0,r.uC)(),l=(0,a.Ye)((()=>{const n=(0,i.P2)(o,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:s})}}),[o,e,t,s]);(0,a.d4)((()=>{t&&!n&&l()}))}},5616:(e,t,n)=>{n.d(t,{d7:()=>i,yi:()=>s,mE:()=>o});var a=n(4050),r=n(6974);function i(e){const[t,n]=(0,a.eJ)((0,r.gO)(e));return(0,a.d4)((()=>(0,r.M2)(e,n)),[e]),t}function s(){const[e,t]=(0,a.eJ)((0,r.wC)());return(0,a.d4)((()=>(0,r.O6)(t)),[]),e}function o(){const[e,t]=(0,a.eJ)((0,r.Yz)());return(0,a.d4)((()=>(0,r.r_)(t)),[]),e}},8781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t)=>{(0,a.d4)((()=>{if(e&&!t)return e.addEventListener("wheel",n,{passive:!0}),()=>{e.removeEventListener("wheel",n)};function n(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},2515:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);function i(e,t,n){(0,a.d4)((()=>{t?r.wB||setTimeout((()=>{requestAnimationFrame((()=>{e.current&&e.current.focus()}))}),500):(e.current&&e.current.blur(),n&&setTimeout(n,300))}),[e,t,n])}},3657:(e,t,n)=>{n.d(t,{S1:()=>s,_N:()=>o,Op:()=>l});var a=n(4050),r=n(9118),i=n(8674);function s(e,t){let{rootRef:n,throttleMs:s,debounceMs:o,shouldSkipFirst:l,margin:c,threshold:d,isDisabled:u}=e;const m=(0,a.sO)(),h=(0,a.sO)(),v=(0,a.sO)(0),f=(0,a.sO)();h.current=t;const p=(0,a.I4)((()=>{v.current++}),[]),g=(0,a.I4)((()=>{v.current&&(v.current--,!v.current&&f.current&&(f.current(),f.current=void 0))}),[]);return(0,i.ZP)(p,g),(0,a.d4)((()=>{if(!u)return()=>{m.current&&(m.current.observer.disconnect(),m.current.callbacks.clear(),m.current=void 0)}}),[u]),{observe:(0,a.I4)(((e,t)=>{m.current||function(){const e=new Map,t=new Map,a=()=>{const n=Array.from(t.values());n.forEach((t=>{const a=e.get(t.target);a&&a(t,n)})),h.current&&h.current(n),t.clear()},i=s?r.P2:o?r.Ds:void 0,u=i?i(a,s||o,!l):a,p=new IntersectionObserver((e=>{e.forEach((e=>{t.set(e.target,e)})),v.current?f.current=()=>{u()}:u()}),{root:n.current,rootMargin:c?`${c}px`:void 0,threshold:d});m.current={observer:p,callbacks:e}}();const a=m.current;return a.observer.observe(e),t&&a.callbacks.set(e,t),()=>{t&&a.callbacks.delete(e),a.observer.unobserve(e)}}),[u]),freeze:p,unfreeze:g}}function o(e,t,n){(0,a.d4)((()=>t?t(e.current,n):void 0),[])}function l(e,t,n){const[r,i]=(0,a.eJ)(!t);return o(e,t,(e=>{i(e.isIntersecting),n&&n(e)})),r}},2357:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(0,a.sO)(e);(0,a.bt)((()=>{r.current=e}),[e]),(0,a.d4)((()=>{if(void 0===t)return;const e=setInterval((()=>r.current()),t);return n||r.current(),()=>clearInterval(e)}),[t,n])}},2645:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7204);const i=(e,t,n)=>{const i=(0,r.Z)(t);return(0,a.bt)((()=>e(i||[])),t,n)}},692:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(1212);function r(e){const t=Boolean(e),{transitionClassNames:n}=(0,a.Z)(t,void 0,t,"slow");return n}},2566:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(7361),i=n(6137),s=n(9118),o=n(647),l=n(5326),c=n(6926);const d={},u=()=>{const e=(0,a.sO)();return e.current||(e.current=(0,c.Z)(d),d[e.current]=!0),e.current};function m(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.IU.BlobUrl,c=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0,m=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const h=e?o.UV(e):void 0,v=n===i.IU.Stream||r.I_&&n===i.IU.Progressive,f=(0,l.Z)(),p=u(),[g,Z]=(0,a.eJ)(h&&!v?1:0),E=(0,a.sO)(),P=(0,a.Ye)((()=>(0,s.P2)((e=>{E.current&&(!d||Date.now()-E.current>d)&&Z(e)}),500,!0)),[d]);return(0,a.d4)((()=>{!t&&e&&(h?v&&setTimeout((()=>{Z(.75)}),1500):(Z(0),E.current&&o.cC(P),E.current=Date.now(),o.he(e,n,m,P,p).then((()=>{const e=Date.now()-E.current;E.current=void 0,!d||e>=d?f():setTimeout(f,d-e)}))))}),[t,e,h,n,c,f,v,d,P,m,p]),(0,a.d4)((()=>{t&&E.current&&(o.cC(P),Z(0),E.current=void 0)}),[P,t]),(0,a.d4)((()=>()=>{e&&o.Iq(e,p)}),[p,e]),{mediaData:h,loadProgress:g}}},6503:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7361);let i;function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=(0,a.sO)(!1),l=(0,a.I4)((()=>{o.current=!0}),[]);(0,a.d4)((()=>{i&&(clearTimeout(i),i=void 0),!e||r.$b||s||(i=window.setTimeout((()=>{o.current||t()}),2*n))}),[s,e,n,t]);const c=(0,a.I4)((()=>{o.current=!0}),[]),d=(0,a.I4)((()=>{o.current=!1,i&&(clearTimeout(i),i=void 0),i=window.setTimeout((()=>{o.current||t()}),n)}),[n,t]);return[c,d,l]}},2678:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(7204),i=n(5326),s=n(9290);function o(e,t){const n=(0,r.Z)(e,!0),o=(0,a.sO)(),l=(0,i.Z)(),c=null!=e,d=null!=n;return c&&o.current&&(clearTimeout(o.current),o.current=void 0),(0,s.Z)((()=>{t&&!c&&d&&!o.current&&(o.current=window.setTimeout((()=>{o.current=void 0,l()}),t))}),[e]),o.current&&t&&!c?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);function r(e,t){const n=(0,a.sO)(e),[r,i]=(0,a.eJ)(t);return[r,(0,a.I4)((e=>{i((t=>n.current(t,e)))}),[])]}},6389:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(5116),i=n(3716),s=n(9118);const o=(e,t)=>(0,a.Ye)((()=>(0,s.P2)((n=>{(0,r.uC)().sendMessageAction({chatId:e,threadId:t,action:n})}),i.o_)),[e,t])},971:(e,t,n)=>{n.d(t,{Y:()=>i});var a=n(4050),r=n(9290);function i(e){const t=(0,a.sO)(e);return(0,r.Z)((()=>{t.current=e}),[e]),t}},6898:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9118);function i(e,t){(0,a.d4)((()=>{const t=e.current;return()=>{t&&(0,r.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>i});const a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],r=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function i(e,t,n,i,s,o,l){if(Number.isNaN(o)||o<1)return;o|=0,Number.isNaN(l)&&(l=1),(l|=0)>3&&(l=3),l<1&&(l=1);const c=e.getImageData(t,n,i,s),d=c.data;let u,m,h,v,f,p,g,Z,E,P,y,C,b=i-1,N=s-1,w=o+1,k=[],I=[],T=[],S=a[o],M=r[o],L=[],x=[];for(;l-- >0;){for(C=y=0,f=0;fb?b:p)<<2),u+=d[g++],m+=d[g++],h+=d[g++];for(v=0;v0?g<<2:0),Z=C+L[v],E=C+x[v],u+=d[Z++]-d[E++],m+=d[Z++]-d[E++],h+=d[Z++]-d[E++],y++;C+=i<<2}for(v=0;vN?0:i,u+=k[P],m+=I[P],h+=T[P];for(y=v<<2,f=0;f>>M,d[y+1]=m*S>>>M,d[y+2]=h*S>>>M,0==v&&(L[f]=((g=f+w)0?g*i:0),Z=v+L[f],E=v+x[f],u+=k[Z]-k[E],m+=I[Z]-I[E],h+=T[Z]-T[E],y+=i<<2}}e.putImageData(c,t,n)}},396:(e,t,n)=>{n.d(t,{Es:()=>p,z2:()=>g,An:()=>P});var a=n(5116),r=n(1713),i=n(7361),s=n(4753),o=n(5266),l=n(8415),c=n(9118),d=n(9066);const u=new Map;let m,h=[],v=[];function f(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const i=E(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!i)return;if(!u.has(i))return void(0,a.uC)().openAudioPlayer((0,l.Ak)(y(i).messageKey));const o=u.get(i);o.onForcePlay&&o.onForcePlay(),m=i,o.audio.src&&(0,s.Z)(o.audio)}function p(){const e=m&&u.get(m);e&&e.audio.pause()}function g(e,t,n,p,g){if(!u.has(e)){const n=function(e,t,n,a){const r=new Audio;function i(t){return n=>{u.has(e)&&((0,o.z)(r)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return r.addEventListener("timeupdate",i("onTimeUpdate")),r.addEventListener("play",i("onPlay")),r.addEventListener("pause",i("onPause")),r.addEventListener("loadstart",i("onLoadStart")),r.addEventListener("loadeddata",i("onLoadedData")),r.addEventListener("playing",i("onPlaying")),r.addEventListener("ended",(()=>{u.has(e)&&((0,o.z)(r)||f(e))})),{audio:r,type:t,proxy:new Proxy(r,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,p,g);u.set(e,n),function(e,t){"audio"!==e.type||v.includes(t)||(v.push(t),v.sort(C)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(C))}(n,e)}const{audio:Z,proxy:P,handlers:b}=u.get(e);return b.push(n),{play(n){if(!Z.paused)return;const c=m&&u.get(m);c&&m!==e&&(c.audio.pause(),c.audio.currentTime=0,(0,o.z)(c.audio)&&(c.audio.dataset.preventPlayAfterPatch="true"),c.onTrackChange&&c.onTrackChange()),m=e,Z.src||(Z.src=n,Z.preload="auto",n.includes("/progressive/")&&i.s$&&(delete Z.dataset.preventPlayAfterPatch,(0,o.B)(Z))),(0,s.Z)(Z),function(e,t){var n;if((0,a.Rd)().globalSearch.currentContent===r.nJ.Music)return;const{chatId:i}=(0,l.Ak)(y(t).messageKey),s=null===(n=(0,d.Bt)((0,a.Rd)()))||void 0===n?void 0:n.chatId,o=e=>e.startsWith(`msg${i}`)||s&&e.startsWith(`msg${s}`);"audio"===e&&(v=v.filter(o)),"voice"===e&&(h=h.filter(o))}(t,e)},pause(){m===e&&Z.pause()},stop(){if(m===e){const e=Z.src;Z.pause(),(0,c.T2)((()=>{Z.src="",Z.src=e}))}},setCurrentTime(t){m===e&&(Z.fastSeek?Z.fastSeek(t):Z.currentTime=t)},setVolume(t){m===e&&(Z.volume=t,Z.muted=!1)},setPlaybackRate(t){m===e&&(Z.playbackRate=t)},toggleMuted(e){Z.muted=void 0===e?!Z.muted:e},proxy:P,requestNextTrack(){f(e)},isLast:()=>!E(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!E(e,(0,a.Rd)().audioPlayer.origin,!0),requestPreviousTrack(){f(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(v=v.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function Z(e){switch(e.type){case"audio":return v;case"voice":return h;default:return}}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Cr.Inline,n=arguments.length>2?arguments[2]:void 0;const a=u.get(e),i=Z(a);if(!i)return;if(t===r.Cr.Search){const t=i.indexOf(e);if(t<0)return;return i[t+(n?-1:1)]}const{chatId:s}=(0,l.Ak)(y(e).messageKey),o=i.filter((e=>e.startsWith(`msg${s}`))),c=o.indexOf(e);if(c<0)return;let d=t===r.Cr.Inline?-1:1;return n&&(d*=-1),o[c+d]}function P(e){return`${(0,l.Tp)(e)}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=y(e),{date:r,messageKey:i}=y(t),s=r-n;return 0===s?i.localeCompare(a):s}},1174:(e,t,n)=>{n.d(t,{eM:()=>r,vJ:()=>i,sf:()=>c});var a=n(7361);let r;!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(r||(r={}));const i=20;function s(e,t){return t?Math.sqrt((t.pageX-e.pageX)**2+(t.pageY-e.pageY)**2):0}function o(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let l=0;function c(e,t){let n,c,d=!1,u=!1,m=0,h={x:window.innerWidth/2,y:window.innerHeight/2};function v(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",p),document.addEventListener("mouseup",f);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",p,{passive:!0}),t.addEventListener("touchend",f),t.addEventListener("touchcancel",f),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(m=s(e.touches[0],e.touches[1]),h=o(e.touches[0],e.touches[1])))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function f(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",f),document.removeEventListener("mousemove",p),n.target.removeEventListener("touchcancel",f),n.target.removeEventListener("touchend",f),n.target.removeEventListener("touchmove",p),a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),e&&(d?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-l<300?t.onDoubleClick(e,{centerX:n.pageX,centerY:n.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),l=Date.now()))),d=!1,u=!1,m=0,c=void 0,h={x:window.innerWidth/2,y:window.innerHeight/2},n=void 0}function p(e){if(n){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&m>0&&2===e.touches.length)){const n=s(e.touches[0],e.touches[1]),a=o(e.touches[0],e.touches[1]),r=a.x-h.x,i=a.y-h.y,l=n/m;t.onZoom(e,{zoomFactor:l,initialCenterX:h.x,initialCenterY:h.y,dragOffsetX:r,dragOffsetY:i,currentCenterX:a.x,currentCenterY:a.y}),1!==l&&(d=!0)}const l=e.pageX-n.pageX,v=e.pageY-n.pageY;(Math.abs(l)>=15||Math.abs(v)>=15)&&(d=!0);let f=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:l,dragOffsetY:v}),f=!0),t.onSwipe&&!u&&(u=function(e,n,s){if(a.cj){const t=e.touches[0].pageX;if(t<=i||t>=window.innerWidth-i)return!1}const o=Math.abs(n),l=Math.abs(s);if(n&&s&&Math.max(o,l)/Math.min(o,l)<2)return!1;let d;if(o>=50?d="x":l>=50&&(d="y"),!d)return!1;if(c){if(c!==d)return!1}else c=d;return function(e,t,n,a,i){return"x"===t?i(e,n<0?r.Left:r.Right):"y"===t&&i(e,a<0?r.Up:r.Down)}(e,d,n,s,t.onSwipe)}(e,l,v),f=u),a.cj&&f&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",v),e.addEventListener("touchstart",v,{passive:!t.isNotPassive}),()=>{f(),e.removeEventListener("touchstart",v),e.removeEventListener("mousedown",v)}}},1279:(e,t,n)=>{function a(e,t,n){i("transitionend",e,t,n)}function r(e,t,n){i("animationend",e,t,n)}function i(e,t,n,a){let r=!1;t.addEventListener(e,(function i(s){r||s.target!==s.currentTarget||a&&(s instanceof TransitionEvent&&s.propertyName===a||s instanceof AnimationEvent&&s.animationName===a)||(r=!0,t.removeEventListener(e,i),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>a,f:()=>r})},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},539:(e,t,n)=>{n.d(t,{Z:()=>u,N:()=>m});var a=n(5116),r=n(1713),i=n(3716),s=n(7361),o=n(8674),l=n(9933),c=n(9118);let d=!1;function u(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.V$,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0;const u=h(e,t,o,l);l!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===i.oB&&(c=0),v(e,t,u,n,s,c,d)):v(e,t,u,n,s,0)}function m(){return d}function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.V$,a=arguments.length>3?arguments[3]:void 0;const{offsetTop:s}=t,{scrollTop:o}=e;if(void 0===a){const t=s-e.scrollTop;if(t<-n)return o+(t+n);if(t>n)return o+(t-n)}else{if(a===r.fo.Up)return s+n;if(a===r.fo.Down)return Math.max(0,s-n)}return o}function v(e,t,n,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5?arguments[5]:void 0,m=arguments.length>6?arguments[6]:void 0;const{offsetTop:h,offsetHeight:v}=t,{scrollTop:g,offsetHeight:Z,scrollHeight:E}=e,P=m&&e.dataset.normalHeight?Number(e.dataset.normalHeight):Z;let y;switch(g!==n&&(e.scrollTop=n),a){case"start":y=h-r-n+(s.wZ?1:0);break;case"end":y=h+v+r-(n+P);break;case"nearest":case"center":case"centerOrTop":y=v0){const e=E-(n+P);y=Math.min(y,e)}if(0===y)return;const C=n+y;if(0===u)return void(e.scrollTop=C);d=!0;const b=Math.abs(y),N=b{(0,l.cK)((()=>{const t=Math.min((Date.now()-k)/w,1),n=y*(1-N(t));return e.scrollTop=Math.round(C-n),d=t<1,d||I(),d}))}))}function f(e){return 1-(1-e)**5}function p(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(5116),r=n(3716),i=n(9933),s=n(9118);function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300;(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),l(e,t,n)}function l(e,t,n){const a="rtl"===e.getAttribute("dir"),{scrollLeft:r,offsetWidth:o,scrollWidth:l}=e;let c=t-r;if(c<0){const e=-r*(a?-1:1);c=Math.max(c,e)}else if(c>0){const e=l-(r+o);c=Math.min(c,e)}if(0===c)return;const d=r+c;if(0===n)return void(e.scrollLeft=d);const u=Date.now();(0,s.T2)((()=>{(0,i.jt)((()=>{const t=Math.min((Date.now()-u)/n,1),a=c*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(d-a),t<1}))}))}},5723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(7361);function r(e,t,n){if(!t&&e===document.activeElement)return;const r=window.getSelection(),i=document.createRange(),s=e.lastChild||e;a.$b||n||s&&s.nodeValue?(i.selectNodeContents(n?e:s),i.collapse(!1),r.removeAllRanges(),r.addRange(i)):e.focus()}},7529:(e,t,n)=>{function a(e){const t="key"in e?e.key:e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}n.d(t,{Z:()=>a})},998:(e,t,n)=>{function a(){var e;let t=null===(e=window.getSelection())||void 0===e?void 0:e.getRangeAt(0).cloneContents();if(!t||0===t.childElementCount)return;const n=Array.from(t.children).reduce(((e,t)=>1===t.nodeType&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):1===t.nodeType&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n}n.d(t,{Z:()=>a})},4532:(e,t,n)=>{n.d(t,{N:()=>r,Ym:()=>i,Ay:()=>o,pC:()=>l,NS:()=>c,Of:()=>d});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function r(e,t){const{mediaSession:n}=window.navigator;n?(e&&i(e),t&&s(t)):console.warn("MediaSession API not supported in this browser")}function i(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function s(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((e=>{let[n,a]=e;try{t.setActionHandler(n,a)}catch(e){}}))}function o(){const{mediaSession:e}=window.navigator;var t;e&&(e.metadata=null,s(a),e.playbackState&&(e.playbackState="none"),null===(t=e.setPositionState)||void 0===t||t.call(e))}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){var t;if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:n}=window.navigator;null==n||null===(t=n.setPositionState)||void 0===t||t.call(n,e)}function d(e){let{title:t,artist:n,album:a,artwork:r}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:a,artwork:r})}},3099:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(6137),r=n(7361);const i={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote};function s(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return r.op||(t=t.replace(/]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/ /g," "),t=t.replace(/
]*)?><\/div>/g,"\n"),t=t.replace(/]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)
/g,"\n"),t=t.replace(/
/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"
$1
"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"
$1
"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"$1"),t=t.replace(/(^|\s)(?!)(\s|$)/g,"$1$2$3"),t=t.replace(/(^|\s)(?!)(\s|$)/g,"$1$2$3"),t=t.replace(/(^|\s)(?!)(\s|$)/g,"$1$2$3"),t=t.replace(/(^|\s)(?!)(\s|$)/g,`$1$2$3`),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let s=0,o=0;const l=[];function c(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(i[e.nodeName])return i[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const s=t.indexOf(e.textContent,n),o=s>=0?s:n,l=t.substring(0,o).length,{length:c}=t.substring(o,o+e.textContent.length);let d,u;return r===a.Vv.TextUrl&&(d=e.href),r===a.Vv.MentionName&&(u=e.dataset.userId),{index:o,entity:{type:r,offset:l,length:c,...d&&{url:d},...u&&{userId:u}}}}(e,n,s);r?(s=t,l.push(r)):e.textContent&&(s+=e.textContent.length),e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(c))}return Array.from(t.childNodes).forEach((e=>{o=1,c(e)})),{text:n,entities:l.length?l:void 0}}},5266:(e,t,n)=>{function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.dataset.patchForSafariInProgress="true",e.addEventListener("progress",(function n(){e.buffered.length&&(e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&!e.dataset.preventPlayAfterPatch&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>a,z:()=>r})},3227:(e,t,n)=>{n.d(t,{Z:()=>a});const a=e=>{e.stopPropagation(),e.preventDefault()}}}]); -//# sourceMappingURL=347.595121c92ffb31ae37da.js.map \ No newline at end of file +//# sourceMappingURL=347.b7e411d2828cadec556d.js.map \ No newline at end of file diff --git a/dist/347.595121c92ffb31ae37da.js.map b/dist/347.b7e411d2828cadec556d.js.map similarity index 99% rename from dist/347.595121c92ffb31ae37da.js.map rename to dist/347.b7e411d2828cadec556d.js.map index 873bdf8f..bbc7acb7 100644 --- a/dist/347.595121c92ffb31ae37da.js.map +++ b/dist/347.b7e411d2828cadec556d.js.map @@ -1 +1 @@ -{"version":3,"file":"347.595121c92ffb31ae37da.js","mappings":"qNAgCA,MAuEA,GAAeA,EAAAA,EAAAA,KArEqB,IAY9B,UAZ+B,QACnCC,EADmC,OAEnCC,EAFmC,MAGnCC,EAHmC,QAInCC,EAJmC,KAKnCC,EAAO,SAL4B,oBAMnCC,EANmC,aAOnCC,EAPmC,iBAQnCC,EARmC,UASnCC,EATmC,OAUnCC,EAVmC,wBAWnCC,GACI,EACJ,MAAM,oBACJC,EADI,kBAEJC,EAFI,IAGJC,EAHI,MAIJC,EAJI,MAKJC,EALI,YAMJC,EANI,QAOJC,IACEC,EAAAA,EAAAA,GAAiBd,EAAMK,EAAQD,EAAWL,EAASO,EAAyBR,OAAOiB,EAAWlB,MAAAA,OAA9E,EAA8EA,EAAQmB,OAEpGC,EAAkB,UAASrB,EAAQsB,KAEnCC,GAAiBC,EAAAA,EAAAA,IAAkBX,EAAKR,GAExCoB,EAAY,UAAGzB,EAAQ0B,iBAAX,aAAG,EAAmBC,QAClCC,GAAiBC,EAAAA,EAAAA,GACpB,GAAER,YACFE,IAAmBhB,EACpBuB,EAAAA,GAAAA,QACAxB,G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AM6tB,KAAKkc,EAAK/B,YAAYtpC,QAAQmrD,IASxC,OALA7pD,MAAM6tB,KAAK07B,EAASvhB,YAAYtpC,SAASqrC,IACvC4f,EAAoB,EACpBE,EAAU9f,MAGL,CACLl+B,KAAAA,EACA+9C,SAAUA,EAASvrD,OAASurD,OAAW5tD,K,eC9CpC,SAASwjD,EAA4B6K,GACtCA,EAAQvzB,QAAQwzB,mBAIpBD,EAAQ3oC,iBAAiB,QAAQ,KAC/B,MAAMklC,EAAIyD,EAAQld,YAElBkd,EAAQvzB,QAAQyzB,yBAA2B,OAiB3CF,EAAQ3oC,iBAAiB,YAhBzB,SAAS8vB,IACF6Y,EAAQrZ,SAAS3yC,SAGtBgsD,EAAQld,YAAckd,EAAQ3lD,SAAW,EACzC2lD,EAAQ3oC,iBAAiB,YAAY,YAC5B2oC,EAAQvzB,QAAQyzB,yBACvBF,EAAQld,YAAcyZ,EAClByD,EAAQnb,SAAWmb,EAAQvzB,QAAQuoB,uBACrCgL,EAAQ3sD,SAET,CAAEikB,MAAM,IAEX0oC,EAAQtgC,oBAAoB,WAAYynB,SAIzC,CAAE7vB,MAAM,IAEX0oC,EAAQvzB,QAAQwzB,iBAAmB,QAG9B,SAASjb,EAAwBgb,GACtC,OAAOrtD,QAAQqtD,EAAQvzB,QAAQyzB,0B,0DClCjC,MAKA,EALmBzjD,IACjBA,EAAEM,kBACFN,EAAE6U","sources":["webpack://telegram-t/./src/components/common/AnimatedEmoji.tsx","webpack://telegram-t/./src/components/common/helpers/waveform.ts","webpack://telegram-t/./src/util/waveform.ts","webpack://telegram-t/./src/components/common/Audio.tsx","webpack://telegram-t/./src/components/common/ChatExtra.tsx","webpack://telegram-t/./src/components/common/DeleteChatModal.tsx","webpack://telegram-t/./src/components/common/Document.tsx","webpack://telegram-t/./src/components/common/DotAnimation.tsx","webpack://telegram-t/./src/components/common/File.tsx","webpack://telegram-t/./src/components/common/GroupChatInfo.tsx","webpack://telegram-t/./src/components/common/LastMessageMeta.tsx","webpack://telegram-t/./src/components/common/Media.tsx","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.tsx","webpack://telegram-t/./src/components/common/NothingFound.tsx","webpack://telegram-t/./src/components/common/Picker.tsx","webpack://telegram-t/./src/components/common/PickerSelectedItem.tsx","webpack://telegram-t/./src/components/common/PrivateChatInfo.tsx","webpack://telegram-t/./src/components/common/ProfilePhoto.tsx","webpack://telegram-t/./src/components/common/ProfileInfo.tsx","webpack://telegram-t/./src/components/common/hooks/usePhotosPreload.ts","webpack://telegram-t/./src/components/common/ReactionStaticEmoji.tsx","webpack://telegram-t/./src/components/common/StickerButton.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.async.tsx","webpack://telegram-t/./src/components/common/TypingStatus.tsx","webpack://telegram-t/./src/components/common/VerifiedIcon.tsx","webpack://telegram-t/./src/components/common/WebLink.tsx","webpack://telegram-t/./src/components/common/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/common/hooks/useAnimatedEmoji.ts","webpack://telegram-t/./src/components/left/ChatFolderModal.async.tsx","webpack://telegram-t/./src/components/left/main/hooks/useChatAnimationType.ts","webpack://telegram-t/./src/components/left/main/Badge.tsx","webpack://telegram-t/./src/components/left/main/ChatCallStatus.tsx","webpack://telegram-t/./src/components/left/main/Chat.tsx","webpack://telegram-t/./src/components/left/main/EmptyFolder.tsx","webpack://telegram-t/./src/components/left/main/ChatList.tsx","webpack://telegram-t/./src/components/left/search/helpers/getSenderName.ts","webpack://telegram-t/./src/components/middle/composer/DropTarget.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MessageInput.tsx","webpack://telegram-t/./src/components/middle/composer/TextFormatter.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/getFilesFromDataTransferItems.ts","webpack://telegram-t/./src/components/middle/composer/helpers/prepareForRegExp.ts","webpack://telegram-t/./src/components/middle/composer/helpers/selection.ts","webpack://telegram-t/./src/util/memoized.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEmojiTooltip.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useMentionTooltip.ts","webpack://telegram-t/./src/components/right/hooks/useAsyncRendering.ts","webpack://telegram-t/./src/components/ui/CheckboxGroup.tsx","webpack://telegram-t/./src/components/ui/FloatingActionButton.tsx","webpack://telegram-t/./src/components/ui/ListItem.tsx","webpack://telegram-t/./src/components/ui/Notification.tsx","webpack://telegram-t/./src/components/ui/ProgressSpinner.tsx","webpack://telegram-t/./src/components/ui/Radio.tsx","webpack://telegram-t/./src/components/ui/RadioGroup.tsx","webpack://telegram-t/./src/components/ui/RangeSlider.tsx","webpack://telegram-t/./src/components/ui/SearchInput.tsx","webpack://telegram-t/./src/components/ui/ShowTransition.tsx","webpack://telegram-t/./src/components/ui/Switcher.tsx","webpack://telegram-t/./src/components/ui/Tab.tsx","webpack://telegram-t/./src/components/ui/TabList.tsx","webpack://telegram-t/./src/components/ui/Transition.tsx","webpack://telegram-t/./src/hooks/reducers/useFoldersReducer.ts","webpack://telegram-t/./src/hooks/useAudioPlayer.ts","webpack://telegram-t/./src/hooks/useBlur.ts","webpack://telegram-t/./src/hooks/useBlurSync.ts","webpack://telegram-t/./src/hooks/useBuffering.ts","webpack://telegram-t/./src/hooks/useCanvasBlur.ts","webpack://telegram-t/./src/hooks/useChatContextActions.ts","webpack://telegram-t/./src/hooks/useContextMenuHandlers.ts","webpack://telegram-t/./src/hooks/useContextMenuPosition.ts","webpack://telegram-t/./src/hooks/useDebounce.ts","webpack://telegram-t/./src/hooks/useEnsureMessage.ts","webpack://telegram-t/./src/hooks/useFolderManager.ts","webpack://telegram-t/./src/hooks/useHorizontalScroll.ts","webpack://telegram-t/./src/hooks/useInputFocusOnOpen.ts","webpack://telegram-t/./src/hooks/useIntersectionObserver.ts","webpack://telegram-t/./src/hooks/useInterval.ts","webpack://telegram-t/./src/hooks/useLayoutEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useMediaTransition.ts","webpack://telegram-t/./src/hooks/useUniqueId.ts","webpack://telegram-t/./src/hooks/useMediaWithLoadProgress.ts","webpack://telegram-t/./src/hooks/useMouseInside.ts","webpack://telegram-t/./src/hooks/usePrevDuringAnimation.ts","webpack://telegram-t/./src/hooks/useReducer.ts","webpack://telegram-t/./src/hooks/useSendMessageAction.ts","webpack://telegram-t/./src/hooks/useStateRef.ts","webpack://telegram-t/./src/hooks/useVideoCleanup.ts","webpack://telegram-t/./src/lib/fastBlur.js","webpack://telegram-t/./src/util/audioPlayer.ts","webpack://telegram-t/./src/util/captureEvents.ts","webpack://telegram-t/./src/util/cssAnimationEndListeners.ts","webpack://telegram-t/./src/util/cycleRestrict.ts","webpack://telegram-t/./src/util/fastSmoothScroll.ts","webpack://telegram-t/./src/util/fastSmoothScrollHorizontal.ts","webpack://telegram-t/./src/util/focusEditableElement.ts","webpack://telegram-t/./src/util/getKeyFromEvent.ts","webpack://telegram-t/./src/util/getMessageIdsForSelectedText.ts","webpack://telegram-t/./src/util/mediaSession.ts","webpack://telegram-t/./src/util/parseMessageInput.ts","webpack://telegram-t/./src/util/patchSafariProgressiveAudio.ts","webpack://telegram-t/./src/util/stopEvent.ts"],"sourcesContent":["import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\nimport { ActiveEmojiInteraction } from '../../global/types';\n\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaTransition from '../../hooks/useMediaTransition';\nimport useAnimatedEmoji from './hooks/useAnimatedEmoji';\nimport { LIKE_STICKER_ID } from './helpers/mediaDimensions';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './AnimatedEmoji.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n effect?: ApiSticker;\n isOwn?: boolean;\n soundId?: string;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n messageId?: number;\n chatId?: string;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\nconst QUALITY = 1;\n\nconst AnimatedEmoji: FC = ({\n sticker,\n effect,\n isOwn,\n soundId,\n size = 'medium',\n observeIntersection,\n lastSyncTime,\n forceLoadPreview,\n messageId,\n chatId,\n activeEmojiInteractions,\n}) => {\n const {\n markAnimationLoaded,\n isAnimationLoaded,\n ref,\n width,\n style,\n handleClick,\n playKey,\n } = useAnimatedEmoji(size, chatId, messageId, soundId, activeEmojiInteractions, isOwn, undefined, effect?.emoji);\n\n const localMediaHash = `sticker${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail?.dataUri;\n const previewBlobUrl = useMedia(\n `${localMediaHash}?size=m`,\n !isIntersecting && !forceLoadPreview,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const transitionClassNames = useMediaTransition(previewBlobUrl);\n\n const mediaData = useMedia(localMediaHash, !isIntersecting, ApiMediaFormat.Lottie, lastSyncTime);\n const isMediaLoaded = Boolean(mediaData);\n\n return (\n \n {!isAnimationLoaded && thumbDataUri && (\n \"\"\n )}\n {!isAnimationLoaded && previewBlobUrl && (\n \"\"\n )}\n {isMediaLoaded && localMediaHash && (\n \n )}\n
\n );\n};\n\nexport default memo(AnimatedEmoji);\n","type IWaveformProps = {\n peak: number;\n fillStyle: string;\n progressFillStyle: string;\n};\n\nexport const MAX_EMPTY_WAVEFORM_POINTS = 30;\nconst SPIKE_WIDTH = 2;\nconst SPIKE_STEP = 4;\nconst SPIKE_RADIUS = 1;\nconst HEIGHT = 23;\n\nexport function renderWaveform(\n canvas: HTMLCanvasElement,\n spikes: number[],\n progress: number,\n {\n peak, fillStyle, progressFillStyle,\n }: IWaveformProps,\n) {\n const width = spikes.length * SPIKE_STEP;\n const height = HEIGHT;\n\n canvas.width = width * 2;\n canvas.height = height * 2;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n\n const ctx = canvas.getContext('2d')!;\n ctx.scale(2, 2);\n\n spikes.forEach((item, i) => {\n ctx.globalAlpha = (i / spikes.length >= progress) ? 0.5 : 1;\n ctx.fillStyle = progress > i / spikes.length ? progressFillStyle : fillStyle;\n const spikeHeight = Math.max(2, HEIGHT * (item / Math.max(1, peak)));\n roundedRectangle(ctx, i * SPIKE_STEP, height, SPIKE_WIDTH, spikeHeight, SPIKE_RADIUS);\n ctx.fill();\n });\n}\n\nfunction roundedRectangle(\n ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number,\n) {\n if (width < 2 * radius) {\n radius = width / 2;\n }\n if (height < 2 * radius) {\n radius = height / 2;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.arcTo(x + width, y, x + width, y - height, radius);\n ctx.arcTo(x + width, y - height, x, y - height, radius);\n ctx.arcTo(x, y - height, x, y, radius);\n ctx.arcTo(x, y, x + width, y, radius);\n ctx.closePath();\n}\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\n// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018\nexport function decodeWaveform(encoded5bit: Uint8Array) {\n const bitsCount = encoded5bit.length * 8;\n const valuesCount = Math.floor(bitsCount / 5);\n if (!valuesCount) {\n return [];\n }\n\n // Read each 5 bit of encoded5bit as 0-31 unsigned char.\n // We count the index of the byte in which the desired 5-bit sequence starts.\n // And then we read a uint16 starting from that byte to guarantee to get all of those 5 bits.\n //\n // BUT! if it is the last byte we have, we're not allowed to read a uint16 starting with it.\n // Because it will be an overflow (we'll access one byte after the available memory).\n // We see, that only the last 5 bits could start in the last available byte and be problematic.\n // So we read in a general way all the entries in a general way except the last one.\n const result = Array(valuesCount);\n const bitsData = encoded5bit;\n for (let i = 0, l = valuesCount - 1; i !== l; ++i) {\n const byteIndex = Math.floor((i * 5) / 8);\n const bitShift = Math.floor((i * 5) % 8);\n const value = bitsData[byteIndex] + (bitsData[byteIndex + 1] << 8);\n result[i] = ((value >> bitShift) & 0x1F);\n }\n const lastByteIndex = Math.floor(((valuesCount - 1) * 5) / 8);\n const lastBitShift = Math.floor(((valuesCount - 1) * 5) % 8);\n const lastValue = bitsData[lastByteIndex] + (bitsData[lastByteIndex + 1] << 8);\n result[valuesCount - 1] = (lastValue >> lastBitShift) & 0x1F;\n\n return result;\n}\n\nexport function interpolateArray(data: number[], fitCount: number) {\n let peak = 0;\n const newData = new Array(fitCount);\n const springFactor = data.length / fitCount;\n const leftFiller = data[0];\n const rightFiller = data[data.length - 1];\n for (let i = 0; i < fitCount; i++) {\n const idx = Math.floor(i * springFactor);\n const val = ((data[idx - 1] ?? leftFiller) + (data[idx] ?? leftFiller) + (data[idx + 1] ?? rightFiller)) / 3;\n newData[i] = val;\n if (peak < val) {\n peak = val;\n }\n }\n return { data: newData, peak };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport {\n ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice,\n} from '../../api/types';\nimport { AudioOrigin, ISettings } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';\nimport {\n getMediaDuration,\n getMediaTransferState,\n getMessageMediaFormat,\n getMessageMediaHash,\n isMessageLocal,\n isOwnMessage,\n} from '../../modules/helpers';\nimport { MAX_EMPTY_WAVEFORM_POINTS, renderWaveform } from './helpers/waveform';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport { getFileSizeString } from './helpers/documentInfo';\nimport { decodeWaveform, interpolateArray } from '../../util/waveform';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport { captureEvents } from '../../util/captureEvents';\nimport useMedia from '../../hooks/useMedia';\nimport { makeTrackId } from '../../util/audioPlayer';\nimport { getTranslation } from '../../util/langProvider';\n\nimport Button from '../ui/Button';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './Audio.scss';\n\ntype OwnProps = {\n theme: ISettings['theme'];\n message: ApiMessage;\n senderTitle?: string;\n uploadProgress?: number;\n origin: AudioOrigin;\n date?: number;\n lastSyncTime?: number;\n className?: string;\n isSelectable?: boolean;\n isSelected?: boolean;\n isDownloading: boolean;\n onPlay: (messageId: number, chatId: string) => void;\n onReadMedia?: () => void;\n onCancelUpload?: () => void;\n onDateClick?: (messageId: number, chatId: string) => void;\n};\n\nconst AVG_VOICE_DURATION = 10;\nconst MIN_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 20 : 25;\nconst MAX_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 50 : 75;\n// This is needed for browsers requiring user interaction before playing.\nconst PRELOAD = true;\n\nconst Audio: FC = ({\n theme,\n message,\n senderTitle,\n uploadProgress,\n origin,\n date,\n lastSyncTime,\n className,\n isSelectable,\n isSelected,\n isDownloading,\n onPlay,\n onReadMedia,\n onCancelUpload,\n onDateClick,\n}) => {\n const { content: { audio, voice, video }, isMediaUnread } = message;\n const isVoice = Boolean(voice || video);\n const isSeeking = useRef(false);\n const playStateBeforeSeeking = useRef(false);\n // eslint-disable-next-line no-null/no-null\n const seekerRef = useRef(null);\n const lang = useLang();\n const { isRtl } = lang;\n const dispatch = getDispatch();\n\n const [isActivated, setIsActivated] = useState(false);\n const shouldLoad = (isActivated || PRELOAD) && lastSyncTime;\n const coverHash = getMessageMediaHash(message, 'pictogram');\n const coverBlobUrl = useMedia(coverHash, false, ApiMediaFormat.BlobUrl);\n\n const mediaData = useMedia(\n getMessageMediaHash(message, 'inline'),\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n );\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'download'),\n !isDownloading,\n );\n\n const handleForcePlay = useCallback(() => {\n setIsActivated(true);\n onPlay(message.id, message.chatId);\n }, [message, onPlay]);\n\n const handleTrackChange = useCallback(() => {\n setIsActivated(false);\n }, []);\n\n const {\n isBuffered, bufferedProgress, bufferingHandlers, checkBuffering,\n } = useBuffering();\n\n const {\n isPlaying, playProgress, playPause, play, pause, setCurrentTime, duration,\n } = useAudioPlayer(\n makeTrackId(message),\n getMediaDuration(message)!,\n isVoice ? 'voice' : 'audio',\n mediaData,\n bufferingHandlers,\n undefined,\n checkBuffering,\n isActivated,\n handleForcePlay,\n handleTrackChange,\n isMessageLocal(message),\n );\n\n const isOwn = isOwnMessage(message);\n const waveformCanvasRef = useWaveformCanvas(theme, voice, (isMediaUnread && !isOwn) ? 1 : playProgress, isOwn);\n\n const withSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n\n useEffect(() => {\n setIsActivated(isPlaying);\n }, [isPlaying]);\n\n const isLoadingForPlaying = isActivated && !isBuffered;\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n uploadProgress || downloadProgress,\n isLoadingForPlaying || isDownloading,\n );\n\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring);\n\n const shouldRenderCross = shouldRenderSpinner && (isLoadingForPlaying || isUploading);\n\n const handleButtonClick = useCallback(() => {\n if (isUploading) {\n onCancelUpload?.();\n return;\n }\n\n if (!isPlaying) {\n onPlay(message.id, message.chatId);\n }\n\n getDispatch().setAudioPlayerOrigin({ origin });\n setIsActivated(!isActivated);\n playPause();\n }, [isUploading, isPlaying, isActivated, playPause, onCancelUpload, onPlay, message.id, message.chatId, origin]);\n\n useEffect(() => {\n if (onReadMedia && isMediaUnread && (isPlaying || isDownloading)) {\n onReadMedia();\n }\n }, [isPlaying, isMediaUnread, onReadMedia, isDownloading]);\n\n const handleDownloadClick = useCallback(() => {\n if (isDownloading) {\n dispatch.cancelMessageMediaDownload({ message });\n } else {\n dispatch.downloadMessageMedia({ message });\n }\n }, [dispatch, isDownloading, message]);\n\n const handleSeek = useCallback((e: MouseEvent | TouchEvent) => {\n if (isSeeking.current && seekerRef.current) {\n const { width, left } = seekerRef.current.getBoundingClientRect();\n const clientX = e instanceof MouseEvent ? e.clientX : e.targetTouches[0].clientX;\n e.stopPropagation(); // Prevent Slide-to-Reply activation\n // Prevent track skipping while seeking near end\n setCurrentTime(Math.max(Math.min(duration * ((clientX - left) / width), duration - 0.1), 0.001));\n }\n }, [duration, setCurrentTime]);\n\n const handleStartSeek = useCallback((e: MouseEvent | TouchEvent) => {\n if (e instanceof MouseEvent && e.button === 2) return;\n isSeeking.current = true;\n playStateBeforeSeeking.current = isPlaying;\n pause();\n handleSeek(e);\n }, [handleSeek, pause, isPlaying]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n if (playStateBeforeSeeking.current) play();\n }, [play]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n useEffect(() => {\n if (!seekerRef.current || !withSeekline) return undefined;\n return captureEvents(seekerRef.current, {\n onCapture: handleStartSeek,\n onRelease: handleStopSeek,\n onClick: handleStopSeek,\n onDrag: handleSeek,\n });\n }, [withSeekline, handleStartSeek, handleSeek, handleStopSeek]);\n\n function renderFirstLine() {\n if (isVoice) {\n return senderTitle || 'Voice';\n }\n\n const { title, fileName } = audio!;\n\n return title || fileName;\n }\n\n function renderSecondLine() {\n if (isVoice) {\n return (\n
\n {formatMediaDuration((voice || video)!.duration)}\n
\n );\n }\n\n const { performer } = audio!;\n\n return (\n
\n {formatMediaDuration(duration)}\n \n {performer && {renderText(performer)}}\n {performer && senderTitle && }\n {senderTitle && {renderText(senderTitle)}}\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Audio',\n className,\n isOwn && origin === AudioOrigin.Inline && 'own',\n (origin === AudioOrigin.Search || origin === AudioOrigin.SharedMedia) && 'bigger',\n isSelected && 'audio-is-selected',\n );\n\n const buttonClassNames = ['toggle-play'];\n if (shouldRenderCross) {\n buttonClassNames.push('loading');\n } else if (isPlaying) {\n buttonClassNames.push('pause');\n } else if (!isPlaying) {\n buttonClassNames.push('play');\n }\n\n const contentClassName = buildClassName('content', withSeekline && 'with-seekline');\n\n function renderWithTitle() {\n return (\n <>\n
\n
\n

{renderText(renderFirstLine())}

\n\n
\n {date && (\n \n {formatPastTimeShort(lang, date * 1000)}\n \n )}\n
\n
\n\n {withSeekline && (\n
\n \n {playProgress < 1 && `${formatMediaDuration(duration * playProgress, duration)}`}\n \n {renderSeekline(playProgress, bufferedProgress, seekerRef)}\n
\n )}\n {!withSeekline && renderSecondLine()}\n
\n \n );\n }\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n \n \n \n \n {shouldRenderSpinner && (\n
\n \n
\n )}\n {audio && !isUploading && (\n \n \n \n )}\n {origin === AudioOrigin.Search && renderWithTitle()}\n {origin !== AudioOrigin.Search && audio && renderAudio(\n lang, audio, duration, isPlaying, playProgress, bufferedProgress, seekerRef,\n (isDownloading || isUploading), date, transferProgress, onDateClick ? handleDateClick : undefined,\n )}\n {origin === AudioOrigin.SharedMedia && (voice || video) && renderWithTitle()}\n {origin === AudioOrigin.Inline && voice && (\n renderVoice(voice, seekerRef, waveformCanvasRef, playProgress, isMediaUnread)\n )}\n
\n );\n};\n\nfunction renderAudio(\n lang: LangFn,\n audio: ApiAudio,\n duration: number,\n isPlaying: boolean,\n playProgress: number,\n bufferedProgress: number,\n seekerRef: React.Ref,\n showProgress?: boolean,\n date?: number,\n progress?: number,\n handleDateClick?: NoneToVoidFunction,\n) {\n const {\n title, performer, fileName,\n } = audio;\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n const { isRtl } = getTranslation;\n\n return (\n
\n

{renderText(title || fileName)}

\n {showSeekline && (\n
\n \n {formatMediaDuration(duration * playProgress, duration)}\n \n {renderSeekline(playProgress, bufferedProgress, seekerRef)}\n
\n )}\n {!showSeekline && showProgress && (\n
\n {progress ? `${getFileSizeString(audio!.size * progress)} / ` : undefined}{getFileSizeString(audio!.size)}\n
\n )}\n {!showSeekline && !showProgress && (\n
\n {formatMediaDuration(duration)}\n \n {renderText(performer || 'Unknown')}\n {date && (\n <>\n \n \n {formatMediaDateTime(lang, date * 1000, true)}\n \n \n )}\n
\n )}\n
\n );\n}\n\nfunction renderVoice(\n voice: ApiVoice,\n seekerRef: React.Ref,\n waveformCanvasRef: React.Ref,\n playProgress: number,\n isMediaUnread?: boolean,\n) {\n return (\n
\n \n \n
\n

\n {playProgress === 0 ? formatMediaDuration(voice.duration) : formatMediaDuration(voice.duration * playProgress)}\n

\n
\n );\n}\n\nfunction useWaveformCanvas(\n theme: ISettings['theme'],\n voice?: ApiVoice,\n playProgress = 0,\n isOwn = false,\n) {\n // eslint-disable-next-line no-null/no-null\n const canvasRef = useRef(null);\n\n const { data: spikes, peak } = useMemo(() => {\n if (!voice) {\n return undefined;\n }\n\n const { waveform, duration } = voice;\n if (!waveform) {\n return {\n data: new Array(Math.min(duration, MAX_EMPTY_WAVEFORM_POINTS)).fill(0),\n peak: 0,\n };\n }\n\n const durationFactor = Math.min(duration / AVG_VOICE_DURATION, 1);\n const spikesCount = Math.round(MIN_SPIKES + (MAX_SPIKES - MIN_SPIKES) * durationFactor);\n const decodedWaveform = decodeWaveform(new Uint8Array(waveform));\n\n return interpolateArray(decodedWaveform, spikesCount);\n }, [voice]) || {};\n\n useLayoutEffect(() => {\n const canvas = canvasRef.current;\n\n if (!canvas || !spikes || peak === undefined) {\n return;\n }\n\n const fillColor = theme === 'dark' ? '#494A78' : '#ADD3F7';\n const fillOwnColor = theme === 'dark' ? '#B7ABED' : '#AEDFA4';\n const progressFillColor = theme === 'dark' ? '#8774E1' : '#3390EC';\n const progressFillOwnColor = theme === 'dark' ? '#FFFFFF' : '#4FAE4E';\n\n renderWaveform(canvas, spikes, playProgress, {\n peak,\n fillStyle: isOwn ? fillOwnColor : fillColor,\n progressFillStyle: isOwn ? progressFillOwnColor : progressFillColor,\n });\n }, [isOwn, peak, playProgress, spikes, theme]);\n\n return canvasRef;\n}\n\nfunction renderSeekline(\n playProgress: number,\n bufferedProgress: number,\n seekerRef: React.Ref,\n) {\n return (\n }\n >\n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default memo(Audio);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\nimport { ApiChat, ApiCountryCode, ApiUser } from '../../api/types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../modules/selectors';\nimport {\n getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isUserId, isUserRightBanned, selectIsChatMuted,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { copyTextToClipboard } from '../../util/clipboard';\nimport { formatPhoneNumberWithCode } from '../../util/phoneNumber';\nimport useLang from '../../hooks/useLang';\n\nimport ListItem from '../ui/ListItem';\nimport Switcher from '../ui/Switcher';\n\ntype OwnProps = {\n chatOrUserId: string;\n forceShowSelf?: boolean;\n};\n\ntype StateProps =\n {\n user?: ApiUser;\n chat?: ApiChat;\n canInviteUsers?: boolean;\n isMuted?: boolean;\n phoneCodeList: ApiCountryCode[];\n }\n & Pick;\n\nconst ChatExtra: FC = ({\n lastSyncTime,\n user,\n chat,\n forceShowSelf,\n canInviteUsers,\n isMuted,\n phoneCodeList,\n}) => {\n const {\n loadFullUser,\n showNotification,\n updateChatMutedState,\n } = getDispatch();\n\n const {\n id: userId,\n fullInfo,\n username,\n phoneNumber,\n isSelf,\n } = user || {};\n const { id: chatId } = chat || {};\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [loadFullUser, userId, lastSyncTime]);\n\n const handleNotificationChange = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n }, [chatId, isMuted, updateChatMutedState]);\n\n if (!chat || chat.isRestricted || (isSelf && !forceShowSelf)) {\n return undefined;\n }\n\n function copy(text: string, entity: string) {\n copyTextToClipboard(text);\n showNotification({ message: `${entity} was copied` });\n }\n\n const formattedNumber = phoneNumber && formatPhoneNumberWithCode(phoneCodeList, phoneNumber);\n const link = getChatLink(chat);\n const description = (fullInfo?.bio) || getChatDescription(chat);\n\n return (\n
\n {formattedNumber && Boolean(formattedNumber.length) && (\n copy(formattedNumber, lang('Phone'))}>\n {formattedNumber}\n {lang('Phone')}\n \n )}\n {username && (\n copy(`@${username}`, lang('Username'))}\n >\n {renderText(username)}\n {lang('Username')}\n \n )}\n {description && Boolean(description.length) && (\n \n \n {renderText(description, ['br', 'links', 'emoji'])}\n \n {lang(userId ? 'UserBio' : 'Info')}\n \n )}\n {(canInviteUsers || !username) && link && (\n copy(link, lang('SetUrlPlaceholder'))}\n >\n
{link}
\n {lang('SetUrlPlaceholder')}\n \n )}\n {!forceShowSelf && (\n \n {lang('Notifications')}\n \n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n const { lastSyncTime, countryList: { phoneCodes: phoneCodeList } } = global;\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isUserId(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n const isMuted = chat && selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n const canInviteUsers = chat && !user && (\n (!isChatChannel(chat) && !isUserRightBanned(chat, 'inviteUsers'))\n || getHasAdminRight(chat, 'inviteUsers')\n );\n\n return {\n lastSyncTime, phoneCodeList, chat, user, canInviteUsers, isMuted,\n };\n },\n)(ChatExtra));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\n\nimport { selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isUserId,\n isUserBot,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n getChatTitle,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Avatar from './Avatar';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './DeleteChatModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n chat: ApiChat;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isChatWithSelf?: boolean;\n isBot?: boolean;\n isPrivateChat: boolean;\n isBasicGroup: boolean;\n isSuperGroup: boolean;\n currentUserId: string | undefined;\n canDeleteForAll?: boolean;\n contactName?: string;\n};\n\nconst DeleteChatModal: FC = ({\n isOpen,\n chat,\n isChannel,\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isBasicGroup,\n isSuperGroup,\n currentUserId,\n canDeleteForAll,\n contactName,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const {\n leaveChannel,\n deleteHistory,\n deleteChannel,\n deleteChatUser,\n blockContact,\n } = getDispatch();\n\n const lang = useLang();\n const chatTitle = getChatTitle(lang, chat);\n\n const handleDeleteMessageForAll = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n\n onClose();\n }, [deleteHistory, chat.id, onClose]);\n\n const handleDeleteAndStop = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n blockContact({ contactId: chat.id, accessHash: chat.accessHash });\n\n onClose();\n }, [deleteHistory, chat.id, chat.accessHash, blockContact, onClose]);\n\n const handleDeleteChat = useCallback(() => {\n if (isPrivateChat) {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if (isBasicGroup) {\n deleteChatUser({ chatId: chat.id, userId: currentUserId });\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if ((isChannel || isSuperGroup) && !chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else if ((isChannel || isSuperGroup) && chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n }\n onClose();\n }, [\n isPrivateChat,\n isBasicGroup,\n isChannel,\n isSuperGroup,\n currentUserId,\n chat.isCreator,\n chat.id,\n onClose,\n deleteHistory,\n deleteChatUser,\n leaveChannel,\n deleteChannel,\n ]);\n\n function renderHeader() {\n return (\n
\n \n

{lang(renderTitle())}

\n
\n );\n }\n\n function renderTitle() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n\n if (isChannel && chat.isCreator) {\n return 'ChannelDelete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return 'DeleteChatUser';\n }\n\n function renderMessage() {\n if (isChannel && chat.isCreator) {\n return

{renderText(lang('ChatList.DeleteAndLeaveGroupConfirmation', chatTitle), ['simple_markdown'])}

;\n }\n\n if ((isChannel && !chat.isCreator) || isBasicGroup || isSuperGroup) {\n return

{renderText(lang('ChannelLeaveAlertWithName', chatTitle), ['simple_markdown'])}

;\n }\n\n return

{renderText(lang('ChatList.DeleteChatConfirmation', contactName), ['simple_markdown'])}

;\n }\n\n function renderActionText() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n if (isChannel && chat.isCreator) {\n return 'Chat.Input.Delete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return canDeleteForAll ? 'ChatList.DeleteForCurrentUser' : 'Delete';\n }\n\n return (\n \n {renderMessage()}\n {isBot && (\n \n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chat }): StateProps => {\n const isPrivateChat = isUserId(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, chat.id);\n const user = isPrivateChat && selectUser(global, getPrivateChatUserId(chat)!);\n const isBot = user && isUserBot(user) && !chat.isSupport;\n const canDeleteForAll = (isPrivateChat && !isChatWithSelf && !isBot);\n const contactName = isPrivateChat\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isChannel: isChatChannel(chat),\n isBasicGroup: isChatBasicGroup(chat),\n isSuperGroup: isChatSuperGroup(chat),\n currentUserId: global.currentUserId,\n canDeleteForAll,\n contactName,\n };\n },\n)(DeleteChatModal));\n","import React, {\n FC, useCallback, memo, useRef, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo';\nimport {\n getMediaTransferState,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport useMedia from '../../hooks/useMedia';\nimport useFlag from '../../hooks/useFlag';\n\nimport File from './File';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n smaller?: boolean;\n isSelected?: boolean;\n isSelectable?: boolean;\n canAutoLoad?: boolean;\n uploadProgress?: number;\n withDate?: boolean;\n datetime?: number;\n className?: string;\n sender?: string;\n autoLoadFileMaxSizeMb?: number;\n isDownloading: boolean;\n onCancelUpload?: () => void;\n onMediaClick?: () => void;\n onDateClick?: (messageId: number, chatId: string) => void;\n};\n\nconst BYTES_PER_MB = 1024 * 1024;\n\nconst Document: FC = ({\n message,\n observeIntersection,\n smaller,\n canAutoLoad,\n autoLoadFileMaxSizeMb,\n uploadProgress,\n withDate,\n datetime,\n className,\n sender,\n isSelected,\n isSelectable,\n onCancelUpload,\n onMediaClick,\n onDateClick,\n isDownloading,\n}) => {\n const dispatch = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const document = message.content.document!;\n const { fileName, size, timestamp } = document;\n const extension = getDocumentExtension(document) || '';\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const [wasIntersected, markIntersected] = useFlag();\n useEffect(() => {\n if (isIntersecting) {\n markIntersected();\n }\n }, [isIntersecting, markIntersected]);\n\n // Auto-loading does not use global download manager because requires additional click to save files locally\n const [isLoadAllowed, setIsLoadAllowed] = useState(\n canAutoLoad && (!autoLoadFileMaxSizeMb || size <= autoLoadFileMaxSizeMb * BYTES_PER_MB),\n );\n\n const shouldDownload = Boolean(isDownloading || (isLoadAllowed && wasIntersected));\n\n const documentHash = getMessageMediaHash(message, 'download');\n const { loadProgress: downloadProgress, mediaData } = useMediaWithLoadProgress(\n documentHash, !shouldDownload, undefined, undefined, undefined, true,\n );\n const isLoaded = Boolean(mediaData);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, shouldDownload && !isLoaded);\n\n const hasPreview = getDocumentHasPreview(document);\n const thumbDataUri = hasPreview ? getMessageMediaThumbDataUri(message) : undefined;\n const localBlobUrl = hasPreview ? document.previewBlobUrl : undefined;\n const previewData = useMedia(getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n\n const withMediaViewer = onMediaClick && Boolean(document.mediaType);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n return;\n }\n\n if (isDownloading) {\n dispatch.cancelMessageMediaDownload({ message });\n return;\n }\n\n if (isTransferring) {\n setIsLoadAllowed(false);\n return;\n }\n\n if (withMediaViewer) {\n onMediaClick!();\n } else {\n dispatch.downloadMessageMedia({ message });\n }\n }, [\n isUploading, isDownloading, isTransferring, withMediaViewer, onCancelUpload, dispatch, message, onMediaClick,\n ]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n return (\n \n );\n};\n\nexport default memo(Document);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport buildClassName from '../../util/buildClassName';\n\nimport './DotAnimation.scss';\n\ntype OwnProps = {\n content: string;\n className?: string;\n};\n\nconst DotAnimation: FC = ({ content, className }) => {\n const lang = useLang();\n return (\n \n {content}\n \n \n );\n};\n\nexport default DotAnimation;\n","import { RefObject } from 'react';\nimport React, { FC, memo, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useMediaTransition from '../../hooks/useMediaTransition';\nimport buildClassName from '../../util/buildClassName';\nimport { formatMediaDateTime, formatPastTimeShort } from '../../util/dateFormat';\nimport { getColorFromExtension, getFileSizeString } from './helpers/documentInfo';\nimport { getDocumentThumbnailDimensions } from './helpers/mediaDimensions';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './File.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n name: string;\n extension?: string;\n size: number;\n timestamp?: number;\n sender?: string;\n thumbnailDataUri?: string;\n previewData?: string;\n className?: string;\n smaller?: boolean;\n isTransferring?: boolean;\n isUploading?: boolean;\n isSelectable?: boolean;\n isSelected?: boolean;\n transferProgress?: number;\n actionIcon?: string;\n onClick?: () => void;\n onDateClick?: (e: React.MouseEvent) => void;\n};\n\nconst File: FC = ({\n ref,\n name,\n size,\n extension = '',\n timestamp,\n sender,\n thumbnailDataUri,\n previewData,\n className,\n smaller,\n isTransferring,\n isUploading,\n isSelectable,\n isSelected,\n transferProgress,\n actionIcon,\n onClick,\n onDateClick,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const transitionClassNames = useMediaTransition(previewData);\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, true);\n\n const color = getColorFromExtension(extension);\n const sizeString = getFileSizeString(size);\n\n const { width, height } = getDocumentThumbnailDimensions(smaller);\n\n const fullClassName = buildClassName(\n 'File',\n className,\n smaller && 'smaller',\n onClick && !isUploading && 'interactive',\n isSelected && 'file-is-selected',\n );\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n
\n {thumbnailDataUri || previewData ? (\n
\n \n \n
\n ) : (\n
\n {extension.length <= 4 && (\n {extension}\n )}\n
\n )}\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {onClick && (\n \n )}\n
\n
\n
{renderText(name)}
\n
\n \n {isTransferring && transferProgress ? `${Math.round(transferProgress * 100)}%` : sizeString}\n \n {sender && {renderText(sender)}}\n {!sender && timestamp && (\n <>\n \n {formatMediaDateTime(lang, timestamp * 1000, true)}\n \n )}\n
\n
\n {sender && timestamp && (\n {formatPastTimeShort(lang, timestamp * 1000)}\n )}\n
\n );\n};\n\nexport default memo(File);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiTypingStatus } from '../../api/types';\nimport { GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport {\n getChatTypeString,\n getChatTitle,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport { selectChat, selectChatMessages, selectChatOnlineCount } from '../../modules/selectors';\nimport renderText from './helpers/renderText';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\nimport DotAnimation from './DotAnimation';\n\ntype OwnProps = {\n chatId: string;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'small' | 'medium' | 'large' | 'jumbo';\n status?: string;\n withDots?: boolean;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n withChatType?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps =\n {\n chat?: ApiChat;\n onlineCount?: number;\n areMessagesLoaded: boolean;\n }\n & Pick;\n\nconst GroupChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withDots,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n withChatType,\n noRtl,\n chat,\n onlineCount,\n areMessagesLoaded,\n lastSyncTime,\n}) => {\n const {\n loadFullChat,\n openMediaViewer,\n } = getDispatch();\n\n const isSuperGroup = chat && isChatSuperGroup(chat);\n const { id: chatId, isMin, isRestricted } = chat || {};\n\n useEffect(() => {\n if (chatId && !isMin && withFullInfo && lastSyncTime) {\n loadFullChat({ chatId });\n }\n }, [chatId, isMin, lastSyncTime, withFullInfo, loadFullChat, isSuperGroup]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (chat && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: chat.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [chat, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (status) {\n return withDots ? (\n \n ) : (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded && !isRestricted) {\n return (\n \n );\n }\n\n if (!chat) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n if (withChatType) {\n return (\n {lang(getChatTypeString(chat))}\n );\n }\n\n const handle = withUsername ? chat.username : undefined;\n const groupStatus = getGroupStatus(lang, chat);\n const onlineStatus = onlineCount ? `, ${lang('OnlineCount', onlineCount, 'i')}` : undefined;\n\n return (\n \n {handle && {handle}}\n {groupStatus}\n {onlineStatus && {onlineStatus}}\n \n );\n }\n\n return (\n
\n \n
\n
\n

{renderText(getChatTitle(lang, chat))}

\n {chat.isVerified && }\n
\n {renderStatusOrTyping()}\n
\n
\n );\n};\n\nfunction getGroupStatus(lang: LangFn, chat: ApiChat) {\n const chatTypeString = lang(getChatTypeString(chat));\n const { membersCount } = chat;\n\n if (chat.isRestricted) {\n return chatTypeString === 'Channel' ? 'channel is inaccessible' : 'group is inaccessible';\n }\n\n if (!membersCount) {\n return chatTypeString;\n }\n\n return chatTypeString === 'Channel'\n ? lang('Subscribers', membersCount, 'i')\n : lang('Members', membersCount, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { lastSyncTime } = global;\n const chat = selectChat(global, chatId);\n const onlineCount = chat ? selectChatOnlineCount(global, chat) : undefined;\n const areMessagesLoaded = Boolean(selectChatMessages(global, chatId));\n\n return {\n lastSyncTime, chat, onlineCount, areMessagesLoaded,\n };\n },\n)(GroupChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types';\n\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\n\nimport MessageOutgoingStatus from './MessageOutgoingStatus';\n\nimport './LastMessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n};\n\nconst LastMessageMeta: FC = ({ message, outgoingStatus }) => {\n const lang = useLang();\n return (\n
\n {outgoingStatus && (\n \n )}\n {formatPastTimeShort(lang, message.date * 1000)}\n
\n );\n};\n\nexport default memo(LastMessageMeta);\n","import React, { FC, memo, useCallback, useRef } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport stopEvent from '../../util/stopEvent';\nimport {\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n} from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaTransition from '../../hooks/useMediaTransition';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\n\nimport './Media.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n idPrefix?: string;\n isProtected?: boolean;\n observeIntersection?: ObserveFn;\n onClick?: (messageId: number, chatId: string) => void;\n};\n\nconst Media: FC = ({\n message,\n idPrefix = 'shared-media',\n isProtected,\n observeIntersection,\n onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const thumbDataUri = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n const transitionClassNames = useMediaTransition(mediaBlobUrl);\n\n const video = getMessageVideo(message);\n\n const handleClick = useCallback(() => {\n onClick!(message.id, message.chatId);\n }, [message.id, message.chatId, onClick]);\n\n return (\n \n \n \n {video && {video.isGif ? 'GIF' : formatMediaDuration(video.duration)}}\n {isProtected && }\n
\n );\n};\n\nexport default memo(Media);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessageOutgoingStatus } from '../../api/types';\n\nimport Transition from '../ui/Transition';\n\nimport './MessageOutgoingStatus.scss';\n\ntype OwnProps = {\n status: ApiMessageOutgoingStatus;\n};\n\nenum Keys {\n failed, pending, succeeded, read,\n}\n\nconst MessageOutgoingStatus: FC = ({ status }) => {\n return (\n
\n \n \n \n
\n );\n};\n\nexport default memo(MessageOutgoingStatus);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport './NothingFound.scss';\n\ninterface OwnProps {\n text?: string;\n description?: string;\n}\n\nconst DEFAULT_TEXT = 'Nothing found.';\n\nconst NothingFound: FC = ({ text = DEFAULT_TEXT, description }) => {\n const lang = useLang();\n const { transitionClassNames } = useShowTransition(true);\n\n return (\n
\n {text}\n {description &&

{renderText(lang(description), ['br'])}

}\n
\n );\n};\n\nexport default memo(NothingFound);\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { isUserId } from '../../modules/helpers';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from './PrivateChatInfo';\nimport GroupChatInfo from './GroupChatInfo';\nimport PickerSelectedItem from './PickerSelectedItem';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Loading from '../ui/Loading';\n\nimport './Picker.scss';\n\ntype OwnProps = {\n itemIds: string[];\n selectedIds: string[];\n filterValue?: string;\n filterPlaceholder?: string;\n notFoundText?: string;\n searchInputId?: string;\n isLoading?: boolean;\n noScrollRestore?: boolean;\n onSelectedIdsChange: (ids: string[]) => void;\n onFilterChange: (value: string) => void;\n onLoadMore?: () => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst Picker: FC = ({\n itemIds,\n selectedIds,\n filterValue,\n filterPlaceholder,\n notFoundText,\n searchInputId,\n isLoading,\n noScrollRestore,\n onSelectedIdsChange,\n onFilterChange,\n onLoadMore,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const shouldMinimize = selectedIds.length > MAX_FULL_ITEMS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: string) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n onFilterChange('');\n }, [selectedIds, onSelectedIdsChange, onFilterChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, itemIds, Boolean(filterValue));\n\n const lang = useLang();\n\n return (\n
\n
\n {selectedIds.map((id, i) => (\n \n ))}\n \n
\n\n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n handleItemClick(id)}\n ripple\n >\n \n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : !isLoading && viewportIds && !viewportIds.length ? (\n

{notFoundText || 'Sorry, nothing found.'}

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(Picker);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport { getChatTitle, getUserFirstOrLastName, isUserId } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\n\nimport './PickerSelectedItem.scss';\n\ntype OwnProps = {\n chatOrUserId?: string;\n icon?: string;\n title?: string;\n isMinimized?: boolean;\n canClose?: boolean;\n onClick: (arg: any) => void;\n clickArg: any;\n className?: string;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n user?: ApiUser;\n};\n\nconst PickerSelectedItem: FC = ({\n icon,\n title,\n isMinimized,\n canClose,\n onClick,\n clickArg,\n chat,\n user,\n className,\n}) => {\n const lang = useLang();\n\n let iconElement: any;\n let titleText: any;\n\n if (icon && title) {\n iconElement = (\n
\n \n
\n );\n\n titleText = title;\n } else if (chat || user) {\n iconElement = (\n \n );\n\n const name = !chat || (user && !user.isSelf)\n ? getUserFirstOrLastName(user)\n : getChatTitle(lang, chat, user);\n\n titleText = name ? renderText(name) : undefined;\n }\n\n const fullClassName = buildClassName(\n 'PickerSelectedItem',\n className,\n isMinimized && 'minimized',\n canClose && 'closeable',\n );\n\n return (\n onClick(clickArg)}\n title={isMinimized ? titleText : undefined}\n dir={lang.isRtl ? 'rtl' : undefined}\n >\n {iconElement}\n {!isMinimized && (\n
\n {titleText}\n
\n )}\n {canClose && (\n
\n \n
\n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n if (!chatOrUserId) {\n return {};\n }\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isUserId(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n\n return {\n chat,\n user,\n };\n },\n)(PickerSelectedItem));\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types';\nimport { GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { selectChatMessages, selectUser, selectUserStatus } from '../../modules/selectors';\nimport { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\nimport DotAnimation from './DotAnimation';\n\ntype OwnProps = {\n userId: string;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n forceShowSelf?: boolean;\n status?: string;\n withDots?: boolean;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n noStatusOrTyping?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps =\n {\n user?: ApiUser;\n userStatus?: ApiUserStatus;\n isSavedMessages?: boolean;\n areMessagesLoaded: boolean;\n serverTimeOffset: number;\n }\n & Pick;\n\nconst PrivateChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withDots,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n noStatusOrTyping,\n noRtl,\n user,\n userStatus,\n isSavedMessages,\n areMessagesLoaded,\n lastSyncTime,\n serverTimeOffset,\n}) => {\n const {\n loadFullUser,\n openMediaViewer,\n } = getDispatch();\n\n const { id: userId } = user || {};\n const fullName = getUserFullName(user);\n\n useEffect(() => {\n if (withFullInfo && lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, lastSyncTime, withFullInfo]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (user && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: user.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [user, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!user) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (status) {\n return withDots ? (\n \n ) : (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded) {\n return (\n \n );\n }\n\n if (!user) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n return (\n \n {withUsername && user.username && {user.username}}\n {getUserStatus(lang, user, userStatus, serverTimeOffset)}\n \n );\n }\n\n return (\n
\n \n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {user?.isVerified && }\n
\n )}\n {(status || (!isSavedMessages && !noStatusOrTyping)) && renderStatusOrTyping()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { lastSyncTime, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const userStatus = selectUserStatus(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const areMessagesLoaded = Boolean(selectChatMessages(global, userId));\n\n return {\n lastSyncTime, user, userStatus, isSavedMessages, areMessagesLoaded, serverTimeOffset,\n };\n },\n)(PrivateChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser,\n} from '../../api/types';\n\nimport {\n getChatAvatarHash,\n getChatTitle,\n getUserColorKey,\n getUserFullName,\n isUserId,\n isChatWithRepliesBot,\n isDeletedUser,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport { getFirstLetters } from '../../util/textFormat';\nimport useMedia from '../../hooks/useMedia';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ProfilePhoto.scss';\n\ntype OwnProps = {\n chat?: ApiChat;\n user?: ApiUser;\n isFirstPhoto?: boolean;\n isSavedMessages?: boolean;\n photo?: ApiPhoto;\n lastSyncTime?: number;\n onClick: NoneToVoidFunction;\n};\n\nconst ProfilePhoto: FC = ({\n chat,\n user,\n photo,\n isFirstPhoto,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const lang = useLang();\n const isDeleted = user && isDeletedUser(user);\n const isRepliesChat = chat && isChatWithRepliesBot(chat.id);\n\n function getMediaHash(size: 'normal' | 'big', forceAvatar?: boolean) {\n if (photo && !forceAvatar) {\n return `photo${photo.id}?size=c`;\n }\n\n let hash: string | undefined;\n if (!isSavedMessages && !isDeleted && !isRepliesChat) {\n if (user) {\n hash = getChatAvatarHash(user, size);\n } else if (chat) {\n hash = getChatAvatarHash(chat, size);\n }\n }\n\n return hash;\n }\n\n const photoBlobUrl = useMedia(getMediaHash('big'), false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const avatarMediaHash = isFirstPhoto && !photoBlobUrl ? getMediaHash('normal', true) : undefined;\n const avatarBlobUrl = useMedia(avatarMediaHash, false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const thumbDataUri = useBlurSync(!photoBlobUrl && photo && photo.thumbnail && photo.thumbnail.dataUri);\n const imageSrc = photoBlobUrl || avatarBlobUrl || thumbDataUri;\n const prevImageSrc = usePrevious(imageSrc);\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (isRepliesChat) {\n content = ;\n } else if (imageSrc) {\n content = \"\";\n } else if (!imageSrc && user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (!imageSrc && chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isUserId(chat.id) ? 2 : 1);\n } else {\n content = (\n
\n \n
\n );\n }\n\n const fullClassName = buildClassName(\n 'ProfilePhoto',\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n isRepliesChat && 'replies-bot-account',\n (!isSavedMessages && !(imageSrc)) && 'no-photo',\n );\n\n return (\n
\n {prevImageSrc && imageSrc && prevImageSrc !== imageSrc && (\n \"\"\n )}\n {typeof content === 'string' ? renderText(content, ['hq_emoji']) : content}\n
\n );\n};\n\nexport default memo(ProfilePhoto);\n","import React, {\n FC, useEffect, useCallback, memo, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat, ApiUserStatus } from '../../api/types';\nimport { GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { selectChat, selectUser, selectUserStatus } from '../../modules/selectors';\nimport {\n getUserFullName, getUserStatus, isChatChannel, isUserOnline,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport buildClassName from '../../util/buildClassName';\nimport usePhotosPreload from './hooks/usePhotosPreload';\nimport useLang from '../../hooks/useLang';\n\nimport VerifiedIcon from './VerifiedIcon';\nimport ProfilePhoto from './ProfilePhoto';\nimport Transition from '../ui/Transition';\n\nimport './ProfileInfo.scss';\n\ntype OwnProps = {\n userId: string;\n forceShowSelf?: boolean;\n};\n\ntype StateProps =\n {\n user?: ApiUser;\n userStatus?: ApiUserStatus;\n chat?: ApiChat;\n isSavedMessages?: boolean;\n animationLevel: 0 | 1 | 2;\n serverTimeOffset: number;\n }\n & Pick;\n\nconst ProfileInfo: FC = ({\n forceShowSelf,\n user,\n userStatus,\n chat,\n isSavedMessages,\n connectionState,\n animationLevel,\n serverTimeOffset,\n}) => {\n const {\n loadFullUser,\n openMediaViewer,\n } = getDispatch();\n\n const lang = useLang();\n\n const { id: userId } = user || {};\n const { id: chatId } = chat || {};\n const fullName = user ? getUserFullName(user) : (chat ? chat.title : '');\n const photos = user?.photos || chat?.photos || [];\n const slideAnimation = animationLevel >= 1\n ? (lang.isRtl ? 'slide-optimized-rtl' : 'slide-optimized')\n : 'none';\n\n const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0);\n const isFirst = isSavedMessages || photos.length <= 1 || currentPhotoIndex === 0;\n const isLast = isSavedMessages || photos.length <= 1 || currentPhotoIndex === photos.length - 1;\n\n // Deleting the last profile photo may result in an error\n useEffect(() => {\n if (currentPhotoIndex > photos.length) {\n setCurrentPhotoIndex(Math.max(0, photos.length - 1));\n }\n }, [currentPhotoIndex, photos.length]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && userId && !forceShowSelf) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, connectionState, forceShowSelf]);\n\n usePhotosPreload(user || chat, photos, currentPhotoIndex);\n\n const handleProfilePhotoClick = useCallback(() => {\n openMediaViewer({\n avatarOwnerId: userId || chatId,\n profilePhotoIndex: currentPhotoIndex,\n origin: forceShowSelf ? MediaViewerOrigin.SettingsAvatar : MediaViewerOrigin.ProfileAvatar,\n });\n }, [openMediaViewer, userId, chatId, currentPhotoIndex, forceShowSelf]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex - 1);\n }, [currentPhotoIndex, isFirst]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex + 1);\n }, [currentPhotoIndex, isLast]);\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.photo-wrapper');\n if (!element) {\n return undefined;\n }\n\n return captureEvents(element, {\n selectorToPreventScroll: '.Profile, .settings-content',\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n return true;\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n return true;\n }\n\n return false;\n } : undefined,\n });\n }, [selectNextMedia, selectPreviousMedia]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n function renderPhotoTabs() {\n if (isSavedMessages || !photos || photos.length <= 1) {\n return undefined;\n }\n\n return (\n
\n {photos.map((_, i) => (\n \n ))}\n
\n );\n }\n\n function renderPhoto() {\n const photo = !isSavedMessages && photos && photos.length > 0 ? photos[currentPhotoIndex] : undefined;\n\n return (\n \n );\n }\n\n function renderStatus() {\n if (user) {\n return (\n
\n {getUserStatus(lang, user, userStatus, serverTimeOffset)}\n
\n );\n }\n\n return (\n {\n isChatChannel(chat!)\n ? lang('Subscribers', chat!.membersCount ?? 0, 'i')\n : lang('Members', chat!.membersCount ?? 0, 'i')\n }\n \n );\n }\n\n const isVerifiedIconShown = (user || chat)?.isVerified;\n\n return (\n
\n
\n {renderPhotoTabs()}\n \n {renderPhoto()}\n \n\n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n
\n\n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {isVerifiedIconShown && }\n
\n )}\n {!isSavedMessages && renderStatus()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { connectionState, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const userStatus = selectUserStatus(global, userId);\n const chat = selectChat(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const { animationLevel } = global.settings.byKey;\n\n return {\n connectionState,\n user,\n userStatus,\n chat,\n isSavedMessages,\n animationLevel,\n serverTimeOffset,\n };\n },\n)(ProfileInfo));\n","import {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser,\n} from '../../../api/types';\nimport { useEffect } from '../../../lib/teact/teact';\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nconst PHOTOS_TO_PRELOAD = 4;\n\nexport default function usePhotosPreload(\n profile: ApiUser | ApiChat | undefined,\n photos: ApiPhoto[],\n currentIndex: number,\n) {\n useEffect(() => {\n photos.slice(currentIndex, currentIndex + PHOTOS_TO_PRELOAD).forEach((photo) => {\n const mediaData = mediaLoader.getFromMemory(`photo${photo.id}?size=c`);\n if (!mediaData) {\n mediaLoader.fetch(`photo${photo.id}?size=c`, ApiMediaFormat.BlobUrl);\n }\n });\n }, [currentIndex, photos]);\n}\n","import { RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\n\nimport useMedia from '../../hooks/useMedia';\nimport buildClassName from '../../util/buildClassName';\n\nimport './ReactionStaticEmoji.scss';\n\ntype OwnProps = {\n reaction: string;\n ref?: RefObject;\n className?: string;\n};\n\nconst ReactionStaticEmoji: FC = ({\n reaction,\n ref,\n className,\n}) => {\n const staticIconId = getGlobal().availableReactions?.find((l) => l.reaction === reaction)?.staticIcon?.id;\n const mediaData = useMedia(`document${staticIconId}`, !staticIconId, ApiMediaFormat.BlobUrl);\n\n return (\n \n );\n};\n\nexport default memo(ReactionStaticEmoji);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { useIsIntersecting, ObserveFn } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\nimport safePlay from '../../util/safePlay';\nimport { IS_WEBM_SUPPORTED } from '../../util/environment';\n\nimport AnimatedSticker from './AnimatedSticker';\nimport Button from '../ui/Button';\n\nimport './StickerButton.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n size: number;\n observeIntersection: ObserveFn;\n noAnimate?: boolean;\n title?: string;\n className?: string;\n onClick?: (arg: any) => void;\n clickArg?: any;\n onUnfaveClick?: (sticker: ApiSticker) => void;\n};\n\nconst StickerButton: FC = ({\n sticker, size, observeIntersection, noAnimate, title, className, onClick, clickArg, onUnfaveClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const localMediaHash = `sticker${sticker.id}`;\n const stickerSelector = `sticker-button-${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail ? sticker.thumbnail.dataUri : undefined;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !isIntersecting, ApiMediaFormat.BlobUrl);\n\n const shouldPlay = isIntersecting && !noAnimate;\n const lottieData = useMedia(sticker.isLottie && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);\n const [isLottieLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));\n const canLottiePlay = isLottieLoaded && shouldPlay;\n const isGif = sticker.isGif && IS_WEBM_SUPPORTED;\n const gifBlobUrl = useMedia(isGif && localMediaHash, !shouldPlay, ApiMediaFormat.BlobUrl);\n const canGifPlay = Boolean(isGif && gifBlobUrl && shouldPlay);\n\n const { transitionClassNames: previewTransitionClassNames } = useShowTransition(\n Boolean(previewBlobUrl || canLottiePlay),\n undefined,\n undefined,\n 'slow',\n );\n\n // To avoid flickering\n useEffect(() => {\n if (!shouldPlay) {\n unmarkLoaded();\n }\n }, [unmarkLoaded, shouldPlay]);\n\n useEffect(() => {\n if (!isGif || !ref.current) return;\n const video = ref.current.querySelector('video');\n if (!video) return;\n if (canGifPlay) {\n safePlay(video);\n } else {\n video.pause();\n }\n }, [isGif, canGifPlay]);\n\n function handleClick() {\n if (onClick) {\n onClick(clickArg);\n }\n }\n\n function handleUnfaveClick(e: ReactMouseEvent) {\n e.stopPropagation();\n e.preventDefault();\n\n onUnfaveClick!(sticker);\n }\n\n const fullClassName = buildClassName(\n 'StickerButton',\n onClick && 'interactive',\n stickerSelector,\n className,\n );\n\n const style = (thumbDataUri && !canLottiePlay && !canGifPlay) ? `background-image: url('${thumbDataUri}');` : '';\n\n return (\n \n {!canLottiePlay && !canGifPlay && (\n // eslint-disable-next-line jsx-a11y/alt-text\n \n )}\n {isGif && (\n \n )}\n {shouldPlay && lottieData && (\n \n )}\n {onUnfaveClick && (\n \n \n \n )}\n \n );\n};\n\nexport default memo(StickerButton);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './StickerSetModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst StickerSetModalAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerSetModal = useModuleLoader(Bundles.Extra, 'StickerSetModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSetModal ? : undefined;\n};\n\nexport default memo(StickerSetModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\n\nimport { selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport DotAnimation from './DotAnimation';\n\nimport './TypingStatus.scss';\n\ntype OwnProps = {\n typingStatus: ApiTypingStatus;\n};\n\ntype StateProps = {\n typingUser?: ApiUser;\n};\n\nconst TypingStatus: FC = ({ typingStatus, typingUser }) => {\n const lang = useLang();\n const typingUserName = typingUser && !typingUser.isSelf && getUserFirstOrLastName(typingUser);\n const content = lang(typingStatus.action)\n // Fix for translation \"{user} is typing\"\n .replace('{user}', '')\n .replace('{emoji}', typingStatus.emoji).trim();\n\n return (\n

\n {typingUserName && (\n {renderText(typingUserName)}\n )}\n \n

\n );\n};\n\nexport default memo(withGlobal(\n (global, { typingStatus }): StateProps => {\n if (!typingStatus.userId) {\n return {};\n }\n\n const typingUser = selectUser(global, typingStatus.userId);\n\n return { typingUser };\n },\n)(TypingStatus));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport './VerifiedIcon.scss';\n\nconst VerifiedIcon: FC = () => {\n return (\n \n );\n};\n\nexport default VerifiedIcon;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiWebPage } from '../../api/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport {\n getFirstLinkInMessage, getMessageText,\n getMessageWebPage,\n} from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport trimText from '../../util/trimText';\nimport renderText from './helpers/renderText';\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\nimport { renderMessageSummary, TextPart } from './helpers/renderMessageText';\n\nimport Media from './Media';\nimport Link from '../ui/Link';\nimport SafeLink from './SafeLink';\n\nimport './WebLink.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n senderTitle?: string;\n isProtected?: boolean;\n observeIntersection?: ObserveFn;\n onMessageClick: (messageId: number, chatId: string) => void;\n};\n\ntype ApiWebPageWithFormatted =\n ApiWebPage\n & { formattedDescription?: TextPart[] };\n\nconst WebLink: FC = ({\n message, senderTitle, isProtected, observeIntersection, onMessageClick,\n}) => {\n const lang = useLang();\n\n let linkData: ApiWebPageWithFormatted | undefined = getMessageWebPage(message);\n\n if (!linkData) {\n const link = getFirstLinkInMessage(message);\n if (link) {\n const { url, domain } = link;\n\n linkData = {\n siteName: domain.replace(/^www./, ''),\n url: url.includes('://') ? url : url.includes('@') ? `mailto:${url}` : `http://${url}`,\n formattedDescription: getMessageText(message) !== url\n ? renderMessageSummary(lang, message, undefined, undefined, MAX_TEXT_LENGTH)\n : undefined,\n } as ApiWebPageWithFormatted;\n }\n }\n\n const handleMessageClick = useCallback(() => {\n onMessageClick(message.id, message.chatId);\n }, [onMessageClick, message.id, message.chatId]);\n\n if (!linkData) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n formattedDescription,\n photo,\n video,\n } = linkData;\n\n const truncatedDescription = !senderTitle && description && trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebLink scroll-item',\n (!photo && !video) && 'without-media',\n );\n\n return (\n \n {photo && (\n \n )}\n
\n \n {renderText(title || siteName || displayUrl)}\n \n {(truncatedDescription || formattedDescription) && (\n \n {formattedDescription || (truncatedDescription && renderText(truncatedDescription))}\n \n )}\n \n {url.replace('mailto:', '') || displayUrl}\n \n {senderTitle &&
{renderText(senderTitle)}
}\n
\n {senderTitle && (\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n )}\n \n );\n};\n\nexport default memo(WebLink);\n","import {\n ApiPhoto, ApiVideo, ApiSticker, ApiDimensions,\n} from '../../../api/types';\n\nimport { STICKER_SIZE_INLINE_DESKTOP_FACTOR, STICKER_SIZE_INLINE_MOBILE_FACTOR } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport { getPhotoInlineDimensions, getVideoDimensions } from '../../../modules/helpers';\n\nexport const MEDIA_VIEWER_MEDIA_QUERY = '(max-height: 640px)';\nexport const REM = parseInt(getComputedStyle(document.documentElement).fontSize, 10);\nexport const ROUND_VIDEO_DIMENSIONS_PX = 240;\nexport const GIF_MIN_WIDTH = 300;\nexport const AVATAR_FULL_DIMENSIONS = { width: 640, height: 640 };\nexport const LIKE_STICKER_ID = '4986041492570112461';\n\nconst DEFAULT_MEDIA_DIMENSIONS: ApiDimensions = { width: 100, height: 100 };\nconst MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM = 4.5;\nconst MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM = 7;\nconst MESSAGE_MAX_WIDTH_REM = 29;\nconst MESSAGE_OWN_MAX_WIDTH_REM = 30;\n\nlet cachedMaxWidthOwn: number | undefined;\nlet cachedMaxWidth: number | undefined;\nlet cachedMaxWidthNoAvatar: number | undefined;\n\nfunction getMaxMessageWidthRem(fromOwnMessage: boolean, noAvatars?: boolean) {\n const regularMaxWidth = fromOwnMessage ? MESSAGE_OWN_MAX_WIDTH_REM : MESSAGE_MAX_WIDTH_REM;\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return regularMaxWidth;\n }\n\n const { width: windowWidth } = windowSize.get();\n\n // @optimization Limitation: changing device screen width not supported\n if (!cachedMaxWidthOwn) {\n cachedMaxWidthOwn = Math.min(\n MESSAGE_OWN_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidth) {\n cachedMaxWidth = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidthNoAvatar) {\n cachedMaxWidthNoAvatar = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n\n return fromOwnMessage\n ? cachedMaxWidthOwn\n : (noAvatars ? cachedMaxWidthNoAvatar : cachedMaxWidth);\n}\n\nexport function getAvailableWidth(\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const extraPaddingRem = isForwarded || isWebPagePhoto ? 1.625 : 0;\n const availableWidthRem = getMaxMessageWidthRem(fromOwnMessage, noAvatars) - extraPaddingRem;\n\n return availableWidthRem * REM;\n}\n\nfunction getAvailableHeight(isGif?: boolean, aspectRatio?: number) {\n if (\n isGif && aspectRatio\n && aspectRatio >= 0.75 && aspectRatio <= 1.25\n ) {\n return 20 * REM;\n }\n\n return 27 * REM;\n}\n\nfunction calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n isGif,\n noAvatars,\n}: {\n width: number;\n height: number;\n fromOwnMessage: boolean;\n isForwarded?: boolean;\n isWebPagePhoto?: boolean;\n isGif?: boolean;\n noAvatars?: boolean;\n}): ApiDimensions {\n const aspectRatio = height / width;\n const availableWidth = getAvailableWidth(fromOwnMessage, isForwarded, isWebPagePhoto, noAvatars);\n const availableHeight = getAvailableHeight(isGif, aspectRatio);\n const mediaWidth = isGif ? Math.max(GIF_MIN_WIDTH, width) : width;\n const mediaHeight = isGif ? height * (mediaWidth / width) : height;\n\n return calculateDimensions(availableWidth, availableHeight, mediaWidth, mediaHeight);\n}\n\nexport function getMediaViewerAvailableDimensions(withFooter: boolean, isVideo: boolean): ApiDimensions {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n const { width: windowWidth, height: windowHeight } = windowSize.get();\n let occupiedHeightRem = isVideo && mql.matches ? 10 : 8.25;\n if (withFooter && !IS_TOUCH_ENV) {\n occupiedHeightRem = mql.matches ? 10 : 12.5;\n }\n return {\n width: windowWidth,\n height: windowHeight - occupiedHeightRem * REM,\n };\n}\n\nexport function calculateInlineImageDimensions(\n photo: ApiPhoto,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getPhotoInlineDimensions(photo) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n noAvatars,\n });\n}\n\nexport function calculateVideoDimensions(\n video: ApiVideo,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getVideoDimensions(video) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isGif: video.isGif,\n noAvatars,\n });\n}\n\nexport function getPictogramDimensions(): ApiDimensions {\n return {\n width: 2 * REM,\n height: 2 * REM,\n };\n}\n\nexport function getDocumentThumbnailDimensions(smaller?: boolean): ApiDimensions {\n if (smaller) {\n return {\n width: 3 * REM,\n height: 3 * REM,\n };\n }\n\n return {\n width: 3.375 * REM,\n height: 3.375 * REM,\n };\n}\n\nexport function getStickerDimensions(sticker: ApiSticker): ApiDimensions {\n const { width } = sticker;\n let { height } = sticker;\n\n // For some reason this sticker has some weird `height` value\n if (sticker.id === LIKE_STICKER_ID) {\n height = width;\n }\n\n const aspectRatio = (height && width) && height / width;\n const baseWidth = REM * (\n IS_SINGLE_COLUMN_LAYOUT\n ? STICKER_SIZE_INLINE_MOBILE_FACTOR\n : STICKER_SIZE_INLINE_DESKTOP_FACTOR\n );\n const calculatedHeight = aspectRatio ? baseWidth * aspectRatio : baseWidth;\n\n if (aspectRatio && calculatedHeight > baseWidth) {\n return {\n width: Math.round(baseWidth / aspectRatio),\n height: baseWidth,\n };\n }\n\n return {\n width: baseWidth,\n height: calculatedHeight,\n };\n}\n\nexport function calculateMediaViewerDimensions(\n { width, height }: ApiDimensions, withFooter: boolean, isVideo: boolean = false,\n): ApiDimensions {\n const { width: availableWidth, height: availableHeight } = getMediaViewerAvailableDimensions(withFooter, isVideo);\n\n return calculateDimensions(availableWidth, availableHeight, width, height);\n}\n\nexport function calculateDimensions(\n availableWidth: number,\n availableHeight: number,\n mediaWidth: number,\n mediaHeight: number,\n): ApiDimensions {\n const aspectRatio = mediaHeight / mediaWidth;\n const calculatedWidth = Math.min(mediaWidth, availableWidth);\n const calculatedHeight = Math.round(calculatedWidth * aspectRatio);\n\n if (calculatedHeight > availableHeight) {\n return {\n width: Math.round(availableHeight / aspectRatio),\n height: availableHeight,\n };\n }\n\n return {\n width: calculatedWidth,\n height: Math.round(calculatedWidth * aspectRatio),\n };\n}\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport safePlay from '../../../util/safePlay';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport useMedia from '../../../hooks/useMedia';\nimport { ActiveEmojiInteraction } from '../../../global/types';\nimport useFlag from '../../../hooks/useFlag';\nimport { selectLocalAnimatedEmojiEffectByName } from '../../../modules/selectors';\n\nconst WIDTH = {\n large: 160,\n medium: 128,\n small: 104,\n};\nconst INTERACTION_BUNCH_TIME = 1000;\nconst MS_DIVIDER = 1000;\nconst TIME_DEFAULT = 0;\n\nexport default function useAnimatedEmoji(\n size: 'large' | 'medium' | 'small',\n chatId?: string,\n messageId?: number,\n soundId?: string,\n activeEmojiInteractions?: ActiveEmojiInteraction[],\n isOwn?: boolean,\n localEffect?: string,\n emoji?: string,\n) {\n const {\n interactWithAnimatedEmoji, sendEmojiInteraction, sendWatchingEmojiInteraction,\n } = getDispatch();\n\n const hasEffect = localEffect || emoji;\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n // eslint-disable-next-line no-null/no-null\n const audioRef = useRef(null);\n\n const soundMediaData = useMedia(soundId ? `document${soundId}` : undefined, !soundId);\n\n const width = WIDTH[size];\n const style = `width: ${width}px; height: ${width}px;`;\n\n const [playKey, setPlayKey] = useState(String(Math.random()));\n const interactions = useRef(undefined);\n const startedInteractions = useRef(undefined);\n const sendInteractionBunch = useCallback(() => {\n const container = ref.current;\n\n if (!container) return;\n\n sendEmojiInteraction({\n chatId,\n messageId,\n localEffect,\n emoji,\n interactions: interactions.current,\n });\n startedInteractions.current = undefined;\n interactions.current = undefined;\n }, [sendEmojiInteraction, chatId, messageId, localEffect, emoji]);\n\n const play = useCallback(() => {\n setPlayKey(String(Math.random()));\n\n const audio = audioRef.current;\n if (soundMediaData) {\n if (audio) {\n audio.pause();\n audio.remove();\n }\n audioRef.current = new Audio();\n audioRef.current.src = soundMediaData;\n safePlay(audioRef.current);\n audioRef.current.addEventListener('ended', () => {\n audioRef.current = undefined;\n }, { once: true });\n }\n }, [soundMediaData]);\n\n const handleClick = useCallback(() => {\n play();\n\n const container = ref.current;\n\n if (!hasEffect || !container || !messageId || !chatId) {\n return;\n }\n\n const { x, y } = container.getBoundingClientRect();\n\n interactWithAnimatedEmoji({\n localEffect,\n emoji,\n x,\n y,\n startSize: width,\n isReversed: !isOwn,\n });\n\n if (!interactions.current) {\n interactions.current = [];\n startedInteractions.current = performance.now();\n setTimeout(sendInteractionBunch, INTERACTION_BUNCH_TIME);\n }\n\n interactions.current.push(startedInteractions.current\n ? (performance.now() - startedInteractions.current) / MS_DIVIDER\n : TIME_DEFAULT);\n }, [\n chatId, emoji, hasEffect, interactWithAnimatedEmoji, isOwn,\n localEffect, messageId, play, sendInteractionBunch, width,\n ]);\n\n // Set an end anchor for remote activated interaction\n useEffect(() => {\n const container = ref.current;\n\n if (!container || !activeEmojiInteractions) return;\n\n activeEmojiInteractions.forEach(({\n id,\n startSize,\n messageId: interactionMessageId,\n }) => {\n if (startSize || messageId !== interactionMessageId) {\n return;\n }\n\n const { x, y } = container.getBoundingClientRect();\n\n sendWatchingEmojiInteraction({\n id,\n chatId,\n emoticon: localEffect ? selectLocalAnimatedEmojiEffectByName(localEffect) : emoji,\n startSize: width,\n x,\n y,\n isReversed: !isOwn,\n });\n play();\n });\n }, [\n activeEmojiInteractions, chatId, emoji, isOwn, localEffect, messageId, play, sendWatchingEmojiInteraction, width,\n ]);\n\n return {\n playKey,\n ref,\n style,\n width,\n handleClick,\n markAnimationLoaded,\n isAnimationLoaded,\n };\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './ChatFolderModal';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ChatFolderModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ChatFolderModal = useModuleLoader(Bundles.Extra, 'ChatFolderModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ChatFolderModal ? : undefined;\n};\n\nexport default memo(ChatFolderModalAsync);\n","import { useMemo } from '../../../../lib/teact/teact';\n\nexport enum ChatAnimationTypes {\n Move,\n Opacity,\n None,\n}\n\nexport function useChatAnimationType(orderDiffById: Record) {\n return useMemo(() => {\n const orderDiffs = Object.values(orderDiffById);\n const numberOfUp = orderDiffs.filter((diff) => diff < 0).length;\n const numberOfDown = orderDiffs.filter((diff) => diff > 0).length;\n\n return (chatId: string): ChatAnimationTypes => {\n const orderDiff = orderDiffById[chatId];\n if (orderDiff === 0) {\n return ChatAnimationTypes.None;\n }\n\n if (\n orderDiff === Infinity\n || orderDiff === -Infinity\n || (numberOfUp <= numberOfDown && orderDiff < 0)\n || (numberOfDown < numberOfUp && orderDiff > 0)\n ) {\n return ChatAnimationTypes.Opacity;\n }\n\n return ChatAnimationTypes.Move;\n };\n }, [orderDiffById]);\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ShowTransition from '../../ui/ShowTransition';\n\nimport './Badge.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst Badge: FC = ({ chat, isPinned, isMuted }) => {\n const isShown = Boolean(chat.unreadCount || chat.hasUnreadMark || isPinned);\n const className = buildClassName(\n 'Badge',\n isMuted && 'muted',\n isPinned && 'pinned',\n Boolean(chat.unreadCount || chat.hasUnreadMark) && 'unread',\n );\n\n function renderContent() {\n if (chat.unreadCount) {\n if (chat.unreadMentionsCount) {\n return (\n
\n
\n \n
\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n
\n );\n }\n\n return (\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n );\n } else if (chat.hasUnreadMark) {\n return (\n
\n );\n } else if (isPinned) {\n return (\n
\n \n
\n );\n }\n\n return undefined;\n }\n\n return (\n \n {renderContent()}\n \n );\n};\n\nexport default memo(Badge);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport buildClassName from '../../../util/buildClassName';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\n\nimport './ChatCallStatus.scss';\n\ntype OwnProps = {\n isSelected?: boolean;\n isActive?: boolean;\n};\n\nconst ChatCallStatus: FC = ({\n isSelected,\n isActive,\n}) => {\n return (\n
\n
\n
\n
\n
\n
\n
\n );\n};\n\nexport default memo(ChatCallStatus);\n","import React, {\n FC, memo, useCallback, useLayoutEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID, ApiUserStatus,\n} from '../../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n isUserId,\n isActionMessage,\n getPrivateChatUserId,\n getMessageAction,\n getMessageSenderName,\n isChatChannel,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageSticker,\n selectIsChatMuted,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectChatMessage, selectOutgoingStatus, selectDraft, selectCurrentMessageList,\n selectNotifySettings, selectNotifyExceptions, selectUserStatus,\n} from '../../../modules/selectors';\nimport { renderActionMessageText } from '../../common/helpers/renderActionMessageText';\nimport renderText from '../../common/helpers/renderText';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport useMedia from '../../../hooks/useMedia';\nimport { ChatAnimationTypes } from './hooks';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport TypingStatus from '../../common/TypingStatus';\nimport LastMessageMeta from '../../common/LastMessageMeta';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\nimport Badge from './Badge';\nimport ChatFolderModal from '../ChatFolderModal.async';\nimport ChatCallStatus from './ChatCallStatus';\n\nimport './Chat.scss';\n\ntype OwnProps = {\n style?: string;\n chatId: string;\n folderId?: number;\n orderDiff: number;\n animationType: ChatAnimationTypes;\n isPinned?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isMuted?: boolean;\n user?: ApiUser;\n userStatus?: ApiUserStatus;\n actionTargetUserIds?: string[];\n actionTargetMessage?: ApiMessage;\n actionTargetChatId?: string;\n lastMessageSender?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n draft?: ApiFormattedText;\n animationLevel?: number;\n isSelected?: boolean;\n canScrollDown?: boolean;\n canChangeFolder?: boolean;\n lastSyncTime?: number;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Chat: FC = ({\n style,\n chatId,\n folderId,\n orderDiff,\n animationType,\n isPinned,\n chat,\n isMuted,\n user,\n userStatus,\n actionTargetUserIds,\n lastMessageSender,\n lastMessageOutgoingStatus,\n actionTargetMessage,\n actionTargetChatId,\n draft,\n animationLevel,\n isSelected,\n canScrollDown,\n canChangeFolder,\n lastSyncTime,\n}) => {\n const {\n openChat,\n focusLastMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isChatFolderModalOpen, openChatFolderModal, closeChatFolderModal] = useFlag();\n const [shouldRenderDeleteModal, markRenderDeleteModal, unmarkRenderDeleteModal] = useFlag();\n const [shouldRenderChatFolderModal, markRenderChatFolderModal, unmarkRenderChatFolderModal] = useFlag();\n\n const { lastMessage, typingStatus } = chat || {};\n const isAction = lastMessage && isActionMessage(lastMessage);\n\n useEnsureMessage(chatId, isAction ? lastMessage!.replyToMessageId : undefined, actionTargetMessage);\n\n const mediaThumbnail = lastMessage && !getMessageSticker(lastMessage)\n ? getMessageMediaThumbDataUri(lastMessage)\n : undefined;\n const mediaBlobUrl = useMedia(lastMessage ? getMessageMediaHash(lastMessage, 'micro') : undefined);\n const isRoundVideo = Boolean(lastMessage && getMessageRoundVideo(lastMessage));\n\n const actionTargetUsers = useMemo(() => {\n if (!actionTargetUserIds) {\n return undefined;\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n return actionTargetUserIds.map((userId) => usersById[userId]).filter(Boolean as any);\n }, [actionTargetUserIds]);\n\n // Sets animation excess values when `orderDiff` changes and then resets excess values to animate.\n useLayoutEffect(() => {\n const element = ref.current;\n\n if (animationLevel === 0 || !element) {\n return;\n }\n\n // TODO Refactor animation: create `useListAnimation` that owns `orderDiff` and `animationType`\n if (animationType === ChatAnimationTypes.Opacity) {\n element.style.opacity = '0';\n\n fastRaf(() => {\n element.classList.add('animate-opacity');\n element.style.opacity = '1';\n });\n } else if (animationType === ChatAnimationTypes.Move) {\n element.style.transform = `translate3d(0, ${-orderDiff * 100}%, 0)`;\n\n fastRaf(() => {\n element.classList.add('animate-transform');\n element.style.transform = '';\n });\n } else {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n element.classList.remove('animate-opacity', 'animate-transform');\n element.style.opacity = '';\n element.style.transform = '';\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [animationLevel, orderDiff, animationType]);\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, shouldReplaceHistory: true });\n\n if (isSelected && canScrollDown) {\n focusLastMessage();\n }\n }, [\n isSelected,\n canScrollDown,\n openChat,\n chatId,\n focusLastMessage,\n ]);\n\n function handleDelete() {\n markRenderDeleteModal();\n openDeleteModal();\n }\n\n function handleChatFolderChange() {\n markRenderChatFolderModal();\n openChatFolderModal();\n }\n\n const contextActions = useChatContextActions({\n chat,\n user,\n handleDelete,\n handleChatFolderChange,\n folderId,\n isPinned,\n isMuted,\n canChangeFolder,\n });\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderLastMessageOrTyping() {\n if (typingStatus && lastMessage && typingStatus.timestamp > lastMessage.date * 1000) {\n return ;\n }\n\n if (draft?.text.length) {\n return (\n

\n {lang('Draft')}\n {renderText(draft.text)}\n

\n );\n }\n\n if (!lastMessage) {\n return undefined;\n }\n\n if (isAction) {\n const isChat = chat && (isChatChannel(chat) || lastMessage.senderId === lastMessage.chatId);\n\n return (\n

\n {renderActionMessageText(\n lang,\n lastMessage,\n !isChat ? lastMessageSender : undefined,\n isChat ? chat : undefined,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asTextWithSpoilers: true },\n )}\n

\n );\n }\n\n const senderName = getMessageSenderName(lang, chatId, lastMessageSender);\n\n return (\n

\n {senderName && (\n <>\n {renderText(senderName)}\n :\n \n )}\n {renderSummary(lang, lastMessage!, mediaBlobUrl || mediaThumbnail, isRoundVideo)}\n

\n );\n }\n\n const className = buildClassName(\n 'Chat chat-item-clickable',\n isUserId(chatId) ? 'private' : 'group',\n isSelected && 'selected',\n );\n\n return (\n \n
\n \n {chat.isCallActive && chat.isCallNotEmpty && (\n \n )}\n
\n
\n
\n

{renderText(getChatTitle(lang, chat, user))}

\n {chat.isVerified && }\n {isMuted && }\n {chat.lastMessage && (\n \n )}\n
\n
\n {renderLastMessageOrTyping()}\n \n
\n
\n {shouldRenderDeleteModal && (\n \n )}\n {shouldRenderChatFolderModal && (\n \n )}\n \n );\n};\n\nfunction renderSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRoundVideo?: boolean) {\n if (!blobUrl) {\n return renderMessageSummary(lang, message);\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderMessageSummary(lang, message, true)}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return {};\n }\n\n const { senderId, replyToMessageId, isOutgoing } = chat.lastMessage;\n const lastMessageSender = senderId ? selectUser(global, senderId) : undefined;\n const lastMessageAction = getMessageAction(chat.lastMessage);\n const actionTargetMessage = lastMessageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const { targetUserIds: actionTargetUserIds, targetChatId: actionTargetChatId } = lastMessageAction || {};\n const privateChatUserId = getPrivateChatUserId(chat);\n const {\n chatId: currentChatId,\n threadId: currentThreadId,\n type: messageListType,\n } = selectCurrentMessageList(global) || {};\n const isSelected = chatId === currentChatId && currentThreadId === MAIN_THREAD_ID;\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n lastMessageSender,\n actionTargetUserIds,\n actionTargetChatId,\n actionTargetMessage,\n draft: selectDraft(global, chatId, MAIN_THREAD_ID),\n animationLevel: global.settings.byKey.animationLevel,\n isSelected,\n canScrollDown: isSelected && messageListType === 'thread',\n canChangeFolder: Boolean(global.chatFolders.orderedIds?.length),\n lastSyncTime: global.lastSyncTime,\n ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),\n ...(privateChatUserId && {\n user: selectUser(global, privateChatUserId),\n userStatus: selectUserStatus(global, privateChatUserId),\n }),\n };\n },\n)(Chat));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatFolder, ApiSticker } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { selectAnimatedEmoji, selectChatFolder } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\n\nimport './EmptyFolder.scss';\n\ntype OwnProps = {\n folderId?: number;\n folderType: 'all' | 'archived' | 'folder';\n foldersDispatch?: FolderEditDispatch;\n onScreenSelect?: (screen: SettingsScreens) => void;\n};\n\ntype StateProps = {\n chatFolder?: ApiChatFolder;\n animatedEmoji?: ApiSticker;\n};\n\nconst EmptyFolder: FC = ({\n chatFolder, animatedEmoji, foldersDispatch, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleEditFolder = useCallback(() => {\n foldersDispatch!({ type: 'editFolder', payload: chatFolder });\n onScreenSelect!(SettingsScreens.FoldersEditFolderFromChatList);\n }, [chatFolder, foldersDispatch, onScreenSelect]);\n\n return (\n
\n
{animatedEmoji && }
\n

{lang('FilterNoChatsToDisplay')}

\n

\n {lang(chatFolder ? 'ChatList.EmptyChatListFilterText' : 'Chat.EmptyChat')}\n

\n {chatFolder && foldersDispatch && onScreenSelect && (\n \n \n {lang('ChatList.EmptyChatListEditFilter')}\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal((global, { folderId, folderType }): StateProps => {\n const chatFolder = folderId && folderType === 'folder' ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatFolder,\n animatedEmoji: selectAnimatedEmoji(global, '📂'),\n };\n})(EmptyFolder));\n","import React, {\n FC, memo, useMemo, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport {\n ALL_FOLDER_ID,\n ARCHIVED_FOLDER_ID,\n CHAT_HEIGHT_PX,\n CHAT_LIST_SLICE,\n} from '../../../config';\nimport { IS_MAC_OS, IS_PWA } from '../../../util/environment';\nimport { mapValues } from '../../../util/iteratees';\nimport { getPinnedChatsCount } from '../../../util/folderManager';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport { useFolderManagerForOrderedIds } from '../../../hooks/useFolderManager';\nimport { useChatAnimationType } from './hooks';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Loading from '../../ui/Loading';\nimport Chat from './Chat';\nimport EmptyFolder from './EmptyFolder';\n\ntype OwnProps = {\n folderType: 'all' | 'archived' | 'folder';\n folderId?: number;\n isActive: boolean;\n lastSyncTime?: number;\n foldersDispatch?: FolderEditDispatch;\n onScreenSelect?: (screen: SettingsScreens) => void;\n};\n\nconst ChatList: FC = ({\n folderType,\n folderId,\n isActive,\n foldersDispatch,\n onScreenSelect,\n}) => {\n const { openChat, openNextChat } = getDispatch();\n\n const resolvedFolderId = (\n folderType === 'all' ? ALL_FOLDER_ID : folderType === 'archived' ? ARCHIVED_FOLDER_ID : folderId!\n );\n\n const orderedIds = useFolderManagerForOrderedIds(resolvedFolderId);\n\n const orderById = useMemo(() => {\n if (!orderedIds) {\n return undefined;\n }\n\n return orderedIds.reduce((acc, id, i) => {\n acc[id] = i;\n return acc;\n }, {} as Record);\n }, [orderedIds]);\n\n const prevOrderById = usePrevious(orderById);\n\n const orderDiffById = useMemo(() => {\n if (!orderById || !prevOrderById) {\n return {};\n }\n\n return mapValues(orderById, (order, id) => {\n return prevOrderById[id] !== undefined ? order - prevOrderById[id] : -Infinity;\n });\n }, [orderById, prevOrderById]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, orderedIds, undefined, CHAT_LIST_SLICE);\n\n // Support + and + to navigate between chats\n useEffect(() => {\n if (!isActive || !orderedIds) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (IS_PWA && ((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && e.code.startsWith('Digit')) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n const position = Number(digit) - 1;\n if (position > orderedIds!.length - 1) return;\n\n openChat({ id: orderedIds![position], shouldReplaceHistory: true });\n }\n\n if (e.altKey) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (!targetIndexDelta) return;\n\n e.preventDefault();\n openNextChat({ targetIndexDelta, orderedIds });\n }\n }\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [isActive, openChat, openNextChat, orderedIds]);\n\n const getAnimationType = useChatAnimationType(orderDiffById);\n\n function renderChats() {\n const viewportOffset = orderedIds!.indexOf(viewportIds![0]);\n const pinnedCount = getPinnedChatsCount(resolvedFolderId) || 0;\n\n return viewportIds!.map((id, i) => (\n \n ));\n }\n\n return (\n \n {viewportIds?.length ? (\n renderChats()\n ) : viewportIds && !viewportIds.length ? (\n (\n \n )\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(ChatList);\n","import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types';\nimport {\n getChatTitle,\n getSenderTitle,\n isUserId,\n isChatGroup,\n} from '../../../../modules/helpers';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport function getSenderName(\n lang: LangFn, message: ApiMessage, chatsById: Record, usersById: Record,\n) {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n const sender = isUserId(senderId) ? usersById[senderId] : chatsById[senderId];\n\n let senderName = getSenderTitle(lang, sender);\n\n const chat = chatsById[message.chatId];\n if (chat) {\n if (isUserId(senderId) && (sender as ApiUser).isSelf) {\n senderName = `${lang('FromYou')} → ${getChatTitle(lang, chat)}`;\n } else if (isChatGroup(chat)) {\n senderName += ` → ${getChatTitle(lang, chat)}`;\n }\n }\n\n return senderName;\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\n\nimport './DropTarget.scss';\n\nexport type OwnProps = {\n isQuick?: boolean;\n onFileSelect: (e: React.DragEvent) => void;\n};\n\nconst DropTarget: FC = ({ isQuick, onFileSelect }) => {\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n\n const handleDragEnter = () => { markHovered(); };\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget } = e;\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const className = buildClassName(\n 'DropTarget',\n isHovered && 'hovered',\n );\n\n return (\n \n
\n
\n
Drop files here to send them
\n
{isQuick ? 'in a quick way' : 'without compression'}
\n
\n
\n );\n};\n\nexport default memo(DropTarget);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport getFilesFromDataTransferItems from './helpers/getFilesFromDataTransferItems';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport Portal from '../../ui/Portal';\nimport DropTarget from './DropTarget';\n\nimport './DropArea.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withQuick?: boolean;\n onHide: NoneToVoidFunction;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n};\n\nexport enum DropAreaState {\n None = 'none',\n Document = 'document',\n QuickFile = 'quick_file',\n}\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst DropArea: FC = ({\n isOpen, withQuick, onHide, onFileSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\n const prevWithQuick = usePrevious(withQuick);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onHide) : undefined), [isOpen, onHide]);\n\n const handleFilesDrop = useCallback(async (e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n let files: File[] = [];\n\n if (dt.files && dt.files.length > 0 && (!dt.items || !dt.items.length)) {\n files = files.concat(Array.from(dt.files));\n } else if (dt.items && dt.items.length > 0) {\n const folderFiles = await getFilesFromDataTransferItems(dt.items);\n if (folderFiles.length) {\n files = files.concat(folderFiles);\n }\n }\n\n onHide();\n onFileSelect(files, false);\n }, [onFileSelect, onHide]);\n\n const handleQuickFilesDrop = useCallback((e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n\n if (dt.files && dt.files.length > 0) {\n onHide();\n onFileSelect(Array.from(dt.files), true);\n }\n }, [onFileSelect, onHide]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.stopPropagation();\n\n const { target: fromTarget, relatedTarget: toTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.DropTarget, .DropArea') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(() => {\n onHide();\n }, DROP_LEAVE_TIMEOUT_MS);\n }\n }, [onHide]);\n\n const handleDragOver = () => {\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n }\n };\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'DropArea',\n transitionClassNames,\n );\n\n return (\n \n
\n \n {(withQuick || prevWithQuick) && }\n
\n
\n );\n};\n\nexport default memo(DropArea);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './EmojiTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst EmojiTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const EmojiTooltip = useModuleLoader(Bundles.Extra, 'EmojiTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return EmojiTooltip ? : undefined;\n};\n\nexport default memo(EmojiTooltipAsync);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useEffect, useRef, memo, useState, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { IAnchorPosition, ISettings } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { selectReplyingToId } from '../../../modules/selectors';\nimport { debounce } from '../../../util/schedulers';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport buildClassName from '../../../util/buildClassName';\nimport {\n IS_ANDROID, IS_EMOJI_SUPPORTED, IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport useLayoutEffectWithPrevDeps from '../../../hooks/useLayoutEffectWithPrevDeps';\nimport useFlag from '../../../hooks/useFlag';\nimport { isHeavyAnimating } from '../../../hooks/useHeavyAnimationCheck';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\nimport useLang from '../../../hooks/useLang';\nimport parseEmojiOnlyString from '../../common/helpers/parseEmojiOnlyString';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport renderText from '../../common/helpers/renderText';\n\nimport TextFormatter from './TextFormatter';\n\nconst CONTEXT_MENU_CLOSE_DELAY_MS = 100;\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 350;\nconst TRANSITION_DURATION_FACTOR = 50;\n\ntype OwnProps = {\n id: string;\n chatId: string;\n threadId: number;\n isAttachmentModalInput?: boolean;\n editableInputId?: string;\n html: string;\n placeholder: string;\n forcedPlaceholder?: string;\n canAutoFocus: boolean;\n shouldSuppressFocus?: boolean;\n shouldSuppressTextFormatter?: boolean;\n onUpdate: (html: string) => void;\n onSuppressedFocus?: () => void;\n onSend: () => void;\n};\n\ntype StateProps = {\n replyingToId?: number;\n noTabCapture?: boolean;\n messageSendKeyCombo?: ISettings['messageSendKeyCombo'];\n};\n\nconst MAX_INPUT_HEIGHT = IS_SINGLE_COLUMN_LAYOUT ? 256 : 416;\nconst TAB_INDEX_PRIORITY_TIMEOUT = 2000;\nconst TEXT_FORMATTER_SAFE_AREA_PX = 90;\n// For some reason Safari inserts `
` after user removes text from input\nconst SAFARI_BR = '
';\n\nfunction clearSelection() {\n const selection = window.getSelection();\n if (!selection) {\n return;\n }\n\n if (selection.removeAllRanges) {\n selection.removeAllRanges();\n } else if (selection.empty) {\n selection.empty();\n }\n}\n\nconst MessageInput: FC = ({\n id,\n chatId,\n threadId,\n isAttachmentModalInput,\n editableInputId,\n html,\n placeholder,\n forcedPlaceholder,\n canAutoFocus,\n shouldSuppressFocus,\n shouldSuppressTextFormatter,\n replyingToId,\n noTabCapture,\n messageSendKeyCombo,\n onUpdate,\n onSuppressedFocus,\n onSend,\n}) => {\n const {\n editLastMessage,\n replyToNextMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const cloneRef = useRef(null);\n\n const lang = useLang();\n const isContextMenuOpenRef = useRef(false);\n const [isTextFormatterOpen, openTextFormatter, closeTextFormatter] = useFlag();\n const [textFormatterAnchorPosition, setTextFormatterAnchorPosition] = useState();\n const [selectedRange, setSelectedRange] = useState();\n\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n useEffect(() => {\n if (!isAttachmentModalInput) return;\n updateInputHeight(false);\n }, [isAttachmentModalInput]);\n\n useLayoutEffectWithPrevDeps(([prevHtml]) => {\n if (html !== inputRef.current!.innerHTML) {\n inputRef.current!.innerHTML = html;\n }\n\n if (html !== cloneRef.current!.innerHTML) {\n cloneRef.current!.innerHTML = html;\n }\n\n if (prevHtml !== undefined && prevHtml !== html) {\n updateInputHeight(!html.length);\n }\n }, [html]);\n\n const chatIdRef = useRef(chatId);\n chatIdRef.current = chatId;\n const focusInput = useCallback(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (isHeavyAnimating()) {\n setTimeout(focusInput, FOCUS_DELAY_MS);\n return;\n }\n\n focusEditableElement(inputRef.current!);\n }, []);\n\n const handleCloseTextFormatter = useCallback(() => {\n closeTextFormatter();\n clearSelection();\n }, [closeTextFormatter]);\n\n function checkSelection() {\n // Disable the formatter on iOS devices for now.\n if (IS_IOS) {\n return false;\n }\n\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount || isContextMenuOpenRef.current) {\n closeTextFormatter();\n return false;\n }\n\n const selectionRange = selection.getRangeAt(0);\n const selectedText = selectionRange.toString().trim();\n if (\n shouldSuppressTextFormatter\n || !isSelectionInsideInput(selectionRange, editableInputId || EDITABLE_INPUT_ID)\n || !selectedText\n || parseEmojiOnlyString(selectedText)\n || !selectionRange.START_TO_END\n ) {\n closeTextFormatter();\n return false;\n }\n\n return true;\n }\n\n function processSelection() {\n if (!checkSelection()) {\n return;\n }\n\n const selectionRange = window.getSelection()!.getRangeAt(0);\n const selectionRect = selectionRange.getBoundingClientRect();\n const inputRect = inputRef.current!.getBoundingClientRect();\n\n let x = (selectionRect.left + selectionRect.width / 2) - inputRect.left;\n\n if (x < TEXT_FORMATTER_SAFE_AREA_PX) {\n x = TEXT_FORMATTER_SAFE_AREA_PX;\n } else if (x > inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX) {\n x = inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX;\n }\n\n setTextFormatterAnchorPosition({\n x,\n y: selectionRect.top - inputRect.top,\n });\n\n setSelectedRange(selectionRange);\n openTextFormatter();\n }\n\n function handleMouseDown(event: React.MouseEvent) {\n function handleMouseUp() {\n processSelection();\n\n event.target.removeEventListener('mouseup', handleMouseUp);\n }\n\n if (event.button !== 2) {\n event.target.addEventListener('mouseup', handleMouseUp);\n return;\n }\n\n if (isContextMenuOpenRef.current === true) {\n return;\n }\n\n isContextMenuOpenRef.current = true;\n\n function closeContextMenuMouseListener() {\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('mouseup', closeContextMenuMouseListener);\n }\n\n function closeContextMenuKeyListener(e: KeyboardEvent) {\n if (e.key !== 'Esc' && e.key !== 'Escape') {\n return;\n }\n\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('keydown', closeContextMenuKeyListener);\n }\n\n document.addEventListener('mousedown', closeContextMenuMouseListener);\n document.addEventListener('keydown', closeContextMenuKeyListener);\n }\n\n function handleKeyDown(e: React.KeyboardEvent) {\n function handleKeyUp() {\n processSelection();\n\n e.target.removeEventListener('keyup', handleKeyUp);\n }\n\n if (!html.length && (e.metaKey || e.ctrlKey)) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (targetIndexDelta) {\n e.preventDefault();\n\n replyToNextMessage({ targetIndexDelta });\n return;\n }\n }\n\n if (e.key === 'Enter' && !e.shiftKey) {\n if (\n !(IS_IOS || IS_ANDROID)\n && (\n (messageSendKeyCombo === 'enter' && !e.shiftKey)\n || (messageSendKeyCombo === 'ctrl-enter' && (e.ctrlKey || e.metaKey))\n )\n ) {\n e.preventDefault();\n\n closeTextFormatter();\n onSend();\n }\n } else if (e.key === 'ArrowUp' && !html.length && !e.metaKey && !e.ctrlKey && !e.altKey) {\n e.preventDefault();\n editLastMessage();\n } else {\n e.target.addEventListener('keyup', handleKeyUp);\n }\n }\n\n function handleChange(e: ChangeEvent) {\n const { innerHTML, textContent } = e.currentTarget;\n\n onUpdate(innerHTML === SAFARI_BR ? '' : innerHTML);\n sendMessageAction({ type: 'typing' });\n\n // Reset focus on the input to remove any active styling when input is cleared\n if (\n !IS_TOUCH_ENV\n && (!textContent || !textContent.length)\n // When emojis are not supported, innerHTML contains an emoji img tag that doesn't exist in the textContext\n && !(!IS_EMOJI_SUPPORTED && innerHTML.includes('emoji-small'))\n ) {\n const selection = window.getSelection()!;\n if (selection) {\n inputRef.current!.blur();\n selection.removeAllRanges();\n focusEditableElement(inputRef.current!, true);\n }\n }\n }\n\n function stopEvent(e: React.MouseEvent) {\n if (!checkSelection()) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n function updateInputHeight(willSend = false) {\n const input = inputRef.current!;\n const clone = cloneRef.current!;\n const currentHeight = Number(input.style.height.replace('px', ''));\n const newHeight = Math.min(clone.scrollHeight, MAX_INPUT_HEIGHT);\n if (newHeight === currentHeight) {\n return;\n }\n\n const transitionDuration = Math.round(\n TRANSITION_DURATION_FACTOR * Math.log(Math.abs(newHeight - currentHeight)),\n );\n\n const exec = () => {\n input.style.height = `${newHeight}px`;\n input.style.transitionDuration = `${transitionDuration}ms`;\n input.classList.toggle('overflown', clone.scrollHeight > MAX_INPUT_HEIGHT);\n };\n\n if (willSend) {\n // Sync with sending animation\n requestAnimationFrame(exec);\n } else {\n exec();\n }\n }\n\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n if (canAutoFocus) {\n focusInput();\n }\n }, [chatId, focusInput, replyingToId, canAutoFocus]);\n\n useEffect(() => {\n if (noTabCapture) {\n return undefined;\n }\n\n const captureFirstTab = debounce((e: KeyboardEvent) => {\n if (e.key === 'Tab') {\n e.preventDefault();\n requestAnimationFrame(focusInput);\n }\n }, TAB_INDEX_PRIORITY_TIMEOUT, true, false);\n\n return captureKeyboardListeners({ onTab: captureFirstTab });\n }, [focusInput, noTabCapture]);\n\n useEffect(() => {\n const input = inputRef.current!;\n\n function suppressFocus() {\n input.blur();\n }\n\n if (shouldSuppressFocus) {\n input.addEventListener('focus', suppressFocus);\n }\n\n return () => {\n input.removeEventListener('focus', suppressFocus);\n };\n }, [shouldSuppressFocus]);\n\n const className = buildClassName(\n 'form-control custom-scroll',\n html.length > 0 && 'touched',\n shouldSuppressFocus && 'focus-disabled',\n );\n\n return (\n
\n \n
\n {!forcedPlaceholder && {placeholder}}\n \n {forcedPlaceholder && {renderText(forcedPlaceholder!)}}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId }: OwnProps): StateProps => {\n const { messageSendKeyCombo } = global.settings.byKey;\n\n return {\n messageSendKeyCombo,\n replyingToId: chatId && threadId ? selectReplyingToId(global, chatId, threadId) : undefined,\n noTabCapture: global.isPollModalOpen || global.payment.isPaymentModalOpen,\n };\n },\n)(MessageInput));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { IAnchorPosition } from '../../../types';\nimport { ApiMessageEntityTypes } from '../../../api/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport buildClassName from '../../../util/buildClassName';\nimport { ensureProtocol } from '../../../util/ensureProtocol';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport getKeyFromEvent from '../../../util/getKeyFromEvent';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useVirtualBackdrop from '../../../hooks/useVirtualBackdrop';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './TextFormatter.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n anchorPosition?: IAnchorPosition;\n selectedRange?: Range;\n setSelectedRange: (range: Range) => void;\n onClose: () => void;\n};\n\ninterface ISelectedTextFormats {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n monospace?: boolean;\n spoiler?: boolean;\n}\n\nconst TEXT_FORMAT_BY_TAG_NAME: Record = {\n B: 'bold',\n STRONG: 'bold',\n I: 'italic',\n EM: 'italic',\n U: 'underline',\n DEL: 'strikethrough',\n CODE: 'monospace',\n SPAN: 'spoiler',\n};\nconst fragmentEl = document.createElement('div');\n\nconst TextFormatter: FC = ({\n isOpen,\n anchorPosition,\n selectedRange,\n setSelectedRange,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const linkUrlInputRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n const [isLinkControlOpen, openLinkControl, closeLinkControl] = useFlag();\n const [linkUrl, setLinkUrl] = useState('');\n const [isEditingLink, setIsEditingLink] = useState(false);\n const [inputClassName, setInputClassName] = useState();\n const [selectedTextFormats, setSelectedTextFormats] = useState({});\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClose) : undefined), [isOpen, onClose]);\n useVirtualBackdrop(\n isOpen,\n containerRef,\n onClose,\n );\n\n useEffect(() => {\n if (isLinkControlOpen) {\n linkUrlInputRef.current!.focus();\n } else {\n setLinkUrl('');\n setIsEditingLink(false);\n }\n }, [isLinkControlOpen]);\n\n useEffect(() => {\n if (!shouldRender) {\n closeLinkControl();\n setSelectedTextFormats({});\n setInputClassName(undefined);\n }\n }, [closeLinkControl, shouldRender]);\n\n useEffect(() => {\n if (!isOpen || !selectedRange) {\n return;\n }\n\n const selectedFormats: ISelectedTextFormats = {};\n let { parentElement } = selectedRange.commonAncestorContainer;\n while (parentElement && parentElement.id !== EDITABLE_INPUT_ID) {\n const textFormat = TEXT_FORMAT_BY_TAG_NAME[parentElement.tagName];\n if (textFormat) {\n selectedFormats[textFormat] = true;\n }\n\n parentElement = parentElement.parentElement;\n }\n\n setSelectedTextFormats(selectedFormats);\n }, [isOpen, selectedRange, openLinkControl]);\n\n function restoreSelection() {\n if (!selectedRange) {\n return;\n }\n\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(selectedRange);\n }\n }\n\n const updateSelectedRange = useCallback(() => {\n const selection = window.getSelection();\n if (selection) {\n setSelectedRange(selection.getRangeAt(0));\n }\n }, [setSelectedRange]);\n\n const getSelectedText = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n fragmentEl.innerText = selectedRange.toString();\n\n return fragmentEl.innerHTML;\n }, [selectedRange]);\n\n const getSelectedElement = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n\n return selectedRange.commonAncestorContainer.parentElement;\n }, [selectedRange]);\n\n function updateInputStyles() {\n const input = linkUrlInputRef.current;\n if (!input) {\n return;\n }\n\n const { offsetWidth, scrollWidth, scrollLeft } = input;\n if (scrollWidth <= offsetWidth) {\n setInputClassName(undefined);\n return;\n }\n\n let className = '';\n if (scrollLeft < scrollWidth - offsetWidth) {\n className = 'mask-right';\n }\n if (scrollLeft > 0) {\n className += ' mask-left';\n }\n\n setInputClassName(className);\n }\n\n function handleLinkUrlChange(e: React.ChangeEvent) {\n setLinkUrl(e.target.value);\n updateInputStyles();\n }\n\n function getFormatButtonClassName(key: keyof ISelectedTextFormats) {\n if (selectedTextFormats[key]) {\n return 'active';\n }\n\n if (key === 'monospace' || key === 'strikethrough') {\n if (Object.keys(selectedTextFormats).some(\n (fKey) => fKey !== key && Boolean(selectedTextFormats[fKey as keyof ISelectedTextFormats]),\n )) {\n return 'disabled';\n }\n } else if (selectedTextFormats.monospace || selectedTextFormats.strikethrough) {\n return 'disabled';\n }\n\n return undefined;\n }\n\n const handleSpoilerText = useCallback(() => {\n if (selectedTextFormats.spoiler) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.dataset.entityType !== ApiMessageEntityTypes.Spoiler\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n spoiler: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand(\n 'insertHTML', false, `${text}`,\n );\n onClose();\n }, [getSelectedElement, getSelectedText, onClose, selectedRange, selectedTextFormats.spoiler]);\n\n const handleBoldText = useCallback(() => {\n setSelectedTextFormats((selectedFormats) => {\n // Somehow re-applying 'bold' command to already bold text doesn't work\n document.execCommand(selectedFormats.bold ? 'removeFormat' : 'bold');\n Object.keys(selectedFormats).forEach((key) => {\n if ((key === 'italic' || key === 'underline') && Boolean(selectedFormats[key])) {\n document.execCommand(key);\n }\n });\n\n updateSelectedRange();\n return {\n ...selectedFormats,\n bold: !selectedFormats.bold,\n };\n });\n }, [updateSelectedRange]);\n\n const handleItalicText = useCallback(() => {\n document.execCommand('italic');\n updateSelectedRange();\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n italic: !selectedFormats.italic,\n }));\n }, [updateSelectedRange]);\n\n const handleUnderlineText = useCallback(() => {\n document.execCommand('underline');\n updateSelectedRange();\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n underline: !selectedFormats.underline,\n }));\n }, [updateSelectedRange]);\n\n const handleStrikethroughText = useCallback(() => {\n if (selectedTextFormats.strikethrough) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'DEL'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n strikethrough: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose, selectedRange, selectedTextFormats.strikethrough,\n ]);\n\n const handleMonospaceText = useCallback(() => {\n if (selectedTextFormats.monospace) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'CODE'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n monospace: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose, selectedRange, selectedTextFormats.monospace,\n ]);\n\n function handleLinkUrlConfirm() {\n const formattedLinkUrl = encodeURI(ensureProtocol(linkUrl) || '');\n\n if (isEditingLink) {\n const element = getSelectedElement();\n if (!element || element.tagName !== 'A') {\n return;\n }\n\n (element as HTMLAnchorElement).href = formattedLinkUrl;\n\n onClose();\n\n return;\n }\n\n const text = getSelectedText();\n restoreSelection();\n document.execCommand(\n 'insertHTML',\n false,\n `${text}`,\n );\n onClose();\n }\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n const HANDLERS_BY_KEY: Record = {\n k: openLinkControl,\n b: handleBoldText,\n u: handleUnderlineText,\n i: handleItalicText,\n m: handleMonospaceText,\n s: handleStrikethroughText,\n p: handleSpoilerText,\n };\n\n const handler = HANDLERS_BY_KEY[getKeyFromEvent(e)];\n\n if (\n e.altKey\n || !(e.ctrlKey || e.metaKey)\n || !handler\n ) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n handler();\n }, [\n openLinkControl, handleBoldText, handleUnderlineText, handleItalicText, handleMonospaceText,\n handleStrikethroughText, handleSpoilerText,\n ]);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('keydown', handleKeyDown);\n }\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, handleKeyDown]);\n\n const lang = useLang();\n\n function handleContainerKeyDown(e: React.KeyboardEvent) {\n if (e.key === 'Enter' && isLinkControlOpen) {\n handleLinkUrlConfirm();\n e.preventDefault();\n }\n }\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'TextFormatter',\n transitionClassNames,\n isLinkControlOpen && 'link-control-shown',\n );\n\n const linkUrlConfirmClassName = buildClassName(\n 'TextFormatter-link-url-confirm',\n Boolean(linkUrl.length) && 'shown',\n );\n\n const style = anchorPosition\n ? `left: ${anchorPosition.x}px; top: ${anchorPosition.y}px;--text-formatter-left: ${anchorPosition.x}px;`\n : '';\n\n return (\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\nexport default memo(TextFormatter);\n","export default async function getFilesFromDataTransferItems(dataTransferItems: DataTransferItemList) {\n const files: File[] = [];\n\n function traverseFileTreePromise(entry: FileSystemEntry | File, item: DataTransferItem) {\n return new Promise(resolve => {\n if (entry instanceof File) {\n files.push(entry);\n resolve(entry);\n } else if (entry.isFile) {\n const itemFile = item.getAsFile();\n (entry as FileSystemFileEntry).file((file) => {\n files.push(file);\n resolve(file);\n }, () => {\n // iOS Safari throws an error \"NotFoundError: Path does not exist\" for files from the clipboard\n // https://stackoverflow.com/a/50059309\n if (itemFile) {\n files.push(itemFile);\n }\n resolve(itemFile);\n });\n } else if (entry.isDirectory) {\n let dirReader = (entry as FileSystemDirectoryEntry).createReader();\n dirReader.readEntries((entries) => {\n let entriesPromises = [];\n for (let entr of entries) {\n entriesPromises.push(traverseFileTreePromise(entr, item));\n }\n resolve(Promise.all(entriesPromises));\n });\n }\n });\n }\n\n let entriesPromises = [];\n for (let item of dataTransferItems) {\n if (item.kind === 'file') {\n const entry = item.webkitGetAsEntry() || item.getAsFile();\n if (entry) {\n entriesPromises.push(traverseFileTreePromise(entry, item));\n }\n }\n }\n\n await Promise.all(entriesPromises);\n\n return files;\n}\n\n","const RE_BR = /(
|)/g;\nconst RE_SPACE = /( |\\u00A0)/g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\nconst RE_EXTRA_NEW_LINE = /\\n$/i;\n\nexport function prepareForRegExp(html: string) {\n return html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .replace(RE_EXTRA_NEW_LINE, '');\n}\n","const MAX_NESTING_PARENTS = 5;\n\nexport function isSelectionInsideInput(selectionRange: Range, inputId: string) {\n const { commonAncestorContainer } = selectionRange;\n let parentNode: HTMLElement | null = commonAncestorContainer as HTMLElement;\n let iterations = 1;\n while (parentNode && parentNode.id !== inputId && iterations < MAX_NESTING_PARENTS) {\n parentNode = parentNode.parentElement;\n iterations++;\n }\n\n return Boolean(parentNode && parentNode.id === inputId);\n}\n","import { areSortedArraysEqual } from './iteratees';\n\nconst cache = new WeakMap();\n\nexport default function memoized(fn: T) {\n return (...args: Parameters): ReturnType => {\n const cached = cache.get(fn);\n if (cached && areSortedArraysEqual(cached.lastArgs, args)) {\n return cached.lastResult;\n }\n\n const result = fn(...args);\n cache.set(fn, { lastArgs: args, lastResult: result });\n return result;\n };\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../../util/memo';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport {\n EmojiData, EmojiModule, EmojiRawData, uncompressEmoji,\n} from '../../../../util/emoji';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport {\n buildCollectionByKey, flatten, mapValues, pickTruthy, unique,\n} from '../../../../util/iteratees';\nimport memoized from '../../../../util/memoized';\nimport useFlag from '../../../../hooks/useFlag';\nimport renderText from '../../../common/helpers/renderText';\n\ninterface Library {\n keywords: string[];\n byKeyword: Record;\n names: string[];\n byName: Record;\n}\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nlet RE_EMOJI_SEARCH: RegExp;\nconst EMOJIS_LIMIT = 36;\nconst FILTER_MIN_LENGTH = 2;\n\nconst prepareRecentEmojisMemo = memoized(prepareRecentEmojis);\nconst prepareLibraryMemo = memoized(prepareLibrary);\nconst searchInLibraryMemo = memoized(searchInLibrary);\n\ntry {\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\p{L}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useEmojiTooltip(\n isAllowed: boolean,\n htmlRef: { current: string },\n recentEmojiIds: string[],\n inputId = EDITABLE_INPUT_ID,\n onUpdateHtml: (html: string) => void,\n baseEmojiKeywords?: Record,\n emojiKeywords?: Record,\n isDisabled = false,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [byId, setById] = useState | undefined>();\n const [shouldForceInsertEmoji, setShouldForceInsertEmoji] = useState(false);\n const [filteredEmojis, setFilteredEmojis] = useState(MEMO_EMPTY_ARRAY);\n\n // Initialize data on first render.\n useEffect(() => {\n if (isDisabled) return;\n const exec = () => {\n setById(emojiData.emojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, [isDisabled]);\n\n const html = htmlRef.current;\n useEffect(() => {\n if (!isAllowed || !html || !byId || isDisabled) {\n unmarkIsOpen();\n return;\n }\n\n const code = html.includes(':') && getEmojiCode(html);\n if (!code) {\n setFilteredEmojis(MEMO_EMPTY_ARRAY);\n unmarkIsOpen();\n return;\n }\n\n const forceSend = code.length > 2 && code.endsWith(':');\n const filter = code.substr(1, forceSend ? code.length - 2 : undefined);\n let matched: Emoji[] = MEMO_EMPTY_ARRAY;\n\n setShouldForceInsertEmoji(forceSend);\n\n if (!filter) {\n matched = prepareRecentEmojisMemo(byId, recentEmojiIds, EMOJIS_LIMIT);\n } else if (filter.length >= FILTER_MIN_LENGTH) {\n const library = prepareLibraryMemo(byId, baseEmojiKeywords, emojiKeywords);\n matched = searchInLibraryMemo(library, filter, EMOJIS_LIMIT);\n }\n\n if (matched.length) {\n if (!forceSend) {\n markIsOpen();\n }\n setFilteredEmojis(matched);\n } else {\n unmarkIsOpen();\n }\n }, [\n byId, html, isAllowed, markIsOpen, recentEmojiIds, unmarkIsOpen, setShouldForceInsertEmoji,\n isDisabled, baseEmojiKeywords, emojiKeywords,\n ]);\n\n const insertEmoji = useCallback((textEmoji: string, isForce?: boolean) => {\n const currentHtml = htmlRef.current;\n const atIndex = currentHtml.lastIndexOf(':', isForce ? currentHtml.lastIndexOf(':') - 1 : undefined);\n if (atIndex !== -1) {\n onUpdateHtml(`${currentHtml.substr(0, atIndex)}${renderText(textEmoji, ['emoji_html'])}`);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, true, true);\n });\n }\n\n unmarkIsOpen();\n }, [htmlRef, inputId, onUpdateHtml, unmarkIsOpen]);\n\n useEffect(() => {\n if (isOpen && shouldForceInsertEmoji && filteredEmojis.length) {\n insertEmoji(filteredEmojis[0].native, true);\n }\n }, [filteredEmojis, insertEmoji, isOpen, shouldForceInsertEmoji]);\n\n return {\n isEmojiTooltipOpen: isOpen,\n closeEmojiTooltip: unmarkIsOpen,\n filteredEmojis,\n insertEmoji,\n };\n}\n\nfunction getEmojiCode(html: string) {\n const emojis = prepareForRegExp(html).match(RE_EMOJI_SEARCH);\n\n return emojis ? emojis[0].trim() : undefined;\n}\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n\nfunction prepareRecentEmojis(byId: Record, recentEmojiIds: string[], limit: number) {\n if (!byId || !recentEmojiIds.length) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return Object.values(pickTruthy(byId, recentEmojiIds)).slice(0, limit);\n}\n\nfunction prepareLibrary(\n byId: Record,\n baseEmojiKeywords?: Record,\n emojiKeywords?: Record,\n): Library {\n const emojis = Object.values(byId);\n\n const byNative = buildCollectionByKey(emojis, 'native');\n const baseEmojisByKeyword = baseEmojiKeywords\n ? mapValues(baseEmojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n const emojisByKeyword = emojiKeywords\n ? mapValues(emojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n\n const byKeyword = { ...baseEmojisByKeyword, ...emojisByKeyword };\n const keywords = ([] as string[]).concat(Object.keys(baseEmojisByKeyword), Object.keys(emojisByKeyword));\n\n const byName = emojis.reduce((result, emoji) => {\n emoji.names.forEach((name) => {\n if (!result[name]) {\n result[name] = [];\n }\n\n result[name].push(emoji);\n });\n\n return result;\n }, {} as Record);\n\n const names = Object.keys(byName);\n\n return {\n byKeyword,\n keywords,\n byName,\n names,\n };\n}\n\nfunction searchInLibrary(library: Library, filter: string, limit: number) {\n const {\n byKeyword, keywords, byName, names,\n } = library;\n\n let matched: Emoji[] = MEMO_EMPTY_ARRAY;\n\n const matchedKeywords = keywords.filter((keyword) => keyword.startsWith(filter)).sort();\n matched = matched.concat(flatten(Object.values(pickTruthy(byKeyword!, matchedKeywords))));\n\n // Also search by names, which is useful for non-English languages\n const matchedNames = names.filter((name) => name.startsWith(filter));\n matched = matched.concat(flatten(Object.values(pickTruthy(byName, matchedNames))));\n\n matched = unique(matched);\n\n return matched.slice(0, limit);\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\nimport { getGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types';\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { filterUsersByName, getUserFirstOrLastName } from '../../../../modules/helpers';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport useFlag from '../../../../hooks/useFlag';\nimport { pickTruthy, unique } from '../../../../util/iteratees';\nimport { throttle } from '../../../../util/schedulers';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nlet RE_USERNAME_SEARCH: RegExp;\n\ntry {\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\p{L}\\\\p{M}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useMentionTooltip(\n canSuggestMembers: boolean | undefined,\n htmlRef: { current: string },\n onUpdateHtml: (html: string) => void,\n inputId: string = EDITABLE_INPUT_ID,\n groupChatMembers?: ApiChatMember[],\n topInlineBotIds?: string[],\n currentUserId?: string,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [usersToMention, setUsersToMention] = useState();\n\n const updateFilteredUsers = useCallback((filter, withInlineBots: boolean) => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n if (!(groupChatMembers || topInlineBotIds) || !usersById) {\n setUsersToMention(undefined);\n\n return;\n }\n\n runThrottled(() => {\n const memberIds = groupChatMembers?.reduce((acc: string[], member) => {\n if (member.userId !== currentUserId) {\n acc.push(member.userId);\n }\n\n return acc;\n }, []);\n\n const filteredIds = filterUsersByName(unique([\n ...((withInlineBots && topInlineBotIds) || []),\n ...(memberIds || []),\n ]), usersById, filter);\n\n setUsersToMention(Object.values(pickTruthy(usersById, filteredIds)));\n });\n }, [currentUserId, groupChatMembers, topInlineBotIds]);\n\n const html = htmlRef.current;\n useEffect(() => {\n if (!canSuggestMembers || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const usernameFilter = html.includes('@') && getUsernameFilter(html);\n\n if (usernameFilter) {\n const filter = usernameFilter ? usernameFilter.substr(1) : '';\n updateFilteredUsers(filter, canSuggestInlineBots(html));\n } else {\n unmarkIsOpen();\n }\n }, [canSuggestMembers, updateFilteredUsers, markIsOpen, unmarkIsOpen, html]);\n\n useEffect(() => {\n if (usersToMention?.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [markIsOpen, unmarkIsOpen, usersToMention]);\n\n const insertMention = useCallback((user: ApiUser, forceFocus = false) => {\n if (!user.username && !getUserFirstOrLastName(user)) {\n return;\n }\n\n const insertedHtml = user.username\n ? `@${user.username}`\n : `${getUserFirstOrLastName(user)}`;\n\n const currentHtml = htmlRef.current;\n const atIndex = currentHtml.lastIndexOf('@');\n if (atIndex !== -1) {\n onUpdateHtml(`${currentHtml.substr(0, atIndex)}${insertedHtml} `);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, forceFocus);\n });\n }\n\n unmarkIsOpen();\n }, [htmlRef, inputId, onUpdateHtml, unmarkIsOpen]);\n\n return {\n isMentionTooltipOpen: isOpen,\n closeMentionTooltip: unmarkIsOpen,\n insertMention,\n mentionFilteredUsers: usersToMention,\n };\n}\n\nfunction getUsernameFilter(html: string) {\n const username = prepareForRegExp(html).match(RE_USERNAME_SEARCH);\n\n return username ? username[0].trim() : undefined;\n}\n\nfunction canSuggestInlineBots(html: string) {\n return html.startsWith('@');\n}\n","import { useEffect, useRef } from '../../../lib/teact/teact';\n\nimport useOnChange from '../../../hooks/useOnChange';\nimport useForceUpdate from '../../../hooks/useForceUpdate';\n\nexport default function useAsyncRendering(dependencies: T, delay?: number) {\n const isDisabled = delay === undefined;\n const shouldRenderRef = useRef(isDisabled);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n if (isDisabled) {\n return;\n }\n\n shouldRenderRef.current = false;\n\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, dependencies);\n\n useEffect(() => {\n if (isDisabled || shouldRenderRef.current) {\n return;\n }\n\n const exec = () => {\n shouldRenderRef.current = true;\n forceUpdate();\n };\n\n if (delay! > 0) {\n timeoutRef.current = window.setTimeout(exec, delay);\n } else {\n exec();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return shouldRenderRef.current;\n}\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, memo, useState,\n} from '../../lib/teact/teact';\n\nimport Checkbox from './Checkbox';\n\ntype IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n};\n\ntype OwnProps = {\n id?: string;\n options: IRadioOption[];\n selected?: string[];\n disabled?: boolean;\n round?: boolean;\n loadingOptions?: string[];\n onChange: (value: string[]) => void;\n};\n\nconst CheckboxGroup: FC = ({\n id,\n options,\n selected = [],\n disabled,\n round,\n loadingOptions,\n onChange,\n}) => {\n const [values, setValues] = useState(selected || []);\n\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value, checked } = event.currentTarget;\n let newValues: string[];\n if (checked) {\n newValues = [...values, value];\n } else {\n newValues = values.filter((v) => v !== value);\n }\n\n setValues(newValues);\n onChange(newValues);\n }, [onChange, values]);\n\n return (\n
\n {options.map((option) => (\n \n ))}\n
\n );\n};\n\nexport default memo(CheckboxGroup);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\nimport './FloatingActionButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n className?: string;\n color?: ButtonProps['color'];\n ariaLabel?: ButtonProps['ariaLabel'];\n disabled?: boolean;\n onClick: () => void;\n children: React.ReactNode;\n};\n\nconst FloatingActionButton: FC = ({\n isShown,\n className,\n color = 'primary',\n ariaLabel,\n disabled,\n onClick,\n children,\n}) => {\n const buttonClassName = buildClassName(\n 'FloatingActionButton',\n isShown && 'revealed',\n className,\n );\n\n return (\n \n {children}\n \n );\n};\n\nexport default FloatingActionButton;\n","import { RefObject } from 'react';\nimport React, { FC, useRef, useCallback } from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport useContextMenuPosition from '../../hooks/useContextMenuPosition';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from './RippleEffect';\nimport Menu from './Menu';\nimport MenuItem from './MenuItem';\nimport Button from './Button';\n\nimport './ListItem.scss';\n\ninterface MenuItemContextAction {\n title: string;\n icon: string;\n destructive?: boolean;\n handler?: () => void;\n}\n\ninterface OwnProps {\n ref?: RefObject;\n buttonRef?: RefObject;\n icon?: string;\n secondaryIcon?: string;\n className?: string;\n style?: string;\n children: React.ReactNode;\n disabled?: boolean;\n ripple?: boolean;\n narrow?: boolean;\n inactive?: boolean;\n focus?: boolean;\n destructive?: boolean;\n multiline?: boolean;\n isStatic?: boolean;\n contextActions?: MenuItemContextAction[];\n onMouseDown?: (e: React.MouseEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n onSecondaryIconClick?: (e: React.MouseEvent) => void;\n}\n\nconst ListItem: FC = ({\n ref,\n buttonRef,\n icon,\n secondaryIcon,\n className,\n style,\n children,\n disabled,\n ripple,\n narrow,\n inactive,\n focus,\n destructive,\n multiline,\n isStatic,\n contextActions,\n onMouseDown,\n onClick,\n onSecondaryIconClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n const [isTouched, markIsTouched, unmarkIsTouched] = useFlag();\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(containerRef, !contextActions);\n\n const getTriggerElement = useCallback(() => containerRef.current, []);\n\n const getRootElement = useCallback(\n () => containerRef.current!.closest('.custom-scroll'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => containerRef.current!.querySelector('.ListItem-context-menu .bubble'),\n [],\n );\n\n const {\n positionX, positionY, transformOriginX, transformOriginY, style: menuStyle,\n } = useContextMenuPosition(\n contextMenuPosition,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n );\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n return;\n }\n onClick(e);\n\n if (IS_TOUCH_ENV && !ripple) {\n markIsTouched();\n fastRaf(unmarkIsTouched);\n }\n }, [disabled, markIsTouched, onClick, ripple, unmarkIsTouched]);\n\n const handleSecondaryIconClick = (e: React.MouseEvent) => {\n if (disabled || e.button !== 0 || (!onSecondaryIconClick && !contextActions)) return;\n e.stopPropagation();\n if (onSecondaryIconClick) {\n onSecondaryIconClick(e);\n } else {\n handleContextMenu(e);\n }\n };\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (inactive || IS_TOUCH_ENV) {\n return;\n }\n if (contextActions && (e.button === 2 || !onClick)) {\n handleBeforeContextMenu(e);\n }\n if (e.button === 0) {\n if (!onClick) {\n handleContextMenu(e);\n } else {\n handleClick(e);\n }\n }\n }, [inactive, contextActions, onClick, handleBeforeContextMenu, handleContextMenu, handleClick]);\n\n const lang = useLang();\n\n const fullClassName = buildClassName(\n 'ListItem',\n className,\n !isStatic && 'no-selection',\n ripple && 'has-ripple',\n narrow && 'narrow',\n disabled && 'disabled',\n inactive && 'inactive',\n contextMenuPosition && 'has-menu-open',\n focus && 'focus',\n destructive && 'destructive',\n multiline && 'multiline',\n isStatic && 'is-static',\n );\n\n return (\n \n \n {icon && (\n \n )}\n {multiline && (
{children}
)}\n {!multiline && children}\n {!disabled && !inactive && ripple && (\n \n )}\n {secondaryIcon && (\n \n \n \n )}\n
\n {contextActions && contextMenuPosition !== undefined && (\n \n {contextActions.map((action) => (\n \n {action.title}\n \n ))}\n \n )}\n
\n );\n};\n\nexport default ListItem;\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport buildClassName from '../../util/buildClassName';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport Portal from './Portal';\n\nimport './Notification.scss';\n\ntype OwnProps = {\n containerId?: string;\n message: TextPart[];\n duration?: number;\n onDismiss: () => void;\n};\n\nconst DEFAULT_DURATION = 3000;\nconst ANIMATION_DURATION = 150;\n\nconst Notification: FC = ({\n message, duration = DEFAULT_DURATION, containerId, onDismiss,\n}) => {\n const [isOpen, setIsOpen] = useState(true);\n // eslint-disable-next-line no-null/no-null\n const timerRef = useRef(null);\n\n const { transitionClassNames } = useShowTransition(isOpen);\n\n const closeAndDismiss = useCallback(() => {\n setIsOpen(false);\n setTimeout(onDismiss, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [onDismiss]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(closeAndDismiss) : undefined), [isOpen, closeAndDismiss]);\n\n useEffect(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n };\n }, [duration, closeAndDismiss]);\n\n const handleMouseEnter = useCallback(() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n }, [duration, closeAndDismiss]);\n\n return (\n \n \n
\n {message}\n
\n
\n \n );\n};\n\nexport default Notification;\n","import React, {\n FC, useEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './ProgressSpinner.scss';\n\nconst RADIUSES = {\n s: 22, m: 25, l: 28, xl: 20,\n};\nconst STROKE_WIDTH = 2;\nconst MIN_PROGRESS = 0.05;\nconst MAX_PROGRESS = 1;\n\nconst ProgressSpinner: FC<{\n progress?: number;\n size?: 's' | 'm' | 'l' | 'xl';\n square?: boolean;\n transparent?: boolean;\n noCross?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n}> = ({\n progress = 0,\n size = 'l',\n square,\n transparent,\n noCross,\n onClick,\n}) => {\n const radius = RADIUSES[size];\n const circleRadius = radius - STROKE_WIDTH * 2;\n const borderRadius = radius - 1;\n const circumference = circleRadius * 2 * Math.PI;\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n\n useEffect(() => {\n if (!container.current) {\n return;\n }\n\n const svg = container.current.firstElementChild;\n const strokeDashOffset = circumference - Math.min(Math.max(MIN_PROGRESS, progress), MAX_PROGRESS) * circumference;\n\n if (!svg) {\n container.current.innerHTML = `\n \n `;\n } else {\n (svg.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n }, [container, circumference, borderRadius, circleRadius, progress]);\n\n const className = buildClassName(\n `ProgressSpinner size-${size}`,\n transparent && 'transparent',\n square && 'square',\n noCross && 'no-cross',\n );\n\n return (\n \n );\n};\n\nexport default memo(ProgressSpinner);\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from './Spinner';\n\nimport './Radio.scss';\n\ntype OwnProps = {\n id?: string;\n name: string;\n label: string;\n subLabel?: string;\n value: string;\n checked: boolean;\n disabled?: boolean;\n hidden?: boolean;\n isLoading?: boolean;\n onChange: (e: ChangeEvent) => void;\n};\n\nconst Radio: FC = ({\n id,\n label,\n subLabel,\n value,\n name,\n checked,\n disabled,\n hidden,\n isLoading,\n onChange,\n}) => {\n const lang = useLang();\n const className = buildClassName(\n 'Radio',\n disabled && 'disabled',\n hidden && 'hidden-widget',\n isLoading && 'loading',\n );\n\n return (\n \n );\n};\n\nexport default memo(Radio);\n","import { ChangeEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport Radio from './Radio';\n\nexport type IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n hidden?: boolean;\n};\n\ntype OwnProps = {\n id?: string;\n name: string;\n options: IRadioOption[];\n selected?: string;\n disabled?: boolean;\n loadingOption?: string;\n onChange: (value: string) => void;\n};\n\nconst RadioGroup: FC = ({\n id,\n name,\n options,\n selected,\n disabled,\n loadingOption,\n onChange,\n}) => {\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value } = event.currentTarget;\n onChange(value);\n }, [onChange]);\n\n return (\n
\n {options.map((option) => (\n
\n );\n};\n\nexport default memo(RadioGroup);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, useMemo, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './RangeSlider.scss';\n\ntype OwnProps = {\n options?: string[];\n min?: number;\n max?: number;\n step?: number;\n label?: string;\n value: number;\n renderValue?: (value: number) => string;\n disabled?: boolean;\n onChange: (value: number) => void;\n};\n\nconst RangeSlider: FC = ({\n options,\n min = 0,\n max = options ? options.length - 1 : 100,\n step = 1,\n label,\n value,\n renderValue,\n disabled,\n onChange,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n onChange(Number(event.currentTarget.value));\n }, [onChange]);\n\n const className = buildClassName(\n 'RangeSlider',\n disabled && 'disabled',\n );\n\n const trackWidth = useMemo(() => {\n if (options) {\n return (value / (options.length - 1)) * 100;\n } else {\n const possibleValuesLength = (max - min) / step;\n return ((value - min) / possibleValuesLength) * 100;\n }\n }, [options, value, max, min, step]);\n\n return (\n
\n {label && (\n
\n {label}\n {!options && (\n {renderValue ? renderValue(value) : value}\n )}\n
\n )}\n
\n \n \n {options && (\n
\n {options.map((option, index) => (\n onChange(index)}\n >\n {option}\n
\n ))}\n
\n )}\n
\n
\n );\n};\n\nexport default memo(RangeSlider);\n","import { RefObject } from 'react';\nimport React, {\n FC, useRef, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\nimport useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen';\n\nimport Loading from './Loading';\nimport Button from './Button';\nimport ShowTransition from './ShowTransition';\n\nimport './SearchInput.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n children?: React.ReactNode;\n parentContainerClassName?: string;\n className?: string;\n inputId?: string;\n value?: string;\n focused?: boolean;\n isLoading?: boolean;\n spinnerColor?: 'yellow';\n spinnerBackgroundColor?: 'light';\n placeholder?: string;\n disabled?: boolean;\n autoComplete?: string;\n canClose?: boolean;\n autoFocusSearch?: boolean;\n onChange: (value: string) => void;\n onReset?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n onBlur?: NoneToVoidFunction;\n onSpinnerClick?: NoneToVoidFunction;\n};\n\nconst SearchInput: FC = ({\n ref,\n children,\n parentContainerClassName,\n value,\n inputId,\n className,\n focused,\n isLoading,\n spinnerColor,\n spinnerBackgroundColor,\n placeholder,\n disabled,\n autoComplete,\n canClose,\n autoFocusSearch,\n onChange,\n onReset,\n onFocus,\n onBlur,\n onSpinnerClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let inputRef = useRef(null);\n if (ref) {\n inputRef = ref;\n }\n\n const [isInputFocused, markInputFocused, unmarkInputFocused] = useFlag(focused);\n\n useInputFocusOnOpen(inputRef, autoFocusSearch, unmarkInputFocused);\n\n useEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (focused) {\n inputRef.current.focus();\n } else {\n inputRef.current.blur();\n }\n }, [focused, placeholder]); // Trick for setting focus when selecting a contact to search for\n\n const lang = useLang();\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n onChange(currentTarget.value);\n }\n\n function handleFocus() {\n markInputFocused();\n if (onFocus) {\n onFocus();\n }\n }\n\n function handleBlur() {\n unmarkInputFocused();\n if (onBlur) {\n onBlur();\n }\n }\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown' || e.key === 'Enter') {\n const element = document.querySelector(`.${parentContainerClassName} .ListItem-button`) as HTMLElement;\n if (element) {\n element.focus();\n }\n }\n }, [parentContainerClassName]);\n\n return (\n \n {children}\n \n \n \n \n \n {!isLoading && (value || canClose) && onReset && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SearchInput);\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\n\n\ntype OwnProps = {\n isOpen: boolean;\n isCustom?: boolean;\n id?: string;\n className?: string;\n onClick?: (e: React.MouseEvent) => void;\n children: React.ReactNode;\n};\n\nconst ShowTransition: FC = ({\n isOpen, isCustom, id, className, onClick, children,\n}) => {\n const { shouldRender, transitionClassNames } = useShowTransition(\n isOpen, undefined, undefined, isCustom ? false : undefined,\n );\n const prevIsOpen = usePrevious(isOpen);\n const prevChildren = usePrevious(children);\n const fromChildrenRef = useRef();\n\n if (prevIsOpen && !isOpen) {\n fromChildrenRef.current = prevChildren;\n }\n\n return (\n shouldRender && (\n
\n {isOpen ? children : fromChildrenRef.current!}\n
\n )\n );\n};\n\nexport default ShowTransition;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Switcher.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n checked?: boolean;\n disabled?: boolean;\n inactive?: boolean;\n noAnimation?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Switcher: FC = ({\n id,\n name,\n value,\n label,\n checked = false,\n disabled,\n inactive,\n noAnimation,\n onChange,\n onCheck,\n}) => {\n const handleChange = useCallback((e: ChangeEvent) => {\n if (onChange) {\n onChange(e);\n }\n\n if (onCheck) {\n onCheck(e.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Switcher',\n disabled && 'disabled',\n inactive && 'inactive',\n noAnimation && 'no-animation',\n );\n\n return (\n \n );\n};\n\nexport default memo(Switcher);\n","import React, {\n FC, useRef, memo, useEffect,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport forceReflow from '../../util/forceReflow';\nimport renderText from '../common/helpers/renderText';\n\nimport './Tab.scss';\n\ntype OwnProps = {\n className?: string;\n title: string;\n isActive?: boolean;\n badgeCount?: number;\n isBadgeActive?: boolean;\n previousActiveTab?: number;\n onClick: (arg: number) => void;\n clickArg: number;\n};\n\nconst classNames = {\n active: 'Tab--active',\n badgeActive: 'Tab__badge--active',\n};\n\nconst Tab: FC = ({\n className,\n title,\n isActive,\n badgeCount,\n isBadgeActive,\n previousActiveTab,\n onClick,\n clickArg,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const tabRef = useRef(null);\n\n useEffect(() => {\n // Set initial active state\n if (isActive && previousActiveTab === undefined && tabRef.current) {\n tabRef.current.classList.add(classNames.active);\n }\n\n if (!isActive || previousActiveTab === undefined) {\n return;\n }\n\n const tabEl = tabRef.current!;\n const prevTabEl = tabEl.parentElement!.children[previousActiveTab];\n if (!prevTabEl) {\n return;\n }\n\n const platformEl = tabEl.querySelector('i')!;\n const prevPlatformEl = prevTabEl.querySelector('i')!;\n\n // We move and resize the platform, so it repeats the position and size of the previous one\n const shiftLeft = prevPlatformEl.parentElement!.offsetLeft - platformEl.parentElement!.offsetLeft;\n const scaleFactor = prevPlatformEl.clientWidth / platformEl.clientWidth;\n\n prevPlatformEl.classList.remove('animate');\n platformEl.classList.remove('animate');\n platformEl.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n forceReflow(platformEl);\n platformEl.classList.add('animate');\n platformEl.style.transform = 'none';\n\n prevTabEl.classList.remove(classNames.active);\n tabEl.classList.add(classNames.active);\n }, [isActive, previousActiveTab]);\n\n return (\n onClick(clickArg)}\n ref={tabRef}\n >\n \n {renderText(title)}\n {Boolean(badgeCount) && (\n {badgeCount}\n )}\n \n \n
\n );\n};\n\nexport default memo(Tab);\n","import React, {\n FC, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { IS_ANDROID, IS_IOS } from '../../util/environment';\nimport fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHorizontalScroll from '../../hooks/useHorizontalScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Tab from './Tab';\n\nimport './TabList.scss';\n\nexport type TabWithProperties = {\n title: string;\n badgeCount?: number;\n isBadgeActive?: boolean;\n};\n\ntype OwnProps = {\n tabs: readonly TabWithProperties[];\n activeTab: number;\n big?: boolean;\n onSwitchTab: (index: number) => void;\n};\n\nconst TAB_SCROLL_THRESHOLD_PX = 16;\n// Should match duration from `--slide-transition` CSS variable\nconst SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300;\n\nconst TabList: FC = ({\n tabs, activeTab, big, onSwitchTab,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const previousActiveTab = usePrevious(activeTab);\n\n useHorizontalScroll(containerRef.current);\n\n // Scroll container to place active tab in the center\n useEffect(() => {\n const container = containerRef.current!;\n const { scrollWidth, offsetWidth, scrollLeft } = container;\n if (scrollWidth <= offsetWidth) {\n return;\n }\n\n const activeTabElement = container.childNodes[activeTab] as HTMLElement | null;\n if (!activeTabElement) {\n return;\n }\n\n const { offsetLeft: activeTabOffsetLeft, offsetWidth: activeTabOffsetWidth } = activeTabElement;\n const newLeft = activeTabOffsetLeft - (offsetWidth / 2) + (activeTabOffsetWidth / 2);\n\n // Prevent scrolling by only a couple of pixels, which doesn't look smooth\n if (Math.abs(newLeft - scrollLeft) < TAB_SCROLL_THRESHOLD_PX) {\n return;\n }\n\n fastSmoothScrollHorizontal(container, newLeft, SCROLL_DURATION);\n }, [activeTab]);\n\n const lang = useLang();\n\n return (\n \n {tabs.map((tab, i) => (\n \n ))}\n
\n );\n};\n\nexport default memo(TabList);\n","import { RefObject } from 'react';\nimport React, {\n FC, useLayoutEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\nimport { GlobalState } from '../../global/types';\n\nimport { ANIMATION_LEVEL_MIN } from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport forceReflow from '../../util/forceReflow';\nimport { waitForAnimationEnd, waitForTransitionEnd } from '../../util/cssAnimationEndListeners';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport usePrevious from '../../hooks/usePrevious';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\n\nimport './Transition.scss';\n\nexport type ChildrenFn = (isActive: boolean, isFrom: boolean, currentKey: number) => React.ReactNode;\nexport type TransitionProps = {\n ref?: RefObject;\n activeKey: number;\n name: (\n 'none' | 'slide' | 'slide-rtl' | 'mv-slide' | 'slide-fade' | 'zoom-fade' | 'slide-layers'\n | 'fade' | 'push-slide' | 'reveal' | 'slide-optimized' | 'slide-optimized-rtl'\n );\n direction?: 'auto' | 'inverse' | 1 | -1;\n renderCount?: number;\n shouldRestoreHeight?: boolean;\n shouldCleanup?: boolean;\n cleanupExceptionKey?: number;\n isDisabled?: boolean;\n id?: string;\n className?: string;\n onStart?: NoneToVoidFunction;\n onStop?: NoneToVoidFunction;\n children: React.ReactNode | ChildrenFn;\n};\n\nconst classNames = {\n active: 'Transition__slide--active',\n};\n\nconst Transition: FC = ({\n ref,\n activeKey,\n name,\n direction = 'auto',\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n id,\n className,\n onStart,\n onStop,\n children,\n}) => {\n // No need for a container to update on change\n const { animationLevel } = getGlobal().settings.byKey;\n const currentKeyRef = useRef();\n\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const rendersRef = useRef>({});\n const prevActiveKey = usePrevious(activeKey);\n const forceUpdate = useForceUpdate();\n\n const activeKeyChanged = prevActiveKey !== undefined && activeKey !== prevActiveKey;\n\n if (!renderCount && activeKeyChanged) {\n rendersRef.current = { [prevActiveKey]: rendersRef.current[prevActiveKey] };\n }\n\n rendersRef.current[activeKey] = children;\n\n useLayoutEffect(() => {\n function cleanup() {\n if (!shouldCleanup) {\n return;\n }\n\n const preservedRender = cleanupExceptionKey !== undefined ? rendersRef.current[cleanupExceptionKey] : undefined;\n\n rendersRef.current = preservedRender ? { [cleanupExceptionKey!]: preservedRender } : {};\n\n forceUpdate();\n }\n\n const container = containerRef.current!;\n\n const childElements = container.children;\n if (childElements.length === 1 && !activeKeyChanged) {\n if (name.startsWith('slide-optimized')) {\n (childElements[0] as HTMLElement).style.transition = 'none';\n (childElements[0] as HTMLElement).style.transform = 'translate3d(0, 0, 0)';\n }\n\n childElements[0].classList.add(classNames.active);\n\n return;\n }\n\n const childNodes = Array.from(container.childNodes);\n\n if (!activeKeyChanged || !childNodes.length) {\n return;\n }\n\n currentKeyRef.current = activeKey;\n\n const isBackwards = (\n direction === -1\n || (direction === 'auto' && prevActiveKey > activeKey)\n || (direction === 'inverse' && prevActiveKey < activeKey)\n );\n\n const keys = Object.keys(rendersRef.current).map(Number);\n const prevActiveIndex = renderCount ? prevActiveKey : keys.indexOf(prevActiveKey);\n const activeIndex = renderCount ? activeKey : keys.indexOf(activeKey);\n\n if (name === 'slide-optimized' || name === 'slide-optimized-rtl') {\n performSlideOptimized(\n animationLevel,\n name,\n isBackwards,\n cleanup,\n activeKey,\n currentKeyRef,\n container,\n shouldRestoreHeight,\n onStart,\n onStop,\n childNodes[activeIndex] as HTMLElement,\n childNodes[prevActiveIndex] as HTMLElement,\n );\n\n return;\n }\n\n container.classList.remove('animating');\n container.classList.toggle('backwards', isBackwards);\n\n if (name === 'none' || animationLevel === ANIMATION_LEVEL_MIN) {\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle(classNames.active, i === activeIndex);\n }\n });\n\n cleanup();\n\n return;\n }\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove(classNames.active);\n node.classList.toggle('from', i === prevActiveIndex);\n node.classList.toggle('through', (\n (i > prevActiveIndex && i < activeIndex) || (i < prevActiveIndex && i > activeIndex)\n ));\n node.classList.toggle('to', i === activeIndex);\n }\n });\n\n const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n requestAnimationFrame(() => {\n container.classList.add('animating');\n\n onStart?.();\n\n function onAnimationEnd() {\n requestAnimationFrame(() => {\n if (activeKey !== currentKeyRef.current) {\n return;\n }\n\n container.classList.remove('animating', 'backwards');\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle(classNames.active, i === activeIndex);\n }\n });\n\n if (shouldRestoreHeight) {\n const activeElement = container.querySelector(`.${classNames.active}`);\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n }\n }\n\n onStop?.();\n dispatchHeavyAnimationStop();\n cleanup();\n });\n }\n\n const watchedNode = name === 'mv-slide'\n ? childNodes[activeIndex]?.firstChild\n : name === 'reveal' && isBackwards\n ? childNodes[prevActiveIndex]\n : childNodes[activeIndex];\n\n if (watchedNode) {\n waitForAnimationEnd(watchedNode, onAnimationEnd);\n } else {\n onAnimationEnd();\n }\n });\n }, [\n activeKey,\n prevActiveKey,\n activeKeyChanged,\n direction,\n name,\n onStart,\n onStop,\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n animationLevel,\n forceUpdate,\n ]);\n\n useLayoutEffect(() => {\n if (shouldRestoreHeight) {\n const container = containerRef.current!;\n const activeElement = container.querySelector(`.${classNames.active}`)\n || container.querySelector('.from');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n container.style.flexBasis = `${activeElement.clientHeight}px`;\n }\n }\n }, [shouldRestoreHeight, children]);\n\n const renders = rendersRef.current;\n const collection = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);\n\n const contents = collection.map((key) => {\n const render = renders[key];\n if (!render) {\n return undefined;\n }\n\n return (\n
{\n typeof render === 'function'\n ? render(key === activeKey, key === prevActiveKey, activeKey)\n : render\n }
\n );\n });\n\n return (\n \n {contents}\n
\n );\n};\n\nexport default Transition;\n\nfunction performSlideOptimized(\n animationLevel: GlobalState['settings']['byKey']['animationLevel'],\n name: 'slide-optimized' | 'slide-optimized-rtl',\n isBackwards: boolean,\n cleanup: NoneToVoidFunction,\n activeKey: number,\n currentKeyRef: { current: number | undefined },\n container: HTMLElement,\n shouldRestoreHeight?: boolean,\n onStart?: NoneToVoidFunction,\n onStop?: NoneToVoidFunction,\n toSlide?: HTMLElement,\n fromSlide?: HTMLElement,\n) {\n if (!fromSlide || !toSlide) {\n return;\n }\n\n if (animationLevel === ANIMATION_LEVEL_MIN) {\n fromSlide.style.transition = 'none';\n fromSlide.style.transform = '';\n fromSlide.classList.remove(classNames.active);\n\n toSlide.style.transition = 'none';\n toSlide.style.transform = 'translate3d(0, 0, 0)';\n toSlide.classList.add(classNames.active);\n\n cleanup();\n\n return;\n }\n\n if (name === 'slide-optimized-rtl') {\n isBackwards = !isBackwards;\n }\n\n const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n requestAnimationFrame(() => {\n onStart?.();\n\n fromSlide.style.transition = 'none';\n fromSlide.style.transform = 'translate3d(0, 0, 0)';\n\n toSlide.style.transition = 'none';\n toSlide.style.transform = `translate3d(${isBackwards ? '-' : ''}100%, 0, 0)`;\n\n forceReflow(toSlide);\n\n fromSlide.style.transition = '';\n fromSlide.style.transform = `translate3d(${isBackwards ? '' : '-'}100%, 0, 0)`;\n\n toSlide.style.transition = '';\n toSlide.style.transform = 'translate3d(0, 0, 0)';\n\n fromSlide.classList.remove(classNames.active);\n toSlide.classList.add(classNames.active);\n\n waitForTransitionEnd(fromSlide, () => {\n if (activeKey !== currentKeyRef.current) {\n return;\n }\n\n fromSlide.style.transition = 'none';\n fromSlide.style.transform = '';\n\n if (shouldRestoreHeight) {\n toSlide.style.height = 'auto';\n container.style.height = `${toSlide.clientHeight}px`;\n }\n\n onStop?.();\n dispatchHeavyAnimationStop();\n cleanup();\n });\n });\n}\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { ApiChatFolder } from '../../api/types';\nimport { pick, omit } from '../../util/iteratees';\n\nexport type FolderChatType = {\n icon: string;\n title: string;\n key: keyof Pick;\n};\n\nexport const INCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'user', title: 'FilterContacts', key: 'contacts' },\n { icon: 'non-contacts', title: 'FilterNonContacts', key: 'nonContacts' },\n { icon: 'group', title: 'FilterGroups', key: 'groups' },\n { icon: 'channel', title: 'FilterChannels', key: 'channels' },\n { icon: 'bots', title: 'FilterBots', key: 'bots' },\n];\n\nexport const EXCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'mute', title: 'FilterMuted', key: 'excludeMuted' },\n { icon: 'archive', title: 'FilterArchived', key: 'excludeArchived' },\n { icon: 'readchats', title: 'FilterRead', key: 'excludeRead' },\n];\n\nconst INCLUDE_FILTER_FIELDS: Array = [\n 'includedChatIds', 'bots', 'channels', 'groups', 'contacts', 'nonContacts',\n];\nconst EXCLUDE_FILTER_FIELDS: Array = [\n 'excludedChatIds', 'excludeArchived', 'excludeMuted', 'excludeRead',\n];\n\nexport function selectChatFilters(state: FoldersState, mode: 'included' | 'excluded', selectTemp?: boolean) {\n let selectedChatIds: string[] = [];\n let selectedChatTypes: FolderChatType['key'][] = [];\n\n if (mode === 'included') {\n const {\n includedChatIds,\n ...includeFilters\n } = selectTemp\n ? state.includeFilters || {}\n : pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = includedChatIds || [];\n selectedChatTypes = (Object.keys(includeFilters) as Array)\n .filter((key) => Boolean(includeFilters[key]));\n } else {\n const {\n excludedChatIds,\n ...excludeFilters\n } = selectTemp\n ? state.excludeFilters || {}\n : pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = excludedChatIds || [];\n selectedChatTypes = (Object.keys(excludeFilters) as Array)\n .filter((key) => Boolean(excludeFilters[key]));\n }\n\n return {\n selectedChatIds,\n selectedChatTypes,\n };\n}\n\nfunction getSuggestedFolderName(includeFilters?: FolderIncludeFilters) {\n if (includeFilters) {\n const {\n includedChatIds,\n ...filters\n } = includeFilters;\n\n if (\n Object.values(filters).filter(Boolean).length > 1\n || (includedChatIds?.length)\n ) {\n return '';\n }\n\n if (filters.bots) {\n return 'Bots';\n } else if (filters.groups) {\n return 'Groups';\n } else if (filters.channels) {\n return 'Channels';\n } else if (filters.contacts) {\n return 'Contacts';\n } else if (filters.nonContacts) {\n return 'Non-Contacts';\n }\n }\n\n return '';\n}\n\ntype FolderIncludeFilters = Pick;\ntype FolderExcludeFilters = Pick;\n\nexport type FoldersState = {\n mode: 'create' | 'edit';\n isLoading?: boolean;\n isTouched?: boolean;\n error?: string;\n folderId?: number;\n chatFilter: string;\n folder: Omit;\n includeFilters?: FolderIncludeFilters;\n excludeFilters?: FolderExcludeFilters;\n};\nexport type FoldersActions = (\n 'setTitle' | 'saveFilters' | 'editFolder' | 'reset' | 'setChatFilter' | 'setIsLoading' | 'setError' |\n 'editIncludeFilters' | 'editExcludeFilters' | 'setIncludeFilters' | 'setExcludeFilters'\n);\nexport type FolderEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FoldersState = {\n mode: 'create',\n chatFilter: '',\n folder: {\n title: '',\n includedChatIds: [],\n excludedChatIds: [],\n },\n};\n\nconst foldersReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setTitle':\n return {\n ...state,\n folder: {\n ...state.folder,\n title: action.payload,\n },\n isTouched: true,\n };\n case 'editIncludeFilters':\n return {\n ...state,\n includeFilters: pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n ),\n };\n case 'editExcludeFilters':\n return {\n ...state,\n excludeFilters: pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n ),\n };\n case 'setIncludeFilters':\n return {\n ...state,\n includeFilters: action.payload,\n chatFilter: '',\n };\n case 'setExcludeFilters':\n return {\n ...state,\n excludeFilters: action.payload,\n chatFilter: '',\n };\n case 'saveFilters':\n if (state.includeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, INCLUDE_FILTER_FIELDS),\n title: state.folder.title ? state.folder.title : getSuggestedFolderName(state.includeFilters),\n ...state.includeFilters,\n },\n includeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else if (state.excludeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, EXCLUDE_FILTER_FIELDS),\n ...state.excludeFilters,\n },\n excludeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else {\n return state;\n }\n case 'editFolder': {\n const { id: folderId, description, ...folder } = action.payload;\n\n return {\n mode: 'edit',\n folderId,\n folder,\n chatFilter: '',\n };\n }\n case 'setChatFilter': {\n return {\n ...state,\n chatFilter: action.payload,\n };\n }\n case 'setIsLoading': {\n return {\n ...state,\n isLoading: action.payload,\n };\n }\n case 'setError': {\n return {\n ...state,\n error: action.payload,\n };\n }\n case 'reset':\n return INITIAL_STATE;\n default:\n return state;\n }\n};\n\nconst useFoldersReducer = () => {\n return useReducer(foldersReducer, INITIAL_STATE);\n};\n\nexport default useFoldersReducer;\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../lib/teact/teact';\nimport { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { register, Track, TrackId } from '../util/audioPlayer';\nimport useEffectWithPrevDeps from './useEffectWithPrevDeps';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\nimport useOnChange from './useOnChange';\nimport {\n MediaSessionHandlers, registerMediaSession, setPlaybackState, setPositionState, updateMetadata,\n} from '../util/mediaSession';\n\ntype Handler = (e: Event) => void;\n\nconst DEFAULT_SKIP_TIME = 10;\n\nconst useAudioPlayer = (\n trackId: TrackId,\n originalDuration: number, // Sometimes incorrect for voice messages\n trackType: Track['type'],\n src?: string,\n handlers?: Record,\n metadata?: MediaMetadata,\n onInit?: (element: HTMLAudioElement) => void,\n shouldPlay = false,\n onForcePlay?: NoneToVoidFunction,\n onTrackChange?: NoneToVoidFunction,\n noPlaylist = false,\n noProgressUpdates = false,\n) => {\n // eslint-disable-next-line no-null/no-null\n const controllerRef = useRef>(null);\n\n const [isPlaying, setIsPlaying] = useState(false);\n let isPlayingSync = isPlaying;\n\n const [playProgress, setPlayProgress] = useState(0);\n\n const handleTrackChange = useCallback(() => {\n setIsPlaying(false);\n if (onTrackChange) onTrackChange();\n }, [onTrackChange]);\n\n useOnChange(() => {\n controllerRef.current = register(trackId, trackType, (eventName, e) => {\n switch (eventName) {\n case 'onPlay': {\n const {\n setVolume, setPlaybackRate, toggleMuted, proxy,\n } = controllerRef.current!;\n setIsPlaying(true);\n\n registerMediaSession(metadata, makeMediaHandlers(controllerRef));\n setPlaybackState('playing');\n setVolume(getGlobal().audioPlayer.volume);\n toggleMuted(Boolean(getGlobal().audioPlayer.isMuted));\n if (trackType === 'voice') {\n setPlaybackRate(getGlobal().audioPlayer.playbackRate);\n }\n\n setPositionState({\n duration: proxy.duration || 0,\n playbackRate: proxy.playbackRate,\n position: proxy.currentTime,\n });\n break;\n }\n case 'onRateChange': {\n const { proxy } = controllerRef.current!;\n setPositionState({\n duration: proxy.duration || 0,\n playbackRate: proxy.playbackRate,\n position: proxy.currentTime,\n });\n break;\n }\n case 'onPause':\n setIsPlaying(false);\n setPlaybackState('paused');\n break;\n case 'onTimeUpdate': {\n const { proxy } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n if (!noProgressUpdates) setPlayProgress(proxy.currentTime / duration);\n break;\n }\n case 'onEnded': {\n setPlaybackState('paused');\n break;\n }\n }\n\n handlers?.[eventName]?.(e);\n }, onForcePlay, handleTrackChange);\n\n const { proxy } = controllerRef.current!;\n\n if (!isPlaying && !proxy.paused) {\n setIsPlaying(true);\n isPlayingSync = true;\n }\n\n if (onInit) {\n onInit(proxy);\n }\n }, [trackId]);\n\n useEffect(() => {\n if (isPlaying && metadata) updateMetadata(metadata);\n }, [metadata, isPlaying]);\n\n const {\n play,\n pause,\n setCurrentTime,\n proxy,\n destroy,\n setVolume,\n stop,\n isFirst,\n isLast,\n requestNextTrack,\n requestPreviousTrack,\n setPlaybackRate,\n toggleMuted,\n } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n\n // RAF progress\n useEffect(() => {\n if (duration && !isSafariPatchInProgress(proxy) && !noProgressUpdates) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, playProgress, proxy, noProgressUpdates]);\n\n // Cleanup\n useEffect(() => () => {\n destroy(noPlaylist);\n }, [destroy, noPlaylist]);\n\n // Autoplay once `src` is present\n useEffectWithPrevDeps(([prevShouldPlay, prevSrc]) => {\n if (prevShouldPlay === shouldPlay && src === prevSrc) {\n return;\n }\n\n // When paused by another player\n if (proxy.src && proxy.paused) {\n return;\n }\n\n if (shouldPlay && src && !isPlaying) {\n play(src);\n }\n }, [shouldPlay, src, isPlaying, play, proxy.src, proxy.paused]);\n\n const playIfPresent = useCallback(() => {\n if (src) {\n play(src);\n }\n }, [src, play]);\n\n const playPause = useCallback(() => {\n if (isPlaying) {\n pause();\n } else {\n playIfPresent();\n }\n }, [pause, playIfPresent, isPlaying]);\n\n const setTime = useCallback((time: number) => {\n setCurrentTime(time);\n if (duration) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, proxy, setCurrentTime]);\n\n return {\n isPlaying: isPlayingSync,\n playProgress,\n playPause,\n pause,\n play: playIfPresent,\n stop,\n setCurrentTime: setTime,\n setVolume,\n audioProxy: proxy,\n duration,\n requestNextTrack,\n requestPreviousTrack,\n isFirst,\n isLast,\n setPlaybackRate,\n toggleMuted,\n };\n};\n\nfunction makeMediaHandlers(controllerRef: React.RefObject>) {\n let mediaHandlers: MediaSessionHandlers = {};\n if (controllerRef && controllerRef.current) {\n const {\n play, pause, setCurrentTime, proxy, requestNextTrack, requestPreviousTrack, isFirst, isLast,\n } = controllerRef.current;\n mediaHandlers = {\n play: () => {\n play(proxy.src);\n },\n pause: () => {\n pause();\n },\n stop: () => {\n pause();\n setCurrentTime(0);\n getDispatch().closeAudioPlayer();\n },\n seekbackward: (event) => {\n const skipTime = event.seekOffset || DEFAULT_SKIP_TIME;\n setCurrentTime(Math.max(proxy.currentTime - skipTime, 0));\n },\n seekforward: (event) => {\n const skipTime = event.seekOffset || DEFAULT_SKIP_TIME;\n setCurrentTime(Math.min(proxy.currentTime + skipTime, proxy.duration));\n },\n seekTo: (event) => {\n if (event.seekTime) {\n setCurrentTime(event.seekTime);\n }\n },\n };\n\n if (!isLast()) {\n mediaHandlers.nexttrack = () => {\n requestNextTrack();\n };\n }\n if (!isFirst()) {\n mediaHandlers.previoustrack = () => {\n requestPreviousTrack();\n };\n }\n }\n return mediaHandlers;\n}\n\nexport default useAudioPlayer;\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport { imgToCanvas } from '../util/files';\nimport useForceUpdate from './useForceUpdate';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\nconst MAX_CACHE_SIZE = 1000;\n\nconst cache = new Map();\n\nexport default function useBlur(dataUri?: string, isDisabled = false, delay?: number) {\n const blurredRef = useRef(dataUri ? cache.get(dataUri) : undefined);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n if (timeoutRef.current && isDisabled) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useEffect(() => {\n if (!dataUri || blurredRef.current || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n img.onload = () => {\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n const blurredDataUri = canvas.toDataURL();\n\n blurredRef.current = blurredDataUri;\n forceUpdate();\n\n if (cache.size >= MAX_CACHE_SIZE) {\n cache.clear();\n }\n cache.set(dataUri, blurredDataUri);\n };\n\n if (delay) {\n timeoutRef.current = window.setTimeout(() => {\n img.src = dataUri;\n }, delay);\n } else {\n img.src = dataUri;\n }\n }, [dataUri, delay, forceUpdate, isDisabled]);\n\n return blurredRef.current;\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useOnChange from './useOnChange';\nimport useBlur from './useBlur';\nimport { imgToCanvas } from '../util/files';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useBlurSync(dataUri: string | false | undefined) {\n const blurredRef = useRef();\n\n let isChanged = false;\n\n useOnChange(() => {\n isChanged = true;\n\n blurredRef.current = undefined;\n\n if (!dataUri) {\n return;\n }\n\n const img = new Image();\n img.src = dataUri;\n if (!img.width) {\n return;\n }\n\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n\n blurredRef.current = canvas.toDataURL();\n }, [dataUri]);\n\n // Sometimes `Image` do not manage to load synchronously,\n // so we fall back the non-blurred variant and prepare the async one at least for the next time\n const blurredAsync = useBlur(dataUri || undefined, Boolean(blurredRef.current));\n\n return blurredRef.current || (!isChanged && blurredAsync) || dataUri || undefined;\n}\n","import React, { useCallback, useMemo, useState } from '../lib/teact/teact';\nimport { debounce } from '../util/schedulers';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\n\ntype BufferingEvent = (e: Event | React.SyntheticEvent) => void;\n\nconst MIN_READY_STATE = 3;\n// Avoid flickering when re-mounting previously buffered video\nconst DEBOUNCE = 200;\n\nconst useBuffering = (noInitiallyBuffered = false) => {\n const [isBuffered, setIsBuffered] = useState(!noInitiallyBuffered);\n const [bufferedProgress, setBufferedProgress] = useState(0);\n\n const setIsBufferedDebounced = useMemo(() => {\n return debounce(setIsBuffered, DEBOUNCE, false, true);\n }, []);\n\n const handleBuffering = useCallback((e) => {\n const media = e.currentTarget as HTMLMediaElement;\n\n if (!isSafariPatchInProgress(media)) {\n if (media.buffered.length) {\n setBufferedProgress(media.buffered.end(0) / media.duration);\n }\n\n setIsBufferedDebounced(media.readyState >= MIN_READY_STATE || media.currentTime > 0);\n }\n }, [setIsBufferedDebounced]);\n\n const bufferingHandlers = {\n onLoadedData: handleBuffering,\n onPlaying: handleBuffering,\n onLoadStart: handleBuffering, // Needed for Safari to start\n onPause: handleBuffering, // Needed for Chrome when seeking\n onTimeUpdate: handleBuffering, // Needed for audio buffering progress\n onProgress: handleBuffering, // Needed for video buffering progress\n };\n\n return {\n isBuffered,\n bufferedProgress,\n bufferingHandlers,\n checkBuffering(element: HTMLMediaElement) {\n setIsBufferedDebounced(element.readyState >= MIN_READY_STATE);\n },\n };\n};\n\nexport default useBuffering;\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useForceUpdate from './useForceUpdate';\nimport { IS_CANVAS_FILTER_SUPPORTED } from '../util/environment';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useCanvasBlur(dataUri?: string, isDisabled = false, withRaf?: boolean) {\n // eslint-disable-next-line no-null/no-null\n const canvasRef = useRef(null);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n const canvas = canvasRef.current;\n\n if (!dataUri || !canvas || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n const processBlur = () => {\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d', { alpha: false })!;\n\n if (IS_CANVAS_FILTER_SUPPORTED) {\n ctx.filter = `blur(${RADIUS}px)`;\n }\n\n ctx.drawImage(img, -RADIUS * 2, -RADIUS * 2, canvas.width + RADIUS * 4, canvas.height + RADIUS * 4);\n\n if (!IS_CANVAS_FILTER_SUPPORTED) {\n fastBlur(ctx, 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n }\n };\n\n img.onload = () => {\n if (withRaf) {\n requestAnimationFrame(processBlur);\n } else {\n processBlur();\n }\n };\n\n img.src = dataUri;\n }, [canvasRef, dataUri, forceUpdate, isDisabled, withRaf]);\n\n return canvasRef;\n}\n","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../api/types';\n\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../config';\nimport {\n isChatArchived, getCanDeleteChat, isUserId, isChatChannel,\n} from '../modules/helpers';\nimport { compact } from '../util/iteratees';\nimport useLang from './useLang';\n\nconst useChatContextActions = ({\n chat,\n user,\n folderId,\n isPinned,\n isMuted,\n canChangeFolder,\n handleDelete,\n handleChatFolderChange,\n}: {\n chat: ApiChat | undefined;\n user: ApiUser | undefined;\n folderId?: number;\n isPinned?: boolean;\n isMuted?: boolean;\n canChangeFolder?: boolean;\n handleDelete: () => void;\n handleChatFolderChange: () => void;\n}, isInSearch = false) => {\n const lang = useLang();\n\n const { isSelf } = user || {};\n const isServiceNotifications = user?.id === SERVICE_NOTIFICATIONS_USER_ID;\n\n return useMemo(() => {\n if (!chat) {\n return undefined;\n }\n\n const {\n toggleChatPinned,\n updateChatMutedState,\n toggleChatArchived,\n toggleChatUnread,\n } = getDispatch();\n\n const actionAddToFolder = canChangeFolder ? {\n title: lang('ChatList.Filter.AddToFolder'),\n icon: 'folder',\n handler: handleChatFolderChange,\n } : undefined;\n\n const actionPin = isPinned\n ? {\n title: lang('UnpinFromTop'),\n icon: 'unpin',\n handler: () => toggleChatPinned({ id: chat.id, folderId }),\n }\n : { title: lang('PinToTop'), icon: 'pin', handler: () => toggleChatPinned({ id: chat.id, folderId }) };\n\n if (isInSearch) {\n return compact([actionPin, actionAddToFolder]);\n }\n\n const actionUnreadMark = chat.unreadCount || chat.hasUnreadMark\n ? { title: lang('MarkAsRead'), icon: 'readchats', handler: () => toggleChatUnread({ id: chat.id }) }\n : { title: lang('MarkAsUnread'), icon: 'unread', handler: () => toggleChatUnread({ id: chat.id }) };\n\n const actionMute = isMuted\n ? {\n title: lang('ChatList.Unmute'),\n icon: 'unmute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: false }),\n }\n : {\n title: lang('ChatList.Mute'),\n icon: 'mute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: true }),\n };\n\n const actionArchive = isChatArchived(chat)\n ? { title: lang('Unarchive'), icon: 'unarchive', handler: () => toggleChatArchived({ id: chat.id }) }\n : { title: lang('Archive'), icon: 'archive', handler: () => toggleChatArchived({ id: chat.id }) };\n\n const actionDelete = {\n title: isUserId(chat.id)\n ? lang('Delete')\n : lang(getCanDeleteChat(chat)\n ? 'DeleteChat'\n : (isChatChannel(chat) ? 'LeaveChannel' : 'Group.LeaveGroup')),\n icon: 'delete',\n destructive: true,\n handler: handleDelete,\n };\n\n const isInFolder = folderId !== undefined;\n\n return compact([\n actionAddToFolder,\n actionUnreadMark,\n actionPin,\n !isSelf && actionMute,\n !isSelf && !isServiceNotifications && !isInFolder && actionArchive,\n actionDelete,\n ]);\n }, [\n chat, canChangeFolder, lang, handleChatFolderChange, isPinned, isInSearch, isMuted, handleDelete, folderId, isSelf,\n isServiceNotifications,\n ]);\n};\n\nexport default useChatContextActions;\n","import { RefObject } from 'react';\nimport { useState, useEffect, useCallback } from '../lib/teact/teact';\n\nimport { IAnchorPosition } from '../types';\nimport {\n IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT, IS_PWA, IS_IOS,\n} from '../util/environment';\n\nconst LONG_TAP_DURATION_MS = 200;\n\nfunction checkIsDisabledForMobile() {\n return IS_SINGLE_COLUMN_LAYOUT\n && window.document.body.classList.contains('enable-symbol-menu-transforms');\n}\n\nfunction stopEvent(e: Event) {\n e.stopImmediatePropagation();\n e.preventDefault();\n e.stopPropagation();\n}\n\nconst useContextMenuHandlers = (\n elementRef: RefObject,\n isMenuDisabled?: boolean,\n shouldDisableOnLink?: boolean,\n shouldDisableOnLongTap?: boolean,\n) => {\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState(undefined);\n\n const handleBeforeContextMenu = useCallback((e: React.MouseEvent) => {\n if (!isMenuDisabled && e.button === 2) {\n (e.target as HTMLElement).classList.add('no-selection');\n }\n }, [isMenuDisabled]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n (e.target as HTMLElement).classList.remove('no-selection');\n\n if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a[href]'))) {\n return;\n }\n e.preventDefault();\n\n if (contextMenuPosition) {\n return;\n }\n\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: e.clientX, y: e.clientY });\n }, [isMenuDisabled, shouldDisableOnLink, contextMenuPosition]);\n\n const handleContextMenuClose = useCallback(() => {\n setIsContextMenuOpen(false);\n }, []);\n\n const handleContextMenuHide = useCallback(() => {\n setContextMenuPosition(undefined);\n document.body.classList.remove('no-selection');\n }, []);\n\n // Support context menu on touch-devices\n useEffect(() => {\n if (isMenuDisabled || !IS_TOUCH_ENV || shouldDisableOnLongTap) {\n return undefined;\n }\n\n const element = elementRef.current;\n if (!element) {\n return undefined;\n }\n\n let timer: number | undefined;\n\n const clearLongPressTimer = () => {\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const emulateContextMenuEvent = (originalEvent: TouchEvent) => {\n clearLongPressTimer();\n\n const { clientX, clientY, target } = originalEvent.touches[0];\n\n if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a[href]'))) {\n return;\n }\n\n // Temporarily intercept and clear the next click\n element.addEventListener('touchend', function cancelClickOnce(e) {\n element.removeEventListener('touchend', cancelClickOnce, true);\n stopEvent(e);\n }, true);\n\n // On iOS15, in PWA mode, the context menu immediately closes after opening\n if (IS_PWA && IS_IOS) {\n element.addEventListener('mousedown', function cancelClickOnce(e) {\n element.removeEventListener('mousedown', cancelClickOnce, true);\n stopEvent(e);\n }, true);\n }\n\n document.body.classList.add('no-selection');\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: clientX, y: clientY });\n };\n\n const startLongPressTimer = (e: TouchEvent) => {\n if (isMenuDisabled || checkIsDisabledForMobile()) {\n return;\n }\n clearLongPressTimer();\n\n timer = window.setTimeout(() => emulateContextMenuEvent(e), LONG_TAP_DURATION_MS);\n };\n\n // @perf Consider event delegation\n element.addEventListener('touchstart', startLongPressTimer, { passive: true });\n element.addEventListener('touchcancel', clearLongPressTimer, true);\n element.addEventListener('touchend', clearLongPressTimer, true);\n element.addEventListener('touchmove', clearLongPressTimer, { passive: true });\n\n return () => {\n clearLongPressTimer();\n element.removeEventListener('touchstart', startLongPressTimer);\n element.removeEventListener('touchcancel', clearLongPressTimer, true);\n element.removeEventListener('touchend', clearLongPressTimer, true);\n element.removeEventListener('touchmove', clearLongPressTimer);\n };\n }, [contextMenuPosition, isMenuDisabled, shouldDisableOnLongTap, elementRef, shouldDisableOnLink]);\n\n return {\n isContextMenuOpen,\n contextMenuPosition,\n handleBeforeContextMenu,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n };\n};\n\nexport default useContextMenuHandlers;\n","import { useState, useEffect } from '../lib/teact/teact';\nimport { IAnchorPosition } from '../types';\n\ninterface Layout {\n extraPaddingX?: number;\n extraTopPadding?: number;\n marginSides?: number;\n extraMarginTop?: number;\n}\n\nconst MENU_POSITION_VISUAL_COMFORT_SPACE_PX = 16;\nconst MENU_POSITION_BOTTOM_MARGIN = 12;\nconst EMPTY_RECT = {\n width: 0, left: 0, height: 0, top: 0,\n};\n\nexport default function useContextMenuPosition(\n anchor: IAnchorPosition | undefined,\n getTriggerElement: () => HTMLElement | null,\n getRootElement: () => HTMLElement | null,\n getMenuElement: () => HTMLElement | null,\n getLayout?: () => Layout,\n) {\n const [positionX, setPositionX] = useState<'right' | 'left'>('right');\n const [positionY, setPositionY] = useState<'top' | 'bottom'>('bottom');\n const [transformOriginX, setTransformOriginX] = useState();\n const [transformOriginY, setTransformOriginY] = useState();\n const [withScroll, setWithScroll] = useState(false);\n const [style, setStyle] = useState('');\n const [menuStyle, setMenuStyle] = useState('opacity: 0;');\n\n useEffect(() => {\n const triggerEl = getTriggerElement();\n if (!anchor || !triggerEl) {\n return;\n }\n\n let { x, y } = anchor;\n const anchorX = x;\n const anchorY = y;\n\n const menuEl = getMenuElement();\n const rootEl = getRootElement();\n\n const {\n extraPaddingX = 0,\n extraTopPadding = 0,\n marginSides = 0,\n extraMarginTop = 0,\n } = getLayout?.() || {};\n\n const marginTop = menuEl ? parseInt(getComputedStyle(menuEl).marginTop, 10) + extraMarginTop : undefined;\n\n const menuRect = menuEl ? {\n width: menuEl.offsetWidth,\n height: menuEl.offsetHeight + marginTop!,\n } : EMPTY_RECT;\n\n const rootRect = rootEl ? rootEl.getBoundingClientRect() : EMPTY_RECT;\n\n let horizontalPosition: 'left' | 'right';\n let verticalPosition: 'top' | 'bottom';\n if (x + menuRect.width + extraPaddingX < rootRect.width + rootRect.left) {\n x += 3;\n horizontalPosition = 'left';\n } else if (x - menuRect.width > 0) {\n horizontalPosition = 'right';\n x -= 3;\n } else {\n horizontalPosition = 'left';\n x = 16;\n }\n setPositionX(horizontalPosition);\n\n if (marginSides\n && horizontalPosition === 'right' && (x + extraPaddingX + marginSides >= rootRect.width + rootRect.left)) {\n x -= marginSides;\n }\n\n if (marginSides && horizontalPosition === 'left') {\n if (x + extraPaddingX + marginSides + menuRect.width >= rootRect.width + rootRect.left) {\n x -= marginSides;\n } else if (x - marginSides <= 0) {\n x += marginSides;\n }\n }\n\n if (y + menuRect.height < rootRect.height + rootRect.top) {\n verticalPosition = 'top';\n } else {\n verticalPosition = 'bottom';\n\n if (y - menuRect.height < rootRect.top + extraTopPadding) {\n y = rootRect.top + rootRect.height;\n }\n }\n setPositionY(verticalPosition);\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const left = horizontalPosition === 'left'\n ? Math.min(x - triggerRect.left, rootRect.width - menuRect.width - MENU_POSITION_VISUAL_COMFORT_SPACE_PX)\n : Math.max((x - triggerRect.left), menuRect.width + MENU_POSITION_VISUAL_COMFORT_SPACE_PX);\n const top = Math.min(\n rootRect.height - triggerRect.top + triggerRect.height - MENU_POSITION_BOTTOM_MARGIN + (marginTop || 0),\n y - triggerRect.top,\n );\n const menuMaxHeight = rootRect.height - MENU_POSITION_BOTTOM_MARGIN - (marginTop || 0);\n\n setWithScroll(menuMaxHeight < menuRect.height);\n setMenuStyle(`max-height: ${menuMaxHeight}px;`);\n setStyle(`left: ${left}px; top: ${top}px`);\n const offsetX = (anchorX - triggerRect.left) - left;\n const offsetY = (anchorY - triggerRect.top) - top - (marginTop || 0);\n setTransformOriginX(horizontalPosition === 'left' ? offsetX : menuRect.width + offsetX);\n setTransformOriginY(verticalPosition === 'bottom' ? menuRect.height + offsetY : offsetY);\n }, [\n anchor, getMenuElement, getRootElement, getTriggerElement, getLayout,\n ]);\n\n return {\n positionX,\n positionY,\n transformOriginX,\n transformOriginY,\n style,\n menuStyle,\n withScroll,\n };\n}\n","import { useMemo } from '../lib/teact/teact';\n\nimport { debounce } from '../util/schedulers';\n\nexport default function useDebounce(ms: number, noFirst?: boolean, noLast?: boolean) {\n return useMemo(() => {\n return debounce((cb) => cb(), ms, !noFirst, !noLast);\n }, [ms, noFirst, noLast]);\n}\n","import { useEffect, useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiMessage } from '../api/types';\n\nimport { throttle } from '../util/schedulers';\n\nconst useEnsureMessage = (\n chatId: string,\n messageId?: number,\n message?: ApiMessage,\n replyOriginForId?: number,\n) => {\n const { loadMessage } = getDispatch();\n const loadMessageThrottled = useMemo(() => {\n const throttled = throttle(loadMessage, 500, true);\n return () => {\n throttled({ chatId, messageId, replyOriginForId });\n };\n }, [loadMessage, chatId, messageId, replyOriginForId]);\n\n useEffect(() => {\n if (messageId && !message) {\n loadMessageThrottled();\n }\n });\n};\n\nexport default useEnsureMessage;\n","import { useEffect, useState } from '../lib/teact/teact';\nimport {\n getOrderedIds,\n getUnreadCounters,\n getChatsCount,\n addOrderedIdsCallback,\n addUnreadCountersCallback,\n addChatsCountCallback,\n} from '../util/folderManager';\n\nexport function useFolderManagerForOrderedIds(folderId: number) {\n const [orderedIds, setOrderedIds] = useState(getOrderedIds(folderId));\n\n useEffect(() => addOrderedIdsCallback(folderId, setOrderedIds), [folderId]);\n\n return orderedIds;\n}\n\nexport function useFolderManagerForUnreadCounters() {\n const [unreadCounters, setUnreadCounters] = useState(getUnreadCounters());\n\n useEffect(() => addUnreadCountersCallback(setUnreadCounters), []);\n\n return unreadCounters;\n}\n\nexport function useFolderManagerForChatsCount() {\n const [chatsCount, setChatsCount] = useState(getChatsCount());\n\n useEffect(() => addChatsCountCallback(setChatsCount), []);\n\n return chatsCount;\n}\n","import { useEffect } from '../lib/teact/teact';\n\nconst useHorizontalScroll = (container: HTMLElement | null, isDisabled?: boolean) => {\n useEffect(() => {\n if (!container || isDisabled) {\n return undefined;\n }\n\n function handleScroll(e: WheelEvent) {\n // Ignore horizontal scroll and let it work natively (e.g. on touchpad)\n if (!e.deltaX) {\n container!.scrollLeft += e.deltaY / 4;\n }\n }\n\n container.addEventListener('wheel', handleScroll, { passive: true });\n\n return () => {\n container.removeEventListener('wheel', handleScroll);\n };\n }, [container, isDisabled]);\n};\n\nexport default useHorizontalScroll;\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\nconst MODAL_HIDE_DELAY_MS = 300;\n\nexport default function useInputFocusOnOpen(\n inputRef: RefObject,\n isOpen?: boolean,\n onClose?: NoneToVoidFunction,\n) {\n useEffect(() => {\n if (isOpen) {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n });\n }, FOCUS_DELAY_MS);\n }\n } else {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n\n if (onClose) {\n setTimeout(onClose, MODAL_HIDE_DELAY_MS);\n }\n }\n }, [inputRef, isOpen, onClose]);\n}\n","import { RefObject } from 'react';\nimport {\n useEffect, useRef, useCallback, useState,\n} from '../lib/teact/teact';\n\nimport { throttle, debounce } from '../util/schedulers';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\n\ntype TargetCallback = (entry: IntersectionObserverEntry) => void;\ntype RootCallback = (entries: IntersectionObserverEntry[]) => void;\ntype ObserveCleanup = NoneToVoidFunction;\nexport type ObserveFn = (target: HTMLElement, targetCallback?: TargetCallback) => ObserveCleanup;\n\ninterface IntersectionController {\n observer: IntersectionObserver;\n callbacks: Map;\n}\n\ninterface Response {\n observe: ObserveFn;\n freeze: NoneToVoidFunction;\n unfreeze: NoneToVoidFunction;\n}\n\nexport function useIntersectionObserver({\n rootRef,\n throttleMs,\n debounceMs,\n shouldSkipFirst,\n margin,\n threshold,\n isDisabled,\n}: {\n rootRef: RefObject;\n throttleMs?: number;\n debounceMs?: number;\n shouldSkipFirst?: boolean;\n margin?: number;\n threshold?: number | number[];\n isDisabled?: boolean;\n}, rootCallback?: RootCallback): Response {\n const controllerRef = useRef();\n const rootCallbackRef = useRef();\n const freezeFlagsRef = useRef(0);\n const onUnfreezeRef = useRef();\n\n rootCallbackRef.current = rootCallback;\n\n const freeze = useCallback(() => {\n freezeFlagsRef.current++;\n }, []);\n\n const unfreeze = useCallback(() => {\n if (!freezeFlagsRef.current) {\n return;\n }\n\n freezeFlagsRef.current--;\n\n if (!freezeFlagsRef.current && onUnfreezeRef.current) {\n onUnfreezeRef.current();\n onUnfreezeRef.current = undefined;\n }\n }, []);\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useEffect(() => {\n if (isDisabled) {\n return undefined;\n }\n\n return () => {\n if (controllerRef.current) {\n controllerRef.current.observer.disconnect();\n controllerRef.current.callbacks.clear();\n controllerRef.current = undefined;\n }\n };\n }, [isDisabled]);\n\n function initController() {\n const callbacks = new Map();\n const entriesAccumulator = new Map();\n const observerCallbackSync = () => {\n const entries = Array.from(entriesAccumulator.values());\n\n entries.forEach((entry: IntersectionObserverEntry) => {\n const callback = callbacks.get(entry.target);\n if (callback) {\n callback!(entry, entries);\n }\n });\n\n if (rootCallbackRef.current) {\n rootCallbackRef.current(entries);\n }\n\n entriesAccumulator.clear();\n };\n const scheduler = throttleMs ? throttle : debounceMs ? debounce : undefined;\n const observerCallback = scheduler\n ? scheduler(observerCallbackSync, (throttleMs || debounceMs)!, !shouldSkipFirst)\n : observerCallbackSync;\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n entriesAccumulator.set(entry.target, entry);\n });\n\n if (freezeFlagsRef.current) {\n onUnfreezeRef.current = () => {\n observerCallback();\n };\n } else {\n observerCallback();\n }\n },\n {\n root: rootRef.current,\n rootMargin: margin ? `${margin}px` : undefined,\n threshold,\n },\n );\n\n controllerRef.current = { observer, callbacks };\n }\n\n const observe = useCallback((target, targetCallback) => {\n if (!controllerRef.current) {\n initController();\n }\n\n const controller = controllerRef.current!;\n controller.observer.observe(target);\n\n if (targetCallback) {\n controller.callbacks.set(target, targetCallback);\n }\n\n return () => {\n if (targetCallback) {\n controller.callbacks.delete(target);\n }\n\n controller.observer.unobserve(target);\n };\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return { observe, freeze, unfreeze };\n}\n\nexport function useOnIntersect(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n useEffect(() => {\n return observe ? observe(targetRef.current!, callback) : undefined;\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n\nexport function useIsIntersecting(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n const [isIntersecting, setIsIntersecting] = useState(!observe);\n\n useOnIntersect(targetRef, observe, (entry) => {\n setIsIntersecting(entry.isIntersecting);\n\n if (callback) {\n callback(entry);\n }\n });\n\n return isIntersecting;\n}\n","import { useEffect, useLayoutEffect, useRef } from '../lib/teact/teact';\n\nfunction useInterval(callback: NoneToVoidFunction, delay?: number, noFirst = false) {\n const savedCallback = useRef(callback);\n\n useLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (delay === undefined) {\n return undefined;\n }\n\n const id = setInterval(() => savedCallback.current(), delay);\n if (!noFirst) savedCallback.current();\n\n return () => clearInterval(id);\n }, [delay, noFirst]);\n}\n\nexport default useInterval;\n","import { useLayoutEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nconst useLayoutEffectWithPrevDeps = (\n cb: (args: T | readonly []) => void, dependencies: T, debugKey?: string,\n) => {\n const prevDeps = usePrevious(dependencies);\n return useLayoutEffect(() => {\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n\nexport default useLayoutEffectWithPrevDeps;\n","import useShowTransition from './useShowTransition';\n\nexport default function useMediaTransition(mediaData?: any) {\n const isMediaReady = Boolean(mediaData);\n const { transitionClassNames } = useShowTransition(isMediaReady, undefined, isMediaReady, 'slow');\n\n return transitionClassNames;\n}\n","import { useRef } from '../lib/teact/teact';\nimport generateIdFor from '../util/generateIdFor';\n\nconst store: Record = {};\n\nconst useUniqueId = () => {\n const idRef = useRef();\n\n if (!idRef.current) {\n idRef.current = generateIdFor(store);\n store[idRef.current] = true;\n }\n\n return idRef.current;\n};\n\nexport default useUniqueId;\n","import {\n useEffect, useMemo, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { IS_PROGRESSIVE_SUPPORTED } from '../util/environment';\nimport { ApiMediaFormat } from '../api/types';\nimport { throttle } from '../util/schedulers';\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\nimport useUniqueId from './useUniqueId';\n\nconst STREAMING_PROGRESS = 0.75;\nconst STREAMING_TIMEOUT = 1500;\nconst PROGRESS_THROTTLE = 500;\n\nexport default function useMediaWithLoadProgress(\n mediaHash: string | undefined,\n noLoad = false,\n mediaFormat = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n isHtmlAllowed = false,\n) {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const isStreaming = mediaFormat === ApiMediaFormat.Stream || (\n IS_PROGRESSIVE_SUPPORTED && mediaFormat === ApiMediaFormat.Progressive\n );\n const forceUpdate = useForceUpdate();\n const id = useUniqueId();\n const [loadProgress, setLoadProgress] = useState(mediaData && !isStreaming ? 1 : 0);\n const startedAtRef = useRef();\n\n const handleProgress = useMemo(() => {\n return throttle((progress: number) => {\n if (startedAtRef.current && (!delay || (Date.now() - startedAtRef.current > delay))) {\n setLoadProgress(progress);\n }\n }, PROGRESS_THROTTLE, true);\n }, [delay]);\n\n useEffect(() => {\n if (!noLoad && mediaHash) {\n if (!mediaData) {\n setLoadProgress(0);\n\n if (startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n }\n\n startedAtRef.current = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat, isHtmlAllowed, handleProgress, id).then(() => {\n const spentTime = Date.now() - startedAtRef.current!;\n startedAtRef.current = undefined;\n\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n } else if (isStreaming) {\n setTimeout(() => {\n setLoadProgress(STREAMING_PROGRESS);\n }, STREAMING_TIMEOUT);\n }\n }\n }, [\n noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, isStreaming, delay, handleProgress,\n isHtmlAllowed, id,\n ]);\n\n useEffect(() => {\n if (noLoad && startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n setLoadProgress(0);\n startedAtRef.current = undefined;\n }\n }, [handleProgress, noLoad]);\n\n useEffect(() => {\n return () => {\n if (mediaHash) {\n mediaLoader.removeCallback(mediaHash, id);\n }\n };\n }, [id, mediaHash]);\n\n return { mediaData, loadProgress };\n}\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\n\nconst MENU_CLOSE_TIMEOUT = 250;\nlet closeTimeout: number | undefined;\n\nexport default function useMouseInside(\n isOpen: boolean, onClose: NoneToVoidFunction, menuCloseTimeout = MENU_CLOSE_TIMEOUT, isDisabled = false,\n) {\n const isMouseInside = useRef(false);\n\n const markMouseInside = useCallback(() => {\n isMouseInside.current = true;\n }, []);\n\n useEffect(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n if (isOpen && !IS_TOUCH_ENV && !isDisabled) {\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout * 2);\n }\n }, [isDisabled, isOpen, menuCloseTimeout, onClose]);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout);\n }, [menuCloseTimeout, onClose]);\n\n return [handleMouseEnter, handleMouseLeave, markMouseInside];\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport usePrevious from './usePrevious';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport default function usePrevDuringAnimation(current: any, duration?: number) {\n const prev = usePrevious(current, true);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n // eslint-disable-next-line no-null/no-null\n const isCurrentPresent = current !== undefined && current !== null;\n // eslint-disable-next-line no-null/no-null\n const isPrevPresent = prev !== undefined && prev !== null;\n\n if (isCurrentPresent && timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useOnChange(() => {\n // When `current` becomes empty\n if (duration && !isCurrentPresent && isPrevPresent && !timeoutRef.current) {\n timeoutRef.current = window.setTimeout(() => {\n timeoutRef.current = undefined;\n forceUpdate();\n }, duration);\n }\n }, [current]);\n\n return !timeoutRef.current || !duration || isCurrentPresent ? current : prev;\n}\n","import { useState, useCallback, useRef } from '../lib/teact/teact';\n\nexport type ReducerAction = { type: Actions; payload?: any };\nexport type StateReducer = (state: State, action: ReducerAction) => State;\nexport type Dispatch = (action: ReducerAction) => void;\n\nexport default function useReducer(\n reducer: StateReducer,\n initialState: State,\n) {\n const reducerRef = useRef(reducer);\n const [state, setState] = useState(initialState);\n\n const dispatch = useCallback((action: ReducerAction) => {\n setState((currentState) => reducerRef.current(currentState, action));\n }, []);\n\n return [\n state,\n dispatch,\n ] as [State, Dispatch];\n}\n","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiSendMessageAction } from '../api/types';\n\nimport { SEND_MESSAGE_ACTION_INTERVAL } from '../config';\nimport { throttle } from '../util/schedulers';\n\nconst useSendMessageAction = (chatId: string, threadId?: number) => {\n return useMemo(() => {\n return throttle((action: ApiSendMessageAction) => {\n getDispatch().sendMessageAction({ chatId, threadId, action });\n }, SEND_MESSAGE_ACTION_INTERVAL);\n }, [chatId, threadId]);\n};\n\nexport default useSendMessageAction;\n","import { useRef } from '../lib/teact/teact';\n\nimport useOnChange from './useOnChange';\n\n// Allows to use state value as \"silent\" dependency in hooks (not causing updates).\n// Useful for state values that update frequently (such as controlled input value).\nexport function useStateRef(value: T) {\n const ref = useRef(value);\n\n useOnChange(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n}\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\nimport { fastRaf } from '../util/schedulers';\n\n// Fix for memory leak when unmounting video element\nexport default function useVideoCleanup(videoRef: RefObject, dependencies: any[]) {\n useEffect(() => {\n const videoEl = videoRef.current;\n\n return () => {\n if (videoEl) {\n fastRaf(() => {\n videoEl.pause();\n videoEl.src = '';\n videoEl.load();\n });\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-cond-assign */\n/* eslint-disable no-param-reassign */\n/* eslint-disable prefer-const */\n/* eslint-disable eqeqeq */\n\n/*\nSuperfast Blur - a fast Box Blur For Canvas\n\nVersion: 0.5\nAuthor: Mario Klingemann\nContact: mario@quasimondo.com\nWebsite: http://www.quasimondo.com/BoxBlurForCanvas\nTwitter: @quasimondo\n\nIn case you find this class useful - especially in commercial projects -\nI am not totally unhappy for a small donation to my PayPal account\nmario@quasimondo.de\n\nOr support me on flattr:\nhttps://flattr.com/thing/140066/Superfast-Blur-a-pretty-fast-Box-Blur-Effect-for-CanvasJavascript\n\nCopyright (c) 2011 Mario Klingemann\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// eslint-disable-next-line max-len\nconst mul_table = [1, 57, 41, 21, 203, 34, 97, 73, 227, 91, 149, 62, 105, 45, 39, 137, 241, 107, 3, 173, 39, 71, 65, 238, 219, 101, 187, 87, 81, 151, 141, 133, 249, 117, 221, 209, 197, 187, 177, 169, 5, 153, 73, 139, 133, 127, 243, 233, 223, 107, 103, 99, 191, 23, 177, 171, 165, 159, 77, 149, 9, 139, 135, 131, 253, 245, 119, 231, 224, 109, 211, 103, 25, 195, 189, 23, 45, 175, 171, 83, 81, 79, 155, 151, 147, 9, 141, 137, 67, 131, 129, 251, 123, 30, 235, 115, 113, 221, 217, 53, 13, 51, 50, 49, 193, 189, 185, 91, 179, 175, 43, 169, 83, 163, 5, 79, 155, 19, 75, 147, 145, 143, 35, 69, 17, 67, 33, 65, 255, 251, 247, 243, 239, 59, 29, 229, 113, 111, 219, 27, 213, 105, 207, 51, 201, 199, 49, 193, 191, 47, 93, 183, 181, 179, 11, 87, 43, 85, 167, 165, 163, 161, 159, 157, 155, 77, 19, 75, 37, 73, 145, 143, 141, 35, 138, 137, 135, 67, 33, 131, 129, 255, 63, 250, 247, 61, 121, 239, 237, 117, 29, 229, 227, 225, 111, 55, 109, 216, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 48, 190, 47, 93, 185, 183, 181, 179, 178, 176, 175, 173, 171, 85, 21, 167, 165, 41, 163, 161, 5, 79, 157, 78, 154, 153, 19, 75, 149, 74, 147, 73, 144, 143, 71, 141, 140, 139, 137, 17, 135, 134, 133, 66, 131, 65, 129, 1];\n// eslint-disable-next-line max-len\nconst shg_table = [0, 9, 10, 10, 14, 12, 14, 14, 16, 15, 16, 15, 16, 15, 15, 17, 18, 17, 12, 18, 16, 17, 17, 19, 19, 18, 19, 18, 18, 19, 19, 19, 20, 19, 20, 20, 20, 20, 20, 20, 15, 20, 19, 20, 20, 20, 21, 21, 21, 20, 20, 20, 21, 18, 21, 21, 21, 21, 20, 21, 17, 21, 21, 21, 22, 22, 21, 22, 22, 21, 22, 21, 19, 22, 22, 19, 20, 22, 22, 21, 21, 21, 22, 22, 22, 18, 22, 22, 21, 22, 22, 23, 22, 20, 23, 22, 22, 23, 23, 21, 19, 21, 21, 21, 23, 23, 23, 22, 23, 23, 21, 23, 22, 23, 18, 22, 23, 20, 22, 23, 23, 23, 21, 22, 20, 22, 21, 22, 24, 24, 24, 24, 24, 22, 21, 24, 23, 23, 24, 21, 24, 23, 24, 22, 24, 24, 22, 24, 24, 22, 23, 24, 24, 24, 20, 23, 22, 23, 24, 24, 24, 24, 24, 24, 24, 23, 21, 23, 22, 23, 24, 24, 24, 22, 24, 24, 24, 23, 22, 24, 24, 25, 23, 25, 25, 23, 24, 25, 25, 24, 22, 25, 25, 25, 24, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 22, 25, 25, 23, 25, 25, 20, 24, 25, 24, 25, 25, 22, 24, 25, 24, 25, 24, 25, 25, 24, 25, 25, 25, 25, 22, 25, 25, 25, 24, 25, 24, 25, 18];\n\nexport default function boxBlurCanvasRGB(context, top_x, top_y, width, height, radius, iterations) {\n if (Number.isNaN(radius) || radius < 1) return;\n\n radius |= 0;\n\n if (Number.isNaN(iterations)) iterations = 1;\n iterations |= 0;\n if (iterations > 3) iterations = 3;\n if (iterations < 1) iterations = 1;\n\n const imageData = context.getImageData(top_x, top_y, width, height);\n\n const pixels = imageData.data;\n\n let rsum;\n let gsum;\n let bsum;\n let x;\n let y;\n let i;\n let p;\n let p1;\n let p2;\n let yp;\n let yi;\n let yw;\n let wm = width - 1;\n let hm = height - 1;\n let rad1 = radius + 1;\n\n let r = [];\n let g = [];\n let b = [];\n\n let mul_sum = mul_table[radius];\n let shg_sum = shg_table[radius];\n\n let vmin = [];\n let vmax = [];\n\n while (iterations-- > 0) {\n yw = yi = 0;\n\n for (y = 0; y < height; y++) {\n rsum = pixels[yw] * rad1;\n gsum = pixels[yw + 1] * rad1;\n bsum = pixels[yw + 2] * rad1;\n\n for (i = 1; i <= radius; i++) {\n p = yw + (((i > wm ? wm : i)) << 2);\n rsum += pixels[p++];\n gsum += pixels[p++];\n bsum += pixels[p++];\n }\n\n for (x = 0; x < width; x++) {\n r[yi] = rsum;\n g[yi] = gsum;\n b[yi] = bsum;\n\n if (y == 0) {\n vmin[x] = ((p = x + rad1) < wm ? p : wm) << 2;\n vmax[x] = ((p = x - radius) > 0 ? p << 2 : 0);\n }\n\n p1 = yw + vmin[x];\n p2 = yw + vmax[x];\n\n rsum += pixels[p1++] - pixels[p2++];\n gsum += pixels[p1++] - pixels[p2++];\n bsum += pixels[p1++] - pixels[p2++];\n\n yi++;\n }\n yw += (width << 2);\n }\n\n for (x = 0; x < width; x++) {\n yp = x;\n rsum = r[yp] * rad1;\n gsum = g[yp] * rad1;\n bsum = b[yp] * rad1;\n\n for (i = 1; i <= radius; i++) {\n yp += (i > hm ? 0 : width);\n rsum += r[yp];\n gsum += g[yp];\n bsum += b[yp];\n }\n\n yi = x << 2;\n for (y = 0; y < height; y++) {\n pixels[yi] = (rsum * mul_sum) >>> shg_sum;\n pixels[yi + 1] = (gsum * mul_sum) >>> shg_sum;\n pixels[yi + 2] = (bsum * mul_sum) >>> shg_sum;\n\n if (x == 0) {\n vmin[y] = ((p = y + rad1) < hm ? p : hm) * width;\n vmax[y] = ((p = y - radius) > 0 ? p * width : 0);\n }\n\n p1 = x + vmin[y];\n p2 = x + vmax[y];\n\n rsum += r[p1] - r[p2];\n gsum += g[p1] - g[p2];\n bsum += b[p1] - b[p2];\n\n yi += width << 2;\n }\n }\n }\n\n context.putImageData(imageData, top_x, top_y);\n}\n","import { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { AudioOrigin, GlobalSearchContent } from '../types';\nimport { ApiMessage } from '../api/types';\n\nimport { IS_SAFARI } from './environment';\nimport safePlay from './safePlay';\nimport { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio';\nimport { getMessageKey, MessageKey, parseMessageKey } from '../modules/helpers';\nimport { fastRaf } from './schedulers';\nimport { selectCurrentMessageList } from '../modules/selectors';\n\ntype Handler = (eventName: string, e: Event) => void;\nexport type TrackId = `${MessageKey}-${number}`;\n\nexport interface Track {\n audio: HTMLAudioElement;\n proxy: HTMLAudioElement;\n type: 'voice' | 'audio';\n handlers: Handler[];\n onForcePlay?: NoneToVoidFunction;\n onTrackChange?: NoneToVoidFunction;\n}\n\nconst tracks = new Map();\nlet voiceQueue: TrackId[] = [];\nlet musicQueue: TrackId[] = [];\n\nlet currentTrackId: TrackId | undefined;\n\nfunction createAudio(\n trackId: TrackId,\n type: Track['type'],\n onForcePlay?: NoneToVoidFunction,\n onTrackChange?: NoneToVoidFunction,\n): Track {\n const audio = new Audio();\n\n function handleEvent(eventName: string) {\n return (e: Event) => {\n if (!tracks.has(trackId)) {\n return;\n }\n\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n tracks.get(trackId)!.handlers.forEach((handler) => {\n handler(eventName, e);\n });\n };\n }\n\n audio.addEventListener('timeupdate', handleEvent('onTimeUpdate'));\n audio.addEventListener('play', handleEvent('onPlay'));\n audio.addEventListener('pause', handleEvent('onPause'));\n audio.addEventListener('loadstart', handleEvent('onLoadStart'));\n audio.addEventListener('loadeddata', handleEvent('onLoadedData'));\n audio.addEventListener('playing', handleEvent('onPlaying'));\n audio.addEventListener('ended', () => {\n if (!tracks.has(trackId)) {\n return;\n }\n\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n playNext(trackId);\n });\n\n return {\n audio,\n type,\n proxy: new Proxy(audio, {\n get: (target, key: keyof HTMLAudioElement) => target[key],\n }),\n handlers: [],\n onForcePlay,\n onTrackChange,\n };\n}\n\nfunction playNext(trackId: TrackId, isReverseOrder?: boolean) {\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack) {\n currentTrack.audio.pause();\n currentTrack.audio.currentTime = 0;\n if (currentTrack.onTrackChange) currentTrack.onTrackChange();\n }\n\n const origin = getGlobal().audioPlayer.origin || AudioOrigin.Inline;\n\n const nextTrackId = findNextInQueue(trackId, origin, isReverseOrder);\n if (!nextTrackId) {\n return;\n }\n\n if (!tracks.has(nextTrackId)) {\n // A bit hacky way to continue playlist when switching chat\n getDispatch().openAudioPlayer(parseMessageKey(splitTrackId(nextTrackId).messageKey));\n\n return;\n }\n\n const nextTrack = tracks.get(nextTrackId)!;\n\n if (nextTrack.onForcePlay) {\n nextTrack.onForcePlay();\n }\n\n currentTrackId = nextTrackId;\n\n if (nextTrack.audio.src) {\n safePlay(nextTrack.audio);\n }\n}\n\nexport function stopCurrentAudio() {\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack) {\n currentTrack.audio.pause();\n }\n}\n\nexport function register(\n trackId: TrackId,\n trackType: Track['type'],\n handler: Handler,\n onForcePlay?: NoneToVoidFunction,\n onTrackChange?: NoneToVoidFunction,\n) {\n if (!tracks.has(trackId)) {\n const track = createAudio(trackId, trackType, onForcePlay, onTrackChange);\n tracks.set(trackId, track);\n addTrackToQueue(track, trackId);\n }\n const { audio, proxy, handlers } = tracks.get(trackId)!;\n\n handlers.push(handler);\n\n return {\n play(src: string) {\n if (!audio.paused) return;\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack && currentTrackId !== trackId) {\n currentTrack.audio.pause();\n currentTrack.audio.currentTime = 0;\n if (isSafariPatchInProgress(currentTrack.audio)) {\n currentTrack.audio.dataset.preventPlayAfterPatch = 'true';\n }\n if (currentTrack.onTrackChange) currentTrack.onTrackChange();\n }\n\n currentTrackId = trackId;\n\n if (!audio.src) {\n audio.src = src;\n audio.preload = 'auto';\n\n if (src.includes('/progressive/') && IS_SAFARI) {\n delete audio.dataset.preventPlayAfterPatch;\n patchSafariProgressiveAudio(audio);\n }\n }\n\n safePlay(audio);\n cleanUpQueue(trackType, trackId);\n },\n\n pause() {\n if (currentTrackId === trackId) {\n audio.pause();\n }\n },\n\n stop() {\n if (currentTrackId === trackId) {\n // Hack, reset src to remove default media session notification\n const prevSrc = audio.src;\n audio.pause();\n // onPause not called otherwise, but required to sync UI\n fastRaf(() => {\n audio.src = '';\n audio.src = prevSrc;\n });\n }\n },\n\n setCurrentTime(time: number) {\n if (currentTrackId === trackId) {\n if (audio.fastSeek) {\n audio.fastSeek(time);\n } else {\n audio.currentTime = time;\n }\n }\n },\n\n setVolume(volume: number) {\n if (currentTrackId === trackId) {\n audio.volume = volume;\n audio.muted = false;\n }\n },\n\n setPlaybackRate(rate: number) {\n if (currentTrackId === trackId) {\n audio.playbackRate = rate;\n }\n },\n\n toggleMuted(muted?: boolean) {\n if (muted === undefined) {\n audio.muted = !audio.muted;\n } else {\n audio.muted = muted;\n }\n },\n\n proxy,\n\n requestNextTrack() {\n playNext(trackId);\n },\n\n isLast() {\n return !findNextInQueue(trackId, getGlobal().audioPlayer.origin);\n },\n\n isFirst() {\n return !findNextInQueue(trackId, getGlobal().audioPlayer.origin, true);\n },\n\n requestPreviousTrack() {\n playNext(trackId, true);\n },\n\n destroy(shouldRemoveFromQueue = false) {\n const track = tracks.get(trackId);\n if (!track) {\n return;\n }\n\n track.handlers = track.handlers.filter((h) => h !== handler);\n\n if (!track.handlers.length) {\n track.audio.pause();\n tracks.delete(trackId);\n\n if (shouldRemoveFromQueue) {\n removeFromQueue(track, trackId);\n }\n\n if (trackId === currentTrackId) {\n currentTrackId = undefined;\n }\n }\n },\n };\n}\n\nfunction getTrackQueue(track: Track) {\n switch (track.type) {\n case 'audio': return musicQueue;\n case 'voice': return voiceQueue;\n default: return undefined;\n }\n}\n\nfunction addTrackToQueue(track: Track, trackId: TrackId) {\n if (track.type === 'audio' && !musicQueue.includes(trackId)) {\n musicQueue.push(trackId);\n musicQueue.sort(trackIdComparator);\n }\n\n if (track.type === 'voice' && !voiceQueue.includes(trackId)) {\n voiceQueue.push(trackId);\n voiceQueue.sort(trackIdComparator);\n }\n}\n\nfunction removeFromQueue(track: Track, trackId: TrackId) {\n const trackIdFilter = (el: TrackId) => el !== trackId;\n if (track.type === 'audio') {\n musicQueue = musicQueue.filter(trackIdFilter);\n }\n\n if (track.type === 'voice') {\n voiceQueue = voiceQueue.filter(trackIdFilter);\n }\n}\n\nfunction cleanUpQueue(type: Track['type'], trackId: TrackId) {\n if (getGlobal().globalSearch.currentContent === GlobalSearchContent.Music) return;\n const { chatId } = parseMessageKey(splitTrackId(trackId).messageKey);\n const openedChatId = selectCurrentMessageList(getGlobal())?.chatId;\n const queueFilter = (id: string) => (\n id.startsWith(`msg${chatId}`) || (openedChatId && id.startsWith(`msg${openedChatId}`))\n );\n\n if (type === 'audio') {\n musicQueue = musicQueue.filter(queueFilter);\n }\n\n if (type === 'voice') {\n voiceQueue = voiceQueue.filter(queueFilter);\n }\n}\n\nfunction findNextInQueue(currentId: TrackId, origin = AudioOrigin.Inline, isReverseOrder?: boolean) {\n const track = tracks.get(currentId)!;\n const queue = getTrackQueue(track);\n if (!queue) return undefined;\n\n if (origin === AudioOrigin.Search) {\n const index = queue.indexOf(currentId);\n if (index < 0) return undefined;\n const direction = isReverseOrder ? -1 : 1;\n return queue[index + direction];\n }\n\n const { chatId } = parseMessageKey(splitTrackId(currentId).messageKey);\n const chatAudio = queue.filter((id) => id.startsWith(`msg${chatId}`));\n const index = chatAudio.indexOf(currentId);\n if (index < 0) return undefined;\n let direction = origin === AudioOrigin.Inline ? -1 : 1;\n if (isReverseOrder) direction *= -1;\n return chatAudio[index + direction];\n}\n\nexport function makeTrackId(message: ApiMessage): TrackId {\n return `${getMessageKey(message)}-${message.date}`;\n}\n\nfunction splitTrackId(trackId: TrackId) {\n const messageKey = trackId.match(/^msg(-?\\d+)-(\\d+)/)![0] as MessageKey;\n const date = Number(trackId.split('-').pop());\n return {\n messageKey,\n date,\n };\n}\n\n// Descending order by date\nfunction trackIdComparator(one?: TrackId, two?: TrackId) {\n if (!one || !two) return 0;\n const { date: dateOne, messageKey: keyOne } = splitTrackId(one);\n const { date: dateTwo, messageKey: keyTwo } = splitTrackId(two);\n const diff = dateTwo - dateOne;\n return diff === 0 ? keyTwo.localeCompare(keyOne) : diff;\n}\n","import { IS_IOS } from './environment';\n\nexport enum SwipeDirection {\n Up,\n Down,\n Left,\n Right,\n}\n\ninterface CaptureOptions {\n onCapture?: (e: MouseEvent | TouchEvent) => void;\n onRelease?: (e: MouseEvent | TouchEvent) => void;\n onDrag?: (\n e: MouseEvent | TouchEvent,\n captureEvent: MouseEvent | TouchEvent,\n params: {\n dragOffsetX: number;\n dragOffsetY: number;\n },\n ) => void;\n onSwipe?: (e: Event, direction: SwipeDirection) => boolean;\n onZoom?: (e: TouchEvent, params: {\n // Relative zoom factor\n zoomFactor: number;\n\n // center coordinate of the initial pinch\n initialCenterX: number;\n initialCenterY: number;\n\n // offset of the pinch center (current from initial)\n dragOffsetX: number;\n dragOffsetY: number;\n\n // center coordinate of the current pinch\n currentCenterX: number;\n currentCenterY: number;\n }) => void;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n onDoubleClick?: (e: MouseEvent | RealTouchEvent, params: { centerX: number; centerY: number }) => void;\n excludedClosestSelector?: string;\n selectorToPreventScroll?: string;\n maxZoom?: number;\n minZoom?: number;\n isNotPassive?: boolean;\n withCursor?: boolean;\n}\n\n// https://stackoverflow.com/questions/11287877/how-can-i-get-e-offsetx-on-mobile-ipad\n// Android does not have this value, and iOS has it but as read-only\nexport interface RealTouchEvent extends TouchEvent {\n pageX?: number;\n pageY?: number;\n}\n\ntype TSwipeAxis =\n 'x'\n | 'y'\n | undefined;\n\nexport const IOS_SCREEN_EDGE_THRESHOLD = 20;\nconst MOVED_THRESHOLD = 15;\nconst SWIPE_THRESHOLD = 50;\n\nfunction getDistance(a: Touch, b?: Touch) {\n if (!b) return 0;\n return Math.sqrt((b.pageX - a.pageX) ** 2 + (b.pageY - a.pageY) ** 2);\n}\n\nfunction getTouchCenter(a: Touch, b: Touch) {\n return {\n x: (a.pageX + b.pageX) / 2,\n y: (a.pageY + b.pageY) / 2,\n };\n}\n\nlet lastClickTime = 0;\n\nexport function captureEvents(element: HTMLElement, options: CaptureOptions) {\n let captureEvent: MouseEvent | RealTouchEvent | undefined;\n let hasMoved = false;\n let hasSwiped = false;\n let initialDistance = 0;\n let initialTouchCenter = { x: window.innerWidth / 2, y: window.innerHeight / 2 };\n let initialSwipeAxis: TSwipeAxis | undefined;\n\n function onCapture(e: MouseEvent | RealTouchEvent) {\n if (options.excludedClosestSelector && (\n (e.target as HTMLElement).matches(options.excludedClosestSelector)\n || (e.target as HTMLElement).closest(options.excludedClosestSelector)\n )) {\n return;\n }\n\n captureEvent = e;\n\n if (e.type === 'mousedown') {\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onRelease);\n } else if (e.type === 'touchstart') {\n // We need to always listen on `touchstart` target:\n // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed\n const target = e.target as HTMLElement;\n target.addEventListener('touchmove', onMove, { passive: true });\n target.addEventListener('touchend', onRelease);\n target.addEventListener('touchcancel', onRelease);\n\n if ('touches' in e) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n\n if (e.touches.length === 2) {\n initialDistance = getDistance(e.touches[0], e.touches[1]);\n initialTouchCenter = getTouchCenter(e.touches[0], e.touches[1]);\n }\n }\n }\n\n document.body.classList.add('no-selection');\n if (options.withCursor) {\n document.body.classList.add('cursor-grabbing');\n }\n\n if (options.onCapture) {\n options.onCapture(e);\n }\n }\n\n function onRelease(e?: MouseEvent | TouchEvent) {\n if (captureEvent) {\n if (options.withCursor) {\n document.body.classList.remove('cursor-grabbing');\n }\n document.body.classList.remove('no-selection');\n\n document.removeEventListener('mouseup', onRelease);\n document.removeEventListener('mousemove', onMove);\n (captureEvent.target as HTMLElement).removeEventListener('touchcancel', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchend', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchmove', onMove);\n\n if (IS_IOS && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = '';\n });\n }\n\n if (e) {\n if (hasMoved) {\n if (options.onRelease) {\n options.onRelease(e);\n }\n } else if (e.type === 'mouseup') {\n if (options.onDoubleClick && Date.now() - lastClickTime < 300) {\n options.onDoubleClick(e, {\n centerX: captureEvent!.pageX!,\n centerY: captureEvent!.pageY!,\n });\n } else if (options.onClick && (!('button' in e) || e.button === 0)) {\n options.onClick(e);\n }\n lastClickTime = Date.now();\n }\n }\n }\n\n hasMoved = false;\n hasSwiped = false;\n initialDistance = 0;\n initialSwipeAxis = undefined;\n initialTouchCenter = { x: window.innerWidth / 2, y: window.innerHeight / 2 };\n captureEvent = undefined;\n }\n\n function onMove(e: MouseEvent | RealTouchEvent) {\n if (captureEvent) {\n if (e.type === 'touchmove' && ('touches' in e)) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n\n if (options.onZoom && initialDistance > 0 && e.touches.length === 2) {\n const endDistance = getDistance(e.touches[0], e.touches[1]);\n const touchCenter = getTouchCenter(e.touches[0], e.touches[1]);\n const dragOffsetX = touchCenter.x - initialTouchCenter.x;\n const dragOffsetY = touchCenter.y - initialTouchCenter.y;\n const zoomFactor = endDistance / initialDistance;\n options.onZoom(e, {\n zoomFactor,\n initialCenterX: initialTouchCenter.x,\n initialCenterY: initialTouchCenter.y,\n dragOffsetX,\n dragOffsetY,\n currentCenterX: touchCenter.x,\n currentCenterY: touchCenter.y,\n });\n if (zoomFactor !== 1) hasMoved = true;\n }\n }\n\n const dragOffsetX = e.pageX! - captureEvent.pageX!;\n const dragOffsetY = e.pageY! - captureEvent.pageY!;\n\n if (Math.abs(dragOffsetX) >= MOVED_THRESHOLD || Math.abs(dragOffsetY) >= MOVED_THRESHOLD) {\n hasMoved = true;\n }\n\n let shouldPreventScroll = false;\n\n if (options.onDrag) {\n options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY });\n shouldPreventScroll = true;\n }\n\n if (options.onSwipe && !hasSwiped) {\n hasSwiped = onSwipe(e, dragOffsetX, dragOffsetY);\n shouldPreventScroll = hasSwiped;\n }\n\n if (IS_IOS && shouldPreventScroll && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = 'hidden';\n });\n }\n }\n }\n\n function onSwipe(e: MouseEvent | RealTouchEvent, dragOffsetX: number, dragOffsetY: number) {\n // Avoid conflicts with swipe-to-back gestures\n if (IS_IOS) {\n const x = (e as RealTouchEvent).touches[0].pageX;\n if (x <= IOS_SCREEN_EDGE_THRESHOLD || x >= window.innerWidth - IOS_SCREEN_EDGE_THRESHOLD) {\n return false;\n }\n }\n\n const xAbs = Math.abs(dragOffsetX);\n const yAbs = Math.abs(dragOffsetY);\n\n if (dragOffsetX && dragOffsetY) {\n const ratio = Math.max(xAbs, yAbs) / Math.min(xAbs, yAbs);\n // Diagonal swipe\n if (ratio < 2) {\n return false;\n }\n }\n\n let axis: TSwipeAxis | undefined;\n if (xAbs >= SWIPE_THRESHOLD) {\n axis = 'x';\n } else if (yAbs >= SWIPE_THRESHOLD) {\n axis = 'y';\n }\n\n if (!axis) {\n return false;\n }\n\n if (!initialSwipeAxis) {\n initialSwipeAxis = axis;\n } else if (initialSwipeAxis !== axis) {\n // Prevent horizontal swipe after vertical to prioritize scroll\n return false;\n }\n\n return processSwipe(e, axis, dragOffsetX, dragOffsetY, options.onSwipe!);\n }\n\n element.addEventListener('mousedown', onCapture);\n element.addEventListener('touchstart', onCapture, { passive: !options.isNotPassive });\n\n return () => {\n onRelease();\n\n element.removeEventListener('touchstart', onCapture);\n element.removeEventListener('mousedown', onCapture);\n };\n}\n\nfunction processSwipe(\n e: Event,\n currentSwipeAxis: TSwipeAxis,\n dragOffsetX: number,\n dragOffsetY: number,\n onSwipe: (e: Event, direction: SwipeDirection) => boolean,\n) {\n if (currentSwipeAxis === 'x') {\n if (dragOffsetX < 0) {\n return onSwipe(e, SwipeDirection.Left);\n } else {\n return onSwipe(e, SwipeDirection.Right);\n }\n } else if (currentSwipeAxis === 'y') {\n if (dragOffsetY < 0) {\n return onSwipe(e, SwipeDirection.Up);\n } else {\n return onSwipe(e, SwipeDirection.Down);\n }\n }\n\n return false;\n}\n","// Sometimes event is fired earlier than animation completes\nconst ANIMATION_END_DELAY = 50;\n\nexport function waitForTransitionEnd(node: Node, handler: NoneToVoidFunction, propertyName?: string) {\n waitForEndEvent('transitionend', node, handler, propertyName);\n}\n\nexport function waitForAnimationEnd(node: Node, handler: NoneToVoidFunction, animationName?: string) {\n waitForEndEvent('animationend', node, handler, animationName);\n}\n\nfunction waitForEndEvent(\n eventType: 'transitionend' | 'animationend',\n node: Node,\n handler: NoneToVoidFunction,\n detailedName?: string,\n) {\n let isHandled = false;\n\n node.addEventListener(eventType, function handleAnimationEnd(e: TransitionEvent | AnimationEvent) {\n if (isHandled || e.target !== e.currentTarget) {\n return;\n }\n\n if (detailedName && (\n (e instanceof TransitionEvent && e.propertyName === detailedName)\n || (e instanceof AnimationEvent && e.animationName === detailedName)\n )) {\n return;\n }\n\n isHandled = true;\n\n node.removeEventListener(eventType, handleAnimationEnd as EventListener);\n\n setTimeout(() => {\n handler();\n }, ANIMATION_END_DELAY);\n } as EventListener);\n}\n","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { FocusDirection } from '../types';\n\nimport {\n ANIMATION_LEVEL_MIN,\n FAST_SMOOTH_MAX_DISTANCE, FAST_SMOOTH_MAX_DURATION, FAST_SMOOTH_MIN_DURATION,\n FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE,\n} from '../config';\nimport { IS_ANDROID } from './environment';\nimport { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';\nimport { animateSingle } from './animation';\nimport { fastRaf } from './schedulers';\n\nlet isAnimating = false;\n\nexport default function fastSmoothScroll(\n container: HTMLElement,\n element: HTMLElement,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const scrollFrom = calculateScrollFrom(container, element, maxDistance, forceDirection);\n\n if (forceDirection === FocusDirection.Static) {\n scrollWithJs(container, element, scrollFrom, position, margin, 0);\n return;\n }\n\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n forceDuration = 0;\n }\n\n scrollWithJs(container, element, scrollFrom, position, margin, forceDuration, forceNormalContainerHeight);\n}\n\nexport function isAnimatingScroll() {\n return isAnimating;\n}\n\nfunction calculateScrollFrom(\n container: HTMLElement,\n element: HTMLElement,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n) {\n const { offsetTop: elementTop } = element;\n const { scrollTop } = container;\n\n if (forceDirection === undefined) {\n const offset = elementTop - container.scrollTop;\n\n if (offset < -maxDistance) {\n return scrollTop + (offset + maxDistance);\n } else if (offset > maxDistance) {\n return scrollTop + (offset - maxDistance);\n }\n } else if (forceDirection === FocusDirection.Up) {\n return elementTop + maxDistance;\n } else if (forceDirection === FocusDirection.Down) {\n return Math.max(0, elementTop - maxDistance);\n }\n\n return scrollTop;\n}\n\nfunction scrollWithJs(\n container: HTMLElement,\n element: HTMLElement,\n scrollFrom: number,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const { scrollTop: currentScrollTop, offsetHeight: containerHeight, scrollHeight } = container;\n const targetContainerHeight = forceNormalContainerHeight && container.dataset.normalHeight\n ? Number(container.dataset.normalHeight)\n : containerHeight;\n\n if (currentScrollTop !== scrollFrom) {\n container.scrollTop = scrollFrom;\n }\n\n let path!: number;\n\n switch (position) {\n case 'start':\n path = (elementTop - margin) - scrollFrom + (IS_ANDROID ? 1 : 0);\n break;\n case 'end':\n path = (elementTop + elementHeight + margin) - (scrollFrom + targetContainerHeight);\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n case 'centerOrTop':\n path = elementHeight < targetContainerHeight\n ? (elementTop + elementHeight / 2) - (scrollFrom + targetContainerHeight / 2)\n : (elementTop - margin) - scrollFrom;\n break;\n }\n\n if (path < 0) {\n const remainingPath = -scrollFrom;\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollHeight - (scrollFrom + targetContainerHeight);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollFrom + path;\n\n if (forceDuration === 0) {\n container.scrollTop = target;\n return;\n }\n\n isAnimating = true;\n\n const absPath = Math.abs(path);\n const transition = absPath < FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE ? shortTransition : longTransition;\n const duration = forceDuration || (\n FAST_SMOOTH_MIN_DURATION\n + (absPath / FAST_SMOOTH_MAX_DISTANCE) * (FAST_SMOOTH_MAX_DURATION - FAST_SMOOTH_MIN_DURATION)\n );\n const startAt = Date.now();\n const onHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n fastRaf(() => {\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n const currentPath = path * (1 - transition(t));\n\n container.scrollTop = Math.round(target - currentPath);\n\n isAnimating = t < 1;\n\n if (!isAnimating) {\n onHeavyAnimationStop();\n }\n\n return isAnimating;\n });\n });\n}\n\nfunction longTransition(t: number) {\n return 1 - ((1 - t) ** 5);\n}\n\nfunction shortTransition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MIN } from '../config';\nimport { animate } from './animation';\nimport { fastRaf } from './schedulers';\n\nconst DEFAULT_DURATION = 300;\n\nexport default function fastSmoothScrollHorizontal(container: HTMLElement, left: number, duration = DEFAULT_DURATION) {\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n duration = 0;\n }\n\n scrollWithJs(container, left, duration);\n}\n\nfunction scrollWithJs(container: HTMLElement, left: number, duration: number) {\n const isRtl = container.getAttribute('dir') === 'rtl';\n const { scrollLeft, offsetWidth: containerWidth, scrollWidth } = container;\n let path = left - scrollLeft;\n\n if (path < 0) {\n const remainingPath = -scrollLeft * (isRtl ? -1 : 1);\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollWidth - (scrollLeft + containerWidth);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollLeft + path;\n\n if (duration === 0) {\n container.scrollLeft = target;\n return;\n }\n\n const startAt = Date.now();\n\n fastRaf(() => {\n animate(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n\n const currentPath = path * (1 - transition(t));\n container.scrollLeft = Math.round(target - currentPath);\n\n return t < 1;\n });\n });\n}\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { IS_TOUCH_ENV } from './environment';\n\nexport default function focusEditableElement(element: HTMLElement, force?: boolean, forcePlaceCaretAtEnd?: boolean) {\n if (!force && element === document.activeElement) {\n return;\n }\n\n const selection = window.getSelection()!;\n const range = document.createRange();\n const lastChild = element.lastChild || element;\n\n if (!IS_TOUCH_ENV && !forcePlaceCaretAtEnd && (!lastChild || !lastChild.nodeValue)) {\n element.focus();\n return;\n }\n\n range.selectNodeContents(forcePlaceCaretAtEnd ? element : lastChild);\n // `false` means collapse to the end rather than the start\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","export default function getKeyFromEvent(e: KeyboardEvent) {\n const key = 'key' in e ? e.key : e.code;\n\n return key.startsWith('Key') ? key.slice(3).toLowerCase() : key;\n}\n","const ELEMENT_NODE = 1;\n\nexport default function getMessageIdsForSelectedText() {\n let selectedFragments = window.getSelection()?.getRangeAt(0).cloneContents();\n if (!selectedFragments || selectedFragments.childElementCount === 0) {\n return;\n }\n\n const messageIds = Array.from(selectedFragments.children)\n .reduce((result, node) => {\n if (node.nodeType === ELEMENT_NODE && node.classList.contains('message-date-group')) {\n return Array.from(node.querySelectorAll('.Message'))\n .reduce((acc, messageEl) => acc.concat(Number((messageEl as HTMLElement).dataset.messageId)), result);\n } else if (node.nodeType === ELEMENT_NODE && node.classList.contains('Message')) {\n return result.concat(Number((node as HTMLElement).dataset.messageId));\n }\n\n return result;\n }, [] as number[]);\n\n\n // Cleanup a document fragment because it is playing media content in the background\n while (selectedFragments.firstChild) {\n selectedFragments.removeChild(selectedFragments.firstChild);\n }\n selectedFragments = undefined;\n\n return messageIds;\n}\n","export type MediaSessionHandlers = {\n play?: () => void;\n pause?: () => void;\n stop?: () => void;\n\n previoustrack?: () => void;\n nexttrack?: () => void;\n\n togglemicrophone?: () => void;\n togglecamera?: () => void;\n hangup?: () => void;\n\n seekbackward?: (details: MediaSessionActionDetails) => void;\n seekforward?: (details: MediaSessionActionDetails) => void;\n seekTo?: ((details: MediaSessionActionDetails) => void);\n};\n\ninterface MediaMetadataParameters {\n title?: string;\n artist?: string;\n album?: string;\n artwork?: MediaImage[];\n}\n\nconst DEFAULT_HANDLERS = {\n play: undefined,\n pause: undefined,\n seekbackward: undefined,\n seekforward: undefined,\n previoustrack: undefined,\n nexttrack: undefined,\n stop: undefined,\n seekTo: undefined,\n};\n\nexport function registerMediaSession(metadata?: MediaMetadata, handlers?: MediaSessionHandlers) {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n if (metadata) updateMetadata(metadata);\n if (handlers) setMediaSessionHandlers(handlers);\n } else {\n // eslint-disable-next-line no-console\n console.warn('MediaSession API not supported in this browser');\n }\n}\n\nexport function updateMetadata(metadata?: MediaMetadata) {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n // eslint-disable-next-line no-null/no-null\n mediaSession.metadata = metadata ?? null;\n }\n}\n\nexport function setMediaSessionHandlers(handlers: MediaSessionHandlers) {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n Object.entries({ ...DEFAULT_HANDLERS, ...handlers }).forEach(([key, handler]) => {\n try {\n // @ts-ignore API not standardized yet\n mediaSession.setActionHandler(key, handler);\n } catch (err) {\n // Handler not supported, ignoring\n }\n });\n }\n}\n\nexport function clearMediaSession() {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n // eslint-disable-next-line no-null/no-null\n mediaSession.metadata = null;\n setMediaSessionHandlers(DEFAULT_HANDLERS);\n if (mediaSession.playbackState) mediaSession.playbackState = 'none';\n mediaSession.setPositionState?.();\n }\n}\n\nexport function setPlaybackState(state: 'none' | 'paused' | 'playing' = 'none') {\n const { mediaSession } = window.navigator;\n if (mediaSession && mediaSession.playbackState) {\n mediaSession.playbackState = state;\n }\n}\n\nexport function setPositionState(state?: MediaPositionState) {\n if (!state || state.position === undefined || state.duration === undefined) return;\n state.position = Math.min(state.position, state.duration);\n\n const { mediaSession } = window.navigator;\n mediaSession?.setPositionState?.(state);\n}\n\nexport function setMicrophoneActive(active: boolean) {\n const { mediaSession } = window.navigator;\n mediaSession?.setMicrophoneActive?.(active);\n}\n\nexport function setCameraActive(active: boolean) {\n const { mediaSession } = window.navigator;\n mediaSession?.setCameraActive?.(active);\n}\n\nexport function buildMediaMetadata({\n title, artist, album, artwork,\n}: MediaMetadataParameters) {\n if ('MediaMetadata' in window) {\n return new window.MediaMetadata({\n title,\n artist,\n album,\n artwork,\n });\n }\n return undefined;\n}\n","import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../api/types';\nimport { IS_EMOJI_SUPPORTED } from './environment';\n\nconst ENTITY_CLASS_BY_NODE_NAME: Record = {\n B: ApiMessageEntityTypes.Bold,\n STRONG: ApiMessageEntityTypes.Bold,\n I: ApiMessageEntityTypes.Italic,\n EM: ApiMessageEntityTypes.Italic,\n U: ApiMessageEntityTypes.Underline,\n S: ApiMessageEntityTypes.Strike,\n STRIKE: ApiMessageEntityTypes.Strike,\n DEL: ApiMessageEntityTypes.Strike,\n CODE: ApiMessageEntityTypes.Code,\n PRE: ApiMessageEntityTypes.Pre,\n BLOCKQUOTE: ApiMessageEntityTypes.Blockquote,\n};\n\nconst MAX_TAG_DEEPNESS = 3;\n\nexport default function parseMessageInput(html: string): ApiFormattedText {\n const fragment = document.createElement('div');\n fragment.innerHTML = parseMarkdown(html);\n const text = fragment.innerText.trim().replace(/\\u200b+/g, '');\n let textIndex = 0;\n let recursionDeepness = 0;\n const entities: ApiMessageEntity[] = [];\n\n function addEntity(node: ChildNode) {\n const { index, entity } = getEntityDataFromNode(node, text, textIndex);\n\n if (entity) {\n textIndex = index;\n entities.push(entity);\n } else if (node.textContent) {\n textIndex += node.textContent.length;\n }\n\n if (node.hasChildNodes() && recursionDeepness <= MAX_TAG_DEEPNESS) {\n recursionDeepness += 1;\n Array.from(node.childNodes).forEach(addEntity);\n }\n }\n\n Array.from(fragment.childNodes).forEach((node) => {\n recursionDeepness = 1;\n addEntity(node);\n });\n\n return {\n text,\n entities: entities.length ? entities : undefined,\n };\n}\n\nfunction parseMarkdown(html: string) {\n let parsedHtml = html.slice(0);\n\n if (!IS_EMOJI_SUPPORTED) {\n // Emojis\n parsedHtml = parsedHtml.replace(/]+alt=\"([^\"]+)\"[^>]*>/gm, '$1');\n }\n\n // Strip redundant nbsp's\n parsedHtml = parsedHtml.replace(/ /g, ' ');\n\n // Replace

with newline (new line in Safari)\n parsedHtml = parsedHtml.replace(/
]*)?><\\/div>/g, '\\n');\n // Replace
with newline\n parsedHtml = parsedHtml.replace(/]*)?>/g, '\\n');\n\n // Strip redundant
tags\n parsedHtml = parsedHtml.replace(/<\\/div>(\\s*)
/g, '\\n');\n parsedHtml = parsedHtml.replace(/
/g, '\\n');\n parsedHtml = parsedHtml.replace(/<\\/div>/g, '');\n\n // Pre\n parsedHtml = parsedHtml.replace(/^`{3}(.*[\\n\\r][^]*?^)`{3}/gm, '
$1
');\n parsedHtml = parsedHtml.replace(/[`]{3}([^`]+)[`]{3}/g, '
$1
');\n\n // Code\n parsedHtml = parsedHtml.replace(/[`]{1}([^`\\n]+)[`]{1}/g, '$1');\n\n // Other simple markdown\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n '$1$2$3',\n );\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n '$1$2$3',\n );\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n '$1$2$3',\n );\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n `$1$2$3`,\n );\n\n return parsedHtml;\n}\n\nfunction getEntityDataFromNode(\n node: ChildNode,\n rawText: string,\n textIndex: number,\n): { index: number; entity?: ApiMessageEntity } {\n const type = getEntityTypeFromNode(node);\n if (!type || !node.textContent) {\n return {\n index: textIndex,\n entity: undefined,\n };\n }\n\n const rawIndex = rawText.indexOf(node.textContent, textIndex);\n // In some cases, last text entity ends with a newline (which gets trimmed from `rawText`).\n // In this case, `rawIndex` would return `-1`, so we use `textIndex` instead.\n const index = rawIndex >= 0 ? rawIndex : textIndex;\n const offset = rawText.substring(0, index).length;\n const { length } = rawText.substring(index, index + node.textContent.length);\n\n let url: string | undefined;\n let userId: string | undefined;\n if (type === ApiMessageEntityTypes.TextUrl) {\n url = (node as HTMLAnchorElement).href;\n }\n if (type === ApiMessageEntityTypes.MentionName) {\n userId = (node as HTMLAnchorElement).dataset.userId;\n }\n\n return {\n index,\n entity: {\n type,\n offset,\n length,\n ...(url && { url }),\n ...(userId && { userId }),\n },\n };\n}\n\nfunction getEntityTypeFromNode(node: ChildNode) {\n if (ENTITY_CLASS_BY_NODE_NAME[node.nodeName]) {\n return ENTITY_CLASS_BY_NODE_NAME[node.nodeName];\n }\n\n if (node.nodeName === 'A') {\n const anchor = node as HTMLAnchorElement;\n if (anchor.dataset.entityType === ApiMessageEntityTypes.MentionName) {\n return ApiMessageEntityTypes.MentionName;\n }\n if (anchor.dataset.entityType === ApiMessageEntityTypes.Url) {\n return ApiMessageEntityTypes.Url;\n }\n if (anchor.href.startsWith('mailto:')) {\n return ApiMessageEntityTypes.Email;\n }\n if (anchor.href.startsWith('tel:')) {\n return ApiMessageEntityTypes.Phone;\n }\n if (anchor.href !== anchor.textContent) {\n return ApiMessageEntityTypes.TextUrl;\n }\n\n return ApiMessageEntityTypes.Url;\n }\n\n if (node.nodeName === 'SPAN') {\n return (node as HTMLElement).dataset.entityType;\n }\n\n return undefined;\n}\n","/*\n * Thanks to Ace Monkey for this mind-blowing patch.\n */\n\nexport function patchSafariProgressiveAudio(audioEl: HTMLAudioElement) {\n if (audioEl.dataset.patchedForSafari) {\n return;\n }\n\n audioEl.addEventListener('play', () => {\n const t = audioEl.currentTime;\n\n audioEl.dataset.patchForSafariInProgress = 'true';\n function onProgress() {\n if (!audioEl.buffered.length) {\n return;\n }\n audioEl.currentTime = audioEl.duration - 1;\n audioEl.addEventListener('progress', () => {\n delete audioEl.dataset.patchForSafariInProgress;\n audioEl.currentTime = t;\n if (audioEl.paused && !audioEl.dataset.preventPlayAfterPatch) {\n audioEl.play();\n }\n }, { once: true });\n\n audioEl.removeEventListener('progress', onProgress);\n }\n\n audioEl.addEventListener('progress', onProgress);\n }, { once: true });\n\n audioEl.dataset.patchedForSafari = 'true';\n}\n\nexport function isSafariPatchInProgress(audioEl: HTMLAudioElement) {\n return Boolean(audioEl.dataset.patchForSafariInProgress);\n}\n","import React from '../lib/teact/teact';\n\nconst stopEvent = (e: React.UIEvent | Event) => {\n e.stopPropagation();\n e.preventDefault();\n};\n\nexport default stopEvent;\n"],"names":["memo","sticker","effect","isOwn","soundId","size","observeIntersection","lastSyncTime","forceLoadPreview","messageId","chatId","activeEmojiInteractions","markAnimationLoaded","isAnimationLoaded","ref","width","style","handleClick","playKey","useAnimatedEmoji","undefined","emoji","localMediaHash","id","isIntersecting","useIsIntersecting","thumbDataUri","thumbnail","dataUri","previewBlobUrl","useMedia","ApiMediaFormat","transitionClassNames","useMediaTransition","mediaData","isMediaLoaded","Boolean","className","buildClassName","LIKE_STICKER_ID","onClick","src","alt","key","animationData","quality","play","forceOnHeavyAnimation","noLoop","onLoad","renderWaveform","canvas","spikes","progress","peak","fillStyle","progressFillStyle","length","height","ctx","getContext","scale","forEach","item","i","globalAlpha","spikeHeight","Math","max","x","y","radius","beginPath","moveTo","arcTo","closePath","roundedRectangle","fill","decodeWaveform","encoded5bit","bitsCount","valuesCount","floor","result","Array","bitsData","l","byteIndex","bitShift","value","lastByteIndex","lastBitShift","lastValue","interpolateArray","data","fitCount","newData","springFactor","leftFiller","rightFiller","idx","val","MIN_SPIKES","IS_SINGLE_COLUMN_LAYOUT","MAX_SPIKES","renderSeekline","playProgress","bufferedProgress","seekerRef","theme","message","senderTitle","uploadProgress","origin","date","isSelectable","isSelected","isDownloading","onPlay","onReadMedia","onCancelUpload","onDateClick","content","audio","voice","video","isMediaUnread","isVoice","isSeeking","useRef","playStateBeforeSeeking","lang","useLang","isRtl","dispatch","getDispatch","isActivated","setIsActivated","useState","shouldLoad","coverHash","getMessageMediaHash","coverBlobUrl","getMessageMediaFormat","loadProgress","downloadProgress","useMediaWithLoadProgress","handleForcePlay","useCallback","handleTrackChange","isBuffered","bufferingHandlers","checkBuffering","useBuffering","isPlaying","playPause","pause","setCurrentTime","duration","useAudioPlayer","makeTrackId","getMediaDuration","isMessageLocal","isOwnMessage","waveformCanvasRef","canvasRef","useMemo","waveform","min","durationFactor","spikesCount","round","Uint8Array","useLayoutEffect","current","useWaveformCanvas","withSeekline","useEffect","isLoadingForPlaying","isUploading","isTransferring","transferProgress","getMediaTransferState","shouldRender","shouldRenderSpinner","spinnerClassNames","useShowTransition","shouldRenderCross","handleButtonClick","setAudioPlayerOrigin","handleDownloadClick","cancelMessageMediaDownload","downloadMessageMedia","handleSeek","e","left","getBoundingClientRect","clientX","MouseEvent","targetTouches","stopPropagation","handleStartSeek","button","handleStopSeek","handleDateClick","renderFirstLine","title","fileName","captureEvents","onCapture","onRelease","onDrag","fullClassName","AudioOrigin","buttonClassNames","push","contentClassName","renderWithTitle","dir","renderText","Link","formatPastTimeShort","formatMediaDuration","performer","renderSecondLine","Button","ripple","color","join","ariaLabel","backgroundImage","ProgressSpinner","transparent","noCross","showProgress","showSeekline","getTranslation","getFileSizeString","formatMediaDateTime","renderAudio","draggable","renderVoice","withGlobal","global","chatOrUserId","countryList","phoneCodes","phoneCodeList","chat","selectChat","user","isUserId","selectUser","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","canInviteUsers","isChatChannel","isUserRightBanned","getHasAdminRight","forceShowSelf","loadFullUser","showNotification","updateChatMutedState","userId","fullInfo","username","phoneNumber","isSelf","handleNotificationChange","isRestricted","copy","text","entity","copyTextToClipboard","formattedNumber","formatPhoneNumberWithCode","link","getChatLink","description","bio","getChatDescription","icon","multiline","narrow","isStatic","label","checked","inactive","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","getPrivateChatUserId","isBot","isUserBot","isSupport","canDeleteForAll","contactName","getUserFirstOrLastName","isChannel","isBasicGroup","isChatBasicGroup","isSuperGroup","isChatSuperGroup","currentUserId","isOpen","onClose","onCloseAnimationEnd","leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact","chatTitle","getChatTitle","handleDeleteMessageForAll","shouldDeleteForAll","handleDeleteAndStop","contactId","accessHash","handleDeleteChat","isCreator","header","isSavedMessages","isText","smaller","canAutoLoad","autoLoadFileMaxSizeMb","withDate","datetime","sender","onMediaClick","document","timestamp","extension","getDocumentExtension","wasIntersected","markIntersected","useFlag","isLoadAllowed","setIsLoadAllowed","shouldDownload","documentHash","isLoaded","hasPreview","getDocumentHasPreview","getMessageMediaThumbDataUri","localBlobUrl","previewData","withMediaViewer","mediaType","name","thumbnailDataUri","actionIcon","isMessageDocumentVideo","elementRef","shouldSpinnerRender","getColorFromExtension","sizeString","getDocumentThumbnailDimensions","onlineCount","selectChatOnlineCount","areMessagesLoaded","selectChatMessages","typingStatus","avatarSize","status","withDots","withUsername","withFullInfo","withUpdatingStatus","withChatType","noRtl","loadFullChat","openMediaViewer","isMin","handleAvatarViewerOpen","hasPhoto","avatarOwnerId","MediaViewerOrigin","isVerified","getChatTypeString","handle","groupStatus","chatTypeString","membersCount","getGroupStatus","onlineStatus","renderStatusOrTyping","outgoingStatus","idPrefix","isProtected","mediaBlobUrl","getMessageVideo","decoding","onContextMenu","stopEvent","isGif","Keys","activeKey","DEFAULT_TEXT","itemIds","selectedIds","filterValue","filterPlaceholder","notFoundText","searchInputId","isLoading","noScrollRestore","onSelectedIdsChange","onFilterChange","onLoadMore","inputRef","shouldMinimize","setTimeout","requestAnimationFrame","focus","handleItemClick","newSelectedIds","includes","splice","indexOf","handleFilterChange","currentTarget","viewportIds","getMore","useInfiniteScroll","map","isMinimized","canClose","clickArg","onChange","placeholder","items","iconElement","titleText","serverTimeOffset","userStatus","selectUserStatus","noStatusOrTyping","fullName","getUserFullName","isUserOnline","getUserStatus","photo","isFirstPhoto","isDeleted","isDeletedUser","isRepliesChat","isChatWithRepliesBot","getMediaHash","forceAvatar","hash","getChatAvatarHash","photoBlobUrl","avatarMediaHash","avatarBlobUrl","useBlurSync","imageSrc","prevImageSrc","usePrevious","userFullName","getFirstLetters","Spinner","getUserColorKey","connectionState","animationLevel","settings","byKey","photos","slideAnimation","currentPhotoIndex","setCurrentPhotoIndex","isFirst","isLast","profile","currentIndex","slice","mediaLoader","usePhotosPreload","handleProfilePhotoClick","profilePhotoIndex","selectPreviousMedia","selectNextMedia","element","querySelector","selectorToPreventScroll","onSwipe","IS_TOUCH_ENV","direction","SwipeDirection","isVerifiedIconShown","_","renderPhotoTabs","Transition","renderPhoto","type","VerifiedIcon","reaction","staticIconId","getGlobal","availableReactions","find","staticIcon","noAnimate","onUnfaveClick","stickerSelector","shouldPlay","lottieData","isLottie","isLottieLoaded","markLoaded","unmarkLoaded","canLottiePlay","IS_WEBM_SUPPORTED","gifBlobUrl","canGifPlay","previewTransitionClassNames","safePlay","onMouseDown","preventMessageInputBlurWithBubbling","autoPlay","loop","playsInline","muted","isLowPriority","preventDefault","props","StickerSetModal","useModuleLoader","Bundles","typingUser","typingUserName","action","replace","trim","onMessageClick","linkData","getMessageWebPage","getFirstLinkInMessage","url","domain","siteName","formattedDescription","getMessageText","renderMessageSummary","handleMessageClick","displayUrl","truncatedDescription","trimText","MEDIA_VIEWER_MEDIA_QUERY","REM","parseInt","getComputedStyle","documentElement","fontSize","ROUND_VIDEO_DIMENSIONS_PX","AVATAR_FULL_DIMENSIONS","DEFAULT_MEDIA_DIMENSIONS","cachedMaxWidthOwn","cachedMaxWidth","cachedMaxWidthNoAvatar","getAvailableWidth","fromOwnMessage","isForwarded","isWebPagePhoto","noAvatars","extraPaddingRem","availableWidthRem","regularMaxWidth","windowWidth","windowSize","getMaxMessageWidthRem","calculateDimensionsForMessageMedia","aspectRatio","availableWidth","availableHeight","getAvailableHeight","mediaWidth","calculateDimensions","getMediaViewerAvailableDimensions","withFooter","isVideo","mql","window","matchMedia","windowHeight","occupiedHeightRem","matches","calculateInlineImageDimensions","getPhotoInlineDimensions","calculateVideoDimensions","getVideoDimensions","getPictogramDimensions","getStickerDimensions","baseWidth","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_INLINE_DESKTOP_FACTOR","calculatedHeight","calculateMediaViewerDimensions","mediaHeight","calculatedWidth","WIDTH","large","medium","small","localEffect","interactWithAnimatedEmoji","sendEmojiInteraction","sendWatchingEmojiInteraction","hasEffect","audioRef","soundMediaData","setPlayKey","String","random","interactions","startedInteractions","sendInteractionBunch","remove","Audio","addEventListener","once","container","startSize","isReversed","performance","now","interactionMessageId","emoticon","selectLocalAnimatedEmojiEffectByName","ChatFolderModal","ChatAnimationTypes","isPinned","isShown","unreadCount","hasUnreadMark","ShowTransition","isCustom","unreadMentionsCount","formatIntegerCompact","isActive","lastMessage","senderId","replyToMessageId","isOutgoing","lastMessageSender","lastMessageAction","getMessageAction","actionTargetMessage","selectChatMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","privateChatUserId","currentChatId","threadId","currentThreadId","messageListType","selectCurrentMessageList","MAIN_THREAD_ID","draft","selectDraft","canScrollDown","canChangeFolder","chatFolders","orderedIds","lastMessageOutgoingStatus","selectOutgoingStatus","folderId","orderDiff","animationType","openChat","focusLastMessage","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isChatFolderModalOpen","openChatFolderModal","closeChatFolderModal","shouldRenderDeleteModal","markRenderDeleteModal","unmarkRenderDeleteModal","shouldRenderChatFolderModal","markRenderChatFolderModal","unmarkRenderChatFolderModal","isAction","isActionMessage","useEnsureMessage","mediaThumbnail","getMessageSticker","isRoundVideo","getMessageRoundVideo","actionTargetUsers","usersById","users","byId","filter","Opacity","opacity","fastRaf","classList","add","Move","transform","ANIMATION_END_DELAY","shouldReplaceHistory","contextActions","useChatContextActions","handleDelete","handleChatFolderChange","ListItem","Avatar","isCallActive","isCallNotEmpty","LastMessageMeta","TypingStatus","isChat","renderActionMessageText","asTextWithSpoilers","senderName","getMessageSenderName","blobUrl","renderSummary","renderLastMessageOrTyping","DeleteChatModal","folderType","chatFolder","selectChatFolder","animatedEmoji","selectAnimatedEmoji","foldersDispatch","onScreenSelect","handleEditFolder","payload","SettingsScreens","AnimatedEmoji","fluid","pill","openNextChat","resolvedFolderId","ALL_FOLDER_ID","ARCHIVED_FOLDER_ID","useFolderManagerForOrderedIds","orderById","reduce","acc","prevOrderById","orderDiffById","mapValues","order","CHAT_LIST_SLICE","handleKeyDown","removeEventListener","IS_PWA","IS_MAC_OS","metaKey","ctrlKey","code","startsWith","digit","match","position","Number","altKey","targetIndexDelta","getAnimationType","orderDiffs","Object","values","numberOfUp","diff","numberOfDown","None","Infinity","useChatAnimationType","InfiniteScroll","preloadBackwards","withAbsolutePositioning","maxHeight","CHAT_HEIGHT_PX","viewportOffset","pinnedCount","getPinnedChatsCount","teactOrderKey","renderChats","Loading","getSenderName","chatsById","getSenderTitle","isChatGroup","isQuick","onFileSelect","isHovered","markHovered","unmarkHovered","onDrop","onDragEnter","onDragLeave","relatedTarget","toTarget","DropAreaState","withQuick","onHide","hideTimeoutRef","prevWithQuick","captureEscKeyListener","handleFilesDrop","async","dataTransfer","dt","files","folderFiles","getFilesFromDataTransferItems","concat","from","handleQuickFilesDrop","handleDragLeave","target","fromTarget","Portal","containerId","onDragOver","clearTimeout","EmojiTooltip","MAX_INPUT_HEIGHT","messageSendKeyCombo","replyingToId","selectReplyingToId","noTabCapture","isPollModalOpen","payment","isPaymentModalOpen","isAttachmentModalInput","editableInputId","html","forcedPlaceholder","canAutoFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","onSend","editLastMessage","replyToNextMessage","cloneRef","isContextMenuOpenRef","isTextFormatterOpen","openTextFormatter","closeTextFormatter","textFormatterAnchorPosition","setTextFormatterAnchorPosition","selectedRange","setSelectedRange","sendMessageAction","useSendMessageAction","updateInputHeight","useLayoutEffectWithPrevDeps","prevHtml","innerHTML","focusInput","isHeavyAnimating","focusEditableElement","handleCloseTextFormatter","selection","getSelection","removeAllRanges","empty","clearSelection","checkSelection","IS_IOS","rangeCount","selectionRange","getRangeAt","selectedText","toString","isSelectionInsideInput","EDITABLE_INPUT_ID","parseEmojiOnlyString","START_TO_END","processSelection","selectionRect","inputRect","top","willSend","input","clone","currentHeight","newHeight","scrollHeight","transitionDuration","log","abs","exec","toggle","captureFirstTab","debounce","captureKeyboardListeners","onTab","suppressFocus","blur","contentEditable","textContent","IS_EMOJI_SUPPORTED","onKeyDown","shiftKey","handleKeyUp","IS_ANDROID","event","closeContextMenuMouseListener","closeContextMenuKeyListener","handleMouseUp","onTouchCancel","anchorPosition","TEXT_FORMAT_BY_TAG_NAME","B","STRONG","I","EM","U","DEL","CODE","SPAN","fragmentEl","createElement","containerRef","linkUrlInputRef","isLinkControlOpen","openLinkControl","closeLinkControl","linkUrl","setLinkUrl","isEditingLink","setIsEditingLink","inputClassName","setInputClassName","selectedTextFormats","setSelectedTextFormats","useVirtualBackdrop","selectedFormats","parentElement","commonAncestorContainer","textFormat","tagName","updateSelectedRange","getSelectedText","innerText","getSelectedElement","updateInputStyles","offsetWidth","scrollWidth","scrollLeft","getFormatButtonClassName","keys","some","fKey","monospace","strikethrough","handleSpoilerText","spoiler","dataset","entityType","ApiMessageEntityTypes","replaceWith","execCommand","handleBoldText","bold","handleItalicText","italic","handleUnderlineText","underline","handleStrikethroughText","handleMonospaceText","handleLinkUrlConfirm","formattedLinkUrl","encodeURI","ensureProtocol","href","addRange","restoreSelection","handler","k","b","u","m","s","p","getKeyFromEvent","linkUrlConfirmClassName","autoComplete","inputMode","onScroll","dataTransferItems","traverseFileTreePromise","entry","Promise","resolve","File","isFile","itemFile","getAsFile","file","isDirectory","createReader","readEntries","entries","entriesPromises","entr","all","kind","webkitGetAsEntry","RE_BR","RE_SPACE","RE_CLEAN_HTML","RE_EXTRA_NEW_LINE","prepareForRegExp","inputId","parentNode","iterations","cache","WeakMap","memoized","fn","cached","get","args","areSortedArraysEqual","lastArgs","lastResult","set","emojiDataPromise","emojiRawData","emojiData","RE_EMOJI_SEARCH","prepareRecentEmojisMemo","recentEmojiIds","limit","pickTruthy","MEMO_EMPTY_ARRAY","prepareLibraryMemo","baseEmojiKeywords","emojiKeywords","emojis","byNative","buildCollectionByKey","baseEmojisByKeyword","natives","emojisByKeyword","byKeyword","keywords","byName","names","searchInLibraryMemo","library","matched","matchedKeywords","keyword","sort","flatten","matchedNames","unique","RegExp","useEmojiTooltip","isAllowed","htmlRef","onUpdateHtml","isDisabled","markIsOpen","unmarkIsOpen","setById","shouldForceInsertEmoji","setShouldForceInsertEmoji","filteredEmojis","setFilteredEmojis","ensureEmojiData","then","getEmojiCode","forceSend","endsWith","substr","insertEmoji","textEmoji","isForce","currentHtml","atIndex","lastIndexOf","messageInput","getElementById","native","isEmojiTooltipOpen","closeEmojiTooltip","default","uncompressEmoji","runThrottled","throttle","cb","RE_USERNAME_SEARCH","useMentionTooltip","canSuggestMembers","groupChatMembers","topInlineBotIds","usersToMention","setUsersToMention","updateFilteredUsers","withInlineBots","memberIds","member","filteredIds","filterUsersByName","usernameFilter","getUsernameFilter","canSuggestInlineBots","insertMention","forceFocus","insertedHtml","isMentionTooltipOpen","closeMentionTooltip","mentionFilteredUsers","useAsyncRendering","dependencies","delay","shouldRenderRef","timeoutRef","forceUpdate","useForceUpdate","useOnChange","options","selected","disabled","loadingOptions","setValues","handleChange","newValues","v","option","subLabel","children","buttonClassName","tabIndex","buttonRef","secondaryIcon","destructive","onSecondaryIconClick","isTouched","markIsTouched","unmarkIsTouched","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","getTriggerElement","getRootElement","closest","getMenuElement","positionX","positionY","transformOriginX","transformOriginY","menuStyle","useContextMenuPosition","handleSecondaryIconClick","handleMouseDown","role","autoClose","DEFAULT_DURATION","onDismiss","setIsOpen","timerRef","closeAndDismiss","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","RADIUSES","xl","square","circleRadius","STROKE_WIDTH","borderRadius","circumference","PI","svg","firstElementChild","strokeDashOffset","setAttribute","hidden","loadingOption","step","renderValue","trackWidth","index","parentContainerClassName","focused","spinnerColor","spinnerBackgroundColor","autoFocusSearch","onReset","onFocus","onBlur","onSpinnerClick","isInputFocused","markInputFocused","unmarkInputFocused","useInputFocusOnOpen","backgroundColor","prevIsOpen","prevChildren","fromChildrenRef","noAnimation","onCheck","classNames","badgeCount","isBadgeActive","previousActiveTab","tabRef","tabEl","prevTabEl","platformEl","prevPlatformEl","shiftLeft","offsetLeft","scaleFactor","clientWidth","forceReflow","SCROLL_DURATION","tabs","activeTab","big","onSwitchTab","useHorizontalScroll","activeTabElement","childNodes","activeTabOffsetLeft","activeTabOffsetWidth","newLeft","fastSmoothScrollHorizontal","tab","renderCount","shouldRestoreHeight","shouldCleanup","cleanupExceptionKey","onStart","onStop","currentKeyRef","rendersRef","prevActiveKey","activeKeyChanged","cleanup","preservedRender","childElements","transition","isBackwards","prevActiveIndex","activeIndex","toSlide","fromSlide","ANIMATION_LEVEL_MIN","dispatchHeavyAnimationStop","dispatchHeavyAnimationEvent","waitForTransitionEnd","clientHeight","performSlideOptimized","node","HTMLElement","onAnimationEnd","activeElement","watchedNode","firstChild","waitForAnimationEnd","flexBasis","renders","contents","render","teactFastList","INCLUDED_CHAT_TYPES","EXCLUDED_CHAT_TYPES","INCLUDE_FILTER_FIELDS","EXCLUDE_FILTER_FIELDS","selectChatFilters","state","mode","selectTemp","selectedChatIds","selectedChatTypes","includedChatIds","includeFilters","pick","folder","excludedChatIds","excludeFilters","getSuggestedFolderName","filters","bots","groups","channels","contacts","nonContacts","INITIAL_STATE","chatFilter","foldersReducer","omit","error","useReducer","makeMediaHandlers","controllerRef","mediaHandlers","proxy","requestNextTrack","requestPreviousTrack","stop","closeAudioPlayer","seekbackward","skipTime","seekOffset","currentTime","seekforward","seekTo","seekTime","nexttrack","previoustrack","trackId","originalDuration","trackType","handlers","metadata","onInit","onForcePlay","onTrackChange","noPlaylist","noProgressUpdates","setIsPlaying","isPlayingSync","setPlayProgress","register","eventName","setVolume","setPlaybackRate","toggleMuted","registerMediaSession","setPlaybackState","audioPlayer","volume","playbackRate","setPositionState","isFinite","paused","updateMetadata","destroy","isSafariPatchInProgress","useEffectWithPrevDeps","prevShouldPlay","prevSrc","playIfPresent","setTime","time","audioProxy","Map","blurredRef","isChanged","img","Image","imgToCanvas","fastBlur","toDataURL","blurredAsync","onload","blurredDataUri","clear","useBlur","noInitiallyBuffered","setIsBuffered","setBufferedProgress","setIsBufferedDebounced","handleBuffering","media","buffered","end","readyState","onLoadedData","onPlaying","onLoadStart","onPause","onTimeUpdate","onProgress","useCanvasBlur","withRaf","processBlur","alpha","IS_CANVAS_FILTER_SUPPORTED","drawImage","RADIUS","isInSearch","isServiceNotifications","SERVICE_NOTIFICATIONS_USER_ID","toggleChatPinned","toggleChatArchived","toggleChatUnread","actionAddToFolder","actionPin","compact","actionUnreadMark","actionMute","actionArchive","isChatArchived","actionDelete","getCanDeleteChat","isInFolder","stopImmediatePropagation","isMenuDisabled","shouldDisableOnLink","shouldDisableOnLongTap","setIsContextMenuOpen","setContextMenuPosition","clientY","body","timer","clearLongPressTimer","startLongPressTimer","contains","originalEvent","touches","cancelClickOnce","emulateContextMenuEvent","passive","EMPTY_RECT","anchor","getLayout","setPositionX","setPositionY","setTransformOriginX","setTransformOriginY","withScroll","setWithScroll","setStyle","setMenuStyle","triggerEl","anchorX","anchorY","menuEl","rootEl","extraPaddingX","extraTopPadding","marginSides","extraMarginTop","marginTop","menuRect","offsetHeight","rootRect","horizontalPosition","verticalPosition","triggerRect","menuMaxHeight","offsetX","offsetY","useDebounce","ms","noFirst","noLast","replyOriginForId","loadMessage","loadMessageThrottled","throttled","setOrderedIds","getOrderedIds","addOrderedIdsCallback","useFolderManagerForUnreadCounters","unreadCounters","setUnreadCounters","getUnreadCounters","addUnreadCountersCallback","useFolderManagerForChatsCount","chatsCount","setChatsCount","getChatsCount","addChatsCountCallback","handleScroll","deltaX","deltaY","useIntersectionObserver","rootCallback","rootRef","throttleMs","debounceMs","shouldSkipFirst","margin","threshold","rootCallbackRef","freezeFlagsRef","onUnfreezeRef","freeze","unfreeze","useHeavyAnimationCheck","observer","disconnect","callbacks","observe","targetCallback","entriesAccumulator","observerCallbackSync","callback","scheduler","observerCallback","IntersectionObserver","root","rootMargin","initController","controller","delete","unobserve","useOnIntersect","targetRef","setIsIntersecting","savedCallback","setInterval","clearInterval","debugKey","prevDeps","isMediaReady","store","idRef","generateIdFor","mediaHash","noLoad","mediaFormat","cacheBuster","isHtmlAllowed","isStreaming","IS_PROGRESSIVE_SUPPORTED","useUniqueId","setLoadProgress","startedAtRef","handleProgress","Date","spentTime","closeTimeout","useMouseInside","menuCloseTimeout","isMouseInside","markMouseInside","usePrevDuringAnimation","prev","isCurrentPresent","isPrevPresent","reducer","initialState","reducerRef","setState","currentState","SEND_MESSAGE_ACTION_INTERVAL","useStateRef","useVideoCleanup","videoRef","videoEl","load","mul_table","shg_table","boxBlurCanvasRGB","context","top_x","top_y","isNaN","imageData","getImageData","pixels","rsum","gsum","bsum","p1","p2","yp","yi","yw","wm","hm","rad1","r","g","mul_sum","shg_sum","vmin","vmax","putImageData","tracks","currentTrackId","voiceQueue","musicQueue","playNext","isReverseOrder","currentTrack","nextTrackId","findNextInQueue","has","openAudioPlayer","parseMessageKey","splitTrackId","messageKey","nextTrack","stopCurrentAudio","track","handleEvent","Proxy","createAudio","trackIdComparator","addTrackToQueue","preventPlayAfterPatch","preload","IS_SAFARI","patchSafariProgressiveAudio","globalSearch","currentContent","GlobalSearchContent","openedChatId","queueFilter","cleanUpQueue","fastSeek","rate","shouldRemoveFromQueue","h","trackIdFilter","el","removeFromQueue","getTrackQueue","currentId","queue","chatAudio","getMessageKey","split","pop","one","two","dateOne","keyOne","dateTwo","keyTwo","localeCompare","IOS_SCREEN_EDGE_THRESHOLD","getDistance","a","sqrt","pageX","pageY","getTouchCenter","lastClickTime","captureEvent","initialSwipeAxis","hasMoved","hasSwiped","initialDistance","initialTouchCenter","innerWidth","innerHeight","excludedClosestSelector","onMove","withCursor","querySelectorAll","scrollable","overflow","onDoubleClick","centerX","centerY","onZoom","endDistance","touchCenter","dragOffsetX","dragOffsetY","zoomFactor","initialCenterX","initialCenterY","currentCenterX","currentCenterY","shouldPreventScroll","xAbs","yAbs","axis","currentSwipeAxis","Left","Right","Up","Down","processSwipe","isNotPassive","propertyName","waitForEndEvent","animationName","eventType","detailedName","isHandled","handleAnimationEnd","TransitionEvent","AnimationEvent","cycleRestrict","isAnimating","fastSmoothScroll","maxDistance","FAST_SMOOTH_MAX_DISTANCE","forceDirection","forceDuration","forceNormalContainerHeight","scrollFrom","calculateScrollFrom","FocusDirection","scrollWithJs","isAnimatingScroll","offsetTop","elementTop","scrollTop","offset","elementHeight","currentScrollTop","containerHeight","targetContainerHeight","normalHeight","path","remainingPath","absPath","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","shortTransition","longTransition","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","startAt","onHeavyAnimationStop","animateSingle","t","currentPath","getAttribute","containerWidth","animate","force","forcePlaceCaretAtEnd","range","createRange","lastChild","nodeValue","selectNodeContents","collapse","toLowerCase","getMessageIdsForSelectedText","selectedFragments","cloneContents","childElementCount","messageIds","nodeType","messageEl","removeChild","DEFAULT_HANDLERS","mediaSession","navigator","setMediaSessionHandlers","console","warn","setActionHandler","err","clearMediaSession","playbackState","buildMediaMetadata","artist","album","artwork","MediaMetadata","ENTITY_CLASS_BY_NODE_NAME","S","STRIKE","PRE","BLOCKQUOTE","parseMessageInput","fragment","parsedHtml","parseMarkdown","textIndex","recursionDeepness","entities","addEntity","rawText","nodeName","getEntityTypeFromNode","rawIndex","substring","getEntityDataFromNode","hasChildNodes","audioEl","patchedForSafari","patchForSafariInProgress"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"347.b7e411d2828cadec556d.js","mappings":"qNAgCA,MAuEA,GAAeA,EAAAA,EAAAA,KArEqB,IAY9B,UAZ+B,QACnCC,EADmC,OAEnCC,EAFmC,MAGnCC,EAHmC,QAInCC,EAJmC,KAKnCC,EAAO,SAL4B,oBAMnCC,EANmC,aAOnCC,EAPmC,iBAQnCC,EARmC,UASnCC,EATmC,OAUnCC,EAVmC,wBAWnCC,GACI,EACJ,MAAM,oBACJC,EADI,kBAEJC,EAFI,IAGJC,EAHI,MAIJC,EAJI,MAKJC,EALI,YAMJC,EANI,QAOJC,IACEC,EAAAA,EAAAA,GAAiBd,EAAMK,EAAQD,EAAWL,EAASO,EAAyBR,OAAOiB,EAAWlB,MAAAA,OAA9E,EAA8EA,EAAQmB,OAEpGC,EAAkB,UAASrB,EAAQsB,KAEnCC,GAAiBC,EAAAA,EAAAA,IAAkBX,EAAKR,GAExCoB,EAAY,UAAGzB,EAAQ0B,iBAAX,aAAG,EAAmBC,QAClCC,GAAiBC,EAAAA,EAAAA,GACpB,GAAER,YACFE,IAAmBhB,EACpBuB,EAAAA,GAAAA,QACAxB,GAEIyB,GAAuBC,EAAAA,EAAAA,GAAmBJ,GAE1CK,GAAYJ,EAAAA,EAAAA,GAASR,GAAiBE,EAAgBO,EAAAA,GAAAA,OAAuBxB,GAC7E4B,EAAgBC,QAAQF,GAE9B,OACE,0BACEpB,IAAKA,EACLuB,WAAWC,EAAAA,EAAAA,GAAe,4BAA6BrC,EAAQsB,KAAOgB,EAAAA,IAAmB,sBACzFvB,MAAOA,EACPwB,QAASvB,IAEPJ,GAAqBa,GACrB,0BAAKe,IAAKf,EAAcgB,IAAI,MAE5B7B,GAAqBgB,GACrB,0BAAKY,IAAKZ,EAAgBQ,UAAWL,EAAsBU,IAAI,KAEhEP,GAAiBb,G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S3yC,SAGtBgsD,EAAQld,YAAckd,EAAQ3lD,SAAW,EACzC2lD,EAAQ3oC,iBAAiB,YAAY,YAC5B2oC,EAAQvzB,QAAQyzB,yBACvBF,EAAQld,YAAcyZ,EAClByD,EAAQnb,SAAWmb,EAAQvzB,QAAQuoB,uBACrCgL,EAAQ3sD,SAET,CAAEikB,MAAM,IAEX0oC,EAAQtgC,oBAAoB,WAAYynB,SAIzC,CAAE7vB,MAAM,IAEX0oC,EAAQvzB,QAAQwzB,iBAAmB,QAG9B,SAASjb,EAAwBgb,GACtC,OAAOrtD,QAAQqtD,EAAQvzB,QAAQyzB,0B,0DClCjC,MAKA,EALmBzjD,IACjBA,EAAEM,kBACFN,EAAE6U","sources":["webpack://telegram-t/./src/components/common/AnimatedEmoji.tsx","webpack://telegram-t/./src/components/common/helpers/waveform.ts","webpack://telegram-t/./src/util/waveform.ts","webpack://telegram-t/./src/components/common/Audio.tsx","webpack://telegram-t/./src/components/common/ChatExtra.tsx","webpack://telegram-t/./src/components/common/DeleteChatModal.tsx","webpack://telegram-t/./src/components/common/Document.tsx","webpack://telegram-t/./src/components/common/DotAnimation.tsx","webpack://telegram-t/./src/components/common/File.tsx","webpack://telegram-t/./src/components/common/GroupChatInfo.tsx","webpack://telegram-t/./src/components/common/LastMessageMeta.tsx","webpack://telegram-t/./src/components/common/Media.tsx","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.tsx","webpack://telegram-t/./src/components/common/NothingFound.tsx","webpack://telegram-t/./src/components/common/Picker.tsx","webpack://telegram-t/./src/components/common/PickerSelectedItem.tsx","webpack://telegram-t/./src/components/common/PrivateChatInfo.tsx","webpack://telegram-t/./src/components/common/ProfilePhoto.tsx","webpack://telegram-t/./src/components/common/ProfileInfo.tsx","webpack://telegram-t/./src/components/common/hooks/usePhotosPreload.ts","webpack://telegram-t/./src/components/common/ReactionStaticEmoji.tsx","webpack://telegram-t/./src/components/common/StickerButton.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.async.tsx","webpack://telegram-t/./src/components/common/TypingStatus.tsx","webpack://telegram-t/./src/components/common/VerifiedIcon.tsx","webpack://telegram-t/./src/components/common/WebLink.tsx","webpack://telegram-t/./src/components/common/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/common/hooks/useAnimatedEmoji.ts","webpack://telegram-t/./src/components/left/ChatFolderModal.async.tsx","webpack://telegram-t/./src/components/left/main/hooks/useChatAnimationType.ts","webpack://telegram-t/./src/components/left/main/Badge.tsx","webpack://telegram-t/./src/components/left/main/ChatCallStatus.tsx","webpack://telegram-t/./src/components/left/main/Chat.tsx","webpack://telegram-t/./src/components/left/main/EmptyFolder.tsx","webpack://telegram-t/./src/components/left/main/ChatList.tsx","webpack://telegram-t/./src/components/left/search/helpers/getSenderName.ts","webpack://telegram-t/./src/components/middle/composer/DropTarget.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MessageInput.tsx","webpack://telegram-t/./src/components/middle/composer/TextFormatter.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/getFilesFromDataTransferItems.ts","webpack://telegram-t/./src/components/middle/composer/helpers/prepareForRegExp.ts","webpack://telegram-t/./src/components/middle/composer/helpers/selection.ts","webpack://telegram-t/./src/util/memoized.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEmojiTooltip.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useMentionTooltip.ts","webpack://telegram-t/./src/components/right/hooks/useAsyncRendering.ts","webpack://telegram-t/./src/components/ui/CheckboxGroup.tsx","webpack://telegram-t/./src/components/ui/FloatingActionButton.tsx","webpack://telegram-t/./src/components/ui/ListItem.tsx","webpack://telegram-t/./src/components/ui/Notification.tsx","webpack://telegram-t/./src/components/ui/ProgressSpinner.tsx","webpack://telegram-t/./src/components/ui/Radio.tsx","webpack://telegram-t/./src/components/ui/RadioGroup.tsx","webpack://telegram-t/./src/components/ui/RangeSlider.tsx","webpack://telegram-t/./src/components/ui/SearchInput.tsx","webpack://telegram-t/./src/components/ui/ShowTransition.tsx","webpack://telegram-t/./src/components/ui/Switcher.tsx","webpack://telegram-t/./src/components/ui/Tab.tsx","webpack://telegram-t/./src/components/ui/TabList.tsx","webpack://telegram-t/./src/components/ui/Transition.tsx","webpack://telegram-t/./src/hooks/reducers/useFoldersReducer.ts","webpack://telegram-t/./src/hooks/useAudioPlayer.ts","webpack://telegram-t/./src/hooks/useBlur.ts","webpack://telegram-t/./src/hooks/useBlurSync.ts","webpack://telegram-t/./src/hooks/useBuffering.ts","webpack://telegram-t/./src/hooks/useCanvasBlur.ts","webpack://telegram-t/./src/hooks/useChatContextActions.ts","webpack://telegram-t/./src/hooks/useContextMenuHandlers.ts","webpack://telegram-t/./src/hooks/useContextMenuPosition.ts","webpack://telegram-t/./src/hooks/useDebounce.ts","webpack://telegram-t/./src/hooks/useEnsureMessage.ts","webpack://telegram-t/./src/hooks/useFolderManager.ts","webpack://telegram-t/./src/hooks/useHorizontalScroll.ts","webpack://telegram-t/./src/hooks/useInputFocusOnOpen.ts","webpack://telegram-t/./src/hooks/useIntersectionObserver.ts","webpack://telegram-t/./src/hooks/useInterval.ts","webpack://telegram-t/./src/hooks/useLayoutEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useMediaTransition.ts","webpack://telegram-t/./src/hooks/useUniqueId.ts","webpack://telegram-t/./src/hooks/useMediaWithLoadProgress.ts","webpack://telegram-t/./src/hooks/useMouseInside.ts","webpack://telegram-t/./src/hooks/usePrevDuringAnimation.ts","webpack://telegram-t/./src/hooks/useReducer.ts","webpack://telegram-t/./src/hooks/useSendMessageAction.ts","webpack://telegram-t/./src/hooks/useStateRef.ts","webpack://telegram-t/./src/hooks/useVideoCleanup.ts","webpack://telegram-t/./src/lib/fastBlur.js","webpack://telegram-t/./src/util/audioPlayer.ts","webpack://telegram-t/./src/util/captureEvents.ts","webpack://telegram-t/./src/util/cssAnimationEndListeners.ts","webpack://telegram-t/./src/util/cycleRestrict.ts","webpack://telegram-t/./src/util/fastSmoothScroll.ts","webpack://telegram-t/./src/util/fastSmoothScrollHorizontal.ts","webpack://telegram-t/./src/util/focusEditableElement.ts","webpack://telegram-t/./src/util/getKeyFromEvent.ts","webpack://telegram-t/./src/util/getMessageIdsForSelectedText.ts","webpack://telegram-t/./src/util/mediaSession.ts","webpack://telegram-t/./src/util/parseMessageInput.ts","webpack://telegram-t/./src/util/patchSafariProgressiveAudio.ts","webpack://telegram-t/./src/util/stopEvent.ts"],"sourcesContent":["import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\nimport { ActiveEmojiInteraction } from '../../global/types';\n\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaTransition from '../../hooks/useMediaTransition';\nimport useAnimatedEmoji from './hooks/useAnimatedEmoji';\nimport { LIKE_STICKER_ID } from './helpers/mediaDimensions';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './AnimatedEmoji.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n effect?: ApiSticker;\n isOwn?: boolean;\n soundId?: string;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n messageId?: number;\n chatId?: string;\n activeEmojiInteractions?: ActiveEmojiInteraction[];\n};\n\nconst QUALITY = 1;\n\nconst AnimatedEmoji: FC = ({\n sticker,\n effect,\n isOwn,\n soundId,\n size = 'medium',\n observeIntersection,\n lastSyncTime,\n forceLoadPreview,\n messageId,\n chatId,\n activeEmojiInteractions,\n}) => {\n const {\n markAnimationLoaded,\n isAnimationLoaded,\n ref,\n width,\n style,\n handleClick,\n playKey,\n } = useAnimatedEmoji(size, chatId, messageId, soundId, activeEmojiInteractions, isOwn, undefined, effect?.emoji);\n\n const localMediaHash = `sticker${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail?.dataUri;\n const previewBlobUrl = useMedia(\n `${localMediaHash}?size=m`,\n !isIntersecting && !forceLoadPreview,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const transitionClassNames = useMediaTransition(previewBlobUrl);\n\n const mediaData = useMedia(localMediaHash, !isIntersecting, ApiMediaFormat.Lottie, lastSyncTime);\n const isMediaLoaded = Boolean(mediaData);\n\n return (\n \n {!isAnimationLoaded && thumbDataUri && (\n \"\"\n )}\n {!isAnimationLoaded && previewBlobUrl && (\n \"\"\n )}\n {isMediaLoaded && localMediaHash && (\n \n )}\n
\n );\n};\n\nexport default memo(AnimatedEmoji);\n","type IWaveformProps = {\n peak: number;\n fillStyle: string;\n progressFillStyle: string;\n};\n\nexport const MAX_EMPTY_WAVEFORM_POINTS = 30;\nconst SPIKE_WIDTH = 2;\nconst SPIKE_STEP = 4;\nconst SPIKE_RADIUS = 1;\nconst HEIGHT = 23;\n\nexport function renderWaveform(\n canvas: HTMLCanvasElement,\n spikes: number[],\n progress: number,\n {\n peak, fillStyle, progressFillStyle,\n }: IWaveformProps,\n) {\n const width = spikes.length * SPIKE_STEP;\n const height = HEIGHT;\n\n canvas.width = width * 2;\n canvas.height = height * 2;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n\n const ctx = canvas.getContext('2d')!;\n ctx.scale(2, 2);\n\n spikes.forEach((item, i) => {\n ctx.globalAlpha = (i / spikes.length >= progress) ? 0.5 : 1;\n ctx.fillStyle = progress > i / spikes.length ? progressFillStyle : fillStyle;\n const spikeHeight = Math.max(2, HEIGHT * (item / Math.max(1, peak)));\n roundedRectangle(ctx, i * SPIKE_STEP, height, SPIKE_WIDTH, spikeHeight, SPIKE_RADIUS);\n ctx.fill();\n });\n}\n\nfunction roundedRectangle(\n ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number,\n) {\n if (width < 2 * radius) {\n radius = width / 2;\n }\n if (height < 2 * radius) {\n radius = height / 2;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.arcTo(x + width, y, x + width, y - height, radius);\n ctx.arcTo(x + width, y - height, x, y - height, radius);\n ctx.arcTo(x, y - height, x, y, radius);\n ctx.arcTo(x, y, x + width, y, radius);\n ctx.closePath();\n}\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\n// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018\nexport function decodeWaveform(encoded5bit: Uint8Array) {\n const bitsCount = encoded5bit.length * 8;\n const valuesCount = Math.floor(bitsCount / 5);\n if (!valuesCount) {\n return [];\n }\n\n // Read each 5 bit of encoded5bit as 0-31 unsigned char.\n // We count the index of the byte in which the desired 5-bit sequence starts.\n // And then we read a uint16 starting from that byte to guarantee to get all of those 5 bits.\n //\n // BUT! if it is the last byte we have, we're not allowed to read a uint16 starting with it.\n // Because it will be an overflow (we'll access one byte after the available memory).\n // We see, that only the last 5 bits could start in the last available byte and be problematic.\n // So we read in a general way all the entries in a general way except the last one.\n const result = Array(valuesCount);\n const bitsData = encoded5bit;\n for (let i = 0, l = valuesCount - 1; i !== l; ++i) {\n const byteIndex = Math.floor((i * 5) / 8);\n const bitShift = Math.floor((i * 5) % 8);\n const value = bitsData[byteIndex] + (bitsData[byteIndex + 1] << 8);\n result[i] = ((value >> bitShift) & 0x1F);\n }\n const lastByteIndex = Math.floor(((valuesCount - 1) * 5) / 8);\n const lastBitShift = Math.floor(((valuesCount - 1) * 5) % 8);\n const lastValue = bitsData[lastByteIndex] + (bitsData[lastByteIndex + 1] << 8);\n result[valuesCount - 1] = (lastValue >> lastBitShift) & 0x1F;\n\n return result;\n}\n\nexport function interpolateArray(data: number[], fitCount: number) {\n let peak = 0;\n const newData = new Array(fitCount);\n const springFactor = data.length / fitCount;\n const leftFiller = data[0];\n const rightFiller = data[data.length - 1];\n for (let i = 0; i < fitCount; i++) {\n const idx = Math.floor(i * springFactor);\n const val = ((data[idx - 1] ?? leftFiller) + (data[idx] ?? leftFiller) + (data[idx + 1] ?? rightFiller)) / 3;\n newData[i] = val;\n if (peak < val) {\n peak = val;\n }\n }\n return { data: newData, peak };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport {\n ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice,\n} from '../../api/types';\nimport { AudioOrigin, ISettings } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';\nimport {\n getMediaDuration,\n getMediaTransferState,\n getMessageMediaFormat,\n getMessageMediaHash,\n isMessageLocal,\n isOwnMessage,\n} from '../../modules/helpers';\nimport { MAX_EMPTY_WAVEFORM_POINTS, renderWaveform } from './helpers/waveform';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport { getFileSizeString } from './helpers/documentInfo';\nimport { decodeWaveform, interpolateArray } from '../../util/waveform';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport { captureEvents } from '../../util/captureEvents';\nimport useMedia from '../../hooks/useMedia';\nimport { makeTrackId } from '../../util/audioPlayer';\nimport { getTranslation } from '../../util/langProvider';\n\nimport Button from '../ui/Button';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './Audio.scss';\n\ntype OwnProps = {\n theme: ISettings['theme'];\n message: ApiMessage;\n senderTitle?: string;\n uploadProgress?: number;\n origin: AudioOrigin;\n date?: number;\n lastSyncTime?: number;\n className?: string;\n isSelectable?: boolean;\n isSelected?: boolean;\n isDownloading: boolean;\n onPlay: (messageId: number, chatId: string) => void;\n onReadMedia?: () => void;\n onCancelUpload?: () => void;\n onDateClick?: (messageId: number, chatId: string) => void;\n};\n\nconst AVG_VOICE_DURATION = 10;\nconst MIN_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 20 : 25;\nconst MAX_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 50 : 75;\n// This is needed for browsers requiring user interaction before playing.\nconst PRELOAD = true;\n\nconst Audio: FC = ({\n theme,\n message,\n senderTitle,\n uploadProgress,\n origin,\n date,\n lastSyncTime,\n className,\n isSelectable,\n isSelected,\n isDownloading,\n onPlay,\n onReadMedia,\n onCancelUpload,\n onDateClick,\n}) => {\n const { content: { audio, voice, video }, isMediaUnread } = message;\n const isVoice = Boolean(voice || video);\n const isSeeking = useRef(false);\n const playStateBeforeSeeking = useRef(false);\n // eslint-disable-next-line no-null/no-null\n const seekerRef = useRef(null);\n const lang = useLang();\n const { isRtl } = lang;\n const dispatch = getDispatch();\n\n const [isActivated, setIsActivated] = useState(false);\n const shouldLoad = (isActivated || PRELOAD) && lastSyncTime;\n const coverHash = getMessageMediaHash(message, 'pictogram');\n const coverBlobUrl = useMedia(coverHash, false, ApiMediaFormat.BlobUrl);\n\n const mediaData = useMedia(\n getMessageMediaHash(message, 'inline'),\n !shouldLoad,\n getMessageMediaFormat(message, 'inline'),\n );\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n getMessageMediaHash(message, 'download'),\n !isDownloading,\n );\n\n const handleForcePlay = useCallback(() => {\n setIsActivated(true);\n onPlay(message.id, message.chatId);\n }, [message, onPlay]);\n\n const handleTrackChange = useCallback(() => {\n setIsActivated(false);\n }, []);\n\n const {\n isBuffered, bufferedProgress, bufferingHandlers, checkBuffering,\n } = useBuffering();\n\n const {\n isPlaying, playProgress, playPause, play, pause, setCurrentTime, duration,\n } = useAudioPlayer(\n makeTrackId(message),\n getMediaDuration(message)!,\n isVoice ? 'voice' : 'audio',\n mediaData,\n bufferingHandlers,\n undefined,\n checkBuffering,\n isActivated,\n handleForcePlay,\n handleTrackChange,\n isMessageLocal(message),\n );\n\n const isOwn = isOwnMessage(message);\n const waveformCanvasRef = useWaveformCanvas(theme, voice, (isMediaUnread && !isOwn) ? 1 : playProgress, isOwn);\n\n const withSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n\n useEffect(() => {\n setIsActivated(isPlaying);\n }, [isPlaying]);\n\n const isLoadingForPlaying = isActivated && !isBuffered;\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n uploadProgress || downloadProgress,\n isLoadingForPlaying || isDownloading,\n );\n\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring);\n\n const shouldRenderCross = shouldRenderSpinner && (isLoadingForPlaying || isUploading);\n\n const handleButtonClick = useCallback(() => {\n if (isUploading) {\n onCancelUpload?.();\n return;\n }\n\n if (!isPlaying) {\n onPlay(message.id, message.chatId);\n }\n\n getDispatch().setAudioPlayerOrigin({ origin });\n setIsActivated(!isActivated);\n playPause();\n }, [isUploading, isPlaying, isActivated, playPause, onCancelUpload, onPlay, message.id, message.chatId, origin]);\n\n useEffect(() => {\n if (onReadMedia && isMediaUnread && (isPlaying || isDownloading)) {\n onReadMedia();\n }\n }, [isPlaying, isMediaUnread, onReadMedia, isDownloading]);\n\n const handleDownloadClick = useCallback(() => {\n if (isDownloading) {\n dispatch.cancelMessageMediaDownload({ message });\n } else {\n dispatch.downloadMessageMedia({ message });\n }\n }, [dispatch, isDownloading, message]);\n\n const handleSeek = useCallback((e: MouseEvent | TouchEvent) => {\n if (isSeeking.current && seekerRef.current) {\n const { width, left } = seekerRef.current.getBoundingClientRect();\n const clientX = e instanceof MouseEvent ? e.clientX : e.targetTouches[0].clientX;\n e.stopPropagation(); // Prevent Slide-to-Reply activation\n // Prevent track skipping while seeking near end\n setCurrentTime(Math.max(Math.min(duration * ((clientX - left) / width), duration - 0.1), 0.001));\n }\n }, [duration, setCurrentTime]);\n\n const handleStartSeek = useCallback((e: MouseEvent | TouchEvent) => {\n if (e instanceof MouseEvent && e.button === 2) return;\n isSeeking.current = true;\n playStateBeforeSeeking.current = isPlaying;\n pause();\n handleSeek(e);\n }, [handleSeek, pause, isPlaying]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n if (playStateBeforeSeeking.current) play();\n }, [play]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n useEffect(() => {\n if (!seekerRef.current || !withSeekline) return undefined;\n return captureEvents(seekerRef.current, {\n onCapture: handleStartSeek,\n onRelease: handleStopSeek,\n onClick: handleStopSeek,\n onDrag: handleSeek,\n });\n }, [withSeekline, handleStartSeek, handleSeek, handleStopSeek]);\n\n function renderFirstLine() {\n if (isVoice) {\n return senderTitle || 'Voice';\n }\n\n const { title, fileName } = audio!;\n\n return title || fileName;\n }\n\n function renderSecondLine() {\n if (isVoice) {\n return (\n
\n {formatMediaDuration((voice || video)!.duration)}\n
\n );\n }\n\n const { performer } = audio!;\n\n return (\n
\n {formatMediaDuration(duration)}\n \n {performer && {renderText(performer)}}\n {performer && senderTitle && }\n {senderTitle && {renderText(senderTitle)}}\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Audio',\n className,\n isOwn && origin === AudioOrigin.Inline && 'own',\n (origin === AudioOrigin.Search || origin === AudioOrigin.SharedMedia) && 'bigger',\n isSelected && 'audio-is-selected',\n );\n\n const buttonClassNames = ['toggle-play'];\n if (shouldRenderCross) {\n buttonClassNames.push('loading');\n } else if (isPlaying) {\n buttonClassNames.push('pause');\n } else if (!isPlaying) {\n buttonClassNames.push('play');\n }\n\n const contentClassName = buildClassName('content', withSeekline && 'with-seekline');\n\n function renderWithTitle() {\n return (\n <>\n
\n
\n

{renderText(renderFirstLine())}

\n\n
\n {date && (\n \n {formatPastTimeShort(lang, date * 1000)}\n \n )}\n
\n
\n\n {withSeekline && (\n
\n \n {playProgress < 1 && `${formatMediaDuration(duration * playProgress, duration)}`}\n \n {renderSeekline(playProgress, bufferedProgress, seekerRef)}\n
\n )}\n {!withSeekline && renderSecondLine()}\n
\n \n );\n }\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n \n \n \n \n {shouldRenderSpinner && (\n
\n \n
\n )}\n {audio && !isUploading && (\n \n \n \n )}\n {origin === AudioOrigin.Search && renderWithTitle()}\n {origin !== AudioOrigin.Search && audio && renderAudio(\n lang, audio, duration, isPlaying, playProgress, bufferedProgress, seekerRef,\n (isDownloading || isUploading), date, transferProgress, onDateClick ? handleDateClick : undefined,\n )}\n {origin === AudioOrigin.SharedMedia && (voice || video) && renderWithTitle()}\n {origin === AudioOrigin.Inline && voice && (\n renderVoice(voice, seekerRef, waveformCanvasRef, playProgress, isMediaUnread)\n )}\n
\n );\n};\n\nfunction renderAudio(\n lang: LangFn,\n audio: ApiAudio,\n duration: number,\n isPlaying: boolean,\n playProgress: number,\n bufferedProgress: number,\n seekerRef: React.Ref,\n showProgress?: boolean,\n date?: number,\n progress?: number,\n handleDateClick?: NoneToVoidFunction,\n) {\n const {\n title, performer, fileName,\n } = audio;\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n const { isRtl } = getTranslation;\n\n return (\n
\n

{renderText(title || fileName)}

\n {showSeekline && (\n
\n \n {formatMediaDuration(duration * playProgress, duration)}\n \n {renderSeekline(playProgress, bufferedProgress, seekerRef)}\n
\n )}\n {!showSeekline && showProgress && (\n
\n {progress ? `${getFileSizeString(audio!.size * progress)} / ` : undefined}{getFileSizeString(audio!.size)}\n
\n )}\n {!showSeekline && !showProgress && (\n
\n {formatMediaDuration(duration)}\n \n {renderText(performer || 'Unknown')}\n {date && (\n <>\n \n \n {formatMediaDateTime(lang, date * 1000, true)}\n \n \n )}\n
\n )}\n
\n );\n}\n\nfunction renderVoice(\n voice: ApiVoice,\n seekerRef: React.Ref,\n waveformCanvasRef: React.Ref,\n playProgress: number,\n isMediaUnread?: boolean,\n) {\n return (\n
\n \n \n
\n

\n {playProgress === 0 ? formatMediaDuration(voice.duration) : formatMediaDuration(voice.duration * playProgress)}\n

\n
\n );\n}\n\nfunction useWaveformCanvas(\n theme: ISettings['theme'],\n voice?: ApiVoice,\n playProgress = 0,\n isOwn = false,\n) {\n // eslint-disable-next-line no-null/no-null\n const canvasRef = useRef(null);\n\n const { data: spikes, peak } = useMemo(() => {\n if (!voice) {\n return undefined;\n }\n\n const { waveform, duration } = voice;\n if (!waveform) {\n return {\n data: new Array(Math.min(duration, MAX_EMPTY_WAVEFORM_POINTS)).fill(0),\n peak: 0,\n };\n }\n\n const durationFactor = Math.min(duration / AVG_VOICE_DURATION, 1);\n const spikesCount = Math.round(MIN_SPIKES + (MAX_SPIKES - MIN_SPIKES) * durationFactor);\n const decodedWaveform = decodeWaveform(new Uint8Array(waveform));\n\n return interpolateArray(decodedWaveform, spikesCount);\n }, [voice]) || {};\n\n useLayoutEffect(() => {\n const canvas = canvasRef.current;\n\n if (!canvas || !spikes || peak === undefined) {\n return;\n }\n\n const fillColor = theme === 'dark' ? '#494A78' : '#ADD3F7';\n const fillOwnColor = theme === 'dark' ? '#B7ABED' : '#AEDFA4';\n const progressFillColor = theme === 'dark' ? '#8774E1' : '#3390EC';\n const progressFillOwnColor = theme === 'dark' ? '#FFFFFF' : '#4FAE4E';\n\n renderWaveform(canvas, spikes, playProgress, {\n peak,\n fillStyle: isOwn ? fillOwnColor : fillColor,\n progressFillStyle: isOwn ? progressFillOwnColor : progressFillColor,\n });\n }, [isOwn, peak, playProgress, spikes, theme]);\n\n return canvasRef;\n}\n\nfunction renderSeekline(\n playProgress: number,\n bufferedProgress: number,\n seekerRef: React.Ref,\n) {\n return (\n }\n >\n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default memo(Audio);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\nimport { ApiChat, ApiCountryCode, ApiUser } from '../../api/types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../modules/selectors';\nimport {\n getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isUserId, isUserRightBanned, selectIsChatMuted,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { copyTextToClipboard } from '../../util/clipboard';\nimport { formatPhoneNumberWithCode } from '../../util/phoneNumber';\nimport useLang from '../../hooks/useLang';\n\nimport ListItem from '../ui/ListItem';\nimport Switcher from '../ui/Switcher';\n\ntype OwnProps = {\n chatOrUserId: string;\n forceShowSelf?: boolean;\n};\n\ntype StateProps =\n {\n user?: ApiUser;\n chat?: ApiChat;\n canInviteUsers?: boolean;\n isMuted?: boolean;\n phoneCodeList: ApiCountryCode[];\n }\n & Pick;\n\nconst ChatExtra: FC = ({\n lastSyncTime,\n user,\n chat,\n forceShowSelf,\n canInviteUsers,\n isMuted,\n phoneCodeList,\n}) => {\n const {\n loadFullUser,\n showNotification,\n updateChatMutedState,\n } = getDispatch();\n\n const {\n id: userId,\n fullInfo,\n username,\n phoneNumber,\n isSelf,\n } = user || {};\n const { id: chatId } = chat || {};\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [loadFullUser, userId, lastSyncTime]);\n\n const handleNotificationChange = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n }, [chatId, isMuted, updateChatMutedState]);\n\n if (!chat || chat.isRestricted || (isSelf && !forceShowSelf)) {\n return undefined;\n }\n\n function copy(text: string, entity: string) {\n copyTextToClipboard(text);\n showNotification({ message: `${entity} was copied` });\n }\n\n const formattedNumber = phoneNumber && formatPhoneNumberWithCode(phoneCodeList, phoneNumber);\n const link = getChatLink(chat);\n const description = (fullInfo?.bio) || getChatDescription(chat);\n\n return (\n
\n {formattedNumber && Boolean(formattedNumber.length) && (\n copy(formattedNumber, lang('Phone'))}>\n {formattedNumber}\n {lang('Phone')}\n \n )}\n {username && (\n copy(`@${username}`, lang('Username'))}\n >\n {renderText(username)}\n {lang('Username')}\n \n )}\n {description && Boolean(description.length) && (\n \n \n {renderText(description, ['br', 'links', 'emoji'])}\n \n {lang(userId ? 'UserBio' : 'Info')}\n \n )}\n {(canInviteUsers || !username) && link && (\n copy(link, lang('SetUrlPlaceholder'))}\n >\n
{link}
\n {lang('SetUrlPlaceholder')}\n \n )}\n {!forceShowSelf && (\n \n {lang('Notifications')}\n \n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n const { lastSyncTime, countryList: { phoneCodes: phoneCodeList } } = global;\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isUserId(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n const isMuted = chat && selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n const canInviteUsers = chat && !user && (\n (!isChatChannel(chat) && !isUserRightBanned(chat, 'inviteUsers'))\n || getHasAdminRight(chat, 'inviteUsers')\n );\n\n return {\n lastSyncTime, phoneCodeList, chat, user, canInviteUsers, isMuted,\n };\n },\n)(ChatExtra));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\n\nimport { selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isUserId,\n isUserBot,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n getChatTitle,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Avatar from './Avatar';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './DeleteChatModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n chat: ApiChat;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isChatWithSelf?: boolean;\n isBot?: boolean;\n isPrivateChat: boolean;\n isBasicGroup: boolean;\n isSuperGroup: boolean;\n currentUserId: string | undefined;\n canDeleteForAll?: boolean;\n contactName?: string;\n};\n\nconst DeleteChatModal: FC = ({\n isOpen,\n chat,\n isChannel,\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isBasicGroup,\n isSuperGroup,\n currentUserId,\n canDeleteForAll,\n contactName,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const {\n leaveChannel,\n deleteHistory,\n deleteChannel,\n deleteChatUser,\n blockContact,\n } = getDispatch();\n\n const lang = useLang();\n const chatTitle = getChatTitle(lang, chat);\n\n const handleDeleteMessageForAll = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n\n onClose();\n }, [deleteHistory, chat.id, onClose]);\n\n const handleDeleteAndStop = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n blockContact({ contactId: chat.id, accessHash: chat.accessHash });\n\n onClose();\n }, [deleteHistory, chat.id, chat.accessHash, blockContact, onClose]);\n\n const handleDeleteChat = useCallback(() => {\n if (isPrivateChat) {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if (isBasicGroup) {\n deleteChatUser({ chatId: chat.id, userId: currentUserId });\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if ((isChannel || isSuperGroup) && !chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else if ((isChannel || isSuperGroup) && chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n }\n onClose();\n }, [\n isPrivateChat,\n isBasicGroup,\n isChannel,\n isSuperGroup,\n currentUserId,\n chat.isCreator,\n chat.id,\n onClose,\n deleteHistory,\n deleteChatUser,\n leaveChannel,\n deleteChannel,\n ]);\n\n function renderHeader() {\n return (\n
\n \n

{lang(renderTitle())}

\n
\n );\n }\n\n function renderTitle() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n\n if (isChannel && chat.isCreator) {\n return 'ChannelDelete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return 'DeleteChatUser';\n }\n\n function renderMessage() {\n if (isChannel && chat.isCreator) {\n return

{renderText(lang('ChatList.DeleteAndLeaveGroupConfirmation', chatTitle), ['simple_markdown'])}

;\n }\n\n if ((isChannel && !chat.isCreator) || isBasicGroup || isSuperGroup) {\n return

{renderText(lang('ChannelLeaveAlertWithName', chatTitle), ['simple_markdown'])}

;\n }\n\n return

{renderText(lang('ChatList.DeleteChatConfirmation', contactName), ['simple_markdown'])}

;\n }\n\n function renderActionText() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n if (isChannel && chat.isCreator) {\n return 'Chat.Input.Delete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return canDeleteForAll ? 'ChatList.DeleteForCurrentUser' : 'Delete';\n }\n\n return (\n \n {renderMessage()}\n {isBot && (\n \n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chat }): StateProps => {\n const isPrivateChat = isUserId(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, chat.id);\n const user = isPrivateChat && selectUser(global, getPrivateChatUserId(chat)!);\n const isBot = user && isUserBot(user) && !chat.isSupport;\n const canDeleteForAll = (isPrivateChat && !isChatWithSelf && !isBot);\n const contactName = isPrivateChat\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isChannel: isChatChannel(chat),\n isBasicGroup: isChatBasicGroup(chat),\n isSuperGroup: isChatSuperGroup(chat),\n currentUserId: global.currentUserId,\n canDeleteForAll,\n contactName,\n };\n },\n)(DeleteChatModal));\n","import React, {\n FC, useCallback, memo, useRef, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo';\nimport {\n getMediaTransferState,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport useMedia from '../../hooks/useMedia';\nimport useFlag from '../../hooks/useFlag';\n\nimport File from './File';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n smaller?: boolean;\n isSelected?: boolean;\n isSelectable?: boolean;\n canAutoLoad?: boolean;\n uploadProgress?: number;\n withDate?: boolean;\n datetime?: number;\n className?: string;\n sender?: string;\n autoLoadFileMaxSizeMb?: number;\n isDownloading: boolean;\n onCancelUpload?: () => void;\n onMediaClick?: () => void;\n onDateClick?: (messageId: number, chatId: string) => void;\n};\n\nconst BYTES_PER_MB = 1024 * 1024;\n\nconst Document: FC = ({\n message,\n observeIntersection,\n smaller,\n canAutoLoad,\n autoLoadFileMaxSizeMb,\n uploadProgress,\n withDate,\n datetime,\n className,\n sender,\n isSelected,\n isSelectable,\n onCancelUpload,\n onMediaClick,\n onDateClick,\n isDownloading,\n}) => {\n const dispatch = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const document = message.content.document!;\n const { fileName, size, timestamp } = document;\n const extension = getDocumentExtension(document) || '';\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const [wasIntersected, markIntersected] = useFlag();\n useEffect(() => {\n if (isIntersecting) {\n markIntersected();\n }\n }, [isIntersecting, markIntersected]);\n\n // Auto-loading does not use global download manager because requires additional click to save files locally\n const [isLoadAllowed, setIsLoadAllowed] = useState(\n canAutoLoad && (!autoLoadFileMaxSizeMb || size <= autoLoadFileMaxSizeMb * BYTES_PER_MB),\n );\n\n const shouldDownload = Boolean(isDownloading || (isLoadAllowed && wasIntersected));\n\n const documentHash = getMessageMediaHash(message, 'download');\n const { loadProgress: downloadProgress, mediaData } = useMediaWithLoadProgress(\n documentHash, !shouldDownload, undefined, undefined, undefined, true,\n );\n const isLoaded = Boolean(mediaData);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, shouldDownload && !isLoaded);\n\n const hasPreview = getDocumentHasPreview(document);\n const thumbDataUri = hasPreview ? getMessageMediaThumbDataUri(message) : undefined;\n const localBlobUrl = hasPreview ? document.previewBlobUrl : undefined;\n const previewData = useMedia(getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n\n const withMediaViewer = onMediaClick && Boolean(document.mediaType);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n return;\n }\n\n if (isDownloading) {\n dispatch.cancelMessageMediaDownload({ message });\n return;\n }\n\n if (isTransferring) {\n setIsLoadAllowed(false);\n return;\n }\n\n if (withMediaViewer) {\n onMediaClick!();\n } else {\n dispatch.downloadMessageMedia({ message });\n }\n }, [\n isUploading, isDownloading, isTransferring, withMediaViewer, onCancelUpload, dispatch, message, onMediaClick,\n ]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n return (\n \n );\n};\n\nexport default memo(Document);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport buildClassName from '../../util/buildClassName';\n\nimport './DotAnimation.scss';\n\ntype OwnProps = {\n content: string;\n className?: string;\n};\n\nconst DotAnimation: FC = ({ content, className }) => {\n const lang = useLang();\n return (\n \n {content}\n \n \n );\n};\n\nexport default DotAnimation;\n","import { RefObject } from 'react';\nimport React, { FC, memo, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useMediaTransition from '../../hooks/useMediaTransition';\nimport buildClassName from '../../util/buildClassName';\nimport { formatMediaDateTime, formatPastTimeShort } from '../../util/dateFormat';\nimport { getColorFromExtension, getFileSizeString } from './helpers/documentInfo';\nimport { getDocumentThumbnailDimensions } from './helpers/mediaDimensions';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './File.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n name: string;\n extension?: string;\n size: number;\n timestamp?: number;\n sender?: string;\n thumbnailDataUri?: string;\n previewData?: string;\n className?: string;\n smaller?: boolean;\n isTransferring?: boolean;\n isUploading?: boolean;\n isSelectable?: boolean;\n isSelected?: boolean;\n transferProgress?: number;\n actionIcon?: string;\n onClick?: () => void;\n onDateClick?: (e: React.MouseEvent) => void;\n};\n\nconst File: FC = ({\n ref,\n name,\n size,\n extension = '',\n timestamp,\n sender,\n thumbnailDataUri,\n previewData,\n className,\n smaller,\n isTransferring,\n isUploading,\n isSelectable,\n isSelected,\n transferProgress,\n actionIcon,\n onClick,\n onDateClick,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const transitionClassNames = useMediaTransition(previewData);\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, true);\n\n const color = getColorFromExtension(extension);\n const sizeString = getFileSizeString(size);\n\n const { width, height } = getDocumentThumbnailDimensions(smaller);\n\n const fullClassName = buildClassName(\n 'File',\n className,\n smaller && 'smaller',\n onClick && !isUploading && 'interactive',\n isSelected && 'file-is-selected',\n );\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n
\n {thumbnailDataUri || previewData ? (\n
\n \n \n
\n ) : (\n
\n {extension.length <= 4 && (\n {extension}\n )}\n
\n )}\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {onClick && (\n \n )}\n
\n
\n
{renderText(name)}
\n
\n \n {isTransferring && transferProgress ? `${Math.round(transferProgress * 100)}%` : sizeString}\n \n {sender && {renderText(sender)}}\n {!sender && timestamp && (\n <>\n \n {formatMediaDateTime(lang, timestamp * 1000, true)}\n \n )}\n
\n
\n {sender && timestamp && (\n {formatPastTimeShort(lang, timestamp * 1000)}\n )}\n
\n );\n};\n\nexport default memo(File);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiTypingStatus } from '../../api/types';\nimport { GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport {\n getChatTypeString,\n getChatTitle,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport { selectChat, selectChatMessages, selectChatOnlineCount } from '../../modules/selectors';\nimport renderText from './helpers/renderText';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\nimport DotAnimation from './DotAnimation';\n\ntype OwnProps = {\n chatId: string;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'small' | 'medium' | 'large' | 'jumbo';\n status?: string;\n withDots?: boolean;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n withChatType?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps =\n {\n chat?: ApiChat;\n onlineCount?: number;\n areMessagesLoaded: boolean;\n }\n & Pick;\n\nconst GroupChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withDots,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n withChatType,\n noRtl,\n chat,\n onlineCount,\n areMessagesLoaded,\n lastSyncTime,\n}) => {\n const {\n loadFullChat,\n openMediaViewer,\n } = getDispatch();\n\n const isSuperGroup = chat && isChatSuperGroup(chat);\n const { id: chatId, isMin, isRestricted } = chat || {};\n\n useEffect(() => {\n if (chatId && !isMin && withFullInfo && lastSyncTime) {\n loadFullChat({ chatId });\n }\n }, [chatId, isMin, lastSyncTime, withFullInfo, loadFullChat, isSuperGroup]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (chat && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: chat.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [chat, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (status) {\n return withDots ? (\n \n ) : (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded && !isRestricted) {\n return (\n \n );\n }\n\n if (!chat) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n if (withChatType) {\n return (\n {lang(getChatTypeString(chat))}\n );\n }\n\n const handle = withUsername ? chat.username : undefined;\n const groupStatus = getGroupStatus(lang, chat);\n const onlineStatus = onlineCount ? `, ${lang('OnlineCount', onlineCount, 'i')}` : undefined;\n\n return (\n \n {handle && {handle}}\n {groupStatus}\n {onlineStatus && {onlineStatus}}\n \n );\n }\n\n return (\n
\n \n
\n
\n

{renderText(getChatTitle(lang, chat))}

\n {chat.isVerified && }\n
\n {renderStatusOrTyping()}\n
\n
\n );\n};\n\nfunction getGroupStatus(lang: LangFn, chat: ApiChat) {\n const chatTypeString = lang(getChatTypeString(chat));\n const { membersCount } = chat;\n\n if (chat.isRestricted) {\n return chatTypeString === 'Channel' ? 'channel is inaccessible' : 'group is inaccessible';\n }\n\n if (!membersCount) {\n return chatTypeString;\n }\n\n return chatTypeString === 'Channel'\n ? lang('Subscribers', membersCount, 'i')\n : lang('Members', membersCount, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { lastSyncTime } = global;\n const chat = selectChat(global, chatId);\n const onlineCount = chat ? selectChatOnlineCount(global, chat) : undefined;\n const areMessagesLoaded = Boolean(selectChatMessages(global, chatId));\n\n return {\n lastSyncTime, chat, onlineCount, areMessagesLoaded,\n };\n },\n)(GroupChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types';\n\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\n\nimport MessageOutgoingStatus from './MessageOutgoingStatus';\n\nimport './LastMessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n};\n\nconst LastMessageMeta: FC = ({ message, outgoingStatus }) => {\n const lang = useLang();\n return (\n
\n {outgoingStatus && (\n \n )}\n {formatPastTimeShort(lang, message.date * 1000)}\n
\n );\n};\n\nexport default memo(LastMessageMeta);\n","import React, { FC, memo, useCallback, useRef } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport stopEvent from '../../util/stopEvent';\nimport {\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n} from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaTransition from '../../hooks/useMediaTransition';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\n\nimport './Media.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n idPrefix?: string;\n isProtected?: boolean;\n observeIntersection?: ObserveFn;\n onClick?: (messageId: number, chatId: string) => void;\n};\n\nconst Media: FC = ({\n message,\n idPrefix = 'shared-media',\n isProtected,\n observeIntersection,\n onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const thumbDataUri = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n const transitionClassNames = useMediaTransition(mediaBlobUrl);\n\n const video = getMessageVideo(message);\n\n const handleClick = useCallback(() => {\n onClick!(message.id, message.chatId);\n }, [message.id, message.chatId, onClick]);\n\n return (\n \n \n \n {video && {video.isGif ? 'GIF' : formatMediaDuration(video.duration)}}\n {isProtected && }\n
\n );\n};\n\nexport default memo(Media);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessageOutgoingStatus } from '../../api/types';\n\nimport Transition from '../ui/Transition';\n\nimport './MessageOutgoingStatus.scss';\n\ntype OwnProps = {\n status: ApiMessageOutgoingStatus;\n};\n\nenum Keys {\n failed, pending, succeeded, read,\n}\n\nconst MessageOutgoingStatus: FC = ({ status }) => {\n return (\n
\n \n \n \n
\n );\n};\n\nexport default memo(MessageOutgoingStatus);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport './NothingFound.scss';\n\ninterface OwnProps {\n text?: string;\n description?: string;\n}\n\nconst DEFAULT_TEXT = 'Nothing found.';\n\nconst NothingFound: FC = ({ text = DEFAULT_TEXT, description }) => {\n const lang = useLang();\n const { transitionClassNames } = useShowTransition(true);\n\n return (\n
\n {text}\n {description &&

{renderText(lang(description), ['br'])}

}\n
\n );\n};\n\nexport default memo(NothingFound);\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { isUserId } from '../../modules/helpers';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from './PrivateChatInfo';\nimport GroupChatInfo from './GroupChatInfo';\nimport PickerSelectedItem from './PickerSelectedItem';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Loading from '../ui/Loading';\n\nimport './Picker.scss';\n\ntype OwnProps = {\n itemIds: string[];\n selectedIds: string[];\n filterValue?: string;\n filterPlaceholder?: string;\n notFoundText?: string;\n searchInputId?: string;\n isLoading?: boolean;\n noScrollRestore?: boolean;\n onSelectedIdsChange: (ids: string[]) => void;\n onFilterChange: (value: string) => void;\n onLoadMore?: () => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst Picker: FC = ({\n itemIds,\n selectedIds,\n filterValue,\n filterPlaceholder,\n notFoundText,\n searchInputId,\n isLoading,\n noScrollRestore,\n onSelectedIdsChange,\n onFilterChange,\n onLoadMore,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const shouldMinimize = selectedIds.length > MAX_FULL_ITEMS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: string) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n onFilterChange('');\n }, [selectedIds, onSelectedIdsChange, onFilterChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, itemIds, Boolean(filterValue));\n\n const lang = useLang();\n\n return (\n
\n
\n {selectedIds.map((id, i) => (\n \n ))}\n \n
\n\n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n handleItemClick(id)}\n ripple\n >\n \n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : !isLoading && viewportIds && !viewportIds.length ? (\n

{notFoundText || 'Sorry, nothing found.'}

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(Picker);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport { getChatTitle, getUserFirstOrLastName, isUserId } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\n\nimport './PickerSelectedItem.scss';\n\ntype OwnProps = {\n chatOrUserId?: string;\n icon?: string;\n title?: string;\n isMinimized?: boolean;\n canClose?: boolean;\n onClick: (arg: any) => void;\n clickArg: any;\n className?: string;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n user?: ApiUser;\n};\n\nconst PickerSelectedItem: FC = ({\n icon,\n title,\n isMinimized,\n canClose,\n onClick,\n clickArg,\n chat,\n user,\n className,\n}) => {\n const lang = useLang();\n\n let iconElement: any;\n let titleText: any;\n\n if (icon && title) {\n iconElement = (\n
\n \n
\n );\n\n titleText = title;\n } else if (chat || user) {\n iconElement = (\n \n );\n\n const name = !chat || (user && !user.isSelf)\n ? getUserFirstOrLastName(user)\n : getChatTitle(lang, chat, user);\n\n titleText = name ? renderText(name) : undefined;\n }\n\n const fullClassName = buildClassName(\n 'PickerSelectedItem',\n className,\n isMinimized && 'minimized',\n canClose && 'closeable',\n );\n\n return (\n onClick(clickArg)}\n title={isMinimized ? titleText : undefined}\n dir={lang.isRtl ? 'rtl' : undefined}\n >\n {iconElement}\n {!isMinimized && (\n
\n {titleText}\n
\n )}\n {canClose && (\n
\n \n
\n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n if (!chatOrUserId) {\n return {};\n }\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isUserId(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n\n return {\n chat,\n user,\n };\n },\n)(PickerSelectedItem));\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types';\nimport { GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { selectChatMessages, selectUser, selectUserStatus } from '../../modules/selectors';\nimport { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\nimport DotAnimation from './DotAnimation';\n\ntype OwnProps = {\n userId: string;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n forceShowSelf?: boolean;\n status?: string;\n withDots?: boolean;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n noStatusOrTyping?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps =\n {\n user?: ApiUser;\n userStatus?: ApiUserStatus;\n isSavedMessages?: boolean;\n areMessagesLoaded: boolean;\n serverTimeOffset: number;\n }\n & Pick;\n\nconst PrivateChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withDots,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n noStatusOrTyping,\n noRtl,\n user,\n userStatus,\n isSavedMessages,\n areMessagesLoaded,\n lastSyncTime,\n serverTimeOffset,\n}) => {\n const {\n loadFullUser,\n openMediaViewer,\n } = getDispatch();\n\n const { id: userId } = user || {};\n const fullName = getUserFullName(user);\n\n useEffect(() => {\n if (withFullInfo && lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, lastSyncTime, withFullInfo]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (user && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: user.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [user, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!user) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (status) {\n return withDots ? (\n \n ) : (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded) {\n return (\n \n );\n }\n\n if (!user) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n return (\n \n {withUsername && user.username && {user.username}}\n {getUserStatus(lang, user, userStatus, serverTimeOffset)}\n \n );\n }\n\n return (\n
\n \n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {user?.isVerified && }\n
\n )}\n {(status || (!isSavedMessages && !noStatusOrTyping)) && renderStatusOrTyping()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { lastSyncTime, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const userStatus = selectUserStatus(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const areMessagesLoaded = Boolean(selectChatMessages(global, userId));\n\n return {\n lastSyncTime, user, userStatus, isSavedMessages, areMessagesLoaded, serverTimeOffset,\n };\n },\n)(PrivateChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser,\n} from '../../api/types';\n\nimport {\n getChatAvatarHash,\n getChatTitle,\n getUserColorKey,\n getUserFullName,\n isUserId,\n isChatWithRepliesBot,\n isDeletedUser,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport { getFirstLetters } from '../../util/textFormat';\nimport useMedia from '../../hooks/useMedia';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ProfilePhoto.scss';\n\ntype OwnProps = {\n chat?: ApiChat;\n user?: ApiUser;\n isFirstPhoto?: boolean;\n isSavedMessages?: boolean;\n photo?: ApiPhoto;\n lastSyncTime?: number;\n onClick: NoneToVoidFunction;\n};\n\nconst ProfilePhoto: FC = ({\n chat,\n user,\n photo,\n isFirstPhoto,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const lang = useLang();\n const isDeleted = user && isDeletedUser(user);\n const isRepliesChat = chat && isChatWithRepliesBot(chat.id);\n\n function getMediaHash(size: 'normal' | 'big', forceAvatar?: boolean) {\n if (photo && !forceAvatar) {\n return `photo${photo.id}?size=c`;\n }\n\n let hash: string | undefined;\n if (!isSavedMessages && !isDeleted && !isRepliesChat) {\n if (user) {\n hash = getChatAvatarHash(user, size);\n } else if (chat) {\n hash = getChatAvatarHash(chat, size);\n }\n }\n\n return hash;\n }\n\n const photoBlobUrl = useMedia(getMediaHash('big'), false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const avatarMediaHash = isFirstPhoto && !photoBlobUrl ? getMediaHash('normal', true) : undefined;\n const avatarBlobUrl = useMedia(avatarMediaHash, false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const thumbDataUri = useBlurSync(!photoBlobUrl && photo && photo.thumbnail && photo.thumbnail.dataUri);\n const imageSrc = photoBlobUrl || avatarBlobUrl || thumbDataUri;\n const prevImageSrc = usePrevious(imageSrc);\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (isRepliesChat) {\n content = ;\n } else if (imageSrc) {\n content = \"\";\n } else if (!imageSrc && user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (!imageSrc && chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isUserId(chat.id) ? 2 : 1);\n } else {\n content = (\n
\n \n
\n );\n }\n\n const fullClassName = buildClassName(\n 'ProfilePhoto',\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n isRepliesChat && 'replies-bot-account',\n (!isSavedMessages && !(imageSrc)) && 'no-photo',\n );\n\n return (\n
\n {prevImageSrc && imageSrc && prevImageSrc !== imageSrc && (\n \"\"\n )}\n {typeof content === 'string' ? renderText(content, ['hq_emoji']) : content}\n
\n );\n};\n\nexport default memo(ProfilePhoto);\n","import React, {\n FC, useEffect, useCallback, memo, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat, ApiUserStatus } from '../../api/types';\nimport { GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { selectChat, selectUser, selectUserStatus } from '../../modules/selectors';\nimport {\n getUserFullName, getUserStatus, isChatChannel, isUserOnline,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport buildClassName from '../../util/buildClassName';\nimport usePhotosPreload from './hooks/usePhotosPreload';\nimport useLang from '../../hooks/useLang';\n\nimport VerifiedIcon from './VerifiedIcon';\nimport ProfilePhoto from './ProfilePhoto';\nimport Transition from '../ui/Transition';\n\nimport './ProfileInfo.scss';\n\ntype OwnProps = {\n userId: string;\n forceShowSelf?: boolean;\n};\n\ntype StateProps =\n {\n user?: ApiUser;\n userStatus?: ApiUserStatus;\n chat?: ApiChat;\n isSavedMessages?: boolean;\n animationLevel: 0 | 1 | 2;\n serverTimeOffset: number;\n }\n & Pick;\n\nconst ProfileInfo: FC = ({\n forceShowSelf,\n user,\n userStatus,\n chat,\n isSavedMessages,\n connectionState,\n animationLevel,\n serverTimeOffset,\n}) => {\n const {\n loadFullUser,\n openMediaViewer,\n } = getDispatch();\n\n const lang = useLang();\n\n const { id: userId } = user || {};\n const { id: chatId } = chat || {};\n const fullName = user ? getUserFullName(user) : (chat ? chat.title : '');\n const photos = user?.photos || chat?.photos || [];\n const slideAnimation = animationLevel >= 1\n ? (lang.isRtl ? 'slide-optimized-rtl' : 'slide-optimized')\n : 'none';\n\n const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0);\n const isFirst = isSavedMessages || photos.length <= 1 || currentPhotoIndex === 0;\n const isLast = isSavedMessages || photos.length <= 1 || currentPhotoIndex === photos.length - 1;\n\n // Deleting the last profile photo may result in an error\n useEffect(() => {\n if (currentPhotoIndex > photos.length) {\n setCurrentPhotoIndex(Math.max(0, photos.length - 1));\n }\n }, [currentPhotoIndex, photos.length]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && userId && !forceShowSelf) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, connectionState, forceShowSelf]);\n\n usePhotosPreload(user || chat, photos, currentPhotoIndex);\n\n const handleProfilePhotoClick = useCallback(() => {\n openMediaViewer({\n avatarOwnerId: userId || chatId,\n profilePhotoIndex: currentPhotoIndex,\n origin: forceShowSelf ? MediaViewerOrigin.SettingsAvatar : MediaViewerOrigin.ProfileAvatar,\n });\n }, [openMediaViewer, userId, chatId, currentPhotoIndex, forceShowSelf]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex - 1);\n }, [currentPhotoIndex, isFirst]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex + 1);\n }, [currentPhotoIndex, isLast]);\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.photo-wrapper');\n if (!element) {\n return undefined;\n }\n\n return captureEvents(element, {\n selectorToPreventScroll: '.Profile, .settings-content',\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n return true;\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n return true;\n }\n\n return false;\n } : undefined,\n });\n }, [selectNextMedia, selectPreviousMedia]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n function renderPhotoTabs() {\n if (isSavedMessages || !photos || photos.length <= 1) {\n return undefined;\n }\n\n return (\n
\n {photos.map((_, i) => (\n \n ))}\n
\n );\n }\n\n function renderPhoto() {\n const photo = !isSavedMessages && photos && photos.length > 0 ? photos[currentPhotoIndex] : undefined;\n\n return (\n \n );\n }\n\n function renderStatus() {\n if (user) {\n return (\n
\n {getUserStatus(lang, user, userStatus, serverTimeOffset)}\n
\n );\n }\n\n return (\n {\n isChatChannel(chat!)\n ? lang('Subscribers', chat!.membersCount ?? 0, 'i')\n : lang('Members', chat!.membersCount ?? 0, 'i')\n }\n \n );\n }\n\n const isVerifiedIconShown = (user || chat)?.isVerified;\n\n return (\n
\n
\n {renderPhotoTabs()}\n \n {renderPhoto()}\n \n\n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n
\n\n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {isVerifiedIconShown && }\n
\n )}\n {!isSavedMessages && renderStatus()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { connectionState, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const userStatus = selectUserStatus(global, userId);\n const chat = selectChat(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const { animationLevel } = global.settings.byKey;\n\n return {\n connectionState,\n user,\n userStatus,\n chat,\n isSavedMessages,\n animationLevel,\n serverTimeOffset,\n };\n },\n)(ProfileInfo));\n","import {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser,\n} from '../../../api/types';\nimport { useEffect } from '../../../lib/teact/teact';\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nconst PHOTOS_TO_PRELOAD = 4;\n\nexport default function usePhotosPreload(\n profile: ApiUser | ApiChat | undefined,\n photos: ApiPhoto[],\n currentIndex: number,\n) {\n useEffect(() => {\n photos.slice(currentIndex, currentIndex + PHOTOS_TO_PRELOAD).forEach((photo) => {\n const mediaData = mediaLoader.getFromMemory(`photo${photo.id}?size=c`);\n if (!mediaData) {\n mediaLoader.fetch(`photo${photo.id}?size=c`, ApiMediaFormat.BlobUrl);\n }\n });\n }, [currentIndex, photos]);\n}\n","import { RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\n\nimport useMedia from '../../hooks/useMedia';\nimport buildClassName from '../../util/buildClassName';\n\nimport './ReactionStaticEmoji.scss';\n\ntype OwnProps = {\n reaction: string;\n ref?: RefObject;\n className?: string;\n};\n\nconst ReactionStaticEmoji: FC = ({\n reaction,\n ref,\n className,\n}) => {\n const staticIconId = getGlobal().availableReactions?.find((l) => l.reaction === reaction)?.staticIcon?.id;\n const mediaData = useMedia(`document${staticIconId}`, !staticIconId, ApiMediaFormat.BlobUrl);\n\n return (\n \n );\n};\n\nexport default memo(ReactionStaticEmoji);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { useIsIntersecting, ObserveFn } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\nimport safePlay from '../../util/safePlay';\nimport { IS_WEBM_SUPPORTED } from '../../util/environment';\n\nimport AnimatedSticker from './AnimatedSticker';\nimport Button from '../ui/Button';\n\nimport './StickerButton.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n size: number;\n observeIntersection: ObserveFn;\n noAnimate?: boolean;\n title?: string;\n className?: string;\n onClick?: (arg: any) => void;\n clickArg?: any;\n onUnfaveClick?: (sticker: ApiSticker) => void;\n};\n\nconst StickerButton: FC = ({\n sticker, size, observeIntersection, noAnimate, title, className, onClick, clickArg, onUnfaveClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const localMediaHash = `sticker${sticker.id}`;\n const stickerSelector = `sticker-button-${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail ? sticker.thumbnail.dataUri : undefined;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !isIntersecting, ApiMediaFormat.BlobUrl);\n\n const shouldPlay = isIntersecting && !noAnimate;\n const lottieData = useMedia(sticker.isLottie && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);\n const [isLottieLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));\n const canLottiePlay = isLottieLoaded && shouldPlay;\n const isGif = sticker.isGif && IS_WEBM_SUPPORTED;\n const gifBlobUrl = useMedia(isGif && localMediaHash, !shouldPlay, ApiMediaFormat.BlobUrl);\n const canGifPlay = Boolean(isGif && gifBlobUrl && shouldPlay);\n\n const { transitionClassNames: previewTransitionClassNames } = useShowTransition(\n Boolean(previewBlobUrl || canLottiePlay),\n undefined,\n undefined,\n 'slow',\n );\n\n // To avoid flickering\n useEffect(() => {\n if (!shouldPlay) {\n unmarkLoaded();\n }\n }, [unmarkLoaded, shouldPlay]);\n\n useEffect(() => {\n if (!isGif || !ref.current) return;\n const video = ref.current.querySelector('video');\n if (!video) return;\n if (canGifPlay) {\n safePlay(video);\n } else {\n video.pause();\n }\n }, [isGif, canGifPlay]);\n\n function handleClick() {\n if (onClick) {\n onClick(clickArg);\n }\n }\n\n function handleUnfaveClick(e: ReactMouseEvent) {\n e.stopPropagation();\n e.preventDefault();\n\n onUnfaveClick!(sticker);\n }\n\n const fullClassName = buildClassName(\n 'StickerButton',\n onClick && 'interactive',\n stickerSelector,\n className,\n );\n\n const style = (thumbDataUri && !canLottiePlay && !canGifPlay) ? `background-image: url('${thumbDataUri}');` : '';\n\n return (\n \n {!canLottiePlay && !canGifPlay && (\n // eslint-disable-next-line jsx-a11y/alt-text\n \n )}\n {isGif && (\n \n )}\n {shouldPlay && lottieData && (\n \n )}\n {onUnfaveClick && (\n \n \n \n )}\n \n );\n};\n\nexport default memo(StickerButton);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './StickerSetModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst StickerSetModalAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerSetModal = useModuleLoader(Bundles.Extra, 'StickerSetModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSetModal ? : undefined;\n};\n\nexport default memo(StickerSetModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\n\nimport { selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport DotAnimation from './DotAnimation';\n\nimport './TypingStatus.scss';\n\ntype OwnProps = {\n typingStatus: ApiTypingStatus;\n};\n\ntype StateProps = {\n typingUser?: ApiUser;\n};\n\nconst TypingStatus: FC = ({ typingStatus, typingUser }) => {\n const lang = useLang();\n const typingUserName = typingUser && !typingUser.isSelf && getUserFirstOrLastName(typingUser);\n const content = lang(typingStatus.action)\n // Fix for translation \"{user} is typing\"\n .replace('{user}', '')\n .replace('{emoji}', typingStatus.emoji).trim();\n\n return (\n

\n {typingUserName && (\n {renderText(typingUserName)}\n )}\n \n

\n );\n};\n\nexport default memo(withGlobal(\n (global, { typingStatus }): StateProps => {\n if (!typingStatus.userId) {\n return {};\n }\n\n const typingUser = selectUser(global, typingStatus.userId);\n\n return { typingUser };\n },\n)(TypingStatus));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport './VerifiedIcon.scss';\n\nconst VerifiedIcon: FC = () => {\n return (\n \n );\n};\n\nexport default VerifiedIcon;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiWebPage } from '../../api/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport {\n getFirstLinkInMessage, getMessageText,\n getMessageWebPage,\n} from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport trimText from '../../util/trimText';\nimport renderText from './helpers/renderText';\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\nimport { renderMessageSummary, TextPart } from './helpers/renderMessageText';\n\nimport Media from './Media';\nimport Link from '../ui/Link';\nimport SafeLink from './SafeLink';\n\nimport './WebLink.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n senderTitle?: string;\n isProtected?: boolean;\n observeIntersection?: ObserveFn;\n onMessageClick: (messageId: number, chatId: string) => void;\n};\n\ntype ApiWebPageWithFormatted =\n ApiWebPage\n & { formattedDescription?: TextPart[] };\n\nconst WebLink: FC = ({\n message, senderTitle, isProtected, observeIntersection, onMessageClick,\n}) => {\n const lang = useLang();\n\n let linkData: ApiWebPageWithFormatted | undefined = getMessageWebPage(message);\n\n if (!linkData) {\n const link = getFirstLinkInMessage(message);\n if (link) {\n const { url, domain } = link;\n\n linkData = {\n siteName: domain.replace(/^www./, ''),\n url: url.includes('://') ? url : url.includes('@') ? `mailto:${url}` : `http://${url}`,\n formattedDescription: getMessageText(message) !== url\n ? renderMessageSummary(lang, message, undefined, undefined, MAX_TEXT_LENGTH)\n : undefined,\n } as ApiWebPageWithFormatted;\n }\n }\n\n const handleMessageClick = useCallback(() => {\n onMessageClick(message.id, message.chatId);\n }, [onMessageClick, message.id, message.chatId]);\n\n if (!linkData) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n formattedDescription,\n photo,\n video,\n } = linkData;\n\n const truncatedDescription = !senderTitle && description && trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebLink scroll-item',\n (!photo && !video) && 'without-media',\n );\n\n return (\n \n {photo && (\n \n )}\n
\n \n {renderText(title || siteName || displayUrl)}\n \n {(truncatedDescription || formattedDescription) && (\n \n {formattedDescription || (truncatedDescription && renderText(truncatedDescription))}\n \n )}\n \n {url.replace('mailto:', '') || displayUrl}\n \n {senderTitle &&
{renderText(senderTitle)}
}\n
\n {senderTitle && (\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n )}\n \n );\n};\n\nexport default memo(WebLink);\n","import {\n ApiPhoto, ApiVideo, ApiSticker, ApiDimensions,\n} from '../../../api/types';\n\nimport { STICKER_SIZE_INLINE_DESKTOP_FACTOR, STICKER_SIZE_INLINE_MOBILE_FACTOR } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport { getPhotoInlineDimensions, getVideoDimensions } from '../../../modules/helpers';\n\nexport const MEDIA_VIEWER_MEDIA_QUERY = '(max-height: 640px)';\nexport const REM = parseInt(getComputedStyle(document.documentElement).fontSize, 10);\nexport const ROUND_VIDEO_DIMENSIONS_PX = 240;\nexport const GIF_MIN_WIDTH = 300;\nexport const AVATAR_FULL_DIMENSIONS = { width: 640, height: 640 };\nexport const LIKE_STICKER_ID = '4986041492570112461';\n\nconst DEFAULT_MEDIA_DIMENSIONS: ApiDimensions = { width: 100, height: 100 };\nconst MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM = 4.5;\nconst MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM = 7;\nconst MESSAGE_MAX_WIDTH_REM = 29;\nconst MESSAGE_OWN_MAX_WIDTH_REM = 30;\n\nlet cachedMaxWidthOwn: number | undefined;\nlet cachedMaxWidth: number | undefined;\nlet cachedMaxWidthNoAvatar: number | undefined;\n\nfunction getMaxMessageWidthRem(fromOwnMessage: boolean, noAvatars?: boolean) {\n const regularMaxWidth = fromOwnMessage ? MESSAGE_OWN_MAX_WIDTH_REM : MESSAGE_MAX_WIDTH_REM;\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return regularMaxWidth;\n }\n\n const { width: windowWidth } = windowSize.get();\n\n // @optimization Limitation: changing device screen width not supported\n if (!cachedMaxWidthOwn) {\n cachedMaxWidthOwn = Math.min(\n MESSAGE_OWN_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidth) {\n cachedMaxWidth = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidthNoAvatar) {\n cachedMaxWidthNoAvatar = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n\n return fromOwnMessage\n ? cachedMaxWidthOwn\n : (noAvatars ? cachedMaxWidthNoAvatar : cachedMaxWidth);\n}\n\nexport function getAvailableWidth(\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const extraPaddingRem = isForwarded || isWebPagePhoto ? 1.625 : 0;\n const availableWidthRem = getMaxMessageWidthRem(fromOwnMessage, noAvatars) - extraPaddingRem;\n\n return availableWidthRem * REM;\n}\n\nfunction getAvailableHeight(isGif?: boolean, aspectRatio?: number) {\n if (\n isGif && aspectRatio\n && aspectRatio >= 0.75 && aspectRatio <= 1.25\n ) {\n return 20 * REM;\n }\n\n return 27 * REM;\n}\n\nfunction calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n isGif,\n noAvatars,\n}: {\n width: number;\n height: number;\n fromOwnMessage: boolean;\n isForwarded?: boolean;\n isWebPagePhoto?: boolean;\n isGif?: boolean;\n noAvatars?: boolean;\n}): ApiDimensions {\n const aspectRatio = height / width;\n const availableWidth = getAvailableWidth(fromOwnMessage, isForwarded, isWebPagePhoto, noAvatars);\n const availableHeight = getAvailableHeight(isGif, aspectRatio);\n const mediaWidth = isGif ? Math.max(GIF_MIN_WIDTH, width) : width;\n const mediaHeight = isGif ? height * (mediaWidth / width) : height;\n\n return calculateDimensions(availableWidth, availableHeight, mediaWidth, mediaHeight);\n}\n\nexport function getMediaViewerAvailableDimensions(withFooter: boolean, isVideo: boolean): ApiDimensions {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n const { width: windowWidth, height: windowHeight } = windowSize.get();\n let occupiedHeightRem = isVideo && mql.matches ? 10 : 8.25;\n if (withFooter && !IS_TOUCH_ENV) {\n occupiedHeightRem = mql.matches ? 10 : 12.5;\n }\n return {\n width: windowWidth,\n height: windowHeight - occupiedHeightRem * REM,\n };\n}\n\nexport function calculateInlineImageDimensions(\n photo: ApiPhoto,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getPhotoInlineDimensions(photo) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n noAvatars,\n });\n}\n\nexport function calculateVideoDimensions(\n video: ApiVideo,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getVideoDimensions(video) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isGif: video.isGif,\n noAvatars,\n });\n}\n\nexport function getPictogramDimensions(): ApiDimensions {\n return {\n width: 2 * REM,\n height: 2 * REM,\n };\n}\n\nexport function getDocumentThumbnailDimensions(smaller?: boolean): ApiDimensions {\n if (smaller) {\n return {\n width: 3 * REM,\n height: 3 * REM,\n };\n }\n\n return {\n width: 3.375 * REM,\n height: 3.375 * REM,\n };\n}\n\nexport function getStickerDimensions(sticker: ApiSticker): ApiDimensions {\n const { width } = sticker;\n let { height } = sticker;\n\n // For some reason this sticker has some weird `height` value\n if (sticker.id === LIKE_STICKER_ID) {\n height = width;\n }\n\n const aspectRatio = (height && width) && height / width;\n const baseWidth = REM * (\n IS_SINGLE_COLUMN_LAYOUT\n ? STICKER_SIZE_INLINE_MOBILE_FACTOR\n : STICKER_SIZE_INLINE_DESKTOP_FACTOR\n );\n const calculatedHeight = aspectRatio ? baseWidth * aspectRatio : baseWidth;\n\n if (aspectRatio && calculatedHeight > baseWidth) {\n return {\n width: Math.round(baseWidth / aspectRatio),\n height: baseWidth,\n };\n }\n\n return {\n width: baseWidth,\n height: calculatedHeight,\n };\n}\n\nexport function calculateMediaViewerDimensions(\n { width, height }: ApiDimensions, withFooter: boolean, isVideo: boolean = false,\n): ApiDimensions {\n const { width: availableWidth, height: availableHeight } = getMediaViewerAvailableDimensions(withFooter, isVideo);\n\n return calculateDimensions(availableWidth, availableHeight, width, height);\n}\n\nexport function calculateDimensions(\n availableWidth: number,\n availableHeight: number,\n mediaWidth: number,\n mediaHeight: number,\n): ApiDimensions {\n const aspectRatio = mediaHeight / mediaWidth;\n const calculatedWidth = Math.min(mediaWidth, availableWidth);\n const calculatedHeight = Math.round(calculatedWidth * aspectRatio);\n\n if (calculatedHeight > availableHeight) {\n return {\n width: Math.round(availableHeight / aspectRatio),\n height: availableHeight,\n };\n }\n\n return {\n width: calculatedWidth,\n height: Math.round(calculatedWidth * aspectRatio),\n };\n}\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport safePlay from '../../../util/safePlay';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport useMedia from '../../../hooks/useMedia';\nimport { ActiveEmojiInteraction } from '../../../global/types';\nimport useFlag from '../../../hooks/useFlag';\nimport { selectLocalAnimatedEmojiEffectByName } from '../../../modules/selectors';\n\nconst WIDTH = {\n large: 160,\n medium: 128,\n small: 104,\n};\nconst INTERACTION_BUNCH_TIME = 1000;\nconst MS_DIVIDER = 1000;\nconst TIME_DEFAULT = 0;\n\nexport default function useAnimatedEmoji(\n size: 'large' | 'medium' | 'small',\n chatId?: string,\n messageId?: number,\n soundId?: string,\n activeEmojiInteractions?: ActiveEmojiInteraction[],\n isOwn?: boolean,\n localEffect?: string,\n emoji?: string,\n) {\n const {\n interactWithAnimatedEmoji, sendEmojiInteraction, sendWatchingEmojiInteraction,\n } = getDispatch();\n\n const hasEffect = localEffect || emoji;\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n // eslint-disable-next-line no-null/no-null\n const audioRef = useRef(null);\n\n const soundMediaData = useMedia(soundId ? `document${soundId}` : undefined, !soundId);\n\n const width = WIDTH[size];\n const style = `width: ${width}px; height: ${width}px;`;\n\n const [playKey, setPlayKey] = useState(String(Math.random()));\n const interactions = useRef(undefined);\n const startedInteractions = useRef(undefined);\n const sendInteractionBunch = useCallback(() => {\n const container = ref.current;\n\n if (!container) return;\n\n sendEmojiInteraction({\n chatId,\n messageId,\n localEffect,\n emoji,\n interactions: interactions.current,\n });\n startedInteractions.current = undefined;\n interactions.current = undefined;\n }, [sendEmojiInteraction, chatId, messageId, localEffect, emoji]);\n\n const play = useCallback(() => {\n setPlayKey(String(Math.random()));\n\n const audio = audioRef.current;\n if (soundMediaData) {\n if (audio) {\n audio.pause();\n audio.remove();\n }\n audioRef.current = new Audio();\n audioRef.current.src = soundMediaData;\n safePlay(audioRef.current);\n audioRef.current.addEventListener('ended', () => {\n audioRef.current = undefined;\n }, { once: true });\n }\n }, [soundMediaData]);\n\n const handleClick = useCallback(() => {\n play();\n\n const container = ref.current;\n\n if (!hasEffect || !container || !messageId || !chatId) {\n return;\n }\n\n const { x, y } = container.getBoundingClientRect();\n\n interactWithAnimatedEmoji({\n localEffect,\n emoji,\n x,\n y,\n startSize: width,\n isReversed: !isOwn,\n });\n\n if (!interactions.current) {\n interactions.current = [];\n startedInteractions.current = performance.now();\n setTimeout(sendInteractionBunch, INTERACTION_BUNCH_TIME);\n }\n\n interactions.current.push(startedInteractions.current\n ? (performance.now() - startedInteractions.current) / MS_DIVIDER\n : TIME_DEFAULT);\n }, [\n chatId, emoji, hasEffect, interactWithAnimatedEmoji, isOwn,\n localEffect, messageId, play, sendInteractionBunch, width,\n ]);\n\n // Set an end anchor for remote activated interaction\n useEffect(() => {\n const container = ref.current;\n\n if (!container || !activeEmojiInteractions) return;\n\n activeEmojiInteractions.forEach(({\n id,\n startSize,\n messageId: interactionMessageId,\n }) => {\n if (startSize || messageId !== interactionMessageId) {\n return;\n }\n\n const { x, y } = container.getBoundingClientRect();\n\n sendWatchingEmojiInteraction({\n id,\n chatId,\n emoticon: localEffect ? selectLocalAnimatedEmojiEffectByName(localEffect) : emoji,\n startSize: width,\n x,\n y,\n isReversed: !isOwn,\n });\n play();\n });\n }, [\n activeEmojiInteractions, chatId, emoji, isOwn, localEffect, messageId, play, sendWatchingEmojiInteraction, width,\n ]);\n\n return {\n playKey,\n ref,\n style,\n width,\n handleClick,\n markAnimationLoaded,\n isAnimationLoaded,\n };\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './ChatFolderModal';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ChatFolderModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ChatFolderModal = useModuleLoader(Bundles.Extra, 'ChatFolderModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ChatFolderModal ? : undefined;\n};\n\nexport default memo(ChatFolderModalAsync);\n","import { useMemo } from '../../../../lib/teact/teact';\n\nexport enum ChatAnimationTypes {\n Move,\n Opacity,\n None,\n}\n\nexport function useChatAnimationType(orderDiffById: Record) {\n return useMemo(() => {\n const orderDiffs = Object.values(orderDiffById);\n const numberOfUp = orderDiffs.filter((diff) => diff < 0).length;\n const numberOfDown = orderDiffs.filter((diff) => diff > 0).length;\n\n return (chatId: string): ChatAnimationTypes => {\n const orderDiff = orderDiffById[chatId];\n if (orderDiff === 0) {\n return ChatAnimationTypes.None;\n }\n\n if (\n orderDiff === Infinity\n || orderDiff === -Infinity\n || (numberOfUp <= numberOfDown && orderDiff < 0)\n || (numberOfDown < numberOfUp && orderDiff > 0)\n ) {\n return ChatAnimationTypes.Opacity;\n }\n\n return ChatAnimationTypes.Move;\n };\n }, [orderDiffById]);\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ShowTransition from '../../ui/ShowTransition';\n\nimport './Badge.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst Badge: FC = ({ chat, isPinned, isMuted }) => {\n const isShown = Boolean(chat.unreadCount || chat.hasUnreadMark || isPinned);\n const className = buildClassName(\n 'Badge',\n isMuted && 'muted',\n isPinned && 'pinned',\n Boolean(chat.unreadCount || chat.hasUnreadMark) && 'unread',\n );\n\n function renderContent() {\n if (chat.unreadCount) {\n if (chat.unreadMentionsCount) {\n return (\n
\n
\n \n
\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n
\n );\n }\n\n return (\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n );\n } else if (chat.hasUnreadMark) {\n return (\n
\n );\n } else if (isPinned) {\n return (\n
\n \n
\n );\n }\n\n return undefined;\n }\n\n return (\n \n {renderContent()}\n \n );\n};\n\nexport default memo(Badge);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport buildClassName from '../../../util/buildClassName';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\n\nimport './ChatCallStatus.scss';\n\ntype OwnProps = {\n isSelected?: boolean;\n isActive?: boolean;\n};\n\nconst ChatCallStatus: FC = ({\n isSelected,\n isActive,\n}) => {\n return (\n
\n
\n
\n
\n
\n
\n
\n );\n};\n\nexport default memo(ChatCallStatus);\n","import React, {\n FC, memo, useCallback, useLayoutEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID, ApiUserStatus,\n} from '../../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n isUserId,\n isActionMessage,\n getPrivateChatUserId,\n getMessageAction,\n getMessageSenderName,\n isChatChannel,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageSticker,\n selectIsChatMuted,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectChatMessage, selectOutgoingStatus, selectDraft, selectCurrentMessageList,\n selectNotifySettings, selectNotifyExceptions, selectUserStatus,\n} from '../../../modules/selectors';\nimport { renderActionMessageText } from '../../common/helpers/renderActionMessageText';\nimport renderText from '../../common/helpers/renderText';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport useMedia from '../../../hooks/useMedia';\nimport { ChatAnimationTypes } from './hooks';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport TypingStatus from '../../common/TypingStatus';\nimport LastMessageMeta from '../../common/LastMessageMeta';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\nimport Badge from './Badge';\nimport ChatFolderModal from '../ChatFolderModal.async';\nimport ChatCallStatus from './ChatCallStatus';\n\nimport './Chat.scss';\n\ntype OwnProps = {\n style?: string;\n chatId: string;\n folderId?: number;\n orderDiff: number;\n animationType: ChatAnimationTypes;\n isPinned?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isMuted?: boolean;\n user?: ApiUser;\n userStatus?: ApiUserStatus;\n actionTargetUserIds?: string[];\n actionTargetMessage?: ApiMessage;\n actionTargetChatId?: string;\n lastMessageSender?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n draft?: ApiFormattedText;\n animationLevel?: number;\n isSelected?: boolean;\n canScrollDown?: boolean;\n canChangeFolder?: boolean;\n lastSyncTime?: number;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Chat: FC = ({\n style,\n chatId,\n folderId,\n orderDiff,\n animationType,\n isPinned,\n chat,\n isMuted,\n user,\n userStatus,\n actionTargetUserIds,\n lastMessageSender,\n lastMessageOutgoingStatus,\n actionTargetMessage,\n actionTargetChatId,\n draft,\n animationLevel,\n isSelected,\n canScrollDown,\n canChangeFolder,\n lastSyncTime,\n}) => {\n const {\n openChat,\n focusLastMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isChatFolderModalOpen, openChatFolderModal, closeChatFolderModal] = useFlag();\n const [shouldRenderDeleteModal, markRenderDeleteModal, unmarkRenderDeleteModal] = useFlag();\n const [shouldRenderChatFolderModal, markRenderChatFolderModal, unmarkRenderChatFolderModal] = useFlag();\n\n const { lastMessage, typingStatus } = chat || {};\n const isAction = lastMessage && isActionMessage(lastMessage);\n\n useEnsureMessage(chatId, isAction ? lastMessage!.replyToMessageId : undefined, actionTargetMessage);\n\n const mediaThumbnail = lastMessage && !getMessageSticker(lastMessage)\n ? getMessageMediaThumbDataUri(lastMessage)\n : undefined;\n const mediaBlobUrl = useMedia(lastMessage ? getMessageMediaHash(lastMessage, 'micro') : undefined);\n const isRoundVideo = Boolean(lastMessage && getMessageRoundVideo(lastMessage));\n\n const actionTargetUsers = useMemo(() => {\n if (!actionTargetUserIds) {\n return undefined;\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n return actionTargetUserIds.map((userId) => usersById[userId]).filter(Boolean as any);\n }, [actionTargetUserIds]);\n\n // Sets animation excess values when `orderDiff` changes and then resets excess values to animate.\n useLayoutEffect(() => {\n const element = ref.current;\n\n if (animationLevel === 0 || !element) {\n return;\n }\n\n // TODO Refactor animation: create `useListAnimation` that owns `orderDiff` and `animationType`\n if (animationType === ChatAnimationTypes.Opacity) {\n element.style.opacity = '0';\n\n fastRaf(() => {\n element.classList.add('animate-opacity');\n element.style.opacity = '1';\n });\n } else if (animationType === ChatAnimationTypes.Move) {\n element.style.transform = `translate3d(0, ${-orderDiff * 100}%, 0)`;\n\n fastRaf(() => {\n element.classList.add('animate-transform');\n element.style.transform = '';\n });\n } else {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n element.classList.remove('animate-opacity', 'animate-transform');\n element.style.opacity = '';\n element.style.transform = '';\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [animationLevel, orderDiff, animationType]);\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, shouldReplaceHistory: true });\n\n if (isSelected && canScrollDown) {\n focusLastMessage();\n }\n }, [\n isSelected,\n canScrollDown,\n openChat,\n chatId,\n focusLastMessage,\n ]);\n\n function handleDelete() {\n markRenderDeleteModal();\n openDeleteModal();\n }\n\n function handleChatFolderChange() {\n markRenderChatFolderModal();\n openChatFolderModal();\n }\n\n const contextActions = useChatContextActions({\n chat,\n user,\n handleDelete,\n handleChatFolderChange,\n folderId,\n isPinned,\n isMuted,\n canChangeFolder,\n });\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderLastMessageOrTyping() {\n if (typingStatus && lastMessage && typingStatus.timestamp > lastMessage.date * 1000) {\n return ;\n }\n\n if (draft?.text.length) {\n return (\n

\n {lang('Draft')}\n {renderText(draft.text)}\n

\n );\n }\n\n if (!lastMessage) {\n return undefined;\n }\n\n if (isAction) {\n const isChat = chat && (isChatChannel(chat) || lastMessage.senderId === lastMessage.chatId);\n\n return (\n

\n {renderActionMessageText(\n lang,\n lastMessage,\n !isChat ? lastMessageSender : undefined,\n isChat ? chat : undefined,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asTextWithSpoilers: true },\n )}\n

\n );\n }\n\n const senderName = getMessageSenderName(lang, chatId, lastMessageSender);\n\n return (\n

\n {senderName && (\n <>\n {renderText(senderName)}\n :\n \n )}\n {renderSummary(lang, lastMessage!, mediaBlobUrl || mediaThumbnail, isRoundVideo)}\n

\n );\n }\n\n const className = buildClassName(\n 'Chat chat-item-clickable',\n isUserId(chatId) ? 'private' : 'group',\n isSelected && 'selected',\n );\n\n return (\n \n
\n \n {chat.isCallActive && chat.isCallNotEmpty && (\n \n )}\n
\n
\n
\n

{renderText(getChatTitle(lang, chat, user))}

\n {chat.isVerified && }\n {isMuted && }\n {chat.lastMessage && (\n \n )}\n
\n
\n {renderLastMessageOrTyping()}\n \n
\n
\n {shouldRenderDeleteModal && (\n \n )}\n {shouldRenderChatFolderModal && (\n \n )}\n \n );\n};\n\nfunction renderSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRoundVideo?: boolean) {\n if (!blobUrl) {\n return renderMessageSummary(lang, message);\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderMessageSummary(lang, message, true)}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return {};\n }\n\n const { senderId, replyToMessageId, isOutgoing } = chat.lastMessage;\n const lastMessageSender = senderId ? selectUser(global, senderId) : undefined;\n const lastMessageAction = getMessageAction(chat.lastMessage);\n const actionTargetMessage = lastMessageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const { targetUserIds: actionTargetUserIds, targetChatId: actionTargetChatId } = lastMessageAction || {};\n const privateChatUserId = getPrivateChatUserId(chat);\n const {\n chatId: currentChatId,\n threadId: currentThreadId,\n type: messageListType,\n } = selectCurrentMessageList(global) || {};\n const isSelected = chatId === currentChatId && currentThreadId === MAIN_THREAD_ID;\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n lastMessageSender,\n actionTargetUserIds,\n actionTargetChatId,\n actionTargetMessage,\n draft: selectDraft(global, chatId, MAIN_THREAD_ID),\n animationLevel: global.settings.byKey.animationLevel,\n isSelected,\n canScrollDown: isSelected && messageListType === 'thread',\n canChangeFolder: Boolean(global.chatFolders.orderedIds?.length),\n lastSyncTime: global.lastSyncTime,\n ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),\n ...(privateChatUserId && {\n user: selectUser(global, privateChatUserId),\n userStatus: selectUserStatus(global, privateChatUserId),\n }),\n };\n },\n)(Chat));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatFolder, ApiSticker } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { selectAnimatedEmoji, selectChatFolder } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\n\nimport './EmptyFolder.scss';\n\ntype OwnProps = {\n folderId?: number;\n folderType: 'all' | 'archived' | 'folder';\n foldersDispatch?: FolderEditDispatch;\n onScreenSelect?: (screen: SettingsScreens) => void;\n};\n\ntype StateProps = {\n chatFolder?: ApiChatFolder;\n animatedEmoji?: ApiSticker;\n};\n\nconst EmptyFolder: FC = ({\n chatFolder, animatedEmoji, foldersDispatch, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleEditFolder = useCallback(() => {\n foldersDispatch!({ type: 'editFolder', payload: chatFolder });\n onScreenSelect!(SettingsScreens.FoldersEditFolderFromChatList);\n }, [chatFolder, foldersDispatch, onScreenSelect]);\n\n return (\n
\n
{animatedEmoji && }
\n

{lang('FilterNoChatsToDisplay')}

\n

\n {lang(chatFolder ? 'ChatList.EmptyChatListFilterText' : 'Chat.EmptyChat')}\n

\n {chatFolder && foldersDispatch && onScreenSelect && (\n \n \n {lang('ChatList.EmptyChatListEditFilter')}\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal((global, { folderId, folderType }): StateProps => {\n const chatFolder = folderId && folderType === 'folder' ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatFolder,\n animatedEmoji: selectAnimatedEmoji(global, '📂'),\n };\n})(EmptyFolder));\n","import React, {\n FC, memo, useMemo, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport {\n ALL_FOLDER_ID,\n ARCHIVED_FOLDER_ID,\n CHAT_HEIGHT_PX,\n CHAT_LIST_SLICE,\n} from '../../../config';\nimport { IS_MAC_OS, IS_PWA } from '../../../util/environment';\nimport { mapValues } from '../../../util/iteratees';\nimport { getPinnedChatsCount } from '../../../util/folderManager';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport { useFolderManagerForOrderedIds } from '../../../hooks/useFolderManager';\nimport { useChatAnimationType } from './hooks';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Loading from '../../ui/Loading';\nimport Chat from './Chat';\nimport EmptyFolder from './EmptyFolder';\n\ntype OwnProps = {\n folderType: 'all' | 'archived' | 'folder';\n folderId?: number;\n isActive: boolean;\n lastSyncTime?: number;\n foldersDispatch?: FolderEditDispatch;\n onScreenSelect?: (screen: SettingsScreens) => void;\n};\n\nconst ChatList: FC = ({\n folderType,\n folderId,\n isActive,\n foldersDispatch,\n onScreenSelect,\n}) => {\n const { openChat, openNextChat } = getDispatch();\n\n const resolvedFolderId = (\n folderType === 'all' ? ALL_FOLDER_ID : folderType === 'archived' ? ARCHIVED_FOLDER_ID : folderId!\n );\n\n const orderedIds = useFolderManagerForOrderedIds(resolvedFolderId);\n\n const orderById = useMemo(() => {\n if (!orderedIds) {\n return undefined;\n }\n\n return orderedIds.reduce((acc, id, i) => {\n acc[id] = i;\n return acc;\n }, {} as Record);\n }, [orderedIds]);\n\n const prevOrderById = usePrevious(orderById);\n\n const orderDiffById = useMemo(() => {\n if (!orderById || !prevOrderById) {\n return {};\n }\n\n return mapValues(orderById, (order, id) => {\n return prevOrderById[id] !== undefined ? order - prevOrderById[id] : -Infinity;\n });\n }, [orderById, prevOrderById]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, orderedIds, undefined, CHAT_LIST_SLICE);\n\n // Support + and + to navigate between chats\n useEffect(() => {\n if (!isActive || !orderedIds) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (IS_PWA && ((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && e.code.startsWith('Digit')) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n const position = Number(digit) - 1;\n if (position > orderedIds!.length - 1) return;\n\n openChat({ id: orderedIds![position], shouldReplaceHistory: true });\n }\n\n if (e.altKey) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (!targetIndexDelta) return;\n\n e.preventDefault();\n openNextChat({ targetIndexDelta, orderedIds });\n }\n }\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [isActive, openChat, openNextChat, orderedIds]);\n\n const getAnimationType = useChatAnimationType(orderDiffById);\n\n function renderChats() {\n const viewportOffset = orderedIds!.indexOf(viewportIds![0]);\n const pinnedCount = getPinnedChatsCount(resolvedFolderId) || 0;\n\n return viewportIds!.map((id, i) => (\n \n ));\n }\n\n return (\n \n {viewportIds?.length ? (\n renderChats()\n ) : viewportIds && !viewportIds.length ? (\n (\n \n )\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(ChatList);\n","import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types';\nimport {\n getChatTitle,\n getSenderTitle,\n isUserId,\n isChatGroup,\n} from '../../../../modules/helpers';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport function getSenderName(\n lang: LangFn, message: ApiMessage, chatsById: Record, usersById: Record,\n) {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n const sender = isUserId(senderId) ? usersById[senderId] : chatsById[senderId];\n\n let senderName = getSenderTitle(lang, sender);\n\n const chat = chatsById[message.chatId];\n if (chat) {\n if (isUserId(senderId) && (sender as ApiUser).isSelf) {\n senderName = `${lang('FromYou')} → ${getChatTitle(lang, chat)}`;\n } else if (isChatGroup(chat)) {\n senderName += ` → ${getChatTitle(lang, chat)}`;\n }\n }\n\n return senderName;\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\n\nimport './DropTarget.scss';\n\nexport type OwnProps = {\n isQuick?: boolean;\n onFileSelect: (e: React.DragEvent) => void;\n};\n\nconst DropTarget: FC = ({ isQuick, onFileSelect }) => {\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n\n const handleDragEnter = () => { markHovered(); };\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget } = e;\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const className = buildClassName(\n 'DropTarget',\n isHovered && 'hovered',\n );\n\n return (\n \n
\n
\n
Drop files here to send them
\n
{isQuick ? 'in a quick way' : 'without compression'}
\n
\n
\n );\n};\n\nexport default memo(DropTarget);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport getFilesFromDataTransferItems from './helpers/getFilesFromDataTransferItems';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport Portal from '../../ui/Portal';\nimport DropTarget from './DropTarget';\n\nimport './DropArea.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withQuick?: boolean;\n onHide: NoneToVoidFunction;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n};\n\nexport enum DropAreaState {\n None = 'none',\n Document = 'document',\n QuickFile = 'quick_file',\n}\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst DropArea: FC = ({\n isOpen, withQuick, onHide, onFileSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\n const prevWithQuick = usePrevious(withQuick);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onHide) : undefined), [isOpen, onHide]);\n\n const handleFilesDrop = useCallback(async (e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n let files: File[] = [];\n\n if (dt.files && dt.files.length > 0 && (!dt.items || !dt.items.length)) {\n files = files.concat(Array.from(dt.files));\n } else if (dt.items && dt.items.length > 0) {\n const folderFiles = await getFilesFromDataTransferItems(dt.items);\n if (folderFiles.length) {\n files = files.concat(folderFiles);\n }\n }\n\n onHide();\n onFileSelect(files, false);\n }, [onFileSelect, onHide]);\n\n const handleQuickFilesDrop = useCallback((e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n\n if (dt.files && dt.files.length > 0) {\n onHide();\n onFileSelect(Array.from(dt.files), true);\n }\n }, [onFileSelect, onHide]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.stopPropagation();\n\n const { target: fromTarget, relatedTarget: toTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.DropTarget, .DropArea') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(() => {\n onHide();\n }, DROP_LEAVE_TIMEOUT_MS);\n }\n }, [onHide]);\n\n const handleDragOver = () => {\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n }\n };\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'DropArea',\n transitionClassNames,\n );\n\n return (\n \n
\n \n {(withQuick || prevWithQuick) && }\n
\n
\n );\n};\n\nexport default memo(DropArea);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './EmojiTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst EmojiTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const EmojiTooltip = useModuleLoader(Bundles.Extra, 'EmojiTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return EmojiTooltip ? : undefined;\n};\n\nexport default memo(EmojiTooltipAsync);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useEffect, useRef, memo, useState, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { IAnchorPosition, ISettings } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { selectReplyingToId } from '../../../modules/selectors';\nimport { debounce } from '../../../util/schedulers';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport buildClassName from '../../../util/buildClassName';\nimport {\n IS_ANDROID, IS_EMOJI_SUPPORTED, IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport useLayoutEffectWithPrevDeps from '../../../hooks/useLayoutEffectWithPrevDeps';\nimport useFlag from '../../../hooks/useFlag';\nimport { isHeavyAnimating } from '../../../hooks/useHeavyAnimationCheck';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\nimport useLang from '../../../hooks/useLang';\nimport parseEmojiOnlyString from '../../common/helpers/parseEmojiOnlyString';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport renderText from '../../common/helpers/renderText';\n\nimport TextFormatter from './TextFormatter';\n\nconst CONTEXT_MENU_CLOSE_DELAY_MS = 100;\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 350;\nconst TRANSITION_DURATION_FACTOR = 50;\n\ntype OwnProps = {\n id: string;\n chatId: string;\n threadId: number;\n isAttachmentModalInput?: boolean;\n editableInputId?: string;\n html: string;\n placeholder: string;\n forcedPlaceholder?: string;\n canAutoFocus: boolean;\n shouldSuppressFocus?: boolean;\n shouldSuppressTextFormatter?: boolean;\n onUpdate: (html: string) => void;\n onSuppressedFocus?: () => void;\n onSend: () => void;\n};\n\ntype StateProps = {\n replyingToId?: number;\n noTabCapture?: boolean;\n messageSendKeyCombo?: ISettings['messageSendKeyCombo'];\n};\n\nconst MAX_INPUT_HEIGHT = IS_SINGLE_COLUMN_LAYOUT ? 256 : 416;\nconst TAB_INDEX_PRIORITY_TIMEOUT = 2000;\nconst TEXT_FORMATTER_SAFE_AREA_PX = 90;\n// For some reason Safari inserts `
` after user removes text from input\nconst SAFARI_BR = '
';\n\nfunction clearSelection() {\n const selection = window.getSelection();\n if (!selection) {\n return;\n }\n\n if (selection.removeAllRanges) {\n selection.removeAllRanges();\n } else if (selection.empty) {\n selection.empty();\n }\n}\n\nconst MessageInput: FC = ({\n id,\n chatId,\n threadId,\n isAttachmentModalInput,\n editableInputId,\n html,\n placeholder,\n forcedPlaceholder,\n canAutoFocus,\n shouldSuppressFocus,\n shouldSuppressTextFormatter,\n replyingToId,\n noTabCapture,\n messageSendKeyCombo,\n onUpdate,\n onSuppressedFocus,\n onSend,\n}) => {\n const {\n editLastMessage,\n replyToNextMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const cloneRef = useRef(null);\n\n const lang = useLang();\n const isContextMenuOpenRef = useRef(false);\n const [isTextFormatterOpen, openTextFormatter, closeTextFormatter] = useFlag();\n const [textFormatterAnchorPosition, setTextFormatterAnchorPosition] = useState();\n const [selectedRange, setSelectedRange] = useState();\n\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n useEffect(() => {\n if (!isAttachmentModalInput) return;\n updateInputHeight(false);\n }, [isAttachmentModalInput]);\n\n useLayoutEffectWithPrevDeps(([prevHtml]) => {\n if (html !== inputRef.current!.innerHTML) {\n inputRef.current!.innerHTML = html;\n }\n\n if (html !== cloneRef.current!.innerHTML) {\n cloneRef.current!.innerHTML = html;\n }\n\n if (prevHtml !== undefined && prevHtml !== html) {\n updateInputHeight(!html.length);\n }\n }, [html]);\n\n const chatIdRef = useRef(chatId);\n chatIdRef.current = chatId;\n const focusInput = useCallback(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (isHeavyAnimating()) {\n setTimeout(focusInput, FOCUS_DELAY_MS);\n return;\n }\n\n focusEditableElement(inputRef.current!);\n }, []);\n\n const handleCloseTextFormatter = useCallback(() => {\n closeTextFormatter();\n clearSelection();\n }, [closeTextFormatter]);\n\n function checkSelection() {\n // Disable the formatter on iOS devices for now.\n if (IS_IOS) {\n return false;\n }\n\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount || isContextMenuOpenRef.current) {\n closeTextFormatter();\n return false;\n }\n\n const selectionRange = selection.getRangeAt(0);\n const selectedText = selectionRange.toString().trim();\n if (\n shouldSuppressTextFormatter\n || !isSelectionInsideInput(selectionRange, editableInputId || EDITABLE_INPUT_ID)\n || !selectedText\n || parseEmojiOnlyString(selectedText)\n || !selectionRange.START_TO_END\n ) {\n closeTextFormatter();\n return false;\n }\n\n return true;\n }\n\n function processSelection() {\n if (!checkSelection()) {\n return;\n }\n\n const selectionRange = window.getSelection()!.getRangeAt(0);\n const selectionRect = selectionRange.getBoundingClientRect();\n const inputRect = inputRef.current!.getBoundingClientRect();\n\n let x = (selectionRect.left + selectionRect.width / 2) - inputRect.left;\n\n if (x < TEXT_FORMATTER_SAFE_AREA_PX) {\n x = TEXT_FORMATTER_SAFE_AREA_PX;\n } else if (x > inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX) {\n x = inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX;\n }\n\n setTextFormatterAnchorPosition({\n x,\n y: selectionRect.top - inputRect.top,\n });\n\n setSelectedRange(selectionRange);\n openTextFormatter();\n }\n\n function handleMouseDown(event: React.MouseEvent) {\n function handleMouseUp() {\n processSelection();\n\n event.target.removeEventListener('mouseup', handleMouseUp);\n }\n\n if (event.button !== 2) {\n event.target.addEventListener('mouseup', handleMouseUp);\n return;\n }\n\n if (isContextMenuOpenRef.current === true) {\n return;\n }\n\n isContextMenuOpenRef.current = true;\n\n function closeContextMenuMouseListener() {\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('mouseup', closeContextMenuMouseListener);\n }\n\n function closeContextMenuKeyListener(e: KeyboardEvent) {\n if (e.key !== 'Esc' && e.key !== 'Escape') {\n return;\n }\n\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('keydown', closeContextMenuKeyListener);\n }\n\n document.addEventListener('mousedown', closeContextMenuMouseListener);\n document.addEventListener('keydown', closeContextMenuKeyListener);\n }\n\n function handleKeyDown(e: React.KeyboardEvent) {\n function handleKeyUp() {\n processSelection();\n\n e.target.removeEventListener('keyup', handleKeyUp);\n }\n\n if (!html.length && (e.metaKey || e.ctrlKey)) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (targetIndexDelta) {\n e.preventDefault();\n\n replyToNextMessage({ targetIndexDelta });\n return;\n }\n }\n\n if (e.key === 'Enter' && !e.shiftKey) {\n if (\n !(IS_IOS || IS_ANDROID)\n && (\n (messageSendKeyCombo === 'enter' && !e.shiftKey)\n || (messageSendKeyCombo === 'ctrl-enter' && (e.ctrlKey || e.metaKey))\n )\n ) {\n e.preventDefault();\n\n closeTextFormatter();\n onSend();\n }\n } else if (e.key === 'ArrowUp' && !html.length && !e.metaKey && !e.ctrlKey && !e.altKey) {\n e.preventDefault();\n editLastMessage();\n } else {\n e.target.addEventListener('keyup', handleKeyUp);\n }\n }\n\n function handleChange(e: ChangeEvent) {\n const { innerHTML, textContent } = e.currentTarget;\n\n onUpdate(innerHTML === SAFARI_BR ? '' : innerHTML);\n sendMessageAction({ type: 'typing' });\n\n // Reset focus on the input to remove any active styling when input is cleared\n if (\n !IS_TOUCH_ENV\n && (!textContent || !textContent.length)\n // When emojis are not supported, innerHTML contains an emoji img tag that doesn't exist in the textContext\n && !(!IS_EMOJI_SUPPORTED && innerHTML.includes('emoji-small'))\n ) {\n const selection = window.getSelection()!;\n if (selection) {\n inputRef.current!.blur();\n selection.removeAllRanges();\n focusEditableElement(inputRef.current!, true);\n }\n }\n }\n\n function stopEvent(e: React.MouseEvent) {\n if (!checkSelection()) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n function updateInputHeight(willSend = false) {\n const input = inputRef.current!;\n const clone = cloneRef.current!;\n const currentHeight = Number(input.style.height.replace('px', ''));\n const newHeight = Math.min(clone.scrollHeight, MAX_INPUT_HEIGHT);\n if (newHeight === currentHeight) {\n return;\n }\n\n const transitionDuration = Math.round(\n TRANSITION_DURATION_FACTOR * Math.log(Math.abs(newHeight - currentHeight)),\n );\n\n const exec = () => {\n input.style.height = `${newHeight}px`;\n input.style.transitionDuration = `${transitionDuration}ms`;\n input.classList.toggle('overflown', clone.scrollHeight > MAX_INPUT_HEIGHT);\n };\n\n if (willSend) {\n // Sync with sending animation\n requestAnimationFrame(exec);\n } else {\n exec();\n }\n }\n\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n if (canAutoFocus) {\n focusInput();\n }\n }, [chatId, focusInput, replyingToId, canAutoFocus]);\n\n useEffect(() => {\n if (noTabCapture) {\n return undefined;\n }\n\n const captureFirstTab = debounce((e: KeyboardEvent) => {\n if (e.key === 'Tab') {\n e.preventDefault();\n requestAnimationFrame(focusInput);\n }\n }, TAB_INDEX_PRIORITY_TIMEOUT, true, false);\n\n return captureKeyboardListeners({ onTab: captureFirstTab });\n }, [focusInput, noTabCapture]);\n\n useEffect(() => {\n const input = inputRef.current!;\n\n function suppressFocus() {\n input.blur();\n }\n\n if (shouldSuppressFocus) {\n input.addEventListener('focus', suppressFocus);\n }\n\n return () => {\n input.removeEventListener('focus', suppressFocus);\n };\n }, [shouldSuppressFocus]);\n\n const className = buildClassName(\n 'form-control custom-scroll',\n html.length > 0 && 'touched',\n shouldSuppressFocus && 'focus-disabled',\n );\n\n return (\n
\n \n
\n {!forcedPlaceholder && {placeholder}}\n \n {forcedPlaceholder && {renderText(forcedPlaceholder!)}}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId }: OwnProps): StateProps => {\n const { messageSendKeyCombo } = global.settings.byKey;\n\n return {\n messageSendKeyCombo,\n replyingToId: chatId && threadId ? selectReplyingToId(global, chatId, threadId) : undefined,\n noTabCapture: global.isPollModalOpen || global.payment.isPaymentModalOpen,\n };\n },\n)(MessageInput));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { IAnchorPosition } from '../../../types';\nimport { ApiMessageEntityTypes } from '../../../api/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport buildClassName from '../../../util/buildClassName';\nimport { ensureProtocol } from '../../../util/ensureProtocol';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport getKeyFromEvent from '../../../util/getKeyFromEvent';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useVirtualBackdrop from '../../../hooks/useVirtualBackdrop';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './TextFormatter.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n anchorPosition?: IAnchorPosition;\n selectedRange?: Range;\n setSelectedRange: (range: Range) => void;\n onClose: () => void;\n};\n\ninterface ISelectedTextFormats {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n monospace?: boolean;\n spoiler?: boolean;\n}\n\nconst TEXT_FORMAT_BY_TAG_NAME: Record = {\n B: 'bold',\n STRONG: 'bold',\n I: 'italic',\n EM: 'italic',\n U: 'underline',\n DEL: 'strikethrough',\n CODE: 'monospace',\n SPAN: 'spoiler',\n};\nconst fragmentEl = document.createElement('div');\n\nconst TextFormatter: FC = ({\n isOpen,\n anchorPosition,\n selectedRange,\n setSelectedRange,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const linkUrlInputRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n const [isLinkControlOpen, openLinkControl, closeLinkControl] = useFlag();\n const [linkUrl, setLinkUrl] = useState('');\n const [isEditingLink, setIsEditingLink] = useState(false);\n const [inputClassName, setInputClassName] = useState();\n const [selectedTextFormats, setSelectedTextFormats] = useState({});\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClose) : undefined), [isOpen, onClose]);\n useVirtualBackdrop(\n isOpen,\n containerRef,\n onClose,\n );\n\n useEffect(() => {\n if (isLinkControlOpen) {\n linkUrlInputRef.current!.focus();\n } else {\n setLinkUrl('');\n setIsEditingLink(false);\n }\n }, [isLinkControlOpen]);\n\n useEffect(() => {\n if (!shouldRender) {\n closeLinkControl();\n setSelectedTextFormats({});\n setInputClassName(undefined);\n }\n }, [closeLinkControl, shouldRender]);\n\n useEffect(() => {\n if (!isOpen || !selectedRange) {\n return;\n }\n\n const selectedFormats: ISelectedTextFormats = {};\n let { parentElement } = selectedRange.commonAncestorContainer;\n while (parentElement && parentElement.id !== EDITABLE_INPUT_ID) {\n const textFormat = TEXT_FORMAT_BY_TAG_NAME[parentElement.tagName];\n if (textFormat) {\n selectedFormats[textFormat] = true;\n }\n\n parentElement = parentElement.parentElement;\n }\n\n setSelectedTextFormats(selectedFormats);\n }, [isOpen, selectedRange, openLinkControl]);\n\n function restoreSelection() {\n if (!selectedRange) {\n return;\n }\n\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(selectedRange);\n }\n }\n\n const updateSelectedRange = useCallback(() => {\n const selection = window.getSelection();\n if (selection) {\n setSelectedRange(selection.getRangeAt(0));\n }\n }, [setSelectedRange]);\n\n const getSelectedText = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n fragmentEl.innerText = selectedRange.toString();\n\n return fragmentEl.innerHTML;\n }, [selectedRange]);\n\n const getSelectedElement = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n\n return selectedRange.commonAncestorContainer.parentElement;\n }, [selectedRange]);\n\n function updateInputStyles() {\n const input = linkUrlInputRef.current;\n if (!input) {\n return;\n }\n\n const { offsetWidth, scrollWidth, scrollLeft } = input;\n if (scrollWidth <= offsetWidth) {\n setInputClassName(undefined);\n return;\n }\n\n let className = '';\n if (scrollLeft < scrollWidth - offsetWidth) {\n className = 'mask-right';\n }\n if (scrollLeft > 0) {\n className += ' mask-left';\n }\n\n setInputClassName(className);\n }\n\n function handleLinkUrlChange(e: React.ChangeEvent) {\n setLinkUrl(e.target.value);\n updateInputStyles();\n }\n\n function getFormatButtonClassName(key: keyof ISelectedTextFormats) {\n if (selectedTextFormats[key]) {\n return 'active';\n }\n\n if (key === 'monospace' || key === 'strikethrough') {\n if (Object.keys(selectedTextFormats).some(\n (fKey) => fKey !== key && Boolean(selectedTextFormats[fKey as keyof ISelectedTextFormats]),\n )) {\n return 'disabled';\n }\n } else if (selectedTextFormats.monospace || selectedTextFormats.strikethrough) {\n return 'disabled';\n }\n\n return undefined;\n }\n\n const handleSpoilerText = useCallback(() => {\n if (selectedTextFormats.spoiler) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.dataset.entityType !== ApiMessageEntityTypes.Spoiler\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n spoiler: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand(\n 'insertHTML', false, `${text}`,\n );\n onClose();\n }, [getSelectedElement, getSelectedText, onClose, selectedRange, selectedTextFormats.spoiler]);\n\n const handleBoldText = useCallback(() => {\n setSelectedTextFormats((selectedFormats) => {\n // Somehow re-applying 'bold' command to already bold text doesn't work\n document.execCommand(selectedFormats.bold ? 'removeFormat' : 'bold');\n Object.keys(selectedFormats).forEach((key) => {\n if ((key === 'italic' || key === 'underline') && Boolean(selectedFormats[key])) {\n document.execCommand(key);\n }\n });\n\n updateSelectedRange();\n return {\n ...selectedFormats,\n bold: !selectedFormats.bold,\n };\n });\n }, [updateSelectedRange]);\n\n const handleItalicText = useCallback(() => {\n document.execCommand('italic');\n updateSelectedRange();\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n italic: !selectedFormats.italic,\n }));\n }, [updateSelectedRange]);\n\n const handleUnderlineText = useCallback(() => {\n document.execCommand('underline');\n updateSelectedRange();\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n underline: !selectedFormats.underline,\n }));\n }, [updateSelectedRange]);\n\n const handleStrikethroughText = useCallback(() => {\n if (selectedTextFormats.strikethrough) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'DEL'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n strikethrough: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose, selectedRange, selectedTextFormats.strikethrough,\n ]);\n\n const handleMonospaceText = useCallback(() => {\n if (selectedTextFormats.monospace) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'CODE'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n monospace: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose, selectedRange, selectedTextFormats.monospace,\n ]);\n\n function handleLinkUrlConfirm() {\n const formattedLinkUrl = encodeURI(ensureProtocol(linkUrl) || '');\n\n if (isEditingLink) {\n const element = getSelectedElement();\n if (!element || element.tagName !== 'A') {\n return;\n }\n\n (element as HTMLAnchorElement).href = formattedLinkUrl;\n\n onClose();\n\n return;\n }\n\n const text = getSelectedText();\n restoreSelection();\n document.execCommand(\n 'insertHTML',\n false,\n `${text}`,\n );\n onClose();\n }\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n const HANDLERS_BY_KEY: Record = {\n k: openLinkControl,\n b: handleBoldText,\n u: handleUnderlineText,\n i: handleItalicText,\n m: handleMonospaceText,\n s: handleStrikethroughText,\n p: handleSpoilerText,\n };\n\n const handler = HANDLERS_BY_KEY[getKeyFromEvent(e)];\n\n if (\n e.altKey\n || !(e.ctrlKey || e.metaKey)\n || !handler\n ) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n handler();\n }, [\n openLinkControl, handleBoldText, handleUnderlineText, handleItalicText, handleMonospaceText,\n handleStrikethroughText, handleSpoilerText,\n ]);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('keydown', handleKeyDown);\n }\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, handleKeyDown]);\n\n const lang = useLang();\n\n function handleContainerKeyDown(e: React.KeyboardEvent) {\n if (e.key === 'Enter' && isLinkControlOpen) {\n handleLinkUrlConfirm();\n e.preventDefault();\n }\n }\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'TextFormatter',\n transitionClassNames,\n isLinkControlOpen && 'link-control-shown',\n );\n\n const linkUrlConfirmClassName = buildClassName(\n 'TextFormatter-link-url-confirm',\n Boolean(linkUrl.length) && 'shown',\n );\n\n const style = anchorPosition\n ? `left: ${anchorPosition.x}px; top: ${anchorPosition.y}px;--text-formatter-left: ${anchorPosition.x}px;`\n : '';\n\n return (\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\nexport default memo(TextFormatter);\n","export default async function getFilesFromDataTransferItems(dataTransferItems: DataTransferItemList) {\n const files: File[] = [];\n\n function traverseFileTreePromise(entry: FileSystemEntry | File, item: DataTransferItem) {\n return new Promise(resolve => {\n if (entry instanceof File) {\n files.push(entry);\n resolve(entry);\n } else if (entry.isFile) {\n const itemFile = item.getAsFile();\n (entry as FileSystemFileEntry).file((file) => {\n files.push(file);\n resolve(file);\n }, () => {\n // iOS Safari throws an error \"NotFoundError: Path does not exist\" for files from the clipboard\n // https://stackoverflow.com/a/50059309\n if (itemFile) {\n files.push(itemFile);\n }\n resolve(itemFile);\n });\n } else if (entry.isDirectory) {\n let dirReader = (entry as FileSystemDirectoryEntry).createReader();\n dirReader.readEntries((entries) => {\n let entriesPromises = [];\n for (let entr of entries) {\n entriesPromises.push(traverseFileTreePromise(entr, item));\n }\n resolve(Promise.all(entriesPromises));\n });\n }\n });\n }\n\n let entriesPromises = [];\n for (let item of dataTransferItems) {\n if (item.kind === 'file') {\n const entry = item.webkitGetAsEntry() || item.getAsFile();\n if (entry) {\n entriesPromises.push(traverseFileTreePromise(entry, item));\n }\n }\n }\n\n await Promise.all(entriesPromises);\n\n return files;\n}\n\n","const RE_BR = /(
|)/g;\nconst RE_SPACE = /( |\\u00A0)/g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\nconst RE_EXTRA_NEW_LINE = /\\n$/i;\n\nexport function prepareForRegExp(html: string) {\n return html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .replace(RE_EXTRA_NEW_LINE, '');\n}\n","const MAX_NESTING_PARENTS = 5;\n\nexport function isSelectionInsideInput(selectionRange: Range, inputId: string) {\n const { commonAncestorContainer } = selectionRange;\n let parentNode: HTMLElement | null = commonAncestorContainer as HTMLElement;\n let iterations = 1;\n while (parentNode && parentNode.id !== inputId && iterations < MAX_NESTING_PARENTS) {\n parentNode = parentNode.parentElement;\n iterations++;\n }\n\n return Boolean(parentNode && parentNode.id === inputId);\n}\n","import { areSortedArraysEqual } from './iteratees';\n\nconst cache = new WeakMap();\n\nexport default function memoized(fn: T) {\n return (...args: Parameters): ReturnType => {\n const cached = cache.get(fn);\n if (cached && areSortedArraysEqual(cached.lastArgs, args)) {\n return cached.lastResult;\n }\n\n const result = fn(...args);\n cache.set(fn, { lastArgs: args, lastResult: result });\n return result;\n };\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../../util/memo';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport {\n EmojiData, EmojiModule, EmojiRawData, uncompressEmoji,\n} from '../../../../util/emoji';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport {\n buildCollectionByKey, flatten, mapValues, pickTruthy, unique,\n} from '../../../../util/iteratees';\nimport memoized from '../../../../util/memoized';\nimport useFlag from '../../../../hooks/useFlag';\nimport renderText from '../../../common/helpers/renderText';\n\ninterface Library {\n keywords: string[];\n byKeyword: Record;\n names: string[];\n byName: Record;\n}\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nlet RE_EMOJI_SEARCH: RegExp;\nconst EMOJIS_LIMIT = 36;\nconst FILTER_MIN_LENGTH = 2;\n\nconst prepareRecentEmojisMemo = memoized(prepareRecentEmojis);\nconst prepareLibraryMemo = memoized(prepareLibrary);\nconst searchInLibraryMemo = memoized(searchInLibrary);\n\ntry {\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\p{L}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useEmojiTooltip(\n isAllowed: boolean,\n htmlRef: { current: string },\n recentEmojiIds: string[],\n inputId = EDITABLE_INPUT_ID,\n onUpdateHtml: (html: string) => void,\n baseEmojiKeywords?: Record,\n emojiKeywords?: Record,\n isDisabled = false,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [byId, setById] = useState | undefined>();\n const [shouldForceInsertEmoji, setShouldForceInsertEmoji] = useState(false);\n const [filteredEmojis, setFilteredEmojis] = useState(MEMO_EMPTY_ARRAY);\n\n // Initialize data on first render.\n useEffect(() => {\n if (isDisabled) return;\n const exec = () => {\n setById(emojiData.emojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, [isDisabled]);\n\n const html = htmlRef.current;\n useEffect(() => {\n if (!isAllowed || !html || !byId || isDisabled) {\n unmarkIsOpen();\n return;\n }\n\n const code = html.includes(':') && getEmojiCode(html);\n if (!code) {\n setFilteredEmojis(MEMO_EMPTY_ARRAY);\n unmarkIsOpen();\n return;\n }\n\n const forceSend = code.length > 2 && code.endsWith(':');\n const filter = code.substr(1, forceSend ? code.length - 2 : undefined);\n let matched: Emoji[] = MEMO_EMPTY_ARRAY;\n\n setShouldForceInsertEmoji(forceSend);\n\n if (!filter) {\n matched = prepareRecentEmojisMemo(byId, recentEmojiIds, EMOJIS_LIMIT);\n } else if (filter.length >= FILTER_MIN_LENGTH) {\n const library = prepareLibraryMemo(byId, baseEmojiKeywords, emojiKeywords);\n matched = searchInLibraryMemo(library, filter, EMOJIS_LIMIT);\n }\n\n if (matched.length) {\n if (!forceSend) {\n markIsOpen();\n }\n setFilteredEmojis(matched);\n } else {\n unmarkIsOpen();\n }\n }, [\n byId, html, isAllowed, markIsOpen, recentEmojiIds, unmarkIsOpen, setShouldForceInsertEmoji,\n isDisabled, baseEmojiKeywords, emojiKeywords,\n ]);\n\n const insertEmoji = useCallback((textEmoji: string, isForce?: boolean) => {\n const currentHtml = htmlRef.current;\n const atIndex = currentHtml.lastIndexOf(':', isForce ? currentHtml.lastIndexOf(':') - 1 : undefined);\n if (atIndex !== -1) {\n onUpdateHtml(`${currentHtml.substr(0, atIndex)}${renderText(textEmoji, ['emoji_html'])}`);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, true, true);\n });\n }\n\n unmarkIsOpen();\n }, [htmlRef, inputId, onUpdateHtml, unmarkIsOpen]);\n\n useEffect(() => {\n if (isOpen && shouldForceInsertEmoji && filteredEmojis.length) {\n insertEmoji(filteredEmojis[0].native, true);\n }\n }, [filteredEmojis, insertEmoji, isOpen, shouldForceInsertEmoji]);\n\n return {\n isEmojiTooltipOpen: isOpen,\n closeEmojiTooltip: unmarkIsOpen,\n filteredEmojis,\n insertEmoji,\n };\n}\n\nfunction getEmojiCode(html: string) {\n const emojis = prepareForRegExp(html).match(RE_EMOJI_SEARCH);\n\n return emojis ? emojis[0].trim() : undefined;\n}\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n\nfunction prepareRecentEmojis(byId: Record, recentEmojiIds: string[], limit: number) {\n if (!byId || !recentEmojiIds.length) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return Object.values(pickTruthy(byId, recentEmojiIds)).slice(0, limit);\n}\n\nfunction prepareLibrary(\n byId: Record,\n baseEmojiKeywords?: Record,\n emojiKeywords?: Record,\n): Library {\n const emojis = Object.values(byId);\n\n const byNative = buildCollectionByKey(emojis, 'native');\n const baseEmojisByKeyword = baseEmojiKeywords\n ? mapValues(baseEmojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n const emojisByKeyword = emojiKeywords\n ? mapValues(emojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n\n const byKeyword = { ...baseEmojisByKeyword, ...emojisByKeyword };\n const keywords = ([] as string[]).concat(Object.keys(baseEmojisByKeyword), Object.keys(emojisByKeyword));\n\n const byName = emojis.reduce((result, emoji) => {\n emoji.names.forEach((name) => {\n if (!result[name]) {\n result[name] = [];\n }\n\n result[name].push(emoji);\n });\n\n return result;\n }, {} as Record);\n\n const names = Object.keys(byName);\n\n return {\n byKeyword,\n keywords,\n byName,\n names,\n };\n}\n\nfunction searchInLibrary(library: Library, filter: string, limit: number) {\n const {\n byKeyword, keywords, byName, names,\n } = library;\n\n let matched: Emoji[] = MEMO_EMPTY_ARRAY;\n\n const matchedKeywords = keywords.filter((keyword) => keyword.startsWith(filter)).sort();\n matched = matched.concat(flatten(Object.values(pickTruthy(byKeyword!, matchedKeywords))));\n\n // Also search by names, which is useful for non-English languages\n const matchedNames = names.filter((name) => name.startsWith(filter));\n matched = matched.concat(flatten(Object.values(pickTruthy(byName, matchedNames))));\n\n matched = unique(matched);\n\n return matched.slice(0, limit);\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\nimport { getGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types';\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { filterUsersByName, getUserFirstOrLastName } from '../../../../modules/helpers';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport useFlag from '../../../../hooks/useFlag';\nimport { pickTruthy, unique } from '../../../../util/iteratees';\nimport { throttle } from '../../../../util/schedulers';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nlet RE_USERNAME_SEARCH: RegExp;\n\ntry {\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\p{L}\\\\p{M}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useMentionTooltip(\n canSuggestMembers: boolean | undefined,\n htmlRef: { current: string },\n onUpdateHtml: (html: string) => void,\n inputId: string = EDITABLE_INPUT_ID,\n groupChatMembers?: ApiChatMember[],\n topInlineBotIds?: string[],\n currentUserId?: string,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [usersToMention, setUsersToMention] = useState();\n\n const updateFilteredUsers = useCallback((filter, withInlineBots: boolean) => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n if (!(groupChatMembers || topInlineBotIds) || !usersById) {\n setUsersToMention(undefined);\n\n return;\n }\n\n runThrottled(() => {\n const memberIds = groupChatMembers?.reduce((acc: string[], member) => {\n if (member.userId !== currentUserId) {\n acc.push(member.userId);\n }\n\n return acc;\n }, []);\n\n const filteredIds = filterUsersByName(unique([\n ...((withInlineBots && topInlineBotIds) || []),\n ...(memberIds || []),\n ]), usersById, filter);\n\n setUsersToMention(Object.values(pickTruthy(usersById, filteredIds)));\n });\n }, [currentUserId, groupChatMembers, topInlineBotIds]);\n\n const html = htmlRef.current;\n useEffect(() => {\n if (!canSuggestMembers || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const usernameFilter = html.includes('@') && getUsernameFilter(html);\n\n if (usernameFilter) {\n const filter = usernameFilter ? usernameFilter.substr(1) : '';\n updateFilteredUsers(filter, canSuggestInlineBots(html));\n } else {\n unmarkIsOpen();\n }\n }, [canSuggestMembers, updateFilteredUsers, markIsOpen, unmarkIsOpen, html]);\n\n useEffect(() => {\n if (usersToMention?.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [markIsOpen, unmarkIsOpen, usersToMention]);\n\n const insertMention = useCallback((user: ApiUser, forceFocus = false) => {\n if (!user.username && !getUserFirstOrLastName(user)) {\n return;\n }\n\n const insertedHtml = user.username\n ? `@${user.username}`\n : `${getUserFirstOrLastName(user)}`;\n\n const currentHtml = htmlRef.current;\n const atIndex = currentHtml.lastIndexOf('@');\n if (atIndex !== -1) {\n onUpdateHtml(`${currentHtml.substr(0, atIndex)}${insertedHtml} `);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, forceFocus);\n });\n }\n\n unmarkIsOpen();\n }, [htmlRef, inputId, onUpdateHtml, unmarkIsOpen]);\n\n return {\n isMentionTooltipOpen: isOpen,\n closeMentionTooltip: unmarkIsOpen,\n insertMention,\n mentionFilteredUsers: usersToMention,\n };\n}\n\nfunction getUsernameFilter(html: string) {\n const username = prepareForRegExp(html).match(RE_USERNAME_SEARCH);\n\n return username ? username[0].trim() : undefined;\n}\n\nfunction canSuggestInlineBots(html: string) {\n return html.startsWith('@');\n}\n","import { useEffect, useRef } from '../../../lib/teact/teact';\n\nimport useOnChange from '../../../hooks/useOnChange';\nimport useForceUpdate from '../../../hooks/useForceUpdate';\n\nexport default function useAsyncRendering(dependencies: T, delay?: number) {\n const isDisabled = delay === undefined;\n const shouldRenderRef = useRef(isDisabled);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n if (isDisabled) {\n return;\n }\n\n shouldRenderRef.current = false;\n\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, dependencies);\n\n useEffect(() => {\n if (isDisabled || shouldRenderRef.current) {\n return;\n }\n\n const exec = () => {\n shouldRenderRef.current = true;\n forceUpdate();\n };\n\n if (delay! > 0) {\n timeoutRef.current = window.setTimeout(exec, delay);\n } else {\n exec();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return shouldRenderRef.current;\n}\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, memo, useState,\n} from '../../lib/teact/teact';\n\nimport Checkbox from './Checkbox';\n\ntype IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n};\n\ntype OwnProps = {\n id?: string;\n options: IRadioOption[];\n selected?: string[];\n disabled?: boolean;\n round?: boolean;\n loadingOptions?: string[];\n onChange: (value: string[]) => void;\n};\n\nconst CheckboxGroup: FC = ({\n id,\n options,\n selected = [],\n disabled,\n round,\n loadingOptions,\n onChange,\n}) => {\n const [values, setValues] = useState(selected || []);\n\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value, checked } = event.currentTarget;\n let newValues: string[];\n if (checked) {\n newValues = [...values, value];\n } else {\n newValues = values.filter((v) => v !== value);\n }\n\n setValues(newValues);\n onChange(newValues);\n }, [onChange, values]);\n\n return (\n
\n {options.map((option) => (\n \n ))}\n
\n );\n};\n\nexport default memo(CheckboxGroup);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\nimport './FloatingActionButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n className?: string;\n color?: ButtonProps['color'];\n ariaLabel?: ButtonProps['ariaLabel'];\n disabled?: boolean;\n onClick: () => void;\n children: React.ReactNode;\n};\n\nconst FloatingActionButton: FC = ({\n isShown,\n className,\n color = 'primary',\n ariaLabel,\n disabled,\n onClick,\n children,\n}) => {\n const buttonClassName = buildClassName(\n 'FloatingActionButton',\n isShown && 'revealed',\n className,\n );\n\n return (\n \n {children}\n \n );\n};\n\nexport default FloatingActionButton;\n","import { RefObject } from 'react';\nimport React, { FC, useRef, useCallback } from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport useContextMenuPosition from '../../hooks/useContextMenuPosition';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from './RippleEffect';\nimport Menu from './Menu';\nimport MenuItem from './MenuItem';\nimport Button from './Button';\n\nimport './ListItem.scss';\n\ninterface MenuItemContextAction {\n title: string;\n icon: string;\n destructive?: boolean;\n handler?: () => void;\n}\n\ninterface OwnProps {\n ref?: RefObject;\n buttonRef?: RefObject;\n icon?: string;\n secondaryIcon?: string;\n className?: string;\n style?: string;\n children: React.ReactNode;\n disabled?: boolean;\n ripple?: boolean;\n narrow?: boolean;\n inactive?: boolean;\n focus?: boolean;\n destructive?: boolean;\n multiline?: boolean;\n isStatic?: boolean;\n contextActions?: MenuItemContextAction[];\n onMouseDown?: (e: React.MouseEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n onSecondaryIconClick?: (e: React.MouseEvent) => void;\n}\n\nconst ListItem: FC = ({\n ref,\n buttonRef,\n icon,\n secondaryIcon,\n className,\n style,\n children,\n disabled,\n ripple,\n narrow,\n inactive,\n focus,\n destructive,\n multiline,\n isStatic,\n contextActions,\n onMouseDown,\n onClick,\n onSecondaryIconClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n const [isTouched, markIsTouched, unmarkIsTouched] = useFlag();\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(containerRef, !contextActions);\n\n const getTriggerElement = useCallback(() => containerRef.current, []);\n\n const getRootElement = useCallback(\n () => containerRef.current!.closest('.custom-scroll'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => containerRef.current!.querySelector('.ListItem-context-menu .bubble'),\n [],\n );\n\n const {\n positionX, positionY, transformOriginX, transformOriginY, style: menuStyle,\n } = useContextMenuPosition(\n contextMenuPosition,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n );\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n return;\n }\n onClick(e);\n\n if (IS_TOUCH_ENV && !ripple) {\n markIsTouched();\n fastRaf(unmarkIsTouched);\n }\n }, [disabled, markIsTouched, onClick, ripple, unmarkIsTouched]);\n\n const handleSecondaryIconClick = (e: React.MouseEvent) => {\n if (disabled || e.button !== 0 || (!onSecondaryIconClick && !contextActions)) return;\n e.stopPropagation();\n if (onSecondaryIconClick) {\n onSecondaryIconClick(e);\n } else {\n handleContextMenu(e);\n }\n };\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (inactive || IS_TOUCH_ENV) {\n return;\n }\n if (contextActions && (e.button === 2 || !onClick)) {\n handleBeforeContextMenu(e);\n }\n if (e.button === 0) {\n if (!onClick) {\n handleContextMenu(e);\n } else {\n handleClick(e);\n }\n }\n }, [inactive, contextActions, onClick, handleBeforeContextMenu, handleContextMenu, handleClick]);\n\n const lang = useLang();\n\n const fullClassName = buildClassName(\n 'ListItem',\n className,\n !isStatic && 'no-selection',\n ripple && 'has-ripple',\n narrow && 'narrow',\n disabled && 'disabled',\n inactive && 'inactive',\n contextMenuPosition && 'has-menu-open',\n focus && 'focus',\n destructive && 'destructive',\n multiline && 'multiline',\n isStatic && 'is-static',\n );\n\n return (\n \n \n {icon && (\n \n )}\n {multiline && (
{children}
)}\n {!multiline && children}\n {!disabled && !inactive && ripple && (\n \n )}\n {secondaryIcon && (\n \n \n \n )}\n
\n {contextActions && contextMenuPosition !== undefined && (\n \n {contextActions.map((action) => (\n \n {action.title}\n \n ))}\n \n )}\n
\n );\n};\n\nexport default ListItem;\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport buildClassName from '../../util/buildClassName';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport Portal from './Portal';\n\nimport './Notification.scss';\n\ntype OwnProps = {\n containerId?: string;\n message: TextPart[];\n duration?: number;\n onDismiss: () => void;\n};\n\nconst DEFAULT_DURATION = 3000;\nconst ANIMATION_DURATION = 150;\n\nconst Notification: FC = ({\n message, duration = DEFAULT_DURATION, containerId, onDismiss,\n}) => {\n const [isOpen, setIsOpen] = useState(true);\n // eslint-disable-next-line no-null/no-null\n const timerRef = useRef(null);\n\n const { transitionClassNames } = useShowTransition(isOpen);\n\n const closeAndDismiss = useCallback(() => {\n setIsOpen(false);\n setTimeout(onDismiss, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [onDismiss]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(closeAndDismiss) : undefined), [isOpen, closeAndDismiss]);\n\n useEffect(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n };\n }, [duration, closeAndDismiss]);\n\n const handleMouseEnter = useCallback(() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n }, [duration, closeAndDismiss]);\n\n return (\n \n \n
\n {message}\n
\n
\n \n );\n};\n\nexport default Notification;\n","import React, {\n FC, useEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './ProgressSpinner.scss';\n\nconst RADIUSES = {\n s: 22, m: 25, l: 28, xl: 20,\n};\nconst STROKE_WIDTH = 2;\nconst MIN_PROGRESS = 0.05;\nconst MAX_PROGRESS = 1;\n\nconst ProgressSpinner: FC<{\n progress?: number;\n size?: 's' | 'm' | 'l' | 'xl';\n square?: boolean;\n transparent?: boolean;\n noCross?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n}> = ({\n progress = 0,\n size = 'l',\n square,\n transparent,\n noCross,\n onClick,\n}) => {\n const radius = RADIUSES[size];\n const circleRadius = radius - STROKE_WIDTH * 2;\n const borderRadius = radius - 1;\n const circumference = circleRadius * 2 * Math.PI;\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n\n useEffect(() => {\n if (!container.current) {\n return;\n }\n\n const svg = container.current.firstElementChild;\n const strokeDashOffset = circumference - Math.min(Math.max(MIN_PROGRESS, progress), MAX_PROGRESS) * circumference;\n\n if (!svg) {\n container.current.innerHTML = `\n \n `;\n } else {\n (svg.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n }, [container, circumference, borderRadius, circleRadius, progress]);\n\n const className = buildClassName(\n `ProgressSpinner size-${size}`,\n transparent && 'transparent',\n square && 'square',\n noCross && 'no-cross',\n );\n\n return (\n \n );\n};\n\nexport default memo(ProgressSpinner);\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from './Spinner';\n\nimport './Radio.scss';\n\ntype OwnProps = {\n id?: string;\n name: string;\n label: string;\n subLabel?: string;\n value: string;\n checked: boolean;\n disabled?: boolean;\n hidden?: boolean;\n isLoading?: boolean;\n onChange: (e: ChangeEvent) => void;\n};\n\nconst Radio: FC = ({\n id,\n label,\n subLabel,\n value,\n name,\n checked,\n disabled,\n hidden,\n isLoading,\n onChange,\n}) => {\n const lang = useLang();\n const className = buildClassName(\n 'Radio',\n disabled && 'disabled',\n hidden && 'hidden-widget',\n isLoading && 'loading',\n );\n\n return (\n \n );\n};\n\nexport default memo(Radio);\n","import { ChangeEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport Radio from './Radio';\n\nexport type IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n hidden?: boolean;\n};\n\ntype OwnProps = {\n id?: string;\n name: string;\n options: IRadioOption[];\n selected?: string;\n disabled?: boolean;\n loadingOption?: string;\n onChange: (value: string) => void;\n};\n\nconst RadioGroup: FC = ({\n id,\n name,\n options,\n selected,\n disabled,\n loadingOption,\n onChange,\n}) => {\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value } = event.currentTarget;\n onChange(value);\n }, [onChange]);\n\n return (\n
\n {options.map((option) => (\n
\n );\n};\n\nexport default memo(RadioGroup);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, useMemo, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './RangeSlider.scss';\n\ntype OwnProps = {\n options?: string[];\n min?: number;\n max?: number;\n step?: number;\n label?: string;\n value: number;\n renderValue?: (value: number) => string;\n disabled?: boolean;\n onChange: (value: number) => void;\n};\n\nconst RangeSlider: FC = ({\n options,\n min = 0,\n max = options ? options.length - 1 : 100,\n step = 1,\n label,\n value,\n renderValue,\n disabled,\n onChange,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n onChange(Number(event.currentTarget.value));\n }, [onChange]);\n\n const className = buildClassName(\n 'RangeSlider',\n disabled && 'disabled',\n );\n\n const trackWidth = useMemo(() => {\n if (options) {\n return (value / (options.length - 1)) * 100;\n } else {\n const possibleValuesLength = (max - min) / step;\n return ((value - min) / possibleValuesLength) * 100;\n }\n }, [options, value, max, min, step]);\n\n return (\n
\n {label && (\n
\n {label}\n {!options && (\n {renderValue ? renderValue(value) : value}\n )}\n
\n )}\n
\n \n \n {options && (\n
\n {options.map((option, index) => (\n onChange(index)}\n >\n {option}\n
\n ))}\n
\n )}\n
\n
\n );\n};\n\nexport default memo(RangeSlider);\n","import { RefObject } from 'react';\nimport React, {\n FC, useRef, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\nimport useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen';\n\nimport Loading from './Loading';\nimport Button from './Button';\nimport ShowTransition from './ShowTransition';\n\nimport './SearchInput.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n children?: React.ReactNode;\n parentContainerClassName?: string;\n className?: string;\n inputId?: string;\n value?: string;\n focused?: boolean;\n isLoading?: boolean;\n spinnerColor?: 'yellow';\n spinnerBackgroundColor?: 'light';\n placeholder?: string;\n disabled?: boolean;\n autoComplete?: string;\n canClose?: boolean;\n autoFocusSearch?: boolean;\n onChange: (value: string) => void;\n onReset?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n onBlur?: NoneToVoidFunction;\n onSpinnerClick?: NoneToVoidFunction;\n};\n\nconst SearchInput: FC = ({\n ref,\n children,\n parentContainerClassName,\n value,\n inputId,\n className,\n focused,\n isLoading,\n spinnerColor,\n spinnerBackgroundColor,\n placeholder,\n disabled,\n autoComplete,\n canClose,\n autoFocusSearch,\n onChange,\n onReset,\n onFocus,\n onBlur,\n onSpinnerClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let inputRef = useRef(null);\n if (ref) {\n inputRef = ref;\n }\n\n const [isInputFocused, markInputFocused, unmarkInputFocused] = useFlag(focused);\n\n useInputFocusOnOpen(inputRef, autoFocusSearch, unmarkInputFocused);\n\n useEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (focused) {\n inputRef.current.focus();\n } else {\n inputRef.current.blur();\n }\n }, [focused, placeholder]); // Trick for setting focus when selecting a contact to search for\n\n const lang = useLang();\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n onChange(currentTarget.value);\n }\n\n function handleFocus() {\n markInputFocused();\n if (onFocus) {\n onFocus();\n }\n }\n\n function handleBlur() {\n unmarkInputFocused();\n if (onBlur) {\n onBlur();\n }\n }\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown' || e.key === 'Enter') {\n const element = document.querySelector(`.${parentContainerClassName} .ListItem-button`) as HTMLElement;\n if (element) {\n element.focus();\n }\n }\n }, [parentContainerClassName]);\n\n return (\n \n {children}\n \n \n \n \n \n {!isLoading && (value || canClose) && onReset && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SearchInput);\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\n\n\ntype OwnProps = {\n isOpen: boolean;\n isCustom?: boolean;\n id?: string;\n className?: string;\n onClick?: (e: React.MouseEvent) => void;\n children: React.ReactNode;\n};\n\nconst ShowTransition: FC = ({\n isOpen, isCustom, id, className, onClick, children,\n}) => {\n const { shouldRender, transitionClassNames } = useShowTransition(\n isOpen, undefined, undefined, isCustom ? false : undefined,\n );\n const prevIsOpen = usePrevious(isOpen);\n const prevChildren = usePrevious(children);\n const fromChildrenRef = useRef();\n\n if (prevIsOpen && !isOpen) {\n fromChildrenRef.current = prevChildren;\n }\n\n return (\n shouldRender && (\n
\n {isOpen ? children : fromChildrenRef.current!}\n
\n )\n );\n};\n\nexport default ShowTransition;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Switcher.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n checked?: boolean;\n disabled?: boolean;\n inactive?: boolean;\n noAnimation?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Switcher: FC = ({\n id,\n name,\n value,\n label,\n checked = false,\n disabled,\n inactive,\n noAnimation,\n onChange,\n onCheck,\n}) => {\n const handleChange = useCallback((e: ChangeEvent) => {\n if (onChange) {\n onChange(e);\n }\n\n if (onCheck) {\n onCheck(e.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Switcher',\n disabled && 'disabled',\n inactive && 'inactive',\n noAnimation && 'no-animation',\n );\n\n return (\n \n );\n};\n\nexport default memo(Switcher);\n","import React, {\n FC, useRef, memo, useEffect,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport forceReflow from '../../util/forceReflow';\nimport renderText from '../common/helpers/renderText';\n\nimport './Tab.scss';\n\ntype OwnProps = {\n className?: string;\n title: string;\n isActive?: boolean;\n badgeCount?: number;\n isBadgeActive?: boolean;\n previousActiveTab?: number;\n onClick: (arg: number) => void;\n clickArg: number;\n};\n\nconst classNames = {\n active: 'Tab--active',\n badgeActive: 'Tab__badge--active',\n};\n\nconst Tab: FC = ({\n className,\n title,\n isActive,\n badgeCount,\n isBadgeActive,\n previousActiveTab,\n onClick,\n clickArg,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const tabRef = useRef(null);\n\n useEffect(() => {\n // Set initial active state\n if (isActive && previousActiveTab === undefined && tabRef.current) {\n tabRef.current.classList.add(classNames.active);\n }\n\n if (!isActive || previousActiveTab === undefined) {\n return;\n }\n\n const tabEl = tabRef.current!;\n const prevTabEl = tabEl.parentElement!.children[previousActiveTab];\n if (!prevTabEl) {\n return;\n }\n\n const platformEl = tabEl.querySelector('i')!;\n const prevPlatformEl = prevTabEl.querySelector('i')!;\n\n // We move and resize the platform, so it repeats the position and size of the previous one\n const shiftLeft = prevPlatformEl.parentElement!.offsetLeft - platformEl.parentElement!.offsetLeft;\n const scaleFactor = prevPlatformEl.clientWidth / platformEl.clientWidth;\n\n prevPlatformEl.classList.remove('animate');\n platformEl.classList.remove('animate');\n platformEl.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n forceReflow(platformEl);\n platformEl.classList.add('animate');\n platformEl.style.transform = 'none';\n\n prevTabEl.classList.remove(classNames.active);\n tabEl.classList.add(classNames.active);\n }, [isActive, previousActiveTab]);\n\n return (\n onClick(clickArg)}\n ref={tabRef}\n >\n \n {renderText(title)}\n {Boolean(badgeCount) && (\n {badgeCount}\n )}\n \n \n
\n );\n};\n\nexport default memo(Tab);\n","import React, {\n FC, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { IS_ANDROID, IS_IOS } from '../../util/environment';\nimport fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHorizontalScroll from '../../hooks/useHorizontalScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Tab from './Tab';\n\nimport './TabList.scss';\n\nexport type TabWithProperties = {\n title: string;\n badgeCount?: number;\n isBadgeActive?: boolean;\n};\n\ntype OwnProps = {\n tabs: readonly TabWithProperties[];\n activeTab: number;\n big?: boolean;\n onSwitchTab: (index: number) => void;\n};\n\nconst TAB_SCROLL_THRESHOLD_PX = 16;\n// Should match duration from `--slide-transition` CSS variable\nconst SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300;\n\nconst TabList: FC = ({\n tabs, activeTab, big, onSwitchTab,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const previousActiveTab = usePrevious(activeTab);\n\n useHorizontalScroll(containerRef.current);\n\n // Scroll container to place active tab in the center\n useEffect(() => {\n const container = containerRef.current!;\n const { scrollWidth, offsetWidth, scrollLeft } = container;\n if (scrollWidth <= offsetWidth) {\n return;\n }\n\n const activeTabElement = container.childNodes[activeTab] as HTMLElement | null;\n if (!activeTabElement) {\n return;\n }\n\n const { offsetLeft: activeTabOffsetLeft, offsetWidth: activeTabOffsetWidth } = activeTabElement;\n const newLeft = activeTabOffsetLeft - (offsetWidth / 2) + (activeTabOffsetWidth / 2);\n\n // Prevent scrolling by only a couple of pixels, which doesn't look smooth\n if (Math.abs(newLeft - scrollLeft) < TAB_SCROLL_THRESHOLD_PX) {\n return;\n }\n\n fastSmoothScrollHorizontal(container, newLeft, SCROLL_DURATION);\n }, [activeTab]);\n\n const lang = useLang();\n\n return (\n \n {tabs.map((tab, i) => (\n \n ))}\n
\n );\n};\n\nexport default memo(TabList);\n","import { RefObject } from 'react';\nimport React, {\n FC, useLayoutEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\nimport { GlobalState } from '../../global/types';\n\nimport { ANIMATION_LEVEL_MIN } from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport forceReflow from '../../util/forceReflow';\nimport { waitForAnimationEnd, waitForTransitionEnd } from '../../util/cssAnimationEndListeners';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport usePrevious from '../../hooks/usePrevious';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\n\nimport './Transition.scss';\n\nexport type ChildrenFn = (isActive: boolean, isFrom: boolean, currentKey: number) => React.ReactNode;\nexport type TransitionProps = {\n ref?: RefObject;\n activeKey: number;\n name: (\n 'none' | 'slide' | 'slide-rtl' | 'mv-slide' | 'slide-fade' | 'zoom-fade' | 'slide-layers'\n | 'fade' | 'push-slide' | 'reveal' | 'slide-optimized' | 'slide-optimized-rtl'\n );\n direction?: 'auto' | 'inverse' | 1 | -1;\n renderCount?: number;\n shouldRestoreHeight?: boolean;\n shouldCleanup?: boolean;\n cleanupExceptionKey?: number;\n isDisabled?: boolean;\n id?: string;\n className?: string;\n onStart?: NoneToVoidFunction;\n onStop?: NoneToVoidFunction;\n children: React.ReactNode | ChildrenFn;\n};\n\nconst classNames = {\n active: 'Transition__slide--active',\n};\n\nconst Transition: FC = ({\n ref,\n activeKey,\n name,\n direction = 'auto',\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n id,\n className,\n onStart,\n onStop,\n children,\n}) => {\n // No need for a container to update on change\n const { animationLevel } = getGlobal().settings.byKey;\n const currentKeyRef = useRef();\n\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const rendersRef = useRef>({});\n const prevActiveKey = usePrevious(activeKey);\n const forceUpdate = useForceUpdate();\n\n const activeKeyChanged = prevActiveKey !== undefined && activeKey !== prevActiveKey;\n\n if (!renderCount && activeKeyChanged) {\n rendersRef.current = { [prevActiveKey]: rendersRef.current[prevActiveKey] };\n }\n\n rendersRef.current[activeKey] = children;\n\n useLayoutEffect(() => {\n function cleanup() {\n if (!shouldCleanup) {\n return;\n }\n\n const preservedRender = cleanupExceptionKey !== undefined ? rendersRef.current[cleanupExceptionKey] : undefined;\n\n rendersRef.current = preservedRender ? { [cleanupExceptionKey!]: preservedRender } : {};\n\n forceUpdate();\n }\n\n const container = containerRef.current!;\n\n const childElements = container.children;\n if (childElements.length === 1 && !activeKeyChanged) {\n if (name.startsWith('slide-optimized')) {\n (childElements[0] as HTMLElement).style.transition = 'none';\n (childElements[0] as HTMLElement).style.transform = 'translate3d(0, 0, 0)';\n }\n\n childElements[0].classList.add(classNames.active);\n\n return;\n }\n\n const childNodes = Array.from(container.childNodes);\n\n if (!activeKeyChanged || !childNodes.length) {\n return;\n }\n\n currentKeyRef.current = activeKey;\n\n const isBackwards = (\n direction === -1\n || (direction === 'auto' && prevActiveKey > activeKey)\n || (direction === 'inverse' && prevActiveKey < activeKey)\n );\n\n const keys = Object.keys(rendersRef.current).map(Number);\n const prevActiveIndex = renderCount ? prevActiveKey : keys.indexOf(prevActiveKey);\n const activeIndex = renderCount ? activeKey : keys.indexOf(activeKey);\n\n if (name === 'slide-optimized' || name === 'slide-optimized-rtl') {\n performSlideOptimized(\n animationLevel,\n name,\n isBackwards,\n cleanup,\n activeKey,\n currentKeyRef,\n container,\n shouldRestoreHeight,\n onStart,\n onStop,\n childNodes[activeIndex] as HTMLElement,\n childNodes[prevActiveIndex] as HTMLElement,\n );\n\n return;\n }\n\n container.classList.remove('animating');\n container.classList.toggle('backwards', isBackwards);\n\n if (name === 'none' || animationLevel === ANIMATION_LEVEL_MIN) {\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle(classNames.active, i === activeIndex);\n }\n });\n\n cleanup();\n\n return;\n }\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove(classNames.active);\n node.classList.toggle('from', i === prevActiveIndex);\n node.classList.toggle('through', (\n (i > prevActiveIndex && i < activeIndex) || (i < prevActiveIndex && i > activeIndex)\n ));\n node.classList.toggle('to', i === activeIndex);\n }\n });\n\n const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n requestAnimationFrame(() => {\n container.classList.add('animating');\n\n onStart?.();\n\n function onAnimationEnd() {\n requestAnimationFrame(() => {\n if (activeKey !== currentKeyRef.current) {\n return;\n }\n\n container.classList.remove('animating', 'backwards');\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle(classNames.active, i === activeIndex);\n }\n });\n\n if (shouldRestoreHeight) {\n const activeElement = container.querySelector(`.${classNames.active}`);\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n }\n }\n\n onStop?.();\n dispatchHeavyAnimationStop();\n cleanup();\n });\n }\n\n const watchedNode = name === 'mv-slide'\n ? childNodes[activeIndex]?.firstChild\n : name === 'reveal' && isBackwards\n ? childNodes[prevActiveIndex]\n : childNodes[activeIndex];\n\n if (watchedNode) {\n waitForAnimationEnd(watchedNode, onAnimationEnd);\n } else {\n onAnimationEnd();\n }\n });\n }, [\n activeKey,\n prevActiveKey,\n activeKeyChanged,\n direction,\n name,\n onStart,\n onStop,\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n animationLevel,\n forceUpdate,\n ]);\n\n useLayoutEffect(() => {\n if (shouldRestoreHeight) {\n const container = containerRef.current!;\n const activeElement = container.querySelector(`.${classNames.active}`)\n || container.querySelector('.from');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n container.style.flexBasis = `${activeElement.clientHeight}px`;\n }\n }\n }, [shouldRestoreHeight, children]);\n\n const renders = rendersRef.current;\n const collection = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);\n\n const contents = collection.map((key) => {\n const render = renders[key];\n if (!render) {\n return undefined;\n }\n\n return (\n
{\n typeof render === 'function'\n ? render(key === activeKey, key === prevActiveKey, activeKey)\n : render\n }
\n );\n });\n\n return (\n \n {contents}\n
\n );\n};\n\nexport default Transition;\n\nfunction performSlideOptimized(\n animationLevel: GlobalState['settings']['byKey']['animationLevel'],\n name: 'slide-optimized' | 'slide-optimized-rtl',\n isBackwards: boolean,\n cleanup: NoneToVoidFunction,\n activeKey: number,\n currentKeyRef: { current: number | undefined },\n container: HTMLElement,\n shouldRestoreHeight?: boolean,\n onStart?: NoneToVoidFunction,\n onStop?: NoneToVoidFunction,\n toSlide?: HTMLElement,\n fromSlide?: HTMLElement,\n) {\n if (!fromSlide || !toSlide) {\n return;\n }\n\n if (animationLevel === ANIMATION_LEVEL_MIN) {\n fromSlide.style.transition = 'none';\n fromSlide.style.transform = '';\n fromSlide.classList.remove(classNames.active);\n\n toSlide.style.transition = 'none';\n toSlide.style.transform = 'translate3d(0, 0, 0)';\n toSlide.classList.add(classNames.active);\n\n cleanup();\n\n return;\n }\n\n if (name === 'slide-optimized-rtl') {\n isBackwards = !isBackwards;\n }\n\n const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n requestAnimationFrame(() => {\n onStart?.();\n\n fromSlide.style.transition = 'none';\n fromSlide.style.transform = 'translate3d(0, 0, 0)';\n\n toSlide.style.transition = 'none';\n toSlide.style.transform = `translate3d(${isBackwards ? '-' : ''}100%, 0, 0)`;\n\n forceReflow(toSlide);\n\n fromSlide.style.transition = '';\n fromSlide.style.transform = `translate3d(${isBackwards ? '' : '-'}100%, 0, 0)`;\n\n toSlide.style.transition = '';\n toSlide.style.transform = 'translate3d(0, 0, 0)';\n\n fromSlide.classList.remove(classNames.active);\n toSlide.classList.add(classNames.active);\n\n waitForTransitionEnd(fromSlide, () => {\n if (activeKey !== currentKeyRef.current) {\n return;\n }\n\n fromSlide.style.transition = 'none';\n fromSlide.style.transform = '';\n\n if (shouldRestoreHeight) {\n toSlide.style.height = 'auto';\n container.style.height = `${toSlide.clientHeight}px`;\n }\n\n onStop?.();\n dispatchHeavyAnimationStop();\n cleanup();\n });\n });\n}\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { ApiChatFolder } from '../../api/types';\nimport { pick, omit } from '../../util/iteratees';\n\nexport type FolderChatType = {\n icon: string;\n title: string;\n key: keyof Pick;\n};\n\nexport const INCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'user', title: 'FilterContacts', key: 'contacts' },\n { icon: 'non-contacts', title: 'FilterNonContacts', key: 'nonContacts' },\n { icon: 'group', title: 'FilterGroups', key: 'groups' },\n { icon: 'channel', title: 'FilterChannels', key: 'channels' },\n { icon: 'bots', title: 'FilterBots', key: 'bots' },\n];\n\nexport const EXCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'mute', title: 'FilterMuted', key: 'excludeMuted' },\n { icon: 'archive', title: 'FilterArchived', key: 'excludeArchived' },\n { icon: 'readchats', title: 'FilterRead', key: 'excludeRead' },\n];\n\nconst INCLUDE_FILTER_FIELDS: Array = [\n 'includedChatIds', 'bots', 'channels', 'groups', 'contacts', 'nonContacts',\n];\nconst EXCLUDE_FILTER_FIELDS: Array = [\n 'excludedChatIds', 'excludeArchived', 'excludeMuted', 'excludeRead',\n];\n\nexport function selectChatFilters(state: FoldersState, mode: 'included' | 'excluded', selectTemp?: boolean) {\n let selectedChatIds: string[] = [];\n let selectedChatTypes: FolderChatType['key'][] = [];\n\n if (mode === 'included') {\n const {\n includedChatIds,\n ...includeFilters\n } = selectTemp\n ? state.includeFilters || {}\n : pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = includedChatIds || [];\n selectedChatTypes = (Object.keys(includeFilters) as Array)\n .filter((key) => Boolean(includeFilters[key]));\n } else {\n const {\n excludedChatIds,\n ...excludeFilters\n } = selectTemp\n ? state.excludeFilters || {}\n : pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = excludedChatIds || [];\n selectedChatTypes = (Object.keys(excludeFilters) as Array)\n .filter((key) => Boolean(excludeFilters[key]));\n }\n\n return {\n selectedChatIds,\n selectedChatTypes,\n };\n}\n\nfunction getSuggestedFolderName(includeFilters?: FolderIncludeFilters) {\n if (includeFilters) {\n const {\n includedChatIds,\n ...filters\n } = includeFilters;\n\n if (\n Object.values(filters).filter(Boolean).length > 1\n || (includedChatIds?.length)\n ) {\n return '';\n }\n\n if (filters.bots) {\n return 'Bots';\n } else if (filters.groups) {\n return 'Groups';\n } else if (filters.channels) {\n return 'Channels';\n } else if (filters.contacts) {\n return 'Contacts';\n } else if (filters.nonContacts) {\n return 'Non-Contacts';\n }\n }\n\n return '';\n}\n\ntype FolderIncludeFilters = Pick;\ntype FolderExcludeFilters = Pick;\n\nexport type FoldersState = {\n mode: 'create' | 'edit';\n isLoading?: boolean;\n isTouched?: boolean;\n error?: string;\n folderId?: number;\n chatFilter: string;\n folder: Omit;\n includeFilters?: FolderIncludeFilters;\n excludeFilters?: FolderExcludeFilters;\n};\nexport type FoldersActions = (\n 'setTitle' | 'saveFilters' | 'editFolder' | 'reset' | 'setChatFilter' | 'setIsLoading' | 'setError' |\n 'editIncludeFilters' | 'editExcludeFilters' | 'setIncludeFilters' | 'setExcludeFilters'\n);\nexport type FolderEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FoldersState = {\n mode: 'create',\n chatFilter: '',\n folder: {\n title: '',\n includedChatIds: [],\n excludedChatIds: [],\n },\n};\n\nconst foldersReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setTitle':\n return {\n ...state,\n folder: {\n ...state.folder,\n title: action.payload,\n },\n isTouched: true,\n };\n case 'editIncludeFilters':\n return {\n ...state,\n includeFilters: pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n ),\n };\n case 'editExcludeFilters':\n return {\n ...state,\n excludeFilters: pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n ),\n };\n case 'setIncludeFilters':\n return {\n ...state,\n includeFilters: action.payload,\n chatFilter: '',\n };\n case 'setExcludeFilters':\n return {\n ...state,\n excludeFilters: action.payload,\n chatFilter: '',\n };\n case 'saveFilters':\n if (state.includeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, INCLUDE_FILTER_FIELDS),\n title: state.folder.title ? state.folder.title : getSuggestedFolderName(state.includeFilters),\n ...state.includeFilters,\n },\n includeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else if (state.excludeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, EXCLUDE_FILTER_FIELDS),\n ...state.excludeFilters,\n },\n excludeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else {\n return state;\n }\n case 'editFolder': {\n const { id: folderId, description, ...folder } = action.payload;\n\n return {\n mode: 'edit',\n folderId,\n folder,\n chatFilter: '',\n };\n }\n case 'setChatFilter': {\n return {\n ...state,\n chatFilter: action.payload,\n };\n }\n case 'setIsLoading': {\n return {\n ...state,\n isLoading: action.payload,\n };\n }\n case 'setError': {\n return {\n ...state,\n error: action.payload,\n };\n }\n case 'reset':\n return INITIAL_STATE;\n default:\n return state;\n }\n};\n\nconst useFoldersReducer = () => {\n return useReducer(foldersReducer, INITIAL_STATE);\n};\n\nexport default useFoldersReducer;\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../lib/teact/teact';\nimport { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { register, Track, TrackId } from '../util/audioPlayer';\nimport useEffectWithPrevDeps from './useEffectWithPrevDeps';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\nimport useOnChange from './useOnChange';\nimport {\n MediaSessionHandlers, registerMediaSession, setPlaybackState, setPositionState, updateMetadata,\n} from '../util/mediaSession';\n\ntype Handler = (e: Event) => void;\n\nconst DEFAULT_SKIP_TIME = 10;\n\nconst useAudioPlayer = (\n trackId: TrackId,\n originalDuration: number, // Sometimes incorrect for voice messages\n trackType: Track['type'],\n src?: string,\n handlers?: Record,\n metadata?: MediaMetadata,\n onInit?: (element: HTMLAudioElement) => void,\n shouldPlay = false,\n onForcePlay?: NoneToVoidFunction,\n onTrackChange?: NoneToVoidFunction,\n noPlaylist = false,\n noProgressUpdates = false,\n) => {\n // eslint-disable-next-line no-null/no-null\n const controllerRef = useRef>(null);\n\n const [isPlaying, setIsPlaying] = useState(false);\n let isPlayingSync = isPlaying;\n\n const [playProgress, setPlayProgress] = useState(0);\n\n const handleTrackChange = useCallback(() => {\n setIsPlaying(false);\n if (onTrackChange) onTrackChange();\n }, [onTrackChange]);\n\n useOnChange(() => {\n controllerRef.current = register(trackId, trackType, (eventName, e) => {\n switch (eventName) {\n case 'onPlay': {\n const {\n setVolume, setPlaybackRate, toggleMuted, proxy,\n } = controllerRef.current!;\n setIsPlaying(true);\n\n registerMediaSession(metadata, makeMediaHandlers(controllerRef));\n setPlaybackState('playing');\n setVolume(getGlobal().audioPlayer.volume);\n toggleMuted(Boolean(getGlobal().audioPlayer.isMuted));\n if (trackType === 'voice') {\n setPlaybackRate(getGlobal().audioPlayer.playbackRate);\n }\n\n setPositionState({\n duration: proxy.duration || 0,\n playbackRate: proxy.playbackRate,\n position: proxy.currentTime,\n });\n break;\n }\n case 'onRateChange': {\n const { proxy } = controllerRef.current!;\n setPositionState({\n duration: proxy.duration || 0,\n playbackRate: proxy.playbackRate,\n position: proxy.currentTime,\n });\n break;\n }\n case 'onPause':\n setIsPlaying(false);\n setPlaybackState('paused');\n break;\n case 'onTimeUpdate': {\n const { proxy } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n if (!noProgressUpdates) setPlayProgress(proxy.currentTime / duration);\n break;\n }\n case 'onEnded': {\n setPlaybackState('paused');\n break;\n }\n }\n\n handlers?.[eventName]?.(e);\n }, onForcePlay, handleTrackChange);\n\n const { proxy } = controllerRef.current!;\n\n if (!isPlaying && !proxy.paused) {\n setIsPlaying(true);\n isPlayingSync = true;\n }\n\n if (onInit) {\n onInit(proxy);\n }\n }, [trackId]);\n\n useEffect(() => {\n if (isPlaying && metadata) updateMetadata(metadata);\n }, [metadata, isPlaying]);\n\n const {\n play,\n pause,\n setCurrentTime,\n proxy,\n destroy,\n setVolume,\n stop,\n isFirst,\n isLast,\n requestNextTrack,\n requestPreviousTrack,\n setPlaybackRate,\n toggleMuted,\n } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n\n // RAF progress\n useEffect(() => {\n if (duration && !isSafariPatchInProgress(proxy) && !noProgressUpdates) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, playProgress, proxy, noProgressUpdates]);\n\n // Cleanup\n useEffect(() => () => {\n destroy(noPlaylist);\n }, [destroy, noPlaylist]);\n\n // Autoplay once `src` is present\n useEffectWithPrevDeps(([prevShouldPlay, prevSrc]) => {\n if (prevShouldPlay === shouldPlay && src === prevSrc) {\n return;\n }\n\n // When paused by another player\n if (proxy.src && proxy.paused) {\n return;\n }\n\n if (shouldPlay && src && !isPlaying) {\n play(src);\n }\n }, [shouldPlay, src, isPlaying, play, proxy.src, proxy.paused]);\n\n const playIfPresent = useCallback(() => {\n if (src) {\n play(src);\n }\n }, [src, play]);\n\n const playPause = useCallback(() => {\n if (isPlaying) {\n pause();\n } else {\n playIfPresent();\n }\n }, [pause, playIfPresent, isPlaying]);\n\n const setTime = useCallback((time: number) => {\n setCurrentTime(time);\n if (duration) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, proxy, setCurrentTime]);\n\n return {\n isPlaying: isPlayingSync,\n playProgress,\n playPause,\n pause,\n play: playIfPresent,\n stop,\n setCurrentTime: setTime,\n setVolume,\n audioProxy: proxy,\n duration,\n requestNextTrack,\n requestPreviousTrack,\n isFirst,\n isLast,\n setPlaybackRate,\n toggleMuted,\n };\n};\n\nfunction makeMediaHandlers(controllerRef: React.RefObject>) {\n let mediaHandlers: MediaSessionHandlers = {};\n if (controllerRef && controllerRef.current) {\n const {\n play, pause, setCurrentTime, proxy, requestNextTrack, requestPreviousTrack, isFirst, isLast,\n } = controllerRef.current;\n mediaHandlers = {\n play: () => {\n play(proxy.src);\n },\n pause: () => {\n pause();\n },\n stop: () => {\n pause();\n setCurrentTime(0);\n getDispatch().closeAudioPlayer();\n },\n seekbackward: (event) => {\n const skipTime = event.seekOffset || DEFAULT_SKIP_TIME;\n setCurrentTime(Math.max(proxy.currentTime - skipTime, 0));\n },\n seekforward: (event) => {\n const skipTime = event.seekOffset || DEFAULT_SKIP_TIME;\n setCurrentTime(Math.min(proxy.currentTime + skipTime, proxy.duration));\n },\n seekTo: (event) => {\n if (event.seekTime) {\n setCurrentTime(event.seekTime);\n }\n },\n };\n\n if (!isLast()) {\n mediaHandlers.nexttrack = () => {\n requestNextTrack();\n };\n }\n if (!isFirst()) {\n mediaHandlers.previoustrack = () => {\n requestPreviousTrack();\n };\n }\n }\n return mediaHandlers;\n}\n\nexport default useAudioPlayer;\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport { imgToCanvas } from '../util/files';\nimport useForceUpdate from './useForceUpdate';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\nconst MAX_CACHE_SIZE = 1000;\n\nconst cache = new Map();\n\nexport default function useBlur(dataUri?: string, isDisabled = false, delay?: number) {\n const blurredRef = useRef(dataUri ? cache.get(dataUri) : undefined);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n if (timeoutRef.current && isDisabled) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useEffect(() => {\n if (!dataUri || blurredRef.current || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n img.onload = () => {\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n const blurredDataUri = canvas.toDataURL();\n\n blurredRef.current = blurredDataUri;\n forceUpdate();\n\n if (cache.size >= MAX_CACHE_SIZE) {\n cache.clear();\n }\n cache.set(dataUri, blurredDataUri);\n };\n\n if (delay) {\n timeoutRef.current = window.setTimeout(() => {\n img.src = dataUri;\n }, delay);\n } else {\n img.src = dataUri;\n }\n }, [dataUri, delay, forceUpdate, isDisabled]);\n\n return blurredRef.current;\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useOnChange from './useOnChange';\nimport useBlur from './useBlur';\nimport { imgToCanvas } from '../util/files';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useBlurSync(dataUri: string | false | undefined) {\n const blurredRef = useRef();\n\n let isChanged = false;\n\n useOnChange(() => {\n isChanged = true;\n\n blurredRef.current = undefined;\n\n if (!dataUri) {\n return;\n }\n\n const img = new Image();\n img.src = dataUri;\n if (!img.width) {\n return;\n }\n\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n\n blurredRef.current = canvas.toDataURL();\n }, [dataUri]);\n\n // Sometimes `Image` do not manage to load synchronously,\n // so we fall back the non-blurred variant and prepare the async one at least for the next time\n const blurredAsync = useBlur(dataUri || undefined, Boolean(blurredRef.current));\n\n return blurredRef.current || (!isChanged && blurredAsync) || dataUri || undefined;\n}\n","import React, { useCallback, useMemo, useState } from '../lib/teact/teact';\nimport { debounce } from '../util/schedulers';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\n\ntype BufferingEvent = (e: Event | React.SyntheticEvent) => void;\n\nconst MIN_READY_STATE = 3;\n// Avoid flickering when re-mounting previously buffered video\nconst DEBOUNCE = 200;\n\nconst useBuffering = (noInitiallyBuffered = false) => {\n const [isBuffered, setIsBuffered] = useState(!noInitiallyBuffered);\n const [bufferedProgress, setBufferedProgress] = useState(0);\n\n const setIsBufferedDebounced = useMemo(() => {\n return debounce(setIsBuffered, DEBOUNCE, false, true);\n }, []);\n\n const handleBuffering = useCallback((e) => {\n const media = e.currentTarget as HTMLMediaElement;\n\n if (!isSafariPatchInProgress(media)) {\n if (media.buffered.length) {\n setBufferedProgress(media.buffered.end(0) / media.duration);\n }\n\n setIsBufferedDebounced(media.readyState >= MIN_READY_STATE || media.currentTime > 0);\n }\n }, [setIsBufferedDebounced]);\n\n const bufferingHandlers = {\n onLoadedData: handleBuffering,\n onPlaying: handleBuffering,\n onLoadStart: handleBuffering, // Needed for Safari to start\n onPause: handleBuffering, // Needed for Chrome when seeking\n onTimeUpdate: handleBuffering, // Needed for audio buffering progress\n onProgress: handleBuffering, // Needed for video buffering progress\n };\n\n return {\n isBuffered,\n bufferedProgress,\n bufferingHandlers,\n checkBuffering(element: HTMLMediaElement) {\n setIsBufferedDebounced(element.readyState >= MIN_READY_STATE);\n },\n };\n};\n\nexport default useBuffering;\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useForceUpdate from './useForceUpdate';\nimport { IS_CANVAS_FILTER_SUPPORTED } from '../util/environment';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useCanvasBlur(dataUri?: string, isDisabled = false, withRaf?: boolean) {\n // eslint-disable-next-line no-null/no-null\n const canvasRef = useRef(null);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n const canvas = canvasRef.current;\n\n if (!dataUri || !canvas || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n const processBlur = () => {\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d', { alpha: false })!;\n\n if (IS_CANVAS_FILTER_SUPPORTED) {\n ctx.filter = `blur(${RADIUS}px)`;\n }\n\n ctx.drawImage(img, -RADIUS * 2, -RADIUS * 2, canvas.width + RADIUS * 4, canvas.height + RADIUS * 4);\n\n if (!IS_CANVAS_FILTER_SUPPORTED) {\n fastBlur(ctx, 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n }\n };\n\n img.onload = () => {\n if (withRaf) {\n requestAnimationFrame(processBlur);\n } else {\n processBlur();\n }\n };\n\n img.src = dataUri;\n }, [canvasRef, dataUri, forceUpdate, isDisabled, withRaf]);\n\n return canvasRef;\n}\n","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../api/types';\n\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../config';\nimport {\n isChatArchived, getCanDeleteChat, isUserId, isChatChannel,\n} from '../modules/helpers';\nimport { compact } from '../util/iteratees';\nimport useLang from './useLang';\n\nconst useChatContextActions = ({\n chat,\n user,\n folderId,\n isPinned,\n isMuted,\n canChangeFolder,\n handleDelete,\n handleChatFolderChange,\n}: {\n chat: ApiChat | undefined;\n user: ApiUser | undefined;\n folderId?: number;\n isPinned?: boolean;\n isMuted?: boolean;\n canChangeFolder?: boolean;\n handleDelete: () => void;\n handleChatFolderChange: () => void;\n}, isInSearch = false) => {\n const lang = useLang();\n\n const { isSelf } = user || {};\n const isServiceNotifications = user?.id === SERVICE_NOTIFICATIONS_USER_ID;\n\n return useMemo(() => {\n if (!chat) {\n return undefined;\n }\n\n const {\n toggleChatPinned,\n updateChatMutedState,\n toggleChatArchived,\n toggleChatUnread,\n } = getDispatch();\n\n const actionAddToFolder = canChangeFolder ? {\n title: lang('ChatList.Filter.AddToFolder'),\n icon: 'folder',\n handler: handleChatFolderChange,\n } : undefined;\n\n const actionPin = isPinned\n ? {\n title: lang('UnpinFromTop'),\n icon: 'unpin',\n handler: () => toggleChatPinned({ id: chat.id, folderId }),\n }\n : { title: lang('PinToTop'), icon: 'pin', handler: () => toggleChatPinned({ id: chat.id, folderId }) };\n\n if (isInSearch) {\n return compact([actionPin, actionAddToFolder]);\n }\n\n const actionUnreadMark = chat.unreadCount || chat.hasUnreadMark\n ? { title: lang('MarkAsRead'), icon: 'readchats', handler: () => toggleChatUnread({ id: chat.id }) }\n : { title: lang('MarkAsUnread'), icon: 'unread', handler: () => toggleChatUnread({ id: chat.id }) };\n\n const actionMute = isMuted\n ? {\n title: lang('ChatList.Unmute'),\n icon: 'unmute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: false }),\n }\n : {\n title: lang('ChatList.Mute'),\n icon: 'mute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: true }),\n };\n\n const actionArchive = isChatArchived(chat)\n ? { title: lang('Unarchive'), icon: 'unarchive', handler: () => toggleChatArchived({ id: chat.id }) }\n : { title: lang('Archive'), icon: 'archive', handler: () => toggleChatArchived({ id: chat.id }) };\n\n const actionDelete = {\n title: isUserId(chat.id)\n ? lang('Delete')\n : lang(getCanDeleteChat(chat)\n ? 'DeleteChat'\n : (isChatChannel(chat) ? 'LeaveChannel' : 'Group.LeaveGroup')),\n icon: 'delete',\n destructive: true,\n handler: handleDelete,\n };\n\n const isInFolder = folderId !== undefined;\n\n return compact([\n actionAddToFolder,\n actionUnreadMark,\n actionPin,\n !isSelf && actionMute,\n !isSelf && !isServiceNotifications && !isInFolder && actionArchive,\n actionDelete,\n ]);\n }, [\n chat, canChangeFolder, lang, handleChatFolderChange, isPinned, isInSearch, isMuted, handleDelete, folderId, isSelf,\n isServiceNotifications,\n ]);\n};\n\nexport default useChatContextActions;\n","import { RefObject } from 'react';\nimport { useState, useEffect, useCallback } from '../lib/teact/teact';\n\nimport { IAnchorPosition } from '../types';\nimport {\n IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT, IS_PWA, IS_IOS,\n} from '../util/environment';\n\nconst LONG_TAP_DURATION_MS = 200;\n\nfunction checkIsDisabledForMobile() {\n return IS_SINGLE_COLUMN_LAYOUT\n && window.document.body.classList.contains('enable-symbol-menu-transforms');\n}\n\nfunction stopEvent(e: Event) {\n e.stopImmediatePropagation();\n e.preventDefault();\n e.stopPropagation();\n}\n\nconst useContextMenuHandlers = (\n elementRef: RefObject,\n isMenuDisabled?: boolean,\n shouldDisableOnLink?: boolean,\n shouldDisableOnLongTap?: boolean,\n) => {\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState(undefined);\n\n const handleBeforeContextMenu = useCallback((e: React.MouseEvent) => {\n if (!isMenuDisabled && e.button === 2) {\n (e.target as HTMLElement).classList.add('no-selection');\n }\n }, [isMenuDisabled]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n (e.target as HTMLElement).classList.remove('no-selection');\n\n if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a[href]'))) {\n return;\n }\n e.preventDefault();\n\n if (contextMenuPosition) {\n return;\n }\n\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: e.clientX, y: e.clientY });\n }, [isMenuDisabled, shouldDisableOnLink, contextMenuPosition]);\n\n const handleContextMenuClose = useCallback(() => {\n setIsContextMenuOpen(false);\n }, []);\n\n const handleContextMenuHide = useCallback(() => {\n setContextMenuPosition(undefined);\n document.body.classList.remove('no-selection');\n }, []);\n\n // Support context menu on touch-devices\n useEffect(() => {\n if (isMenuDisabled || !IS_TOUCH_ENV || shouldDisableOnLongTap) {\n return undefined;\n }\n\n const element = elementRef.current;\n if (!element) {\n return undefined;\n }\n\n let timer: number | undefined;\n\n const clearLongPressTimer = () => {\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const emulateContextMenuEvent = (originalEvent: TouchEvent) => {\n clearLongPressTimer();\n\n const { clientX, clientY, target } = originalEvent.touches[0];\n\n if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a[href]'))) {\n return;\n }\n\n // Temporarily intercept and clear the next click\n element.addEventListener('touchend', function cancelClickOnce(e) {\n element.removeEventListener('touchend', cancelClickOnce, true);\n stopEvent(e);\n }, true);\n\n // On iOS15, in PWA mode, the context menu immediately closes after opening\n if (IS_PWA && IS_IOS) {\n element.addEventListener('mousedown', function cancelClickOnce(e) {\n element.removeEventListener('mousedown', cancelClickOnce, true);\n stopEvent(e);\n }, true);\n }\n\n document.body.classList.add('no-selection');\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: clientX, y: clientY });\n };\n\n const startLongPressTimer = (e: TouchEvent) => {\n if (isMenuDisabled || checkIsDisabledForMobile()) {\n return;\n }\n clearLongPressTimer();\n\n timer = window.setTimeout(() => emulateContextMenuEvent(e), LONG_TAP_DURATION_MS);\n };\n\n // @perf Consider event delegation\n element.addEventListener('touchstart', startLongPressTimer, { passive: true });\n element.addEventListener('touchcancel', clearLongPressTimer, true);\n element.addEventListener('touchend', clearLongPressTimer, true);\n element.addEventListener('touchmove', clearLongPressTimer, { passive: true });\n\n return () => {\n clearLongPressTimer();\n element.removeEventListener('touchstart', startLongPressTimer);\n element.removeEventListener('touchcancel', clearLongPressTimer, true);\n element.removeEventListener('touchend', clearLongPressTimer, true);\n element.removeEventListener('touchmove', clearLongPressTimer);\n };\n }, [contextMenuPosition, isMenuDisabled, shouldDisableOnLongTap, elementRef, shouldDisableOnLink]);\n\n return {\n isContextMenuOpen,\n contextMenuPosition,\n handleBeforeContextMenu,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n };\n};\n\nexport default useContextMenuHandlers;\n","import { useState, useEffect } from '../lib/teact/teact';\nimport { IAnchorPosition } from '../types';\n\ninterface Layout {\n extraPaddingX?: number;\n extraTopPadding?: number;\n marginSides?: number;\n extraMarginTop?: number;\n}\n\nconst MENU_POSITION_VISUAL_COMFORT_SPACE_PX = 16;\nconst MENU_POSITION_BOTTOM_MARGIN = 12;\nconst EMPTY_RECT = {\n width: 0, left: 0, height: 0, top: 0,\n};\n\nexport default function useContextMenuPosition(\n anchor: IAnchorPosition | undefined,\n getTriggerElement: () => HTMLElement | null,\n getRootElement: () => HTMLElement | null,\n getMenuElement: () => HTMLElement | null,\n getLayout?: () => Layout,\n) {\n const [positionX, setPositionX] = useState<'right' | 'left'>('right');\n const [positionY, setPositionY] = useState<'top' | 'bottom'>('bottom');\n const [transformOriginX, setTransformOriginX] = useState();\n const [transformOriginY, setTransformOriginY] = useState();\n const [withScroll, setWithScroll] = useState(false);\n const [style, setStyle] = useState('');\n const [menuStyle, setMenuStyle] = useState('opacity: 0;');\n\n useEffect(() => {\n const triggerEl = getTriggerElement();\n if (!anchor || !triggerEl) {\n return;\n }\n\n let { x, y } = anchor;\n const anchorX = x;\n const anchorY = y;\n\n const menuEl = getMenuElement();\n const rootEl = getRootElement();\n\n const {\n extraPaddingX = 0,\n extraTopPadding = 0,\n marginSides = 0,\n extraMarginTop = 0,\n } = getLayout?.() || {};\n\n const marginTop = menuEl ? parseInt(getComputedStyle(menuEl).marginTop, 10) + extraMarginTop : undefined;\n\n const menuRect = menuEl ? {\n width: menuEl.offsetWidth,\n height: menuEl.offsetHeight + marginTop!,\n } : EMPTY_RECT;\n\n const rootRect = rootEl ? rootEl.getBoundingClientRect() : EMPTY_RECT;\n\n let horizontalPosition: 'left' | 'right';\n let verticalPosition: 'top' | 'bottom';\n if (x + menuRect.width + extraPaddingX < rootRect.width + rootRect.left) {\n x += 3;\n horizontalPosition = 'left';\n } else if (x - menuRect.width > 0) {\n horizontalPosition = 'right';\n x -= 3;\n } else {\n horizontalPosition = 'left';\n x = 16;\n }\n setPositionX(horizontalPosition);\n\n if (marginSides\n && horizontalPosition === 'right' && (x + extraPaddingX + marginSides >= rootRect.width + rootRect.left)) {\n x -= marginSides;\n }\n\n if (marginSides && horizontalPosition === 'left') {\n if (x + extraPaddingX + marginSides + menuRect.width >= rootRect.width + rootRect.left) {\n x -= marginSides;\n } else if (x - marginSides <= 0) {\n x += marginSides;\n }\n }\n\n if (y + menuRect.height < rootRect.height + rootRect.top) {\n verticalPosition = 'top';\n } else {\n verticalPosition = 'bottom';\n\n if (y - menuRect.height < rootRect.top + extraTopPadding) {\n y = rootRect.top + rootRect.height;\n }\n }\n setPositionY(verticalPosition);\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const left = horizontalPosition === 'left'\n ? Math.min(x - triggerRect.left, rootRect.width - menuRect.width - MENU_POSITION_VISUAL_COMFORT_SPACE_PX)\n : Math.max((x - triggerRect.left), menuRect.width + MENU_POSITION_VISUAL_COMFORT_SPACE_PX);\n const top = Math.min(\n rootRect.height - triggerRect.top + triggerRect.height - MENU_POSITION_BOTTOM_MARGIN + (marginTop || 0),\n y - triggerRect.top,\n );\n const menuMaxHeight = rootRect.height - MENU_POSITION_BOTTOM_MARGIN - (marginTop || 0);\n\n setWithScroll(menuMaxHeight < menuRect.height);\n setMenuStyle(`max-height: ${menuMaxHeight}px;`);\n setStyle(`left: ${left}px; top: ${top}px`);\n const offsetX = (anchorX - triggerRect.left) - left;\n const offsetY = (anchorY - triggerRect.top) - top - (marginTop || 0);\n setTransformOriginX(horizontalPosition === 'left' ? offsetX : menuRect.width + offsetX);\n setTransformOriginY(verticalPosition === 'bottom' ? menuRect.height + offsetY : offsetY);\n }, [\n anchor, getMenuElement, getRootElement, getTriggerElement, getLayout,\n ]);\n\n return {\n positionX,\n positionY,\n transformOriginX,\n transformOriginY,\n style,\n menuStyle,\n withScroll,\n };\n}\n","import { useMemo } from '../lib/teact/teact';\n\nimport { debounce } from '../util/schedulers';\n\nexport default function useDebounce(ms: number, noFirst?: boolean, noLast?: boolean) {\n return useMemo(() => {\n return debounce((cb) => cb(), ms, !noFirst, !noLast);\n }, [ms, noFirst, noLast]);\n}\n","import { useEffect, useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiMessage } from '../api/types';\n\nimport { throttle } from '../util/schedulers';\n\nconst useEnsureMessage = (\n chatId: string,\n messageId?: number,\n message?: ApiMessage,\n replyOriginForId?: number,\n) => {\n const { loadMessage } = getDispatch();\n const loadMessageThrottled = useMemo(() => {\n const throttled = throttle(loadMessage, 500, true);\n return () => {\n throttled({ chatId, messageId, replyOriginForId });\n };\n }, [loadMessage, chatId, messageId, replyOriginForId]);\n\n useEffect(() => {\n if (messageId && !message) {\n loadMessageThrottled();\n }\n });\n};\n\nexport default useEnsureMessage;\n","import { useEffect, useState } from '../lib/teact/teact';\nimport {\n getOrderedIds,\n getUnreadCounters,\n getChatsCount,\n addOrderedIdsCallback,\n addUnreadCountersCallback,\n addChatsCountCallback,\n} from '../util/folderManager';\n\nexport function useFolderManagerForOrderedIds(folderId: number) {\n const [orderedIds, setOrderedIds] = useState(getOrderedIds(folderId));\n\n useEffect(() => addOrderedIdsCallback(folderId, setOrderedIds), [folderId]);\n\n return orderedIds;\n}\n\nexport function useFolderManagerForUnreadCounters() {\n const [unreadCounters, setUnreadCounters] = useState(getUnreadCounters());\n\n useEffect(() => addUnreadCountersCallback(setUnreadCounters), []);\n\n return unreadCounters;\n}\n\nexport function useFolderManagerForChatsCount() {\n const [chatsCount, setChatsCount] = useState(getChatsCount());\n\n useEffect(() => addChatsCountCallback(setChatsCount), []);\n\n return chatsCount;\n}\n","import { useEffect } from '../lib/teact/teact';\n\nconst useHorizontalScroll = (container: HTMLElement | null, isDisabled?: boolean) => {\n useEffect(() => {\n if (!container || isDisabled) {\n return undefined;\n }\n\n function handleScroll(e: WheelEvent) {\n // Ignore horizontal scroll and let it work natively (e.g. on touchpad)\n if (!e.deltaX) {\n container!.scrollLeft += e.deltaY / 4;\n }\n }\n\n container.addEventListener('wheel', handleScroll, { passive: true });\n\n return () => {\n container.removeEventListener('wheel', handleScroll);\n };\n }, [container, isDisabled]);\n};\n\nexport default useHorizontalScroll;\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\nconst MODAL_HIDE_DELAY_MS = 300;\n\nexport default function useInputFocusOnOpen(\n inputRef: RefObject,\n isOpen?: boolean,\n onClose?: NoneToVoidFunction,\n) {\n useEffect(() => {\n if (isOpen) {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n });\n }, FOCUS_DELAY_MS);\n }\n } else {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n\n if (onClose) {\n setTimeout(onClose, MODAL_HIDE_DELAY_MS);\n }\n }\n }, [inputRef, isOpen, onClose]);\n}\n","import { RefObject } from 'react';\nimport {\n useEffect, useRef, useCallback, useState,\n} from '../lib/teact/teact';\n\nimport { throttle, debounce } from '../util/schedulers';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\n\ntype TargetCallback = (entry: IntersectionObserverEntry) => void;\ntype RootCallback = (entries: IntersectionObserverEntry[]) => void;\ntype ObserveCleanup = NoneToVoidFunction;\nexport type ObserveFn = (target: HTMLElement, targetCallback?: TargetCallback) => ObserveCleanup;\n\ninterface IntersectionController {\n observer: IntersectionObserver;\n callbacks: Map;\n}\n\ninterface Response {\n observe: ObserveFn;\n freeze: NoneToVoidFunction;\n unfreeze: NoneToVoidFunction;\n}\n\nexport function useIntersectionObserver({\n rootRef,\n throttleMs,\n debounceMs,\n shouldSkipFirst,\n margin,\n threshold,\n isDisabled,\n}: {\n rootRef: RefObject;\n throttleMs?: number;\n debounceMs?: number;\n shouldSkipFirst?: boolean;\n margin?: number;\n threshold?: number | number[];\n isDisabled?: boolean;\n}, rootCallback?: RootCallback): Response {\n const controllerRef = useRef();\n const rootCallbackRef = useRef();\n const freezeFlagsRef = useRef(0);\n const onUnfreezeRef = useRef();\n\n rootCallbackRef.current = rootCallback;\n\n const freeze = useCallback(() => {\n freezeFlagsRef.current++;\n }, []);\n\n const unfreeze = useCallback(() => {\n if (!freezeFlagsRef.current) {\n return;\n }\n\n freezeFlagsRef.current--;\n\n if (!freezeFlagsRef.current && onUnfreezeRef.current) {\n onUnfreezeRef.current();\n onUnfreezeRef.current = undefined;\n }\n }, []);\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useEffect(() => {\n if (isDisabled) {\n return undefined;\n }\n\n return () => {\n if (controllerRef.current) {\n controllerRef.current.observer.disconnect();\n controllerRef.current.callbacks.clear();\n controllerRef.current = undefined;\n }\n };\n }, [isDisabled]);\n\n function initController() {\n const callbacks = new Map();\n const entriesAccumulator = new Map();\n const observerCallbackSync = () => {\n const entries = Array.from(entriesAccumulator.values());\n\n entries.forEach((entry: IntersectionObserverEntry) => {\n const callback = callbacks.get(entry.target);\n if (callback) {\n callback!(entry, entries);\n }\n });\n\n if (rootCallbackRef.current) {\n rootCallbackRef.current(entries);\n }\n\n entriesAccumulator.clear();\n };\n const scheduler = throttleMs ? throttle : debounceMs ? debounce : undefined;\n const observerCallback = scheduler\n ? scheduler(observerCallbackSync, (throttleMs || debounceMs)!, !shouldSkipFirst)\n : observerCallbackSync;\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n entriesAccumulator.set(entry.target, entry);\n });\n\n if (freezeFlagsRef.current) {\n onUnfreezeRef.current = () => {\n observerCallback();\n };\n } else {\n observerCallback();\n }\n },\n {\n root: rootRef.current,\n rootMargin: margin ? `${margin}px` : undefined,\n threshold,\n },\n );\n\n controllerRef.current = { observer, callbacks };\n }\n\n const observe = useCallback((target, targetCallback) => {\n if (!controllerRef.current) {\n initController();\n }\n\n const controller = controllerRef.current!;\n controller.observer.observe(target);\n\n if (targetCallback) {\n controller.callbacks.set(target, targetCallback);\n }\n\n return () => {\n if (targetCallback) {\n controller.callbacks.delete(target);\n }\n\n controller.observer.unobserve(target);\n };\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return { observe, freeze, unfreeze };\n}\n\nexport function useOnIntersect(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n useEffect(() => {\n return observe ? observe(targetRef.current!, callback) : undefined;\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n\nexport function useIsIntersecting(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n const [isIntersecting, setIsIntersecting] = useState(!observe);\n\n useOnIntersect(targetRef, observe, (entry) => {\n setIsIntersecting(entry.isIntersecting);\n\n if (callback) {\n callback(entry);\n }\n });\n\n return isIntersecting;\n}\n","import { useEffect, useLayoutEffect, useRef } from '../lib/teact/teact';\n\nfunction useInterval(callback: NoneToVoidFunction, delay?: number, noFirst = false) {\n const savedCallback = useRef(callback);\n\n useLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (delay === undefined) {\n return undefined;\n }\n\n const id = setInterval(() => savedCallback.current(), delay);\n if (!noFirst) savedCallback.current();\n\n return () => clearInterval(id);\n }, [delay, noFirst]);\n}\n\nexport default useInterval;\n","import { useLayoutEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nconst useLayoutEffectWithPrevDeps = (\n cb: (args: T | readonly []) => void, dependencies: T, debugKey?: string,\n) => {\n const prevDeps = usePrevious(dependencies);\n return useLayoutEffect(() => {\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n\nexport default useLayoutEffectWithPrevDeps;\n","import useShowTransition from './useShowTransition';\n\nexport default function useMediaTransition(mediaData?: any) {\n const isMediaReady = Boolean(mediaData);\n const { transitionClassNames } = useShowTransition(isMediaReady, undefined, isMediaReady, 'slow');\n\n return transitionClassNames;\n}\n","import { useRef } from '../lib/teact/teact';\nimport generateIdFor from '../util/generateIdFor';\n\nconst store: Record = {};\n\nconst useUniqueId = () => {\n const idRef = useRef();\n\n if (!idRef.current) {\n idRef.current = generateIdFor(store);\n store[idRef.current] = true;\n }\n\n return idRef.current;\n};\n\nexport default useUniqueId;\n","import {\n useEffect, useMemo, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { IS_PROGRESSIVE_SUPPORTED } from '../util/environment';\nimport { ApiMediaFormat } from '../api/types';\nimport { throttle } from '../util/schedulers';\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\nimport useUniqueId from './useUniqueId';\n\nconst STREAMING_PROGRESS = 0.75;\nconst STREAMING_TIMEOUT = 1500;\nconst PROGRESS_THROTTLE = 500;\n\nexport default function useMediaWithLoadProgress(\n mediaHash: string | undefined,\n noLoad = false,\n mediaFormat = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n isHtmlAllowed = false,\n) {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const isStreaming = mediaFormat === ApiMediaFormat.Stream || (\n IS_PROGRESSIVE_SUPPORTED && mediaFormat === ApiMediaFormat.Progressive\n );\n const forceUpdate = useForceUpdate();\n const id = useUniqueId();\n const [loadProgress, setLoadProgress] = useState(mediaData && !isStreaming ? 1 : 0);\n const startedAtRef = useRef();\n\n const handleProgress = useMemo(() => {\n return throttle((progress: number) => {\n if (startedAtRef.current && (!delay || (Date.now() - startedAtRef.current > delay))) {\n setLoadProgress(progress);\n }\n }, PROGRESS_THROTTLE, true);\n }, [delay]);\n\n useEffect(() => {\n if (!noLoad && mediaHash) {\n if (!mediaData) {\n setLoadProgress(0);\n\n if (startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n }\n\n startedAtRef.current = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat, isHtmlAllowed, handleProgress, id).then(() => {\n const spentTime = Date.now() - startedAtRef.current!;\n startedAtRef.current = undefined;\n\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n } else if (isStreaming) {\n setTimeout(() => {\n setLoadProgress(STREAMING_PROGRESS);\n }, STREAMING_TIMEOUT);\n }\n }\n }, [\n noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, isStreaming, delay, handleProgress,\n isHtmlAllowed, id,\n ]);\n\n useEffect(() => {\n if (noLoad && startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n setLoadProgress(0);\n startedAtRef.current = undefined;\n }\n }, [handleProgress, noLoad]);\n\n useEffect(() => {\n return () => {\n if (mediaHash) {\n mediaLoader.removeCallback(mediaHash, id);\n }\n };\n }, [id, mediaHash]);\n\n return { mediaData, loadProgress };\n}\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\n\nconst MENU_CLOSE_TIMEOUT = 250;\nlet closeTimeout: number | undefined;\n\nexport default function useMouseInside(\n isOpen: boolean, onClose: NoneToVoidFunction, menuCloseTimeout = MENU_CLOSE_TIMEOUT, isDisabled = false,\n) {\n const isMouseInside = useRef(false);\n\n const markMouseInside = useCallback(() => {\n isMouseInside.current = true;\n }, []);\n\n useEffect(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n if (isOpen && !IS_TOUCH_ENV && !isDisabled) {\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout * 2);\n }\n }, [isDisabled, isOpen, menuCloseTimeout, onClose]);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout);\n }, [menuCloseTimeout, onClose]);\n\n return [handleMouseEnter, handleMouseLeave, markMouseInside];\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport usePrevious from './usePrevious';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport default function usePrevDuringAnimation(current: any, duration?: number) {\n const prev = usePrevious(current, true);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n // eslint-disable-next-line no-null/no-null\n const isCurrentPresent = current !== undefined && current !== null;\n // eslint-disable-next-line no-null/no-null\n const isPrevPresent = prev !== undefined && prev !== null;\n\n if (isCurrentPresent && timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useOnChange(() => {\n // When `current` becomes empty\n if (duration && !isCurrentPresent && isPrevPresent && !timeoutRef.current) {\n timeoutRef.current = window.setTimeout(() => {\n timeoutRef.current = undefined;\n forceUpdate();\n }, duration);\n }\n }, [current]);\n\n return !timeoutRef.current || !duration || isCurrentPresent ? current : prev;\n}\n","import { useState, useCallback, useRef } from '../lib/teact/teact';\n\nexport type ReducerAction = { type: Actions; payload?: any };\nexport type StateReducer = (state: State, action: ReducerAction) => State;\nexport type Dispatch = (action: ReducerAction) => void;\n\nexport default function useReducer(\n reducer: StateReducer,\n initialState: State,\n) {\n const reducerRef = useRef(reducer);\n const [state, setState] = useState(initialState);\n\n const dispatch = useCallback((action: ReducerAction) => {\n setState((currentState) => reducerRef.current(currentState, action));\n }, []);\n\n return [\n state,\n dispatch,\n ] as [State, Dispatch];\n}\n","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiSendMessageAction } from '../api/types';\n\nimport { SEND_MESSAGE_ACTION_INTERVAL } from '../config';\nimport { throttle } from '../util/schedulers';\n\nconst useSendMessageAction = (chatId: string, threadId?: number) => {\n return useMemo(() => {\n return throttle((action: ApiSendMessageAction) => {\n getDispatch().sendMessageAction({ chatId, threadId, action });\n }, SEND_MESSAGE_ACTION_INTERVAL);\n }, [chatId, threadId]);\n};\n\nexport default useSendMessageAction;\n","import { useRef } from '../lib/teact/teact';\n\nimport useOnChange from './useOnChange';\n\n// Allows to use state value as \"silent\" dependency in hooks (not causing updates).\n// Useful for state values that update frequently (such as controlled input value).\nexport function useStateRef(value: T) {\n const ref = useRef(value);\n\n useOnChange(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n}\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\nimport { fastRaf } from '../util/schedulers';\n\n// Fix for memory leak when unmounting video element\nexport default function useVideoCleanup(videoRef: RefObject, dependencies: any[]) {\n useEffect(() => {\n const videoEl = videoRef.current;\n\n return () => {\n if (videoEl) {\n fastRaf(() => {\n videoEl.pause();\n videoEl.src = '';\n videoEl.load();\n });\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-cond-assign */\n/* eslint-disable no-param-reassign */\n/* eslint-disable prefer-const */\n/* eslint-disable eqeqeq */\n\n/*\nSuperfast Blur - a fast Box Blur For Canvas\n\nVersion: 0.5\nAuthor: Mario Klingemann\nContact: mario@quasimondo.com\nWebsite: http://www.quasimondo.com/BoxBlurForCanvas\nTwitter: @quasimondo\n\nIn case you find this class useful - especially in commercial projects -\nI am not totally unhappy for a small donation to my PayPal account\nmario@quasimondo.de\n\nOr support me on flattr:\nhttps://flattr.com/thing/140066/Superfast-Blur-a-pretty-fast-Box-Blur-Effect-for-CanvasJavascript\n\nCopyright (c) 2011 Mario Klingemann\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// eslint-disable-next-line max-len\nconst mul_table = [1, 57, 41, 21, 203, 34, 97, 73, 227, 91, 149, 62, 105, 45, 39, 137, 241, 107, 3, 173, 39, 71, 65, 238, 219, 101, 187, 87, 81, 151, 141, 133, 249, 117, 221, 209, 197, 187, 177, 169, 5, 153, 73, 139, 133, 127, 243, 233, 223, 107, 103, 99, 191, 23, 177, 171, 165, 159, 77, 149, 9, 139, 135, 131, 253, 245, 119, 231, 224, 109, 211, 103, 25, 195, 189, 23, 45, 175, 171, 83, 81, 79, 155, 151, 147, 9, 141, 137, 67, 131, 129, 251, 123, 30, 235, 115, 113, 221, 217, 53, 13, 51, 50, 49, 193, 189, 185, 91, 179, 175, 43, 169, 83, 163, 5, 79, 155, 19, 75, 147, 145, 143, 35, 69, 17, 67, 33, 65, 255, 251, 247, 243, 239, 59, 29, 229, 113, 111, 219, 27, 213, 105, 207, 51, 201, 199, 49, 193, 191, 47, 93, 183, 181, 179, 11, 87, 43, 85, 167, 165, 163, 161, 159, 157, 155, 77, 19, 75, 37, 73, 145, 143, 141, 35, 138, 137, 135, 67, 33, 131, 129, 255, 63, 250, 247, 61, 121, 239, 237, 117, 29, 229, 227, 225, 111, 55, 109, 216, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 48, 190, 47, 93, 185, 183, 181, 179, 178, 176, 175, 173, 171, 85, 21, 167, 165, 41, 163, 161, 5, 79, 157, 78, 154, 153, 19, 75, 149, 74, 147, 73, 144, 143, 71, 141, 140, 139, 137, 17, 135, 134, 133, 66, 131, 65, 129, 1];\n// eslint-disable-next-line max-len\nconst shg_table = [0, 9, 10, 10, 14, 12, 14, 14, 16, 15, 16, 15, 16, 15, 15, 17, 18, 17, 12, 18, 16, 17, 17, 19, 19, 18, 19, 18, 18, 19, 19, 19, 20, 19, 20, 20, 20, 20, 20, 20, 15, 20, 19, 20, 20, 20, 21, 21, 21, 20, 20, 20, 21, 18, 21, 21, 21, 21, 20, 21, 17, 21, 21, 21, 22, 22, 21, 22, 22, 21, 22, 21, 19, 22, 22, 19, 20, 22, 22, 21, 21, 21, 22, 22, 22, 18, 22, 22, 21, 22, 22, 23, 22, 20, 23, 22, 22, 23, 23, 21, 19, 21, 21, 21, 23, 23, 23, 22, 23, 23, 21, 23, 22, 23, 18, 22, 23, 20, 22, 23, 23, 23, 21, 22, 20, 22, 21, 22, 24, 24, 24, 24, 24, 22, 21, 24, 23, 23, 24, 21, 24, 23, 24, 22, 24, 24, 22, 24, 24, 22, 23, 24, 24, 24, 20, 23, 22, 23, 24, 24, 24, 24, 24, 24, 24, 23, 21, 23, 22, 23, 24, 24, 24, 22, 24, 24, 24, 23, 22, 24, 24, 25, 23, 25, 25, 23, 24, 25, 25, 24, 22, 25, 25, 25, 24, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 22, 25, 25, 23, 25, 25, 20, 24, 25, 24, 25, 25, 22, 24, 25, 24, 25, 24, 25, 25, 24, 25, 25, 25, 25, 22, 25, 25, 25, 24, 25, 24, 25, 18];\n\nexport default function boxBlurCanvasRGB(context, top_x, top_y, width, height, radius, iterations) {\n if (Number.isNaN(radius) || radius < 1) return;\n\n radius |= 0;\n\n if (Number.isNaN(iterations)) iterations = 1;\n iterations |= 0;\n if (iterations > 3) iterations = 3;\n if (iterations < 1) iterations = 1;\n\n const imageData = context.getImageData(top_x, top_y, width, height);\n\n const pixels = imageData.data;\n\n let rsum;\n let gsum;\n let bsum;\n let x;\n let y;\n let i;\n let p;\n let p1;\n let p2;\n let yp;\n let yi;\n let yw;\n let wm = width - 1;\n let hm = height - 1;\n let rad1 = radius + 1;\n\n let r = [];\n let g = [];\n let b = [];\n\n let mul_sum = mul_table[radius];\n let shg_sum = shg_table[radius];\n\n let vmin = [];\n let vmax = [];\n\n while (iterations-- > 0) {\n yw = yi = 0;\n\n for (y = 0; y < height; y++) {\n rsum = pixels[yw] * rad1;\n gsum = pixels[yw + 1] * rad1;\n bsum = pixels[yw + 2] * rad1;\n\n for (i = 1; i <= radius; i++) {\n p = yw + (((i > wm ? wm : i)) << 2);\n rsum += pixels[p++];\n gsum += pixels[p++];\n bsum += pixels[p++];\n }\n\n for (x = 0; x < width; x++) {\n r[yi] = rsum;\n g[yi] = gsum;\n b[yi] = bsum;\n\n if (y == 0) {\n vmin[x] = ((p = x + rad1) < wm ? p : wm) << 2;\n vmax[x] = ((p = x - radius) > 0 ? p << 2 : 0);\n }\n\n p1 = yw + vmin[x];\n p2 = yw + vmax[x];\n\n rsum += pixels[p1++] - pixels[p2++];\n gsum += pixels[p1++] - pixels[p2++];\n bsum += pixels[p1++] - pixels[p2++];\n\n yi++;\n }\n yw += (width << 2);\n }\n\n for (x = 0; x < width; x++) {\n yp = x;\n rsum = r[yp] * rad1;\n gsum = g[yp] * rad1;\n bsum = b[yp] * rad1;\n\n for (i = 1; i <= radius; i++) {\n yp += (i > hm ? 0 : width);\n rsum += r[yp];\n gsum += g[yp];\n bsum += b[yp];\n }\n\n yi = x << 2;\n for (y = 0; y < height; y++) {\n pixels[yi] = (rsum * mul_sum) >>> shg_sum;\n pixels[yi + 1] = (gsum * mul_sum) >>> shg_sum;\n pixels[yi + 2] = (bsum * mul_sum) >>> shg_sum;\n\n if (x == 0) {\n vmin[y] = ((p = y + rad1) < hm ? p : hm) * width;\n vmax[y] = ((p = y - radius) > 0 ? p * width : 0);\n }\n\n p1 = x + vmin[y];\n p2 = x + vmax[y];\n\n rsum += r[p1] - r[p2];\n gsum += g[p1] - g[p2];\n bsum += b[p1] - b[p2];\n\n yi += width << 2;\n }\n }\n }\n\n context.putImageData(imageData, top_x, top_y);\n}\n","import { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { AudioOrigin, GlobalSearchContent } from '../types';\nimport { ApiMessage } from '../api/types';\n\nimport { IS_SAFARI } from './environment';\nimport safePlay from './safePlay';\nimport { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio';\nimport { getMessageKey, MessageKey, parseMessageKey } from '../modules/helpers';\nimport { fastRaf } from './schedulers';\nimport { selectCurrentMessageList } from '../modules/selectors';\n\ntype Handler = (eventName: string, e: Event) => void;\nexport type TrackId = `${MessageKey}-${number}`;\n\nexport interface Track {\n audio: HTMLAudioElement;\n proxy: HTMLAudioElement;\n type: 'voice' | 'audio';\n handlers: Handler[];\n onForcePlay?: NoneToVoidFunction;\n onTrackChange?: NoneToVoidFunction;\n}\n\nconst tracks = new Map();\nlet voiceQueue: TrackId[] = [];\nlet musicQueue: TrackId[] = [];\n\nlet currentTrackId: TrackId | undefined;\n\nfunction createAudio(\n trackId: TrackId,\n type: Track['type'],\n onForcePlay?: NoneToVoidFunction,\n onTrackChange?: NoneToVoidFunction,\n): Track {\n const audio = new Audio();\n\n function handleEvent(eventName: string) {\n return (e: Event) => {\n if (!tracks.has(trackId)) {\n return;\n }\n\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n tracks.get(trackId)!.handlers.forEach((handler) => {\n handler(eventName, e);\n });\n };\n }\n\n audio.addEventListener('timeupdate', handleEvent('onTimeUpdate'));\n audio.addEventListener('play', handleEvent('onPlay'));\n audio.addEventListener('pause', handleEvent('onPause'));\n audio.addEventListener('loadstart', handleEvent('onLoadStart'));\n audio.addEventListener('loadeddata', handleEvent('onLoadedData'));\n audio.addEventListener('playing', handleEvent('onPlaying'));\n audio.addEventListener('ended', () => {\n if (!tracks.has(trackId)) {\n return;\n }\n\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n playNext(trackId);\n });\n\n return {\n audio,\n type,\n proxy: new Proxy(audio, {\n get: (target, key: keyof HTMLAudioElement) => target[key],\n }),\n handlers: [],\n onForcePlay,\n onTrackChange,\n };\n}\n\nfunction playNext(trackId: TrackId, isReverseOrder?: boolean) {\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack) {\n currentTrack.audio.pause();\n currentTrack.audio.currentTime = 0;\n if (currentTrack.onTrackChange) currentTrack.onTrackChange();\n }\n\n const origin = getGlobal().audioPlayer.origin || AudioOrigin.Inline;\n\n const nextTrackId = findNextInQueue(trackId, origin, isReverseOrder);\n if (!nextTrackId) {\n return;\n }\n\n if (!tracks.has(nextTrackId)) {\n // A bit hacky way to continue playlist when switching chat\n getDispatch().openAudioPlayer(parseMessageKey(splitTrackId(nextTrackId).messageKey));\n\n return;\n }\n\n const nextTrack = tracks.get(nextTrackId)!;\n\n if (nextTrack.onForcePlay) {\n nextTrack.onForcePlay();\n }\n\n currentTrackId = nextTrackId;\n\n if (nextTrack.audio.src) {\n safePlay(nextTrack.audio);\n }\n}\n\nexport function stopCurrentAudio() {\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack) {\n currentTrack.audio.pause();\n }\n}\n\nexport function register(\n trackId: TrackId,\n trackType: Track['type'],\n handler: Handler,\n onForcePlay?: NoneToVoidFunction,\n onTrackChange?: NoneToVoidFunction,\n) {\n if (!tracks.has(trackId)) {\n const track = createAudio(trackId, trackType, onForcePlay, onTrackChange);\n tracks.set(trackId, track);\n addTrackToQueue(track, trackId);\n }\n const { audio, proxy, handlers } = tracks.get(trackId)!;\n\n handlers.push(handler);\n\n return {\n play(src: string) {\n if (!audio.paused) return;\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack && currentTrackId !== trackId) {\n currentTrack.audio.pause();\n currentTrack.audio.currentTime = 0;\n if (isSafariPatchInProgress(currentTrack.audio)) {\n currentTrack.audio.dataset.preventPlayAfterPatch = 'true';\n }\n if (currentTrack.onTrackChange) currentTrack.onTrackChange();\n }\n\n currentTrackId = trackId;\n\n if (!audio.src) {\n audio.src = src;\n audio.preload = 'auto';\n\n if (src.includes('/progressive/') && IS_SAFARI) {\n delete audio.dataset.preventPlayAfterPatch;\n patchSafariProgressiveAudio(audio);\n }\n }\n\n safePlay(audio);\n cleanUpQueue(trackType, trackId);\n },\n\n pause() {\n if (currentTrackId === trackId) {\n audio.pause();\n }\n },\n\n stop() {\n if (currentTrackId === trackId) {\n // Hack, reset src to remove default media session notification\n const prevSrc = audio.src;\n audio.pause();\n // onPause not called otherwise, but required to sync UI\n fastRaf(() => {\n audio.src = '';\n audio.src = prevSrc;\n });\n }\n },\n\n setCurrentTime(time: number) {\n if (currentTrackId === trackId) {\n if (audio.fastSeek) {\n audio.fastSeek(time);\n } else {\n audio.currentTime = time;\n }\n }\n },\n\n setVolume(volume: number) {\n if (currentTrackId === trackId) {\n audio.volume = volume;\n audio.muted = false;\n }\n },\n\n setPlaybackRate(rate: number) {\n if (currentTrackId === trackId) {\n audio.playbackRate = rate;\n }\n },\n\n toggleMuted(muted?: boolean) {\n if (muted === undefined) {\n audio.muted = !audio.muted;\n } else {\n audio.muted = muted;\n }\n },\n\n proxy,\n\n requestNextTrack() {\n playNext(trackId);\n },\n\n isLast() {\n return !findNextInQueue(trackId, getGlobal().audioPlayer.origin);\n },\n\n isFirst() {\n return !findNextInQueue(trackId, getGlobal().audioPlayer.origin, true);\n },\n\n requestPreviousTrack() {\n playNext(trackId, true);\n },\n\n destroy(shouldRemoveFromQueue = false) {\n const track = tracks.get(trackId);\n if (!track) {\n return;\n }\n\n track.handlers = track.handlers.filter((h) => h !== handler);\n\n if (!track.handlers.length) {\n track.audio.pause();\n tracks.delete(trackId);\n\n if (shouldRemoveFromQueue) {\n removeFromQueue(track, trackId);\n }\n\n if (trackId === currentTrackId) {\n currentTrackId = undefined;\n }\n }\n },\n };\n}\n\nfunction getTrackQueue(track: Track) {\n switch (track.type) {\n case 'audio': return musicQueue;\n case 'voice': return voiceQueue;\n default: return undefined;\n }\n}\n\nfunction addTrackToQueue(track: Track, trackId: TrackId) {\n if (track.type === 'audio' && !musicQueue.includes(trackId)) {\n musicQueue.push(trackId);\n musicQueue.sort(trackIdComparator);\n }\n\n if (track.type === 'voice' && !voiceQueue.includes(trackId)) {\n voiceQueue.push(trackId);\n voiceQueue.sort(trackIdComparator);\n }\n}\n\nfunction removeFromQueue(track: Track, trackId: TrackId) {\n const trackIdFilter = (el: TrackId) => el !== trackId;\n if (track.type === 'audio') {\n musicQueue = musicQueue.filter(trackIdFilter);\n }\n\n if (track.type === 'voice') {\n voiceQueue = voiceQueue.filter(trackIdFilter);\n }\n}\n\nfunction cleanUpQueue(type: Track['type'], trackId: TrackId) {\n if (getGlobal().globalSearch.currentContent === GlobalSearchContent.Music) return;\n const { chatId } = parseMessageKey(splitTrackId(trackId).messageKey);\n const openedChatId = selectCurrentMessageList(getGlobal())?.chatId;\n const queueFilter = (id: string) => (\n id.startsWith(`msg${chatId}`) || (openedChatId && id.startsWith(`msg${openedChatId}`))\n );\n\n if (type === 'audio') {\n musicQueue = musicQueue.filter(queueFilter);\n }\n\n if (type === 'voice') {\n voiceQueue = voiceQueue.filter(queueFilter);\n }\n}\n\nfunction findNextInQueue(currentId: TrackId, origin = AudioOrigin.Inline, isReverseOrder?: boolean) {\n const track = tracks.get(currentId)!;\n const queue = getTrackQueue(track);\n if (!queue) return undefined;\n\n if (origin === AudioOrigin.Search) {\n const index = queue.indexOf(currentId);\n if (index < 0) return undefined;\n const direction = isReverseOrder ? -1 : 1;\n return queue[index + direction];\n }\n\n const { chatId } = parseMessageKey(splitTrackId(currentId).messageKey);\n const chatAudio = queue.filter((id) => id.startsWith(`msg${chatId}`));\n const index = chatAudio.indexOf(currentId);\n if (index < 0) return undefined;\n let direction = origin === AudioOrigin.Inline ? -1 : 1;\n if (isReverseOrder) direction *= -1;\n return chatAudio[index + direction];\n}\n\nexport function makeTrackId(message: ApiMessage): TrackId {\n return `${getMessageKey(message)}-${message.date}`;\n}\n\nfunction splitTrackId(trackId: TrackId) {\n const messageKey = trackId.match(/^msg(-?\\d+)-(\\d+)/)![0] as MessageKey;\n const date = Number(trackId.split('-').pop());\n return {\n messageKey,\n date,\n };\n}\n\n// Descending order by date\nfunction trackIdComparator(one?: TrackId, two?: TrackId) {\n if (!one || !two) return 0;\n const { date: dateOne, messageKey: keyOne } = splitTrackId(one);\n const { date: dateTwo, messageKey: keyTwo } = splitTrackId(two);\n const diff = dateTwo - dateOne;\n return diff === 0 ? keyTwo.localeCompare(keyOne) : diff;\n}\n","import { IS_IOS } from './environment';\n\nexport enum SwipeDirection {\n Up,\n Down,\n Left,\n Right,\n}\n\ninterface CaptureOptions {\n onCapture?: (e: MouseEvent | TouchEvent) => void;\n onRelease?: (e: MouseEvent | TouchEvent) => void;\n onDrag?: (\n e: MouseEvent | TouchEvent,\n captureEvent: MouseEvent | TouchEvent,\n params: {\n dragOffsetX: number;\n dragOffsetY: number;\n },\n ) => void;\n onSwipe?: (e: Event, direction: SwipeDirection) => boolean;\n onZoom?: (e: TouchEvent, params: {\n // Relative zoom factor\n zoomFactor: number;\n\n // center coordinate of the initial pinch\n initialCenterX: number;\n initialCenterY: number;\n\n // offset of the pinch center (current from initial)\n dragOffsetX: number;\n dragOffsetY: number;\n\n // center coordinate of the current pinch\n currentCenterX: number;\n currentCenterY: number;\n }) => void;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n onDoubleClick?: (e: MouseEvent | RealTouchEvent, params: { centerX: number; centerY: number }) => void;\n excludedClosestSelector?: string;\n selectorToPreventScroll?: string;\n maxZoom?: number;\n minZoom?: number;\n isNotPassive?: boolean;\n withCursor?: boolean;\n}\n\n// https://stackoverflow.com/questions/11287877/how-can-i-get-e-offsetx-on-mobile-ipad\n// Android does not have this value, and iOS has it but as read-only\nexport interface RealTouchEvent extends TouchEvent {\n pageX?: number;\n pageY?: number;\n}\n\ntype TSwipeAxis =\n 'x'\n | 'y'\n | undefined;\n\nexport const IOS_SCREEN_EDGE_THRESHOLD = 20;\nconst MOVED_THRESHOLD = 15;\nconst SWIPE_THRESHOLD = 50;\n\nfunction getDistance(a: Touch, b?: Touch) {\n if (!b) return 0;\n return Math.sqrt((b.pageX - a.pageX) ** 2 + (b.pageY - a.pageY) ** 2);\n}\n\nfunction getTouchCenter(a: Touch, b: Touch) {\n return {\n x: (a.pageX + b.pageX) / 2,\n y: (a.pageY + b.pageY) / 2,\n };\n}\n\nlet lastClickTime = 0;\n\nexport function captureEvents(element: HTMLElement, options: CaptureOptions) {\n let captureEvent: MouseEvent | RealTouchEvent | undefined;\n let hasMoved = false;\n let hasSwiped = false;\n let initialDistance = 0;\n let initialTouchCenter = { x: window.innerWidth / 2, y: window.innerHeight / 2 };\n let initialSwipeAxis: TSwipeAxis | undefined;\n\n function onCapture(e: MouseEvent | RealTouchEvent) {\n if (options.excludedClosestSelector && (\n (e.target as HTMLElement).matches(options.excludedClosestSelector)\n || (e.target as HTMLElement).closest(options.excludedClosestSelector)\n )) {\n return;\n }\n\n captureEvent = e;\n\n if (e.type === 'mousedown') {\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onRelease);\n } else if (e.type === 'touchstart') {\n // We need to always listen on `touchstart` target:\n // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed\n const target = e.target as HTMLElement;\n target.addEventListener('touchmove', onMove, { passive: true });\n target.addEventListener('touchend', onRelease);\n target.addEventListener('touchcancel', onRelease);\n\n if ('touches' in e) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n\n if (e.touches.length === 2) {\n initialDistance = getDistance(e.touches[0], e.touches[1]);\n initialTouchCenter = getTouchCenter(e.touches[0], e.touches[1]);\n }\n }\n }\n\n document.body.classList.add('no-selection');\n if (options.withCursor) {\n document.body.classList.add('cursor-grabbing');\n }\n\n if (options.onCapture) {\n options.onCapture(e);\n }\n }\n\n function onRelease(e?: MouseEvent | TouchEvent) {\n if (captureEvent) {\n if (options.withCursor) {\n document.body.classList.remove('cursor-grabbing');\n }\n document.body.classList.remove('no-selection');\n\n document.removeEventListener('mouseup', onRelease);\n document.removeEventListener('mousemove', onMove);\n (captureEvent.target as HTMLElement).removeEventListener('touchcancel', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchend', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchmove', onMove);\n\n if (IS_IOS && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = '';\n });\n }\n\n if (e) {\n if (hasMoved) {\n if (options.onRelease) {\n options.onRelease(e);\n }\n } else if (e.type === 'mouseup') {\n if (options.onDoubleClick && Date.now() - lastClickTime < 300) {\n options.onDoubleClick(e, {\n centerX: captureEvent!.pageX!,\n centerY: captureEvent!.pageY!,\n });\n } else if (options.onClick && (!('button' in e) || e.button === 0)) {\n options.onClick(e);\n }\n lastClickTime = Date.now();\n }\n }\n }\n\n hasMoved = false;\n hasSwiped = false;\n initialDistance = 0;\n initialSwipeAxis = undefined;\n initialTouchCenter = { x: window.innerWidth / 2, y: window.innerHeight / 2 };\n captureEvent = undefined;\n }\n\n function onMove(e: MouseEvent | RealTouchEvent) {\n if (captureEvent) {\n if (e.type === 'touchmove' && ('touches' in e)) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n\n if (options.onZoom && initialDistance > 0 && e.touches.length === 2) {\n const endDistance = getDistance(e.touches[0], e.touches[1]);\n const touchCenter = getTouchCenter(e.touches[0], e.touches[1]);\n const dragOffsetX = touchCenter.x - initialTouchCenter.x;\n const dragOffsetY = touchCenter.y - initialTouchCenter.y;\n const zoomFactor = endDistance / initialDistance;\n options.onZoom(e, {\n zoomFactor,\n initialCenterX: initialTouchCenter.x,\n initialCenterY: initialTouchCenter.y,\n dragOffsetX,\n dragOffsetY,\n currentCenterX: touchCenter.x,\n currentCenterY: touchCenter.y,\n });\n if (zoomFactor !== 1) hasMoved = true;\n }\n }\n\n const dragOffsetX = e.pageX! - captureEvent.pageX!;\n const dragOffsetY = e.pageY! - captureEvent.pageY!;\n\n if (Math.abs(dragOffsetX) >= MOVED_THRESHOLD || Math.abs(dragOffsetY) >= MOVED_THRESHOLD) {\n hasMoved = true;\n }\n\n let shouldPreventScroll = false;\n\n if (options.onDrag) {\n options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY });\n shouldPreventScroll = true;\n }\n\n if (options.onSwipe && !hasSwiped) {\n hasSwiped = onSwipe(e, dragOffsetX, dragOffsetY);\n shouldPreventScroll = hasSwiped;\n }\n\n if (IS_IOS && shouldPreventScroll && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = 'hidden';\n });\n }\n }\n }\n\n function onSwipe(e: MouseEvent | RealTouchEvent, dragOffsetX: number, dragOffsetY: number) {\n // Avoid conflicts with swipe-to-back gestures\n if (IS_IOS) {\n const x = (e as RealTouchEvent).touches[0].pageX;\n if (x <= IOS_SCREEN_EDGE_THRESHOLD || x >= window.innerWidth - IOS_SCREEN_EDGE_THRESHOLD) {\n return false;\n }\n }\n\n const xAbs = Math.abs(dragOffsetX);\n const yAbs = Math.abs(dragOffsetY);\n\n if (dragOffsetX && dragOffsetY) {\n const ratio = Math.max(xAbs, yAbs) / Math.min(xAbs, yAbs);\n // Diagonal swipe\n if (ratio < 2) {\n return false;\n }\n }\n\n let axis: TSwipeAxis | undefined;\n if (xAbs >= SWIPE_THRESHOLD) {\n axis = 'x';\n } else if (yAbs >= SWIPE_THRESHOLD) {\n axis = 'y';\n }\n\n if (!axis) {\n return false;\n }\n\n if (!initialSwipeAxis) {\n initialSwipeAxis = axis;\n } else if (initialSwipeAxis !== axis) {\n // Prevent horizontal swipe after vertical to prioritize scroll\n return false;\n }\n\n return processSwipe(e, axis, dragOffsetX, dragOffsetY, options.onSwipe!);\n }\n\n element.addEventListener('mousedown', onCapture);\n element.addEventListener('touchstart', onCapture, { passive: !options.isNotPassive });\n\n return () => {\n onRelease();\n\n element.removeEventListener('touchstart', onCapture);\n element.removeEventListener('mousedown', onCapture);\n };\n}\n\nfunction processSwipe(\n e: Event,\n currentSwipeAxis: TSwipeAxis,\n dragOffsetX: number,\n dragOffsetY: number,\n onSwipe: (e: Event, direction: SwipeDirection) => boolean,\n) {\n if (currentSwipeAxis === 'x') {\n if (dragOffsetX < 0) {\n return onSwipe(e, SwipeDirection.Left);\n } else {\n return onSwipe(e, SwipeDirection.Right);\n }\n } else if (currentSwipeAxis === 'y') {\n if (dragOffsetY < 0) {\n return onSwipe(e, SwipeDirection.Up);\n } else {\n return onSwipe(e, SwipeDirection.Down);\n }\n }\n\n return false;\n}\n","// Sometimes event is fired earlier than animation completes\nconst ANIMATION_END_DELAY = 50;\n\nexport function waitForTransitionEnd(node: Node, handler: NoneToVoidFunction, propertyName?: string) {\n waitForEndEvent('transitionend', node, handler, propertyName);\n}\n\nexport function waitForAnimationEnd(node: Node, handler: NoneToVoidFunction, animationName?: string) {\n waitForEndEvent('animationend', node, handler, animationName);\n}\n\nfunction waitForEndEvent(\n eventType: 'transitionend' | 'animationend',\n node: Node,\n handler: NoneToVoidFunction,\n detailedName?: string,\n) {\n let isHandled = false;\n\n node.addEventListener(eventType, function handleAnimationEnd(e: TransitionEvent | AnimationEvent) {\n if (isHandled || e.target !== e.currentTarget) {\n return;\n }\n\n if (detailedName && (\n (e instanceof TransitionEvent && e.propertyName === detailedName)\n || (e instanceof AnimationEvent && e.animationName === detailedName)\n )) {\n return;\n }\n\n isHandled = true;\n\n node.removeEventListener(eventType, handleAnimationEnd as EventListener);\n\n setTimeout(() => {\n handler();\n }, ANIMATION_END_DELAY);\n } as EventListener);\n}\n","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { FocusDirection } from '../types';\n\nimport {\n ANIMATION_LEVEL_MIN,\n FAST_SMOOTH_MAX_DISTANCE, FAST_SMOOTH_MAX_DURATION, FAST_SMOOTH_MIN_DURATION,\n FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE,\n} from '../config';\nimport { IS_ANDROID } from './environment';\nimport { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';\nimport { animateSingle } from './animation';\nimport { fastRaf } from './schedulers';\n\nlet isAnimating = false;\n\nexport default function fastSmoothScroll(\n container: HTMLElement,\n element: HTMLElement,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const scrollFrom = calculateScrollFrom(container, element, maxDistance, forceDirection);\n\n if (forceDirection === FocusDirection.Static) {\n scrollWithJs(container, element, scrollFrom, position, margin, 0);\n return;\n }\n\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n forceDuration = 0;\n }\n\n scrollWithJs(container, element, scrollFrom, position, margin, forceDuration, forceNormalContainerHeight);\n}\n\nexport function isAnimatingScroll() {\n return isAnimating;\n}\n\nfunction calculateScrollFrom(\n container: HTMLElement,\n element: HTMLElement,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n) {\n const { offsetTop: elementTop } = element;\n const { scrollTop } = container;\n\n if (forceDirection === undefined) {\n const offset = elementTop - container.scrollTop;\n\n if (offset < -maxDistance) {\n return scrollTop + (offset + maxDistance);\n } else if (offset > maxDistance) {\n return scrollTop + (offset - maxDistance);\n }\n } else if (forceDirection === FocusDirection.Up) {\n return elementTop + maxDistance;\n } else if (forceDirection === FocusDirection.Down) {\n return Math.max(0, elementTop - maxDistance);\n }\n\n return scrollTop;\n}\n\nfunction scrollWithJs(\n container: HTMLElement,\n element: HTMLElement,\n scrollFrom: number,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const { scrollTop: currentScrollTop, offsetHeight: containerHeight, scrollHeight } = container;\n const targetContainerHeight = forceNormalContainerHeight && container.dataset.normalHeight\n ? Number(container.dataset.normalHeight)\n : containerHeight;\n\n if (currentScrollTop !== scrollFrom) {\n container.scrollTop = scrollFrom;\n }\n\n let path!: number;\n\n switch (position) {\n case 'start':\n path = (elementTop - margin) - scrollFrom + (IS_ANDROID ? 1 : 0);\n break;\n case 'end':\n path = (elementTop + elementHeight + margin) - (scrollFrom + targetContainerHeight);\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n case 'centerOrTop':\n path = elementHeight < targetContainerHeight\n ? (elementTop + elementHeight / 2) - (scrollFrom + targetContainerHeight / 2)\n : (elementTop - margin) - scrollFrom;\n break;\n }\n\n if (path < 0) {\n const remainingPath = -scrollFrom;\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollHeight - (scrollFrom + targetContainerHeight);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollFrom + path;\n\n if (forceDuration === 0) {\n container.scrollTop = target;\n return;\n }\n\n isAnimating = true;\n\n const absPath = Math.abs(path);\n const transition = absPath < FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE ? shortTransition : longTransition;\n const duration = forceDuration || (\n FAST_SMOOTH_MIN_DURATION\n + (absPath / FAST_SMOOTH_MAX_DISTANCE) * (FAST_SMOOTH_MAX_DURATION - FAST_SMOOTH_MIN_DURATION)\n );\n const startAt = Date.now();\n const onHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n fastRaf(() => {\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n const currentPath = path * (1 - transition(t));\n\n container.scrollTop = Math.round(target - currentPath);\n\n isAnimating = t < 1;\n\n if (!isAnimating) {\n onHeavyAnimationStop();\n }\n\n return isAnimating;\n });\n });\n}\n\nfunction longTransition(t: number) {\n return 1 - ((1 - t) ** 5);\n}\n\nfunction shortTransition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MIN } from '../config';\nimport { animate } from './animation';\nimport { fastRaf } from './schedulers';\n\nconst DEFAULT_DURATION = 300;\n\nexport default function fastSmoothScrollHorizontal(container: HTMLElement, left: number, duration = DEFAULT_DURATION) {\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n duration = 0;\n }\n\n scrollWithJs(container, left, duration);\n}\n\nfunction scrollWithJs(container: HTMLElement, left: number, duration: number) {\n const isRtl = container.getAttribute('dir') === 'rtl';\n const { scrollLeft, offsetWidth: containerWidth, scrollWidth } = container;\n let path = left - scrollLeft;\n\n if (path < 0) {\n const remainingPath = -scrollLeft * (isRtl ? -1 : 1);\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollWidth - (scrollLeft + containerWidth);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollLeft + path;\n\n if (duration === 0) {\n container.scrollLeft = target;\n return;\n }\n\n const startAt = Date.now();\n\n fastRaf(() => {\n animate(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n\n const currentPath = path * (1 - transition(t));\n container.scrollLeft = Math.round(target - currentPath);\n\n return t < 1;\n });\n });\n}\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { IS_TOUCH_ENV } from './environment';\n\nexport default function focusEditableElement(element: HTMLElement, force?: boolean, forcePlaceCaretAtEnd?: boolean) {\n if (!force && element === document.activeElement) {\n return;\n }\n\n const selection = window.getSelection()!;\n const range = document.createRange();\n const lastChild = element.lastChild || element;\n\n if (!IS_TOUCH_ENV && !forcePlaceCaretAtEnd && (!lastChild || !lastChild.nodeValue)) {\n element.focus();\n return;\n }\n\n range.selectNodeContents(forcePlaceCaretAtEnd ? element : lastChild);\n // `false` means collapse to the end rather than the start\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","export default function getKeyFromEvent(e: KeyboardEvent) {\n const key = 'key' in e ? e.key : e.code;\n\n return key.startsWith('Key') ? key.slice(3).toLowerCase() : key;\n}\n","const ELEMENT_NODE = 1;\n\nexport default function getMessageIdsForSelectedText() {\n let selectedFragments = window.getSelection()?.getRangeAt(0).cloneContents();\n if (!selectedFragments || selectedFragments.childElementCount === 0) {\n return;\n }\n\n const messageIds = Array.from(selectedFragments.children)\n .reduce((result, node) => {\n if (node.nodeType === ELEMENT_NODE && node.classList.contains('message-date-group')) {\n return Array.from(node.querySelectorAll('.Message'))\n .reduce((acc, messageEl) => acc.concat(Number((messageEl as HTMLElement).dataset.messageId)), result);\n } else if (node.nodeType === ELEMENT_NODE && node.classList.contains('Message')) {\n return result.concat(Number((node as HTMLElement).dataset.messageId));\n }\n\n return result;\n }, [] as number[]);\n\n\n // Cleanup a document fragment because it is playing media content in the background\n while (selectedFragments.firstChild) {\n selectedFragments.removeChild(selectedFragments.firstChild);\n }\n selectedFragments = undefined;\n\n return messageIds;\n}\n","export type MediaSessionHandlers = {\n play?: () => void;\n pause?: () => void;\n stop?: () => void;\n\n previoustrack?: () => void;\n nexttrack?: () => void;\n\n togglemicrophone?: () => void;\n togglecamera?: () => void;\n hangup?: () => void;\n\n seekbackward?: (details: MediaSessionActionDetails) => void;\n seekforward?: (details: MediaSessionActionDetails) => void;\n seekTo?: ((details: MediaSessionActionDetails) => void);\n};\n\ninterface MediaMetadataParameters {\n title?: string;\n artist?: string;\n album?: string;\n artwork?: MediaImage[];\n}\n\nconst DEFAULT_HANDLERS = {\n play: undefined,\n pause: undefined,\n seekbackward: undefined,\n seekforward: undefined,\n previoustrack: undefined,\n nexttrack: undefined,\n stop: undefined,\n seekTo: undefined,\n};\n\nexport function registerMediaSession(metadata?: MediaMetadata, handlers?: MediaSessionHandlers) {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n if (metadata) updateMetadata(metadata);\n if (handlers) setMediaSessionHandlers(handlers);\n } else {\n // eslint-disable-next-line no-console\n console.warn('MediaSession API not supported in this browser');\n }\n}\n\nexport function updateMetadata(metadata?: MediaMetadata) {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n // eslint-disable-next-line no-null/no-null\n mediaSession.metadata = metadata ?? null;\n }\n}\n\nexport function setMediaSessionHandlers(handlers: MediaSessionHandlers) {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n Object.entries({ ...DEFAULT_HANDLERS, ...handlers }).forEach(([key, handler]) => {\n try {\n // @ts-ignore API not standardized yet\n mediaSession.setActionHandler(key, handler);\n } catch (err) {\n // Handler not supported, ignoring\n }\n });\n }\n}\n\nexport function clearMediaSession() {\n const { mediaSession } = window.navigator;\n if (mediaSession) {\n // eslint-disable-next-line no-null/no-null\n mediaSession.metadata = null;\n setMediaSessionHandlers(DEFAULT_HANDLERS);\n if (mediaSession.playbackState) mediaSession.playbackState = 'none';\n mediaSession.setPositionState?.();\n }\n}\n\nexport function setPlaybackState(state: 'none' | 'paused' | 'playing' = 'none') {\n const { mediaSession } = window.navigator;\n if (mediaSession && mediaSession.playbackState) {\n mediaSession.playbackState = state;\n }\n}\n\nexport function setPositionState(state?: MediaPositionState) {\n if (!state || state.position === undefined || state.duration === undefined) return;\n state.position = Math.min(state.position, state.duration);\n\n const { mediaSession } = window.navigator;\n mediaSession?.setPositionState?.(state);\n}\n\nexport function setMicrophoneActive(active: boolean) {\n const { mediaSession } = window.navigator;\n mediaSession?.setMicrophoneActive?.(active);\n}\n\nexport function setCameraActive(active: boolean) {\n const { mediaSession } = window.navigator;\n mediaSession?.setCameraActive?.(active);\n}\n\nexport function buildMediaMetadata({\n title, artist, album, artwork,\n}: MediaMetadataParameters) {\n if ('MediaMetadata' in window) {\n return new window.MediaMetadata({\n title,\n artist,\n album,\n artwork,\n });\n }\n return undefined;\n}\n","import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../api/types';\nimport { IS_EMOJI_SUPPORTED } from './environment';\n\nconst ENTITY_CLASS_BY_NODE_NAME: Record = {\n B: ApiMessageEntityTypes.Bold,\n STRONG: ApiMessageEntityTypes.Bold,\n I: ApiMessageEntityTypes.Italic,\n EM: ApiMessageEntityTypes.Italic,\n U: ApiMessageEntityTypes.Underline,\n S: ApiMessageEntityTypes.Strike,\n STRIKE: ApiMessageEntityTypes.Strike,\n DEL: ApiMessageEntityTypes.Strike,\n CODE: ApiMessageEntityTypes.Code,\n PRE: ApiMessageEntityTypes.Pre,\n BLOCKQUOTE: ApiMessageEntityTypes.Blockquote,\n};\n\nconst MAX_TAG_DEEPNESS = 3;\n\nexport default function parseMessageInput(html: string): ApiFormattedText {\n const fragment = document.createElement('div');\n fragment.innerHTML = parseMarkdown(html);\n const text = fragment.innerText.trim().replace(/\\u200b+/g, '');\n let textIndex = 0;\n let recursionDeepness = 0;\n const entities: ApiMessageEntity[] = [];\n\n function addEntity(node: ChildNode) {\n const { index, entity } = getEntityDataFromNode(node, text, textIndex);\n\n if (entity) {\n textIndex = index;\n entities.push(entity);\n } else if (node.textContent) {\n textIndex += node.textContent.length;\n }\n\n if (node.hasChildNodes() && recursionDeepness <= MAX_TAG_DEEPNESS) {\n recursionDeepness += 1;\n Array.from(node.childNodes).forEach(addEntity);\n }\n }\n\n Array.from(fragment.childNodes).forEach((node) => {\n recursionDeepness = 1;\n addEntity(node);\n });\n\n return {\n text,\n entities: entities.length ? entities : undefined,\n };\n}\n\nfunction parseMarkdown(html: string) {\n let parsedHtml = html.slice(0);\n\n if (!IS_EMOJI_SUPPORTED) {\n // Emojis\n parsedHtml = parsedHtml.replace(/]+alt=\"([^\"]+)\"[^>]*>/gm, '$1');\n }\n\n // Strip redundant nbsp's\n parsedHtml = parsedHtml.replace(/ /g, ' ');\n\n // Replace

with newline (new line in Safari)\n parsedHtml = parsedHtml.replace(/
]*)?><\\/div>/g, '\\n');\n // Replace
with newline\n parsedHtml = parsedHtml.replace(/]*)?>/g, '\\n');\n\n // Strip redundant
tags\n parsedHtml = parsedHtml.replace(/<\\/div>(\\s*)
/g, '\\n');\n parsedHtml = parsedHtml.replace(/
/g, '\\n');\n parsedHtml = parsedHtml.replace(/<\\/div>/g, '');\n\n // Pre\n parsedHtml = parsedHtml.replace(/^`{3}(.*[\\n\\r][^]*?^)`{3}/gm, '
$1
');\n parsedHtml = parsedHtml.replace(/[`]{3}([^`]+)[`]{3}/g, '
$1
');\n\n // Code\n parsedHtml = parsedHtml.replace(/[`]{1}([^`\\n]+)[`]{1}/g, '$1');\n\n // Other simple markdown\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n '$1$2$3',\n );\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n '$1$2$3',\n );\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n '$1$2$3',\n );\n parsedHtml = parsedHtml.replace(\n /(^|\\s)(?!)(\\s|$)/g,\n `$1$2$3`,\n );\n\n return parsedHtml;\n}\n\nfunction getEntityDataFromNode(\n node: ChildNode,\n rawText: string,\n textIndex: number,\n): { index: number; entity?: ApiMessageEntity } {\n const type = getEntityTypeFromNode(node);\n if (!type || !node.textContent) {\n return {\n index: textIndex,\n entity: undefined,\n };\n }\n\n const rawIndex = rawText.indexOf(node.textContent, textIndex);\n // In some cases, last text entity ends with a newline (which gets trimmed from `rawText`).\n // In this case, `rawIndex` would return `-1`, so we use `textIndex` instead.\n const index = rawIndex >= 0 ? rawIndex : textIndex;\n const offset = rawText.substring(0, index).length;\n const { length } = rawText.substring(index, index + node.textContent.length);\n\n let url: string | undefined;\n let userId: string | undefined;\n if (type === ApiMessageEntityTypes.TextUrl) {\n url = (node as HTMLAnchorElement).href;\n }\n if (type === ApiMessageEntityTypes.MentionName) {\n userId = (node as HTMLAnchorElement).dataset.userId;\n }\n\n return {\n index,\n entity: {\n type,\n offset,\n length,\n ...(url && { url }),\n ...(userId && { userId }),\n },\n };\n}\n\nfunction getEntityTypeFromNode(node: ChildNode) {\n if (ENTITY_CLASS_BY_NODE_NAME[node.nodeName]) {\n return ENTITY_CLASS_BY_NODE_NAME[node.nodeName];\n }\n\n if (node.nodeName === 'A') {\n const anchor = node as HTMLAnchorElement;\n if (anchor.dataset.entityType === ApiMessageEntityTypes.MentionName) {\n return ApiMessageEntityTypes.MentionName;\n }\n if (anchor.dataset.entityType === ApiMessageEntityTypes.Url) {\n return ApiMessageEntityTypes.Url;\n }\n if (anchor.href.startsWith('mailto:')) {\n return ApiMessageEntityTypes.Email;\n }\n if (anchor.href.startsWith('tel:')) {\n return ApiMessageEntityTypes.Phone;\n }\n if (anchor.href !== anchor.textContent) {\n return ApiMessageEntityTypes.TextUrl;\n }\n\n return ApiMessageEntityTypes.Url;\n }\n\n if (node.nodeName === 'SPAN') {\n return (node as HTMLElement).dataset.entityType;\n }\n\n return undefined;\n}\n","/*\n * Thanks to Ace Monkey for this mind-blowing patch.\n */\n\nexport function patchSafariProgressiveAudio(audioEl: HTMLAudioElement) {\n if (audioEl.dataset.patchedForSafari) {\n return;\n }\n\n audioEl.addEventListener('play', () => {\n const t = audioEl.currentTime;\n\n audioEl.dataset.patchForSafariInProgress = 'true';\n function onProgress() {\n if (!audioEl.buffered.length) {\n return;\n }\n audioEl.currentTime = audioEl.duration - 1;\n audioEl.addEventListener('progress', () => {\n delete audioEl.dataset.patchForSafariInProgress;\n audioEl.currentTime = t;\n if (audioEl.paused && !audioEl.dataset.preventPlayAfterPatch) {\n audioEl.play();\n }\n }, { once: true });\n\n audioEl.removeEventListener('progress', onProgress);\n }\n\n audioEl.addEventListener('progress', onProgress);\n }, { once: true });\n\n audioEl.dataset.patchedForSafari = 'true';\n}\n\nexport function isSafariPatchInProgress(audioEl: HTMLAudioElement) {\n return Boolean(audioEl.dataset.patchForSafariInProgress);\n}\n","import React from '../lib/teact/teact';\n\nconst stopEvent = (e: React.UIEvent | Event) => {\n e.stopPropagation();\n e.preventDefault();\n};\n\nexport default stopEvent;\n"],"names":["memo","sticker","effect","isOwn","soundId","size","observeIntersection","lastSyncTime","forceLoadPreview","messageId","chatId","activeEmojiInteractions","markAnimationLoaded","isAnimationLoaded","ref","width","style","handleClick","playKey","useAnimatedEmoji","undefined","emoji","localMediaHash","id","isIntersecting","useIsIntersecting","thumbDataUri","thumbnail","dataUri","previewBlobUrl","useMedia","ApiMediaFormat","transitionClassNames","useMediaTransition","mediaData","isMediaLoaded","Boolean","className","buildClassName","LIKE_STICKER_ID","onClick","src","alt","key","animationData","quality","play","forceOnHeavyAnimation","noLoop","onLoad","renderWaveform","canvas","spikes","progress","peak","fillStyle","progressFillStyle","length","height","ctx","getContext","scale","forEach","item","i","globalAlpha","spikeHeight","Math","max","x","y","radius","beginPath","moveTo","arcTo","closePath","roundedRectangle","fill","decodeWaveform","encoded5bit","bitsCount","valuesCount","floor","result","Array","bitsData","l","byteIndex","bitShift","value","lastByteIndex","lastBitShift","lastValue","interpolateArray","data","fitCount","newData","springFactor","leftFiller","rightFiller","idx","val","MIN_SPIKES","IS_SINGLE_COLUMN_LAYOUT","MAX_SPIKES","renderSeekline","playProgress","bufferedProgress","seekerRef","theme","message","senderTitle","uploadProgress","origin","date","isSelectable","isSelected","isDownloading","onPlay","onReadMedia","onCancelUpload","onDateClick","content","audio","voice","video","isMediaUnread","isVoice","isSeeking","useRef","playStateBeforeSeeking","lang","useLang","isRtl","dispatch","getDispatch","isActivated","setIsActivated","useState","shouldLoad","coverHash","getMessageMediaHash","coverBlobUrl","getMessageMediaFormat","loadProgress","downloadProgress","useMediaWithLoadProgress","handleForcePlay","useCallback","handleTrackChange","isBuffered","bufferingHandlers","checkBuffering","useBuffering","isPlaying","playPause","pause","setCurrentTime","duration","useAudioPlayer","makeTrackId","getMediaDuration","isMessageLocal","isOwnMessage","waveformCanvasRef","canvasRef","useMemo","waveform","min","durationFactor","spikesCount","round","Uint8Array","useLayoutEffect","current","useWaveformCanvas","withSeekline","useEffect","isLoadingForPlaying","isUploading","isTransferring","transferProgress","getMediaTransferState","shouldRender","shouldRenderSpinner","spinnerClassNames","useShowTransition","shouldRenderCross","handleButtonClick","setAudioPlayerOrigin","handleDownloadClick","cancelMessageMediaDownload","downloadMessageMedia","handleSeek","e","left","getBoundingClientRect","clientX","MouseEvent","targetTouches","stopPropagation","handleStartSeek","button","handleStopSeek","handleDateClick","renderFirstLine","title","fileName","captureEvents","onCapture","onRelease","onDrag","fullClassName","AudioOrigin","buttonClassNames","push","contentClassName","renderWithTitle","dir","renderText","Link","formatPastTimeShort","formatMediaDuration","performer","renderSecondLine","Button","ripple","color","join","ariaLabel","backgroundImage","ProgressSpinner","transparent","noCross","showProgress","showSeekline","getTranslation","getFileSizeString","formatMediaDateTime","renderAudio","draggable","renderVoice","withGlobal","global","chatOrUserId","countryList","phoneCodes","phoneCodeList","chat","selectChat","user","isUserId","selectUser","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","canInviteUsers","isChatChannel","isUserRightBanned","getHasAdminRight","forceShowSelf","loadFullUser","showNotification","updateChatMutedState","userId","fullInfo","username","phoneNumber","isSelf","handleNotificationChange","isRestricted","copy","text","entity","copyTextToClipboard","formattedNumber","formatPhoneNumberWithCode","link","getChatLink","description","bio","getChatDescription","icon","multiline","narrow","isStatic","label","checked","inactive","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","getPrivateChatUserId","isBot","isUserBot","isSupport","canDeleteForAll","contactName","getUserFirstOrLastName","isChannel","isBasicGroup","isChatBasicGroup","isSuperGroup","isChatSuperGroup","currentUserId","isOpen","onClose","onCloseAnimationEnd","leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact","chatTitle","getChatTitle","handleDeleteMessageForAll","shouldDeleteForAll","handleDeleteAndStop","contactId","accessHash","handleDeleteChat","isCreator","header","isSavedMessages","isText","smaller","canAutoLoad","autoLoadFileMaxSizeMb","withDate","datetime","sender","onMediaClick","document","timestamp","extension","getDocumentExtension","wasIntersected","markIntersected","useFlag","isLoadAllowed","setIsLoadAllowed","shouldDownload","documentHash","isLoaded","hasPreview","getDocumentHasPreview","getMessageMediaThumbDataUri","localBlobUrl","previewData","withMediaViewer","mediaType","name","thumbnailDataUri","actionIcon","isMessageDocumentVideo","elementRef","shouldSpinnerRender","getColorFromExtension","sizeString","getDocumentThumbnailDimensions","onlineCount","selectChatOnlineCount","areMessagesLoaded","selectChatMessages","typingStatus","avatarSize","status","withDots","withUsername","withFullInfo","withUpdatingStatus","withChatType","noRtl","loadFullChat","openMediaViewer","isMin","handleAvatarViewerOpen","hasPhoto","avatarOwnerId","MediaViewerOrigin","isVerified","getChatTypeString","handle","groupStatus","chatTypeString","membersCount","getGroupStatus","onlineStatus","renderStatusOrTyping","outgoingStatus","idPrefix","isProtected","mediaBlobUrl","getMessageVideo","decoding","onContextMenu","stopEvent","isGif","Keys","activeKey","DEFAULT_TEXT","itemIds","selectedIds","filterValue","filterPlaceholder","notFoundText","searchInputId","isLoading","noScrollRestore","onSelectedIdsChange","onFilterChange","onLoadMore","inputRef","shouldMinimize","setTimeout","requestAnimationFrame","focus","handleItemClick","newSelectedIds","includes","splice","indexOf","handleFilterChange","currentTarget","viewportIds","getMore","useInfiniteScroll","map","isMinimized","canClose","clickArg","onChange","placeholder","items","iconElement","titleText","serverTimeOffset","userStatus","selectUserStatus","noStatusOrTyping","fullName","getUserFullName","isUserOnline","getUserStatus","photo","isFirstPhoto","isDeleted","isDeletedUser","isRepliesChat","isChatWithRepliesBot","getMediaHash","forceAvatar","hash","getChatAvatarHash","photoBlobUrl","avatarMediaHash","avatarBlobUrl","useBlurSync","imageSrc","prevImageSrc","usePrevious","userFullName","getFirstLetters","Spinner","getUserColorKey","connectionState","animationLevel","settings","byKey","photos","slideAnimation","currentPhotoIndex","setCurrentPhotoIndex","isFirst","isLast","profile","currentIndex","slice","mediaLoader","usePhotosPreload","handleProfilePhotoClick","profilePhotoIndex","selectPreviousMedia","selectNextMedia","element","querySelector","selectorToPreventScroll","onSwipe","IS_TOUCH_ENV","direction","SwipeDirection","isVerifiedIconShown","_","renderPhotoTabs","Transition","renderPhoto","type","VerifiedIcon","reaction","staticIconId","getGlobal","availableReactions","find","staticIcon","noAnimate","onUnfaveClick","stickerSelector","shouldPlay","lottieData","isLottie","isLottieLoaded","markLoaded","unmarkLoaded","canLottiePlay","IS_WEBM_SUPPORTED","gifBlobUrl","canGifPlay","previewTransitionClassNames","safePlay","onMouseDown","preventMessageInputBlurWithBubbling","autoPlay","loop","playsInline","muted","isLowPriority","preventDefault","props","StickerSetModal","useModuleLoader","Bundles","typingUser","typingUserName","action","replace","trim","onMessageClick","linkData","getMessageWebPage","getFirstLinkInMessage","url","domain","siteName","formattedDescription","getMessageText","renderMessageSummary","handleMessageClick","displayUrl","truncatedDescription","trimText","MEDIA_VIEWER_MEDIA_QUERY","REM","parseInt","getComputedStyle","documentElement","fontSize","ROUND_VIDEO_DIMENSIONS_PX","AVATAR_FULL_DIMENSIONS","DEFAULT_MEDIA_DIMENSIONS","cachedMaxWidthOwn","cachedMaxWidth","cachedMaxWidthNoAvatar","getAvailableWidth","fromOwnMessage","isForwarded","isWebPagePhoto","noAvatars","extraPaddingRem","availableWidthRem","regularMaxWidth","windowWidth","windowSize","getMaxMessageWidthRem","calculateDimensionsForMessageMedia","aspectRatio","availableWidth","availableHeight","getAvailableHeight","mediaWidth","calculateDimensions","getMediaViewerAvailableDimensions","withFooter","isVideo","mql","window","matchMedia","windowHeight","occupiedHeightRem","matches","calculateInlineImageDimensions","getPhotoInlineDimensions","calculateVideoDimensions","getVideoDimensions","getPictogramDimensions","getStickerDimensions","baseWidth","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_INLINE_DESKTOP_FACTOR","calculatedHeight","calculateMediaViewerDimensions","mediaHeight","calculatedWidth","WIDTH","large","medium","small","localEffect","interactWithAnimatedEmoji","sendEmojiInteraction","sendWatchingEmojiInteraction","hasEffect","audioRef","soundMediaData","setPlayKey","String","random","interactions","startedInteractions","sendInteractionBunch","remove","Audio","addEventListener","once","container","startSize","isReversed","performance","now","interactionMessageId","emoticon","selectLocalAnimatedEmojiEffectByName","ChatFolderModal","ChatAnimationTypes","isPinned","isShown","unreadCount","hasUnreadMark","ShowTransition","isCustom","unreadMentionsCount","formatIntegerCompact","isActive","lastMessage","senderId","replyToMessageId","isOutgoing","lastMessageSender","lastMessageAction","getMessageAction","actionTargetMessage","selectChatMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","privateChatUserId","currentChatId","threadId","currentThreadId","messageListType","selectCurrentMessageList","MAIN_THREAD_ID","draft","selectDraft","canScrollDown","canChangeFolder","chatFolders","orderedIds","lastMessageOutgoingStatus","selectOutgoingStatus","folderId","orderDiff","animationType","openChat","focusLastMessage","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isChatFolderModalOpen","openChatFolderModal","closeChatFolderModal","shouldRenderDeleteModal","markRenderDeleteModal","unmarkRenderDeleteModal","shouldRenderChatFolderModal","markRenderChatFolderModal","unmarkRenderChatFolderModal","isAction","isActionMessage","useEnsureMessage","mediaThumbnail","getMessageSticker","isRoundVideo","getMessageRoundVideo","actionTargetUsers","usersById","users","byId","filter","Opacity","opacity","fastRaf","classList","add","Move","transform","ANIMATION_END_DELAY","shouldReplaceHistory","contextActions","useChatContextActions","handleDelete","handleChatFolderChange","ListItem","Avatar","isCallActive","isCallNotEmpty","LastMessageMeta","TypingStatus","isChat","renderActionMessageText","asTextWithSpoilers","senderName","getMessageSenderName","blobUrl","renderSummary","renderLastMessageOrTyping","DeleteChatModal","folderType","chatFolder","selectChatFolder","animatedEmoji","selectAnimatedEmoji","foldersDispatch","onScreenSelect","handleEditFolder","payload","SettingsScreens","AnimatedEmoji","fluid","pill","openNextChat","resolvedFolderId","ALL_FOLDER_ID","ARCHIVED_FOLDER_ID","useFolderManagerForOrderedIds","orderById","reduce","acc","prevOrderById","orderDiffById","mapValues","order","CHAT_LIST_SLICE","handleKeyDown","removeEventListener","IS_PWA","IS_MAC_OS","metaKey","ctrlKey","code","startsWith","digit","match","position","Number","altKey","targetIndexDelta","getAnimationType","orderDiffs","Object","values","numberOfUp","diff","numberOfDown","None","Infinity","useChatAnimationType","InfiniteScroll","preloadBackwards","withAbsolutePositioning","maxHeight","CHAT_HEIGHT_PX","viewportOffset","pinnedCount","getPinnedChatsCount","teactOrderKey","renderChats","Loading","getSenderName","chatsById","getSenderTitle","isChatGroup","isQuick","onFileSelect","isHovered","markHovered","unmarkHovered","onDrop","onDragEnter","onDragLeave","relatedTarget","toTarget","DropAreaState","withQuick","onHide","hideTimeoutRef","prevWithQuick","captureEscKeyListener","handleFilesDrop","async","dataTransfer","dt","files","folderFiles","getFilesFromDataTransferItems","concat","from","handleQuickFilesDrop","handleDragLeave","target","fromTarget","Portal","containerId","onDragOver","clearTimeout","EmojiTooltip","MAX_INPUT_HEIGHT","messageSendKeyCombo","replyingToId","selectReplyingToId","noTabCapture","isPollModalOpen","payment","isPaymentModalOpen","isAttachmentModalInput","editableInputId","html","forcedPlaceholder","canAutoFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","onSend","editLastMessage","replyToNextMessage","cloneRef","isContextMenuOpenRef","isTextFormatterOpen","openTextFormatter","closeTextFormatter","textFormatterAnchorPosition","setTextFormatterAnchorPosition","selectedRange","setSelectedRange","sendMessageAction","useSendMessageAction","updateInputHeight","useLayoutEffectWithPrevDeps","prevHtml","innerHTML","focusInput","isHeavyAnimating","focusEditableElement","handleCloseTextFormatter","selection","getSelection","removeAllRanges","empty","clearSelection","checkSelection","IS_IOS","rangeCount","selectionRange","getRangeAt","selectedText","toString","isSelectionInsideInput","EDITABLE_INPUT_ID","parseEmojiOnlyString","START_TO_END","processSelection","selectionRect","inputRect","top","willSend","input","clone","currentHeight","newHeight","scrollHeight","transitionDuration","log","abs","exec","toggle","captureFirstTab","debounce","captureKeyboardListeners","onTab","suppressFocus","blur","contentEditable","textContent","IS_EMOJI_SUPPORTED","onKeyDown","shiftKey","handleKeyUp","IS_ANDROID","event","closeContextMenuMouseListener","closeContextMenuKeyListener","handleMouseUp","onTouchCancel","anchorPosition","TEXT_FORMAT_BY_TAG_NAME","B","STRONG","I","EM","U","DEL","CODE","SPAN","fragmentEl","createElement","containerRef","linkUrlInputRef","isLinkControlOpen","openLinkControl","closeLinkControl","linkUrl","setLinkUrl","isEditingLink","setIsEditingLink","inputClassName","setInputClassName","selectedTextFormats","setSelectedTextFormats","useVirtualBackdrop","selectedFormats","parentElement","commonAncestorContainer","textFormat","tagName","updateSelectedRange","getSelectedText","innerText","getSelectedElement","updateInputStyles","offsetWidth","scrollWidth","scrollLeft","getFormatButtonClassName","keys","some","fKey","monospace","strikethrough","handleSpoilerText","spoiler","dataset","entityType","ApiMessageEntityTypes","replaceWith","execCommand","handleBoldText","bold","handleItalicText","italic","handleUnderlineText","underline","handleStrikethroughText","handleMonospaceText","handleLinkUrlConfirm","formattedLinkUrl","encodeURI","ensureProtocol","href","addRange","restoreSelection","handler","k","b","u","m","s","p","getKeyFromEvent","linkUrlConfirmClassName","autoComplete","inputMode","onScroll","dataTransferItems","traverseFileTreePromise","entry","Promise","resolve","File","isFile","itemFile","getAsFile","file","isDirectory","createReader","readEntries","entries","entriesPromises","entr","all","kind","webkitGetAsEntry","RE_BR","RE_SPACE","RE_CLEAN_HTML","RE_EXTRA_NEW_LINE","prepareForRegExp","inputId","parentNode","iterations","cache","WeakMap","memoized","fn","cached","get","args","areSortedArraysEqual","lastArgs","lastResult","set","emojiDataPromise","emojiRawData","emojiData","RE_EMOJI_SEARCH","prepareRecentEmojisMemo","recentEmojiIds","limit","pickTruthy","MEMO_EMPTY_ARRAY","prepareLibraryMemo","baseEmojiKeywords","emojiKeywords","emojis","byNative","buildCollectionByKey","baseEmojisByKeyword","natives","emojisByKeyword","byKeyword","keywords","byName","names","searchInLibraryMemo","library","matched","matchedKeywords","keyword","sort","flatten","matchedNames","unique","RegExp","useEmojiTooltip","isAllowed","htmlRef","onUpdateHtml","isDisabled","markIsOpen","unmarkIsOpen","setById","shouldForceInsertEmoji","setShouldForceInsertEmoji","filteredEmojis","setFilteredEmojis","ensureEmojiData","then","getEmojiCode","forceSend","endsWith","substr","insertEmoji","textEmoji","isForce","currentHtml","atIndex","lastIndexOf","messageInput","getElementById","native","isEmojiTooltipOpen","closeEmojiTooltip","default","uncompressEmoji","runThrottled","throttle","cb","RE_USERNAME_SEARCH","useMentionTooltip","canSuggestMembers","groupChatMembers","topInlineBotIds","usersToMention","setUsersToMention","updateFilteredUsers","withInlineBots","memberIds","member","filteredIds","filterUsersByName","usernameFilter","getUsernameFilter","canSuggestInlineBots","insertMention","forceFocus","insertedHtml","isMentionTooltipOpen","closeMentionTooltip","mentionFilteredUsers","useAsyncRendering","dependencies","delay","shouldRenderRef","timeoutRef","forceUpdate","useForceUpdate","useOnChange","options","selected","disabled","loadingOptions","setValues","handleChange","newValues","v","option","subLabel","children","buttonClassName","tabIndex","buttonRef","secondaryIcon","destructive","onSecondaryIconClick","isTouched","markIsTouched","unmarkIsTouched","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","getTriggerElement","getRootElement","closest","getMenuElement","positionX","positionY","transformOriginX","transformOriginY","menuStyle","useContextMenuPosition","handleSecondaryIconClick","handleMouseDown","role","autoClose","DEFAULT_DURATION","onDismiss","setIsOpen","timerRef","closeAndDismiss","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","RADIUSES","xl","square","circleRadius","STROKE_WIDTH","borderRadius","circumference","PI","svg","firstElementChild","strokeDashOffset","setAttribute","hidden","loadingOption","step","renderValue","trackWidth","index","parentContainerClassName","focused","spinnerColor","spinnerBackgroundColor","autoFocusSearch","onReset","onFocus","onBlur","onSpinnerClick","isInputFocused","markInputFocused","unmarkInputFocused","useInputFocusOnOpen","backgroundColor","prevIsOpen","prevChildren","fromChildrenRef","noAnimation","onCheck","classNames","badgeCount","isBadgeActive","previousActiveTab","tabRef","tabEl","prevTabEl","platformEl","prevPlatformEl","shiftLeft","offsetLeft","scaleFactor","clientWidth","forceReflow","SCROLL_DURATION","tabs","activeTab","big","onSwitchTab","useHorizontalScroll","activeTabElement","childNodes","activeTabOffsetLeft","activeTabOffsetWidth","newLeft","fastSmoothScrollHorizontal","tab","renderCount","shouldRestoreHeight","shouldCleanup","cleanupExceptionKey","onStart","onStop","currentKeyRef","rendersRef","prevActiveKey","activeKeyChanged","cleanup","preservedRender","childElements","transition","isBackwards","prevActiveIndex","activeIndex","toSlide","fromSlide","ANIMATION_LEVEL_MIN","dispatchHeavyAnimationStop","dispatchHeavyAnimationEvent","waitForTransitionEnd","clientHeight","performSlideOptimized","node","HTMLElement","onAnimationEnd","activeElement","watchedNode","firstChild","waitForAnimationEnd","flexBasis","renders","contents","render","teactFastList","INCLUDED_CHAT_TYPES","EXCLUDED_CHAT_TYPES","INCLUDE_FILTER_FIELDS","EXCLUDE_FILTER_FIELDS","selectChatFilters","state","mode","selectTemp","selectedChatIds","selectedChatTypes","includedChatIds","includeFilters","pick","folder","excludedChatIds","excludeFilters","getSuggestedFolderName","filters","bots","groups","channels","contacts","nonContacts","INITIAL_STATE","chatFilter","foldersReducer","omit","error","useReducer","makeMediaHandlers","controllerRef","mediaHandlers","proxy","requestNextTrack","requestPreviousTrack","stop","closeAudioPlayer","seekbackward","skipTime","seekOffset","currentTime","seekforward","seekTo","seekTime","nexttrack","previoustrack","trackId","originalDuration","trackType","handlers","metadata","onInit","onForcePlay","onTrackChange","noPlaylist","noProgressUpdates","setIsPlaying","isPlayingSync","setPlayProgress","register","eventName","setVolume","setPlaybackRate","toggleMuted","registerMediaSession","setPlaybackState","audioPlayer","volume","playbackRate","setPositionState","isFinite","paused","updateMetadata","destroy","isSafariPatchInProgress","useEffectWithPrevDeps","prevShouldPlay","prevSrc","playIfPresent","setTime","time","audioProxy","Map","blurredRef","isChanged","img","Image","imgToCanvas","fastBlur","toDataURL","blurredAsync","onload","blurredDataUri","clear","useBlur","noInitiallyBuffered","setIsBuffered","setBufferedProgress","setIsBufferedDebounced","handleBuffering","media","buffered","end","readyState","onLoadedData","onPlaying","onLoadStart","onPause","onTimeUpdate","onProgress","useCanvasBlur","withRaf","processBlur","alpha","IS_CANVAS_FILTER_SUPPORTED","drawImage","RADIUS","isInSearch","isServiceNotifications","SERVICE_NOTIFICATIONS_USER_ID","toggleChatPinned","toggleChatArchived","toggleChatUnread","actionAddToFolder","actionPin","compact","actionUnreadMark","actionMute","actionArchive","isChatArchived","actionDelete","getCanDeleteChat","isInFolder","stopImmediatePropagation","isMenuDisabled","shouldDisableOnLink","shouldDisableOnLongTap","setIsContextMenuOpen","setContextMenuPosition","clientY","body","timer","clearLongPressTimer","startLongPressTimer","contains","originalEvent","touches","cancelClickOnce","emulateContextMenuEvent","passive","EMPTY_RECT","anchor","getLayout","setPositionX","setPositionY","setTransformOriginX","setTransformOriginY","withScroll","setWithScroll","setStyle","setMenuStyle","triggerEl","anchorX","anchorY","menuEl","rootEl","extraPaddingX","extraTopPadding","marginSides","extraMarginTop","marginTop","menuRect","offsetHeight","rootRect","horizontalPosition","verticalPosition","triggerRect","menuMaxHeight","offsetX","offsetY","useDebounce","ms","noFirst","noLast","replyOriginForId","loadMessage","loadMessageThrottled","throttled","setOrderedIds","getOrderedIds","addOrderedIdsCallback","useFolderManagerForUnreadCounters","unreadCounters","setUnreadCounters","getUnreadCounters","addUnreadCountersCallback","useFolderManagerForChatsCount","chatsCount","setChatsCount","getChatsCount","addChatsCountCallback","handleScroll","deltaX","deltaY","useIntersectionObserver","rootCallback","rootRef","throttleMs","debounceMs","shouldSkipFirst","margin","threshold","rootCallbackRef","freezeFlagsRef","onUnfreezeRef","freeze","unfreeze","useHeavyAnimationCheck","observer","disconnect","callbacks","observe","targetCallback","entriesAccumulator","observerCallbackSync","callback","scheduler","observerCallback","IntersectionObserver","root","rootMargin","initController","controller","delete","unobserve","useOnIntersect","targetRef","setIsIntersecting","savedCallback","setInterval","clearInterval","debugKey","prevDeps","isMediaReady","store","idRef","generateIdFor","mediaHash","noLoad","mediaFormat","cacheBuster","isHtmlAllowed","isStreaming","IS_PROGRESSIVE_SUPPORTED","useUniqueId","setLoadProgress","startedAtRef","handleProgress","Date","spentTime","closeTimeout","useMouseInside","menuCloseTimeout","isMouseInside","markMouseInside","usePrevDuringAnimation","prev","isCurrentPresent","isPrevPresent","reducer","initialState","reducerRef","setState","currentState","SEND_MESSAGE_ACTION_INTERVAL","useStateRef","useVideoCleanup","videoRef","videoEl","load","mul_table","shg_table","boxBlurCanvasRGB","context","top_x","top_y","isNaN","imageData","getImageData","pixels","rsum","gsum","bsum","p1","p2","yp","yi","yw","wm","hm","rad1","r","g","mul_sum","shg_sum","vmin","vmax","putImageData","tracks","currentTrackId","voiceQueue","musicQueue","playNext","isReverseOrder","currentTrack","nextTrackId","findNextInQueue","has","openAudioPlayer","parseMessageKey","splitTrackId","messageKey","nextTrack","stopCurrentAudio","track","handleEvent","Proxy","createAudio","trackIdComparator","addTrackToQueue","preventPlayAfterPatch","preload","IS_SAFARI","patchSafariProgressiveAudio","globalSearch","currentContent","GlobalSearchContent","openedChatId","queueFilter","cleanUpQueue","fastSeek","rate","shouldRemoveFromQueue","h","trackIdFilter","el","removeFromQueue","getTrackQueue","currentId","queue","chatAudio","getMessageKey","split","pop","one","two","dateOne","keyOne","dateTwo","keyTwo","localeCompare","IOS_SCREEN_EDGE_THRESHOLD","getDistance","a","sqrt","pageX","pageY","getTouchCenter","lastClickTime","captureEvent","initialSwipeAxis","hasMoved","hasSwiped","initialDistance","initialTouchCenter","innerWidth","innerHeight","excludedClosestSelector","onMove","withCursor","querySelectorAll","scrollable","overflow","onDoubleClick","centerX","centerY","onZoom","endDistance","touchCenter","dragOffsetX","dragOffsetY","zoomFactor","initialCenterX","initialCenterY","currentCenterX","currentCenterY","shouldPreventScroll","xAbs","yAbs","axis","currentSwipeAxis","Left","Right","Up","Down","processSwipe","isNotPassive","propertyName","waitForEndEvent","animationName","eventType","detailedName","isHandled","handleAnimationEnd","TransitionEvent","AnimationEvent","cycleRestrict","isAnimating","fastSmoothScroll","maxDistance","FAST_SMOOTH_MAX_DISTANCE","forceDirection","forceDuration","forceNormalContainerHeight","scrollFrom","calculateScrollFrom","FocusDirection","scrollWithJs","isAnimatingScroll","offsetTop","elementTop","scrollTop","offset","elementHeight","currentScrollTop","containerHeight","targetContainerHeight","normalHeight","path","remainingPath","absPath","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","shortTransition","longTransition","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","startAt","onHeavyAnimationStop","animateSingle","t","currentPath","getAttribute","containerWidth","animate","force","forcePlaceCaretAtEnd","range","createRange","lastChild","nodeValue","selectNodeContents","collapse","toLowerCase","getMessageIdsForSelectedText","selectedFragments","cloneContents","childElementCount","messageIds","nodeType","messageEl","removeChild","DEFAULT_HANDLERS","mediaSession","navigator","setMediaSessionHandlers","console","warn","setActionHandler","err","clearMediaSession","playbackState","buildMediaMetadata","artist","album","artwork","MediaMetadata","ENTITY_CLASS_BY_NODE_NAME","S","STRIKE","PRE","BLOCKQUOTE","parseMessageInput","fragment","parsedHtml","parseMarkdown","textIndex","recursionDeepness","entities","addEntity","rawText","nodeName","getEntityTypeFromNode","rawIndex","substring","getEntityDataFromNode","hasChildNodes","audioEl","patchedForSafari","patchForSafariInProgress"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/354.e30ac9a934f7627782aa.js b/dist/354.472e40d0f6d6067cc288.js similarity index 98% rename from dist/354.e30ac9a934f7627782aa.js rename to dist/354.472e40d0f6d6067cc288.js index 701062b3..230d9a71 100644 --- a/dist/354.e30ac9a934f7627782aa.js +++ b/dist/354.472e40d0f6d6067cc288.js @@ -1,2 +1,2 @@ (()=>{"use strict";var e,r,t={2993:(e,r,t)=>{var n=t(5802);"undefined"!=typeof window&&window.innerHeight,Math.round(425),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]);const a=new Set(["image/png","image/gif","image/jpeg"]),o=new Set(["video/mp4"]);new Set([...a,...o]),new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),self.onerror=e=>{console.error(e),i({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),i({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));const s=new Map;function i(e,r){r?postMessage(e,r):postMessage(e)}let c;self.importScripts("rlottie-wasm.js");const l=new Promise((e=>{Module.onRuntimeInitialized=()=>{c={init:Module.cwrap("lottie_init","",[]),destroy:Module.cwrap("lottie_destroy","",["number"]),resize:Module.cwrap("lottie_resize","",["number","number","number"]),buffer:Module.cwrap("lottie_buffer","number",["number"]),render:Module.cwrap("lottie_render","",["number","number"]),loadFromData:Module.cwrap("lottie_load_from_data","number",["number","number"])},e()}})),u=new Map;async function d(e){const r=await fetch(e),t=r.headers.get("Content-Type");if(null!=t&&t.startsWith("text/"))return r.text();const a=await r.arrayBuffer();return(0,n.inflate)(a,{to:"string"})}function m(e,r,t){const n=r?30:60,a=JSON.parse(e).fr||n,o=a%n==0?a/n:1;return{reduceFactor:o,msPerFrame:1e3/(a/o),reducedFramesCount:Math.ceil(t/o)}}var p;p={init:async function(e,r,t,n,a){c||await l;const o=await d(r),s=allocate(intArrayFromString(o),"i8",0),i=c.init(),p=c.loadFromData(i,s);c.resize(i,t,t);const{reduceFactor:g,msPerFrame:f,reducedFramesCount:h}=m(o,n,p);u.set(e,{imgSize:t,reduceFactor:g,handle:i}),a(g,f,h)},changeData:async function(e,r,t,n){c||await l;const a=await d(r),o=allocate(intArrayFromString(a),"i8",0),{handle:s}=u.get(e),i=c.loadFromData(s,o),{reduceFactor:p,msPerFrame:g,reducedFramesCount:f}=m(a,t,i);n(p,g,f)},renderFrames:async function(e,r,t,n){c||await l;const{imgSize:a,reduceFactor:o,handle:s}=u.get(e);for(let e=r;e<=t;e++){const r=e*o;c.render(s,r);const t=c.buffer(s),i=Module.HEAPU8.subarray(t,t+a*a*4);n(e,new Uint8ClampedArray(i).buffer)}},destroy:function(e){const r=u.get(e);c.destroy(r.handle),u.delete(e)}},onmessage=async e=>{const{data:r}=e;switch(r.type){case"callMethod":{const{messageId:e,name:t,args:n}=r;try{if(e){const r=function(){for(var r=arguments.length,t=new Array(r),n=0;n{var e=a.O(void 0,[802],(()=>a(2993)));return a.O(e)},e=[],a.O=(r,t,n,o)=>{if(!t){var s=1/0;for(u=0;u=o)&&Object.keys(a.O).every((e=>a.O[e](t[c])))?t.splice(c--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[t,n,o]},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>e+".8080c8e2ac99944cfa27.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={354:1};a.f.i=(r,t)=>{e[r]||importScripts(a.p+a.u(r))};var r=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],t=r.push.bind(r);r.push=r=>{var[n,o,s]=r;for(var i in o)a.o(o,i)&&(a.m[i]=o[i]);for(s&&s(a);n.length;)e[n.pop()]=1;t(r)}})(),r=a.x,a.x=()=>a.e(802).then(r),a.x()})(); -//# sourceMappingURL=354.e30ac9a934f7627782aa.js.map \ No newline at end of file +//# sourceMappingURL=354.472e40d0f6d6067cc288.js.map \ No newline at end of file diff --git a/dist/354.e30ac9a934f7627782aa.js.map b/dist/354.472e40d0f6d6067cc288.js.map similarity index 99% rename from dist/354.e30ac9a934f7627782aa.js.map rename to dist/354.472e40d0f6d6067cc288.js.map index 8aad5edd..8ff18390 100644 --- a/dist/354.e30ac9a934f7627782aa.js.map +++ b/dist/354.472e40d0f6d6067cc288.js.map @@ -1 +1 @@ -{"version":3,"file":"354.e30ac9a934f7627782aa.js","mappings":"uBAAIA,ECAAC,E,gCC0CkC,oBAAXC,QAA0BA,OAAOC,YAmEzBC,KAAKC,MAAM,KACJ,IAAIC,IAAI,CAChD,aAAc,sBAAuB,iBAAkB,0BAA2B,kBA/G7E,MA4IMC,EAAgC,IAAID,IAAI,CACnD,YAAa,YAAa,eAGfE,EAAgC,IAAIF,IAAI,CACnD,cAGwC,IAAIA,IAAI,IAC7CC,KACAC,IAYyC,IAAIF,IAAI,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,OCnF3JG,KAAKC,QAAWC,IAEdC,QAAQC,MAAMF,GACdG,EAAa,CAAEC,KAAM,iBAAkBF,MAAO,CAAEG,QAASL,EAAEE,MAAMG,SAAW,mCAG9EP,KAAKQ,iBAAiB,sBAAuBN,IAE3CC,QAAQC,MAAMF,GACdG,EAAa,CAAEC,KAAM,iBAAkBF,MAAO,CAAEG,QAASL,EAAEO,OAAOF,SAAW,qCAjFjF,MAAMG,EAAgB,IAAIC,IAqF1B,SAASN,EAAaO,EAAyBC,GACzCA,EACFC,YAAYF,EAAMC,GAElBC,YAAYF,GClFhB,IAAIG,EAFJf,KAAKgB,cAAc,mBAGnB,MAAMC,EAAoB,IAAIC,SAAeC,IAC3CC,OAAOC,qBAAuB,KAC5BN,EAAa,CACXO,KAAMF,OAAOG,MAAM,cAAe,GAAI,IACtCC,QAASJ,OA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A,QAAQ,YAAa,KACpFhD,EAAoBiD,EAAIT,G,SCXxB,IAAIU,EAAkB,CACrB,IAAK,GAgBNlD,EAAoBwB,EAAE7C,EAAI,CAAC8C,EAASG,KAE/BsB,EAAgBzB,IAElBpG,cAAc2E,EAAoBiD,EAAIjD,EAAoB6B,EAAEJ,KAK/D,IAAI0B,EAAqB9I,KAA6B,uBAAIA,KAA6B,wBAAK,GACxF+I,EAA6BD,EAAmBtD,KAAKwD,KAAKF,GAC9DA,EAAmBtD,KAvBC5E,IACnB,IAAK2F,EAAU0C,EAAaC,GAAWtI,EACvC,IAAI,IAAIgF,KAAYqD,EAChBtD,EAAoBmC,EAAEmB,EAAarD,KACrCD,EAAoBO,EAAEN,GAAYqD,EAAYrD,IAIhD,IADGsD,GAASA,EAAQvD,GACdY,EAASlB,QACdwD,EAAgBtC,EAAS4C,OAAS,EACnCJ,EAA2BnI,K,GXnBxBpB,EAAOmG,EAAoBQ,EAC/BR,EAAoBQ,EAAI,IAChBR,EAAoBzF,EAAE,KAAKkJ,KAAK5J,GYDdmG,EAAoBQ,K","sources":["webpack://telegram-t/webpack/runtime/chunk loaded","webpack://telegram-t/webpack/runtime/startup chunk dependencies","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/createWorkerInterface.ts","webpack://telegram-t/./src/lib/rlottie/rlottie.worker.ts","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/importScripts chunk loading","webpack://telegram-t/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(802).then(next);\n};","export const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION!;\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const DEBUG_PAYMENT_SMART_GLOCAL = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 500;\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 200;\nexport const GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT = 30;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v7';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const AUTODOWNLOAD_FILESIZE_MB_LIMITS = [1, 5, 10, 50, 100, 500];\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\nexport const COMMON_CHATS_LIMIT = 100;\nexport const GROUP_CALL_PARTICIPANTS_LIMIT = 100;\nexport const REACTION_LIST_LIMIT = 100;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\n\nexport const SPONSORED_MESSAGE_CACHE_MS = 300000; // 5 min\n\nexport const DEFAULT_VOLUME = 1;\nexport const DEFAULT_PLAYBACK_RATE = 1;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\nexport const SEND_MESSAGE_ACTION_INTERVAL = 3000; // 3s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\nexport const TMP_CHAT_ID = '0';\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 100;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const STICKER_SIZE_JOIN_REQUESTS = 140;\nexport const STICKER_SIZE_INVITES = 140;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const NO_STICKER_SET_ID = 'NO_STICKER_SET';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const VIDEO_MOV_TYPE = 'video/quicktime';\nexport const VIDEO_WEBM_TYPE = 'video/webm';\n\nexport const SUPPORTED_IMAGE_CONTENT_TYPES = new Set([\n 'image/png', 'image/gif', 'image/jpeg',\n]);\n\nexport const SUPPORTED_VIDEO_CONTENT_TYPES = new Set([\n 'video/mp4', // video/quicktime added dynamically in environment.ts\n]);\n\nexport const CONTENT_TYPES_WITH_PREVIEW = new Set([\n ...SUPPORTED_IMAGE_CONTENT_TYPES,\n ...SUPPORTED_VIDEO_CONTENT_TYPES,\n]);\n\nexport const CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram.';\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TG_LINK = /^tg:(\\/\\/)?([?=&\\d\\w_-]+)?/gm;\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)/gm;\n\n// eslint-disable-next-line max-len\nexport const COUNTRIES_WITH_12H_TIME_FORMAT = new Set(['AU', 'BD', 'CA', 'CO', 'EG', 'HN', 'IE', 'IN', 'JO', 'MX', 'MY', 'NI', 'NZ', 'PH', 'PK', 'SA', 'SV', 'US']);\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = '777000';\nexport const REPLIES_USER_ID = '1271266957'; // TODO For Test connection ID must be equal to 708513\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = '-777';\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n\n// Group calls\nexport const GROUP_CALL_VOLUME_MULTIPLIER = 100;\nexport const GROUP_CALL_DEFAULT_VOLUME = 100 * GROUP_CALL_VOLUME_MULTIPLIER;\nexport const ENABLE_THUMBNAIL_VIDEO = false;\n","import { CancellableCallback, OriginMessageEvent, WorkerMessageData } from './WorkerConnector';\nimport { DEBUG } from '../config';\n\ndeclare const self: WorkerGlobalScope;\n\nhandleErrors();\n\nconst callbackState = new Map();\n\nexport default function createInterface(api: Record) {\n onmessage = async (message: OriginMessageEvent) => {\n const { data } = message;\n\n switch (data.type) {\n case 'callMethod': {\n const { messageId, name, args } = data;\n try {\n if (messageId) {\n const callback = (...callbackArgs: any[]) => {\n const lastArg = callbackArgs[callbackArgs.length - 1];\n\n sendToOrigin({\n type: 'methodCallback',\n messageId,\n callbackArgs,\n }, lastArg instanceof ArrayBuffer ? [lastArg] : undefined);\n };\n\n callbackState.set(messageId, callback);\n\n args.push(callback as never);\n }\n\n const [response, arrayBuffers] = (await api[name](...args)) || [];\n\n if (messageId) {\n sendToOrigin(\n {\n type: 'methodResponse',\n messageId,\n response,\n },\n arrayBuffers,\n );\n }\n } catch (error: any) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n error: { message: error.message },\n });\n }\n }\n\n if (messageId) {\n callbackState.delete(messageId);\n }\n\n break;\n }\n case 'cancelProgress': {\n const callback = callbackState.get(data.messageId);\n if (callback) {\n callback.isCanceled = true;\n }\n\n break;\n }\n }\n };\n}\n\nfunction handleErrors() {\n self.onerror = (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.error.message || 'Uncaught exception in worker' } });\n };\n\n self.addEventListener('unhandledrejection', (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.reason.message || 'Uncaught rejection in worker' } });\n });\n}\n\nfunction sendToOrigin(data: WorkerMessageData, arrayBuffers?: ArrayBuffer[]) {\n if (arrayBuffers) {\n postMessage(data, arrayBuffers);\n } else {\n postMessage(data);\n }\n}\n","import { inflate } from 'pako/dist/pako_inflate';\nimport createWorkerInterface from '../../util/createWorkerInterface';\nimport { CancellableCallback } from '../../util/WorkerConnector';\n\ndeclare const Module: any;\n\ndeclare function allocate(...args: any[]): string;\n\ndeclare function intArrayFromString(str: String): string;\n\ndeclare const self: WorkerGlobalScope;\n\nself.importScripts('rlottie-wasm.js');\n\nlet rLottieApi: Record;\nconst rLottieApiPromise = new Promise((resolve) => {\n Module.onRuntimeInitialized = () => {\n rLottieApi = {\n init: Module.cwrap('lottie_init', '', []),\n destroy: Module.cwrap('lottie_destroy', '', ['number']),\n resize: Module.cwrap('lottie_resize', '', ['number', 'number', 'number']),\n buffer: Module.cwrap('lottie_buffer', 'number', ['number']),\n render: Module.cwrap('lottie_render', '', ['number', 'number']),\n loadFromData: Module.cwrap('lottie_load_from_data', 'number', ['number', 'number']),\n };\n\n resolve();\n };\n});\n\nconst HIGH_PRIORITY_MAX_FPS = 60;\nconst LOW_PRIORITY_MAX_FPS = 30;\n\nconst renderers = new Map();\n\nasync function init(\n key: string,\n animationData: string,\n imgSize: number,\n isLowPriority: boolean,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = await extractJson(animationData);\n const stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n const handle = rLottieApi.init();\n const framesCount = rLottieApi.loadFromData(handle, stringOnWasmHeap);\n rLottieApi.resize(handle, imgSize, imgSize);\n\n const { reduceFactor, msPerFrame, reducedFramesCount } = calcParams(json, isLowPriority, framesCount);\n\n renderers.set(key, { imgSize, reduceFactor, handle });\n onInit(reduceFactor, msPerFrame, reducedFramesCount);\n}\n\nasync function changeData(\n key: string,\n animationData: string,\n isLowPriority: boolean,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = await extractJson(animationData);\n const stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n const { handle } = renderers.get(key)!;\n const framesCount = rLottieApi.loadFromData(handle, stringOnWasmHeap);\n\n const { reduceFactor, msPerFrame, reducedFramesCount } = calcParams(json, isLowPriority, framesCount);\n onInit(reduceFactor, msPerFrame, reducedFramesCount);\n}\n\nasync function extractJson(animationData: string) {\n const response = await fetch(animationData);\n const contentType = response.headers.get('Content-Type');\n\n // Support deprecated JSON format cached locally\n if (contentType?.startsWith('text/')) {\n return response.text();\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return inflate(arrayBuffer, { to: 'string' });\n}\n\nfunction calcParams(json: string, isLowPriority: boolean, framesCount: number) {\n const animationData = JSON.parse(json);\n const maxFps = isLowPriority ? LOW_PRIORITY_MAX_FPS : HIGH_PRIORITY_MAX_FPS;\n const sourceFps = animationData.fr || maxFps;\n const reduceFactor = sourceFps % maxFps === 0 ? sourceFps / maxFps : 1;\n\n return {\n reduceFactor,\n msPerFrame: 1000 / (sourceFps / reduceFactor),\n reducedFramesCount: Math.ceil(framesCount / reduceFactor),\n };\n}\n\nasync function renderFrames(\n key: string, fromIndex: number, toIndex: number, onProgress: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const { imgSize, reduceFactor, handle } = renderers.get(key)!;\n\n for (let i = fromIndex; i <= toIndex; i++) {\n const realIndex = i * reduceFactor;\n\n rLottieApi.render(handle, realIndex);\n const bufferPointer = rLottieApi.buffer(handle);\n const data = Module.HEAPU8.subarray(bufferPointer, bufferPointer + (imgSize * imgSize * 4));\n const arrayBuffer = new Uint8ClampedArray(data).buffer;\n onProgress(i, arrayBuffer);\n }\n}\n\nfunction destroy(key: string) {\n const renderer = renderers.get(key)!;\n\n rLottieApi.destroy(renderer.handle);\n\n renderers.delete(key);\n}\n\ncreateWorkerInterface({\n init,\n changeData,\n renderFrames,\n destroy,\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [802], () => (__webpack_require__(2993)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + \"8080c8e2ac99944cfa27\" + \".js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t354: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","window","innerHeight","Math","round","Set","SUPPORTED_IMAGE_CONTENT_TYPES","SUPPORTED_VIDEO_CONTENT_TYPES","self","onerror","e","console","error","sendToOrigin","type","message","addEventListener","reason","callbackState","Map","data","arrayBuffers","postMessage","rLottieApi","importScripts","rLottieApiPromise","Promise","resolve","Module","onRuntimeInitialized","init","cwrap","destroy","resize","buffer","render","loadFromData","renderers","async","extractJson","animationData","response","fetch","contentType","headers","get","startsWith","text","arrayBuffer","inflate","to","calcParams","json","isLowPriority","framesCount","maxFps","sourceFps","JSON","parse","fr","reduceFactor","msPerFrame","reducedFramesCount","ceil","api","key","imgSize","onInit","stringOnWasmHeap","allocate","intArrayFromString","handle","set","changeData","renderFrames","fromIndex","toIndex","onProgress","i","realIndex","bufferPointer","HEAPU8","subarray","Uint8ClampedArray","renderer","delete","onmessage","messageId","name","args","callback","callbackArgs","lastArg","length","ArrayBuffer","undefined","push","isCanceled","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","call","m","x","__webpack_exports__","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","Object","keys","every","splice","r","f","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","this","Function","o","obj","prop","prototype","hasOwnProperty","scriptUrl","location","document","currentScript","src","scripts","getElementsByTagName","Error","replace","p","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","bind","moreModules","runtime","pop","then"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"354.472e40d0f6d6067cc288.js","mappings":"uBAAIA,ECAAC,E,gCC0CkC,oBAAXC,QAA0BA,OAAOC,YAmEzBC,KAAKC,MAAM,KACJ,IAAIC,IAAI,CAChD,aAAc,sBAAuB,iBAAkB,0BAA2B,kBA/G7E,MA4IMC,EAAgC,IAAID,IAAI,CACnD,YAAa,YAAa,eAGfE,EA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C,EAAS4C,OAAS,EACnCJ,EAA2BnI,K,GXnBxBpB,EAAOmG,EAAoBQ,EAC/BR,EAAoBQ,EAAI,IAChBR,EAAoBzF,EAAE,KAAKkJ,KAAK5J,GYDdmG,EAAoBQ,K","sources":["webpack://telegram-t/webpack/runtime/chunk loaded","webpack://telegram-t/webpack/runtime/startup chunk dependencies","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/createWorkerInterface.ts","webpack://telegram-t/./src/lib/rlottie/rlottie.worker.ts","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/importScripts chunk loading","webpack://telegram-t/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(802).then(next);\n};","export const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION!;\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const DEBUG_PAYMENT_SMART_GLOCAL = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 500;\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 200;\nexport const GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT = 30;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v7';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const AUTODOWNLOAD_FILESIZE_MB_LIMITS = [1, 5, 10, 50, 100, 500];\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\nexport const COMMON_CHATS_LIMIT = 100;\nexport const GROUP_CALL_PARTICIPANTS_LIMIT = 100;\nexport const REACTION_LIST_LIMIT = 100;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\n\nexport const SPONSORED_MESSAGE_CACHE_MS = 300000; // 5 min\n\nexport const DEFAULT_VOLUME = 1;\nexport const DEFAULT_PLAYBACK_RATE = 1;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\nexport const SEND_MESSAGE_ACTION_INTERVAL = 3000; // 3s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\nexport const TMP_CHAT_ID = '0';\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 100;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const STICKER_SIZE_JOIN_REQUESTS = 140;\nexport const STICKER_SIZE_INVITES = 140;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const NO_STICKER_SET_ID = 'NO_STICKER_SET';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const VIDEO_MOV_TYPE = 'video/quicktime';\nexport const VIDEO_WEBM_TYPE = 'video/webm';\n\nexport const SUPPORTED_IMAGE_CONTENT_TYPES = new Set([\n 'image/png', 'image/gif', 'image/jpeg',\n]);\n\nexport const SUPPORTED_VIDEO_CONTENT_TYPES = new Set([\n 'video/mp4', // video/quicktime added dynamically in environment.ts\n]);\n\nexport const CONTENT_TYPES_WITH_PREVIEW = new Set([\n ...SUPPORTED_IMAGE_CONTENT_TYPES,\n ...SUPPORTED_VIDEO_CONTENT_TYPES,\n]);\n\nexport const CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram.';\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TG_LINK = /^tg:(\\/\\/)?([?=&\\d\\w_-]+)?/gm;\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)/gm;\n\n// eslint-disable-next-line max-len\nexport const COUNTRIES_WITH_12H_TIME_FORMAT = new Set(['AU', 'BD', 'CA', 'CO', 'EG', 'HN', 'IE', 'IN', 'JO', 'MX', 'MY', 'NI', 'NZ', 'PH', 'PK', 'SA', 'SV', 'US']);\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = '777000';\nexport const REPLIES_USER_ID = '1271266957'; // TODO For Test connection ID must be equal to 708513\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = '-777';\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n\n// Group calls\nexport const GROUP_CALL_VOLUME_MULTIPLIER = 100;\nexport const GROUP_CALL_DEFAULT_VOLUME = 100 * GROUP_CALL_VOLUME_MULTIPLIER;\nexport const ENABLE_THUMBNAIL_VIDEO = false;\n","import { CancellableCallback, OriginMessageEvent, WorkerMessageData } from './WorkerConnector';\nimport { DEBUG } from '../config';\n\ndeclare const self: WorkerGlobalScope;\n\nhandleErrors();\n\nconst callbackState = new Map();\n\nexport default function createInterface(api: Record) {\n onmessage = async (message: OriginMessageEvent) => {\n const { data } = message;\n\n switch (data.type) {\n case 'callMethod': {\n const { messageId, name, args } = data;\n try {\n if (messageId) {\n const callback = (...callbackArgs: any[]) => {\n const lastArg = callbackArgs[callbackArgs.length - 1];\n\n sendToOrigin({\n type: 'methodCallback',\n messageId,\n callbackArgs,\n }, lastArg instanceof ArrayBuffer ? [lastArg] : undefined);\n };\n\n callbackState.set(messageId, callback);\n\n args.push(callback as never);\n }\n\n const [response, arrayBuffers] = (await api[name](...args)) || [];\n\n if (messageId) {\n sendToOrigin(\n {\n type: 'methodResponse',\n messageId,\n response,\n },\n arrayBuffers,\n );\n }\n } catch (error: any) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n error: { message: error.message },\n });\n }\n }\n\n if (messageId) {\n callbackState.delete(messageId);\n }\n\n break;\n }\n case 'cancelProgress': {\n const callback = callbackState.get(data.messageId);\n if (callback) {\n callback.isCanceled = true;\n }\n\n break;\n }\n }\n };\n}\n\nfunction handleErrors() {\n self.onerror = (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.error.message || 'Uncaught exception in worker' } });\n };\n\n self.addEventListener('unhandledrejection', (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.reason.message || 'Uncaught rejection in worker' } });\n });\n}\n\nfunction sendToOrigin(data: WorkerMessageData, arrayBuffers?: ArrayBuffer[]) {\n if (arrayBuffers) {\n postMessage(data, arrayBuffers);\n } else {\n postMessage(data);\n }\n}\n","import { inflate } from 'pako/dist/pako_inflate';\nimport createWorkerInterface from '../../util/createWorkerInterface';\nimport { CancellableCallback } from '../../util/WorkerConnector';\n\ndeclare const Module: any;\n\ndeclare function allocate(...args: any[]): string;\n\ndeclare function intArrayFromString(str: String): string;\n\ndeclare const self: WorkerGlobalScope;\n\nself.importScripts('rlottie-wasm.js');\n\nlet rLottieApi: Record;\nconst rLottieApiPromise = new Promise((resolve) => {\n Module.onRuntimeInitialized = () => {\n rLottieApi = {\n init: Module.cwrap('lottie_init', '', []),\n destroy: Module.cwrap('lottie_destroy', '', ['number']),\n resize: Module.cwrap('lottie_resize', '', ['number', 'number', 'number']),\n buffer: Module.cwrap('lottie_buffer', 'number', ['number']),\n render: Module.cwrap('lottie_render', '', ['number', 'number']),\n loadFromData: Module.cwrap('lottie_load_from_data', 'number', ['number', 'number']),\n };\n\n resolve();\n };\n});\n\nconst HIGH_PRIORITY_MAX_FPS = 60;\nconst LOW_PRIORITY_MAX_FPS = 30;\n\nconst renderers = new Map();\n\nasync function init(\n key: string,\n animationData: string,\n imgSize: number,\n isLowPriority: boolean,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = await extractJson(animationData);\n const stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n const handle = rLottieApi.init();\n const framesCount = rLottieApi.loadFromData(handle, stringOnWasmHeap);\n rLottieApi.resize(handle, imgSize, imgSize);\n\n const { reduceFactor, msPerFrame, reducedFramesCount } = calcParams(json, isLowPriority, framesCount);\n\n renderers.set(key, { imgSize, reduceFactor, handle });\n onInit(reduceFactor, msPerFrame, reducedFramesCount);\n}\n\nasync function changeData(\n key: string,\n animationData: string,\n isLowPriority: boolean,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = await extractJson(animationData);\n const stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n const { handle } = renderers.get(key)!;\n const framesCount = rLottieApi.loadFromData(handle, stringOnWasmHeap);\n\n const { reduceFactor, msPerFrame, reducedFramesCount } = calcParams(json, isLowPriority, framesCount);\n onInit(reduceFactor, msPerFrame, reducedFramesCount);\n}\n\nasync function extractJson(animationData: string) {\n const response = await fetch(animationData);\n const contentType = response.headers.get('Content-Type');\n\n // Support deprecated JSON format cached locally\n if (contentType?.startsWith('text/')) {\n return response.text();\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return inflate(arrayBuffer, { to: 'string' });\n}\n\nfunction calcParams(json: string, isLowPriority: boolean, framesCount: number) {\n const animationData = JSON.parse(json);\n const maxFps = isLowPriority ? LOW_PRIORITY_MAX_FPS : HIGH_PRIORITY_MAX_FPS;\n const sourceFps = animationData.fr || maxFps;\n const reduceFactor = sourceFps % maxFps === 0 ? sourceFps / maxFps : 1;\n\n return {\n reduceFactor,\n msPerFrame: 1000 / (sourceFps / reduceFactor),\n reducedFramesCount: Math.ceil(framesCount / reduceFactor),\n };\n}\n\nasync function renderFrames(\n key: string, fromIndex: number, toIndex: number, onProgress: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const { imgSize, reduceFactor, handle } = renderers.get(key)!;\n\n for (let i = fromIndex; i <= toIndex; i++) {\n const realIndex = i * reduceFactor;\n\n rLottieApi.render(handle, realIndex);\n const bufferPointer = rLottieApi.buffer(handle);\n const data = Module.HEAPU8.subarray(bufferPointer, bufferPointer + (imgSize * imgSize * 4));\n const arrayBuffer = new Uint8ClampedArray(data).buffer;\n onProgress(i, arrayBuffer);\n }\n}\n\nfunction destroy(key: string) {\n const renderer = renderers.get(key)!;\n\n rLottieApi.destroy(renderer.handle);\n\n renderers.delete(key);\n}\n\ncreateWorkerInterface({\n init,\n changeData,\n renderFrames,\n destroy,\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [802], () => (__webpack_require__(2993)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + \"8080c8e2ac99944cfa27\" + \".js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t354: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","window","innerHeight","Math","round","Set","SUPPORTED_IMAGE_CONTENT_TYPES","SUPPORTED_VIDEO_CONTENT_TYPES","self","onerror","e","console","error","sendToOrigin","type","message","addEventListener","reason","callbackState","Map","data","arrayBuffers","postMessage","rLottieApi","importScripts","rLottieApiPromise","Promise","resolve","Module","onRuntimeInitialized","init","cwrap","destroy","resize","buffer","render","loadFromData","renderers","async","extractJson","animationData","response","fetch","contentType","headers","get","startsWith","text","arrayBuffer","inflate","to","calcParams","json","isLowPriority","framesCount","maxFps","sourceFps","JSON","parse","fr","reduceFactor","msPerFrame","reducedFramesCount","ceil","api","key","imgSize","onInit","stringOnWasmHeap","allocate","intArrayFromString","handle","set","changeData","renderFrames","fromIndex","toIndex","onProgress","i","realIndex","bufferPointer","HEAPU8","subarray","Uint8ClampedArray","renderer","delete","onmessage","messageId","name","args","callback","callbackArgs","lastArg","length","ArrayBuffer","undefined","push","isCanceled","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","call","m","x","__webpack_exports__","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","Object","keys","every","splice","r","f","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","this","Function","o","obj","prop","prototype","hasOwnProperty","scriptUrl","location","document","currentScript","src","scripts","getElementsByTagName","Error","replace","p","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","bind","moreModules","runtime","pop","then"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/47.b422d6da038c24068089.css b/dist/47.9ea2a6fe11cbf65b8511.css similarity index 99% rename from dist/47.b422d6da038c24068089.css rename to dist/47.9ea2a6fe11cbf65b8511.css index 67fce75a..975e456f 100644 --- a/dist/47.b422d6da038c24068089.css +++ b/dist/47.9ea2a6fe11cbf65b8511.css @@ -7,4 +7,4 @@ .GroupCall .modal-content{display:flex;flex-direction:column;align-items:center;height:37.5rem}.GroupCall .modal-dialog{max-height:calc(100% - 4rem);background:#181f27}.GroupCall .Menu{--color-text: white;--color-background-compact-menu: #212121DD;--color-background-compact-menu-hover: #00000066}.GroupCall .Menu .bubble{box-shadow:0 .25rem .5rem .125rem rgba(16,16,16,.3)}.GroupCall.single-column{opacity:1 !important}.GroupCall.single-column .modal-dialog{max-width:100% !important;border-bottom-left-radius:0;border-bottom-right-radius:0;margin-top:auto;margin-bottom:0;transform:translate3d(0, 100%, 0);transition:transform .3s ease,opacity .3s ease}.GroupCall.single-column .modal-backdrop{opacity:0;transition:opacity .2s ease}.GroupCall.single-column.open .modal-backdrop{opacity:1}.GroupCall.single-column.open .modal-dialog{transform:translate3d(0, 0, 0)}.GroupCall .header{width:100%;display:flex;align-items:center;color:#fff;margin-bottom:.5rem}.GroupCall .header h3{font-size:1.25rem;font-weight:500;margin:0 auto 0 .5rem}.GroupCall .videos{display:flex;flex-wrap:wrap;gap:.5rem}.GroupCall .participants{margin-top:.75rem;background:#222b34;border-radius:.75rem}.GroupCall .participants .Loading{padding:2rem 0}.GroupCall .participants .invite-btn{padding:.25rem .75rem;display:flex;align-items:center;border-radius:.75rem;transition:.15s ease-out background-color;cursor:pointer;color:var(--color-text-secondary)}.GroupCall .participants .invite-btn:hover{background:#2f363e}.GroupCall .participants .invite-btn .text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.GroupCall .participants .invite-btn .icon{display:flex;justify-content:center;align-items:center;width:2.75rem;height:2.75rem;font-size:1.5rem;margin-right:1rem}.GroupCall .scrollable{overflow:auto;padding-bottom:2rem;max-width:37.5rem;width:100%}.GroupCall .buttons{max-width:37.5rem;margin-top:auto;display:flex;align-items:center;justify-content:space-around;width:100%;position:relative;height:8.75rem}.GroupCall .buttons button{cursor:pointer}.GroupCall .buttons::before{position:absolute;content:"";width:100%;height:2rem;background:linear-gradient(0deg, #181f27, rgba(24, 31, 39, 0));z-index:0;top:-2rem}.GroupCall .buttons .button-wrapper{width:4rem;display:flex;flex-direction:column;align-items:center}.GroupCall .buttons .button-wrapper .button-text{white-space:nowrap;font-size:.75rem;margin-top:.5rem;color:#fff}.GroupCall .buttons .button-wrapper.microphone-wrapper{width:6rem}.GroupCall .buttons .button-wrapper.microphone-wrapper .button-text{margin-top:.75rem;font-size:1rem}.GroupCall .buttons .Loading{position:absolute;transform:translate(0, -1.125rem)}.GroupCall .buttons .Loading .Spinner{--spinner-size: 6.5rem}.GroupCall .buttons .video-buttons{display:flex;flex-direction:column;align-items:center}.GroupCall .buttons .small-button,.GroupCall .buttons .smaller-button{outline:none;border:0;background:#15415b;border-radius:50%;width:3rem;height:3rem;color:#fff;font-size:1.375rem;display:flex;align-items:center;justify-content:center;transition:.25s ease-out background-color}.GroupCall .buttons .small-button:hover,.GroupCall .buttons .smaller-button:hover{background:#11364b}.GroupCall .buttons .small-button.camera.active{background:#15415b}.GroupCall .buttons .small-button.camera.active:hover{background:#11364b}.GroupCall .buttons .small-button.speaker{background:#2b3a51}.GroupCall .buttons .small-button.speaker.active{background:#496092}.GroupCall .buttons .small-button.leave{background:#5a2824}.GroupCall .buttons .small-button.leave:hover{background:#49201d}.GroupCall .buttons .smaller-button{width:2.5rem;height:2.5rem;margin-bottom:.5rem;padding:0}.GroupCall.landscape .scrollable{display:flex;flex-direction:row;flex-grow:1;gap:1rem;align-items:flex-start;max-width:100%;max-height:100%}.GroupCall.landscape .GroupCallParticipantVideo{max-height:initial}.GroupCall.landscape .GroupCallParticipantVideo video{height:100%}.GroupCall.landscape .buttons{position:absolute;left:calc(50% - 7.8125rem);transform:translateX(-50%);width:auto;gap:1rem;bottom:4rem;background:rgba(0,0,0,.6);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:1rem;z-index:5;padding:.75rem 1rem;height:auto}.GroupCall.landscape .buttons .button-text{display:none}.GroupCall.landscape .buttons .video-buttons{flex-direction:row;gap:1rem}.GroupCall.landscape .buttons .video-buttons .smaller-button{margin-bottom:0}.GroupCall.landscape .buttons .Loading{transform:none}.GroupCall.landscape .buttons .Loading .Spinner{--spinner-size: 3.25rem}.GroupCall.landscape .buttons .MicrophoneButton canvas{width:2rem !important;height:2rem !important}.GroupCall.landscape .buttons .MicrophoneButton,.GroupCall.landscape .buttons .microphone-wrapper{width:3rem;height:3rem}.GroupCall.landscape .buttons .MicrophoneButton .AnimatedSticker,.GroupCall.landscape .buttons .microphone-wrapper .AnimatedSticker{display:flex;align-items:center;justify-content:center}.GroupCall.landscape .buttons::before{display:none}.GroupCall.landscape.no-sidebar .buttons{left:50%}.GroupCall.landscape .streams{width:100%;height:100%}.GroupCall.landscape .videos{width:100%;height:100%;display:grid;--column-count: 1;grid-template-columns:repeat(var(--column-count), 1fr);grid-auto-rows:1fr}.GroupCall.landscape .videos .GroupCallParticipantVideo{max-height:100%;width:100%}.GroupCall.landscape .videos .GroupCallParticipantVideo .thumbnail-wrapper{height:100%}.GroupCall.landscape .videos.span-last-video .GroupCallParticipantVideo:last-child{grid-column:span var(--column-count)}.GroupCall.landscape .participants{width:15.625rem;margin-top:0} .ActiveCallHeader{position:absolute;top:0;left:0;height:2rem;width:100%;z-index:1;display:flex;justify-content:center;font-weight:500;font-size:.875rem;color:#fff;align-items:center;padding:0 1rem;background:linear-gradient(135deg, #3152e8, #8f4aac);transform:translateY(-100%)}.ActiveCallHeader.open{transform:translateY(0)}.ActiveCallHeader span{line-height:100%} -/*# sourceMappingURL=47.b422d6da038c24068089.css.map*/ \ No newline at end of file +/*# sourceMappingURL=47.9ea2a6fe11cbf65b8511.css.map*/ \ No newline at end of file diff --git a/dist/47.b422d6da038c24068089.css.map b/dist/47.9ea2a6fe11cbf65b8511.css.map similarity index 99% rename from dist/47.b422d6da038c24068089.css.map rename to dist/47.9ea2a6fe11cbf65b8511.css.map index 78b3651c..54f02947 100644 --- a/dist/47.b422d6da038c24068089.css.map +++ b/dist/47.9ea2a6fe11cbf65b8511.css.map @@ -1 +1 @@ -{"version":3,"file":"47.b422d6da038c24068089.css","mappings":"AAAA,OACE,kBACA,uBAOE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDAEE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,oBACE,oBACA,4BACA,qBACA,uBACA,gBAGF,mBACE,kCACA,mBACA,gBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;AC/KJ,kBACE,aACA,uBACA,mBACA,wBACA,kBACA,WACA,YACA,SACA,wFACA,kBACA,eACA,WACA,gCAEA,0BACE,WACA,cACA,kBACA,WACA,YACA,mBACA,kBACA,kBACA,WACA,oBAEA,sCACE,aAIJ,wBACE,uBAGF,0BACE,wFAEA,kCACE,mBAIJ,iCACE,mFACA,yCACE,mBAIJ,sEACE,mBACA,sFACE,uB;ACpDN,kBACE,kBACA,oBACA,2CACA,iDAEA,0BACE,2BACA,gBACA,UACA,uBACA,2BACA,iBACA,wBAEA,iCACE,oDACA,gBACA,mCACA,2CACA,oBAKF,iCACE,gDAIJ,kCACE,YAiCA,kBACA,gBACA,eAjCA,wCACE,oBACA,kBACA,UACA,YACA,aACA,mBACA,mBACA,oBAEA,yDACE,kBAIJ,uCACE,uBAGF,yCACE,uBAGF,yCACE,uBAGF,sCACE,uBC9CJ,oDACE,wBACA,cACA,WACA,cACA,oBACA,uBAEA,0DACE,aAGF,+DACE,WACA,eAEA,uBACA,yBACA,kBAGF,0EACE,wBAGF,uEACE,qBAGF,mFACE,eAGF,+IACE,eDgCF,oDACE,YACA,kBACA,aACA,MACA,wBACA,SACA,UAIA,0EAvBA,YACA,YACA,aACA,8BACA,2CACA,oDACA,0JAqBA,sEA3BA,YACA,YACA,aACA,8BACA,2CACA,oDACA,uJAyBA,+DA/BA,YACA,YACA,aACA,8BACA,2CACA,oDACA,sJ;AE7EN,QACE,mCACA,UACA,mBACA,uBACA,eACA,gBACA,kBACA,wEACA,WACA,iBACA,aACA,mBACA,0CAEA,wBACE,kBACA,WACA,YAGF,eACE,WACA,YAGF,UACE,iBAEA,4BACE,qBAIJ,mBACE,WACA,YACA,gBAEA,0BACE,eACA,gBAIJ,kBACE,WACA,YACA,kBAEA,yBACE,cACA,eAIJ,mBACE,eACA,gBACA,kBAEA,0BACE,cACA,eAIJ,oBACE,cACA,eACA,oBAEA,2BACE,WACA,YAIJ,mBACE,oBAEA,qBACE,iBAGF,0BACE,gBACA,iBAIJ,mBACE,aACA,cACA,iBAEA,qBACE,eAGF,0BACE,aACA,cAIJ,eACE,kBAEA,sBACE,WACA,cACA,kBACA,gBACA,eACA,cACA,eACA,kBACA,yCACA,yBACA,cAIJ,oBACE,e;AC7HJ,sBACE,kBACA,aACA,mBACA,mBACA,WACA,qBACA,qBACA,0CACA,eAEA,4BACE,mBAGF,4BACE,aAGF,8BACE,kBAGF,4BACE,YACA,aACA,sBAEA,kCACE,uBACA,mBACA,gBAGF,mCACE,uBACA,mBACA,gBACA,cACA,iBAEA,wCACE,cAGF,yCACE,cAGF,uCACE,cAKN,kCACE,cACA,aACA,mBACA,uBACA,cACA,eACA,iBACA,iBACA,cAIA,kDACE,cAIJ,+BACE,eACA,a;AC3EJ,2BACE,qBACA,gBACA,kBACA,qBACA,yBACA,+BACA,eAEA,6CACE,kBACA,gBACA,WACA,YACA,qBAEA,iDACE,kBACA,gBACA,iBAIJ,qDACE,WAGF,mCACE,uCACA,WACA,YACA,kBACA,cACA,WACA,UACA,qBACA,oCAGF,0CACE,yCAGF,wCACE,kBACA,UACA,WACA,YACA,0BACA,SACA,WACA,mBACA,sBACA,aACA,mBACA,WACA,gEACA,UACA,eACA,wBAEA,8CACE,0BAIJ,iCACE,cACA,WAGF,kCACE,mBACA,eACA,kBAGF,8CACE,kBACA,QACA,SACA,UACA,WACA,2CACA,gBAGF,sCACE,kCACA,iBAGF,iCACE,kBACA,SACA,WACA,aACA,mBACA,uBACA,WACA,YACA,oDACA,iCACA,UAEA,uCACE,kBAGF,4CACE,iBAOJ,+CACE,UAGF,sDACE,U;ACzHF,0BACE,aACA,sBACA,mBACA,eAGF,yBACE,6BACA,mBAGF,iBACE,oBACA,2CACA,iDACA,yBACE,oDAIJ,yBACE,qBAEA,uCACE,0BACA,4BACA,6BACA,gBACA,gBACA,kCACA,+CAGF,yCACE,UACA,4BAIA,8CACE,UAGF,4CACE,+BAKN,mBACE,WACA,aACA,mBACA,WACA,oBAEA,sBACE,kBACA,gBACA,sBAIJ,mBACE,aACA,eACA,UAGF,yBACE,kBACA,mBACA,qBAEA,kCACE,eAGF,qCACE,sBACA,aACA,mBACA,qBACA,0CACA,eACA,kCAEA,2CACE,mBAGF,2CACE,uBACA,mBACA,gBAGF,2CACE,aACA,uBACA,mBACA,cACA,eACA,iBACA,kBAKN,uBACE,cACA,oBACA,kBACA,WAGF,oBACE,kBACA,gBACA,aACA,mBACA,6BACA,WACA,kBACA,eAEA,2BACE,eAGF,4BACE,kBACA,WACA,WACA,YACA,+DACA,UACA,UAGF,oCACE,WACA,aACA,sBACA,mBAEA,iDACE,mBACA,iBACA,iBACA,WAGF,uDACE,WAEA,oEACE,kBACA,eAKN,6BACE,kBACA,kCAEA,sCACE,uBAIJ,mCACE,aACA,sBACA,mBAGF,sEAEE,aACA,SACA,mBACA,kBACA,WACA,YACA,WACA,mBACA,aACA,mBACA,uBACA,0CAEA,kFACE,mBAIJ,gDACE,mBAEA,sDACE,mBAIJ,0CACE,mBAEA,iDACE,mBAIJ,wCACE,mBAEA,8CACE,mBAIJ,oCACE,aACA,cACA,oBACA,UAIJ,iCACE,aACA,mBACA,YACA,SACA,uBACA,eACA,gBAGF,gDACE,mBAEA,sDACE,YAIJ,8BACE,kBACA,2BACA,2BACA,WACA,SACA,YACA,0BACA,8DACA,mBACA,UACA,oBACA,YAEA,2CACE,aAGF,6CACE,mBACA,SAEA,6DACE,gBAIJ,uCACE,eACA,gDACE,wBAKF,uDACE,sBACA,uBAIJ,kGAEE,WACA,YAEA,oIACE,aACA,mBACA,uBAIJ,sCACE,aAIJ,yCACE,SAGF,8BACE,WACA,YAGF,6BACE,WACA,YAEA,aACA,kBACA,uDACA,mBAEA,wDACE,gBACA,WAEA,2EACE,YAIJ,mFACE,qCAIJ,mCACE,gBACA,a;ACtVJ,kBACE,kBACA,MACA,OACA,YACA,WACA,UAEA,aACA,uBACA,gBACA,kBACA,WACA,mBACA,eACA,qDACA,4BAEA,uBACE,wBAGF,uBACE,iB","sources":["webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/calls/group/MicrophoneButton.scss","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantMenu.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/common/Avatar.scss","webpack://telegram-t/./src/components/calls/group/GroupCallParticipant.scss","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantVideo.scss","webpack://telegram-t/./src/components/calls/group/GroupCall.scss","webpack://telegram-t/./src/components/calls/ActiveCallHeader.scss"],"sourcesContent":[".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete,\n &.error,\n &.confirm,\n &.pin,\n &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, 0.25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform 0.2s ease, opacity 0.2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header,\n %modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend %modal-header;\n padding: 0.5rem 1.25rem 0 0.9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n max-height: 90vh;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .modal-about {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .modal-help {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.3;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n",".MicrophoneButton {\n display: flex;\n justify-content: center;\n align-items: center;\n outline: none !important;\n position: relative;\n width: 6rem;\n height: 6rem;\n border: 0;\n background: radial-gradient(100% 100% at 100% 0%, #00a0b9 0%, #33c659 55%, #33c659 100%);\n border-radius: 50%;\n font-size: 2rem;\n color: #fff;\n transition: 0.25s ease-out filter;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n width: 8rem;\n height: 8rem;\n background: #64C166;\n border-radius: 50%;\n filter: blur(10px);\n opacity: 0.2;\n pointer-events: none;\n\n body.is-ios & {\n display: none;\n }\n }\n\n &:hover {\n filter: brightness(0.9);\n }\n\n &.crossed {\n background: radial-gradient(100% 100% at 100% 0%, #00AFFE 0%, #00AFFE 55%, #007FFF 100%);\n\n &::before {\n background: #00AFFE;\n }\n }\n\n &.muted-by-admin {\n background: radial-gradient(85.5% 103.5% at 87.5% 20.65%, #CE4D74 0%, #3D52DF 100%);\n &::before {\n background: #3D52DF;\n }\n }\n\n &.is-connecting, &.is-connecting:hover {\n background: #222B34;\n &::before {\n background: transparent;\n }\n }\n}\n","@import '../../../styles/mixins';\n\n.participant-menu {\n position: absolute;\n --color-text: white;\n --color-background-compact-menu: #212121DD;\n --color-background-compact-menu-hover: #00000066;\n\n .bubble {\n background: none !important;\n border-radius: 0;\n padding: 0;\n border: none !important;\n box-shadow: none !important;\n overflow: visible;\n color: var(--color-text);\n\n .group {\n box-shadow: 0 0.25rem 0.5rem 0.125rem rgba(16, 16, 16, 0.3);\n overflow: hidden;\n background: var(--color-background);\n border-radius: var(--border-radius-default);\n margin-bottom: 0.5rem;\n }\n }\n\n &.compact {\n .group {\n background: var(--color-background-compact-menu);\n }\n }\n\n .volume-control {\n height: 3rem;\n\n .info {\n pointer-events: none;\n position: relative;\n z-index: 1;\n height: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.75rem 1rem;\n\n .AnimatedSticker {\n margin-right: 2rem;\n }\n }\n\n &.high {\n --range-color: #4DA6E0;\n }\n\n &.normal {\n --range-color: #57BC6C;\n }\n\n &.medium {\n --range-color: #CAA53B;\n }\n\n &.low {\n --range-color: #CB5757;\n }\n\n position: relative;\n overflow: hidden;\n cursor: pointer;\n\n @mixin thumb-styles() {\n border: none;\n height: 3rem;\n width: 1.5rem;\n background: var(--range-color);\n border-radius: var(--border-radius-default);\n box-shadow: -13.5rem 0 0 12.75rem var(--range-color);\n transition: 0.25s ease-in-out background-color, 0.25s ease-in-out box-shadow;\n }\n\n @include reset-range();\n\n // Apply custom styles\n input[type=\"range\"] {\n height: 3rem;\n position: absolute;\n left: -1.5rem;\n top: 0;\n width: calc(100% + 3rem);\n margin: 0;\n z-index: 0;\n\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n",".Avatar {\n --color-user: var(--color-primary);\n flex: none;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n color: white;\n font-weight: bold;\n display: flex;\n white-space: nowrap;\n user-select: none;\n\n img:not(.emoji) {\n border-radius: 50%;\n width: 100%;\n height: 100%;\n }\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n\n i {\n font-size: 2.5rem;\n\n &.icon-reply-filled {\n transform: scale(0.7);\n }\n }\n\n &.size-micro {\n width: 1rem;\n height: 1rem;\n font-size: 0.5rem;\n\n .emoji {\n width: 0.5625rem;\n height: 0.5625rem;\n }\n }\n\n &.size-tiny {\n width: 2rem;\n height: 2rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-small {\n width: 2.125rem;\n height: 2.125rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-medium {\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.1875rem;\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n }\n\n &.size-large {\n font-size: 1.3125rem;\n\n i {\n font-size: 3.5rem;\n }\n\n .emoji {\n width: 1.3125rem;\n height: 1.3125rem;\n }\n }\n\n &.size-jumbo {\n width: 7.5rem;\n height: 7.5rem;\n font-size: 3.5rem;\n\n i {\n font-size: 6rem;\n }\n\n .emoji {\n width: 3.5rem;\n height: 3.5rem;\n }\n }\n\n &.online {\n position: relative;\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n bottom: 0.0625rem;\n right: 0.0625rem;\n width: 0.875rem;\n height: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--color-background);\n background-color: #0ac630;\n flex-shrink: 0;\n }\n }\n\n &.interactive {\n cursor: pointer;\n }\n}\n",".GroupCallParticipant {\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n color: #fff;\n padding: 0.5rem 0.75rem;\n border-radius: 0.75rem;\n transition: 0.15s ease-out background-color;\n cursor: pointer;\n\n &:hover {\n background: #2f363e;\n }\n\n audio {\n display: none;\n }\n\n .Avatar {\n margin-right: 1rem;\n }\n\n .info {\n min-width: 0;\n display: flex;\n flex-direction: column;\n\n .name {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n\n .about {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n color: #848d94;\n font-size: 0.75rem;\n\n &.blue {\n color: #4da6e0;\n }\n\n &.green {\n color: #57bc6c;\n }\n\n &.red {\n color: #ff706f;\n }\n }\n }\n\n .microphone {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.75rem;\n height: 2.75rem;\n margin-left: auto;\n font-size: 1.5rem;\n color: #ff706f;\n }\n\n &.can-self-unmute {\n .microphone {\n color: #848d94;\n }\n }\n\n .streams {\n cursor: pointer;\n display: flex;\n }\n}\n",".GroupCallParticipantVideo {\n border-radius: 0.75rem;\n overflow: hidden;\n position: relative;\n max-height: 12.875rem;\n width: calc(50% - 0.25rem);\n transition: 0.25s ease-out width;\n cursor: pointer;\n\n .thumbnail-avatar {\n position: absolute;\n border-radius: 0;\n width: 100%;\n height: 100%;\n transform: scale(1.1);\n\n img {\n filter: blur(10px);\n border-radius: 0;\n object-fit: cover;\n }\n }\n\n &:last-child:nth-child(odd) {\n width: 100%;\n }\n\n &::before {\n box-shadow: 0 0 0 3px transparent inset;\n width: 100%;\n height: 100%;\n position: absolute;\n display: block;\n content: \"\";\n z-index: 5;\n border-radius: 0.75rem;\n transition: 0.25s ease-out box-shadow;\n }\n\n &.active::before {\n box-shadow: 0px 0px 0px 3px #78ee7e inset;\n }\n\n .back-button {\n position: absolute;\n z-index: 5;\n top: 0.75rem;\n left: 0.75rem;\n background: rgba(0, 0, 0, 0.3);\n border: 0;\n color: white;\n border-radius: 1rem;\n padding: 0.25rem 0.75rem;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n transition: 0.25s ease-out opacity, 0.25s ease-out background-color;\n opacity: 0;\n cursor: pointer;\n outline: none !important;\n\n &:hover {\n background: rgba(0, 0, 0, 0.4);\n }\n }\n\n video {\n display: block;\n width: 100%;\n }\n\n .video {\n object-fit: contain;\n height: 12.5rem;\n position: relative;\n }\n\n .thumbnail-wrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 0;\n width: 100%;\n transform: translate(-50%, -50%) scale(1.5);\n background: black;\n }\n\n .thumbnail {\n filter: blur(10px) brightness(0.5);\n object-fit: cover;\n }\n\n .info {\n position: absolute;\n bottom: 0;\n color: #fff;\n display: flex;\n align-items: center;\n padding: 0 0.5rem 0.25rem;\n width: 100%;\n height: 2rem;\n background: linear-gradient(0deg, #000, transparent);\n transition: 0.25s ease-out opacity;\n opacity: 0;\n\n .name {\n margin-left: 0.5rem;\n }\n\n .last-icon {\n margin-left: auto;\n }\n }\n}\n\n.videos:hover .GroupCallParticipantVideo {\n\n .info {\n opacity: 1;\n }\n\n .back-button {\n opacity: 1;\n }\n}\n",".GroupCall {\n .modal-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 37.5rem;\n }\n\n .modal-dialog {\n max-height: calc(100% - 4rem);\n background: #181f27;\n }\n\n .Menu {\n --color-text: white;\n --color-background-compact-menu: #212121DD;\n --color-background-compact-menu-hover: #00000066;\n .bubble {\n box-shadow: 0 0.25rem 0.5rem 0.125rem rgba(16, 16, 16, 0.3);\n }\n }\n\n &.single-column {\n opacity: 1 !important;\n\n .modal-dialog {\n max-width: 100% !important;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n margin-top: auto;\n margin-bottom: 0;\n transform: translate3d(0, 100%, 0);\n transition: transform 0.3s ease, opacity 0.3s ease;\n }\n\n .modal-backdrop {\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n &.open {\n .modal-backdrop {\n opacity: 1;\n }\n\n .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n }\n }\n\n .header {\n width: 100%;\n display: flex;\n align-items: center;\n color: #fff;\n margin-bottom: 0.5rem;\n\n h3 {\n font-size: 1.25rem;\n font-weight: 500;\n margin: 0 auto 0 0.5rem;\n }\n }\n\n .videos {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n .participants {\n margin-top: 0.75rem;\n background: #222b34;\n border-radius: 0.75rem;\n\n .Loading {\n padding: 2rem 0;\n }\n\n .invite-btn {\n padding: 0.25rem 0.75rem;\n display: flex;\n align-items: center;\n border-radius: 0.75rem;\n transition: 0.15s ease-out background-color;\n cursor: pointer;\n color: var(--color-text-secondary);\n\n &:hover {\n background: #2f363e;\n }\n\n .text {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.5rem;\n margin-right: 1rem;\n }\n }\n }\n\n .scrollable {\n overflow: auto;\n padding-bottom: 2rem;\n max-width: 37.5rem;\n width: 100%;\n }\n\n .buttons {\n max-width: 37.5rem;\n margin-top: auto;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: 100%;\n position: relative;\n height: 8.75rem;\n\n button {\n cursor: pointer;\n }\n\n &::before {\n position: absolute;\n content: \"\";\n width: 100%;\n height: 2rem;\n background: linear-gradient(0deg, #181f27, rgba(24, 31, 39, 0));\n z-index: 0;\n top: -2rem;\n }\n\n .button-wrapper {\n width: 4rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .button-text {\n white-space: nowrap;\n font-size: 0.75rem;\n margin-top: 0.5rem;\n color: #fff;\n }\n\n &.microphone-wrapper {\n width: 6rem;\n\n .button-text {\n margin-top: 0.75rem;\n font-size: 1rem;\n }\n }\n }\n\n .Loading {\n position: absolute;\n transform: translate(0, -1.125rem);\n\n .Spinner {\n --spinner-size: 6.5rem;\n }\n }\n\n .video-buttons {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .small-button,\n .smaller-button {\n outline: none;\n border: 0;\n background: #15415b;\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n color: #fff;\n font-size: 1.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: 0.25s ease-out background-color;\n\n &:hover {\n background: #11364b;\n }\n }\n\n .small-button.camera.active {\n background: #15415b;\n\n &:hover {\n background: #11364b;\n }\n }\n\n .small-button.speaker {\n background: #2b3a51;\n\n &.active {\n background: #496092;\n }\n }\n\n .small-button.leave {\n background: #5a2824;\n\n &:hover {\n background: #49201d;\n }\n }\n\n .smaller-button {\n width: 2.5rem;\n height: 2.5rem;\n margin-bottom: 0.5rem;\n padding: 0;\n }\n }\n\n &.landscape .scrollable {\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n gap: 1rem;\n align-items: flex-start;\n max-width: 100%;\n max-height: 100%;\n }\n\n &.landscape .GroupCallParticipantVideo {\n max-height: initial;\n\n video {\n height: 100%;\n }\n }\n\n &.landscape .buttons {\n position: absolute;\n left: calc(50% - 15.625rem / 2);\n transform: translateX(-50%);\n width: auto;\n gap: 1rem;\n bottom: 4rem;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(10px);\n border-radius: 1rem;\n z-index: 5;\n padding: 0.75rem 1rem;\n height: auto;\n\n .button-text {\n display: none;\n }\n\n .video-buttons {\n flex-direction: row;\n gap: 1rem;\n\n .smaller-button {\n margin-bottom: 0;\n }\n }\n\n .Loading {\n transform: none;\n .Spinner {\n --spinner-size: 3.25rem;\n }\n }\n\n .MicrophoneButton {\n canvas {\n width: 2rem !important;\n height: 2rem !important;\n }\n }\n\n .MicrophoneButton,\n .microphone-wrapper {\n width: 3rem;\n height: 3rem;\n\n .AnimatedSticker {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n }\n\n &::before {\n display: none;\n }\n }\n\n &.landscape.no-sidebar .buttons {\n left: calc(50%);\n }\n\n &.landscape .streams {\n width: 100%;\n height: 100%;\n }\n\n &.landscape .videos {\n width: 100%;\n height: 100%;\n\n display: grid;\n --column-count: 1;\n grid-template-columns: repeat(var(--column-count), 1fr);\n grid-auto-rows: 1fr;\n\n .GroupCallParticipantVideo {\n max-height: 100%;\n width: 100%;\n\n .thumbnail-wrapper {\n height: 100%;\n }\n }\n\n &.span-last-video .GroupCallParticipantVideo:last-child {\n grid-column: span var(--column-count);\n }\n }\n\n &.landscape .participants {\n width: 15.625rem;\n margin-top: 0;\n }\n}\n",".ActiveCallHeader {\n position: absolute;\n top: 0;\n left: 0;\n height: 2rem;\n width: 100%;\n z-index: 1;\n\n display: flex;\n justify-content: center;\n font-weight: 500;\n font-size: 0.875rem;\n color: #fff;\n align-items: center;\n padding: 0 1rem;\n background: linear-gradient(135deg, rgb(49, 82, 232), rgb(143, 74, 172));\n transform: translateY(-100%);\n\n &.open {\n transform: translateY(0);\n }\n\n span {\n line-height: 100%;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"47.9ea2a6fe11cbf65b8511.css","mappings":"AAAA,OACE,kBACA,uBAOE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDAEE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,oBACE,oBACA,4BACA,qBACA,uBACA,gBAGF,mBACE,kCACA,mBACA,gBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;AC/KJ,kBACE,aACA,uBACA,mBACA,wBACA,kBACA,WACA,YACA,SACA,wFACA,kBACA,eACA,WACA,gCAEA,0BACE,WACA,cACA,kBACA,WACA,YACA,mBACA,kBACA,kBACA,WACA,oBAEA,sCACE,aAIJ,wBACE,uBAGF,0BACE,wFAEA,kCACE,mBAIJ,iCACE,mFACA,yCACE,mBAIJ,sEACE,mBACA,sFACE,uB;ACpDN,kBACE,kBACA,oBACA,2CACA,iDAEA,0BACE,2BACA,gBACA,UACA,uBACA,2BACA,iBACA,wBAEA,iCACE,oDACA,gBACA,mCACA,2CACA,oBAKF,iCACE,gDAIJ,kCACE,YAiCA,kBACA,gBACA,eAjCA,wCACE,oBACA,kBACA,UACA,YACA,aACA,mBACA,mBACA,oBAEA,yDACE,kBAIJ,uCACE,uBAGF,yCACE,uBAGF,yCACE,uBAGF,sCACE,uBC9CJ,oDACE,wBACA,cACA,WACA,cACA,oBACA,uBAEA,0DACE,aAGF,+DACE,WACA,eAEA,uBACA,yBACA,kBAGF,0EACE,wBAGF,uEACE,qBAGF,mFACE,eAGF,+IACE,eDgCF,oDACE,YACA,kBACA,aACA,MACA,wBACA,SACA,UAIA,0EAvBA,YACA,YACA,aACA,8BACA,2CACA,oDACA,0JAqBA,sEA3BA,YACA,YACA,aACA,8BACA,2CACA,oDACA,uJAyBA,+DA/BA,YACA,YACA,aACA,8BACA,2CACA,oDACA,sJ;AE7EN,QACE,mCACA,UACA,mBACA,uBACA,eACA,gBACA,kBACA,wEACA,WACA,iBACA,aACA,mBACA,0CAEA,wBACE,kBACA,WACA,YAGF,eACE,WACA,YAGF,UACE,iBAEA,4BACE,qBAIJ,mBACE,WACA,YACA,gBAEA,0BACE,eACA,gBAIJ,kBACE,WACA,YACA,kBAEA,yBACE,cACA,eAIJ,mBACE,eACA,gBACA,kBAEA,0BACE,cACA,eAIJ,oBACE,cACA,eACA,oBAEA,2BACE,WACA,YAIJ,mBACE,oBAEA,qBACE,iBAGF,0BACE,gBACA,iBAIJ,mBACE,aACA,cACA,iBAEA,qBACE,eAGF,0BACE,aACA,cAIJ,eACE,kBAEA,sBACE,WACA,cACA,kBACA,gBACA,eACA,cACA,eACA,kBACA,yCACA,yBACA,cAIJ,oBACE,e;AC7HJ,sBACE,kBACA,aACA,mBACA,mBACA,WACA,qBACA,qBACA,0CACA,eAEA,4BACE,mBAGF,4BACE,aAGF,8BACE,kBAGF,4BACE,YACA,aACA,sBAEA,kCACE,uBACA,mBACA,gBAGF,mCACE,uBACA,mBACA,gBACA,cACA,iBAEA,wCACE,cAGF,yCACE,cAGF,uCACE,cAKN,kCACE,cACA,aACA,mBACA,uBACA,cACA,eACA,iBACA,iBACA,cAIA,kDACE,cAIJ,+BACE,eACA,a;AC3EJ,2BACE,qBACA,gBACA,kBACA,qBACA,yBACA,+BACA,eAEA,6CACE,kBACA,gBACA,WACA,YACA,qBAEA,iDACE,kBACA,gBACA,iBAIJ,qDACE,WAGF,mCACE,uCACA,WACA,YACA,kBACA,cACA,WACA,UACA,qBACA,oCAGF,0CACE,yCAGF,wCACE,kBACA,UACA,WACA,YACA,0BACA,SACA,WACA,mBACA,sBACA,aACA,mBACA,WACA,gEACA,UACA,eACA,wBAEA,8CACE,0BAIJ,iCACE,cACA,WAGF,kCACE,mBACA,eACA,kBAGF,8CACE,kBACA,QACA,SACA,UACA,WACA,2CACA,gBAGF,sCACE,kCACA,iBAGF,iCACE,kBACA,SACA,WACA,aACA,mBACA,uBACA,WACA,YACA,oDACA,iCACA,UAEA,uCACE,kBAGF,4CACE,iBAOJ,+CACE,UAGF,sDACE,U;ACzHF,0BACE,aACA,sBACA,mBACA,eAGF,yBACE,6BACA,mBAGF,iBACE,oBACA,2CACA,iDACA,yBACE,oDAIJ,yBACE,qBAEA,uCACE,0BACA,4BACA,6BACA,gBACA,gBACA,kCACA,+CAGF,yCACE,UACA,4BAIA,8CACE,UAGF,4CACE,+BAKN,mBACE,WACA,aACA,mBACA,WACA,oBAEA,sBACE,kBACA,gBACA,sBAIJ,mBACE,aACA,eACA,UAGF,yBACE,kBACA,mBACA,qBAEA,kCACE,eAGF,qCACE,sBACA,aACA,mBACA,qBACA,0CACA,eACA,kCAEA,2CACE,mBAGF,2CACE,uBACA,mBACA,gBAGF,2CACE,aACA,uBACA,mBACA,cACA,eACA,iBACA,kBAKN,uBACE,cACA,oBACA,kBACA,WAGF,oBACE,kBACA,gBACA,aACA,mBACA,6BACA,WACA,kBACA,eAEA,2BACE,eAGF,4BACE,kBACA,WACA,WACA,YACA,+DACA,UACA,UAGF,oCACE,WACA,aACA,sBACA,mBAEA,iDACE,mBACA,iBACA,iBACA,WAGF,uDACE,WAEA,oEACE,kBACA,eAKN,6BACE,kBACA,kCAEA,sCACE,uBAIJ,mCACE,aACA,sBACA,mBAGF,sEAEE,aACA,SACA,mBACA,kBACA,WACA,YACA,WACA,mBACA,aACA,mBACA,uBACA,0CAEA,kFACE,mBAIJ,gDACE,mBAEA,sDACE,mBAIJ,0CACE,mBAEA,iDACE,mBAIJ,wCACE,mBAEA,8CACE,mBAIJ,oCACE,aACA,cACA,oBACA,UAIJ,iCACE,aACA,mBACA,YACA,SACA,uBACA,eACA,gBAGF,gDACE,mBAEA,sDACE,YAIJ,8BACE,kBACA,2BACA,2BACA,WACA,SACA,YACA,0BACA,8DACA,mBACA,UACA,oBACA,YAEA,2CACE,aAGF,6CACE,mBACA,SAEA,6DACE,gBAIJ,uCACE,eACA,gDACE,wBAKF,uDACE,sBACA,uBAIJ,kGAEE,WACA,YAEA,oIACE,aACA,mBACA,uBAIJ,sCACE,aAIJ,yCACE,SAGF,8BACE,WACA,YAGF,6BACE,WACA,YAEA,aACA,kBACA,uDACA,mBAEA,wDACE,gBACA,WAEA,2EACE,YAIJ,mFACE,qCAIJ,mCACE,gBACA,a;ACtVJ,kBACE,kBACA,MACA,OACA,YACA,WACA,UAEA,aACA,uBACA,gBACA,kBACA,WACA,mBACA,eACA,qDACA,4BAEA,uBACE,wBAGF,uBACE,iB","sources":["webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/calls/group/MicrophoneButton.scss","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantMenu.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/common/Avatar.scss","webpack://telegram-t/./src/components/calls/group/GroupCallParticipant.scss","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantVideo.scss","webpack://telegram-t/./src/components/calls/group/GroupCall.scss","webpack://telegram-t/./src/components/calls/ActiveCallHeader.scss"],"sourcesContent":[".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete,\n &.error,\n &.confirm,\n &.pin,\n &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, 0.25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform 0.2s ease, opacity 0.2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header,\n %modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend %modal-header;\n padding: 0.5rem 1.25rem 0 0.9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n max-height: 90vh;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .modal-about {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .modal-help {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.3;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n",".MicrophoneButton {\n display: flex;\n justify-content: center;\n align-items: center;\n outline: none !important;\n position: relative;\n width: 6rem;\n height: 6rem;\n border: 0;\n background: radial-gradient(100% 100% at 100% 0%, #00a0b9 0%, #33c659 55%, #33c659 100%);\n border-radius: 50%;\n font-size: 2rem;\n color: #fff;\n transition: 0.25s ease-out filter;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n width: 8rem;\n height: 8rem;\n background: #64C166;\n border-radius: 50%;\n filter: blur(10px);\n opacity: 0.2;\n pointer-events: none;\n\n body.is-ios & {\n display: none;\n }\n }\n\n &:hover {\n filter: brightness(0.9);\n }\n\n &.crossed {\n background: radial-gradient(100% 100% at 100% 0%, #00AFFE 0%, #00AFFE 55%, #007FFF 100%);\n\n &::before {\n background: #00AFFE;\n }\n }\n\n &.muted-by-admin {\n background: radial-gradient(85.5% 103.5% at 87.5% 20.65%, #CE4D74 0%, #3D52DF 100%);\n &::before {\n background: #3D52DF;\n }\n }\n\n &.is-connecting, &.is-connecting:hover {\n background: #222B34;\n &::before {\n background: transparent;\n }\n }\n}\n","@import '../../../styles/mixins';\n\n.participant-menu {\n position: absolute;\n --color-text: white;\n --color-background-compact-menu: #212121DD;\n --color-background-compact-menu-hover: #00000066;\n\n .bubble {\n background: none !important;\n border-radius: 0;\n padding: 0;\n border: none !important;\n box-shadow: none !important;\n overflow: visible;\n color: var(--color-text);\n\n .group {\n box-shadow: 0 0.25rem 0.5rem 0.125rem rgba(16, 16, 16, 0.3);\n overflow: hidden;\n background: var(--color-background);\n border-radius: var(--border-radius-default);\n margin-bottom: 0.5rem;\n }\n }\n\n &.compact {\n .group {\n background: var(--color-background-compact-menu);\n }\n }\n\n .volume-control {\n height: 3rem;\n\n .info {\n pointer-events: none;\n position: relative;\n z-index: 1;\n height: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.75rem 1rem;\n\n .AnimatedSticker {\n margin-right: 2rem;\n }\n }\n\n &.high {\n --range-color: #4DA6E0;\n }\n\n &.normal {\n --range-color: #57BC6C;\n }\n\n &.medium {\n --range-color: #CAA53B;\n }\n\n &.low {\n --range-color: #CB5757;\n }\n\n position: relative;\n overflow: hidden;\n cursor: pointer;\n\n @mixin thumb-styles() {\n border: none;\n height: 3rem;\n width: 1.5rem;\n background: var(--range-color);\n border-radius: var(--border-radius-default);\n box-shadow: -13.5rem 0 0 12.75rem var(--range-color);\n transition: 0.25s ease-in-out background-color, 0.25s ease-in-out box-shadow;\n }\n\n @include reset-range();\n\n // Apply custom styles\n input[type=\"range\"] {\n height: 3rem;\n position: absolute;\n left: -1.5rem;\n top: 0;\n width: calc(100% + 3rem);\n margin: 0;\n z-index: 0;\n\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n",".Avatar {\n --color-user: var(--color-primary);\n flex: none;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n color: white;\n font-weight: bold;\n display: flex;\n white-space: nowrap;\n user-select: none;\n\n img:not(.emoji) {\n border-radius: 50%;\n width: 100%;\n height: 100%;\n }\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n\n i {\n font-size: 2.5rem;\n\n &.icon-reply-filled {\n transform: scale(0.7);\n }\n }\n\n &.size-micro {\n width: 1rem;\n height: 1rem;\n font-size: 0.5rem;\n\n .emoji {\n width: 0.5625rem;\n height: 0.5625rem;\n }\n }\n\n &.size-tiny {\n width: 2rem;\n height: 2rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-small {\n width: 2.125rem;\n height: 2.125rem;\n font-size: 0.875rem;\n\n .emoji {\n width: 0.875rem;\n height: 0.875rem;\n }\n }\n\n &.size-medium {\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.1875rem;\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n }\n\n &.size-large {\n font-size: 1.3125rem;\n\n i {\n font-size: 3.5rem;\n }\n\n .emoji {\n width: 1.3125rem;\n height: 1.3125rem;\n }\n }\n\n &.size-jumbo {\n width: 7.5rem;\n height: 7.5rem;\n font-size: 3.5rem;\n\n i {\n font-size: 6rem;\n }\n\n .emoji {\n width: 3.5rem;\n height: 3.5rem;\n }\n }\n\n &.online {\n position: relative;\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n bottom: 0.0625rem;\n right: 0.0625rem;\n width: 0.875rem;\n height: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--color-background);\n background-color: #0ac630;\n flex-shrink: 0;\n }\n }\n\n &.interactive {\n cursor: pointer;\n }\n}\n",".GroupCallParticipant {\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n color: #fff;\n padding: 0.5rem 0.75rem;\n border-radius: 0.75rem;\n transition: 0.15s ease-out background-color;\n cursor: pointer;\n\n &:hover {\n background: #2f363e;\n }\n\n audio {\n display: none;\n }\n\n .Avatar {\n margin-right: 1rem;\n }\n\n .info {\n min-width: 0;\n display: flex;\n flex-direction: column;\n\n .name {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n\n .about {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n color: #848d94;\n font-size: 0.75rem;\n\n &.blue {\n color: #4da6e0;\n }\n\n &.green {\n color: #57bc6c;\n }\n\n &.red {\n color: #ff706f;\n }\n }\n }\n\n .microphone {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.75rem;\n height: 2.75rem;\n margin-left: auto;\n font-size: 1.5rem;\n color: #ff706f;\n }\n\n &.can-self-unmute {\n .microphone {\n color: #848d94;\n }\n }\n\n .streams {\n cursor: pointer;\n display: flex;\n }\n}\n",".GroupCallParticipantVideo {\n border-radius: 0.75rem;\n overflow: hidden;\n position: relative;\n max-height: 12.875rem;\n width: calc(50% - 0.25rem);\n transition: 0.25s ease-out width;\n cursor: pointer;\n\n .thumbnail-avatar {\n position: absolute;\n border-radius: 0;\n width: 100%;\n height: 100%;\n transform: scale(1.1);\n\n img {\n filter: blur(10px);\n border-radius: 0;\n object-fit: cover;\n }\n }\n\n &:last-child:nth-child(odd) {\n width: 100%;\n }\n\n &::before {\n box-shadow: 0 0 0 3px transparent inset;\n width: 100%;\n height: 100%;\n position: absolute;\n display: block;\n content: \"\";\n z-index: 5;\n border-radius: 0.75rem;\n transition: 0.25s ease-out box-shadow;\n }\n\n &.active::before {\n box-shadow: 0px 0px 0px 3px #78ee7e inset;\n }\n\n .back-button {\n position: absolute;\n z-index: 5;\n top: 0.75rem;\n left: 0.75rem;\n background: rgba(0, 0, 0, 0.3);\n border: 0;\n color: white;\n border-radius: 1rem;\n padding: 0.25rem 0.75rem;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n transition: 0.25s ease-out opacity, 0.25s ease-out background-color;\n opacity: 0;\n cursor: pointer;\n outline: none !important;\n\n &:hover {\n background: rgba(0, 0, 0, 0.4);\n }\n }\n\n video {\n display: block;\n width: 100%;\n }\n\n .video {\n object-fit: contain;\n height: 12.5rem;\n position: relative;\n }\n\n .thumbnail-wrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 0;\n width: 100%;\n transform: translate(-50%, -50%) scale(1.5);\n background: black;\n }\n\n .thumbnail {\n filter: blur(10px) brightness(0.5);\n object-fit: cover;\n }\n\n .info {\n position: absolute;\n bottom: 0;\n color: #fff;\n display: flex;\n align-items: center;\n padding: 0 0.5rem 0.25rem;\n width: 100%;\n height: 2rem;\n background: linear-gradient(0deg, #000, transparent);\n transition: 0.25s ease-out opacity;\n opacity: 0;\n\n .name {\n margin-left: 0.5rem;\n }\n\n .last-icon {\n margin-left: auto;\n }\n }\n}\n\n.videos:hover .GroupCallParticipantVideo {\n\n .info {\n opacity: 1;\n }\n\n .back-button {\n opacity: 1;\n }\n}\n",".GroupCall {\n .modal-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 37.5rem;\n }\n\n .modal-dialog {\n max-height: calc(100% - 4rem);\n background: #181f27;\n }\n\n .Menu {\n --color-text: white;\n --color-background-compact-menu: #212121DD;\n --color-background-compact-menu-hover: #00000066;\n .bubble {\n box-shadow: 0 0.25rem 0.5rem 0.125rem rgba(16, 16, 16, 0.3);\n }\n }\n\n &.single-column {\n opacity: 1 !important;\n\n .modal-dialog {\n max-width: 100% !important;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n margin-top: auto;\n margin-bottom: 0;\n transform: translate3d(0, 100%, 0);\n transition: transform 0.3s ease, opacity 0.3s ease;\n }\n\n .modal-backdrop {\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n &.open {\n .modal-backdrop {\n opacity: 1;\n }\n\n .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n }\n }\n\n .header {\n width: 100%;\n display: flex;\n align-items: center;\n color: #fff;\n margin-bottom: 0.5rem;\n\n h3 {\n font-size: 1.25rem;\n font-weight: 500;\n margin: 0 auto 0 0.5rem;\n }\n }\n\n .videos {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n .participants {\n margin-top: 0.75rem;\n background: #222b34;\n border-radius: 0.75rem;\n\n .Loading {\n padding: 2rem 0;\n }\n\n .invite-btn {\n padding: 0.25rem 0.75rem;\n display: flex;\n align-items: center;\n border-radius: 0.75rem;\n transition: 0.15s ease-out background-color;\n cursor: pointer;\n color: var(--color-text-secondary);\n\n &:hover {\n background: #2f363e;\n }\n\n .text {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.5rem;\n margin-right: 1rem;\n }\n }\n }\n\n .scrollable {\n overflow: auto;\n padding-bottom: 2rem;\n max-width: 37.5rem;\n width: 100%;\n }\n\n .buttons {\n max-width: 37.5rem;\n margin-top: auto;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: 100%;\n position: relative;\n height: 8.75rem;\n\n button {\n cursor: pointer;\n }\n\n &::before {\n position: absolute;\n content: \"\";\n width: 100%;\n height: 2rem;\n background: linear-gradient(0deg, #181f27, rgba(24, 31, 39, 0));\n z-index: 0;\n top: -2rem;\n }\n\n .button-wrapper {\n width: 4rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .button-text {\n white-space: nowrap;\n font-size: 0.75rem;\n margin-top: 0.5rem;\n color: #fff;\n }\n\n &.microphone-wrapper {\n width: 6rem;\n\n .button-text {\n margin-top: 0.75rem;\n font-size: 1rem;\n }\n }\n }\n\n .Loading {\n position: absolute;\n transform: translate(0, -1.125rem);\n\n .Spinner {\n --spinner-size: 6.5rem;\n }\n }\n\n .video-buttons {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .small-button,\n .smaller-button {\n outline: none;\n border: 0;\n background: #15415b;\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n color: #fff;\n font-size: 1.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: 0.25s ease-out background-color;\n\n &:hover {\n background: #11364b;\n }\n }\n\n .small-button.camera.active {\n background: #15415b;\n\n &:hover {\n background: #11364b;\n }\n }\n\n .small-button.speaker {\n background: #2b3a51;\n\n &.active {\n background: #496092;\n }\n }\n\n .small-button.leave {\n background: #5a2824;\n\n &:hover {\n background: #49201d;\n }\n }\n\n .smaller-button {\n width: 2.5rem;\n height: 2.5rem;\n margin-bottom: 0.5rem;\n padding: 0;\n }\n }\n\n &.landscape .scrollable {\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n gap: 1rem;\n align-items: flex-start;\n max-width: 100%;\n max-height: 100%;\n }\n\n &.landscape .GroupCallParticipantVideo {\n max-height: initial;\n\n video {\n height: 100%;\n }\n }\n\n &.landscape .buttons {\n position: absolute;\n left: calc(50% - 15.625rem / 2);\n transform: translateX(-50%);\n width: auto;\n gap: 1rem;\n bottom: 4rem;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(10px);\n border-radius: 1rem;\n z-index: 5;\n padding: 0.75rem 1rem;\n height: auto;\n\n .button-text {\n display: none;\n }\n\n .video-buttons {\n flex-direction: row;\n gap: 1rem;\n\n .smaller-button {\n margin-bottom: 0;\n }\n }\n\n .Loading {\n transform: none;\n .Spinner {\n --spinner-size: 3.25rem;\n }\n }\n\n .MicrophoneButton {\n canvas {\n width: 2rem !important;\n height: 2rem !important;\n }\n }\n\n .MicrophoneButton,\n .microphone-wrapper {\n width: 3rem;\n height: 3rem;\n\n .AnimatedSticker {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n }\n\n &::before {\n display: none;\n }\n }\n\n &.landscape.no-sidebar .buttons {\n left: calc(50%);\n }\n\n &.landscape .streams {\n width: 100%;\n height: 100%;\n }\n\n &.landscape .videos {\n width: 100%;\n height: 100%;\n\n display: grid;\n --column-count: 1;\n grid-template-columns: repeat(var(--column-count), 1fr);\n grid-auto-rows: 1fr;\n\n .GroupCallParticipantVideo {\n max-height: 100%;\n width: 100%;\n\n .thumbnail-wrapper {\n height: 100%;\n }\n }\n\n &.span-last-video .GroupCallParticipantVideo:last-child {\n grid-column: span var(--column-count);\n }\n }\n\n &.landscape .participants {\n width: 15.625rem;\n margin-top: 0;\n }\n}\n",".ActiveCallHeader {\n position: absolute;\n top: 0;\n left: 0;\n height: 2rem;\n width: 100%;\n z-index: 1;\n\n display: flex;\n justify-content: center;\n font-weight: 500;\n font-size: 0.875rem;\n color: #fff;\n align-items: center;\n padding: 0 1rem;\n background: linear-gradient(135deg, rgb(49, 82, 232), rgb(143, 74, 172));\n transform: translateY(-100%);\n\n &.open {\n transform: translateY(0);\n }\n\n span {\n line-height: 100%;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/47.b422d6da038c24068089.js b/dist/47.9ea2a6fe11cbf65b8511.js similarity index 99% rename from dist/47.b422d6da038c24068089.js rename to dist/47.9ea2a6fe11cbf65b8511.js index 0edc2b8a..1d5f1a70 100644 --- a/dist/47.b422d6da038c24068089.js +++ b/dist/47.9ea2a6fe11cbf65b8511.js @@ -1,3 +1,3 @@ -/*! For license information please see 47.b422d6da038c24068089.js.LICENSE.txt */ +/*! For license information please see 47.9ea2a6fe11cbf65b8511.js.LICENSE.txt */ (self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[47],{6628:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ActiveCallHeader:()=>J,CallFallbackConfirm:()=>K,GroupCall:()=>q});var n=a(3794),i=a(4050),o=a(5116),r=a(3716),s=a(1226),l=a(9066),c=a(2607),d=a(4446),u=a(782),p=a(2267),m=a(1394),v=a(1689),g=a(6204),f=a(1171);(0,o.Q6)("apiUpdate",((e,t,a)=>{const{activeGroupCallId:i}=e.groupCalls;switch(a["@type"]){case"updateGroupCallLeavePresentation":t.toggleGroupCallPresentation({value:!1});break;case"updateGroupCallStreams":if(!a.userId||!i)break;if(!(0,c.GU)(e,i,a.userId))break;return(0,d.B6)(e,i,a.userId,(0,u.CE)(a,["@type","userId"]));case"updateGroupCallConnectionState":if(!i)break;if("disconnected"===a.connectionState){t.leaveGroupCall({isFromLibrary:!0});break}return(0,d.AH)(e,i,{connectionState:a.connectionState,isSpeakerDisabled:a.isSpeakerDisabled});case"updateGroupCallParticipants":{const{groupCallId:e,participants:t}=a;i===e&&(0,n.handleUpdateGroupCallParticipants)(t);break}case"updateGroupCallConnection":{if(a.data.stream){t.showNotification({message:"Big live streams are not yet supported"}),t.leaveGroupCall();break}(0,n.handleUpdateGroupCallConnection)(a.data,a.presentation);const i=(0,c.mU)(e);null!=i&&i.participants&&Object.keys(i.participants).length>0&&(0,n.handleUpdateGroupCallParticipants)(Object.values(i.participants));break}}})),(0,o.Q6)("leaveGroupCall",((e,t,a)=>{const{isFromLibrary:i,shouldDiscard:r,shouldRemove:l,rejoin:u}=a||{},p=(0,c.mU)(e);p&&((0,o.R3)((0,d.Ic)(e,{connectionState:"disconnected"},p.participantsCount-1)),(async()=>{await(0,s.t9)("leaveGroupCall",{call:p});let a=!1;var c;r&&((e=(0,o.Rd)()).groupCalls.fallbackChatId===p.chatId&&(a=!0,null===(c=e.groupCalls.fallbackUserIdsToRemove)||void 0===c||c.forEach((a=>{t.deleteChatMember({chatId:e.groupCalls.fallbackChatId,userId:a})}))),await(0,s.t9)("discardGroupCall",{call:p}));e=(0,o.Rd)(),l&&(e=(0,d.dc)(e,p.id)),(0,v.Mt)(),(0,o.R3)({...e,groupCalls:{...e.groupCalls,isGroupCallPanelHidden:!0,activeGroupCallId:void 0,...a&&{fallbackChatId:void 0,fallbackUserIdsToRemove:void 0}}}),i||(0,n.leaveGroupCall)(),u&&t.joinGroupCall(u)})())})),(0,o.Q6)("toggleGroupCallVideo",(e=>{const t=(0,c.mU)(e),a=(0,l.dy)(e,e.currentUserId);a&&t&&(async()=>{await(0,n.toggleStream)("video"),await(0,s.t9)("editGroupCallParticipant",{call:t,videoStopped:!(0,n.isStreamEnabled)("video"),participant:a})})()})),(0,o.Q6)("requestToSpeak",((e,t,a)=>{const{value:n}=a||{value:!0},i=(0,c.mU)(e),o=(0,l.dy)(e,e.currentUserId);o&&i&&(0,s.t9)("editGroupCallParticipant",{call:i,raiseHand:n,participant:o})})),(0,o.Q6)("setGroupCallParticipantVolume",((e,t,a)=>{const{participantId:i,volume:o}=a,d=(0,c.mU)(e),u=(0,l.dy)(e,i);u&&d&&((0,n.setVolume)(i,Math.floor(o/r.Ro)/100),(0,s.t9)("editGroupCallParticipant",{call:d,volume:Number(o),participant:u}))})),(0,o.Q6)("toggleGroupCallMute",((e,t,a)=>{const{participantId:i,value:o}=a||{},r=(0,c.mU)(e),d=(0,l.dy)(e,i||e.currentUserId);d&&r&&(async()=>{const e=void 0===o?(0,n.isStreamEnabled)("audio",d.id):o;i?(0,n.setVolume)(i,e?0:1):await(0,n.toggleStream)("audio"),await(0,s.t9)("editGroupCallParticipant",{call:r,muted:e,participant:d})})()})),(0,o.Q6)("toggleGroupCallPresentation",((e,t,a)=>{const i=(0,c.mU)(e),o=(0,l.dy)(e,e.currentUserId);o&&i&&(async()=>{if(void 0!==(null==a?void 0:a.value)?null==a?void 0:a.value:!(0,n.isStreamEnabled)("presentation")){const e=await(0,n.startSharingScreen)();if(!e)return;await(0,s.t9)("joinGroupCallPresentation",{call:i,params:e})}else await(0,n.toggleStream)("presentation",!1),await(0,s.t9)("leaveGroupCallPresentation",{call:i});await(0,s.t9)("editGroupCallParticipant",{call:i,presentationPaused:!(0,n.isStreamEnabled)("presentation"),participant:o})})()})),(0,o.Q6)("connectToActiveGroupCall",((e,t)=>{const a=(0,c.mU)(e);if(!a)return;if("discarded"===a.connectionState)return void t.showNotification({message:"This voice chat is not active"});const i=(0,v.FF)(),r=(0,v.NH)();if(!i||!r)return;const{currentUserId:d}=e;d&&(async()=>{const e=await(0,n.joinGroupCall)(d,r,i,t.apiUpdate);if(await(0,s.t9)("joinGroupCall",{call:a,params:e,inviteHash:a.inviteHash})&&(t.loadMoreGroupCallParticipants(),a.chatId)){const e=(0,l.Z1)((0,o.Rd)(),a.chatId);if(!e)return;await(0,g.f)(e)}})()})),(0,o.Q6)("inviteToCallFallback",((e,t,a)=>{const{chatId:n}=(0,l.Bt)(e)||{};if(!n)return;const i=(0,l.dy)(e,n);if(!i)return;const{shouldRemove:r}=a;(async()=>{const a=(0,c.oq)(e);let l=Object.values(e.chats.byId).find((e=>e.title===a&&e.isCreator&&!e.isRestricted));if(l)t.updateChatMemberBannedRights({chatId:l.id,userId:n,bannedRights:{}}),(0,s.t9)("addChatMembers",l,[i],!0);else{if(l=await(0,s.t9)("createChannel",{title:a,users:[i]}),!l)return;const e=await(0,m.dc)(f,"avatar.png");(0,s.t9)("editChatPhoto",{chatId:l.id,accessHash:l.accessHash,photo:e})}const d=await(0,s.t9)("updatePrivateLink",{chat:l,usageLimit:1,expireDate:(0,p.b)(e.serverTimeOffset)+1800});if(d){if(r){const t=(e=(0,o.Rd)()).groupCalls.fallbackUserIdsToRemove||[];(0,o.R3)({...e,groupCalls:{...e.groupCalls,fallbackChatId:l.id,fallbackUserIdsToRemove:[...t,n]}})}t.sendMessage({text:`Join a call: ${d}`}),t.openChat({id:l.id}),t.createGroupCall({chatId:l.id}),t.closeCallFallbackConfirm()}})()}));var C=a(7361),h=a(6752),P=a(706),S=a(9107),E=a(4288),b=a(231),y=a(3106),Z=a(8964),k=a(3103);const I=()=>{var e,t;null===(e=(t=navigator).vibrate)||void 0===e||e.call(t,50)};var G=a(7204),w=a(7324),T=a(7799);const N=(0,i.X$)((e=>{let{size:t,name:a,playSegment:n,color:o}=e;const[r,s]=(0,i.eJ)();return(0,i.d4)((()=>{(0,w.Z)(a).then(s)}),[a]),i.ZP.createElement(T.Z,{id:a,play:!0,noLoop:!0,playSegment:n,size:t,speed:1,animationData:r,color:o})})),M=(0,i.X$)((0,o.c$)((e=>{const t=(0,c.mU)(e),{connectionState:a}=t||{},n=t&&(0,c.GU)(e,t.id,e.currentUserId),{raiseHandRating:i,hasAudioStream:o,canSelfUnmute:r,isMuted:s}=n||{};return{connectionState:a||"discarded",hasRequestedToSpeak:Boolean(i),noAudioStream:!o,canSelfUnmute:r,isMuted:s}}))((e=>{let{noAudioStream:t,canSelfUnmute:a,isMuted:n,hasRequestedToSpeak:r,connectionState:s}=e;const{toggleGroupCallMute:l,requestToSpeak:c,playGroupCallSound:d}=(0,o.uC)(),u=(0,S.Z)(),p=(0,i.sO)("up"),[m,v]=(0,i.eJ)(!1),g="connected"!==s,f=!a&&n,C=(0,G.Z)(f);(0,i.d4)((()=>{C&&!f&&d("allowTalk")}),[d,C,f]);const P=(0,i.Ye)((()=>{if(m){const e=Math.floor(100*Math.random());return e<32?[0,120]:e<64?[120,240]:e<97?[240,420]:[420,540]}return!C&&f?t?[99,135]:[136,172]:C&&!f?[0,36]:f?[0,0]:t?[69,99]:[36,69]}),[C,m,t,f]),E=m?"HandFilled":"VoiceMini",b=()=>{I(),l()},y=(0,i.Ye)((()=>u(r?"VoipMutedTapedForSpeak":f?"VoipMutedByAdmin":t?"VoipUnmute":"VoipTapToMute")),[r,t,u,f]);return i.ZP.createElement("div",{className:"button-wrapper microphone-wrapper"},i.ZP.createElement("button",{className:(0,h.Z)("MicrophoneButton",t&&"crossed",a&&"can-self-unmute",g&&"is-connecting",f&&"muted-by-admin"),onMouseDown:()=>{if(f){if(m)return;return I(),c(),v(!0),void setTimeout((()=>{v(!1)}),3e3)}p.current="down",t&&setTimeout((()=>{"down"===p.current&&(p.current="hold",b())}),200)},onMouseUp:()=>{f||(b(),p.current="up")}},i.ZP.createElement(N,{name:E,size:48,playSegment:P})),i.ZP.createElement("div",{className:"button-text"},y))})));var U=a(4605),O=a(9118);var R=a(2328),$=a(2275);const D=[0,17],V=[17,34],A=(0,i.X$)((0,o.c$)((e=>({isAdmin:(0,c.Ht)(e)})))((e=>{let{participant:t,closeDropdown:a,isDropdownOpen:n,anchor:s,isAdmin:l}=e;const{toggleGroupCallMute:c,setGroupCallParticipantVolume:d,toggleGroupCallPanel:u,openChat:p,requestToSpeak:m}=(0,o.uC)(),v=(0,S.Z)(),[g,f,C]=(0,P.Z)(),E=null==t?void 0:t.id,{isMutedByMe:b,isMuted:y,isSelf:k,canSelfUnmute:I}=t||{},G=Boolean(null==t?void 0:t.raiseHandRating),w=!I&&y,[T,M]=(0,i.eJ)(b?0:((null==t?void 0:t.volume)||r.aC)/r.Ro);(0,i.d4)((()=>{M(b?0:((null==t?void 0:t.volume)||r.aC)/r.Ro)}),[E]);const U=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.Ye)((()=>(0,O.P2)((e=>e()),e,!t)),[e,t])}(500),A=(0,i.I4)((e=>{e.stopPropagation(),f(),a()}),[f,a]),H=(0,i.I4)((e=>{e.stopPropagation(),m({value:!1}),a()}),[m,a]),F=(0,i.I4)((e=>{e.stopPropagation(),a(),l||M(b?r.aC/r.Ro:0),c({participantId:E,value:l?!w:!b})}),[a,c,E,l,w,b]),L=(0,i.I4)((e=>{e.stopPropagation(),u(),p({id:E}),a()}),[u,a,p,E]),x=0===T?D:V;return i.ZP.createElement("div",null,i.ZP.createElement(R.Z,{isOpen:n,positionX:"right",autoClose:!0,style:s?`right: 1rem; top: ${s.y}px;`:void 0,onClose:a,className:"participant-menu"},!k&&!w&&i.ZP.createElement("div",{className:"group"},i.ZP.createElement("div",{className:(0,h.Z)("volume-control",T<50&&"low",T>=50&&T<100&&"medium",T>=100&&T<150&&"normal",T>=150&&"high")},i.ZP.createElement("input",{type:"range",min:"0",max:"200",value:T,onChange:e=>{const t=Number(e.target.value);M(t),U((()=>{0===t?c({participantId:E,value:!0}):d({participantId:E,volume:Math.floor(t*r.Ro)})}))}}),i.ZP.createElement("div",{className:"info"},i.ZP.createElement(N,{name:"Speaker",playSegment:x,size:24}),i.ZP.createElement("span",null,T,"%")))),i.ZP.createElement("div",{className:"group"},G&&k&&i.ZP.createElement(Z.Z,{icon:"stop-raising-hand",onClick:H},v("VoipGroupCancelRaiseHand")),!k&&i.ZP.createElement(Z.Z,{icon:"user",onClick:L},v("VoipGroupOpenProfile")),!k&&i.ZP.createElement(Z.Z,{icon:y&&l?"allow-speak":"microphone-alt",onClick:F},v(l?w?"VoipGroupAllowToSpeak":"VoipMute":b?"VoipGroupUnmuteForMe":"VoipGroupMuteForMe")),!k&&l&&i.ZP.createElement(Z.Z,{icon:"delete-user",destructive:!0,onClick:A},v("VoipGroupUserRemove")))),!k&&l&&i.ZP.createElement($.Z,{isOpen:g,userId:E,onClose:C}))})));var H=a(7407),F=a(172);const L=(0,i.X$)((e=>{let{participant:t,noColor:a}=e;const{isMuted:o,isMutedByMe:r}=t,s=(t.amplitude||0)>n.THRESHOLD,l=Boolean(t.raiseHandRating),c=(0,G.Z)(l),d=!Boolean(null==t?void 0:t.canSelfUnmute)&&o,u=(0,G.Z)(o),p=(0,i.Ye)((()=>o&&!u?[43,64]:!o&&u?[22,42]:l&&!c?[65,84]:!d&&c?[0,21]:o?[22,23]:[43,44]),[o,d,l]),m=(0,i.Ye)((()=>a?[255,255,255]:l?[77,166,224]:d||r?[255,112,111]:s?[87,188,108]:[132,141,148]),[a,l,d,r,s]);return i.ZP.createElement(N,{name:"VoiceOutlined",playSegment:p,size:28,color:m})})),x=(0,i.X$)((0,o.c$)(((e,t)=>{let{participant:a}=t;return{user:a.isUser?(0,l.dy)(e,a.id):void 0,chat:a.isUser?void 0:(0,l.Z1)(e,a.id)}}))((e=>{let{openParticipantMenu:t,participant:a,user:o,chat:s}=e;const l=(0,i.sO)(null),c=(0,S.Z)(),{isSelf:d,isMutedByMe:u,isMuted:p}=a,m=(a.amplitude||0)>n.THRESHOLD,v=Boolean(a.raiseHandRating),[g,f]=(0,i.Ye)((()=>d?[c("ThisIsYou"),"blue"]:u?[c("VoipGroupMutedForMe"),"red"]:v?[c("WantsToSpeak"),"blue"]:!p&&m?[a.volume&&a.volume!==r.aC?c("SpeakingWithVolume",(a.volume/r.Ro).toString()).replace("%%","%"):c("Speaking"),"green"]:a.about?[a.about,""]:[c("Listening"),"blue"]),[m,a.volume,c,d,u,v,p,a.about]);if(!o&&!s)return;const C=o?`${o.firstName||""} ${o.lastName||""}`:null==s?void 0:s.title;return i.ZP.createElement("div",{className:(0,h.Z)("GroupCallParticipant",a.canSelfUnmute&&"can-self-unmute"),onClick:()=>{d||t(l.current,a)},ref:l},i.ZP.createElement(F.Z,{user:o,chat:s,size:"medium"}),i.ZP.createElement("div",{className:"info"},i.ZP.createElement("span",{className:"name"},C),i.ZP.createElement("span",{className:(0,h.Z)("about",f)},g)),i.ZP.createElement("div",{className:"microphone"},i.ZP.createElement(L,{participant:a})))})));var j=a(1273);const _=(0,i.X$)((0,o.c$)((e=>{const{participantsCount:t,participants:a}=(0,c.mU)(e)||{};return{participants:a,participantsCount:t||0}}))((e=>{let{participants:t,participantsCount:a,openParticipantMenu:n}=e;const{createGroupCallInviteLink:r,loadMoreGroupCallParticipants:s}=(0,o.uC)(),l=(0,S.Z)(),c=(0,i.Ye)((()=>Object.keys(t||{})),[t]),[d,u]=(0,H.Z)(s,c,c.length>=a);return i.ZP.createElement("div",{className:"participants"},i.ZP.createElement("div",{className:"invite-btn",onClick:r},i.ZP.createElement("div",{className:"icon"},i.ZP.createElement("i",{className:"icon-add-user"})),i.ZP.createElement("div",{className:"text"},l("VoipGroupInviteMember"))),i.ZP.createElement(j.Z,{items:d,onLoadMore:u},null==d?void 0:d.map((e=>t[e]&&i.ZP.createElement(x,{key:e,openParticipantMenu:n,participant:t[e]})))))}))),B=(0,i.X$)((0,o.c$)(((e,t)=>{let{participant:a}=t;return{currentUserId:e.currentUserId,user:a.isUser?(0,l.dy)(e,a.id):void 0,chat:a.isUser?void 0:(0,l.Z1)(e,a.id),isActive:(a.amplitude||0)>n.THRESHOLD}}))((e=>{let{type:t,onClick:a,user:o,chat:s,isActive:l,isFullscreen:c}=e;const d=(0,S.Z)(),u=(0,i.I4)((()=>{a&&a((null==o?void 0:o.id)||s.id,t)}),[s,a,t,null==o?void 0:o.id]);if(!o&&!s)return;const p=(0,n.getUserStreams)((null==o?void 0:o.id)||s.id);return i.ZP.createElement("div",{className:(0,h.Z)("GroupCallParticipantVideo",l&&"active"),onClick:u},c&&i.ZP.createElement("button",{className:"back-button"},i.ZP.createElement("i",{className:"icon-arrow-left"}),d("Back")),i.ZP.createElement(F.Z,{user:o,chat:s,className:"thumbnail-avatar"}),r.LH&&i.ZP.createElement("div",{className:"thumbnail-wrapper"},i.ZP.createElement("video",{className:"thumbnail",muted:!0,autoPlay:!0,playsInline:!0,srcObject:null==p?void 0:p[t]})),i.ZP.createElement("video",{className:"video",muted:!0,autoPlay:!0,playsInline:!0,srcObject:null==p?void 0:p[t]}),i.ZP.createElement("div",{className:"info"},i.ZP.createElement("i",{className:"icon-microphone-alt"}),i.ZP.createElement("span",{className:"name"},(null==o?void 0:o.firstName)||(null==s?void 0:s.title)),"presentation"===t&&i.ZP.createElement("i",{className:"last-icon icon-active-sessions"})))}))),z=(0,i.X$)((0,o.c$)((e=>{const{participants:t}=(0,c.mU)(e)||{};return{participants:t}}))((e=>{let{participants:t,onDoubleClick:a}=e;const[n,o]=(0,i.eJ)(void 0),r=(0,i.Ye)((()=>Object.values(t||{}).filter((e=>e.hasPresentationStream))),[t]),s=(0,i.Ye)((()=>Object.values(t||{}).filter((e=>e.hasVideoStream))),[t]),l=s.length+r.length,c=l<=2?1:l<=6?2:l<=9?3:4,d=3===l||2===c&&l%2!=0,u=(0,i.I4)(((e,t)=>{n&&e===n.id&&t===n.type?o(void 0):o({id:e,type:t})}),[n]);return i.ZP.createElement("div",{className:"streams",onDoubleClick:a},i.ZP.createElement("div",{className:(0,h.Z)("videos",d&&"span-last-video"),style:`--column-count: ${n?1:c}`},n&&i.ZP.createElement(B,{key:n.id,isFullscreen:!0,onClick:u,participant:t[n.id],type:n.type}),n?void 0:r.map((e=>i.ZP.createElement(B,{key:e.id,onClick:u,participant:e,type:"presentation"}))),n?void 0:s.map((e=>i.ZP.createElement(B,{key:e.id,onClick:u,participant:e,type:"video"})))))}))),Q=[0,10],q=(0,i.X$)((0,o.c$)(((e,t)=>{let{groupCallId:a}=t;const{connectionState:n,title:i,isSpeakerDisabled:o,participants:r,participantsCount:s}=(0,c.$5)(e,a)||{};return{connectionState:n,title:i,isSpeakerEnabled:!o,participantsCount:s,meParticipant:(0,c.GU)(e,a,e.currentUserId),isGroupCallPanelHidden:Boolean(e.groupCalls.isGroupCallPanelHidden),isAdmin:(0,c.Ht)(e),participants:r}}))((e=>{let{groupCallId:t,isGroupCallPanelHidden:a,connectionState:r,isSpeakerEnabled:s,title:l,meParticipant:c,isAdmin:d,participants:u}=e;const{toggleGroupCallVideo:p,toggleGroupCallPresentation:m,leaveGroupCall:v,toggleGroupCallPanel:g,connectToActiveGroupCall:f,playGroupCallSound:I}=(0,o.uC)(),G=(0,S.Z)(),w=(0,i.sO)(null),[T,O]=(0,i.eJ)(!1),[R,$,D]=(0,P.Z)(),[V,H,F]=(0,P.Z)(!0),L=u&&Object.values(u).some((e=>e.video||e.presentation)),x=R&&!C.wB&&L,[j,B]=(0,i.eJ)(),[q,J,X]=(0,P.Z)(),[Y,W,K]=(0,P.Z)(),[ee,te]=(0,i.eJ)(!1),[ae,ne]=(0,i.eJ)(!1),ie=null==c?void 0:c.hasVideoStream,oe=null==c?void 0:c.hasPresentationStream,re="connected"!==r,se=!(null==c?void 0:c.canSelfUnmute)&&(null==c?void 0:c.isMuted),le=(0,i.I4)(((e,t)=>{const a=e.getBoundingClientRect(),n=w.current;B({anchor:{x:a.left,y:a.top-n.offsetTop+60},participant:t}),J()}),[J]);(0,i.d4)((()=>{"connected"===r?I({sound:"join"}):"reconnecting"===r&&I({sound:"connecting"})}),[r,I]);const ce=()=>{K(),te(!1)},de=(0,i.Ye)((()=>e=>{let{onTrigger:t,isOpen:a}=e;return i.ZP.createElement(b.Z,{round:!0,size:"smaller",color:"translucent",className:a?"active":void 0,onClick:t,ariaLabel:G("AccDescrMoreOptions")},i.ZP.createElement("i",{className:"icon-more"}))}),[G]),ue=(0,i.I4)((()=>{w.current&&(R?document.exitFullscreen().then(D):w.current.requestFullscreen().then($))}),[D,R,$]),pe=(0,i.I4)((()=>{C.t0&&(R||F(),ue())}),[F,ue,R]),me=(0,i.I4)((()=>{R?D():$()}),[D,R,$]);(0,i.d4)((()=>{if(!C.t0)return;const e=w.current;return e?(e.addEventListener("fullscreenchange",me),()=>{e.removeEventListener("fullscreenchange",me)}):void 0}),[me]),(0,i.d4)((()=>{f()}),[f,t]);const ve=()=>{if(d&&!Y)return W(),void(R&&ue());I({sound:"leave"}),O(!0),K()};return i.ZP.createElement(k.Z,{isOpen:!a&&!T,onClose:g,className:(0,h.Z)("GroupCall",C.wB&&"single-column",x&&"landscape",!V&&"no-sidebar"),dialogRef:w,onCloseAnimationEnd:()=>{T&&v({shouldDiscard:ae})}},i.ZP.createElement("div",{className:"header"},i.ZP.createElement("h3",null,l||G("VoipGroupVoiceChat")),C.t0&&i.ZP.createElement(b.Z,{round:!0,size:"smaller",color:"translucent",onClick:ue,ariaLabel:G(R?"AccExitFullscreen":"AccSwitchToFullscreen")},i.ZP.createElement("i",{className:R?"icon-smallscreen":"icon-fullscreen"})),x&&i.ZP.createElement(b.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>{V?F():H()}},i.ZP.createElement("i",{className:"icon-sidebar"})),(n.IS_SCREENSHARE_SUPPORTED&&!se||d)&&i.ZP.createElement(y.Z,{positionX:"right",trigger:de},n.IS_SCREENSHARE_SUPPORTED&&!se&&i.ZP.createElement(Z.Z,{icon:"share-screen",onClick:m},G(oe?"VoipChatStopScreenCapture":"VoipChatStartScreenCapture")),d&&i.ZP.createElement(Z.Z,{icon:"phone-discard-outline",onClick:()=>{te(!0),ne(!0),W(),R&&ue()},destructive:!0},G("VoipGroupLeaveAlertEndChat"))),i.ZP.createElement(b.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>{g(),R&&D()}},i.ZP.createElement("i",{className:"icon-close"}))),i.ZP.createElement("div",{className:"scrollable custom-scroll"},i.ZP.createElement(z,{onDoubleClick:pe}),(!x||V)&&i.ZP.createElement(_,{openParticipantMenu:le})),i.ZP.createElement(A,{participant:null==j?void 0:j.participant,anchor:null==j?void 0:j.anchor,isDropdownOpen:q,closeDropdown:X}),i.ZP.createElement("div",{className:"buttons"},re&&i.ZP.createElement(E.Z,null),i.ZP.createElement("div",{className:"button-wrapper"},i.ZP.createElement("div",{className:"video-buttons"},ie&&(C.wZ||C.cj)&&i.ZP.createElement("button",{className:"smaller-button",onClick:n.switchCameraInput},i.ZP.createElement(N,{name:"CameraFlip",playSegment:Q,size:24})),i.ZP.createElement("button",{className:(0,h.Z)("small-button",se?"speaker":"camera",(ie||se&&s)&&"active"),onClick:()=>{se?(0,n.toggleSpeaker)():p()}},i.ZP.createElement("i",{className:se?"icon-speaker":ie?"icon-video-stop":"icon-video"}))),i.ZP.createElement("div",{className:"button-text"},G(se?"VoipSpeaker":"VoipCamera"))),i.ZP.createElement(M,null),i.ZP.createElement("div",{className:"button-wrapper"},i.ZP.createElement("button",{className:"small-button leave",onClick:ve},i.ZP.createElement("i",{className:"icon-phone-discard"})),i.ZP.createElement("div",{className:"button-text"},G("VoipGroupLeave")))),i.ZP.createElement(k.Z,{isOpen:Y,onClose:ce,className:"error",title:G(ee?"VoipGroupEndAlertTitle":"VoipGroupLeaveAlertTitle")},i.ZP.createElement("p",null,G(ee?"VoipGroupEndAlertText":"VoipGroupLeaveAlertText")),!ee&&i.ZP.createElement(U.Z,{label:G("VoipGroupEndChat"),checked:ae,onCheck:ne}),i.ZP.createElement(b.Z,{isText:!0,className:"confirm-dialog-button",onClick:ve},G(ee?"VoipGroupEnd":"VoipGroupLeave")),i.ZP.createElement(b.Z,{isText:!0,className:"confirm-dialog-button",onClick:ce},G("Cancel"))))}))),J=(0,i.X$)((0,o.c$)((e=>({groupCall:(0,c.mU)(e),isGroupCallPanelHidden:e.groupCalls.isGroupCallPanelHidden,meParticipant:(0,c.GU)(e,e.groupCalls.activeGroupCallId,e.currentUserId)})))((e=>{let{groupCall:t,meParticipant:a,isGroupCallPanelHidden:n}=e;const{toggleGroupCallPanel:r}=(0,o.uC)(),s=(0,S.Z)();if((0,i.d4)((()=>(document.body.classList.toggle("has-group-call-header",n),()=>{document.body.classList.toggle("has-group-call-header",!1)})),[n]),t&&a)return i.ZP.createElement("div",{className:(0,h.Z)("ActiveCallHeader",n&&"open"),onClick:r},i.ZP.createElement("span",{className:"title"},t.title||s("VoipGroupVoiceChat")))})));var X=a(7551),Y=a(8415),W=a(8360);const K=(0,i.X$)((0,o.c$)((e=>{const{chatId:t}=(0,l.Bt)(e)||{},a=t?(0,l.dy)(e,t):void 0;return{userFullName:a?(0,Y.Js)(a):void 0,channelTitle:(0,c.oq)(e)}}))((e=>{let{isOpen:t,channelTitle:a,userFullName:n}=e;const{closeCallFallbackConfirm:r,inviteToCallFallback:s}=(0,o.uC)(),[l,c]=(0,i.eJ)(!0),d=(0,W.Z)(n,!0);return i.ZP.createElement(X.Z,{title:"Start Call",isOpen:t,confirmHandler:()=>{s({shouldRemove:l})},onClose:r},i.ZP.createElement("p",null,"The call will be started in a private channel ",i.ZP.createElement("b",null,a),"."),i.ZP.createElement(U.Z,{label:`Remove ${d} from this channel after the call`,checked:l,onCheck:c}))})))},3794:(e,t)=>{(()=>{"use strict";var e={"./src/blacksilence.ts":(e,t,a)=>{a.r(t),a.d(t,{silence:()=>n,black:()=>i});const n=e=>{const t=e.createOscillator(),a=t.connect(e.createMediaStreamDestination());return t.start(),new MediaStream([Object.assign(a.stream.getAudioTracks()[0],{enabled:!1})])},i=function(){let{width:e=640,height:t=480}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=Object.assign(document.createElement("canvas"),{width:e,height:t}),n=a.getContext("2d");if(!n)throw Error("Cannot create canvas ctx");n.fillRect(0,0,e,t);const i=a.captureStream();return new MediaStream([Object.assign(i.getVideoTracks()[0],{enabled:!1})])}},"./src/buildSdp.ts":(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a("./src/utils.ts");const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=[],o=e=>{i.push(e)},{sessionId:r,ssrcs:s,audioExtensions:l,videoExtensions:c,audioPayloadTypes:d,videoPayloadTypes:u,transport:{ufrag:p,pwd:m,fingerprints:v,candidates:g}}=e;o("v=0"),o(`o=- ${r} 2 IN IP4 0.0.0.0`),o("s=-"),o("t=0 0"),o(`a=group:BUNDLE ${s.map((e=>e.endpoint)).join(" ")}${a?"":" 2"}`),o("a=ice-lite");const f=e=>{let t="";t+="a=candidate:",t+=`${e.foundation} ${e.component} ${e.protocol} ${e.priority} ${e.ip} ${e.port} typ ${e.type}`,"rel-addr"in e&&(t+=` raddr ${e["rel-addr"]} rport ${e["rel-port"]}`),t+=` generation ${e.generation}`,o(t)},C=()=>{o(`a=ice-ufrag:${p}`),o(`a=ice-pwd:${m}`),v.forEach((e=>{o(`a=fingerprint:${e.hash} ${e.fingerprint}`),o("a=setup:passive")})),g.forEach(f)},h=e=>{var t;const{channels:a,id:n,name:i,clockrate:r,parameters:s}=e;var l=a?`/${a}`:"";o(`a=rtpmap:${n} ${i}/${r}${l}`),s&&(l=Object.keys(s).map((e=>`${e}=${s[e]};`)).join(" "),o(`a=fmtp:${n} ${l}`)),null===(t=e["rtcp-fbs"])||void 0===t||t.forEach((e=>{o(`a=rtcp-fb:${n} ${e.type}${e.subtype?` ${e.subtype}`:""}`)}))};return e=e=>{const a=e.isVideo?u:d;var i=e.isVideo?"video":"audio";o(`m=${i} ${e.isMain?1:0} RTP/SAVPF ${a.map((e=>e.id)).join(" ")}`),o("c=IN IP4 0.0.0.0"),o("b=AS:1300"),o(`a=mid:${e.endpoint}`),o("a=rtcp-mux"),a.forEach(h),o("a=rtcp:1 IN IP4 0.0.0.0"),e.isVideo&&o("a=rtcp-rsize"),(e.isVideo?c:l).forEach((e=>{let{id:t,uri:a}=e;o(`a=extmap:${t} ${a}`)})),e.isRemoved?o("a=inactive"):(C(),t?o("a=recvonly"):(e.isMain?o("a=sendrecv"):(o("a=sendonly"),o("a=bundle-only")),e.sourceGroups.forEach((t=>{o(`a=ssrc-group:${t.semantics} ${t.sources.map(n.fromTelegramSource).join(" ")}`),t.sources.forEach((t=>{t=(0,n.fromTelegramSource)(t),o(`a=ssrc:${t} cname:${e.endpoint}`),o(`a=ssrc:${t} msid:${e.endpoint} ${e.endpoint}`),o(`a=ssrc:${t} mslabel:${e.endpoint}`),o(`a=ssrc:${t} label:${e.endpoint}`)}))}))))},s.filter((e=>"0"===e.endpoint||"1"===e.endpoint)).map(e),a||(o("m=application 1 UDP/DTLS/SCTP webrtc-datachannel"),o("c=IN IP4 0.0.0.0"),C(),o("a=ice-options:trickle"),o("a=mid:"+(a?"1":"2")),o("a=sctp-port:5000"),o("a=max-message-size:262144")),s.filter((e=>"0"!==e.endpoint&&"1"!==e.endpoint)).map(e),`${i.join("\n")}\n`}},"./src/parseSdp.ts":(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a("./src/utils.ts");const i=e=>{var t,a;if(!e||!e.sdp)throw Error("Failed parsing SDP: session description is null");const i=e.sdp.split("\r\nm=").map(((e,t)=>0===t?e:`m=${e}`)).reduce(((e,t)=>{var a;return e[(null===(a=t.match(/^m=(.+?)\s/))||void 0===a?void 0:a[1])||"header"]=t.split("\r\n").filter(Boolean),e}),{});var o=(e,t)=>{var a,n;return t?null===(a=i[t])||void 0===a||null===(n=a.find((t=>t.startsWith(e))))||void 0===n?void 0:n.substr(e.length):Object.values(i).map((t=>{var a;return null===(a=t.find((t=>t.startsWith(e))))||void 0===a?void 0:a.substr(e.length)})).filter(Boolean)[0]};const r=o("a=ssrc:","audio");var s=r&&Number(r.split(" ")[0]);const l=(null===(t=o("a=ssrc-group:","video"))||void 0===t?void 0:t.split(" "))||void 0;if(!l)throw Error("Failed parsing SDP: no video ssrc");var[c,d]=(null===(a=o("a=fingerprint:"))||void 0===a?void 0:a.split(" "))||[];if(!c||!d)throw Error("Failed parsing SDP: no fingerprint");if(e=o("a=ice-ufrag:"),o=o("a=ice-pwd:"),!e||!o)throw Error("Failed parsing SDP: no ICE ufrag or pwd");return{fingerprints:[{fingerprint:d,hash:c,setup:"active"}],pwd:o,ufrag:e,...s&&{ssrc:(0,n.toTelegramSource)(s)},...l&&{"ssrc-groups":[{semantics:l[0],sources:l.slice(1,l.length).map(Number).map(n.toTelegramSource)}]}}}},"./src/secretsauce.ts":(e,t,a)=>{a.r(t),a.d(t,{getDevices:()=>async function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(await navigator.mediaDevices.enumerateDevices()).filter((a=>a.kind===`${e}${t?"input":"output"}`))},toggleSpeaker:()=>function(){var e,t;s&&(s.isSpeakerDisabled=!s.isSpeakerDisabled,null!==(e=s)&&void 0!==e&&null!==(t=e.onUpdate)&&void 0!==t&&t.call(e,{"@type":"updateGroupCallConnectionState",connectionState:"connected",isSpeakerDisabled:s.isSpeakerDisabled}),s.participantFunctions&&Object.values(s.participantFunctions).forEach((e=>{var t,a;null===(t=e.toggleMute)||void 0===t||t.call(e,!(null===(a=s)||void 0===a||!a.isSpeakerDisabled))})))},toggleNoiseSuppression:()=>function(){if(s&&s.myId&&s.streams){const a=s.streams[s.myId].audio;if(a){const n=a.getTracks()[0];var e,t;n&&(({echoCancellation:e,noiseSuppression:t}=n.getConstraints()),n.applyConstraints({echoCancellation:!e,noiseSuppression:!t}))}}},getUserStreams:()=>c,setVolume:()=>function(e,t){var a,n,i;const o=null===(a=s)||void 0===a||null===(n=a.participantFunctions)||void 0===n?void 0:n[e];o&&(null===(i=o.setVolume)||void 0===i||i.call(o,t))},isStreamEnabled:()=>d,switchCameraInput:()=>async function(){var e;if(null!==(e=s)&&void 0!==e&&e.myId&&s.connection&&s.streams&&s.facingMode){var t;const e=null===(t=c(s.myId))||void 0===t?void 0:t.video;if(e){const t=e.getTracks()[0];if(t){const e=s.connection.getSenders().find((e=>{var a;return t.id===(null===(a=e.track)||void 0===a?void 0:a.id)}));if(e){s.facingMode="environment"===s.facingMode?"user":"environment";try{const t=await p("video",s.facingMode);await e.replaceTrack(t.getTracks()[0]),s.streams[s.myId].video=t}catch(e){}}}}}},toggleStream:()=>m,leaveGroupCall:()=>g,handleUpdateGroupCallParticipants:()=>async function(e){if(s){const{participants:n,conference:o,connection:r,myId:l}=s;if(n&&o&&r&&o.ssrcs&&o.transport&&l)if(e.find((e=>{var t,a,n,i;return e.isSelf&&e.source!==(null===(t=s)||void 0===t||null===(a=t.conference)||void 0===a||null===(n=a.ssrcs)||void 0===n||null===(i=n.find((e=>e.isMain&&!e.isVideo)))||void 0===i?void 0:i.sourceGroups[0].sources[0])})))g();else{const n=[];if(e.forEach((e=>{if(e.isSelf)e.isMuted&&!e.canSelfUnmute&&(m("audio",!1),m("video",!1),m("presentation",!1));else{var t=e.isLeft;const a=e.isMuted||e.isMutedByMe,i=!e.isVideoJoined||!e.video||t,r=!e.presentation||t;let s=!1,l=!1,c=!1;o.ssrcs.filter((t=>t.userId===e.id)).forEach((t=>{t.isVideo||(t.sourceGroups[0].sources[0]===e.source&&(l=!0),t.isRemoved=a),t.isVideo&&(t.isPresentation||(e.video&&t.endpoint===e.video.endpoint&&(s=!0),t.isRemoved=i),t.isPresentation&&(e.presentation&&t.endpoint===e.presentation.endpoint&&(c=!0),t.isRemoved=r))})),a||l||o.ssrcs.push({userId:e.id,isMain:!1,endpoint:`audio${e.source}`,isVideo:!1,sourceGroups:[{semantics:"FID",sources:[e.source]}]}),i||s||!e.video||(n.push(e.video.endpoint),o.ssrcs.push({userId:e.id,isMain:!1,endpoint:e.video.endpoint,isVideo:!0,sourceGroups:e.video.sourceGroups})),r||c||!e.presentation||o.ssrcs.push({isPresentation:!0,userId:e.id,isMain:!1,endpoint:e.presentation.endpoint,isVideo:!0,sourceGroups:e.presentation.sourceGroups})}})),s.updatingParticipantsQueue)s.updatingParticipantsQueue.push(o);else{s.updatingParticipantsQueue=[],e=(0,i.default)(o),await r.setRemoteDescription({type:"offer",sdp:e});try{var t=await r.createAnswer();if(await r.setLocalDescription(t),u(l),0async function(e,t){if(s){var a=t?s.screenshareConference:s.conference;const d=t?s.screenshareConnection:s.connection;if(a&&d&&a.ssrcs){var n,o,r,l,c=Date.now();e={...a,transport:e.transport,sessionId:c,audioExtensions:null===(n=e.audio)||void 0===n?void 0:n["rtp-hdrexts"],audioPayloadTypes:null===(o=e.audio)||void 0===o?void 0:o["payload-types"],videoExtensions:null===(r=e.video)||void 0===r?void 0:r["rtp-hdrexts"],videoPayloadTypes:null===(l=e.video)||void 0===l?void 0:l["payload-types"]},s={...s,...t?{screenshareConference:e}:{conference:e}};try{await d.setRemoteDescription({type:"answer",sdp:(0,i.default)(e,!0,t)})}catch(e){console.error(e)}}}},startSharingScreen:()=>async function(){if(s)try{const e=await p("presentation");return e?(e.getTracks()[0].onended=()=>{var e;s&&s.myId&&(null!==(e=s.streams)&&void 0!==e&&e[s.myId].presentation,u(s.myId),l())},new Promise((t=>{var{connection:a,dataChannel:t}=h([e],t,!0);s={...s,screenshareConnection:a,screenshareDataChannel:t}}))):void 0}catch(e){return}},joinGroupCall:()=>function(e,t,a,n){if(s)throw Error("Already in call");v("connecting");var i=new MediaStream;return a.srcObject=i,a.play().catch((e=>console.warn(e))),s={onUpdate:n,participants:[],myId:e,speaking:{},silence:(0,o.silence)(t),black:(0,o.black)({width:640,height:480}),analyserInterval:setInterval(f,1e3),audioElement:a,audioContext:t,mediaStream:i},new Promise((e=>{s={...s,...h([s.silence,s.black],e)}}))}});var n=a("./src/parseSdp.ts"),i=a("./src/buildSdp.ts"),o=a("./src/blacksilence.ts"),r=a("./src/utils.ts");let s;function l(e){var t,a,n,i;s&&(null!==(t=s.screenshareDataChannel)&&void 0!==t&&t.close(),null!==(a=s.screenshareConnection)&&void 0!==a&&a.close(),e||null===(n=(i=s).onUpdate)||void 0===n||n.call(i,{"@type":"updateGroupCallLeavePresentation"}))}function c(e){var t,a;return null===(t=s)||void 0===t||null===(a=t.streams)||void 0===a?void 0:a[e]}function d(e,t){var a,n,i;const o=(t=t||(null===(a=s)||void 0===a?void 0:a.myId))&&(null===(n=c(t))||void 0===n?void 0:n[e]);return!!o&&(null===(i=o.getTracks()[0])||void 0===i?void 0:i.enabled)}function u(e){var t,a,n;null===(t=s)||void 0===t||null===(a=t.onUpdate)||void 0===a||a.call(t,{"@type":"updateGroupCallStreams",userId:e,hasAudioStream:d("audio",e),hasVideoStream:d("video",e),hasPresentationStream:d("presentation",e),amplitude:null===(n=s.speaking)||void 0===n?void 0:n[e]})}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"user";return"presentation"===e?navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}):navigator.mediaDevices.getUserMedia({audio:"audio"===e&&{...r.IS_ECHO_CANCELLATION_SUPPORTED&&{echoCancellation:!0},...r.IS_NOISE_SUPPRESSION_SUPPORTED&&{noiseSuppression:!0}},video:"video"===e&&{facingMode:t}})}async function m(e,t){if(s&&s.myId&&s.connection&&s.streams){var a;const o=null===(a=c(s.myId))||void 0===a?void 0:a[e];if(o){const a=o.getTracks()[0];if(a){var n;const o=[...s.connection.getSenders(),...(null===(n=s.screenshareConnection)||void 0===n?void 0:n.getSenders())||[]].find((e=>{var t;return a.id===(null===(t=e.track)||void 0===t?void 0:t.id)}));if(o){t=void 0===t?!a.enabled:t;try{if(t&&!a.enabled){const t=await p(e);if(await o.replaceTrack(t.getTracks()[0]),s.streams[s.myId][e]=t,"video"===e)s.facingMode="user";else if("audio"===e){var i;const e=s.audioContext;if(!e)return;const a=e.createMediaStreamSource(t),n=e.createAnalyser();n.minDecibels=-100,n.maxDecibels=-30,n.smoothingTimeConstant=.05,n.fftSize=1024,a.connect(n),s={...s,participantFunctions:{...s.participantFunctions,[s.myId]:{...null===(i=s.participantFunctions)||void 0===i?void 0:i[s.myId],getCurrentAmplitude:()=>{var e=new Uint8Array(n.frequencyBinCount);return n.getByteFrequencyData(e),(0,r.getAmplitude)(e,1.5)}}}}}}else if(!t&&a.enabled){a.stop();const t="audio"===e?s.silence:s.black;if(!t)return;await o.replaceTrack(t.getTracks()[0]),s.streams[s.myId][e]=t,"video"===e&&(s.facingMode=void 0)}u(s.myId),"presentation"!==e||t||l(!0)}catch(e){}}}}}}function v(e){var t,a;null===(t=s)||void 0===t||null===(a=t.onUpdate)||void 0===a||a.call(t,{"@type":"updateGroupCallConnectionState",connectionState:e})}function g(){var e,t,a;s&&(s.myId&&null!==(e=s.streams)&&void 0!==e&&e[s.myId]&&Object.values(s.streams[s.myId]||{}).forEach((e=>{null==e||e.getTracks().forEach((e=>{e.stop()}))})),l(!0),null!==(t=s.dataChannel)&&void 0!==t&&t.close(),null!==(a=s.connection)&&void 0!==a&&a.close(),v("disconnected"),s.analyserInterval&&clearInterval(s.analyserInterval),s=void 0)}function f(){s&&s.participantFunctions&&Object.keys(s.participantFunctions).forEach((e=>{const t=s.participantFunctions[Number(e)].getCurrentAmplitude;var a,n;t&&(a=t(),n=s.speaking[e]||0,((s.speaking[e]=a)>r.THRESHOLD&&n<=r.THRESHOLD||a<=r.THRESHOLD&&n>r.THRESHOLD)&&u(e))}))}function C(e){if(s&&s.audioElement&&s.audioContext&&s.mediaStream){var t,a,n=null===(t=s.conference)||void 0===t||null===(a=t.ssrcs)||void 0===a?void 0:a.find((t=>t.endpoint===e.track.id));if(n&&n.userId){var i,o;const{userId:t,isPresentation:a}=n;var l=null===(i=s.participants)||void 0===i?void 0:i.find((e=>e.id===t));const d="video"===e.track.kind?a?"presentation":"video":"audio";if(e.track.onended=()=>{var e,a;null!==(e=s)&&void 0!==e&&null!==(a=e.streams)&&void 0!==a&&a[t][d],u(t)},n=e.streams[0],"audio"===e.track.kind){var c;const e=s.mediaStream,a=new window.AudioContext,i=a.createMediaStreamSource(n),o=a.createGain();o.gain.value=((null==l?void 0:l.volume)||1e4)/1e4;const d=a.createGain();o.gain.value=1;const u=a.createAnalyser();u.minDecibels=-100,u.maxDecibels=-30,u.smoothingTimeConstant=.05,u.fftSize=1024,i.connect(u).connect(d).connect(o).connect(a.destination),e.addTrack(i.mediaStream.getAudioTracks()[0]);const p=new Audio;p.srcObject=n,p.muted=!0,p.remove(),s={...s,participantFunctions:{...s.participantFunctions,[t]:{...null===(c=s.participantFunctions)||void 0===c?void 0:c[t],setVolume:e=>{o.gain.value=1{d.gain.value=e?0:1},getCurrentAmplitude:()=>{var e=new Uint8Array(u.frequencyBinCount);return u.getByteFrequencyData(e),(0,r.getAmplitude)(e,1.5)}}}}}s={...s,streams:{...s.streams,[t]:{...null===(o=s.streams)||void 0===o?void 0:o[t],[d]:n}}},u(t)}}}function h(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=new RTCPeerConnection;var o=a?void 0:function(e){const t=e.createDataChannel("data",{id:0});return t.onopen=()=>{},t.onmessage=e=>{JSON.parse(e.data).colibriClass},t.onerror=e=>{console.log("%conerror","background: green; font-size: 5em"),console.error(e)},t}(i);return e.forEach((e=>e.getTracks().forEach((t=>{i.addTrack(t,e)})))),a||(i.oniceconnectionstatechange=()=>{var e=i.iceConnectionState;"connected"===e||"completed"===e?v("connected"):"checking"===e||"new"===e?v("connecting"):"disconnected"===i.iceConnectionState&&v("reconnecting")}),i.ontrack=C,i.onnegotiationneeded=async()=>{if(s){var o=s.myId;if(o){var r=await i.createOffer({offerToReceiveVideo:!0,offerToReceiveAudio:!a});if(await i.setLocalDescription(r),r.sdp){var l,c=(0,n.default)(r),d=a?void 0:{userId:"",sourceGroups:[{semantics:"FID",sources:[c.ssrc||0]}],isRemoved:a,isMain:!0,isVideo:!1,isPresentation:a,endpoint:a?"1":"0"},p=c["ssrc-groups"]&&{isPresentation:a,userId:"",sourceGroups:c["ssrc-groups"],isMain:!0,isVideo:!0,endpoint:a?"0":"1"};r=a?s.screenshareConference:s.conference;const i=[];a?(p&&i.push(p),d&&i.push(d)):(d&&i.push(d),p&&i.push(p)),d=e.find((e=>"audio"===e.getTracks()[0].kind)),p=e.find((e=>"video"===e.getTracks()[0].kind)),s={...s,...a?{screenshareConference:{...r,ssrcs:i}}:{conference:{...r,ssrcs:i}},streams:{...s.streams,[o]:{...null===(l=s.streams)||void 0===l?void 0:l[o],...d&&{audio:d},...!a&&p?{video:p}:{presentation:p}}}},u(o),t(c)}}}},{connection:i,dataChannel:o}}},"./src/types.ts":(e,t,a)=>{a.r(t)},"./src/utils.ts":(e,t,a)=>{var n,i,o,r,s;function l(){var{userAgent:e,platform:t}=window.navigator;let a;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?a="macOS":-1!==["iPhone","iPad","iPod"].indexOf(t)?a="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?a="Windows":/Android/.test(e)?a="Android":/Linux/.test(t)&&(a="Linux"),a}a.r(t),a.d(t,{toTelegramSource:()=>function(e){return e<<0},fromTelegramSource:()=>function(e){return e>>>0},getAmplitude:()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!e)return 0;var a=e.length;let n=0;for(let t=0;tl,THRESHOLD:()=>c,PLATFORM_ENV:()=>d,IS_MAC_OS:()=>u,IS_IOS:()=>p,IS_SCREENSHARE_SUPPORTED:()=>m,IS_ECHO_CANCELLATION_SUPPORTED:()=>v,IS_NOISE_SUPPRESSION_SUPPORTED:()=>g});const c=.1,d=l(),u="macOS"===d,p="iOS"===d,m="getDisplayMedia"in((null===(n=navigator)||void 0===n?void 0:n.mediaDevices)||{}),v=null===(i=navigator)||void 0===i||null===(o=i.mediaDevices)||void 0===o?void 0:o.getSupportedConstraints().echoCancellation,g=null===(r=navigator)||void 0===r||null===(s=r.mediaDevices)||void 0===s?void 0:s.getSupportedConstraints().noiseSuppression}},a={};function n(t){var i=a[t];return void 0!==i||(i=a[t]={exports:{}},e[t](i,i.exports,n)),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{n.r(i),n.d(i,{handleUpdateGroupCallConnection:()=>e.handleUpdateGroupCallConnection,startSharingScreen:()=>e.startSharingScreen,joinGroupCall:()=>e.joinGroupCall,getDevices:()=>e.getDevices,getUserStreams:()=>e.getUserStreams,setVolume:()=>e.setVolume,isStreamEnabled:()=>e.isStreamEnabled,toggleStream:()=>e.toggleStream,leaveGroupCall:()=>e.leaveGroupCall,handleUpdateGroupCallParticipants:()=>e.handleUpdateGroupCallParticipants,switchCameraInput:()=>e.switchCameraInput,toggleSpeaker:()=>e.toggleSpeaker,toggleNoiseSuppression:()=>e.toggleNoiseSuppression,IS_SCREENSHARE_SUPPORTED:()=>t.IS_SCREENSHARE_SUPPORTED,THRESHOLD:()=>t.THRESHOLD});var e=n("./src/secretsauce.ts"),t=n("./src/utils.ts");n("./src/types.ts")})();var o,r=t;for(o in i)r[o]=i[o];i.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})()},1171:(e,t,a)=>{"use strict";e.exports=a.p+"call-fallback-avatar.50c421eaa09a90e44ec4..png"}}]); -//# sourceMappingURL=47.b422d6da038c24068089.js.map \ No newline at end of file +//# sourceMappingURL=47.9ea2a6fe11cbf65b8511.js.map \ No newline at end of file diff --git a/dist/47.b422d6da038c24068089.js.LICENSE.txt b/dist/47.9ea2a6fe11cbf65b8511.js.LICENSE.txt similarity index 100% rename from dist/47.b422d6da038c24068089.js.LICENSE.txt rename to dist/47.9ea2a6fe11cbf65b8511.js.LICENSE.txt diff --git a/dist/47.b422d6da038c24068089.js.map b/dist/47.9ea2a6fe11cbf65b8511.js.map similarity index 99% rename from dist/47.b422d6da038c24068089.js.map rename to dist/47.9ea2a6fe11cbf65b8511.js.map index 1ffc041d..33d73500 100644 --- a/dist/47.b422d6da038c24068089.js.map +++ b/dist/47.9ea2a6fe11cbf65b8511.js.map @@ -1 +1 @@ -{"version":3,"file":"47.b422d6da038c24068089.js","mappings":";uUAqCAA,EAAAA,EAAAA,IAAW,aAAa,CAACC,EAAQC,EAASC,KACxC,MAAM,kBAAEC,GAAsBH,EAAOI,WAErC,OAAQF,EAAO,UACb,IAAK,mCACHD,EAAQI,4BAA4B,CAAEC,OAAO,IAC7C,MAEF,IAAK,yBACH,IAAKJ,EAAOK,SAAWJ,EAAmB,MAC1C,KAAKK,EAAAA,EAAAA,IAA2BR,EAAQG,EAAmBD,EAAOK,QAAS,MAE3E,OAAOE,EAAAA,EAAAA,IAA2BT,EAAQG,EAAmBD,EAAOK,QAAQG,EAAAA,EAAAA,IAAKR,EAAQ,CAAC,QAAS,YAErG,IAAK,iCACH,IAAKC,EAAmB,MAExB,GAA+B,iBAA3BD,EAAOS,gBAAoC,CAC7CV,EAAQW,eAAe,CAAEC,eAAe,IACxC,MAGF,OAAOC,EAAAA,EAAAA,IAAgBd,EAAQG,EAAmB,CAChDQ,gBAAiBT,EAAOS,gBACxBI,kBAAmBb,EAAOa,oBAG9B,IAAK,8BAA+B,CAClC,MAAM,YAAEC,EAAF,aAAeC,GAAiB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EAAQ,IAAI1K,KAAKF,EAAExM,EAAE0M,GAAGF,EAAEE,GAAGF,EAAEoL,YAAY1f,OAAOmf,eAAerX,EAAE,aAAa,CAACnJ,OAAM,KAA1nf","sources":["webpack://telegram-t/./src/modules/actions/api/calls.async.ts","webpack://telegram-t/./src/util/vibrate.ts","webpack://telegram-t/./src/components/common/AnimatedIcon.tsx","webpack://telegram-t/./src/components/calls/group/MicrophoneButton.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantMenu.tsx","webpack://telegram-t/./src/hooks/useThrottle.ts","webpack://telegram-t/./src/components/calls/group/OutlinedMicrophoneIcon.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipant.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantList.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantVideo.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantStreams.tsx","webpack://telegram-t/./src/components/calls/group/GroupCall.tsx","webpack://telegram-t/./src/components/calls/ActiveCallHeader.tsx","webpack://telegram-t/./src/components/calls/CallFallbackConfirm.tsx","webpack://telegram-t/./src/lib/secret-sauce/index.js"],"sourcesContent":["import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport {\n joinGroupCall,\n startSharingScreen,\n leaveGroupCall,\n toggleStream,\n isStreamEnabled,\n setVolume,\n handleUpdateGroupCallParticipants, handleUpdateGroupCallConnection,\n} from '../../../lib/secret-sauce';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport {\n selectActiveGroupCall,\n selectCallFallbackChannelTitle,\n selectGroupCallParticipant,\n} from '../../selectors/calls';\nimport {\n removeGroupCall,\n updateActiveGroupCall,\n updateGroupCall,\n updateGroupCallParticipant,\n} from '../../reducers/calls';\nimport { omit } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\nimport { fetchFile } from '../../../util/files';\nimport { getGroupCallAudioContext, getGroupCallAudioElement, removeGroupCallAudioElement } from '../ui/calls';\nimport { loadFullChat } from './chats';\n\nimport callFallbackAvatarPath from '../../../assets/call-fallback-avatar.png';\n\nconst FALLBACK_INVITE_EXPIRE_SECONDS = 1800; // 30 min\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n const { activeGroupCallId } = global.groupCalls;\n\n switch (update['@type']) {\n case 'updateGroupCallLeavePresentation': {\n actions.toggleGroupCallPresentation({ value: false });\n break;\n }\n case 'updateGroupCallStreams': {\n if (!update.userId || !activeGroupCallId) break;\n if (!selectGroupCallParticipant(global, activeGroupCallId, update.userId)) break;\n\n return updateGroupCallParticipant(global, activeGroupCallId, update.userId, omit(update, ['@type', 'userId']));\n }\n case 'updateGroupCallConnectionState': {\n if (!activeGroupCallId) break;\n\n if (update.connectionState === 'disconnected') {\n actions.leaveGroupCall({ isFromLibrary: true });\n break;\n }\n\n return updateGroupCall(global, activeGroupCallId, {\n connectionState: update.connectionState,\n isSpeakerDisabled: update.isSpeakerDisabled,\n });\n }\n case 'updateGroupCallParticipants': {\n const { groupCallId, participants } = update;\n if (activeGroupCallId === groupCallId) {\n void handleUpdateGroupCallParticipants(participants);\n }\n break;\n }\n case 'updateGroupCallConnection': {\n if (update.data.stream) {\n actions.showNotification({ message: 'Big live streams are not yet supported' });\n actions.leaveGroupCall();\n break;\n }\n void handleUpdateGroupCallConnection(update.data, update.presentation);\n\n const groupCall = selectActiveGroupCall(global);\n if (groupCall?.participants && Object.keys(groupCall.participants).length > 0) {\n void handleUpdateGroupCallParticipants(Object.values(groupCall.participants));\n }\n break;\n }\n }\n\n return undefined;\n});\n\naddReducer('leaveGroupCall', (global, actions, payload) => {\n const {\n isFromLibrary, shouldDiscard, shouldRemove, rejoin,\n } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n setGlobal(updateActiveGroupCall(global, { connectionState: 'disconnected' }, groupCall.participantsCount - 1));\n\n (async () => {\n await callApi('leaveGroupCall', {\n call: groupCall,\n });\n\n let shouldResetFallbackState = false;\n if (shouldDiscard) {\n global = getGlobal();\n\n if (global.groupCalls.fallbackChatId === groupCall.chatId) {\n shouldResetFallbackState = true;\n\n global.groupCalls.fallbackUserIdsToRemove?.forEach((userId) => {\n actions.deleteChatMember({ chatId: global.groupCalls.fallbackChatId, userId });\n });\n }\n\n await callApi('discardGroupCall', {\n call: groupCall,\n });\n }\n\n global = getGlobal();\n if (shouldRemove) {\n global = removeGroupCall(global, groupCall.id);\n }\n\n removeGroupCallAudioElement();\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: true,\n activeGroupCallId: undefined,\n ...(shouldResetFallbackState && {\n fallbackChatId: undefined,\n fallbackUserIdsToRemove: undefined,\n }),\n },\n });\n\n if (!isFromLibrary) {\n leaveGroupCall();\n }\n\n if (rejoin) {\n actions.joinGroupCall(rejoin);\n }\n })();\n});\n\naddReducer('toggleGroupCallVideo', (global) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n await toggleStream('video');\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n videoStopped: !isStreamEnabled('video'),\n participant: user,\n });\n })();\n});\n\naddReducer('requestToSpeak', (global, actions, payload) => {\n const { value } = payload || { value: true };\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n raiseHand: value,\n participant: user,\n });\n});\n\naddReducer('setGroupCallParticipantVolume', (global, actions, payload) => {\n const { participantId, volume } = payload!;\n\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId);\n if (!user || !groupCall) {\n return;\n }\n\n setVolume(participantId, Math.floor(volume / GROUP_CALL_VOLUME_MULTIPLIER) / 100);\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n volume: Number(volume),\n participant: user,\n });\n});\n\naddReducer('toggleGroupCallMute', (global, actions, payload) => {\n const { participantId, value } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId || global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n const muted = value === undefined ? isStreamEnabled('audio', user.id) : value;\n\n if (!participantId) {\n await toggleStream('audio');\n } else {\n setVolume(participantId, muted ? 0 : 1);\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n muted,\n participant: user,\n });\n })();\n});\n\naddReducer('toggleGroupCallPresentation', (global, actions, payload) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n const value = payload?.value !== undefined ? payload?.value : !isStreamEnabled('presentation');\n if (value) {\n const params = await startSharingScreen();\n if (!params) {\n return;\n }\n\n await callApi('joinGroupCallPresentation', {\n call: groupCall,\n params,\n });\n } else {\n await toggleStream('presentation', false);\n await callApi('leaveGroupCallPresentation', {\n call: groupCall,\n });\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n presentationPaused: !isStreamEnabled('presentation'),\n participant: user,\n });\n })();\n});\n\naddReducer('connectToActiveGroupCall', (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) return;\n\n if (groupCall.connectionState === 'discarded') {\n actions.showNotification({ message: 'This voice chat is not active' });\n return;\n }\n\n const audioElement = getGroupCallAudioElement();\n const audioContext = getGroupCallAudioContext();\n\n if (!audioElement || !audioContext) {\n return;\n }\n\n const {\n currentUserId,\n } = global;\n\n if (!currentUserId) return;\n\n (async () => {\n const params = await joinGroupCall(currentUserId, audioContext, audioElement, actions.apiUpdate);\n\n const result = await callApi('joinGroupCall', {\n call: groupCall,\n params,\n inviteHash: groupCall.inviteHash,\n });\n\n if (!result) return;\n\n actions.loadMoreGroupCallParticipants();\n\n if (groupCall.chatId) {\n const chat = selectChat(getGlobal(), groupCall.chatId);\n if (!chat) return;\n await loadFullChat(chat);\n }\n })();\n});\n\naddReducer('inviteToCallFallback', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const user = selectUser(global, chatId);\n if (!user) {\n return;\n }\n\n const { shouldRemove } = payload;\n\n (async () => {\n const fallbackChannelTitle = selectCallFallbackChannelTitle(global);\n\n let fallbackChannel = Object.values(global.chats.byId).find((channel) => {\n return (\n channel.title === fallbackChannelTitle\n && channel.isCreator\n && !channel.isRestricted\n );\n });\n if (!fallbackChannel) {\n fallbackChannel = await callApi('createChannel', {\n title: fallbackChannelTitle,\n users: [user],\n });\n\n if (!fallbackChannel) {\n return;\n }\n\n const photo = await fetchFile(callFallbackAvatarPath, 'avatar.png');\n void callApi('editChatPhoto', {\n chatId: fallbackChannel.id,\n accessHash: fallbackChannel.accessHash,\n photo,\n });\n } else {\n actions.updateChatMemberBannedRights({\n chatId: fallbackChannel.id,\n userId: chatId,\n bannedRights: {},\n });\n\n void callApi('addChatMembers', fallbackChannel, [user], true);\n }\n\n const inviteLink = await callApi('updatePrivateLink', {\n chat: fallbackChannel,\n usageLimit: 1,\n expireDate: getServerTime(global.serverTimeOffset) + FALLBACK_INVITE_EXPIRE_SECONDS,\n });\n if (!inviteLink) {\n return;\n }\n\n if (shouldRemove) {\n global = getGlobal();\n const fallbackUserIdsToRemove = global.groupCalls.fallbackUserIdsToRemove || [];\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n fallbackChatId: fallbackChannel.id,\n fallbackUserIdsToRemove: [...fallbackUserIdsToRemove, chatId],\n },\n });\n }\n\n actions.sendMessage({ text: `Join a call: ${inviteLink}` });\n actions.openChat({ id: fallbackChannel.id });\n actions.createGroupCall({ chatId: fallbackChannel.id });\n actions.closeCallFallbackConfirm();\n })();\n});\n","export const vibrateShort = () => {\n navigator.vibrate?.(50);\n};\n","import React, {\n FC, memo, useEffect, useState,\n} from '../../lib/teact/teact';\n\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\ntype OwnProps = {\n name: keyof typeof ANIMATED_STICKERS_PATHS;\n size: number;\n playSegment?: [number, number];\n color?: [number, number, number];\n};\n\nconst AnimatedIcon: FC = ({\n size,\n name,\n playSegment,\n color,\n}) => {\n const [iconData, setIconData] = useState();\n\n useEffect(() => {\n getAnimationData(name).then(setIconData);\n }, [name]);\n\n return (\n \n );\n};\n\nexport default memo(AnimatedIcon);\n","import { GroupCallConnectionState } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { vibrateShort } from '../../../util/vibrate';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../../modules/selectors/calls';\nimport useLang from '../../../hooks/useLang';\n\nimport AnimatedIcon from '../../common/AnimatedIcon';\n\nimport './MicrophoneButton.scss';\n\nconst CONNECTION_STATE_DEFAULT = 'discarded';\n\ntype StateProps = {\n connectionState?: GroupCallConnectionState;\n hasRequestedToSpeak: boolean;\n isMuted?: boolean;\n canSelfUnmute?: boolean;\n noAudioStream: boolean;\n};\n\nconst REQUEST_TO_SPEAK_THROTTLE = 3000;\nconst HOLD_TO_SPEAK_TIME = 200;\nconst ICON_SIZE = 48;\n\nconst MicrophoneButton: FC = ({\n noAudioStream,\n canSelfUnmute,\n isMuted,\n hasRequestedToSpeak,\n connectionState,\n}) => {\n const {\n toggleGroupCallMute,\n requestToSpeak,\n playGroupCallSound,\n } = getDispatch();\n\n const lang = useLang();\n const muteMouseDownState = useRef('up');\n\n const [isRequestingToSpeak, setIsRequestingToSpeak] = useState(false);\n const isConnecting = connectionState !== 'connected';\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevShouldRaiseHand = usePrevious(shouldRaiseHand);\n\n useEffect(() => {\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n playGroupCallSound('allowTalk');\n }\n }, [playGroupCallSound, prevShouldRaiseHand, shouldRaiseHand]);\n\n // Voice mini\n // unmuted -> muted [69, 99]\n // muted -> unmuted [36, 69]\n // raise -> muted [0, 36]\n // muted -> raise [99, 136]\n // unmuted -> raise [136, 172]\n // TODO should probably move to other component\n const playSegment: [number, number] = useMemo(() => {\n if (isRequestingToSpeak) {\n const r = Math.floor(Math.random() * 100);\n return (r < 32 ? [0, 120]\n : (r < 64 ? [120, 240]\n : (r < 97 ? [240, 420]\n : [420, 540]\n )\n )\n );\n }\n if (!prevShouldRaiseHand && shouldRaiseHand) {\n return noAudioStream ? [99, 135] : [136, 172];\n }\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n return [0, 36];\n }\n if (!shouldRaiseHand) {\n return noAudioStream ? [69, 99] : [36, 69];\n }\n return [0, 0];\n }, [prevShouldRaiseHand, isRequestingToSpeak, noAudioStream, shouldRaiseHand]);\n\n const animatedIconName = isRequestingToSpeak ? 'HandFilled' : 'VoiceMini';\n\n const toggleMute = () => {\n vibrateShort();\n toggleGroupCallMute();\n };\n\n const handleMouseDownMute = () => {\n if (shouldRaiseHand) {\n if (isRequestingToSpeak) return;\n vibrateShort();\n requestToSpeak();\n setIsRequestingToSpeak(true);\n setTimeout(() => {\n setIsRequestingToSpeak(false);\n }, REQUEST_TO_SPEAK_THROTTLE);\n return;\n }\n muteMouseDownState.current = 'down';\n if (noAudioStream) {\n setTimeout(() => {\n if (muteMouseDownState.current === 'down') {\n muteMouseDownState.current = 'hold';\n toggleMute();\n }\n }, HOLD_TO_SPEAK_TIME);\n }\n };\n\n const handleMouseUpMute = () => {\n if (shouldRaiseHand) {\n return;\n }\n toggleMute();\n muteMouseDownState.current = 'up';\n };\n\n const buttonText = useMemo(() => {\n return lang(\n hasRequestedToSpeak ? 'VoipMutedTapedForSpeak' : (\n shouldRaiseHand ? 'VoipMutedByAdmin' : (\n noAudioStream ? 'VoipUnmute' : 'VoipTapToMute'\n )\n ),\n );\n }, [hasRequestedToSpeak, noAudioStream, lang, shouldRaiseHand]);\n\n return (\n
\n \n \n \n
\n {buttonText}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const groupCall = selectActiveGroupCall(global);\n\n const { connectionState } = groupCall || {};\n const meParticipant = groupCall && selectGroupCallParticipant(global, groupCall.id, global.currentUserId!);\n\n const {\n raiseHandRating, hasAudioStream, canSelfUnmute, isMuted,\n } = meParticipant || {};\n\n return {\n connectionState: connectionState || CONNECTION_STATE_DEFAULT,\n hasRequestedToSpeak: Boolean(raiseHandRating),\n noAudioStream: !hasAudioStream,\n canSelfUnmute,\n isMuted,\n };\n },\n)(MicrophoneButton));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottle from '../../../hooks/useThrottle';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport { selectIsAdminInActiveGroupCall } from '../../../modules/selectors/calls';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport DeleteMemberModal from '../../right/DeleteMemberModal';\n\nimport './GroupCallParticipantMenu.scss';\n\nconst SPEAKER_ICON_DISABLED_SEGMENT: [number, number] = [0, 17];\nconst SPEAKER_ICON_ENABLED_SEGMENT: [number, number] = [17, 34];\n\ntype OwnProps = {\n participant?: GroupCallParticipant;\n closeDropdown: VoidFunction;\n isDropdownOpen: boolean;\n anchor?: IAnchorPosition;\n};\n\ntype StateProps = {\n isAdmin: boolean;\n};\n\nconst VOLUME_ZERO = 0;\nconst VOLUME_LOW = 50;\nconst VOLUME_MEDIUM = 100;\nconst VOLUME_NORMAL = 150;\n\nconst VOLUME_CHANGE_THROTTLE = 500;\n\nconst SPEAKER_ICON_SIZE = 24;\n\nconst GroupCallParticipantMenu: FC = ({\n participant,\n closeDropdown,\n isDropdownOpen,\n anchor,\n isAdmin,\n}) => {\n const {\n toggleGroupCallMute,\n setGroupCallParticipantVolume,\n toggleGroupCallPanel,\n openChat,\n requestToSpeak,\n } = getDispatch();\n\n const lang = useLang();\n const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag();\n\n const id = participant?.id;\n const {\n isMutedByMe, isMuted, isSelf, canSelfUnmute,\n } = participant || {};\n const isRaiseHand = Boolean(participant?.raiseHandRating);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n\n const [localVolume, setLocalVolume] = useState(\n isMutedByMe ? VOLUME_ZERO : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER),\n );\n\n useEffect(() => {\n setLocalVolume(isMutedByMe\n ? VOLUME_ZERO\n : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER));\n // We only want to initialize local volume when switching participants and ignore following updates from server\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [id]);\n\n const runThrottled = useThrottle(VOLUME_CHANGE_THROTTLE);\n\n const handleRemove = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n openDeleteUserModal();\n closeDropdown();\n }, [openDeleteUserModal, closeDropdown]);\n\n const handleCancelRequestToSpeak = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n requestToSpeak({\n value: false,\n });\n closeDropdown();\n }, [requestToSpeak, closeDropdown]);\n\n const handleMute = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n closeDropdown();\n\n if (!isAdmin) {\n setLocalVolume(isMutedByMe ? GROUP_CALL_DEFAULT_VOLUME / GROUP_CALL_VOLUME_MULTIPLIER : VOLUME_ZERO);\n }\n\n toggleGroupCallMute({\n participantId: id,\n value: isAdmin ? !shouldRaiseHand : !isMutedByMe,\n });\n }, [closeDropdown, toggleGroupCallMute, id, isAdmin, shouldRaiseHand, isMutedByMe]);\n\n const handleOpenProfile = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n toggleGroupCallPanel();\n openChat({\n id,\n });\n closeDropdown();\n }, [toggleGroupCallPanel, closeDropdown, openChat, id]);\n\n const isLocalVolumeZero = localVolume === VOLUME_ZERO;\n const speakerIconPlaySegment = isLocalVolumeZero ? SPEAKER_ICON_DISABLED_SEGMENT : SPEAKER_ICON_ENABLED_SEGMENT;\n\n const handleChangeVolume = (e: React.ChangeEvent) => {\n const value = Number(e.target.value);\n setLocalVolume(value);\n runThrottled(() => {\n if (value === VOLUME_ZERO) {\n toggleGroupCallMute({\n participantId: id,\n value: true,\n });\n } else {\n setGroupCallParticipantVolume({\n participantId: id,\n volume: Math.floor(value * GROUP_CALL_VOLUME_MULTIPLIER),\n });\n }\n });\n };\n\n return (\n
\n \n {!isSelf && !shouldRaiseHand && (\n
\n
= VOLUME_LOW && localVolume < VOLUME_MEDIUM && 'medium',\n localVolume >= VOLUME_MEDIUM && localVolume < VOLUME_NORMAL && 'normal',\n localVolume >= VOLUME_NORMAL && 'high',\n )}\n >\n \n
\n \n {localVolume}%\n
\n
\n
\n )}\n
\n {(isRaiseHand && isSelf) && (\n \n {lang('VoipGroupCancelRaiseHand')}\n \n )}\n {!isSelf && {lang('VoipGroupOpenProfile')}}\n {!isSelf && (\n // TODO cross mic\n \n {isAdmin\n ? lang(shouldRaiseHand ? 'VoipGroupAllowToSpeak' : 'VoipMute')\n : lang(isMutedByMe ? 'VoipGroupUnmuteForMe' : 'VoipGroupMuteForMe')}\n \n )}\n {!isSelf && isAdmin && (\n // TODO replace with hand\n \n {lang('VoipGroupUserRemove')}\n \n )}\n
\n \n\n {!isSelf && isAdmin && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n isAdmin: selectIsAdminInActiveGroupCall(global),\n };\n },\n)(GroupCallParticipantMenu));\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nconst useThrottle = (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n\nexport default useThrottle;\n","import { GroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport usePrevious from '../../../hooks/usePrevious';\n\ntype OwnProps = {\n participant: GroupCallParticipant;\n noColor?: boolean;\n};\n\nconst OutlinedMicrophoneIcon: FC = ({\n participant,\n noColor,\n}) => {\n const { isMuted, isMutedByMe } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n const prevIsRaiseHand = usePrevious(isRaiseHand);\n const canSelfUnmute = Boolean(participant?.canSelfUnmute);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevIsMuted = usePrevious(isMuted);\n\n const playSegment: [number, number] = useMemo(() => {\n if (isMuted && !prevIsMuted) {\n return [43, 64];\n }\n\n if (!isMuted && prevIsMuted) {\n return [22, 42];\n }\n\n if (isRaiseHand && !prevIsRaiseHand) {\n return [65, 84];\n }\n\n if (!shouldRaiseHand && prevIsRaiseHand) {\n return [0, 21];\n }\n\n // TODO cancel request to speak should play in reverse\n // if (!isRaiseHand && prevIsRaiseHand) {\n // return [84, 65];\n // }\n\n return isMuted ? [22, 23] : [43, 44];\n // eslint-disable-next-line\n }, [isMuted, shouldRaiseHand, isRaiseHand]);\n\n const microphoneColor: [number, number, number] | undefined = useMemo(() => {\n return noColor ? [0xff, 0xff, 0xff] : (\n isRaiseHand ? [0x4d, 0xa6, 0xe0]\n : (shouldRaiseHand || isMutedByMe ? [0xFF, 0x70, 0x6F] : (\n isSpeaking ? [0x57, 0xBC, 0x6C] : [0x84, 0x8D, 0x94]\n ))\n );\n }, [noColor, isRaiseHand, shouldRaiseHand, isMutedByMe, isSpeaking]);\n\n return (\n \n );\n};\n\nexport default memo(OutlinedMicrophoneIcon);\n","import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\nimport OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';\n\nimport './GroupCallParticipant.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n};\n\nconst GroupCallParticipant: FC = ({\n openParticipantMenu,\n participant,\n user,\n chat,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const anchorRef = useRef(null);\n const lang = useLang();\n\n const { isSelf, isMutedByMe, isMuted } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n\n const handleOnClick = () => {\n if (isSelf) return;\n openParticipantMenu(anchorRef.current!, participant);\n };\n\n const [aboutText, aboutColor] = useMemo(() => {\n if (isSelf) {\n return [lang('ThisIsYou'), 'blue'];\n }\n if (isMutedByMe) {\n return [lang('VoipGroupMutedForMe'), 'red'];\n }\n return isRaiseHand\n ? [lang('WantsToSpeak'), 'blue']\n : (!isMuted && isSpeaking ? [\n participant.volume && participant.volume !== GROUP_CALL_DEFAULT_VOLUME\n ? lang('SpeakingWithVolume',\n (participant.volume / GROUP_CALL_VOLUME_MULTIPLIER).toString())\n .replace('%%', '%') : lang('Speaking'),\n 'green',\n ]\n : (participant.about ? [participant.about, ''] : [lang('Listening'), 'blue']));\n }, [isSpeaking, participant.volume, lang, isSelf, isMutedByMe, isRaiseHand, isMuted, participant.about]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n const name = user ? `${user.firstName || ''} ${user.lastName || ''}` : chat?.title;\n\n return (\n \n \n
\n {name}\n {aboutText}\n
\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { participant }): StateProps => {\n return {\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n };\n },\n)(GroupCallParticipant));\n","import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectActiveGroupCall } from '../../../modules/selectors/calls';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nimport GroupCallParticipant from './GroupCallParticipant';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\ntype OwnProps = {\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n participantsCount: number;\n participants?: Record;\n canInvite?: boolean;\n};\n\nconst GroupCallParticipantList: FC = ({\n participants,\n participantsCount,\n openParticipantMenu,\n}) => {\n const {\n createGroupCallInviteLink,\n loadMoreGroupCallParticipants,\n } = getDispatch();\n\n const lang = useLang();\n\n const participantsIds = useMemo(() => {\n return Object.keys(participants || {});\n }, [participants]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n loadMoreGroupCallParticipants,\n participantsIds,\n participantsIds.length >= participantsCount,\n );\n\n return (\n
\n
\n
\n \n
\n
{lang('VoipGroupInviteMember')}
\n
\n\n \n {viewportIds?.map(\n (participantId) => (\n participants![participantId] && (\n \n )\n ),\n )}\n \n\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { participantsCount, participants } = selectActiveGroupCall(global) || {};\n\n return {\n participants,\n participantsCount: participantsCount || 0,\n };\n },\n)(GroupCallParticipantList));\n","import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { ENABLE_THUMBNAIL_VIDEO } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\n\nimport './GroupCallParticipantVideo.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n type: 'video' | 'presentation';\n onClick?: (id: string, type: 'video' | 'presentation') => void;\n isFullscreen?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n currentUserId?: string;\n isActive?: boolean;\n};\n\nconst GroupCallParticipantVideo: FC = ({\n type,\n onClick,\n user,\n chat,\n isActive,\n isFullscreen,\n}) => {\n const lang = useLang();\n\n const handleClick = useCallback(() => {\n if (onClick) {\n onClick(user?.id || chat!.id, type);\n }\n }, [chat, onClick, type, user?.id]);\n\n if (!user && !chat) return undefined;\n\n const streams = getUserStreams(user?.id || chat!.id);\n\n return (\n \n {isFullscreen && (\n \n )}\n \n {ENABLE_THUMBNAIL_VIDEO && (\n
\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { participant }): StateProps => {\n return {\n currentUserId: global.currentUserId,\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n isActive: (participant.amplitude || 0) > THRESHOLD,\n };\n },\n)(GroupCallParticipantVideo));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\nimport GroupCallParticipantVideo from './GroupCallParticipantVideo';\nimport { selectActiveGroupCall } from '../../../modules/selectors/calls';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n onDoubleClick?: VoidFunction;\n};\n\ntype StateProps = {\n participants?: Record;\n};\n\ntype SelectedVideo = {\n type: 'video' | 'presentation';\n id: string;\n};\n\nconst GroupCallParticipantStreams: FC = ({\n participants,\n onDoubleClick,\n}) => {\n const [selectedVideo, setSelectedVideo] = useState(undefined);\n const presentationParticipants = useMemo(() => {\n return Object.values(participants || {}).filter((l) => l.hasPresentationStream);\n }, [participants]);\n const videoParticipants = useMemo(() => {\n return Object.values(participants || {}).filter((l) => l.hasVideoStream);\n }, [participants]);\n\n const totalVideoCount = videoParticipants.length + presentationParticipants.length;\n // TODO replace with more adequate solution.\n // There's a max of 30 videos or so right now\n const columnCount = totalVideoCount <= 2 ? 1 : (\n totalVideoCount <= 6 ? 2 : (\n totalVideoCount <= 9 ? 3 : 4\n )\n );\n\n const shouldSpanLastVideo = totalVideoCount === 3 || (columnCount === 2 && totalVideoCount % 2 !== 0);\n\n const handleClickVideo = useCallback((id: string, type: 'video' | 'presentation') => {\n if (!selectedVideo || (id !== selectedVideo.id || type !== selectedVideo.type)) {\n setSelectedVideo({\n id,\n type,\n });\n } else {\n setSelectedVideo(undefined);\n }\n }, [selectedVideo]);\n\n return (\n
\n \n {selectedVideo && (\n \n )}\n\n {!selectedVideo ? presentationParticipants.map((participant) => (\n \n )) : undefined}\n {!selectedVideo ? videoParticipants.map((participant) => (\n \n )) : undefined}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { participants } = selectActiveGroupCall(global) || {};\n return {\n participants,\n };\n },\n)(GroupCallParticipantStreams));\n","import {\n GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant,\n IS_SCREENSHARE_SUPPORTED, switchCameraInput, toggleSpeaker,\n} from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\nimport '../../../modules/actions/calls';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport {\n IS_ANDROID,\n IS_IOS,\n IS_REQUEST_FULLSCREEN_SUPPORTED,\n IS_SINGLE_COLUMN_LAYOUT,\n} from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport {\n selectGroupCall,\n selectGroupCallParticipant,\n selectIsAdminInActiveGroupCall,\n} from '../../../modules/selectors/calls';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Modal from '../../ui/Modal';\nimport MicrophoneButton from './MicrophoneButton';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport Checkbox from '../../ui/Checkbox';\nimport GroupCallParticipantMenu from './GroupCallParticipantMenu';\nimport GroupCallParticipantList from './GroupCallParticipantList';\nimport GroupCallParticipantStreams from './GroupCallParticipantStreams';\n\nimport './GroupCall.scss';\n\nconst CAMERA_FLIP_PLAY_SEGMENT: [number, number] = [0, 10];\nconst PARTICIPANT_HEIGHT = 60;\n\nexport type OwnProps = {\n groupCallId: string;\n};\n\ntype StateProps = {\n isGroupCallPanelHidden: boolean;\n connectionState: GroupCallConnectionState;\n title?: string;\n meParticipant?: TypeGroupCallParticipant;\n participantsCount?: number;\n isSpeakerEnabled?: boolean;\n isAdmin: boolean;\n participants: Record;\n};\n\nconst GroupCall: FC = ({\n groupCallId,\n isGroupCallPanelHidden,\n connectionState,\n isSpeakerEnabled,\n title,\n meParticipant,\n isAdmin,\n participants,\n\n}) => {\n const {\n toggleGroupCallVideo,\n toggleGroupCallPresentation,\n leaveGroupCall,\n toggleGroupCallPanel,\n connectToActiveGroupCall,\n playGroupCallSound,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const [isLeaving, setIsLeaving] = useState(false);\n const [isFullscreen, openFullscreen, closeFullscreen] = useFlag();\n const [isSidebarOpen, openSidebar, closeSidebar] = useFlag(true);\n const hasVideoParticipants = participants && Object.values(participants).some((l) => l.video || l.presentation);\n const isLandscape = isFullscreen && !IS_SINGLE_COLUMN_LAYOUT && hasVideoParticipants;\n\n const [participantMenu, setParticipantMenu] = useState<{\n participant: TypeGroupCallParticipant;\n anchor: IAnchorPosition;\n } | undefined>();\n const [isParticipantMenuOpen, openParticipantMenu, closeParticipantMenu] = useFlag();\n\n const [isConfirmLeaveModalOpen, openConfirmLeaveModal, closeConfirmLeaveModal] = useFlag();\n const [isEndGroupCallModal, setIsEndGroupCallModal] = useState(false);\n const [shouldEndGroupCall, setShouldEndGroupCall] = useState(false);\n\n const hasVideo = meParticipant?.hasVideoStream;\n const hasPresentation = meParticipant?.hasPresentationStream;\n const isConnecting = connectionState !== 'connected';\n const canSelfUnmute = meParticipant?.canSelfUnmute;\n const shouldRaiseHand = !canSelfUnmute && meParticipant?.isMuted;\n\n const handleOpenParticipantMenu = useCallback((anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => {\n const rect = anchor.getBoundingClientRect();\n const container = containerRef.current!;\n\n setParticipantMenu({\n anchor: { x: rect.left, y: rect.top - container.offsetTop + PARTICIPANT_HEIGHT },\n participant,\n });\n\n openParticipantMenu();\n }, [openParticipantMenu]);\n\n useEffect(() => {\n if (connectionState === 'connected') {\n playGroupCallSound({ sound: 'join' });\n } else if (connectionState === 'reconnecting') {\n playGroupCallSound({ sound: 'connecting' });\n }\n }, [connectionState, playGroupCallSound]);\n\n const handleCloseConfirmLeaveModal = () => {\n closeConfirmLeaveModal();\n setIsEndGroupCallModal(false);\n };\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, [lang]);\n\n const handleToggleFullscreen = useCallback(() => {\n if (!containerRef.current) return;\n\n if (isFullscreen) {\n document.exitFullscreen().then(closeFullscreen);\n } else {\n containerRef.current.requestFullscreen().then(openFullscreen);\n }\n }, [closeFullscreen, isFullscreen, openFullscreen]);\n\n const handleToggleSidebar = () => {\n if (isSidebarOpen) {\n closeSidebar();\n } else {\n openSidebar();\n }\n };\n\n const handleStreamsDoubleClick = useCallback(() => {\n if (!IS_REQUEST_FULLSCREEN_SUPPORTED) return;\n\n if (!isFullscreen) {\n closeSidebar();\n handleToggleFullscreen();\n } else {\n handleToggleFullscreen();\n }\n }, [closeSidebar, handleToggleFullscreen, isFullscreen]);\n\n const toggleFullscreen = useCallback(() => {\n if (isFullscreen) {\n closeFullscreen();\n } else {\n openFullscreen();\n }\n }, [closeFullscreen, isFullscreen, openFullscreen]);\n\n const handleClose = () => {\n toggleGroupCallPanel();\n if (isFullscreen) {\n closeFullscreen();\n }\n };\n\n useEffect(() => {\n if (!IS_REQUEST_FULLSCREEN_SUPPORTED) return undefined;\n const container = containerRef.current;\n if (!container) return undefined;\n\n container.addEventListener('fullscreenchange', toggleFullscreen);\n\n return () => {\n container.removeEventListener('fullscreenchange', toggleFullscreen);\n };\n }, [toggleFullscreen]);\n\n const handleClickVideoOrSpeaker = () => {\n if (shouldRaiseHand) {\n toggleSpeaker();\n } else {\n toggleGroupCallVideo();\n }\n };\n\n useEffect(() => {\n connectToActiveGroupCall();\n }, [connectToActiveGroupCall, groupCallId]);\n\n const endGroupCall = () => {\n setIsEndGroupCallModal(true);\n setShouldEndGroupCall(true);\n openConfirmLeaveModal();\n if (isFullscreen) {\n handleToggleFullscreen();\n }\n };\n\n const handleLeaveGroupCall = () => {\n if (isAdmin && !isConfirmLeaveModalOpen) {\n openConfirmLeaveModal();\n if (isFullscreen) {\n handleToggleFullscreen();\n }\n return;\n }\n playGroupCallSound({ sound: 'leave' });\n setIsLeaving(true);\n closeConfirmLeaveModal();\n };\n\n const handleCloseAnimationEnd = () => {\n if (isLeaving) {\n leaveGroupCall({\n shouldDiscard: shouldEndGroupCall,\n });\n }\n };\n\n return (\n \n
\n

{title || lang('VoipGroupVoiceChat')}

\n {IS_REQUEST_FULLSCREEN_SUPPORTED && (\n \n \n \n )}\n {isLandscape && (\n \n \n \n )}\n {((IS_SCREENSHARE_SUPPORTED && !shouldRaiseHand) || isAdmin) && (\n \n {IS_SCREENSHARE_SUPPORTED && !shouldRaiseHand && (\n \n {lang(hasPresentation ? 'VoipChatStopScreenCapture' : 'VoipChatStartScreenCapture')}\n \n )}\n {isAdmin && (\n \n {lang('VoipGroupLeaveAlertEndChat')}\n \n )}\n \n )}\n \n \n \n
\n\n
\n \n\n {(!isLandscape || isSidebarOpen)\n && }\n
\n\n \n\n
\n {isConnecting && }\n\n
\n
\n {hasVideo && (IS_ANDROID || IS_IOS) && (\n \n )}\n \n \n \n
\n\n
\n {lang(shouldRaiseHand ? 'VoipSpeaker' : 'VoipCamera')}\n
\n
\n\n \n\n
\n \n\n
\n {lang('VoipGroupLeave')}\n
\n
\n
\n\n \n

{lang(isEndGroupCallModal ? 'VoipGroupEndAlertText' : 'VoipGroupLeaveAlertText')}

\n {!isEndGroupCallModal && (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { groupCallId }): StateProps => {\n const {\n connectionState, title, isSpeakerDisabled, participants, participantsCount,\n } = selectGroupCall(global, groupCallId)! || {};\n\n return {\n connectionState,\n title,\n isSpeakerEnabled: !isSpeakerDisabled,\n participantsCount,\n meParticipant: selectGroupCallParticipant(global, groupCallId, global.currentUserId!),\n isGroupCallPanelHidden: Boolean(global.groupCalls.isGroupCallPanelHidden),\n isAdmin: selectIsAdminInActiveGroupCall(global),\n participants,\n };\n },\n)(GroupCall));\n","import { GroupCallParticipant } from '../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiGroupCall } from '../../api/types';\n\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../modules/selectors/calls';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './ActiveCallHeader.scss';\n\ntype StateProps = {\n isGroupCallPanelHidden?: boolean;\n meParticipant: GroupCallParticipant;\n groupCall?: ApiGroupCall;\n};\n\nconst ActiveCallHeader: FC = ({\n groupCall,\n meParticipant,\n isGroupCallPanelHidden,\n}) => {\n const { toggleGroupCallPanel } = getDispatch();\n\n const lang = useLang();\n\n useEffect(() => {\n document.body.classList.toggle('has-group-call-header', isGroupCallPanelHidden);\n\n return () => {\n document.body.classList.toggle('has-group-call-header', false);\n };\n }, [isGroupCallPanelHidden]);\n\n if (!groupCall || !meParticipant) return undefined;\n\n return (\n \n {groupCall.title || lang('VoipGroupVoiceChat')}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n groupCall: selectActiveGroupCall(global),\n isGroupCallPanelHidden: global.groupCalls.isGroupCallPanelHidden,\n meParticipant: selectGroupCallParticipant(global, global.groupCalls.activeGroupCallId!, global.currentUserId!),\n };\n },\n)(ActiveCallHeader));\n","import React, { FC, memo, useState } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Checkbox from '../ui/Checkbox';\nimport { selectCallFallbackChannelTitle } from '../../modules/selectors/calls';\nimport { getUserFullName } from '../../modules/helpers';\nimport { selectCurrentMessageList, selectUser } from '../../modules/selectors';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ninterface StateProps {\n userFullName?: string;\n channelTitle: string;\n}\n\nconst CallFallbackConfirm: FC = ({\n isOpen,\n channelTitle,\n userFullName,\n}) => {\n const {\n closeCallFallbackConfirm,\n inviteToCallFallback,\n } = getDispatch();\n\n const [shouldRemove, setShouldRemove] = useState(true);\n const renderingUserFullName = useCurrentOrPrev(userFullName, true);\n\n return (\n {\n inviteToCallFallback({ shouldRemove });\n }}\n onClose={closeCallFallbackConfirm}\n >\n

The call will be started in a private channel {channelTitle}.

\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const user = chatId ? selectUser(global, chatId) : undefined;\n\n return {\n userFullName: user ? getUserFullName(user) : undefined,\n channelTitle: selectCallFallbackChannelTitle(global),\n };\n },\n)(CallFallbackConfirm));\n","/*! For license information please see index.js.LICENSE.txt */\n(()=>{\"use strict\";var e={\"./src/blacksilence.ts\":(e,t,n)=>{n.r(t),n.d(t,{silence:()=>a,black:()=>i});const a=e=>{const t=e.createOscillator(),n=t.connect(e.createMediaStreamDestination());return t.start(),new MediaStream([Object.assign(n.stream.getAudioTracks()[0],{enabled:!1})])},i=({width:e=640,height:t=480}={})=>{const n=Object.assign(document.createElement(\"canvas\"),{width:e,height:t}),a=n.getContext(\"2d\");if(!a)throw Error(\"Cannot create canvas ctx\");a.fillRect(0,0,e,t);const i=n.captureStream();return new MediaStream([Object.assign(i.getVideoTracks()[0],{enabled:!1})])}},\"./src/buildSdp.ts\":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(\"./src/utils.ts\");const i=(e,t=!1,n=!1)=>{const i=[],r=e=>{i.push(e)},{sessionId:s,ssrcs:o,audioExtensions:c,videoExtensions:d,audioPayloadTypes:p,videoPayloadTypes:u,transport:{ufrag:l,pwd:m,fingerprints:f,candidates:g}}=e;r(\"v=0\"),r(`o=- ${s} 2 IN IP4 0.0.0.0`),r(\"s=-\"),r(\"t=0 0\"),r(`a=group:BUNDLE ${o.map((e=>e.endpoint)).join(\" \")}${n?\"\":\" 2\"}`),r(\"a=ice-lite\");const S=e=>{let t=\"\";t+=\"a=candidate:\",t+=`${e.foundation} ${e.component} ${e.protocol} ${e.priority} ${e.ip} ${e.port} typ ${e.type}`,\"rel-addr\"in e&&(t+=` raddr ${e[\"rel-addr\"]} rport ${e[\"rel-port\"]}`),t+=` generation ${e.generation}`,r(t)},v=()=>{r(`a=ice-ufrag:${l}`),r(`a=ice-pwd:${m}`),f.forEach((e=>{r(`a=fingerprint:${e.hash} ${e.fingerprint}`),r(\"a=setup:passive\")})),g.forEach(S)},h=e=>{const{channels:t,id:n,name:a,clockrate:i,parameters:s}=e;var o=t?`/${t}`:\"\";r(`a=rtpmap:${n} ${a}/${i}${o}`),s&&(o=Object.keys(s).map((e=>`${e}=${s[e]};`)).join(\" \"),r(`a=fmtp:${n} ${o}`)),e[\"rtcp-fbs\"]?.forEach((e=>{r(`a=rtcp-fb:${n} ${e.type}${e.subtype?` ${e.subtype}`:\"\"}`)}))};return e=e=>{const n=e.isVideo?u:p;var i=e.isVideo?\"video\":\"audio\";r(`m=${i} ${e.isMain?1:0} RTP/SAVPF ${n.map((e=>e.id)).join(\" \")}`),r(\"c=IN IP4 0.0.0.0\"),r(\"b=AS:1300\"),r(`a=mid:${e.endpoint}`),r(\"a=rtcp-mux\"),n.forEach(h),r(\"a=rtcp:1 IN IP4 0.0.0.0\"),e.isVideo&&r(\"a=rtcp-rsize\"),(e.isVideo?d:c).forEach((({id:e,uri:t})=>{r(`a=extmap:${e} ${t}`)})),e.isRemoved?r(\"a=inactive\"):(v(),t?r(\"a=recvonly\"):(e.isMain?r(\"a=sendrecv\"):(r(\"a=sendonly\"),r(\"a=bundle-only\")),e.sourceGroups.forEach((t=>{r(`a=ssrc-group:${t.semantics} ${t.sources.map(a.fromTelegramSource).join(\" \")}`),t.sources.forEach((t=>{t=(0,a.fromTelegramSource)(t),r(`a=ssrc:${t} cname:${e.endpoint}`),r(`a=ssrc:${t} msid:${e.endpoint} ${e.endpoint}`),r(`a=ssrc:${t} mslabel:${e.endpoint}`),r(`a=ssrc:${t} label:${e.endpoint}`)}))}))))},o.filter((e=>\"0\"===e.endpoint||\"1\"===e.endpoint)).map(e),n||(r(\"m=application 1 UDP/DTLS/SCTP webrtc-datachannel\"),r(\"c=IN IP4 0.0.0.0\"),v(),r(\"a=ice-options:trickle\"),r(\"a=mid:\"+(n?\"1\":\"2\")),r(\"a=sctp-port:5000\"),r(\"a=max-message-size:262144\")),o.filter((e=>\"0\"!==e.endpoint&&\"1\"!==e.endpoint)).map(e),`${i.join(\"\\n\")}\\n`}},\"./src/parseSdp.ts\":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(\"./src/utils.ts\");const i=e=>{if(!e||!e.sdp)throw Error(\"Failed parsing SDP: session description is null\");const t=e.sdp.split(\"\\r\\nm=\").map(((e,t)=>0===t?e:`m=${e}`)).reduce(((e,t)=>(e[t.match(/^m=(.+?)\\s/)?.[1]||\"header\"]=t.split(\"\\r\\n\").filter(Boolean),e)),{});var n=(e,n)=>n?t[n]?.find((t=>t.startsWith(e)))?.substr(e.length):Object.values(t).map((t=>t.find((t=>t.startsWith(e)))?.substr(e.length))).filter(Boolean)[0];const i=n(\"a=ssrc:\",\"audio\");var r=i&&Number(i.split(\" \")[0]);const s=n(\"a=ssrc-group:\",\"video\")?.split(\" \")||void 0;if(!s)throw Error(\"Failed parsing SDP: no video ssrc\");var[o,c]=n(\"a=fingerprint:\")?.split(\" \")||[];if(!o||!c)throw Error(\"Failed parsing SDP: no fingerprint\");if(e=n(\"a=ice-ufrag:\"),n=n(\"a=ice-pwd:\"),!e||!n)throw Error(\"Failed parsing SDP: no ICE ufrag or pwd\");return{fingerprints:[{fingerprint:c,hash:o,setup:\"active\"}],pwd:n,ufrag:e,...r&&{ssrc:(0,a.toTelegramSource)(r)},...s&&{\"ssrc-groups\":[{semantics:s[0],sources:s.slice(1,s.length).map(Number).map(a.toTelegramSource)}]}}}},\"./src/secretsauce.ts\":(e,t,n)=>{n.r(t),n.d(t,{getDevices:()=>async function(e,t=!0){return(await navigator.mediaDevices.enumerateDevices()).filter((n=>n.kind===`${e}${t?\"input\":\"output\"}`))},toggleSpeaker:()=>function(){o&&(o.isSpeakerDisabled=!o.isSpeakerDisabled,o?.onUpdate?.({\"@type\":\"updateGroupCallConnectionState\",connectionState:\"connected\",isSpeakerDisabled:o.isSpeakerDisabled}),o.participantFunctions&&Object.values(o.participantFunctions).forEach((e=>{e.toggleMute?.(!!o?.isSpeakerDisabled)})))},toggleNoiseSuppression:()=>function(){if(o&&o.myId&&o.streams){const n=o.streams[o.myId].audio;if(n){const a=n.getTracks()[0];var e,t;a&&(({echoCancellation:e,noiseSuppression:t}=a.getConstraints()),a.applyConstraints({echoCancellation:!e,noiseSuppression:!t}))}}},getUserStreams:()=>d,setVolume:()=>function(e,t){const n=o?.participantFunctions?.[e];n&&n.setVolume?.(t)},isStreamEnabled:()=>p,switchCameraInput:()=>async function(){if(o?.myId&&o.connection&&o.streams&&o.facingMode){const e=d(o.myId)?.video;if(e){const t=e.getTracks()[0];if(t){const e=o.connection.getSenders().find((e=>t.id===e.track?.id));if(e){o.facingMode=\"environment\"===o.facingMode?\"user\":\"environment\";try{const t=await l(\"video\",o.facingMode);await e.replaceTrack(t.getTracks()[0]),o.streams[o.myId].video=t}catch(e){}}}}}},toggleStream:()=>m,leaveGroupCall:()=>g,handleUpdateGroupCallParticipants:()=>async function(e){if(o){const{participants:a,conference:r,connection:s,myId:c}=o;if(a&&r&&s&&r.ssrcs&&r.transport&&c)if(e.find((e=>e.isSelf&&e.source!==o?.conference?.ssrcs?.find((e=>e.isMain&&!e.isVideo))?.sourceGroups[0].sources[0])))g();else{const a=[];if(e.forEach((e=>{if(e.isSelf)e.isMuted&&!e.canSelfUnmute&&(m(\"audio\",!1),m(\"video\",!1),m(\"presentation\",!1));else{var t=e.isLeft;const n=e.isMuted||e.isMutedByMe,i=!e.isVideoJoined||!e.video||t,s=!e.presentation||t;let o=!1,c=!1,d=!1;r.ssrcs.filter((t=>t.userId===e.id)).forEach((t=>{t.isVideo||(t.sourceGroups[0].sources[0]===e.source&&(c=!0),t.isRemoved=n),t.isVideo&&(t.isPresentation||(e.video&&t.endpoint===e.video.endpoint&&(o=!0),t.isRemoved=i),t.isPresentation&&(e.presentation&&t.endpoint===e.presentation.endpoint&&(d=!0),t.isRemoved=s))})),n||c||r.ssrcs.push({userId:e.id,isMain:!1,endpoint:`audio${e.source}`,isVideo:!1,sourceGroups:[{semantics:\"FID\",sources:[e.source]}]}),i||o||!e.video||(a.push(e.video.endpoint),r.ssrcs.push({userId:e.id,isMain:!1,endpoint:e.video.endpoint,isVideo:!0,sourceGroups:e.video.sourceGroups})),s||d||!e.presentation||r.ssrcs.push({isPresentation:!0,userId:e.id,isMain:!1,endpoint:e.presentation.endpoint,isVideo:!0,sourceGroups:e.presentation.sourceGroups})}})),o.updatingParticipantsQueue)o.updatingParticipantsQueue.push(r);else{o.updatingParticipantsQueue=[],e=(0,i.default)(r),await s.setRemoteDescription({type:\"offer\",sdp:e});try{var t=await s.createAnswer();if(await s.setLocalDescription(t),u(c),0async function(e,t){if(o){var n=t?o.screenshareConference:o.conference;const r=t?o.screenshareConnection:o.connection;if(n&&r&&n.ssrcs){var a=Date.now();e={...n,transport:e.transport,sessionId:a,audioExtensions:e.audio?.[\"rtp-hdrexts\"],audioPayloadTypes:e.audio?.[\"payload-types\"],videoExtensions:e.video?.[\"rtp-hdrexts\"],videoPayloadTypes:e.video?.[\"payload-types\"]};o={...o,...t?{screenshareConference:e}:{conference:e}};try{await r.setRemoteDescription({type:\"answer\",sdp:(0,i.default)(e,!0,t)})}catch(e){console.error(e)}}}},startSharingScreen:()=>async function(){if(o)try{const e=await l(\"presentation\");return e?(e.getTracks()[0].onended=()=>{o&&o.myId&&(o.streams?.[o.myId].presentation,u(o.myId),c())},new Promise((t=>{var{connection:n,dataChannel:t}=h([e],t,!0);o={...o,screenshareConnection:n,screenshareDataChannel:t}}))):void 0}catch(e){return}},joinGroupCall:()=>function(e,t,n,a){if(o)throw Error(\"Already in call\");f(\"connecting\");var i=new MediaStream;return n.srcObject=i,n.play().catch((e=>console.warn(e))),o={onUpdate:a,participants:[],myId:e,speaking:{},silence:(0,r.silence)(t),black:(0,r.black)({width:640,height:480}),analyserInterval:setInterval(S,1e3),audioElement:n,audioContext:t,mediaStream:i},new Promise((e=>{o={...o,...h([o.silence,o.black],e)}}))}});var a=n(\"./src/parseSdp.ts\"),i=n(\"./src/buildSdp.ts\"),r=n(\"./src/blacksilence.ts\"),s=n(\"./src/utils.ts\");let o;function c(e){o&&(o.screenshareDataChannel?.close(),o.screenshareConnection?.close(),e||o.onUpdate?.({\"@type\":\"updateGroupCallLeavePresentation\"}))}function d(e){return o?.streams?.[e]}function p(e,t){const n=(t=t||o?.myId)&&d(t)?.[e];return!!n&&n.getTracks()[0]?.enabled}function u(e){o?.onUpdate?.({\"@type\":\"updateGroupCallStreams\",userId:e,hasAudioStream:p(\"audio\",e),hasVideoStream:p(\"video\",e),hasPresentationStream:p(\"presentation\",e),amplitude:o.speaking?.[e]})}function l(e,t=\"user\"){return\"presentation\"===e?navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}):navigator.mediaDevices.getUserMedia({audio:\"audio\"===e&&{...s.IS_ECHO_CANCELLATION_SUPPORTED&&{echoCancellation:!0},...s.IS_NOISE_SUPPRESSION_SUPPORTED&&{noiseSuppression:!0}},video:\"video\"===e&&{facingMode:t}})}async function m(e,t){if(o&&o.myId&&o.connection&&o.streams){const n=d(o.myId)?.[e];if(n){const a=n.getTracks()[0];if(a){const n=[...o.connection.getSenders(),...o.screenshareConnection?.getSenders()||[]].find((e=>a.id===e.track?.id));if(n){t=void 0===t?!a.enabled:t;try{if(t&&!a.enabled){const t=await l(e);if(await n.replaceTrack(t.getTracks()[0]),o.streams[o.myId][e]=t,\"video\"===e)o.facingMode=\"user\";else if(\"audio\"===e){const e=o.audioContext;if(!e)return;const n=e.createMediaStreamSource(t),a=e.createAnalyser();a.minDecibels=-100,a.maxDecibels=-30,a.smoothingTimeConstant=.05,a.fftSize=1024,n.connect(a),o={...o,participantFunctions:{...o.participantFunctions,[o.myId]:{...o.participantFunctions?.[o.myId],getCurrentAmplitude:()=>{var e=new Uint8Array(a.frequencyBinCount);return a.getByteFrequencyData(e),(0,s.getAmplitude)(e,1.5)}}}}}}else if(!t&&a.enabled){a.stop();const t=\"audio\"===e?o.silence:o.black;if(!t)return;await n.replaceTrack(t.getTracks()[0]),o.streams[o.myId][e]=t,\"video\"===e&&(o.facingMode=void 0)}u(o.myId),\"presentation\"!==e||t||c(!0)}catch(e){}}}}}}function f(e){o?.onUpdate?.({\"@type\":\"updateGroupCallConnectionState\",connectionState:e})}function g(){o&&(o.myId&&o.streams?.[o.myId]&&Object.values(o.streams[o.myId]||{}).forEach((e=>{e?.getTracks().forEach((e=>{e.stop()}))})),c(!0),o.dataChannel?.close(),o.connection?.close(),f(\"disconnected\"),o.analyserInterval&&clearInterval(o.analyserInterval),o=void 0)}function S(){o&&o.participantFunctions&&Object.keys(o.participantFunctions).forEach((e=>{const t=o.participantFunctions[Number(e)].getCurrentAmplitude;var n,a;t&&(n=t(),a=o.speaking[e]||0,((o.speaking[e]=n)>s.THRESHOLD&&a<=s.THRESHOLD||n<=s.THRESHOLD&&a>s.THRESHOLD)&&u(e))}))}function v(e){if(o&&o.audioElement&&o.audioContext&&o.mediaStream){var t=o.conference?.ssrcs?.find((t=>t.endpoint===e.track.id));if(t&&t.userId){const{userId:a,isPresentation:i}=t;var n=o.participants?.find((e=>e.id===a));const r=\"video\"===e.track.kind?i?\"presentation\":\"video\":\"audio\";if(e.track.onended=()=>{o?.streams?.[a][r],u(a)},t=e.streams[0],\"audio\"===e.track.kind){const e=o.mediaStream,i=new window.AudioContext,r=i.createMediaStreamSource(t),c=i.createGain();c.gain.value=(n?.volume||1e4)/1e4;const d=i.createGain();c.gain.value=1;const p=i.createAnalyser();p.minDecibels=-100,p.maxDecibels=-30,p.smoothingTimeConstant=.05,p.fftSize=1024,r.connect(p).connect(d).connect(c).connect(i.destination),e.addTrack(r.mediaStream.getAudioTracks()[0]);const u=new Audio;u.srcObject=t,u.muted=!0,u.remove(),o={...o,participantFunctions:{...o.participantFunctions,[a]:{...o.participantFunctions?.[a],setVolume:e=>{c.gain.value=1{d.gain.value=e?0:1},getCurrentAmplitude:()=>{var e=new Uint8Array(p.frequencyBinCount);return p.getByteFrequencyData(e),(0,s.getAmplitude)(e,1.5)}}}}}o={...o,streams:{...o.streams,[a]:{...o.streams?.[a],[r]:t}}},u(a)}}}function h(e,t,n=!1){const i=new RTCPeerConnection;var r=n?void 0:function(e){const t=e.createDataChannel(\"data\",{id:0});return t.onopen=()=>{},t.onmessage=e=>{JSON.parse(e.data).colibriClass},t.onerror=e=>{console.log(\"%conerror\",\"background: green; font-size: 5em\"),console.error(e)},t}(i);return e.forEach((e=>e.getTracks().forEach((t=>{i.addTrack(t,e)})))),n||(i.oniceconnectionstatechange=()=>{var e=i.iceConnectionState;\"connected\"===e||\"completed\"===e?f(\"connected\"):\"checking\"===e||\"new\"===e?f(\"connecting\"):\"disconnected\"===i.iceConnectionState&&f(\"reconnecting\")}),i.ontrack=v,i.onnegotiationneeded=async()=>{if(o){var r=o.myId;if(r){var s=await i.createOffer({offerToReceiveVideo:!0,offerToReceiveAudio:!n});if(await i.setLocalDescription(s),s.sdp){var c=(0,a.default)(s),d=n?void 0:{userId:\"\",sourceGroups:[{semantics:\"FID\",sources:[c.ssrc||0]}],isRemoved:n,isMain:!0,isVideo:!1,isPresentation:n,endpoint:n?\"1\":\"0\"},p=c[\"ssrc-groups\"]&&{isPresentation:n,userId:\"\",sourceGroups:c[\"ssrc-groups\"],isMain:!0,isVideo:!0,endpoint:n?\"0\":\"1\"};s=n?o.screenshareConference:o.conference;const i=[];n?(p&&i.push(p),d&&i.push(d)):(d&&i.push(d),p&&i.push(p)),d=e.find((e=>\"audio\"===e.getTracks()[0].kind)),p=e.find((e=>\"video\"===e.getTracks()[0].kind)),o={...o,...n?{screenshareConference:{...s,ssrcs:i}}:{conference:{...s,ssrcs:i}},streams:{...o.streams,[r]:{...o.streams?.[r],...d&&{audio:d},...!n&&p?{video:p}:{presentation:p}}}},u(r),t(c)}}}},{connection:i,dataChannel:r}}},\"./src/types.ts\":(e,t,n)=>{n.r(t)},\"./src/utils.ts\":(e,t,n)=>{function a(){var{userAgent:e,platform:t}=window.navigator;let n;return-1!==[\"Macintosh\",\"MacIntel\",\"MacPPC\",\"Mac68K\"].indexOf(t)?n=\"macOS\":-1!==[\"iPhone\",\"iPad\",\"iPod\"].indexOf(t)?n=\"iOS\":-1!==[\"Win32\",\"Win64\",\"Windows\",\"WinCE\"].indexOf(t)?n=\"Windows\":/Android/.test(e)?n=\"Android\":/Linux/.test(t)&&(n=\"Linux\"),n}n.r(t),n.d(t,{toTelegramSource:()=>function(e){return e<<0},fromTelegramSource:()=>function(e){return e>>>0},getAmplitude:()=>function(e,t=3){if(!e)return 0;var n=e.length;let a=0;for(let t=0;ta,THRESHOLD:()=>i,PLATFORM_ENV:()=>r,IS_MAC_OS:()=>s,IS_IOS:()=>o,IS_SCREENSHARE_SUPPORTED:()=>c,IS_ECHO_CANCELLATION_SUPPORTED:()=>d,IS_NOISE_SUPPRESSION_SUPPORTED:()=>p});const i=.1,r=a(),s=\"macOS\"===r,o=\"iOS\"===r,c=\"getDisplayMedia\"in(navigator?.mediaDevices||{}),d=navigator?.mediaDevices?.getSupportedConstraints().echoCancellation,p=navigator?.mediaDevices?.getSupportedConstraints().noiseSuppression}},t={};function n(a){var i=t[a];return void 0!==i||(i=t[a]={exports:{}},e[a](i,i.exports,n)),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var a={};(()=>{n.r(a),n.d(a,{handleUpdateGroupCallConnection:()=>e.handleUpdateGroupCallConnection,startSharingScreen:()=>e.startSharingScreen,joinGroupCall:()=>e.joinGroupCall,getDevices:()=>e.getDevices,getUserStreams:()=>e.getUserStreams,setVolume:()=>e.setVolume,isStreamEnabled:()=>e.isStreamEnabled,toggleStream:()=>e.toggleStream,leaveGroupCall:()=>e.leaveGroupCall,handleUpdateGroupCallParticipants:()=>e.handleUpdateGroupCallParticipants,switchCameraInput:()=>e.switchCameraInput,toggleSpeaker:()=>e.toggleSpeaker,toggleNoiseSuppression:()=>e.toggleNoiseSuppression,IS_SCREENSHARE_SUPPORTED:()=>t.IS_SCREENSHARE_SUPPORTED,THRESHOLD:()=>t.THRESHOLD});var e=n(\"./src/secretsauce.ts\"),t=n(\"./src/utils.ts\");n(\"./src/types.ts\")})();var i,r=exports;for(i in a)r[i]=a[i];a.__esModule&&Object.defineProperty(r,\"__esModule\",{value:!0})})();"],"names":["addReducer","global","actions","update","activeGroupCallId","groupCalls","toggleGroupCallPresentation","value","userId","selectGroupCallParticipant","updateGroupCallParticipant","omit","connectionState","leaveGroupCall","isFromLibrary","updateGroupCall","isSpeakerDisabled","groupCallId","participants","handleUpdateGroupCallParticipants","data","stream","showNotification","message","handleUpdateGroupCallConnection","presentation","groupCall","selectActiveGroupCall","Object","keys","length","values","payload","shouldDiscard","shouldRemove","rejoin","setGlobal","updateActiveGroupCall","participantsCount","callApi","call","shouldResetFallbackState","getGlobal","fallbackChatId","chatId","fallbackUserIdsToRemove","forEach","deleteChatMember","removeGroupCall","id","removeGroupCallAudioElement","isGroupCallPanelHidden","undefined","joinGroupCall","user","selectUser","currentUserId","toggleStream","videoStopped","isStreamEnabled","participant","raiseHand","participantId","volume","setVolume","Math","floor","GROUP_CALL_VOLUME_MULTIPLIER","Number","muted","params","startSharingScreen","presentationPaused","audioElement","getGroupCallAudioElement","audioContext","getGroupCallAudioContext","apiUpdate","inviteHash","loadMoreGroupCallParticipants","chat","selectChat","loadFullChat","selectCurrentMessageList","fallbackChannelTitle","selectCallFallbackChannelTitle","fallbackChannel","chats","byId","find","channel","title","isCreator","isRestricted","updateChatMemberBannedRights","bannedRights","users","photo","fetchFile","callFallbackAvatarPath","accessHash","inviteLink","usageLimit","expireDate","getServerTime","serverTimeOffset","sendMessage","text","openChat","createGroupCall","closeCallFallbackConfirm","vibrateShort","navigator","vibrate","memo","size","name","playSegment","color","iconData","setIconData","useState","useEffect","getAnimationData","then","AnimatedSticker","play","noLoop","speed","animationData","withGlobal","meParticipant","raiseHandRating","hasAudioStream","canSelfUnmute","isMuted","hasRequestedToSpeak","Boolean","noAudioStream","toggleGroupCallMute","requestToSpeak","playGroupCallSound","getDispatch","lang","useLang","muteMouseDownState","useRef","isRequestingToSpeak","setIsRequestingToSpeak","isConnecting","shouldRaiseHand","prevShouldRaiseHand","usePrevious","useMemo","r","random","animatedIconName","toggleMute","buttonText","className","buildClassName","onMouseDown","setTimeout","current","onMouseUp","SPEAKER_ICON_DISABLED_SEGMENT","SPEAKER_ICON_ENABLED_SEGMENT","isAdmin","selectIsAdminInActiveGroupCall","closeDropdown","isDropdownOpen","anchor","setGroupCallParticipantVolume","toggleGroupCallPanel","isDeleteUserModalOpen","openDeleteUserModal","closeDeleteUserModal","useFlag","isMutedByMe","isSelf","isRaiseHand","localVolume","setLocalVolume","GROUP_CALL_DEFAULT_VOLUME","runThrottled","ms","noFirst","throttle","cb","useThrottle","handleRemove","useCallback","e","stopPropagation","handleCancelRequestToSpeak","handleMute","handleOpenProfile","speakerIconPlaySegment","Menu","isOpen","positionX","autoClose","style","y","onClose","type","min","max","onChange","target","MenuItem","icon","onClick","destructive","DeleteMemberModal","noColor","isSpeaking","amplitude","THRESHOLD","prevIsRaiseHand","prevIsMuted","microphoneColor","isUser","openParticipantMenu","anchorRef","aboutText","aboutColor","toString","replace","about","firstName","lastName","ref","Avatar","createGroupCallInviteLink","participantsIds","viewportIds","getMore","useInfiniteScroll","InfiniteScroll","items","onLoadMore","map","key","isActive","isFullscreen","handleClick","streams","getUserStreams","ENABLE_THUMBNAIL_VIDEO","autoPlay","playsInline","srcObject","onDoubleClick","selectedVideo","setSelectedVideo","presentationParticipants","filter","l","hasPresentationStream","videoParticipants","hasVideoStream","totalVideoCount","columnCount","shouldSpanLastVideo","handleClickVideo","CAMERA_FLIP_PLAY_SEGMENT","selectGroupCall","isSpeakerEnabled","toggleGroupCallVideo","connectToActiveGroupCall","containerRef","isLeaving","setIsLeaving","openFullscreen","closeFullscreen","isSidebarOpen","openSidebar","closeSidebar","hasVideoParticipants","some","video","isLandscape","IS_SINGLE_COLUMN_LAYOUT","participantMenu","setParticipantMenu","isParticipantMenuOpen","closeParticipantMenu","isConfirmLeaveModalOpen","openConfirmLeaveModal","closeConfirmLeaveModal","isEndGroupCallModal","setIsEndGroupCallModal","shouldEndGroupCall","setShouldEndGroupCall","hasVideo","hasPresentation","handleOpenParticipantMenu","rect","getBoundingClientRect","container","x","left","top","offsetTop","sound","handleCloseConfirmLeaveModal","MainButton","onTrigger","Button","round","ariaLabel","handleToggleFullscreen","document","exitFullscreen","requestFullscreen","handleStreamsDoubleClick","IS_REQUEST_FULLSCREEN_SUPPORTED","toggleFullscreen","addEventListener","removeEventListener","handleLeaveGroupCall","Modal","dialogRef","onCloseAnimationEnd","IS_SCREENSHARE_SUPPORTED","DropdownMenu","trigger","Loading","IS_ANDROID","IS_IOS","switchCameraInput","toggleSpeaker","Checkbox","label","checked","onCheck","isText","body","classList","toggle","userFullName","getUserFullName","channelTitle","inviteToCallFallback","setShouldRemove","renderingUserFullName","useCurrentOrPrev","ConfirmDialog","confirmHandler","t","n","d","silence","a","black","i","createOscillator","connect","createMediaStreamDestination","start","MediaStream","assign","getAudioTracks","enabled","width","height","createElement","getContext","Error","fillRect","captureStream","getVideoTracks","default","push","sessionId","s","ssrcs","o","audioExtensions","c","videoExtensions","audioPayloadTypes","p","videoPayloadTypes","u","transport","ufrag","pwd","m","fingerprints","f","candidates","g","endpoint","join","S","foundation","component","protocol","priority","ip","port","generation","v","hash","fingerprint","h","channels","clockrate","parameters","subtype","isVideo","isMain","uri","isRemoved","sourceGroups","semantics","sources","fromTelegramSource","sdp","split","reduce","match","startsWith","substr","setup","ssrc","toTelegramSource","slice","getDevices","async","mediaDevices","enumerateDevices","kind","onUpdate","participantFunctions","toggleNoiseSuppression","myId","audio","getTracks","echoCancellation","noiseSuppression","getConstraints","applyConstraints","connection","facingMode","getSenders","track","replaceTrack","conference","source","isLeft","isVideoJoined","isPresentation","updatingParticipantsQueue","setRemoteDescription","createAnswer","setLocalDescription","console","error","screenshareConference","screenshareConnection","Date","now","onended","Promise","dataChannel","screenshareDataChannel","catch","warn","speaking","analyserInterval","setInterval","mediaStream","close","getDisplayMedia","getUserMedia","IS_ECHO_CANCELLATION_SUPPORTED","IS_NOISE_SUPPRESSION_SUPPORTED","createMediaStreamSource","createAnalyser","minDecibels","maxDecibels","smoothingTimeConstant","fftSize","getCurrentAmplitude","Uint8Array","frequencyBinCount","getByteFrequencyData","getAmplitude","stop","clearInterval","window","AudioContext","createGain","gain","destination","addTrack","Audio","remove","RTCPeerConnection","createDataChannel","onopen","onmessage","JSON","parse","colibriClass","onerror","log","oniceconnectionstatechange","iceConnectionState","ontrack","onnegotiationneeded","createOffer","offerToReceiveVideo","offerToReceiveAudio","userAgent","platform","indexOf","test","sqrt","getPlatform","PLATFORM_ENV","IS_MAC_OS","getSupportedConstraints","exports","defineProperty","enumerable","get","prototype","hasOwnProperty","Symbol","toStringTag","__esModule"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"47.9ea2a6fe11cbf65b8511.js","mappings":";uUAqCAA,EAAAA,EAAAA,IAAW,aAAa,CAACC,EAAQC,EAASC,KACxC,MAAM,kBAAEC,GAAsBH,EAAOI,WAErC,OAAQF,EAAO,UACb,IAAK,mCACHD,EAAQI,4BAA4B,CAAEC,OAAO,IAC7C,MAEF,IAAK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,IAAI9O,EAAE8O,WAAWtL,eAAe,IAAIxD,EAAEwD,eAAexL,UAAU,IAAIgI,EAAEhI,UAAUL,gBAAgB,IAAIqI,EAAErI,gBAAgBF,aAAa,IAAIuI,EAAEvI,aAAa5C,eAAe,IAAImL,EAAEnL,eAAeM,kCAAkC,IAAI6K,EAAE7K,kCAAkCwT,kBAAkB,IAAI3I,EAAE2I,kBAAkBC,cAAc,IAAI5I,EAAE4I,cAAcyG,uBAAuB,IAAIrP,EAAEqP,uBAAuBhH,yBAAyB,IAAIyB,EAAEzB,yBAAyB3G,UAAU,IAAIoI,EAAEpI,YAAY,IAAI1B,EAAE+J,EAAE,wBAAwBD,EAAEC,EAAE,kBAAkBA,EAAE,mBAAlsB,GAAwtB,IAAIK,EAAE1M,EAAEoX,EAAQ,IAAI1K,KAAKF,EAAExM,EAAE0M,GAAGF,EAAEE,GAAGF,EAAEoL,YAAY1f,OAAOmf,eAAerX,EAAE,aAAa,CAACnJ,OAAM,KAA1nf","sources":["webpack://telegram-t/./src/modules/actions/api/calls.async.ts","webpack://telegram-t/./src/util/vibrate.ts","webpack://telegram-t/./src/components/common/AnimatedIcon.tsx","webpack://telegram-t/./src/components/calls/group/MicrophoneButton.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantMenu.tsx","webpack://telegram-t/./src/hooks/useThrottle.ts","webpack://telegram-t/./src/components/calls/group/OutlinedMicrophoneIcon.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipant.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantList.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantVideo.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantStreams.tsx","webpack://telegram-t/./src/components/calls/group/GroupCall.tsx","webpack://telegram-t/./src/components/calls/ActiveCallHeader.tsx","webpack://telegram-t/./src/components/calls/CallFallbackConfirm.tsx","webpack://telegram-t/./src/lib/secret-sauce/index.js"],"sourcesContent":["import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport {\n joinGroupCall,\n startSharingScreen,\n leaveGroupCall,\n toggleStream,\n isStreamEnabled,\n setVolume,\n handleUpdateGroupCallParticipants, handleUpdateGroupCallConnection,\n} from '../../../lib/secret-sauce';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport {\n selectActiveGroupCall,\n selectCallFallbackChannelTitle,\n selectGroupCallParticipant,\n} from '../../selectors/calls';\nimport {\n removeGroupCall,\n updateActiveGroupCall,\n updateGroupCall,\n updateGroupCallParticipant,\n} from '../../reducers/calls';\nimport { omit } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\nimport { fetchFile } from '../../../util/files';\nimport { getGroupCallAudioContext, getGroupCallAudioElement, removeGroupCallAudioElement } from '../ui/calls';\nimport { loadFullChat } from './chats';\n\nimport callFallbackAvatarPath from '../../../assets/call-fallback-avatar.png';\n\nconst FALLBACK_INVITE_EXPIRE_SECONDS = 1800; // 30 min\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n const { activeGroupCallId } = global.groupCalls;\n\n switch (update['@type']) {\n case 'updateGroupCallLeavePresentation': {\n actions.toggleGroupCallPresentation({ value: false });\n break;\n }\n case 'updateGroupCallStreams': {\n if (!update.userId || !activeGroupCallId) break;\n if (!selectGroupCallParticipant(global, activeGroupCallId, update.userId)) break;\n\n return updateGroupCallParticipant(global, activeGroupCallId, update.userId, omit(update, ['@type', 'userId']));\n }\n case 'updateGroupCallConnectionState': {\n if (!activeGroupCallId) break;\n\n if (update.connectionState === 'disconnected') {\n actions.leaveGroupCall({ isFromLibrary: true });\n break;\n }\n\n return updateGroupCall(global, activeGroupCallId, {\n connectionState: update.connectionState,\n isSpeakerDisabled: update.isSpeakerDisabled,\n });\n }\n case 'updateGroupCallParticipants': {\n const { groupCallId, participants } = update;\n if (activeGroupCallId === groupCallId) {\n void handleUpdateGroupCallParticipants(participants);\n }\n break;\n }\n case 'updateGroupCallConnection': {\n if (update.data.stream) {\n actions.showNotification({ message: 'Big live streams are not yet supported' });\n actions.leaveGroupCall();\n break;\n }\n void handleUpdateGroupCallConnection(update.data, update.presentation);\n\n const groupCall = selectActiveGroupCall(global);\n if (groupCall?.participants && Object.keys(groupCall.participants).length > 0) {\n void handleUpdateGroupCallParticipants(Object.values(groupCall.participants));\n }\n break;\n }\n }\n\n return undefined;\n});\n\naddReducer('leaveGroupCall', (global, actions, payload) => {\n const {\n isFromLibrary, shouldDiscard, shouldRemove, rejoin,\n } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n setGlobal(updateActiveGroupCall(global, { connectionState: 'disconnected' }, groupCall.participantsCount - 1));\n\n (async () => {\n await callApi('leaveGroupCall', {\n call: groupCall,\n });\n\n let shouldResetFallbackState = false;\n if (shouldDiscard) {\n global = getGlobal();\n\n if (global.groupCalls.fallbackChatId === groupCall.chatId) {\n shouldResetFallbackState = true;\n\n global.groupCalls.fallbackUserIdsToRemove?.forEach((userId) => {\n actions.deleteChatMember({ chatId: global.groupCalls.fallbackChatId, userId });\n });\n }\n\n await callApi('discardGroupCall', {\n call: groupCall,\n });\n }\n\n global = getGlobal();\n if (shouldRemove) {\n global = removeGroupCall(global, groupCall.id);\n }\n\n removeGroupCallAudioElement();\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: true,\n activeGroupCallId: undefined,\n ...(shouldResetFallbackState && {\n fallbackChatId: undefined,\n fallbackUserIdsToRemove: undefined,\n }),\n },\n });\n\n if (!isFromLibrary) {\n leaveGroupCall();\n }\n\n if (rejoin) {\n actions.joinGroupCall(rejoin);\n }\n })();\n});\n\naddReducer('toggleGroupCallVideo', (global) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n await toggleStream('video');\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n videoStopped: !isStreamEnabled('video'),\n participant: user,\n });\n })();\n});\n\naddReducer('requestToSpeak', (global, actions, payload) => {\n const { value } = payload || { value: true };\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n raiseHand: value,\n participant: user,\n });\n});\n\naddReducer('setGroupCallParticipantVolume', (global, actions, payload) => {\n const { participantId, volume } = payload!;\n\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId);\n if (!user || !groupCall) {\n return;\n }\n\n setVolume(participantId, Math.floor(volume / GROUP_CALL_VOLUME_MULTIPLIER) / 100);\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n volume: Number(volume),\n participant: user,\n });\n});\n\naddReducer('toggleGroupCallMute', (global, actions, payload) => {\n const { participantId, value } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId || global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n const muted = value === undefined ? isStreamEnabled('audio', user.id) : value;\n\n if (!participantId) {\n await toggleStream('audio');\n } else {\n setVolume(participantId, muted ? 0 : 1);\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n muted,\n participant: user,\n });\n })();\n});\n\naddReducer('toggleGroupCallPresentation', (global, actions, payload) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n const value = payload?.value !== undefined ? payload?.value : !isStreamEnabled('presentation');\n if (value) {\n const params = await startSharingScreen();\n if (!params) {\n return;\n }\n\n await callApi('joinGroupCallPresentation', {\n call: groupCall,\n params,\n });\n } else {\n await toggleStream('presentation', false);\n await callApi('leaveGroupCallPresentation', {\n call: groupCall,\n });\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n presentationPaused: !isStreamEnabled('presentation'),\n participant: user,\n });\n })();\n});\n\naddReducer('connectToActiveGroupCall', (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) return;\n\n if (groupCall.connectionState === 'discarded') {\n actions.showNotification({ message: 'This voice chat is not active' });\n return;\n }\n\n const audioElement = getGroupCallAudioElement();\n const audioContext = getGroupCallAudioContext();\n\n if (!audioElement || !audioContext) {\n return;\n }\n\n const {\n currentUserId,\n } = global;\n\n if (!currentUserId) return;\n\n (async () => {\n const params = await joinGroupCall(currentUserId, audioContext, audioElement, actions.apiUpdate);\n\n const result = await callApi('joinGroupCall', {\n call: groupCall,\n params,\n inviteHash: groupCall.inviteHash,\n });\n\n if (!result) return;\n\n actions.loadMoreGroupCallParticipants();\n\n if (groupCall.chatId) {\n const chat = selectChat(getGlobal(), groupCall.chatId);\n if (!chat) return;\n await loadFullChat(chat);\n }\n })();\n});\n\naddReducer('inviteToCallFallback', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const user = selectUser(global, chatId);\n if (!user) {\n return;\n }\n\n const { shouldRemove } = payload;\n\n (async () => {\n const fallbackChannelTitle = selectCallFallbackChannelTitle(global);\n\n let fallbackChannel = Object.values(global.chats.byId).find((channel) => {\n return (\n channel.title === fallbackChannelTitle\n && channel.isCreator\n && !channel.isRestricted\n );\n });\n if (!fallbackChannel) {\n fallbackChannel = await callApi('createChannel', {\n title: fallbackChannelTitle,\n users: [user],\n });\n\n if (!fallbackChannel) {\n return;\n }\n\n const photo = await fetchFile(callFallbackAvatarPath, 'avatar.png');\n void callApi('editChatPhoto', {\n chatId: fallbackChannel.id,\n accessHash: fallbackChannel.accessHash,\n photo,\n });\n } else {\n actions.updateChatMemberBannedRights({\n chatId: fallbackChannel.id,\n userId: chatId,\n bannedRights: {},\n });\n\n void callApi('addChatMembers', fallbackChannel, [user], true);\n }\n\n const inviteLink = await callApi('updatePrivateLink', {\n chat: fallbackChannel,\n usageLimit: 1,\n expireDate: getServerTime(global.serverTimeOffset) + FALLBACK_INVITE_EXPIRE_SECONDS,\n });\n if (!inviteLink) {\n return;\n }\n\n if (shouldRemove) {\n global = getGlobal();\n const fallbackUserIdsToRemove = global.groupCalls.fallbackUserIdsToRemove || [];\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n fallbackChatId: fallbackChannel.id,\n fallbackUserIdsToRemove: [...fallbackUserIdsToRemove, chatId],\n },\n });\n }\n\n actions.sendMessage({ text: `Join a call: ${inviteLink}` });\n actions.openChat({ id: fallbackChannel.id });\n actions.createGroupCall({ chatId: fallbackChannel.id });\n actions.closeCallFallbackConfirm();\n })();\n});\n","export const vibrateShort = () => {\n navigator.vibrate?.(50);\n};\n","import React, {\n FC, memo, useEffect, useState,\n} from '../../lib/teact/teact';\n\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\ntype OwnProps = {\n name: keyof typeof ANIMATED_STICKERS_PATHS;\n size: number;\n playSegment?: [number, number];\n color?: [number, number, number];\n};\n\nconst AnimatedIcon: FC = ({\n size,\n name,\n playSegment,\n color,\n}) => {\n const [iconData, setIconData] = useState();\n\n useEffect(() => {\n getAnimationData(name).then(setIconData);\n }, [name]);\n\n return (\n \n );\n};\n\nexport default memo(AnimatedIcon);\n","import { GroupCallConnectionState } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { vibrateShort } from '../../../util/vibrate';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../../modules/selectors/calls';\nimport useLang from '../../../hooks/useLang';\n\nimport AnimatedIcon from '../../common/AnimatedIcon';\n\nimport './MicrophoneButton.scss';\n\nconst CONNECTION_STATE_DEFAULT = 'discarded';\n\ntype StateProps = {\n connectionState?: GroupCallConnectionState;\n hasRequestedToSpeak: boolean;\n isMuted?: boolean;\n canSelfUnmute?: boolean;\n noAudioStream: boolean;\n};\n\nconst REQUEST_TO_SPEAK_THROTTLE = 3000;\nconst HOLD_TO_SPEAK_TIME = 200;\nconst ICON_SIZE = 48;\n\nconst MicrophoneButton: FC = ({\n noAudioStream,\n canSelfUnmute,\n isMuted,\n hasRequestedToSpeak,\n connectionState,\n}) => {\n const {\n toggleGroupCallMute,\n requestToSpeak,\n playGroupCallSound,\n } = getDispatch();\n\n const lang = useLang();\n const muteMouseDownState = useRef('up');\n\n const [isRequestingToSpeak, setIsRequestingToSpeak] = useState(false);\n const isConnecting = connectionState !== 'connected';\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevShouldRaiseHand = usePrevious(shouldRaiseHand);\n\n useEffect(() => {\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n playGroupCallSound('allowTalk');\n }\n }, [playGroupCallSound, prevShouldRaiseHand, shouldRaiseHand]);\n\n // Voice mini\n // unmuted -> muted [69, 99]\n // muted -> unmuted [36, 69]\n // raise -> muted [0, 36]\n // muted -> raise [99, 136]\n // unmuted -> raise [136, 172]\n // TODO should probably move to other component\n const playSegment: [number, number] = useMemo(() => {\n if (isRequestingToSpeak) {\n const r = Math.floor(Math.random() * 100);\n return (r < 32 ? [0, 120]\n : (r < 64 ? [120, 240]\n : (r < 97 ? [240, 420]\n : [420, 540]\n )\n )\n );\n }\n if (!prevShouldRaiseHand && shouldRaiseHand) {\n return noAudioStream ? [99, 135] : [136, 172];\n }\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n return [0, 36];\n }\n if (!shouldRaiseHand) {\n return noAudioStream ? [69, 99] : [36, 69];\n }\n return [0, 0];\n }, [prevShouldRaiseHand, isRequestingToSpeak, noAudioStream, shouldRaiseHand]);\n\n const animatedIconName = isRequestingToSpeak ? 'HandFilled' : 'VoiceMini';\n\n const toggleMute = () => {\n vibrateShort();\n toggleGroupCallMute();\n };\n\n const handleMouseDownMute = () => {\n if (shouldRaiseHand) {\n if (isRequestingToSpeak) return;\n vibrateShort();\n requestToSpeak();\n setIsRequestingToSpeak(true);\n setTimeout(() => {\n setIsRequestingToSpeak(false);\n }, REQUEST_TO_SPEAK_THROTTLE);\n return;\n }\n muteMouseDownState.current = 'down';\n if (noAudioStream) {\n setTimeout(() => {\n if (muteMouseDownState.current === 'down') {\n muteMouseDownState.current = 'hold';\n toggleMute();\n }\n }, HOLD_TO_SPEAK_TIME);\n }\n };\n\n const handleMouseUpMute = () => {\n if (shouldRaiseHand) {\n return;\n }\n toggleMute();\n muteMouseDownState.current = 'up';\n };\n\n const buttonText = useMemo(() => {\n return lang(\n hasRequestedToSpeak ? 'VoipMutedTapedForSpeak' : (\n shouldRaiseHand ? 'VoipMutedByAdmin' : (\n noAudioStream ? 'VoipUnmute' : 'VoipTapToMute'\n )\n ),\n );\n }, [hasRequestedToSpeak, noAudioStream, lang, shouldRaiseHand]);\n\n return (\n
\n \n \n \n
\n {buttonText}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const groupCall = selectActiveGroupCall(global);\n\n const { connectionState } = groupCall || {};\n const meParticipant = groupCall && selectGroupCallParticipant(global, groupCall.id, global.currentUserId!);\n\n const {\n raiseHandRating, hasAudioStream, canSelfUnmute, isMuted,\n } = meParticipant || {};\n\n return {\n connectionState: connectionState || CONNECTION_STATE_DEFAULT,\n hasRequestedToSpeak: Boolean(raiseHandRating),\n noAudioStream: !hasAudioStream,\n canSelfUnmute,\n isMuted,\n };\n },\n)(MicrophoneButton));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottle from '../../../hooks/useThrottle';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport { selectIsAdminInActiveGroupCall } from '../../../modules/selectors/calls';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport DeleteMemberModal from '../../right/DeleteMemberModal';\n\nimport './GroupCallParticipantMenu.scss';\n\nconst SPEAKER_ICON_DISABLED_SEGMENT: [number, number] = [0, 17];\nconst SPEAKER_ICON_ENABLED_SEGMENT: [number, number] = [17, 34];\n\ntype OwnProps = {\n participant?: GroupCallParticipant;\n closeDropdown: VoidFunction;\n isDropdownOpen: boolean;\n anchor?: IAnchorPosition;\n};\n\ntype StateProps = {\n isAdmin: boolean;\n};\n\nconst VOLUME_ZERO = 0;\nconst VOLUME_LOW = 50;\nconst VOLUME_MEDIUM = 100;\nconst VOLUME_NORMAL = 150;\n\nconst VOLUME_CHANGE_THROTTLE = 500;\n\nconst SPEAKER_ICON_SIZE = 24;\n\nconst GroupCallParticipantMenu: FC = ({\n participant,\n closeDropdown,\n isDropdownOpen,\n anchor,\n isAdmin,\n}) => {\n const {\n toggleGroupCallMute,\n setGroupCallParticipantVolume,\n toggleGroupCallPanel,\n openChat,\n requestToSpeak,\n } = getDispatch();\n\n const lang = useLang();\n const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag();\n\n const id = participant?.id;\n const {\n isMutedByMe, isMuted, isSelf, canSelfUnmute,\n } = participant || {};\n const isRaiseHand = Boolean(participant?.raiseHandRating);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n\n const [localVolume, setLocalVolume] = useState(\n isMutedByMe ? VOLUME_ZERO : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER),\n );\n\n useEffect(() => {\n setLocalVolume(isMutedByMe\n ? VOLUME_ZERO\n : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER));\n // We only want to initialize local volume when switching participants and ignore following updates from server\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [id]);\n\n const runThrottled = useThrottle(VOLUME_CHANGE_THROTTLE);\n\n const handleRemove = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n openDeleteUserModal();\n closeDropdown();\n }, [openDeleteUserModal, closeDropdown]);\n\n const handleCancelRequestToSpeak = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n requestToSpeak({\n value: false,\n });\n closeDropdown();\n }, [requestToSpeak, closeDropdown]);\n\n const handleMute = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n closeDropdown();\n\n if (!isAdmin) {\n setLocalVolume(isMutedByMe ? GROUP_CALL_DEFAULT_VOLUME / GROUP_CALL_VOLUME_MULTIPLIER : VOLUME_ZERO);\n }\n\n toggleGroupCallMute({\n participantId: id,\n value: isAdmin ? !shouldRaiseHand : !isMutedByMe,\n });\n }, [closeDropdown, toggleGroupCallMute, id, isAdmin, shouldRaiseHand, isMutedByMe]);\n\n const handleOpenProfile = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n toggleGroupCallPanel();\n openChat({\n id,\n });\n closeDropdown();\n }, [toggleGroupCallPanel, closeDropdown, openChat, id]);\n\n const isLocalVolumeZero = localVolume === VOLUME_ZERO;\n const speakerIconPlaySegment = isLocalVolumeZero ? SPEAKER_ICON_DISABLED_SEGMENT : SPEAKER_ICON_ENABLED_SEGMENT;\n\n const handleChangeVolume = (e: React.ChangeEvent) => {\n const value = Number(e.target.value);\n setLocalVolume(value);\n runThrottled(() => {\n if (value === VOLUME_ZERO) {\n toggleGroupCallMute({\n participantId: id,\n value: true,\n });\n } else {\n setGroupCallParticipantVolume({\n participantId: id,\n volume: Math.floor(value * GROUP_CALL_VOLUME_MULTIPLIER),\n });\n }\n });\n };\n\n return (\n
\n \n {!isSelf && !shouldRaiseHand && (\n
\n
= VOLUME_LOW && localVolume < VOLUME_MEDIUM && 'medium',\n localVolume >= VOLUME_MEDIUM && localVolume < VOLUME_NORMAL && 'normal',\n localVolume >= VOLUME_NORMAL && 'high',\n )}\n >\n \n
\n \n {localVolume}%\n
\n
\n
\n )}\n
\n {(isRaiseHand && isSelf) && (\n \n {lang('VoipGroupCancelRaiseHand')}\n \n )}\n {!isSelf && {lang('VoipGroupOpenProfile')}}\n {!isSelf && (\n // TODO cross mic\n \n {isAdmin\n ? lang(shouldRaiseHand ? 'VoipGroupAllowToSpeak' : 'VoipMute')\n : lang(isMutedByMe ? 'VoipGroupUnmuteForMe' : 'VoipGroupMuteForMe')}\n \n )}\n {!isSelf && isAdmin && (\n // TODO replace with hand\n \n {lang('VoipGroupUserRemove')}\n \n )}\n
\n \n\n {!isSelf && isAdmin && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n isAdmin: selectIsAdminInActiveGroupCall(global),\n };\n },\n)(GroupCallParticipantMenu));\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nconst useThrottle = (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n\nexport default useThrottle;\n","import { GroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport usePrevious from '../../../hooks/usePrevious';\n\ntype OwnProps = {\n participant: GroupCallParticipant;\n noColor?: boolean;\n};\n\nconst OutlinedMicrophoneIcon: FC = ({\n participant,\n noColor,\n}) => {\n const { isMuted, isMutedByMe } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n const prevIsRaiseHand = usePrevious(isRaiseHand);\n const canSelfUnmute = Boolean(participant?.canSelfUnmute);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevIsMuted = usePrevious(isMuted);\n\n const playSegment: [number, number] = useMemo(() => {\n if (isMuted && !prevIsMuted) {\n return [43, 64];\n }\n\n if (!isMuted && prevIsMuted) {\n return [22, 42];\n }\n\n if (isRaiseHand && !prevIsRaiseHand) {\n return [65, 84];\n }\n\n if (!shouldRaiseHand && prevIsRaiseHand) {\n return [0, 21];\n }\n\n // TODO cancel request to speak should play in reverse\n // if (!isRaiseHand && prevIsRaiseHand) {\n // return [84, 65];\n // }\n\n return isMuted ? [22, 23] : [43, 44];\n // eslint-disable-next-line\n }, [isMuted, shouldRaiseHand, isRaiseHand]);\n\n const microphoneColor: [number, number, number] | undefined = useMemo(() => {\n return noColor ? [0xff, 0xff, 0xff] : (\n isRaiseHand ? [0x4d, 0xa6, 0xe0]\n : (shouldRaiseHand || isMutedByMe ? [0xFF, 0x70, 0x6F] : (\n isSpeaking ? [0x57, 0xBC, 0x6C] : [0x84, 0x8D, 0x94]\n ))\n );\n }, [noColor, isRaiseHand, shouldRaiseHand, isMutedByMe, isSpeaking]);\n\n return (\n \n );\n};\n\nexport default memo(OutlinedMicrophoneIcon);\n","import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\nimport OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';\n\nimport './GroupCallParticipant.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n};\n\nconst GroupCallParticipant: FC = ({\n openParticipantMenu,\n participant,\n user,\n chat,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const anchorRef = useRef(null);\n const lang = useLang();\n\n const { isSelf, isMutedByMe, isMuted } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n\n const handleOnClick = () => {\n if (isSelf) return;\n openParticipantMenu(anchorRef.current!, participant);\n };\n\n const [aboutText, aboutColor] = useMemo(() => {\n if (isSelf) {\n return [lang('ThisIsYou'), 'blue'];\n }\n if (isMutedByMe) {\n return [lang('VoipGroupMutedForMe'), 'red'];\n }\n return isRaiseHand\n ? [lang('WantsToSpeak'), 'blue']\n : (!isMuted && isSpeaking ? [\n participant.volume && participant.volume !== GROUP_CALL_DEFAULT_VOLUME\n ? lang('SpeakingWithVolume',\n (participant.volume / GROUP_CALL_VOLUME_MULTIPLIER).toString())\n .replace('%%', '%') : lang('Speaking'),\n 'green',\n ]\n : (participant.about ? [participant.about, ''] : [lang('Listening'), 'blue']));\n }, [isSpeaking, participant.volume, lang, isSelf, isMutedByMe, isRaiseHand, isMuted, participant.about]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n const name = user ? `${user.firstName || ''} ${user.lastName || ''}` : chat?.title;\n\n return (\n \n \n
\n {name}\n {aboutText}\n
\n
\n \n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { participant }): StateProps => {\n return {\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n };\n },\n)(GroupCallParticipant));\n","import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectActiveGroupCall } from '../../../modules/selectors/calls';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nimport GroupCallParticipant from './GroupCallParticipant';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\ntype OwnProps = {\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n participantsCount: number;\n participants?: Record;\n canInvite?: boolean;\n};\n\nconst GroupCallParticipantList: FC = ({\n participants,\n participantsCount,\n openParticipantMenu,\n}) => {\n const {\n createGroupCallInviteLink,\n loadMoreGroupCallParticipants,\n } = getDispatch();\n\n const lang = useLang();\n\n const participantsIds = useMemo(() => {\n return Object.keys(participants || {});\n }, [participants]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n loadMoreGroupCallParticipants,\n participantsIds,\n participantsIds.length >= participantsCount,\n );\n\n return (\n
\n
\n
\n \n
\n
{lang('VoipGroupInviteMember')}
\n
\n\n \n {viewportIds?.map(\n (participantId) => (\n participants![participantId] && (\n \n )\n ),\n )}\n \n\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { participantsCount, participants } = selectActiveGroupCall(global) || {};\n\n return {\n participants,\n participantsCount: participantsCount || 0,\n };\n },\n)(GroupCallParticipantList));\n","import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { ENABLE_THUMBNAIL_VIDEO } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\n\nimport './GroupCallParticipantVideo.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n type: 'video' | 'presentation';\n onClick?: (id: string, type: 'video' | 'presentation') => void;\n isFullscreen?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n currentUserId?: string;\n isActive?: boolean;\n};\n\nconst GroupCallParticipantVideo: FC = ({\n type,\n onClick,\n user,\n chat,\n isActive,\n isFullscreen,\n}) => {\n const lang = useLang();\n\n const handleClick = useCallback(() => {\n if (onClick) {\n onClick(user?.id || chat!.id, type);\n }\n }, [chat, onClick, type, user?.id]);\n\n if (!user && !chat) return undefined;\n\n const streams = getUserStreams(user?.id || chat!.id);\n\n return (\n \n {isFullscreen && (\n \n )}\n \n {ENABLE_THUMBNAIL_VIDEO && (\n
\n
\n )}\n \n \n {shouldRenderPlayButton && (\n \n )}\n {shouldRenderSpinner && (\n
\n {!isBuffered &&
Buffering...
}\n \n
\n )}\n {!isGif && !shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(VideoPlayer);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../../api/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport {\n getChatAvatarHash,\n getMessageDocument,\n getMessageFileSize,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport {\n selectChat, selectChatMessage, selectIsMessageProtected, selectScheduledMessage, selectUser,\n} from '../../modules/selectors';\nimport { AVATAR_FULL_DIMENSIONS, calculateMediaViewerDimensions } from '../common/helpers/mediaDimensions';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport stopEvent from '../../util/stopEvent';\n\nimport Spinner from '../ui/Spinner';\nimport MediaViewerFooter from './MediaViewerFooter';\nimport VideoPlayer from './VideoPlayer';\n\nimport './MediaViewerContent.scss';\n\ntype OwnProps = {\n messageId?: number;\n chatId?: string;\n threadId?: number;\n avatarOwnerId?: string;\n profilePhotoIndex?: number;\n origin?: MediaViewerOrigin;\n isActive?: boolean;\n animationLevel: 0 | 1 | 2;\n onClose: () => void;\n onFooterClick: () => void;\n setIsFooterHidden?: (isHidden: boolean) => void;\n isFooterHidden?: boolean;\n};\n\ntype StateProps = {\n chatId?: string;\n messageId?: number;\n senderId?: string;\n threadId?: number;\n avatarOwner?: ApiChat | ApiUser;\n profilePhotoIndex?: number;\n message?: ApiMessage;\n origin?: MediaViewerOrigin;\n isProtected?: boolean;\n};\n\nconst ANIMATION_DURATION = 350;\n\nconst MediaViewerContent: FC = (props) => {\n const {\n messageId,\n isActive,\n avatarOwner,\n chatId,\n message,\n profilePhotoIndex,\n origin,\n animationLevel,\n onClose,\n onFooterClick,\n isFooterHidden,\n isProtected,\n setIsFooterHidden,\n } = props;\n /* Content */\n const photo = message ? getMessagePhoto(message) : undefined;\n const video = message ? getMessageVideo(message) : undefined;\n const webPagePhoto = message ? getMessageWebPagePhoto(message) : undefined;\n const webPageVideo = message ? getMessageWebPageVideo(message) : undefined;\n const isDocumentPhoto = message ? isMessageDocumentPhoto(message) : false;\n const isDocumentVideo = message ? isMessageDocumentVideo(message) : false;\n const isVideo = Boolean(video || webPageVideo || isDocumentVideo);\n const isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const { isGif } = video || webPageVideo || {};\n\n const isOpen = Boolean(avatarOwner || messageId);\n const isAvatar = Boolean(avatarOwner);\n\n const isFromSharedMedia = origin === MediaViewerOrigin.SharedMedia;\n const isFromSearch = origin === MediaViewerOrigin.SearchResult;\n\n const isGhostAnimation = animationLevel === 2;\n\n /* Media data */\n function getMediaHash(isFull?: boolean) {\n if (isAvatar && profilePhotoIndex !== undefined) {\n const { photos } = avatarOwner!;\n return photos && photos[profilePhotoIndex]\n ? `photo${photos[profilePhotoIndex].id}?size=c`\n : getChatAvatarHash(avatarOwner!, isFull ? 'big' : 'normal');\n }\n\n return message && getMessageMediaHash(message, isFull ? 'viewerFull' : 'viewerPreview');\n }\n\n const pictogramBlobUrl = useMedia(\n message && (isFromSharedMedia || isFromSearch) && getMessageMediaHash(message, 'pictogram'),\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const previewMediaHash = getMediaHash();\n const previewBlobUrl = useMedia(\n previewMediaHash,\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const {\n mediaData: fullMediaBlobUrl,\n loadProgress,\n } = useMediaWithLoadProgress(\n getMediaHash(true),\n undefined,\n message && getMessageMediaFormat(message, 'viewerFull'),\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n\n const toggleControls = useCallback((isVisible) => {\n setIsFooterHidden?.(!isVisible);\n }, [setIsFooterHidden]);\n\n const localBlobUrl = (photo || video) ? (photo || video)!.blobUrl : undefined;\n let bestImageData = (!isVideo && (localBlobUrl || fullMediaBlobUrl)) || previewBlobUrl || pictogramBlobUrl;\n const thumbDataUri = useBlurSync(!bestImageData && message && getMessageMediaThumbDataUri(message));\n if (!bestImageData && origin !== MediaViewerOrigin.SearchResult) {\n bestImageData = thumbDataUri;\n }\n\n const videoSize = message ? getMessageFileSize(message) : undefined;\n\n let dimensions!: ApiDimensions;\n if (message) {\n if (isDocumentPhoto || isDocumentVideo) {\n dimensions = getMessageDocument(message)!.mediaSize!;\n } else if (photo || webPagePhoto) {\n dimensions = getPhotoFullDimensions((photo || webPagePhoto)!)!;\n } else if (video || webPageVideo) {\n dimensions = getVideoDimensions((video || webPageVideo)!)!;\n }\n } else {\n dimensions = AVATAR_FULL_DIMENSIONS;\n }\n\n if (isAvatar) {\n return (\n
\n {renderPhoto(\n fullMediaBlobUrl || previewBlobUrl,\n calculateMediaViewerDimensions(AVATAR_FULL_DIMENSIONS, false),\n !IS_SINGLE_COLUMN_LAYOUT && !isProtected,\n )}\n
\n );\n }\n\n if (!message) return undefined;\n const textParts = renderMessageText(message);\n const hasFooter = Boolean(textParts);\n\n return (\n \n {isProtected &&
}\n {isPhoto && renderPhoto(\n localBlobUrl || fullMediaBlobUrl || previewBlobUrl || pictogramBlobUrl,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter),\n !IS_SINGLE_COLUMN_LAYOUT && !isProtected,\n )}\n {isVideo && ((!isActive && IS_TOUCH_ENV) ? renderVideoPreview(\n bestImageData,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter, true),\n !IS_SINGLE_COLUMN_LAYOUT && !isProtected,\n ) : (\n \n ))}\n {textParts && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n } = ownProps;\n\n if (origin === MediaViewerOrigin.SearchResult) {\n if (!(chatId && messageId)) {\n return {};\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n if (!message) {\n return {};\n }\n\n return {\n chatId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n isProtected: selectIsMessageProtected(global, message),\n };\n }\n\n if (avatarOwnerId) {\n const sender = selectUser(global, avatarOwnerId) || selectChat(global, avatarOwnerId);\n\n return {\n messageId: -1,\n senderId: avatarOwnerId,\n avatarOwner: sender,\n profilePhotoIndex: profilePhotoIndex || 0,\n origin,\n };\n }\n\n if (!(chatId && threadId && messageId)) {\n return {};\n }\n\n let message: ApiMessage | undefined;\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n message = selectScheduledMessage(global, chatId, messageId);\n } else {\n message = selectChatMessage(global, chatId, messageId);\n }\n\n if (!message) {\n return {};\n }\n\n return {\n chatId,\n threadId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n isProtected: selectIsMessageProtected(global, message),\n };\n },\n)(MediaViewerContent));\n\nfunction renderPhoto(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n return blobUrl\n ? (\n \n )\n : (\n \n \n \n );\n}\n\nfunction renderVideoPreview(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n const wrapperStyle = imageSize && `width: ${imageSize.width}px; height: ${imageSize.height}px`;\n const videoStyle = `background-image: url(${blobUrl})`;\n return blobUrl\n ? (\n \n \n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n \n \n )\n : (\n \n \n \n );\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MediaViewerOrigin } from '../../types';\n\nimport useDebounce from '../../hooks/useDebounce';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport { animateNumber, timingFunctions } from '../../util/animation';\nimport arePropsShallowEqual from '../../util/arePropsShallowEqual';\nimport { captureEvents, IOS_SCREEN_EDGE_THRESHOLD, RealTouchEvent } from '../../util/captureEvents';\nimport { IS_IOS, IS_TOUCH_ENV } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\n\nimport MediaViewerContent from './MediaViewerContent';\n\nimport './MediaViewerSlides.scss';\nimport useTimeout from '../../hooks/useTimeout';\n\ntype OwnProps = {\n messageId?: number;\n getMessageId: (fromId?: number, direction?: number) => number | undefined;\n isVideo?: boolean;\n isGif?: boolean;\n isPhoto?: boolean;\n isOpen?: boolean;\n selectMessage: (id?: number) => void;\n chatId?: string;\n threadId?: number;\n isActive?: boolean;\n avatarOwnerId?: string;\n profilePhotoIndex?: number;\n origin?: MediaViewerOrigin;\n isZoomed?: boolean;\n animationLevel: 0 | 1 | 2;\n onClose: () => void;\n hasFooter?: boolean;\n onFooterClick: () => void;\n};\n\nconst SWIPE_X_THRESHOLD = 50;\nconst SWIPE_Y_THRESHOLD = 50;\nconst SLIDES_GAP = 40;\nconst ANIMATION_DURATION = 350;\nconst DEBOUNCE_MESSAGE = 350;\nconst DEBOUNCE_SWIPE = 500;\nconst DEBOUNCE_ACTIVE = 800;\nconst MAX_ZOOM = 4;\nconst MIN_ZOOM = 0.6;\nconst DOUBLE_TAP_ZOOM = 3;\nconst CLICK_X_THRESHOLD = 40;\nconst CLICK_Y_THRESHOLD = 80;\nlet cancelAnimation: Function | undefined;\n\ntype Transform = {\n x: number;\n y: number;\n scale: number;\n};\n\nenum SwipeDirection {\n Horizontal,\n Vertical,\n}\n\nconst MediaViewerSlides: FC = ({\n messageId,\n getMessageId,\n selectMessage,\n isVideo,\n isGif,\n isPhoto,\n isOpen,\n isActive,\n hasFooter,\n ...rest\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const activeSlideRef = useRef(null);\n const transformRef = useRef({ x: 0, y: 0, scale: 1 });\n const swipeDirectionRef = useRef(undefined);\n const isActiveRef = useRef(true);\n const [activeMessageId, setActiveMessageId] = useState(messageId);\n const forceUpdate = useForceUpdate();\n const [isFooterHidden, setIsFooterHidden] = useState(true);\n\n const {\n isZoomed,\n onClose,\n } = rest;\n\n const setTransform = useCallback((value: Transform) => {\n transformRef.current = value;\n forceUpdate();\n }, [forceUpdate]);\n\n const setIsActive = useCallback((value: boolean) => {\n isActiveRef.current = value;\n forceUpdate();\n }, [forceUpdate]);\n\n const debounceSetMessage = useDebounce(DEBOUNCE_MESSAGE, true);\n const debounceSwipeDirection = useDebounce(DEBOUNCE_SWIPE, true);\n const debounceActive = useDebounce(DEBOUNCE_ACTIVE, true);\n\n const handleToggleFooterVisibility = useCallback((e: React.MouseEvent) => {\n if (!IS_TOUCH_ENV) return;\n const isFooter = window.innerHeight - e.pageY < CLICK_Y_THRESHOLD;\n if (!isFooter && e.pageX < CLICK_X_THRESHOLD) return;\n if (!isFooter && e.pageX > window.innerWidth - CLICK_X_THRESHOLD) return;\n setIsFooterHidden(!isFooterHidden);\n }, [isFooterHidden]);\n\n useTimeout(() => setIsFooterHidden(false), ANIMATION_DURATION - 150);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV || !containerRef.current || isZoomed || !activeMessageId) {\n return undefined;\n }\n let lastTransform = { x: 0, y: 0, scale: 1 };\n const lastDragOffset = {\n x: 0,\n y: 0,\n };\n const lastZoomCenter = {\n x: 0,\n y: 0,\n };\n const panDelta = {\n x: 0,\n y: 0,\n };\n let lastGestureTime = Date.now();\n let initialContentRect: DOMRect;\n let content: HTMLElement | null;\n const setLastGestureTime = debounce(() => {\n lastGestureTime = Date.now();\n }, 500, false, true);\n\n const changeSlide = (e: MouseEvent) => {\n if (transformRef.current.scale !== 1) return false;\n let direction = 0;\n if (window.innerHeight - e.pageY < CLICK_Y_THRESHOLD) {\n return false;\n }\n if (e.pageX < CLICK_X_THRESHOLD) {\n direction = -1;\n } else if (e.pageX > window.innerWidth - CLICK_X_THRESHOLD) {\n direction = 1;\n }\n const mId = getMessageId(activeMessageId, direction);\n if (mId) {\n const offset = (window.innerWidth + SLIDES_GAP) * direction;\n transformRef.current.x += offset;\n isActiveRef.current = false;\n setActiveMessageId(mId);\n debounceSetMessage(() => selectMessage(mId));\n debounceActive(() => {\n setIsActive(true);\n });\n lastTransform = { x: 0, y: 0, scale: 1 };\n cancelAnimation = animateNumber({\n from: transformRef.current.x,\n to: 0,\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n y: 0,\n x: value,\n scale: 1,\n }),\n });\n }\n return direction !== 0;\n };\n\n return captureEvents(containerRef.current, {\n isNotPassive: true,\n excludedClosestSelector: '.VideoPlayerControls, .MediaViewerFooter',\n onCapture: () => {\n lastGestureTime = Date.now();\n if (arePropsShallowEqual(transformRef.current, { x: 0, y: 0, scale: 1 })) {\n if (!activeSlideRef.current) return;\n content = activeSlideRef.current.querySelector('img, video');\n if (!content) return;\n // Store initial content rect, without transformations\n initialContentRect = content.getBoundingClientRect();\n }\n },\n onDrag: (event, captureEvent, {\n dragOffsetX,\n dragOffsetY,\n }) => {\n // Avoid conflicts with swipe-to-back gestures\n if (IS_IOS) {\n const { pageX } = (captureEvent as RealTouchEvent).touches[0];\n if (pageX <= IOS_SCREEN_EDGE_THRESHOLD || pageX >= window.innerWidth - IOS_SCREEN_EDGE_THRESHOLD) {\n return;\n }\n }\n if (cancelAnimation) {\n cancelAnimation();\n cancelAnimation = undefined;\n }\n panDelta.x = lastDragOffset.x - dragOffsetX;\n panDelta.y = lastDragOffset.y - dragOffsetY;\n lastDragOffset.x = dragOffsetX;\n lastDragOffset.y = dragOffsetY;\n const absOffsetX = Math.abs(dragOffsetX);\n const absOffsetY = Math.abs(dragOffsetY);\n const {\n scale,\n x,\n y,\n } = transformRef.current;\n const h = 10;\n\n // If user is inactive but is still touching the screen\n // we reset last gesture time\n setLastGestureTime();\n\n // If image is scaled we just need to pan it\n if (scale !== 1) {\n if ('touches' in event && event.touches.length === 1) {\n setTransform({\n x: lastTransform.x + dragOffsetX,\n y: lastTransform.y + dragOffsetY,\n scale,\n });\n }\n return;\n }\n if (swipeDirectionRef.current !== SwipeDirection.Vertical) {\n // If user is swiping horizontally or horizontal shift is dominant\n // we change only horizontal position\n if (swipeDirectionRef.current === SwipeDirection.Horizontal\n || Math.abs(x) > h || (absOffsetX > h && absOffsetY < h)) {\n swipeDirectionRef.current = SwipeDirection.Horizontal;\n isActiveRef.current = false;\n setTransform({\n x: dragOffsetX,\n y: 0,\n scale,\n });\n return;\n }\n }\n // If vertical shift is dominant we change only vertical position\n if (swipeDirectionRef.current === SwipeDirection.Vertical\n || Math.abs(y) > h || (absOffsetY > h && absOffsetX < h)) {\n swipeDirectionRef.current = SwipeDirection.Vertical;\n setTransform({\n x: 0,\n y: dragOffsetY,\n scale,\n });\n }\n },\n onZoom: (e, {\n zoomFactor,\n initialCenterX,\n initialCenterY,\n dragOffsetX,\n dragOffsetY,\n currentCenterX,\n currentCenterY,\n }) => {\n // Calculate current scale based on zoom factor and limits, add max zoom margin for bounce back effect\n const scale = Math.min(MAX_ZOOM * 3, Math.max(lastTransform.scale * zoomFactor, MIN_ZOOM));\n const scaleFactor = scale / lastTransform.scale;\n const offsetX = Math.abs(Math.min(lastTransform.x, 0));\n const offsetY = Math.abs(Math.min(lastTransform.y, 0));\n\n // Calculate new center relative to the shifted image\n const scaledCenterX = offsetX + initialCenterX;\n const scaledCenterY = offsetY + initialCenterY;\n\n // Save last zoom center for bounce back effect\n lastZoomCenter.x = currentCenterX;\n lastZoomCenter.y = currentCenterY;\n\n // Calculate how much we need to shift the image to keep the zoom center at the same position\n const scaleOffsetX = (scaledCenterX - scaleFactor * scaledCenterX);\n const scaleOffsetY = (scaledCenterY - scaleFactor * scaledCenterY);\n\n setTransform({\n x: lastTransform.x + scaleOffsetX + dragOffsetX,\n y: lastTransform.y + scaleOffsetY + dragOffsetY,\n scale,\n });\n },\n onClick(e) {\n if (changeSlide(e as MouseEvent)) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n onDoubleClick(e, {\n centerX,\n centerY,\n }) {\n if (changeSlide(e as MouseEvent)) {\n e.preventDefault();\n e.stopPropagation();\n return undefined;\n }\n // Calculate how much we need to shift the image to keep the zoom center at the same position\n const scaleOffsetX = (centerX - DOUBLE_TAP_ZOOM * centerX);\n const scaleOffsetY = (centerY - DOUBLE_TAP_ZOOM * centerY);\n const {\n scale,\n x,\n y,\n } = transformRef.current;\n if (scale === 1) {\n if (x !== 0 || y !== 0) return undefined;\n lastTransform = {\n x: scaleOffsetX,\n y: scaleOffsetY,\n scale: DOUBLE_TAP_ZOOM,\n };\n } else {\n lastTransform = {\n x: 0,\n y: 0,\n scale: 1,\n };\n }\n return animateNumber({\n from: [x, y, scale],\n to: [lastTransform.x, lastTransform.y, lastTransform.scale],\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: value[0],\n y: value[1],\n scale: value[2],\n }),\n });\n },\n onRelease: () => {\n const absX = Math.abs(transformRef.current.x);\n const absY = Math.abs(transformRef.current.y);\n const {\n scale,\n x,\n y,\n } = transformRef.current;\n\n debounceSwipeDirection(() => {\n swipeDirectionRef.current = undefined;\n });\n debounceActive(() => {\n setIsActive(true);\n });\n\n // If scale is less than 1 we need to bounce back\n if (scale < 1) {\n lastTransform = { x: 0, y: 0, scale: 1 };\n return animateNumber({\n from: [x, y, scale],\n to: [0, 0, 1],\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: value[0],\n y: value[1],\n scale: value[2],\n }),\n });\n }\n if (scale > 1) {\n if (!content || !initialContentRect) {\n lastTransform = {\n x,\n y,\n scale,\n };\n return undefined;\n }\n // Get current content boundaries\n const boundaries = content.getBoundingClientRect();\n const s1 = Math.min(scale, MAX_ZOOM);\n const scaleFactor = s1 / scale;\n\n // Calculate new position based on the last zoom center to keep the zoom center\n // at the same position when bouncing back from max zoom\n let x1 = x * scaleFactor + (lastZoomCenter.x - scaleFactor * lastZoomCenter.x);\n let y1 = y * scaleFactor + (lastZoomCenter.y - scaleFactor * lastZoomCenter.y);\n\n // Arbitrary pan velocity coefficient\n const k = 0.15;\n\n // If scale didn't change, we need to add inertia to pan gesture\n if (lastTransform.scale === scale) {\n // Calculate user gesture velocity\n const Vx = Math.abs(lastDragOffset.x) / (Date.now() - lastGestureTime);\n const Vy = Math.abs(lastDragOffset.y) / (Date.now() - lastGestureTime);\n\n // Add extra distance based on gesture velocity and last pan delta\n x1 -= Math.abs(lastDragOffset.x) * Vx * k * panDelta.x;\n y1 -= Math.abs(lastDragOffset.y) * Vy * k * panDelta.y;\n }\n\n // If content is outside window we calculate offset boundaries\n // based on initial content rect and current scale\n if (boundaries.width > window.innerWidth) {\n const minOffsetX = -initialContentRect.left * s1;\n const maxOffsetX = window.innerWidth - initialContentRect.right * s1;\n x1 = Math.min(minOffsetX, Math.max(maxOffsetX, x1));\n } else {\n // Else we center the content on the screen\n x1 = (window.innerWidth - window.innerWidth * s1) / 2;\n }\n\n if (boundaries.height > window.innerHeight) {\n const minOffsetY = -initialContentRect.top * s1;\n const maxOffsetY = window.innerHeight - initialContentRect.bottom * s1;\n y1 = Math.min(minOffsetY, Math.max(maxOffsetY, y1));\n } else {\n y1 = (window.innerHeight - window.innerHeight * s1) / 2;\n }\n lastTransform = {\n x: x1,\n y: y1,\n scale: s1,\n };\n cancelAnimation = animateNumber({\n from: [x, y, scale],\n to: [x1, y1, s1],\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: value[0],\n y: value[1],\n scale: value[2],\n }),\n });\n return undefined;\n }\n lastTransform = {\n x,\n y,\n scale,\n };\n if (absY >= SWIPE_Y_THRESHOLD) return onClose();\n // Bounce back if vertical swipe is below threshold\n if (absY > 0) {\n return animateNumber({\n from: y,\n to: 0,\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: 0,\n y: value,\n scale,\n }),\n });\n }\n // Get horizontal swipe direction\n const direction = x < 0 ? 1 : -1;\n const mId = getMessageId(activeMessageId, x < 0 ? 1 : -1);\n // Get the direction of the last pan gesture.\n // Could be different from the total horizontal swipe direction\n // if user starts a swipe in one direction and then changes the direction\n // we need to cancel slide transition\n const dirX = panDelta.x < 0 ? -1 : 1;\n if (mId && absX >= SWIPE_X_THRESHOLD && direction === dirX) {\n const offset = (window.innerWidth + SLIDES_GAP) * direction;\n // If image is shifted by more than SWIPE_X_THRESHOLD,\n // We shift everything by one screen width and then set new active message id\n transformRef.current.x += offset;\n setActiveMessageId(mId);\n debounceSetMessage(() => selectMessage(mId));\n }\n // Then we always return to the original position\n cancelAnimation = animateNumber({\n from: transformRef.current.x,\n to: 0,\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n y: 0,\n x: value,\n scale: transformRef.current.scale,\n }),\n });\n return undefined;\n },\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n isZoomed,\n onClose,\n setTransform,\n getMessageId,\n activeMessageId,\n setIsActive,\n ]);\n\n if (!activeMessageId) return undefined;\n\n const nextMessageId = getMessageId(activeMessageId, 1);\n const previousMessageId = getMessageId(activeMessageId, -1);\n const offsetX = transformRef.current.x;\n const offsetY = transformRef.current.y;\n const { scale } = transformRef.current;\n\n return (\n
\n {previousMessageId && scale === 1 && (\n
\n \n
\n )}\n {activeMessageId && (\n \n \n
\n )}\n {nextMessageId && scale === 1 && (\n
\n \n
\n )}\n \n );\n};\n\nexport default memo(MediaViewerSlides);\n\nfunction getAnimationStyle(x = 0, y = 0, scale = 1) {\n return `transform: translate3d(${x.toFixed(3)}px, ${y.toFixed(3)}px, 0px) scale(${scale.toFixed(3)});`;\n}\n","import { useEffect, useLayoutEffect, useRef } from '../lib/teact/teact';\n\nfunction useTimeout(callback: () => void, delay: number | null) {\n const savedCallback = useRef(callback);\n\n useLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (typeof delay !== 'number') {\n return undefined;\n }\n const id = setTimeout(() => savedCallback.current(), delay);\n return () => clearTimeout(id);\n }, [delay]);\n}\n\nexport default useTimeout;\n","/*\n @source https://github.com/ajainarayanan/react-pan-zoom\n\n Heavily inspired/lifted from this idea: https://stackoverflow.com/a/39311435/661768\n without jqueryUI or jquery dependency.\n*/\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nimport './PanZoom.scss';\n\nexport interface IDragData {\n x: number;\n y: number;\n dx: number;\n dy: number;\n}\n\nexport interface OwnProps {\n children: React.ReactNode;\n className?: string;\n noWrap: boolean;\n canPan: boolean;\n zoomLevel: number;\n panDeltaX: number;\n panDeltaY: number;\n onPan?: (x: number, y: number) => void;\n}\n\nconst INITIAL_MATRIX = [\n 1, 0, 0, 1, 0, 0,\n];\n\nconst SCALE_VALUES = {\n 1: 1,\n 1.5: 1.5,\n 2: 2.2,\n 2.5: 3.3,\n 3: 5.5,\n};\n\nconst ZOOM_SAFE_AREA = 150;\n\nfunction calculateSafeZoneOnZoom(oldScale: number, matrixData: number[], wrapper: HTMLDivElement | null) {\n const image = wrapper && wrapper.querySelector('.Transition__slide--active img');\n if (!wrapper || !image) {\n return matrixData;\n }\n const wrapperRect = wrapper.getBoundingClientRect();\n const imageRect = image.getBoundingClientRect();\n\n const newImgWidth = (imageRect.width / oldScale) * matrixData[0];\n const newImgHeight = (imageRect.height / oldScale) * matrixData[3];\n const newImgX = (wrapperRect.width - newImgWidth) / 2 + matrixData[4];\n const newImgY = (wrapperRect.height - newImgHeight) / 2 + matrixData[5];\n if (wrapperRect.width && wrapperRect.width - ZOOM_SAFE_AREA < newImgX) {\n matrixData[4] -= newImgX + wrapperRect.width - ZOOM_SAFE_AREA;\n } else if (newImgWidth && newImgWidth + newImgX < ZOOM_SAFE_AREA) {\n matrixData[4] -= newImgWidth + newImgX - ZOOM_SAFE_AREA;\n }\n if (wrapperRect.height && wrapperRect.height - ZOOM_SAFE_AREA < newImgY) {\n matrixData[5] -= newImgY + wrapperRect.height - ZOOM_SAFE_AREA;\n } else if (newImgHeight && newImgHeight + newImgY < ZOOM_SAFE_AREA) {\n matrixData[5] -= newImgHeight + newImgY - ZOOM_SAFE_AREA;\n }\n\n return matrixData;\n}\n\nconst PanZoom: FC = ({\n children,\n className,\n noWrap,\n canPan,\n zoomLevel,\n panDeltaX,\n panDeltaY,\n onPan,\n}) => {\n const tunedZoomLevel = SCALE_VALUES[zoomLevel as keyof typeof SCALE_VALUES] || zoomLevel;\n const [isDragging, setIsDragging] = useState(false);\n const [dragData, setDragData] = useState({\n dx: panDeltaX, dy: panDeltaY, x: 0, y: 0,\n });\n // [zoom, skew, skew, zoom, dx, dy] - see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix()\n const [matrixData, setMatrixData] = useState(INITIAL_MATRIX);\n // Used to set cursor while moving.\n // eslint-disable-next-line no-null/no-null\n const panWrapperRef = useRef(null);\n // Used to set transform for pan.\n // eslint-disable-next-line no-null/no-null\n const panContainerRef = useRef(null);\n\n useEffect(() => {\n const newZoomLevel = tunedZoomLevel || matrixData[0];\n const newPandx = panDeltaX || matrixData[4];\n const newPandy = panDeltaY || matrixData[5];\n\n const newMatrixData = [...matrixData];\n if (matrixData[0] !== newZoomLevel) {\n newMatrixData[0] = newZoomLevel || newMatrixData[0];\n newMatrixData[3] = newZoomLevel || newMatrixData[3];\n }\n if (matrixData[4] !== newPandx) {\n newMatrixData[4] = newPandx;\n }\n if (matrixData[5] !== newPandy) {\n newMatrixData[5] = newPandy;\n }\n\n if (!areSortedArraysEqual(matrixData, newMatrixData)) {\n setMatrixData(calculateSafeZoneOnZoom(matrixData[0], newMatrixData, panWrapperRef.current));\n }\n // eslint-disable-next-line\n }, [panDeltaX, panDeltaY, tunedZoomLevel]);\n\n useEffect(() => {\n if (!canPan) {\n setMatrixData(INITIAL_MATRIX);\n }\n }, [canPan]);\n\n useEffect(() => {\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }, [noWrap, matrixData]);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n if (!canPan) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n const offsetX = matrixData[4];\n const offsetY = matrixData[5];\n const newDragData: IDragData = {\n dx: offsetX,\n dy: offsetY,\n x: e.pageX,\n y: e.pageY,\n };\n setDragData(newDragData);\n setIsDragging(true);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.add('move');\n }\n };\n\n const handleMouseUp = () => {\n setIsDragging(false);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.remove('move');\n }\n\n if (onPan) {\n onPan(matrixData[4], matrixData[5]);\n }\n };\n\n function getNewMatrixData(x: number, y: number): number[] {\n const newMatrixData = [...matrixData];\n const deltaX = dragData.x - x;\n const deltaY = dragData.y - y;\n newMatrixData[4] = dragData.dx - deltaX;\n newMatrixData[5] = dragData.dy - deltaY;\n\n return newMatrixData;\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (isDragging) {\n const newMatrixData = getNewMatrixData(e.pageX, e.pageY);\n setMatrixData(newMatrixData);\n\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }\n };\n\n if (noWrap) {\n return children;\n }\n\n return (\n \n \n {children}\n \n \n );\n};\n\nexport default memo(PanZoom);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { getSenderTitle, isUserId } from '../../modules/helpers';\nimport { formatMediaDateTime } from '../../util/dateFormat';\nimport renderText from '../common/helpers/renderText';\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectUser,\n} from '../../modules/selectors';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from '../common/Avatar';\n\nimport './SenderInfo.scss';\n\ntype OwnProps = {\n chatId?: string;\n messageId?: number;\n isAvatar?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiUser | ApiChat;\n message?: ApiMessage;\n};\n\nconst ANIMATION_DURATION = 350;\n\nconst SenderInfo: FC = ({\n chatId,\n messageId,\n sender,\n isAvatar,\n message,\n}) => {\n const {\n closeMediaViewer,\n focusMessage,\n toggleChatInfo,\n } = getDispatch();\n\n const handleFocusMessage = useCallback(() => {\n closeMediaViewer();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n toggleChatInfo(false, { forceSyncOnIOs: true });\n focusMessage({ chatId, messageId });\n }, ANIMATION_DURATION);\n } else {\n focusMessage({ chatId, messageId });\n }\n }, [chatId, focusMessage, toggleChatInfo, messageId, closeMediaViewer]);\n\n const lang = useLang();\n\n if (!sender || (!message && !isAvatar)) {\n return undefined;\n }\n\n const senderTitle = getSenderTitle(lang, sender);\n\n return (\n
\n {isUserId(sender.id) ? (\n \n ) : (\n \n )}\n
\n
\n {senderTitle && renderText(senderTitle)}\n
\n
\n {isAvatar\n ? lang('lng_mediaview_profile_photo')\n : formatMediaDateTime(lang, message!.date * 1000, true)}\n
\n
\n
\n );\n};\n\nexport default withGlobal(\n (global, { chatId, messageId, isAvatar }): StateProps => {\n if (isAvatar && chatId) {\n return {\n sender: isUserId(chatId) ? selectUser(global, chatId) : selectChat(global, chatId),\n };\n }\n\n if (!messageId || !chatId) {\n return {};\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n message,\n sender: message && selectSender(global, message),\n };\n },\n)(SenderInfo);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\n\nimport Transition, { ChildrenFn, TransitionProps } from '../ui/Transition';\n\nconst SlideTransition: FC = ({ children, ...props }) => {\n if (IS_TOUCH_ENV) return children(true, true, 1);\n // eslint-disable-next-line react/jsx-props-no-spreading\n return {children};\n};\n\nexport default SlideTransition;\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ZoomControls.scss';\n\ntype OwnProps = {\n isShown: boolean;\n onChangeZoom: (level: number, canCloseZoom?: boolean) => void;\n};\n\nexport const MAX_ZOOM_LEVEL = 3;\nexport const MIN_ZOOM_LEVEL = 1;\nconst ONE_STEP_PERCENT = 100 / (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL);\nconst RESET_ZOOM_LEVEL = 1.5;\n\nconst ZoomControls: FC = ({ isShown, onChangeZoom }) => {\n const { transitionClassNames } = useShowTransition(isShown);\n const prevIsShown = usePrevious(isShown);\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [zoomLevel, setZoomLevel] = useState(1);\n const isSeeking = useRef(false);\n\n useEffect(() => {\n if (isShown && !prevIsShown) {\n setZoomLevel(RESET_ZOOM_LEVEL);\n }\n }, [isShown, prevIsShown]);\n\n const handleZoomOut = () => {\n if (inputRef.current) {\n setZoomLevel(Math.max(MIN_ZOOM_LEVEL, zoomLevel - 0.5));\n }\n };\n\n const handleZoomIn = () => {\n if (inputRef.current) {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, zoomLevel + 0.5));\n }\n };\n\n const handleStartSeek = useCallback(() => {\n isSeeking.current = true;\n }, []);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n if (zoomLevel === 1) {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }\n }, [onChangeZoom, zoomLevel]);\n\n const handleSeeklineChange = (e:React.ChangeEvent) => {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, Math.max(Number(e.target.value), MIN_ZOOM_LEVEL)));\n };\n\n useEffect(() => {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }, [zoomLevel, onChangeZoom]);\n\n const lang = useLang();\n\n const className = buildClassName(\n 'ZoomControls',\n transitionClassNames,\n );\n\n return (\n
\n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n );\n};\n\nexport default memo(ZoomControls);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../../api/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useLang from '../../hooks/useLang';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport usePrevious from '../../hooks/usePrevious';\nimport {\n getChatAvatarHash,\n getChatMediaMessageIds,\n getMessageDocument,\n getMessageFileName,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectCurrentMediaSearch,\n selectListedIds,\n selectOutlyingIds,\n selectScheduledMessage,\n selectScheduledMessages,\n selectUser,\n} from '../../modules/selectors';\nimport { stopCurrentAudio } from '../../util/audioPlayer';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { captureEvents } from '../../util/captureEvents';\nimport windowSize from '../../util/windowSize';\nimport { AVATAR_FULL_DIMENSIONS, MEDIA_VIEWER_MEDIA_QUERY } from '../common/helpers/mediaDimensions';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport { animateClosing, animateOpening } from './helpers/ghostAnimation';\n\nimport Button from '../ui/Button';\nimport ShowTransition from '../ui/ShowTransition';\nimport Transition from '../ui/Transition';\nimport MediaViewerActions from './MediaViewerActions';\nimport MediaViewerSlides from './MediaViewerSlides';\nimport PanZoom from './PanZoom';\nimport SenderInfo from './SenderInfo';\nimport SlideTransition from './SlideTransition';\nimport ZoomControls from './ZoomControls';\n\nimport './MediaViewer.scss';\n\ntype StateProps = {\n chatId?: string;\n threadId?: number;\n messageId?: number;\n senderId?: string;\n origin?: MediaViewerOrigin;\n avatarOwner?: ApiChat | ApiUser;\n profilePhotoIndex?: number;\n message?: ApiMessage;\n chatMessages?: Record;\n collectionIds?: number[];\n animationLevel: 0 | 1 | 2;\n};\n\nconst ANIMATION_DURATION = 350;\n\nconst MediaViewer: FC = ({\n chatId,\n threadId,\n messageId,\n senderId,\n origin,\n avatarOwner,\n profilePhotoIndex,\n message,\n chatMessages,\n collectionIds,\n animationLevel,\n}) => {\n const {\n openMediaViewer,\n closeMediaViewer,\n openForwardMenu,\n focusMessage,\n toggleChatInfo,\n } = getDispatch();\n\n const isOpen = Boolean(avatarOwner || messageId);\n\n const isFromSharedMedia = origin === MediaViewerOrigin.SharedMedia;\n const isFromSearch = origin === MediaViewerOrigin.SearchResult;\n\n /* Content */\n const photo = message ? getMessagePhoto(message) : undefined;\n const video = message ? getMessageVideo(message) : undefined;\n const webPagePhoto = message ? getMessageWebPagePhoto(message) : undefined;\n const webPageVideo = message ? getMessageWebPageVideo(message) : undefined;\n const isDocumentPhoto = message ? isMessageDocumentPhoto(message) : false;\n const isDocumentVideo = message ? isMessageDocumentVideo(message) : false;\n const isVideo = Boolean(video || webPageVideo || isDocumentVideo);\n const { isGif } = video || webPageVideo || {};\n const isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const isAvatar = Boolean(avatarOwner);\n\n /* Navigation */\n const singleMessageId = webPagePhoto || webPageVideo ? messageId : undefined;\n\n const messageIds = useMemo(() => {\n return singleMessageId\n ? [singleMessageId]\n : getChatMediaMessageIds(chatMessages || {}, collectionIds || [], isFromSharedMedia);\n }, [singleMessageId, chatMessages, collectionIds, isFromSharedMedia]);\n\n const selectedMediaMessageIndex = messageId ? messageIds.indexOf(messageId) : -1;\n const isFirst = selectedMediaMessageIndex === 0 || selectedMediaMessageIndex === -1;\n const isLast = selectedMediaMessageIndex === messageIds.length - 1 || selectedMediaMessageIndex === -1;\n\n /* Animation */\n const animationKey = useRef();\n const prevSenderId = usePrevious(senderId);\n if (isOpen && (!prevSenderId || prevSenderId !== senderId || !animationKey.current)) {\n animationKey.current = selectedMediaMessageIndex;\n }\n const slideAnimation = animationLevel >= 1 && !IS_TOUCH_ENV ? 'mv-slide' : 'none';\n const headerAnimation = animationLevel === 2 ? 'slide-fade' : 'none';\n const isGhostAnimation = animationLevel === 2;\n\n /* Controls */\n const [canPanZoomWrap, setCanPanZoomWrap] = useState(false);\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomLevel, setZoomLevel] = useState(1);\n const [panDelta, setPanDelta] = useState({\n x: 0,\n y: 0,\n });\n\n /* Media data */\n function getMediaHash(isFull?: boolean) {\n if (isAvatar && profilePhotoIndex !== undefined) {\n const { photos } = avatarOwner!;\n return photos && photos[profilePhotoIndex]\n ? `photo${photos[profilePhotoIndex].id}?size=c`\n : getChatAvatarHash(avatarOwner!, isFull ? 'big' : 'normal');\n }\n\n return message && getMessageMediaHash(message, isFull ? 'viewerFull' : 'viewerPreview');\n }\n\n const pictogramBlobUrl = useMedia(\n message && (isFromSharedMedia || isFromSearch) && getMessageMediaHash(message, 'pictogram'),\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const previewMediaHash = getMediaHash();\n const previewBlobUrl = useMedia(\n previewMediaHash,\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const { mediaData: fullMediaBlobUrl } = useMediaWithLoadProgress(\n getMediaHash(true),\n undefined,\n message && getMessageMediaFormat(message, 'viewerFull'),\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n\n const localBlobUrl = (photo || video) ? (photo || video)!.blobUrl : undefined;\n let bestImageData = (!isVideo && (localBlobUrl || fullMediaBlobUrl)) || previewBlobUrl || pictogramBlobUrl;\n const thumbDataUri = useBlurSync(!bestImageData && message && getMessageMediaThumbDataUri(message));\n if (!bestImageData && origin !== MediaViewerOrigin.SearchResult) {\n bestImageData = thumbDataUri;\n }\n\n const fileName = message\n ? getMessageFileName(message)\n : isAvatar\n ? `avatar${avatarOwner!.id}-${profilePhotoIndex}.jpg`\n : undefined;\n\n let dimensions!: ApiDimensions;\n if (message) {\n if (isDocumentPhoto || isDocumentVideo) {\n dimensions = getMessageDocument(message)!.mediaSize!;\n } else if (photo || webPagePhoto) {\n dimensions = getPhotoFullDimensions((photo || webPagePhoto)!)!;\n } else if (video || webPageVideo) {\n dimensions = getVideoDimensions((video || webPageVideo)!)!;\n }\n } else {\n dimensions = AVATAR_FULL_DIMENSIONS;\n }\n\n useEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return;\n }\n\n document.body.classList.toggle('is-media-viewer-open', isOpen);\n }, [isOpen]);\n\n const forceUpdate = useForceUpdate();\n useEffect(() => {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', forceUpdate);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(forceUpdate);\n }\n\n return () => {\n if (typeof mql.removeEventListener === 'function') {\n mql.removeEventListener('change', forceUpdate);\n } else if (typeof mql.removeListener === 'function') {\n mql.removeListener(forceUpdate);\n }\n };\n }, [forceUpdate]);\n\n const prevMessage = usePrevious(message);\n const prevOrigin = usePrevious(origin);\n const prevAvatarOwner = usePrevious(avatarOwner);\n const prevBestImageData = usePrevious(bestImageData);\n const textParts = message ? renderMessageText(message) : undefined;\n const hasFooter = Boolean(textParts);\n\n useEffect(() => {\n if (isGhostAnimation && isOpen && !prevMessage && !prevAvatarOwner) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n animateOpening(hasFooter, origin!, bestImageData!, dimensions, isVideo, message);\n }\n\n if (isGhostAnimation && !isOpen && (prevMessage || prevAvatarOwner)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n animateClosing(prevOrigin!, prevBestImageData!, prevMessage || undefined);\n }\n }, [\n isGhostAnimation, isOpen, origin, prevOrigin, message, prevMessage, prevAvatarOwner,\n bestImageData, prevBestImageData, dimensions, isVideo, hasFooter,\n ]);\n\n useEffect(() => {\n let timer: number | undefined;\n\n if (isZoomed) {\n setCanPanZoomWrap(true);\n } else {\n timer = window.setTimeout(() => {\n setCanPanZoomWrap(false);\n }, ANIMATION_DURATION);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [isZoomed]);\n\n const closeZoom = () => {\n setIsZoomed(false);\n setZoomLevel(1);\n setPanDelta({\n x: 0,\n y: 0,\n });\n };\n\n const handleZoomToggle = useCallback(() => {\n setIsZoomed(!isZoomed);\n setZoomLevel(!isZoomed ? 1.5 : 1);\n if (isZoomed) {\n setPanDelta({\n x: 0,\n y: 0,\n });\n }\n }, [isZoomed]);\n\n const handleZoomValue = useCallback((level: number, canCloseZoom = false) => {\n setZoomLevel(level);\n if (level === 1 && canCloseZoom) {\n closeZoom();\n }\n }, []);\n\n const close = useCallback(() => {\n closeMediaViewer();\n closeZoom();\n }, [closeMediaViewer]);\n\n const handleFooterClick = useCallback(() => {\n close();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n toggleChatInfo(false, { forceSyncOnIOs: true });\n focusMessage({ chatId, threadId, messageId });\n }, ANIMATION_DURATION);\n } else {\n focusMessage({ chatId, threadId, messageId });\n }\n }, [close, chatId, threadId, focusMessage, toggleChatInfo, messageId]);\n\n const handleForward = useCallback(() => {\n openForwardMenu({\n fromChatId: chatId,\n messageIds: [messageId],\n });\n closeZoom();\n }, [openForwardMenu, chatId, messageId]);\n\n const selectMessage = useCallback((id?: number) => openMediaViewer({\n chatId,\n threadId,\n messageId: id,\n origin,\n }, {\n forceOnHeavyAnimation: true,\n }), [chatId, openMediaViewer, origin, threadId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(() => {\n if (isZoomed) {\n closeZoom();\n } else {\n close();\n }\n }) : undefined), [close, isOpen, isZoomed]);\n\n useEffect(() => {\n if (isVideo && !isGif) {\n stopCurrentAudio();\n }\n }, [isGif, isVideo]);\n\n // Prevent refresh when rotating device to watch a video\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [isOpen]);\n\n const getMessageId = useCallback((fromId?: number, direction?: number): number | undefined => {\n if (!fromId) return undefined;\n const index = messageIds.indexOf(fromId);\n if ((direction === -1 && index > 0) || (direction === 1 && index < messageIds.length - 1)) {\n return messageIds[index + direction];\n }\n return undefined;\n }, [messageIds]);\n\n const nextMessageId = getMessageId(messageId, 1);\n const previousMessageId = getMessageId(messageId, -1);\n\n const handlePan = useCallback((x: number, y: number) => {\n setPanDelta({\n x,\n y,\n });\n }, []);\n\n const lang = useLang();\n\n useHistoryBack(isOpen, closeMediaViewer, openMediaViewer, {\n chatId,\n threadId,\n messageId,\n origin,\n avatarOwnerId: avatarOwner && avatarOwner.id,\n });\n\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n switch (e.key) {\n case 'Left': // IE/Edge specific value\n case 'ArrowLeft':\n selectMessage(previousMessageId);\n break;\n\n case 'Right': // IE/Edge specific value\n case 'ArrowRight':\n selectMessage(nextMessageId);\n break;\n }\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n }, [isOpen, nextMessageId, previousMessageId, selectMessage]);\n\n useEffect(() => {\n if (isZoomed || IS_TOUCH_ENV) return undefined;\n const element = document.querySelector('.MediaViewerSlide--active');\n if (!element) {\n return undefined;\n }\n\n const shouldCloseOnVideo = isGif && !IS_IOS;\n\n return captureEvents(element, {\n // eslint-disable-next-line max-len\n excludedClosestSelector: `.backdrop, .navigation, .media-viewer-head, .Spoiler, .media-viewer-footer${!shouldCloseOnVideo ? ', .VideoPlayer' : ''}`,\n onClick: close,\n });\n }, [close, isGif, isZoomed, messageId]);\n\n function renderSenderInfo() {\n return isAvatar ? (\n \n ) : (\n \n );\n }\n\n return (\n \n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n {renderSenderInfo()}\n \n \n
\n \n \n {(isActive: boolean) => (\n \n )}\n \n \n {!isFirst && !IS_TOUCH_ENV && (\n selectMessage(previousMessageId)}\n />\n )}\n {!isLast && !IS_TOUCH_ENV && (\n selectMessage(nextMessageId)}\n />\n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n } = global.mediaViewer;\n const {\n animationLevel,\n } = global.settings.byKey;\n\n if (origin === MediaViewerOrigin.SearchResult) {\n if (!(chatId && messageId)) {\n return { animationLevel };\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n if (!message) {\n return { animationLevel };\n }\n\n return {\n chatId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n animationLevel,\n };\n }\n\n if (avatarOwnerId) {\n const sender = selectUser(global, avatarOwnerId) || selectChat(global, avatarOwnerId);\n\n return {\n messageId: -1,\n senderId: avatarOwnerId,\n avatarOwner: sender,\n profilePhotoIndex: profilePhotoIndex || 0,\n animationLevel,\n origin,\n };\n }\n\n if (!(chatId && threadId && messageId)) {\n return { animationLevel };\n }\n\n let message: ApiMessage | undefined;\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n message = selectScheduledMessage(global, chatId, messageId);\n } else {\n message = selectChatMessage(global, chatId, messageId);\n }\n\n if (!message) {\n return { animationLevel };\n }\n\n let chatMessages: Record | undefined;\n\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n chatMessages = selectScheduledMessages(global, chatId);\n } else {\n chatMessages = selectChatMessages(global, chatId);\n }\n let collectionIds: number[] | undefined;\n\n if (origin === MediaViewerOrigin.Inline || origin === MediaViewerOrigin.Album) {\n collectionIds = selectOutlyingIds(global, chatId, threadId) || selectListedIds(global, chatId, threadId);\n } else if (origin === MediaViewerOrigin.SharedMedia) {\n const currentSearch = selectCurrentMediaSearch(global);\n const { foundIds } = (currentSearch && currentSearch.resultsByType && currentSearch.resultsByType.media) || {};\n collectionIds = foundIds;\n }\n\n return {\n chatId,\n threadId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n chatMessages,\n collectionIds,\n animationLevel,\n };\n },\n)(MediaViewer));\n","import { RefObject } from 'react';\nimport React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\n\nimport { CHAT_HEIGHT_PX } from '../../config';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen';\nimport { isUserId } from '../../modules/helpers';\n\nimport Loading from '../ui/Loading';\nimport Modal from '../ui/Modal';\nimport InputText from '../ui/InputText';\nimport Button from '../ui/Button';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport GroupChatInfo from './GroupChatInfo';\nimport PrivateChatInfo from './PrivateChatInfo';\n\nimport './ChatOrUserPicker.scss';\n\nexport type OwnProps = {\n currentUserId?: string;\n chatOrUserIds: string[];\n isOpen: boolean;\n filterRef: RefObject;\n filterPlaceholder: string;\n filter: string;\n loadMore?: NoneToVoidFunction;\n onFilterChange: (filter: string) => void;\n onSelectChatOrUser: (chatOrUserId: string) => void;\n onClose: NoneToVoidFunction;\n onCloseAnimationEnd?: NoneToVoidFunction;\n};\n\nconst ChatOrUserPicker: FC = ({\n isOpen,\n currentUserId,\n chatOrUserIds,\n filterRef,\n filter,\n filterPlaceholder,\n loadMore,\n onFilterChange,\n onSelectChatOrUser,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const lang = useLang();\n const [viewportIds, getMore] = useInfiniteScroll(loadMore, chatOrUserIds, Boolean(filter));\n\n const resetFilter = useCallback(() => {\n onFilterChange('');\n }, [onFilterChange]);\n useInputFocusOnOpen(filterRef, isOpen, resetFilter);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n onFilterChange(e.currentTarget.value);\n }, [onFilterChange]);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n onSelectChatOrUser(viewportIds[index === -1 ? 0 : index]);\n }\n }, '.ListItem-button', true);\n\n const modalHeader = (\n
\n \n \n \n \n
\n );\n\n const viewportOffset = chatOrUserIds!.indexOf(viewportIds![0]);\n\n return (\n \n {viewportIds?.length ? (\n \n {viewportIds.map((id, i) => (\n onSelectChatOrUser(id)}\n >\n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : viewportIds && !viewportIds.length ? (\n

{lang('lng_blocked_list_not_found')}

\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(ChatOrUserPicker);\n","import React, {\n FC, useMemo, useState, memo, useRef, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, MAIN_THREAD_ID } from '../../api/types';\n\nimport {\n filterChatsByName,\n filterUsersByName,\n getCanPostInChat,\n sortChatIds,\n} from '../../modules/helpers';\nimport { unique } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useFlag from '../../hooks/useFlag';\n\nimport ChatOrUserPicker from '../common/ChatOrUserPicker';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n chatsById: Record;\n activeListIds?: string[];\n archivedListIds?: string[];\n pinnedIds?: string[];\n contactIds?: string[];\n currentUserId?: string;\n};\n\nconst ForwardPicker: FC = ({\n chatsById,\n activeListIds,\n archivedListIds,\n pinnedIds,\n contactIds,\n currentUserId,\n isOpen,\n}) => {\n const {\n setForwardChatId,\n exitForwardMode,\n } = getDispatch();\n\n const lang = useLang();\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const filterRef = useRef(null);\n\n const [isShown, markIsShown, unmarkIsShown] = useFlag();\n useEffect(() => {\n if (isOpen) {\n markIsShown();\n }\n }, [isOpen, markIsShown]);\n\n const chatAndContactIds = useMemo(() => {\n if (!isOpen) {\n return undefined;\n }\n\n let priorityIds = pinnedIds || [];\n if (currentUserId) {\n priorityIds = unique([currentUserId, ...priorityIds]);\n }\n\n const chatIds = [\n ...(activeListIds || []),\n ...(archivedListIds || []),\n ].filter((id) => {\n const chat = chatsById[id];\n\n return chat && getCanPostInChat(chat, MAIN_THREAD_ID);\n });\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return sortChatIds(unique([\n ...filterChatsByName(lang, chatIds, chatsById, filter, currentUserId),\n ...(contactIds ? filterUsersByName(contactIds, usersById, filter) : []),\n ]), chatsById, undefined, priorityIds);\n }, [activeListIds, archivedListIds, chatsById, contactIds, currentUserId, filter, isOpen, lang, pinnedIds]);\n\n const handleSelectUser = useCallback((userId: string) => {\n setForwardChatId({ id: userId });\n }, [setForwardChatId]);\n\n const renderingChatAndContactIds = useCurrentOrPrev(chatAndContactIds, true)!;\n\n if (!isOpen && !isShown) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n chatsById,\n activeListIds: listIds.active,\n archivedListIds: listIds.archived,\n pinnedIds: orderedPinnedIds.active,\n contactIds: global.contactList?.userIds,\n currentUserId,\n };\n },\n)(ForwardPicker));\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiContact, ApiError, ApiInviteInfo, ApiPhoto,\n} from '../../api/types';\n\nimport getReadableErrorText from '../../util/getReadableErrorText';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Avatar from '../common/Avatar';\n\nimport './Dialogs.scss';\n\ntype StateProps = {\n dialogs: (ApiError | ApiInviteInfo)[];\n};\n\nconst Dialogs: FC = ({ dialogs }) => {\n const {\n dismissDialog,\n acceptInviteConfirmation,\n sendMessage,\n showNotification,\n } = getDispatch();\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n const lang = useLang();\n\n useEffect(() => {\n if (dialogs.length > 0) {\n openModal();\n }\n }, [dialogs, openModal]);\n\n if (!dialogs.length) {\n return undefined;\n }\n\n function renderInviteHeader(title: string, photo?: ApiPhoto) {\n return (\n
\n {photo && }\n
\n {renderText(title)}\n
\n \n
\n );\n }\n\n const renderInvite = (invite: ApiInviteInfo) => {\n const {\n hash, title, about, participantsCount, isChannel, photo, isRequestNeeded,\n } = invite;\n\n const handleJoinClick = () => {\n acceptInviteConfirmation({\n hash,\n });\n showNotification({\n message: isChannel ? lang('RequestToJoinChannelSentDescription') : lang('RequestToJoinGroupSentDescription'),\n });\n closeModal();\n };\n\n const participantsText = isChannel\n ? lang('Subscribers', participantsCount, 'i')\n : lang('Members', participantsCount, 'i');\n\n const joinText = isChannel ? lang('ChannelJoin') : lang('JoinGroup');\n const requestToJoinText = isChannel\n ? lang('MemberRequests.RequestToJoinChannel') : lang('MemberRequests.RequestToJoinGroup');\n\n return (\n \n {participantsCount !== undefined &&

{participantsText}

}\n {about &&

{renderText(about, ['br'])}

}\n {isRequestNeeded && (\n

\n {isChannel\n ? lang('MemberRequests.RequestToJoinDescriptionChannel')\n : lang('MemberRequests.RequestToJoinDescriptionGroup')}\n

\n )}\n \n \n \n );\n };\n\n const renderContactRequest = (contactRequest: ApiContact) => {\n const handleConfirm = () => {\n sendMessage({\n contact: pick(contactRequest, ['firstName', 'lastName', 'phoneNumber']),\n });\n closeModal();\n };\n\n return (\n \n {lang('AreYouSureShareMyContactInfoBot')}\n
\n \n \n
\n \n );\n };\n\n const renderError = (error: ApiError) => {\n return (\n \n {error.hasErrorKey ? getReadableErrorText(error) : renderText(error.message!, ['emoji', 'br'])}\n
\n \n
\n \n );\n };\n\n const renderDialog = (dialog: ApiError | ApiInviteInfo | ApiContact) => {\n if ('hash' in dialog) {\n return renderInvite(dialog);\n }\n\n if ('phoneNumber' in dialog) {\n return renderContactRequest(dialog);\n }\n\n return renderError(dialog);\n };\n\n return (\n
\n {Boolean(dialogs.length) && renderDialog(dialogs[dialogs.length - 1])}\n
\n );\n};\n\nfunction getErrorHeader(error: ApiError) {\n if (error.isSlowMode) {\n return 'Slowmode enabled';\n }\n\n if (!error.hasErrorKey) {\n return 'Telegram';\n }\n\n return 'Something went wrong';\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['dialogs']),\n)(Dialogs));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiNotification } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\n\nimport Notification from '../ui/Notification';\n\ntype StateProps = {\n notifications: ApiNotification[];\n};\n\nconst Notifications: FC = ({ notifications }) => {\n const { dismissNotification } = getDispatch();\n\n if (!notifications.length) {\n return undefined;\n }\n\n return (\n
\n {notifications.map(({ message, localId }) => (\n dismissNotification({ localId })}\n />\n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['notifications']),\n)(Notifications));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ensureProtocol } from '../../util/ensureProtocol';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\n\nexport type OwnProps = {\n url?: string;\n};\n\nconst SafeLinkModal: FC = ({ url }) => {\n const { toggleSafeLinkModal } = getDispatch();\n\n const lang = useLang();\n\n const handleOpen = useCallback(() => {\n window.open(ensureProtocol(url));\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal, url]);\n\n const handleDismiss = useCallback(() => {\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal]);\n\n const renderingUrl = useCurrentOrPrev(url);\n\n return (\n \n );\n};\n\nexport default memo(SafeLinkModal);\n","import React, {\n FC, memo, useState, useEffect, useMemo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport { formatTime, formatDateToString, getDayStart } from '../../util/dateFormat';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useFlag from '../../hooks/useFlag';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './CalendarModal.scss';\n\nconst MAX_SAFE_DATE = 2147483647 * 1000; // API has int for dates\nconst MIN_SAFE_DATE = 0;\n\nexport type OwnProps = {\n selectedAt?: number;\n minAt?: number;\n maxAt?: number;\n isFutureMode?: boolean;\n isPastMode?: boolean;\n isOpen: boolean;\n withTimePicker?: boolean;\n submitButtonLabel?: string;\n secondButtonLabel?: string;\n onClose: () => void;\n onSubmit: (date: Date) => void;\n onSecondButtonClick?: NoneToVoidFunction;\n};\n\nconst WEEKDAY_LETTERS = [\n 'lng_weekday1',\n 'lng_weekday2',\n 'lng_weekday3',\n 'lng_weekday4',\n 'lng_weekday5',\n 'lng_weekday6',\n 'lng_weekday7',\n];\n\nconst CalendarModal: FC = ({\n selectedAt,\n minAt,\n maxAt,\n isFutureMode,\n isPastMode,\n isOpen,\n withTimePicker,\n submitButtonLabel,\n secondButtonLabel,\n onClose,\n onSubmit,\n onSecondButtonClick,\n}) => {\n const lang = useLang();\n const now = new Date();\n\n const minDate = useMemo(() => {\n if (isFutureMode && !minAt) return new Date();\n return new Date(Math.max(minAt || MIN_SAFE_DATE, MIN_SAFE_DATE));\n }, [isFutureMode, minAt]);\n const maxDate = useMemo(() => {\n if (isPastMode && !maxAt) return new Date();\n return new Date(Math.min(maxAt || MAX_SAFE_DATE, MAX_SAFE_DATE));\n }, [isPastMode, maxAt]);\n\n const passedSelectedDate = useMemo(() => (selectedAt ? new Date(selectedAt) : new Date()), [selectedAt]);\n const prevIsOpen = usePrevious(isOpen);\n const [isTimeInputFocused, markTimeInputAsFocused, unmarkTimeInputAsFocused] = useFlag(false);\n\n const [selectedDate, setSelectedDate] = useState(passedSelectedDate);\n const [currentMonthAndYear, setCurrentMonthAndYear] = useState(\n new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1),\n );\n const [selectedHours, setSelectedHours] = useState(\n formatInputTime(passedSelectedDate.getHours()),\n );\n const [selectedMinutes, setSelectedMinutes] = useState(\n formatInputTime(passedSelectedDate.getMinutes()),\n );\n\n const selectedDay = formatDay(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate());\n const currentYear = currentMonthAndYear.getFullYear();\n const currentMonth = currentMonthAndYear.getMonth();\n\n useEffect(() => {\n if (!prevIsOpen && isOpen) {\n setSelectedDate(passedSelectedDate);\n setCurrentMonthAndYear(new Date(passedSelectedDate.getFullYear(), passedSelectedDate.getMonth(), 1));\n if (withTimePicker) {\n setSelectedHours(formatInputTime(passedSelectedDate.getHours()));\n setSelectedMinutes(formatInputTime(passedSelectedDate.getMinutes()));\n }\n }\n }, [passedSelectedDate, isOpen, prevIsOpen, withTimePicker]);\n\n useEffect(() => {\n if (isFutureMode && !isTimeInputFocused && selectedDate.getTime() < minDate.getTime()) {\n setSelectedDate(minDate);\n setSelectedHours(formatInputTime(minDate.getHours()));\n setSelectedMinutes(formatInputTime(minDate.getMinutes()));\n }\n }, [isFutureMode, isTimeInputFocused, minDate, selectedDate]);\n\n useEffect(() => {\n if (isPastMode && !isTimeInputFocused && selectedDate.getTime() > maxDate.getTime()) {\n setSelectedDate(maxDate);\n setSelectedHours(formatInputTime(maxDate.getHours()));\n setSelectedMinutes(formatInputTime(maxDate.getMinutes()));\n }\n }, [isFutureMode, isPastMode, isTimeInputFocused, maxDate, minDate, selectedDate]);\n\n useEffect(() => {\n if (selectedAt) {\n const newSelectedDate = new Date(selectedAt);\n setSelectedDate(newSelectedDate);\n setSelectedHours(formatInputTime(newSelectedDate.getHours()));\n setSelectedMinutes(formatInputTime(newSelectedDate.getMinutes()));\n }\n }, [selectedAt]);\n\n const shouldDisableNextMonth = (isPastMode && currentYear >= now.getFullYear() && currentMonth >= now.getMonth())\n || (maxDate && currentYear >= maxDate.getFullYear() && currentMonth >= maxDate.getMonth());\n const shouldDisablePrevMonth = isFutureMode && currentYear <= now.getFullYear() && currentMonth <= now.getMonth();\n\n const { prevMonthGrid, currentMonthGrid, nextMonthGrid } = useMemo(() => (\n buildCalendarGrid(currentYear, currentMonth)\n ), [currentMonth, currentYear]);\n\n const submitLabel = useMemo(() => {\n return submitButtonLabel || formatSubmitLabel(lang, selectedDate);\n }, [lang, selectedDate, submitButtonLabel]);\n\n function handlePrevMonth() {\n setCurrentMonthAndYear((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() - 1);\n\n return dateCopy;\n });\n }\n\n function handleNextMonth() {\n setCurrentMonthAndYear((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() + 1);\n\n return dateCopy;\n });\n }\n\n function handleDateSelect(date: number) {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setDate(date);\n dateCopy.setMonth(currentMonth);\n dateCopy.setFullYear(currentYear);\n\n return dateCopy;\n });\n }\n\n function handleSubmit() {\n onSubmit(selectedDate);\n }\n\n const handleChangeHours = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedHours('');\n e.target.value = '';\n return;\n }\n\n const hours = Math.max(0, Math.min(Number(value), 23));\n\n const date = new Date(selectedDate.getTime());\n date.setHours(hours);\n setSelectedDate(date);\n\n const hoursStr = formatInputTime(hours);\n setSelectedHours(hoursStr);\n e.target.value = hoursStr;\n }, [selectedDate]);\n\n const handleChangeMinutes = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedMinutes('');\n e.target.value = '';\n return;\n }\n\n const minutes = Math.max(0, Math.min(Number(value), 59));\n\n const date = new Date(selectedDate.getTime());\n date.setMinutes(minutes);\n setSelectedDate(date);\n\n const minutesStr = formatInputTime(minutes);\n setSelectedMinutes(minutesStr);\n e.target.value = minutesStr;\n }, [selectedDate]);\n\n function renderTimePicker() {\n return (\n
\n \n :\n \n
\n );\n }\n\n return (\n \n
\n
\n \n \n \n\n

\n {lang(`lng_month${currentMonth + 1}`)}\n {' '}\n {currentYear}\n

\n\n \n \n \n\n \n \n \n
\n
\n\n
\n
\n {WEEKDAY_LETTERS.map((day) => (\n
\n {lang(day)}\n
\n ))}\n {prevMonthGrid.map((gridDate) => (\n
{gridDate}
\n ))}\n {currentMonthGrid.map((gridDate) => (\n handleDateSelect(gridDate)}\n className={buildClassName(\n 'day-button',\n isDisabledDay(\n currentYear, currentMonth, gridDate, minDate, maxDate,\n )\n ? 'disabled'\n : `${gridDate ? 'clickable' : ''}`,\n selectedDay === formatDay(currentYear, currentMonth, gridDate) && 'selected',\n )}\n >\n {Boolean(gridDate) && (\n {gridDate}\n )}\n
\n ))}\n {nextMonthGrid.map((gridDate) => (\n
{gridDate}
\n ))}\n
\n \n\n {withTimePicker && renderTimePicker()}\n\n
\n \n {secondButtonLabel && (\n \n )}\n
\n \n );\n};\n\nfunction buildCalendarGrid(year: number, month: number) {\n const prevMonthGrid: number[] = [];\n const currentMonthGrid: number[] = [];\n const nextMonthGrid: number[] = [];\n\n const date = new Date();\n date.setDate(1);\n date.setMonth(month);\n date.setFullYear(year);\n const firstDay = date.getDay();\n const totalDaysInPrevMonth = new Date(year, month, 0).getDate();\n\n for (let i = 1; i < firstDay; i++) {\n prevMonthGrid.push(totalDaysInPrevMonth - firstDay + i + 1);\n }\n\n while (date.getMonth() === month) {\n const gridDate = date.getDate();\n currentMonthGrid.push(gridDate);\n date.setDate(gridDate + 1);\n }\n\n const lastRowDaysCount = (currentMonthGrid.length + prevMonthGrid.length) % 7;\n if (lastRowDaysCount > 0) {\n for (let i = 1; i <= 7 - lastRowDaysCount; i++) {\n nextMonthGrid.push(i);\n }\n }\n\n return { prevMonthGrid, currentMonthGrid, nextMonthGrid };\n}\n\nfunction isDisabledDay(year: number, month: number, day: number, minDate?: Date, maxDate?: Date) {\n const selectedDay = new Date(year, month, day);\n const fixedMinDate = minDate && getDayStart(minDate);\n const fixedMaxDate = maxDate && getDayStart(maxDate);\n\n if (fixedMaxDate && selectedDay > fixedMaxDate) {\n return true;\n } else if (fixedMinDate && selectedDay < fixedMinDate) {\n return true;\n }\n\n return false;\n}\n\nfunction formatInputTime(value: string | number) {\n return String(value).padStart(2, '0');\n}\n\nfunction formatDay(year: number, month: number, day: number) {\n return `${year}-${month + 1}-${day}`;\n}\n\nfunction formatSubmitLabel(lang: LangFn, date: Date) {\n const day = formatDateToString(date, lang.code);\n const today = formatDateToString(new Date(), lang.code);\n\n if (day === today) {\n return lang('Conversation.ScheduleMessage.SendToday', formatTime(lang, date));\n }\n\n return lang('Conversation.ScheduleMessage.SendOn', [day, formatTime(lang, date)]);\n}\n\nexport default memo(CalendarModal);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport useLang from '../../hooks/useLang';\n\nimport CalendarModal from '../common/CalendarModal';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n selectedAt?: number;\n};\n\nconst HistoryCalendar: FC = ({\n isOpen, selectedAt,\n}) => {\n const { searchMessagesByDate, closeHistoryCalendar } = getDispatch();\n\n const handleJumpToDate = useCallback((date: Date) => {\n searchMessagesByDate({ timestamp: date.valueOf() / 1000 });\n closeHistoryCalendar();\n }, [closeHistoryCalendar, searchMessagesByDate]);\n\n const lang = useLang();\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return { selectedAt: global.historyCalendarSelectedAt };\n },\n)(HistoryCalendar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { IAlbum } from '../../types';\n\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectUser,\n} from '../../modules/selectors';\nimport {\n isUserId,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n message: ApiMessage;\n album?: IAlbum;\n onClose: () => void;\n};\n\ntype StateProps = {\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\nconst DeleteMessageModal: FC = ({\n isOpen,\n isSchedule,\n message,\n album,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n}) => {\n const {\n deleteMessages,\n deleteScheduledMessages,\n } = getDispatch();\n\n const handleDeleteMessageForAll = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n deleteMessages({ messageIds, shouldDeleteForAll: true });\n onClose();\n }, [deleteMessages, message.id, onClose, album]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n if (isSchedule) {\n deleteScheduledMessages({ messageIds });\n } else {\n deleteMessages({\n messageIds,\n shouldDeleteForAll: false,\n });\n }\n onClose();\n }, [album, message.id, isSchedule, onClose, deleteScheduledMessages, deleteMessages]);\n\n const lang = useLang();\n\n return (\n \n

{lang('AreYouSureDeleteSingleMessage')}

\n {willDeleteForCurrentUserOnly && (\n

{lang('lng_delete_for_me_chat_hint', 1, 'i')}

\n )}\n {willDeleteForAll && (\n

{lang('lng_delete_for_everyone_hint', 1, 'i')}

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { message, isSchedule }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const { canDeleteForAll } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const chat = selectChat(global, message.chatId);\n const contactName = chat && isUserId(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n)(DeleteMessageModal));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isUserId,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId: string;\n messageId: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isPrivateChat: boolean;\n isChatWithSelf: boolean;\n isGroup: boolean;\n isSuperGroup: boolean;\n canPinForAll: boolean;\n contactName?: string;\n};\n\nconst PinMessageModal: FC = ({\n isOpen,\n messageId,\n chatId,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n onClose,\n}) => {\n const { pinMessage } = getDispatch();\n\n const handlePinMessageForAll = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false,\n });\n onClose();\n }, [pinMessage, chatId, messageId, onClose]);\n\n const handlePinMessage = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false, isOneSide: true, isSilent: true,\n });\n onClose();\n }, [chatId, messageId, onClose, pinMessage]);\n\n const lang = useLang();\n\n function renderMessage() {\n if (isChannel) {\n return lang('PinMessageAlertChannel');\n }\n\n if (isGroup || isSuperGroup) {\n return lang('PinMessageAlert');\n }\n\n return lang('PinMessageAlertChat');\n }\n\n return (\n \n

{renderMessage()}

\n \n {canPinForAll && (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const isPrivateChat = isUserId(chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const chat = selectChat(global, chatId);\n const isChannel = Boolean(chat) && isChatChannel(chat);\n const isGroup = Boolean(chat) && isChatBasicGroup(chat);\n const isSuperGroup = Boolean(chat) && isChatSuperGroup(chat);\n const canPinForAll = (isPrivateChat && !isChatWithSelf) || isSuperGroup || isGroup;\n const contactName = chat && isUserId(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n };\n },\n)(PinMessageModal));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId?: string;\n pinnedMessagesCount?: number;\n onClose: () => void;\n onUnpin: () => void;\n};\n\nconst UnpinAllMessagesModal: FC = ({\n isOpen,\n pinnedMessagesCount = 0,\n onClose,\n onUnpin,\n}) => {\n const lang = useLang();\n\n return (\n \n

{lang('Chat.UnpinAllMessagesConfirmation', pinnedMessagesCount, 'i')}

\n \n \n \n );\n};\n\nexport default memo(UnpinAllMessagesModal);\n","import { useEffect } from '../../../lib/teact/teact';\nimport { IS_MAC_OS } from '../../../util/environment';\nimport getKeyFromEvent from '../../../util/getKeyFromEvent';\n\nconst useCopySelectedMessages = (isActive: boolean, copySelectedMessages: NoneToVoidFunction) => {\n useEffect(() => {\n function handleCopy(e: KeyboardEvent) {\n if (((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && getKeyFromEvent(e) === 'c') {\n e.preventDefault();\n copySelectedMessages();\n }\n }\n\n if (isActive) {\n document.addEventListener('keydown', handleCopy, false);\n }\n\n return () => {\n document.removeEventListener('keydown', handleCopy, false);\n };\n }, [copySelectedMessages, isActive]);\n};\n\nexport default useCopySelectedMessages;\n","import React, {\n FC, useCallback, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';\nimport {\n isUserId,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n selectedMessageIds?: number[];\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\nconst DeleteSelectedMessageModal: FC = ({\n isOpen,\n isSchedule,\n selectedMessageIds,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n}) => {\n const {\n deleteMessages,\n deleteScheduledMessages,\n exitMessageSelectMode,\n } = getDispatch();\n\n const prevIsOpen = usePrevious(isOpen);\n\n const handleDeleteMessageForAll = useCallback(() => {\n onClose();\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: true });\n }, [deleteMessages, selectedMessageIds, onClose]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n if (isSchedule) {\n deleteScheduledMessages({ messageIds: selectedMessageIds });\n } else {\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: false });\n }\n\n onClose();\n }, [isSchedule, onClose, deleteScheduledMessages, selectedMessageIds, deleteMessages]);\n\n const lang = useLang();\n\n // Returning `undefined` from FC instead of `` doesn't trigger useHistoryBack\n useEffect(() => {\n if (!isOpen && prevIsOpen) {\n exitMessageSelectMode();\n }\n }, [exitMessageSelectMode, isOpen, prevIsOpen]);\n\n if (!selectedMessageIds) {\n return undefined;\n }\n\n return (\n \n

{lang('AreYouSureDeleteFewMessages')}

\n {willDeleteForCurrentUserOnly && (\n

This will delete them just for you, not for other participants in the chat.

\n )}\n {willDeleteForAll && (\n

This will delete them for everyone in this chat.

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { isSchedule }): StateProps => {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { canDeleteForAll } = selectCanDeleteSelectedMessages(global);\n const chat = selectCurrentChat(global);\n const contactName = chat && isUserId(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n selectedMessageIds,\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n)(DeleteSelectedMessageModal));\n","import { ChangeEvent } from 'react';\n\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ApiReportReason } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport RadioGroup from '../ui/RadioGroup';\nimport InputText from '../ui/InputText';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageIds?: number[];\n onClose: () => void;\n};\n\nconst ReportMessageModal: FC = ({\n isOpen,\n messageIds,\n onClose,\n}) => {\n const {\n reportMessages,\n exitMessageSelectMode,\n } = getDispatch();\n\n const [selectedReason, setSelectedReason] = useState('spam');\n const [description, setDescription] = useState('');\n\n const handleReport = () => {\n reportMessages({ messageIds, reason: selectedReason, description });\n exitMessageSelectMode();\n onClose();\n };\n\n const handleSelectReason = useCallback((value: string) => {\n setSelectedReason(value as ApiReportReason);\n }, []);\n\n const handleDescriptionChange = useCallback((e: ChangeEvent) => {\n setDescription(e.target.value);\n }, []);\n\n const lang = useLang();\n\n const REPORT_OPTIONS: { value: ApiReportReason; label: string }[] = [\n { value: 'spam', label: lang('lng_report_reason_spam') },\n { value: 'violence', label: lang('lng_report_reason_violence') },\n { value: 'pornography', label: lang('lng_report_reason_pornography') },\n { value: 'childAbuse', label: lang('lng_report_reason_child_abuse') },\n { value: 'copyright', label: lang('ReportPeer.ReasonCopyright') },\n { value: 'other', label: lang('lng_report_reason_other') },\n ];\n\n if (!messageIds) {\n return undefined;\n }\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default memo(ReportMessageModal);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { MessageListType } from '../../global/types';\n\nimport {\n selectCanDeleteSelectedMessages,\n selectCanDownloadSelectedMessages,\n selectCanReportSelectedMessages,\n selectCurrentMessageList,\n selectHasProtectedMessage,\n selectSelectedMessagesCount,\n} from '../../modules/selectors';\nimport useFlag from '../../hooks/useFlag';\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\nimport useCopySelectedMessages from './hooks/useCopySelectedMessages';\n\nimport Button from '../ui/Button';\n\nimport DeleteSelectedMessageModal from './DeleteSelectedMessageModal';\nimport ReportMessageModal from '../common/ReportMessageModal';\n\nimport './MessageSelectToolbar.scss';\n\nexport type OwnProps = {\n isActive?: boolean;\n canPost?: boolean;\n messageListType?: MessageListType;\n};\n\ntype StateProps = {\n isSchedule: boolean;\n selectedMessagesCount?: number;\n canDeleteMessages?: boolean;\n canReportMessages?: boolean;\n canDownloadMessages?: boolean;\n hasProtectedMessage?: boolean;\n selectedMessageIds?: number[];\n};\n\nconst MessageSelectToolbar: FC = ({\n canPost,\n isActive,\n messageListType,\n isSchedule,\n selectedMessagesCount,\n canDeleteMessages,\n canReportMessages,\n canDownloadMessages,\n hasProtectedMessage,\n selectedMessageIds,\n}) => {\n const {\n exitMessageSelectMode,\n openForwardMenuForSelectedMessages,\n downloadSelectedMessages,\n copySelectedMessages,\n } = getDispatch();\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();\n\n useCopySelectedMessages(Boolean(isActive), copySelectedMessages);\n useEffect(() => {\n return isActive && !isDeleteModalOpen && !isReportModalOpen\n ? captureKeyboardListeners({\n onBackspace: openDeleteModal,\n onDelete: openDeleteModal,\n onEsc: exitMessageSelectMode,\n })\n : undefined;\n }, [isActive, isDeleteModalOpen, isReportModalOpen, openDeleteModal, exitMessageSelectMode]);\n\n const handleCopy = useCallback(() => {\n copySelectedMessages();\n exitMessageSelectMode();\n }, [copySelectedMessages, exitMessageSelectMode]);\n\n const handleDownload = useCallback(() => {\n downloadSelectedMessages();\n exitMessageSelectMode();\n }, [downloadSelectedMessages, exitMessageSelectMode]);\n\n const prevSelectedMessagesCount = usePrevious(selectedMessagesCount || undefined, true);\n const renderingSelectedMessagesCount = isActive ? selectedMessagesCount : prevSelectedMessagesCount;\n\n const lang = useLang();\n\n const formattedMessagesCount = lang('VoiceOver.Chat.MessagesSelected', renderingSelectedMessagesCount, 'i');\n\n const className = buildClassName(\n 'MessageSelectToolbar',\n canPost && 'with-composer',\n isActive && 'shown',\n );\n\n const renderButton = (\n icon: string, label: string, onClick: AnyToVoidFunction, disabled?: boolean, destructive?: boolean,\n ) => {\n return (\n \n \n \n );\n };\n\n return (\n
\n
\n \n \n \n \n {formattedMessagesCount}\n \n\n {Boolean(selectedMessagesCount) && (\n
\n {messageListType !== 'scheduled' && (\n renderButton(\n 'forward', lang('Chat.ForwardActionHeader'), openForwardMenuForSelectedMessages, hasProtectedMessage,\n )\n )}\n {canReportMessages && (\n renderButton('flag', lang('Conversation.ReportMessages'), openReportModal)\n )}\n {canDownloadMessages && (\n renderButton('download', lang('lng_media_download'), handleDownload, hasProtectedMessage)\n )}\n {renderButton('copy', lang('lng_context_copy_selected_items'), handleCopy, hasProtectedMessage)}\n {renderButton('delete', lang('EditAdminGroupDeleteMessages'), openDeleteModal, !canDeleteMessages, true)}\n
\n )}\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { type: messageListType, chatId } = selectCurrentMessageList(global) || {};\n const { canDelete } = selectCanDeleteSelectedMessages(global);\n const canReport = selectCanReportSelectedMessages(global);\n const canDownload = selectCanDownloadSelectedMessages(global);\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const hasProtectedMessage = chatId ? selectHasProtectedMessage(global, chatId, selectedMessageIds) : false;\n\n return {\n isSchedule: messageListType === 'scheduled',\n selectedMessagesCount: selectSelectedMessagesCount(global),\n canDeleteMessages: canDelete,\n canReportMessages: canReport,\n canDownloadMessages: canDownload,\n selectedMessageIds,\n hasProtectedMessage,\n };\n },\n)(MessageSelectToolbar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport useLang from '../../hooks/useLang';\nimport { selectChatMessage } from '../../modules/selectors';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport PrivateChatInfo from './PrivateChatInfo';\nimport ListItem from '../ui/ListItem';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\nexport type StateProps = {\n memberIds?: string[];\n};\n\nconst CLOSE_ANIMATION_DURATION = 100;\n\nconst SeenByModal: FC = ({\n isOpen,\n memberIds,\n}) => {\n const {\n openChat,\n closeSeenByModal,\n } = getDispatch();\n\n const lang = useLang();\n\n const handleClick = useCallback((userId: string) => {\n closeSeenByModal();\n\n setTimeout(() => {\n openChat({ id: userId });\n }, CLOSE_ANIMATION_DURATION);\n }, [closeSeenByModal, openChat]);\n\n const renderingMemberIds = useCurrentOrPrev(memberIds, true);\n\n return (\n \n
\n {renderingMemberIds && renderingMemberIds.map((userId) => (\n handleClick(userId)}\n >\n \n \n ))}\n
\n \n {lang('Close')}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, messageId } = global.seenByModal || {};\n if (!chatId || !messageId) {\n return {};\n }\n\n return {\n memberIds: selectChatMessage(global, chatId, messageId)?.seenByUserIds,\n };\n },\n)(SeenByModal));\n","import React, {\n FC, useCallback, memo, useMemo, useEffect, useState, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport useLang from '../../hooks/useLang';\nimport { selectChatMessage } from '../../modules/selectors';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport { getUserFullName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport { unique } from '../../util/iteratees';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Avatar from '../common/Avatar';\nimport ListItem from '../ui/ListItem';\nimport ReactionStaticEmoji from '../common/ReactionStaticEmoji';\nimport Loading from '../ui/Loading';\n\nimport './ReactorListModal.scss';\n\nconst MIN_REACTIONS_COUNT_FOR_FILTERS = 10;\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\nexport type StateProps = Pick & {\n chatId?: string;\n messageId?: number;\n};\n\nconst ReactorListModal: FC = ({\n isOpen,\n reactors,\n reactions,\n chatId,\n messageId,\n seenByUserIds,\n}) => {\n const {\n loadReactors,\n closeReactorListModal,\n openChat,\n } = getDispatch();\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n const lang = useLang();\n const [isClosing, startClosing, stopClosing] = useFlag(false);\n const [chosenTab, setChosenTab] = useState(undefined);\n const canShowFilters = reactors && reactions && reactors.count >= MIN_REACTIONS_COUNT_FOR_FILTERS\n && reactions.results.length > 1;\n const chatIdRef = useRef();\n\n useEffect(() => {\n if (isClosing && !isOpen) {\n stopClosing();\n setChosenTab(undefined);\n }\n }, [isClosing, isOpen, stopClosing]);\n\n const handleCloseAnimationEnd = useCallback(() => {\n if (chatIdRef.current) {\n openChat({ id: chatIdRef.current });\n }\n closeReactorListModal();\n }, [closeReactorListModal, openChat]);\n\n const handleClose = useCallback(() => {\n startClosing();\n }, [startClosing]);\n\n const handleClick = useCallback((userId: string) => {\n chatIdRef.current = userId;\n handleClose();\n }, [handleClose]);\n\n const handleLoadMore = useCallback(() => {\n loadReactors({\n chatId,\n messageId,\n });\n }, [chatId, loadReactors, messageId]);\n\n const allReactions = useMemo(() => {\n return reactors?.reactions ? unique(reactors.reactions.map((l) => l.reaction)) : [];\n }, [reactors?.reactions]);\n\n const userIds = useMemo(() => {\n if (chosenTab) {\n return reactors?.reactions.filter((l) => l.reaction === chosenTab).map((l) => l.userId);\n }\n return unique(reactors?.reactions.map((l) => l.userId).concat(seenByUserIds || []) || []);\n }, [chosenTab, reactors?.reactions, seenByUserIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n handleLoadMore, userIds, reactors && reactors.nextOffset === undefined,\n );\n\n useEffect(() => {\n getMore?.({ direction: LoadMoreDirection.Backwards });\n }, [getMore]);\n\n return (\n \n {canShowFilters && (\n
\n setChosenTab(undefined)}\n >\n \n {reactors?.count && formatIntegerCompact(reactors.count)}\n \n {allReactions.map((reaction) => {\n const count = reactions?.results.find((l) => l.reaction === reaction)?.count;\n return (\n setChosenTab(reaction)}\n >\n \n {count && formatIntegerCompact(count)}\n \n );\n })}\n
\n )}\n\n
\n {viewportIds?.length ? (\n \n {viewportIds?.map(\n (userId) => {\n const user = usersById[userId];\n const fullName = getUserFullName(user);\n const reaction = reactors?.reactions.find((l) => l.userId === userId)?.reaction;\n return (\n handleClick(userId)}\n >\n \n
\n

{fullName && renderText(fullName)}

\n
\n {reaction && }\n \n );\n },\n )}\n \n ) : }\n
\n \n {lang('Close')}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, messageId } = global.reactorModal || {};\n const message = chatId && messageId ? selectChatMessage(global, chatId, messageId) : undefined;\n\n return {\n chatId,\n messageId,\n reactions: message?.reactions,\n reactors: message?.reactors,\n seenByUserIds: message?.seenByUserIds,\n };\n },\n)(ReactorListModal));\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ActiveEmojiInteraction } from '../../global/types';\nimport { ApiMediaFormat } from '../../api/types';\n\nimport { IS_ANDROID } from '../../util/environment';\nimport useFlag from '../../hooks/useFlag';\nimport useMedia from '../../hooks/useMedia';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectAnimatedEmojiEffect,\n} from '../../modules/selectors';\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from '../common/helpers/animatedAssets';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\n\nimport AnimatedSticker from '../common/AnimatedSticker';\n\nimport './EmojiInteractionAnimation.scss';\n\nexport type OwnProps = {\n activeEmojiInteraction: ActiveEmojiInteraction;\n};\n\ntype StateProps = {\n effectAnimationId?: string;\n localEffectAnimation?: string;\n};\n\nconst HIDE_ANIMATION_DURATION = 250;\nconst PLAYING_DURATION = 3000;\nconst EFFECT_SIZE = 240;\n\nconst EmojiInteractionAnimation: FC = ({\n effectAnimationId,\n localEffectAnimation,\n activeEmojiInteraction,\n}) => {\n const { stopActiveEmojiInteraction } = getDispatch();\n\n const [isHiding, startHiding] = useFlag(false);\n const [isPlaying, startPlaying] = useFlag(false);\n const timeoutRef = useRef();\n\n const stop = useCallback(() => {\n startHiding();\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n setTimeout(() => {\n stopActiveEmojiInteraction({ id: activeEmojiInteraction.id });\n }, HIDE_ANIMATION_DURATION);\n }, [activeEmojiInteraction.id, startHiding, stopActiveEmojiInteraction]);\n\n const handleCancelAnimation = useCallback((e: UIEvent) => {\n if (!(e.target as HTMLElement)?.closest('.AnimatedEmoji')) {\n stop();\n }\n }, [stop]);\n\n useEffect(() => {\n document.addEventListener('touchstart', handleCancelAnimation);\n document.addEventListener('touchmove', handleCancelAnimation);\n document.addEventListener('mousedown', handleCancelAnimation);\n document.addEventListener('wheel', handleCancelAnimation);\n\n return () => {\n document.removeEventListener('touchstart', handleCancelAnimation);\n document.removeEventListener('touchmove', handleCancelAnimation);\n document.removeEventListener('mousedown', handleCancelAnimation);\n document.removeEventListener('wheel', handleCancelAnimation);\n };\n }, [handleCancelAnimation]);\n\n useLayoutEffect(() => {\n const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n timeoutRef.current = setTimeout(() => {\n stop();\n dispatchHeavyAnimationStop();\n }, PLAYING_DURATION);\n }, [stop]);\n\n const effectAnimationData = useMedia(`sticker${effectAnimationId}`, !effectAnimationId, ApiMediaFormat.Lottie);\n\n const [localEffectAnimationData, setLocalEffectAnimationData] = useState();\n useEffect(() => {\n if (localEffectAnimation) {\n getAnimationData(localEffectAnimation as keyof typeof ANIMATED_STICKERS_PATHS).then((data) => {\n setLocalEffectAnimationData(data);\n });\n }\n }, [localEffectAnimation]);\n\n if (!activeEmojiInteraction.startSize) {\n return undefined;\n }\n\n const scale = (activeEmojiInteraction.startSize || 0) / EFFECT_SIZE;\n\n return (\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { activeEmojiInteraction }): StateProps => {\n const animatedEffect = activeEmojiInteraction.animatedEffect !== undefined\n && selectAnimatedEmojiEffect(global, activeEmojiInteraction.animatedEffect);\n return {\n effectAnimationId: animatedEffect ? animatedEffect.id : undefined,\n localEffectAnimation: !animatedEffect && activeEmojiInteraction.animatedEffect\n && Object.keys(ANIMATED_STICKERS_PATHS).includes(activeEmojiInteraction.animatedEffect)\n ? activeEmojiInteraction.animatedEffect : undefined,\n };\n },\n)(EmojiInteractionAnimation));\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nconst useSendWithEnter = (\n onSelect: NoneToVoidFunction,\n) => {\n // eslint-disable-next-line no-null/no-null\n const buttonRef = useRef(null);\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n const isFocused = buttonRef.current === document.activeElement;\n\n if (isFocused) {\n onSelect();\n }\n }, [onSelect]);\n\n useEffect(() => {\n window.addEventListener('keydown', handleKeyDown, false);\n\n return () => window.removeEventListener('keydown', handleKeyDown, false);\n }, [handleKeyDown]);\n\n return buttonRef;\n};\n\nexport default useSendWithEnter;\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport { isUserId, getPrivateChatUserId, selectIsChatMuted } from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectIsChatPinned, selectNotifySettings, selectNotifyExceptions,\n} from '../../../modules/selectors';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\nimport ChatFolderModal from '../ChatFolderModal.async';\n\ntype OwnProps = {\n chatId: string;\n withUsername?: boolean;\n onClick: (id: string) => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n user?: ApiUser;\n isPinned?: boolean;\n isMuted?: boolean;\n canChangeFolder?: boolean;\n};\n\nconst LeftSearchResultChat: FC = ({\n chatId,\n withUsername,\n onClick,\n chat,\n user,\n isPinned,\n isMuted,\n canChangeFolder,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isChatFolderModalOpen, openChatFolderModal, closeChatFolderModal] = useFlag();\n\n const contextActions = useChatContextActions({\n chat,\n user,\n isPinned,\n isMuted,\n canChangeFolder,\n handleDelete: openDeleteModal,\n handleChatFolderChange: openChatFolderModal,\n }, true);\n\n const handleClick = () => {\n onClick(chatId);\n };\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n {isUserId(chatId) ? (\n \n ) : (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const privateChatUserId = chat && getPrivateChatUserId(chat);\n const user = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n const isPinned = selectIsChatPinned(global, chatId);\n const isMuted = chat\n ? selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global))\n : undefined;\n\n return {\n chat,\n user,\n isPinned,\n isMuted,\n canChangeFolder: Boolean(global.chatFolders.orderedIds?.length),\n };\n },\n)(LeftSearchResultChat));\n","import React, {\n FC, useEffect, useCallback, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport { getUserFirstOrLastName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport { throttle } from '../../../util/schedulers';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport LeftSearchResultChat from './LeftSearchResultChat';\n\nimport './RecentContacts.scss';\n\ntype OwnProps = {\n onReset: () => void;\n};\n\ntype StateProps = {\n topUserIds?: string[];\n usersById: Record;\n recentlyFoundChatIds?: string[];\n};\n\nconst SEARCH_CLOSE_TIMEOUT_MS = 250;\nconst NBSP = '\\u00A0';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst RecentContacts: FC = ({\n topUserIds, usersById, recentlyFoundChatIds,\n onReset,\n}) => {\n const {\n loadTopUsers, loadContactList, openChat,\n addRecentlyFoundChatId, clearRecentlyFoundChats,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const topUsersRef = useRef(null);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadTopUsers();\n // Loading full contact list for quick local search before user enters the query\n loadContactList();\n });\n }, [loadTopUsers, loadContactList]);\n\n useHorizontalScroll(topUsersRef.current, !topUserIds);\n\n const handleClick = useCallback((id: string) => {\n openChat({ id, shouldReplaceHistory: true });\n onReset();\n setTimeout(() => {\n addRecentlyFoundChatId({ id });\n }, SEARCH_CLOSE_TIMEOUT_MS);\n }, [openChat, addRecentlyFoundChatId, onReset]);\n\n const lang = useLang();\n\n return (\n
\n {topUserIds && (\n
\n
\n {topUserIds.map((userId) => (\n
handleClick(userId)} dir={lang.isRtl ? 'rtl' : undefined}>\n \n
{renderText(getUserFirstOrLastName(usersById[userId]) || NBSP)}
\n
\n ))}\n
\n
\n )}\n {recentlyFoundChatIds && (\n
\n

\n {lang('Recent')}\n\n \n \n \n

\n {recentlyFoundChatIds.map((id) => (\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: topUserIds } = global.topPeers;\n const usersById = global.users.byId;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n return {\n topUserIds,\n usersById,\n recentlyFoundChatIds,\n };\n },\n)(RecentContacts));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus,\n} from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n getPrivateChatUserId,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport renderText from '../../common/helpers/renderText';\nimport useMedia from '../../../hooks/useMedia';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport ListItem from '../../ui/ListItem';\nimport Link from '../../ui/Link';\n\nimport './ChatMessage.scss';\n\ntype OwnProps = {\n searchQuery?: string;\n message: ApiMessage;\n chatId: string;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n lastSyncTime?: number;\n};\n\nconst ChatMessage: FC = ({\n message,\n searchQuery,\n chatId,\n chat,\n privateChatUser,\n lastSyncTime,\n}) => {\n const { focusMessage } = getDispatch();\n\n const mediaThumbnail = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'micro'));\n const isRoundVideo = Boolean(getMessageRoundVideo(message));\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId, messageId: message.id });\n }, [chatId, focusMessage, message.id]);\n\n const lang = useLang();\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n \n
\n
\n
\n

{renderText(getChatTitle(lang, chat, privateChatUser))}

\n {chat.isVerified && }\n
\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n\n
\n
\n
\n {renderSummary(lang, message, mediaBlobUrl || mediaThumbnail, searchQuery, isRoundVideo)}\n
\n
\n
\n \n );\n};\n\nfunction renderSummary(\n lang: LangFn, message: ApiMessage, blobUrl?: string, searchQuery?: string, isRoundVideo?: boolean,\n) {\n if (!blobUrl) {\n return renderMessageSummary(lang, message, undefined, searchQuery);\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderMessageSummary(lang, message, true, searchQuery)}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const privateChatUserId = getPrivateChatUserId(chat);\n\n return {\n chat,\n lastSyncTime: global.lastSyncTime,\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n };\n },\n)(ChatMessage));\n","import React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { formatDateToString } from '../../../util/dateFormat';\n\nimport './DateSuggest.scss';\n\nconst SUGGESTION_COUNT = 8;\n\nexport type OwnProps = {\n searchDate: string;\n onSelect: (value: Date) => void;\n};\n\nconst DateSuggest: FC = ({\n searchDate, onSelect,\n}) => {\n const suggestions = useMemo(() => getSuggestionsFromDate(searchDate), [searchDate]);\n return (\n
\n {suggestions.map(({ date, text }) => {\n return (\n onSelect(date)}\n className=\"date-item\"\n key={text}\n >\n \n {text}\n \n );\n })}\n
\n );\n};\n\nfunction getSuggestionsFromDate(searchDate: string) {\n const hasYear = searchDate.match(/^\\d{2,4}-\\d{2}-\\d{2}$/g);\n if (hasYear) {\n const date = new Date(searchDate);\n return [{ date, text: formatDateToString(date) }];\n }\n\n const suggestion = [];\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n const latestYear = currentDate.getTime() > (new Date(`${currentYear}-${searchDate}`)).getTime()\n ? currentYear\n : currentYear - 1;\n\n for (let i = 0; i < SUGGESTION_COUNT; i++) {\n const date = new Date(`${latestYear - i}-${searchDate}`);\n suggestion.push({ date, text: formatDateToString(date) });\n }\n\n return suggestion;\n}\n\nexport default memo(DateSuggest);\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { unique } from '../../../util/iteratees';\nimport {\n sortChatIds,\n filterUsersByName,\n} from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport LeftSearchResultChat from './LeftSearchResultChat';\nimport RecentContacts from './RecentContacts';\nimport ChatMessage from './ChatMessage';\nimport DateSuggest from './DateSuggest';\nimport Link from '../../ui/Link';\nimport NothingFound from '../../common/NothingFound';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n searchDate?: number;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: string;\n localContactIds?: string[];\n localChatIds?: string[];\n localUserIds?: string[];\n globalChatIds?: string[];\n globalUserIds?: string[];\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\nconst MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH = 4;\nconst LESS_LIST_ITEMS_AMOUNT = 5;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatResults: FC = ({\n searchQuery, searchDate, dateSearchQuery, currentUserId,\n localContactIds, localChatIds, localUserIds, globalChatIds, globalUserIds,\n foundIds, globalMessagesByChatId, chatsById, fetchingStatus, lastSyncTime,\n onReset, onSearchDateSelect,\n}) => {\n const {\n openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,\n } = getDispatch();\n\n const lang = useLang();\n\n const [shouldShowMoreLocal, setShouldShowMoreLocal] = useState(false);\n const [shouldShowMoreGlobal, setShouldShowMoreGlobal] = useState(false);\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const handleChatClick = useCallback(\n (id: string) => {\n openChat({ id, shouldReplaceHistory: true });\n\n if (id !== currentUserId) {\n addRecentlyFoundChatId({ id });\n }\n\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n onReset();\n }\n },\n [currentUserId, openChat, addRecentlyFoundChatId, onReset],\n );\n\n const handlePickerItemClick = useCallback((id: string) => {\n setGlobalSearchChatId({ id });\n }, [setGlobalSearchChatId]);\n\n const localResults = useMemo(() => {\n if (!searchQuery || (searchQuery.startsWith('@') && searchQuery.length < 2)) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const contactIdsWithMe = [\n ...(currentUserId ? [currentUserId] : []),\n ...(localContactIds || []),\n ];\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const foundContactIds = filterUsersByName(\n contactIdsWithMe, usersById, searchQuery, currentUserId, lang('SavedMessages'),\n );\n\n return [\n ...sortChatIds(unique([\n ...(foundContactIds || []),\n ...(localChatIds || []),\n ...(localUserIds || []),\n ]), chatsById, undefined, currentUserId ? [currentUserId] : undefined),\n ];\n }, [searchQuery, currentUserId, localContactIds, lang, localChatIds, localUserIds, chatsById]);\n\n const globalResults = useMemo(() => {\n if (!searchQuery || searchQuery.length < MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH || !globalChatIds || !globalUserIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return sortChatIds(\n unique([...globalChatIds, ...globalUserIds]),\n chatsById,\n true,\n );\n }, [chatsById, globalChatIds, globalUserIds, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if ((!searchQuery && !searchDate) || !foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId?.[chatId]?.byId[Number(messageId)];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId, searchQuery, searchDate]);\n\n const handleClickShowMoreLocal = useCallback(() => {\n setShouldShowMoreLocal(!shouldShowMoreLocal);\n }, [shouldShowMoreLocal]);\n\n const handleClickShowMoreGlobal = useCallback(() => {\n setShouldShowMoreGlobal(!shouldShowMoreGlobal);\n }, [shouldShowMoreGlobal]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = renderMessageSummary(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages\n && !localResults.length && !globalResults.length && !foundMessages.length;\n\n if (!searchQuery && !searchDate) {\n return ;\n }\n\n return (\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {Boolean(localResults.length) && (\n
\n {localResults.map((id) => (\n \n ))}\n
\n )}\n {Boolean(localResults.length) && (\n
\n

\n {localResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreLocal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionDialogs')}\n

\n {localResults.map((id, index) => {\n if (!shouldShowMoreLocal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {Boolean(globalResults.length) && (\n
\n

\n {globalResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreGlobal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionGlobal')}\n

\n {globalResults.map((id, index) => {\n if (!shouldShowMoreGlobal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {Boolean(foundMessages.length) && (\n
\n

{lang('SearchMessages')}

\n {foundMessages.map(renderFoundMessage)}\n
\n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n\n const { userIds: localContactIds } = global.contactList || {};\n\n if (!localContactIds) {\n return {\n chatsById,\n };\n }\n\n const {\n currentUserId, messages, lastSyncTime,\n } = global;\n const {\n fetchingStatus, globalResults, localResults, resultsByType,\n } = global.globalSearch;\n const { chatIds: globalChatIds, userIds: globalUserIds } = globalResults || {};\n const { chatIds: localChatIds, userIds: localUserIds } = localResults || {};\n const { byChatId: globalMessagesByChatId } = messages;\n const foundIds = resultsByType?.text?.foundIds;\n\n return {\n currentUserId,\n localContactIds,\n localChatIds,\n localUserIds,\n globalChatIds,\n globalUserIds,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n)(ChatResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport NothingFound from '../../common/NothingFound';\nimport ChatMessage from './ChatMessage';\nimport DateSuggest from './DateSuggest';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: string;\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatMessageResults: FC = ({\n searchQuery,\n currentUserId,\n dateSearchQuery,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n onSearchDateSelect,\n}) => {\n const { searchMessagesGlobal } = getDispatch();\n\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n chatId: currentUserId,\n });\n });\n }\n }, [currentUserId, lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId?.[chatId]?.byId[Number(messageId)];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = renderMessageSummary(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages && !foundMessages.length;\n\n return (\n
\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {foundMessages.map(renderFoundMessage)}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n const { currentUserId, messages: { byChatId: globalMessagesByChatId }, lastSyncTime } = global;\n const { fetchingStatus, resultsByType } = global.globalSearch;\n\n const { foundIds } = (resultsByType?.text) || {};\n\n return {\n currentUserId,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n)(ChatMessageResults));\n","import { GlobalState } from '../../../../global/types';\nimport {\n ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser,\n} from '../../../../api/types';\nimport { ISettings } from '../../../../types';\n\nimport { selectChat, selectTheme } from '../../../../modules/selectors';\n\nexport type StateProps = {\n theme: ISettings['theme'];\n isLoading?: boolean;\n chatsById: Record;\n usersById: Record;\n globalMessagesByChatId?: Record }>;\n foundIds?: string[];\n lastSyncTime?: number;\n searchChatId?: string;\n activeDownloads: Record;\n isChatProtected?: boolean;\n};\n\nexport function createMapStateToProps(type: ApiGlobalMessageSearchType) {\n return (global: GlobalState, props: any) => {\n const { byId: chatsById } = global.chats;\n const { byId: usersById } = global.users;\n const {\n fetchingStatus, resultsByType, chatId,\n } = global.globalSearch;\n\n // One component is used for two different types of results.\n // The differences between them are only in the isVoice property.\n // The rest of the search results use their own personal components.\n const currentType = type !== 'audio' ? type : (props?.isVoice ? 'voice' : 'audio');\n\n const { byChatId: globalMessagesByChatId } = global.messages;\n const foundIds = resultsByType?.[currentType]?.foundIds;\n\n const activeDownloads = global.activeDownloads.byChatId;\n\n return {\n theme: selectTheme(global),\n isLoading: foundIds === undefined\n || (fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false),\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n searchChatId: chatId,\n activeDownloads,\n isChatProtected: chatId ? selectChat(global, chatId)?.isProtected : undefined,\n lastSyncTime: global.lastSyncTime,\n };\n };\n}\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { LoadMoreDirection, MediaViewerOrigin } from '../../../types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport buildClassName from '../../../util/buildClassName';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Media from '../../common/Media';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\nconst CURRENT_TYPE = 'media';\nconst INTERSECTION_THROTTLE = 500;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst MediaResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n isChatProtected,\n}) => {\n const {\n searchMessagesGlobal,\n openMediaViewer,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleSelectMedia = useCallback((messageId: number, chatId: string) => {\n openMediaViewer({\n chatId,\n messageId,\n origin: MediaViewerOrigin.SearchResult,\n });\n }, [openMediaViewer]);\n\n function renderGallery() {\n return (\n
\n {foundMessages.map((message) => (\n \n ))}\n
\n );\n }\n\n function renderSearchResult() {\n return foundMessages.map((message) => (\n \n ));\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n const isMediaGrid = canRenderContents && foundIds && foundIds.length > 0 && !searchQuery;\n const isMessageList = canRenderContents && foundIds && foundIds.length > 0 && searchQuery;\n\n const classNames = buildClassName(\n 'search-content custom-scroll',\n isMessageList && 'chat-list',\n );\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {isMediaGrid && renderGallery()}\n {isMessageList && renderSearchResult()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n)(MediaResults));\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport WebLink from '../../common/WebLink';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\nconst CURRENT_TYPE = 'links';\nconst INTERSECTION_THROTTLE = 500;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst LinkResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n isChatProtected,\n}) => {\n const {\n searchMessagesGlobal,\n focusMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: string) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n)(LinkResults));\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport { getMessageDocument } from '../../../modules/helpers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport Document from '../../common/Document';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\nconst CURRENT_TYPE = 'documents';\nconst INTERSECTION_THROTTLE = 500;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst FileResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n activeDownloads,\n lastSyncTime,\n}) => {\n const {\n searchMessagesGlobal,\n focusMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n const message = globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n\n return message && getMessageDocument(message) ? message : undefined;\n }).filter(Boolean) as ApiMessage[];\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: string) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

{formatMonthAndYear(lang, new Date(message.date * 1000))}

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n)(FileResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { AudioOrigin, LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Audio from '../../common/Audio';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n isVoice?: boolean;\n searchQuery?: string;\n};\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst AudioResults: FC = ({\n theme,\n isVoice,\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n activeDownloads,\n}) => {\n const {\n searchMessagesGlobal,\n focusMessage,\n openAudioPlayer,\n } = getDispatch();\n\n const lang = useLang();\n const currentType = isVoice ? 'voice' : 'audio';\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: currentType,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [currentType, lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: string) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n const handlePlayAudio = useCallback((messageId: number, chatId: string) => {\n openAudioPlayer({ chatId, messageId });\n }, [openAudioPlayer]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps('audio'),\n)(AudioResults));\n","import React, {\n FC, memo, useCallback, useState, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalSearchContent } from '../../../types';\n\nimport { parseDateString } from '../../../util/dateFormat';\nimport useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport TabList from '../../ui/TabList';\nimport Transition from '../../ui/Transition';\nimport ChatResults from './ChatResults';\nimport UserChatResults from './ChatMessageResults';\nimport MediaResults from './MediaResults';\nimport LinkResults from './LinkResults';\nimport FileResults from './FileResults';\nimport AudioResults from './AudioResults';\n\nimport './LeftSearch.scss';\n\nexport type OwnProps = {\n searchQuery?: string;\n searchDate?: number;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentContent?: GlobalSearchContent;\n chatId?: string;\n};\n\nconst TABS = [\n { type: GlobalSearchContent.ChatList, title: 'SearchAllChatsShort' },\n { type: GlobalSearchContent.Media, title: 'SharedMediaTab2' },\n { type: GlobalSearchContent.Links, title: 'SharedLinksTab2' },\n { type: GlobalSearchContent.Files, title: 'SharedFilesTab2' },\n { type: GlobalSearchContent.Music, title: 'SharedMusicTab2' },\n { type: GlobalSearchContent.Voice, title: 'SharedVoiceTab2' },\n];\n\nconst CHAT_TABS = [\n { type: GlobalSearchContent.ChatList, title: 'All Messages' },\n ...TABS.slice(1),\n];\n\nconst TRANSITION_RENDER_COUNT = Object.keys(GlobalSearchContent).length / 2;\n\nconst LeftSearch: FC = ({\n searchQuery,\n searchDate,\n isActive,\n currentContent = GlobalSearchContent.ChatList,\n chatId,\n onReset,\n}) => {\n const {\n setGlobalSearchContent,\n setGlobalSearchDate,\n } = getDispatch();\n\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(currentContent);\n const dateSearchQuery = useMemo(() => parseDateString(searchQuery), [searchQuery]);\n\n const handleSwitchTab = useCallback((index: number) => {\n const tab = TABS[index];\n setGlobalSearchContent({ content: tab.type });\n setActiveTab(index);\n }, [setGlobalSearchContent]);\n\n const handleSearchDateSelect = useCallback((value: Date) => {\n setGlobalSearchDate({ date: value.getTime() / 1000 });\n }, [setGlobalSearchDate]);\n\n useHistoryBack(isActive, onReset, undefined, undefined, true);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isActive, undefined, '.ListItem-button', true);\n\n return (\n
\n \n \n {(() => {\n switch (currentContent) {\n case GlobalSearchContent.ChatList:\n if (chatId) {\n return (\n \n );\n }\n return (\n \n );\n case GlobalSearchContent.Media:\n return ;\n case GlobalSearchContent.Links:\n return ;\n case GlobalSearchContent.Files:\n return ;\n case GlobalSearchContent.Music:\n return (\n \n );\n case GlobalSearchContent.Voice:\n return (\n \n );\n default:\n return undefined;\n }\n })()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentContent, chatId } = global.globalSearch;\n\n return { currentContent, chatId };\n },\n)(LeftSearch));\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\n\nexport type TwoFaActions = (\n 'setCurrentPassword' | 'setPassword' | 'setHint' | 'setEmail' | 'reset'\n);\nexport type TwoFaDispatch = Dispatch;\n\nexport type TwoFaState = {\n currentPassword: string;\n password: string;\n hint: string;\n email: string;\n};\n\nconst INITIAL_STATE: TwoFaState = {\n currentPassword: '',\n password: '',\n hint: '',\n email: '',\n};\n\nconst twoFaReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setCurrentPassword':\n return {\n ...state,\n currentPassword: action.payload,\n };\n\n case 'setPassword':\n return {\n ...state,\n password: action.payload,\n };\n\n case 'setHint':\n return {\n ...state,\n hint: action.payload,\n };\n\n case 'setEmail':\n return {\n ...state,\n email: action.payload,\n };\n\n case 'reset':\n return INITIAL_STATE;\n\n default:\n return state;\n }\n};\n\nconst useTwoFaReducer = () => {\n return useReducer(twoFaReducer, INITIAL_STATE);\n};\n\nexport default useTwoFaReducer;\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport useLang from '../../../hooks/useLang';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n currentScreen: SettingsScreens;\n editedFolderId?: number;\n onReset: () => void;\n onSaveFilter: () => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n};\n\nconst SettingsHeader: FC = ({\n currentScreen,\n editedFolderId,\n onReset,\n onSaveFilter,\n onScreenSelect,\n}) => {\n const {\n signOut,\n deleteChatFolder,\n } = getDispatch();\n\n const [isSignOutDialogOpen, setIsSignOutDialogOpen] = useState(false);\n const [isDeleteFolderDialogOpen, setIsDeleteFolderDialogOpen] = useState(false);\n\n const openSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(true);\n }, []);\n\n const closeSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(false);\n }, []);\n\n const openDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(true);\n }, []);\n\n const closeDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(false);\n }, []);\n\n const handleSignOutMessage = useCallback(() => {\n closeSignOutConfirmation();\n signOut();\n }, [closeSignOutConfirmation, signOut]);\n\n const handleDeleteFolderMessage = useCallback(() => {\n closeDeleteFolderConfirmation();\n deleteChatFolder({ id: editedFolderId });\n onReset();\n }, [editedFolderId, closeDeleteFolderConfirmation, deleteChatFolder, onReset]);\n\n const SettingsMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n const lang = useLang();\n\n function renderHeaderContent() {\n switch (currentScreen) {\n case SettingsScreens.EditProfile:\n return

{lang('lng_settings_information')}

;\n case SettingsScreens.General:\n return

{lang('General')}

;\n case SettingsScreens.QuickReaction:\n return

{lang('DoubleTapSetting')}

;\n case SettingsScreens.Notifications:\n return

{lang('Notifications')}

;\n case SettingsScreens.DataStorage:\n return

{lang('DataSettings')}

;\n case SettingsScreens.Privacy:\n return

{lang('PrivacySettings')}

;\n case SettingsScreens.Language:\n return

{lang('Language')}

;\n\n case SettingsScreens.GeneralChatBackground:\n return

{lang('ChatBackground')}

;\n case SettingsScreens.GeneralChatBackgroundColor:\n return

{lang('SetColor')}

;\n\n case SettingsScreens.PrivacyPhoneNumber:\n return

{lang('PrivacyPhone')}

;\n case SettingsScreens.PrivacyLastSeen:\n return

{lang('PrivacyLastSeen')}

;\n case SettingsScreens.PrivacyProfilePhoto:\n return

{lang('Privacy.ProfilePhoto')}

;\n case SettingsScreens.PrivacyForwarding:\n return

{lang('PrivacyForwards')}

;\n case SettingsScreens.PrivacyGroupChats:\n return

{lang('AutodownloadGroupChats')}

;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return

{lang('AlwaysShareWith')}

;\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return

{lang('NeverShareWith')}

;\n\n case SettingsScreens.PrivacyActiveSessions:\n return

{lang('SessionsTitle')}

;\n case SettingsScreens.PrivacyBlockedUsers:\n return

{lang('BlockedUsers')}

;\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n return

{lang('TwoStepVerification')}

;\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return

{lang('PleaseEnterCurrentPassword')}

;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return

{lang('PleaseReEnterPassword')}

;\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaChangePasswordHint:\n return

{lang('PasswordHint')}

;\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaRecoveryEmail:\n return

{lang('RecoveryEmailTitle')}

;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return

Recovery Email Code

;\n case SettingsScreens.TwoFaCongratulations:\n return

{lang('TwoStepVerificationPasswordSet')}

;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return

{lang('PleaseEnterCurrentPassword')}

;\n\n case SettingsScreens.Folders:\n return

{lang('Filters')}

;\n case SettingsScreens.FoldersCreateFolder:\n return

{lang('FilterNew')}

;\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n
\n

{lang('FilterEdit')}

\n\n {editedFolderId && (\n \n \n {lang('Delete')}\n \n \n )}\n
\n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n
\n {(currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersIncludedChatsFromChatList) ? (\n

{lang('FilterInclude')}

\n ) : (\n

{lang('FilterExclude')}

\n )}\n\n \n \n \n
\n );\n\n default:\n return (\n
\n

{lang('SETTINGS')}

\n\n onScreenSelect(SettingsScreens.EditProfile)}\n ariaLabel={lang('lng_settings_information')}\n >\n \n \n \n {lang('LogOutTitle')}\n \n
\n );\n }\n }\n\n return (\n
\n \n \n \n {renderHeaderContent()}\n \n \n
\n );\n};\n\nexport default memo(SettingsHeader);\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ProfileInfo from '../../common/ProfileInfo';\nimport ChatExtra from '../../common/ChatExtra';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUser?: ApiUser;\n lastSyncTime?: number;\n};\n\nconst SettingsMain: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentUser,\n lastSyncTime,\n}) => {\n const { loadProfilePhotos } = getDispatch();\n\n const lang = useLang();\n const profileId = currentUser?.id;\n\n useEffect(() => {\n if (profileId && lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [lastSyncTime, profileId, loadProfilePhotos]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Main);\n\n return (\n
\n
\n {currentUser && (\n \n )}\n {currentUser && (\n \n )}\n onScreenSelect(SettingsScreens.General)}\n >\n {lang('Telegram.GeneralSettingsViewController')}\n \n onScreenSelect(SettingsScreens.Notifications)}\n >\n {lang('Notifications')}\n \n onScreenSelect(SettingsScreens.Privacy)}\n >\n {lang('PrivacySettings')}\n \n onScreenSelect(SettingsScreens.DataStorage)}\n >\n {lang('DataSettings')}\n \n onScreenSelect(SettingsScreens.Folders)}\n >\n {lang('Filters')}\n \n onScreenSelect(SettingsScreens.Language)}\n >\n {lang('Language')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId, lastSyncTime } = global;\n\n return {\n currentUser: currentUserId ? selectUser(global, currentUserId) : undefined,\n lastSyncTime,\n };\n },\n)(SettingsMain));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\n\ntype OwnProps = {\n currentUsername?: string;\n asLink?: boolean;\n isLoading?: boolean;\n isUsernameAvailable?: boolean;\n checkUsername: AnyToVoidFunction;\n onChange: (value: string | false) => void;\n};\n\nconst MIN_USERNAME_LENGTH = 5;\nconst MAX_USERNAME_LENGTH = 32;\nconst LINK_PREFIX = 'https://t.me/';\nconst LINK_PREFIX_REGEX = /https:\\/\\/t\\.me\\/?/i;\nconst USERNAME_REGEX = /^([a-zA-Z0-9_]+)$/;\n\nconst runDebouncedForCheckUsername = debounce((cb) => cb(), 250, false);\n\nfunction isUsernameValid(username: string) {\n return username.length >= MIN_USERNAME_LENGTH\n && username.length <= MAX_USERNAME_LENGTH\n && USERNAME_REGEX.test(username);\n}\n\nconst SettingsEditProfile: FC = ({\n currentUsername,\n asLink,\n isLoading,\n isUsernameAvailable,\n checkUsername,\n onChange,\n}) => {\n const [username, setUsername] = useState(currentUsername || '');\n\n const lang = useLang();\n const langPrefix = asLink ? 'SetUrl' : 'Username';\n const label = asLink ? lang('SetUrlPlaceholder') : lang('Username');\n\n const [usernameSuccess, usernameError] = useMemo(() => {\n if (!username.length) {\n return [];\n }\n\n if (username.length < MIN_USERNAME_LENGTH) {\n return [undefined, `${label} is too short`];\n }\n if (username.length > MAX_USERNAME_LENGTH) {\n return [undefined, `${label} is too long`];\n }\n if (!USERNAME_REGEX.test(username)) {\n return [undefined, `${label} contains invalid characters`];\n }\n\n if (isUsernameAvailable === undefined) {\n return [];\n }\n\n // Variable `isUsernameAvailable` is initialized with `undefined`, so a strict false check is required\n return [\n isUsernameAvailable ? lang(`${langPrefix}Available`, 'Username') : undefined,\n isUsernameAvailable === false ? lang(`${langPrefix}InUse`) : undefined,\n ];\n }, [username, isUsernameAvailable, lang, langPrefix, label]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [asLink, currentUsername]);\n\n const handleUsernameChange = useCallback((e: ChangeEvent) => {\n const newUsername = e.target.value.trim().replace(LINK_PREFIX_REGEX, '');\n setUsername(newUsername);\n e.target.value = `${asLink ? LINK_PREFIX : ''}${newUsername}`;\n\n const isValid = isUsernameValid(newUsername);\n\n if (isValid) {\n runDebouncedForCheckUsername(() => {\n checkUsername({ username: newUsername });\n });\n }\n\n if (onChange) {\n onChange(isValid ? newUsername : false);\n }\n }, [asLink, checkUsername, onChange]);\n\n return (\n \n );\n};\n\nexport default memo(SettingsEditProfile);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../../api/types';\nimport { ProfileEditProgress, SettingsScreens } from '../../../types';\n\nimport { throttle } from '../../../util/schedulers';\nimport { selectUser } from '../../../modules/selectors';\nimport { getChatAvatarHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport InputText from '../../ui/InputText';\nimport renderText from '../../common/helpers/renderText';\nimport UsernameInput from '../../common/UsernameInput';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentAvatarHash?: string;\n currentFirstName?: string;\n currentLastName?: string;\n currentBio?: string;\n currentUsername?: string;\n progress?: ProfileEditProgress;\n isUsernameAvailable?: boolean;\n};\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst MAX_BIO_LENGTH = 70;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide your first name';\nconst ERROR_BIO_TOO_LONG = 'Bio can\\' be longer than 70 characters';\n\nconst SettingsEditProfile: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n}) => {\n const {\n loadCurrentUser,\n updateProfile,\n checkUsername,\n } = getDispatch();\n\n const lang = useLang();\n\n const [isUsernameTouched, setIsUsernameTouched] = useState(false);\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n\n const [photo, setPhoto] = useState();\n const [firstName, setFirstName] = useState(currentFirstName || '');\n const [lastName, setLastName] = useState(currentLastName || '');\n const [bio, setBio] = useState(currentBio || '');\n const [username, setUsername] = useState(currentUsername || '');\n\n const currentAvatarBlobUrl = useMedia(currentAvatarHash, false, ApiMediaFormat.BlobUrl);\n\n const isLoading = progress === ProfileEditProgress.InProgress;\n const isUsernameError = username === false;\n\n const isSaveButtonShown = useMemo(() => {\n if (isUsernameError) {\n return false;\n }\n\n return Boolean(photo) || isProfileFieldsTouched || isUsernameAvailable === true;\n }, [photo, isProfileFieldsTouched, isUsernameError, isUsernameAvailable]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.EditProfile);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadCurrentUser();\n });\n }, [loadCurrentUser]);\n\n useEffect(() => {\n setPhoto(undefined);\n }, [currentAvatarBlobUrl]);\n\n useEffect(() => {\n setFirstName(currentFirstName || '');\n setLastName(currentLastName || '');\n setBio(currentBio || '');\n }, [currentFirstName, currentLastName, currentBio]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [currentUsername]);\n\n useEffect(() => {\n if (progress === ProfileEditProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setIsUsernameTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handlePhotoChange = useCallback((newPhoto: File) => {\n setPhoto(newPhoto);\n }, []);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleBioChange = useCallback((e: ChangeEvent) => {\n setBio(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUsernameChange = useCallback((value: string | false) => {\n setUsername(value);\n setIsUsernameTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n const trimmedBio = bio.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n return;\n }\n\n if (trimmedBio.length > MAX_BIO_LENGTH) {\n setError(ERROR_BIO_TOO_LONG);\n return;\n }\n\n updateProfile({\n photo,\n ...(isProfileFieldsTouched && {\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n bio: trimmedBio,\n }),\n ...(isUsernameTouched && {\n username,\n }),\n });\n }, [\n photo,\n firstName, lastName, bio, isProfileFieldsTouched,\n username, isUsernameTouched,\n updateProfile,\n ]);\n\n return (\n
\n
\n
\n \n \n \n \n\n

\n {renderText(lang('lng_settings_about_bio'), ['br', 'simple_markdown'])}\n

\n
\n\n
\n

{lang('Username')}

\n\n \n\n

\n {renderText(lang('UsernameHelp'), ['br', 'simple_markdown'])}\n

\n {username && (\n

\n {lang('lng_username_link')}
\n https://t.me/{username}\n

\n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n const { progress, isUsernameAvailable } = global.profileEdit || {};\n const currentUser = currentUserId ? selectUser(global, currentUserId) : undefined;\n\n if (!currentUser) {\n return {\n progress,\n isUsernameAvailable,\n };\n }\n\n const {\n firstName: currentFirstName,\n lastName: currentLastName,\n username: currentUsername,\n fullInfo,\n } = currentUser;\n const { bio: currentBio } = fullInfo || {};\n const currentAvatarHash = getChatAvatarHash(currentUser);\n\n return {\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n };\n },\n)(SettingsEditProfile));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ISettings } from '../../../types';\n\nimport { AUTODOWNLOAD_FILESIZE_MB_LIMITS } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Checkbox from '../../ui/Checkbox';\nimport RangeSlider from '../../ui/RangeSlider';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\nconst SettingsDataStorage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n canAutoLoadPhotoFromContacts,\n canAutoLoadPhotoInPrivateChats,\n canAutoLoadPhotoInGroups,\n canAutoLoadPhotoInChannels,\n canAutoLoadVideoFromContacts,\n canAutoLoadVideoInPrivateChats,\n canAutoLoadVideoInGroups,\n canAutoLoadVideoInChannels,\n canAutoLoadFileFromContacts,\n canAutoLoadFileInPrivateChats,\n canAutoLoadFileInGroups,\n canAutoLoadFileInChannels,\n canAutoPlayGifs,\n canAutoPlayVideos,\n autoLoadFileMaxSizeMb,\n}) => {\n const { setSettingOption } = getDispatch();\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n const renderFileSizeCallback = useCallback((value: number) => {\n return lang('AutodownloadSizeLimitUpTo', lang('FileSize.MB', String(AUTODOWNLOAD_FILESIZE_MB_LIMITS[value]), 'i'));\n }, [lang]);\n\n const handleFileSizeChange = useCallback((value: number) => {\n setSettingOption({ autoLoadFileMaxSizeMb: AUTODOWNLOAD_FILESIZE_MB_LIMITS[value] });\n }, [setSettingOption]);\n\n function renderContentSizeSlider() {\n const value = AUTODOWNLOAD_FILESIZE_MB_LIMITS.indexOf(autoLoadFileMaxSizeMb);\n\n return (\n
\n \n
\n );\n }\n\n function renderAutoDownloadBlock(\n title: string,\n key: 'Photo' | 'Video' | 'File',\n canAutoLoadFromContacts: boolean,\n canAutoLoadInPrivateChats: boolean,\n canAutoLoadInGroups: boolean,\n canAutoLoadInChannels: boolean,\n ) {\n return (\n
\n

{title}

\n\n setSettingOption({ [`canAutoLoad${key}FromContacts`]: isChecked })}\n />\n setSettingOption({ [`canAutoLoad${key}InPrivateChats`]: isChecked })}\n />\n setSettingOption({ [`canAutoLoad${key}InGroups`]: isChecked })}\n />\n setSettingOption({ [`canAutoLoad${key}InChannels`]: isChecked })}\n />\n\n {key === 'File' && renderContentSizeSlider()}\n
\n );\n }\n\n return (\n
\n {renderAutoDownloadBlock(\n lang('AutoDownloadPhotosTitle'),\n 'Photo',\n canAutoLoadPhotoFromContacts,\n canAutoLoadPhotoInPrivateChats,\n canAutoLoadPhotoInGroups,\n canAutoLoadPhotoInChannels,\n )}\n {renderAutoDownloadBlock(\n lang('AutoDownloadVideosTitle'),\n 'Video',\n canAutoLoadVideoFromContacts,\n canAutoLoadVideoInPrivateChats,\n canAutoLoadVideoInGroups,\n canAutoLoadVideoInChannels,\n )}\n {renderAutoDownloadBlock(\n 'Auto-download files', // Proper translation is not available yet\n 'File',\n canAutoLoadFileFromContacts,\n canAutoLoadFileInPrivateChats,\n canAutoLoadFileInGroups,\n canAutoLoadFileInChannels,\n )}\n\n
\n

{lang('AutoplayMedia')}

\n\n setSettingOption({ canAutoPlayGifs: isChecked })}\n />\n setSettingOption({ canAutoPlayVideos: isChecked })}\n />\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return pick(global.settings.byKey, [\n 'canAutoLoadPhotoFromContacts',\n 'canAutoLoadPhotoInPrivateChats',\n 'canAutoLoadPhotoInGroups',\n 'canAutoLoadPhotoInChannels',\n 'canAutoLoadVideoFromContacts',\n 'canAutoLoadVideoInPrivateChats',\n 'canAutoLoadVideoInGroups',\n 'canAutoLoadVideoInChannels',\n 'canAutoLoadFileFromContacts',\n 'canAutoLoadFileInPrivateChats',\n 'canAutoLoadFileInGroups',\n 'canAutoLoadFileInChannels',\n 'canAutoPlayGifs',\n 'canAutoPlayVideos',\n 'autoLoadFileMaxSizeMb',\n ]);\n },\n)(SettingsDataStorage));\n","import React, {\n FC, memo, useMemo, useCallback, useState, useEffect,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiChatFolder } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { throttle } from '../../../../util/schedulers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport { getFolderDescriptionText } from '../../../../modules/helpers';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\nimport { useFolderManagerForChatsCount } from '../../../../hooks/useFolderManager';\n\nimport ListItem from '../../../ui/ListItem';\nimport Button from '../../../ui/Button';\nimport Loading from '../../../ui/Loading';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\n\ntype OwnProps = {\n isActive?: boolean;\n onCreateFolder: () => void;\n onEditFolder: (folder: ApiChatFolder) => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n orderedFolderIds?: number[];\n foldersById: Record;\n recommendedChatFolders?: ApiChatFolder[];\n};\n\nconst runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);\n\nconst MAX_ALLOWED_FOLDERS = 10;\n\nconst SettingsFoldersMain: FC = ({\n isActive,\n onCreateFolder,\n onEditFolder,\n onScreenSelect,\n onReset,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n}) => {\n const {\n loadRecommendedChatFolders,\n addChatFolder,\n showDialog,\n } = getDispatch();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersAll').then(setAnimationData);\n }\n }, [animationData]);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottledForLoadRecommended(() => {\n loadRecommendedChatFolders();\n });\n }, [loadRecommendedChatFolders]);\n\n const handleCreateFolder = useCallback(() => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n onCreateFolder();\n }, [foldersById, showDialog, onCreateFolder]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Folders);\n\n const chatsCountByFolderId = useFolderManagerForChatsCount();\n const userFolders = useMemo(() => {\n if (!orderedFolderIds) {\n return undefined;\n }\n\n return orderedFolderIds.map((id) => {\n const folder = foldersById[id];\n\n return {\n id: folder.id,\n title: folder.title,\n subtitle: getFolderDescriptionText(lang, folder, chatsCountByFolderId[folder.id]),\n };\n });\n }, [orderedFolderIds, foldersById, lang, chatsCountByFolderId]);\n\n const handleCreateFolderFromRecommended = useCallback((folder: ApiChatFolder) => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n addChatFolder({ folder });\n }, [foldersById, addChatFolder, showDialog]);\n\n return (\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n

\n {lang('CreateNewFilterInfo')}\n

\n\n \n \n {lang('CreateNewFilter')}\n \n
\n\n
\n

{lang('Filters')}

\n\n {userFolders?.length ? userFolders.map((folder) => (\n onEditFolder(foldersById[folder.id])}\n >\n {folder.title}\n {folder.subtitle}\n \n )) : userFolders && !userFolders.length ? (\n

\n You have no folders yet.\n

\n ) : }\n
\n\n {(recommendedChatFolders && Boolean(recommendedChatFolders.length)) && (\n
\n

\n {lang('FilterRecommended')}\n

\n\n {recommendedChatFolders.map((folder) => (\n handleCreateFolderFromRecommended(folder)}\n >\n
\n
\n {folder.title}\n {folder.description}\n
\n\n \n {lang('Add')}\n \n
\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n orderedIds: orderedFolderIds,\n byId: foldersById,\n recommended: recommendedChatFolders,\n } = global.chatFolders;\n\n return {\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n };\n },\n)(SettingsFoldersMain));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\n\nimport './ShowMoreButton.scss';\n\ntype OwnProps = {\n count: number;\n itemName: string;\n itemPluralName?: string;\n isLoading?: boolean;\n onClick: () => void;\n};\n\nconst ShowMoreButton: FC = ({\n count,\n itemName,\n itemPluralName,\n isLoading,\n onClick,\n}) => {\n const lang = useLang();\n\n return (\n \n \n Show {count} more {count > 1 ? itemPluralName || `${itemName}s` : itemName}\n \n );\n};\n\nexport default ShowMoreButton;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { findIntersectionWithSet } from '../../../../util/iteratees';\nimport { isUserId } from '../../../../modules/helpers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport {\n EXCLUDED_CHAT_TYPES,\n FolderEditDispatch,\n FoldersState,\n INCLUDED_CHAT_TYPES,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\nimport InputText from '../../../ui/InputText';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport FloatingActionButton from '../../../ui/FloatingActionButton';\nimport Spinner from '../../../ui/Spinner';\nimport ShowMoreButton from '../../../ui/ShowMoreButton';\n\ntype OwnProps = {\n state: FoldersState;\n dispatch: FolderEditDispatch;\n onAddIncludedChats: () => void;\n onAddExcludedChats: () => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n onBack: () => void;\n};\n\ntype StateProps = {\n loadedActiveChatIds?: string[];\n loadedArchivedChatIds?: string[];\n};\n\nconst SUBMIT_TIMEOUT = 500;\n\nconst INITIAL_CHATS_LIMIT = 5;\n\nconst ERROR_NO_TITLE = 'Please provide a title for this folder.';\nconst ERROR_NO_CHATS = 'ChatList.Filter.Error.Empty';\n\nconst SettingsFoldersEdit: FC = ({\n state,\n dispatch,\n onAddIncludedChats,\n onAddExcludedChats,\n isActive,\n onScreenSelect,\n onReset,\n onBack,\n loadedActiveChatIds,\n loadedArchivedChatIds,\n}) => {\n const {\n editChatFolder,\n addChatFolder,\n } = getDispatch();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n const [isIncludedChatsListExpanded, setIsIncludedChatsListExpanded] = useState(false);\n const [isExcludedChatsListExpanded, setIsExcludedChatsListExpanded] = useState(false);\n\n const {\n selectedChatIds: includedChatIds,\n selectedChatTypes: includedChatTypes,\n } = selectChatFilters(state, 'included');\n const {\n selectedChatIds: excludedChatIds,\n selectedChatTypes: excludedChatTypes,\n } = selectChatFilters(state, 'excluded');\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersNew').then(setAnimationData);\n }\n }, [animationData]);\n\n useEffect(() => {\n setIsIncludedChatsListExpanded(false);\n setIsExcludedChatsListExpanded(false);\n }, [state.folderId]);\n\n const [visibleIncludedChatIds, visibleExcludedChatIds] = useMemo(() => {\n const allLoadedChatsSet = new Set([\n ...(loadedActiveChatIds || []),\n ...(loadedArchivedChatIds || []),\n ]);\n\n const loadedIncludedChatIds = findIntersectionWithSet(includedChatIds, allLoadedChatsSet);\n const loadedExcludedChatIds = findIntersectionWithSet(excludedChatIds, allLoadedChatsSet);\n\n return [\n isIncludedChatsListExpanded\n ? loadedIncludedChatIds\n : loadedIncludedChatIds.slice(0, INITIAL_CHATS_LIMIT - includedChatTypes.length),\n isExcludedChatsListExpanded\n ? loadedExcludedChatIds\n : loadedExcludedChatIds.slice(0, INITIAL_CHATS_LIMIT - excludedChatTypes.length),\n ];\n }, [\n excludedChatIds, includedChatIds, includedChatTypes, excludedChatTypes,\n isExcludedChatsListExpanded, isIncludedChatsListExpanded,\n loadedActiveChatIds, loadedArchivedChatIds,\n ]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onBack, onScreenSelect, state.mode === 'edit'\n ? SettingsScreens.FoldersEditFolder\n : SettingsScreens.FoldersCreateFolder);\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n dispatch({ type: 'setTitle', payload: currentTarget.value.trim() });\n }\n\n function handleSubmit() {\n const { title } = state.folder;\n\n if (!title) {\n dispatch({ type: 'setError', payload: ERROR_NO_TITLE });\n return;\n }\n\n if (!includedChatIds.length && !Object.keys(includedChatTypes).length) {\n dispatch({ type: 'setError', payload: ERROR_NO_CHATS });\n return;\n }\n\n dispatch({ type: 'setIsLoading', payload: true });\n if (state.mode === 'edit') {\n editChatFolder({ id: state.folderId, folderUpdate: state.folder });\n } else {\n addChatFolder({ folder: state.folder });\n }\n\n setTimeout(() => {\n onReset();\n }, SUBMIT_TIMEOUT);\n }\n\n function renderChatType(key: string, mode: 'included' | 'excluded') {\n const chatType = mode === 'included'\n ? INCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key)\n : EXCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key);\n\n if (!chatType) {\n return undefined;\n }\n\n return (\n \n {lang(chatType.title)}\n \n );\n }\n\n function renderChats(mode: 'included' | 'excluded') {\n const selectedChatTypes = mode === 'included' ? includedChatTypes : excludedChatTypes;\n const visibleChatIds = mode === 'included' ? visibleIncludedChatIds : visibleExcludedChatIds;\n\n const isExpanded = mode === 'included' ? isIncludedChatsListExpanded : isExcludedChatsListExpanded;\n const allChatIds = mode === 'included' ? includedChatIds : excludedChatIds;\n const leftChatsCount = allChatIds.length - selectedChatTypes.length - visibleChatIds.length;\n const clickHandler = mode === 'included'\n ? () => setIsIncludedChatsListExpanded(true)\n : () => setIsExcludedChatsListExpanded(true);\n\n return (\n <>\n {selectedChatTypes.map((key) => renderChatType(key, mode))}\n {visibleChatIds.map((id) => (\n \n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n ))}\n {(!isExpanded && leftChatsCount > 0) && (\n \n )}\n \n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n {state.mode === 'create' && (\n

\n {lang('FilterIncludeInfo')}\n

\n )}\n\n \n
\n\n
\n {state.error && state.error === ERROR_NO_CHATS && (\n

\n {lang(state.error)}\n

\n )}\n\n

{lang('FilterInclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('included')}\n
\n\n
\n

{lang('FilterExclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('excluded')}\n
\n
\n\n \n {state.isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { listIds } = global.chats;\n\n return {\n loadedActiveChatIds: listIds.active,\n loadedArchivedChatIds: listIds.archived,\n };\n },\n)(SettingsFoldersEdit));\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../../../lib/teact/teact';\n\nimport { isUserId } from '../../../../modules/helpers';\nimport {\n INCLUDED_CHAT_TYPES,\n EXCLUDED_CHAT_TYPES,\n FolderChatType,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useInfiniteScroll from '../../../../hooks/useInfiniteScroll';\nimport useLang from '../../../../hooks/useLang';\n\nimport Checkbox from '../../../ui/Checkbox';\nimport InputText from '../../../ui/InputText';\nimport ListItem from '../../../ui/ListItem';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport PickerSelectedItem from '../../../common/PickerSelectedItem';\nimport InfiniteScroll from '../../../ui/InfiniteScroll';\nimport Loading from '../../../ui/Loading';\n\nimport '../../../common/Picker.scss';\nimport './SettingsFoldersChatsPicker.scss';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n chatIds: string[];\n selectedIds: string[];\n selectedChatTypes: string[];\n filterValue?: string;\n onSelectedIdsChange: (ids: string[]) => void;\n onSelectedChatTypesChange: (types: string[]) => void;\n onFilterChange: (value: string) => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_CHATS = 100;\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst SettingsFoldersChatsPicker: FC = ({\n mode,\n chatIds,\n selectedIds,\n selectedChatTypes,\n filterValue,\n onSelectedIdsChange,\n onSelectedChatTypesChange,\n onFilterChange,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const chatTypes = mode === 'included' ? INCLUDED_CHAT_TYPES : EXCLUDED_CHAT_TYPES;\n const shouldMinimize = selectedIds.length + selectedChatTypes.length > MAX_FULL_ITEMS;\n const hasMaxChats = selectedIds.length >= MAX_CHATS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: string) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n }, [selectedIds, onSelectedIdsChange]);\n\n const handleChatTypeClick = useCallback((key: FolderChatType['key']) => {\n const newSelectedChatTypes = [...selectedChatTypes];\n if (newSelectedChatTypes.includes(key)) {\n newSelectedChatTypes.splice(newSelectedChatTypes.indexOf(key), 1);\n } else {\n newSelectedChatTypes.push(key);\n }\n onSelectedChatTypesChange(newSelectedChatTypes);\n }, [selectedChatTypes, onSelectedChatTypesChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const lang = useLang();\n\n function renderSelectedChatType(key: string) {\n const selectedType = chatTypes.find(({ key: typeKey }) => key === typeKey);\n if (!selectedType) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n function renderChatType(type: FolderChatType) {\n return (\n handleChatTypeClick(type.key)}\n ripple\n >\n \n

{lang(type.title)}

\n \n \n );\n }\n\n function renderItem(id: string) {\n const isSelected = selectedIds.includes(id);\n\n return (\n handleItemClick(id)}\n ripple\n disabled={!isSelected && hasMaxChats}\n >\n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n \n );\n }\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, chatIds, Boolean(filterValue));\n\n return (\n
\n
\n {selectedChatTypes.map(renderSelectedChatType)}\n {selectedIds.map((id, i) => (\n \n ))}\n {!hasMaxChats ? (\n \n ) : (\n

\n {`Sorry, you can't add more than ${MAX_CHATS} chats.`}\n

\n )}\n
\n \n {(!viewportIds || !viewportIds.length || viewportIds.includes(chatIds[0])) && (\n <>\n

\n {lang('FilterChatTypes')}\n

\n {chatTypes.map(renderChatType)}\n
\n

\n {lang('FilterChats')}\n

\n \n )}\n\n {viewportIds?.length ? (\n viewportIds.map(renderItem)\n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(SettingsFoldersChatsPicker);\n","import React, {\n FC, memo, useMemo, useCallback,\n} from '../../../../lib/teact/teact';\nimport { getGlobal } from '../../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport { unique } from '../../../../util/iteratees';\n\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../../config';\nimport { filterChatsByName } from '../../../../modules/helpers';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\nimport { useFolderManagerForOrderedIds } from '../../../../hooks/useFolderManager';\nimport {\n FoldersState,\n FolderEditDispatch,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\n\nimport SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker';\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst SettingsFoldersChatFilters: FC = ({\n mode,\n state,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const { chatFilter } = state;\n const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true);\n\n const lang = useLang();\n\n const folderAllOrderedIds = useFolderManagerForOrderedIds(ALL_FOLDER_ID);\n const folderArchivedOrderedIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on chats, so we avoid them\n const chatsById = getGlobal().chats.byId;\n\n const chatIds = [...folderAllOrderedIds || [], ...folderArchivedOrderedIds || []];\n return unique([\n ...selectedChatIds,\n ...filterChatsByName(lang, chatIds, chatsById, chatFilter),\n ]);\n }, [folderAllOrderedIds, folderArchivedOrderedIds, selectedChatIds, lang, chatFilter]);\n\n const handleFilterChange = useCallback((newFilter: string) => {\n dispatch({\n type: 'setChatFilter',\n payload: newFilter,\n });\n }, [dispatch]);\n\n const handleSelectedIdsChange = useCallback((ids: string[]) => {\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: { ...state.includeFilters, includedChatIds: ids },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: { ...state.excludeFilters, excludedChatIds: ids },\n });\n }\n }, [mode, state, dispatch]);\n\n const handleSelectedChatTypesChange = useCallback((keys: string[]) => {\n const newFilters: Record = {};\n keys.forEach((key) => {\n newFilters[key] = true;\n });\n\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: {\n includedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: {\n excludedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n }\n }, [mode, selectedChatIds, dispatch]);\n\n useHistoryBack(\n isActive, onReset, onScreenSelect,\n mode === 'included' ? SettingsScreens.FoldersIncludedChats : SettingsScreens.FoldersExcludedChats,\n );\n\n if (!displayedIds) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default memo(SettingsFoldersChatFilters);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiChatFolder } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { FolderEditDispatch, FoldersState } from '../../../../hooks/reducers/useFoldersReducer';\n\nimport SettingsFoldersMain from './SettingsFoldersMain';\nimport SettingsFoldersEdit from './SettingsFoldersEdit';\nimport SettingsFoldersChatFilters from './SettingsFoldersChatFilters';\n\nimport './SettingsFolders.scss';\n\nconst TRANSITION_DURATION = 200;\n\nexport type OwnProps = {\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst SettingsFolders: FC = ({\n currentScreen,\n shownScreen,\n state,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n dispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (state.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n state.mode, dispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleCreateFolder = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n }, [onScreenSelect, dispatch]);\n\n const handleEditFolder = useCallback((folder: ApiChatFolder) => {\n dispatch({ type: 'editFolder', payload: folder });\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }, [dispatch, onScreenSelect]);\n\n const handleAddIncludedChats = useCallback(() => {\n dispatch({ type: 'editIncludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersIncludedChatsFromChatList\n : SettingsScreens.FoldersIncludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n const handleAddExcludedChats = useCallback(() => {\n dispatch({ type: 'editExcludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersExcludedChatsFromChatList\n : SettingsScreens.FoldersExcludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n switch (currentScreen) {\n case SettingsScreens.Folders:\n return (\n \n );\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(SettingsFolders);\n","import React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport { getFirstLetters } from '../../../util/textFormat';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\ntype OwnProps = {\n size?: number;\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCoverAnimated: FC = ({\n size = STICKER_SIZE_PICKER_HEADER,\n stickerSet,\n observeIntersection,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaHash = `stickerSet${stickerSet.id}`;\n const lottieData = useMedia(mediaHash, !isIntersecting, ApiMediaFormat.Lottie);\n const transitionClassNames = useMediaTransition(lottieData);\n\n const firstLetters = useMemo(() => {\n if (lottieData) return undefined;\n\n return getFirstLetters(stickerSet.title, 2);\n }, [lottieData, stickerSet.title]);\n\n return (\n
\n {firstLetters}\n {lottieData && (\n \n )}\n
\n );\n};\n\nexport default memo(StickerSetCoverAnimated);\n","import React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiStickerSet } from '../../../api/types';\n\nimport { IS_WEBM_SUPPORTED } from '../../../util/environment';\nimport { getFirstLetters } from '../../../util/textFormat';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\n\ntype OwnProps = {\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCover: FC = ({ stickerSet, observeIntersection }) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaData = useMedia(stickerSet.hasThumbnail && `stickerSet${stickerSet.id}`, !isIntersecting);\n const transitionClassNames = useMediaTransition(mediaData);\n const isGif = stickerSet.isGifs;\n\n const firstLetters = useMemo(() => {\n if ((isGif && !IS_WEBM_SUPPORTED) || !mediaData) return getFirstLetters(stickerSet.title, 2);\n }, [isGif, mediaData, stickerSet.title]);\n\n return (\n
\n {firstLetters}\n {isGif ? (\n
\n );\n};\n\nexport default memo(StickerSetCover);\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_GENERAL_SETTINGS } from '../../../config';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\n\nimport ListItem from '../../ui/ListItem';\nimport Button from '../../ui/Button';\nimport StickerSetCoverAnimated from '../../middle/composer/StickerSetCoverAnimated';\nimport StickerSetCover from '../../middle/composer/StickerSetCover';\nimport StickerButton from '../../common/StickerButton';\n\nimport './SettingsStickerSet.scss';\n\ntype OwnProps = {\n stickerSet?: ApiStickerSet;\n observeIntersection: ObserveFn;\n onClick: (value: ApiSticker) => void;\n};\n\nconst SettingsStickerSet: FC = ({\n stickerSet,\n observeIntersection,\n onClick,\n}) => {\n const lang = useLang();\n\n if (!stickerSet || !stickerSet.stickers) {\n return undefined;\n }\n\n const firstSticker = stickerSet.stickers?.[0];\n\n if (stickerSet.hasThumbnail || !firstSticker) {\n return (\n firstSticker && onClick(firstSticker)}\n >\n \n {stickerSet.isLottie ? (\n \n ) : (\n \n )}\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n } else {\n return (\n onClick(firstSticker)}\n >\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n }\n};\n\nexport default memo(SettingsStickerSet);\n","import React, {\n FC, useCallback, memo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ISettings, TimeFormat } from '../../../types';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { IS_IOS, IS_MAC_OS, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport { setTimeFormat } from '../../../util/langProvider';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RangeSlider from '../../ui/RangeSlider';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup, { IRadioOption } from '../../ui/RadioGroup';\nimport SettingsStickerSet from './SettingsStickerSet';\nimport StickerSetModal from '../../common/StickerSetModal.async';\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps =\n Pick & {\n stickerSetIds?: string[];\n stickerSetsById?: Record;\n defaultReaction?: string;\n };\n\nconst ANIMATION_LEVEL_OPTIONS = [\n 'Solid and Steady',\n 'Nice and Fast',\n 'Lots of Stuff',\n];\n\nconst TIME_FORMAT_OPTIONS: IRadioOption[] = [{\n label: '12-hour',\n value: '12h',\n}, {\n label: '24-hour',\n value: '24h',\n}];\n\nconst SettingsGeneral: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n stickerSetIds,\n stickerSetsById,\n defaultReaction,\n messageTextSize,\n animationLevel,\n messageSendKeyCombo,\n shouldSuggestStickers,\n shouldLoopStickers,\n timeFormat,\n}) => {\n const {\n setSettingOption,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const stickerSettingsRef = useRef(null);\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: stickerSettingsRef });\n const [isModalOpen, openModal, closeModal] = useFlag();\n const [sticker, setSticker] = useState();\n\n const lang = useLang();\n\n const KEYBOARD_SEND_OPTIONS = !IS_TOUCH_ENV ? [\n { value: 'enter', label: lang('lng_settings_send_enter'), subLabel: 'New line by Shift + Enter' },\n {\n value: 'ctrl-enter',\n label: lang(IS_MAC_OS ? 'lng_settings_send_cmdenter' : 'lng_settings_send_ctrlenter'),\n subLabel: 'New line by Enter',\n },\n ] : undefined;\n\n const handleAnimationLevelChange = useCallback((newLevel: number) => {\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [setSettingOption]);\n\n const handleMessageTextSizeChange = useCallback((newSize: number) => {\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(newSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(newSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${newSize}px`);\n document.documentElement.setAttribute('data-message-text-size', newSize.toString());\n\n setSettingOption({ messageTextSize: newSize });\n }, [setSettingOption]);\n\n const handleTimeFormatChange = useCallback((newTimeFormat: string) => {\n setSettingOption({ timeFormat: newTimeFormat });\n setSettingOption({ wasTimeFormatSetManually: true });\n\n setTimeFormat(newTimeFormat as TimeFormat);\n }, [setSettingOption]);\n\n const handleStickerSetClick = useCallback((value: ApiSticker) => {\n setSticker(value);\n openModal();\n }, [openModal]);\n\n const stickerSets = stickerSetIds && stickerSetIds.map((id: string) => {\n return stickerSetsById?.[id]?.installedDate ? stickerSetsById[id] : false;\n }).filter(Boolean as any);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n return (\n
\n
\n

{lang('SETTINGS')}

\n\n \n\n onScreenSelect(SettingsScreens.GeneralChatBackground)}\n >\n {lang('ChatBackground')}\n \n
\n\n
\n

\n Time Format\n

\n \n
\n\n
\n

\n Animation Level\n

\n

\n Choose the desired animations amount.\n

\n\n \n
\n\n {KEYBOARD_SEND_OPTIONS && (\n
\n

{lang('VoiceOver.Keyboard')}

\n\n setSettingOption({ messageSendKeyCombo: value })}\n selected={messageSendKeyCombo}\n />\n
\n )}\n\n
\n

{lang('AccDescrStickers')}

\n\n {defaultReaction && (\n onScreenSelect(SettingsScreens.QuickReaction)}\n >\n \n
{lang('DoubleTapSetting')}
\n \n )}\n\n setSettingOption({ shouldSuggestStickers: isChecked })}\n />\n setSettingOption({ shouldLoopStickers: isChecked })}\n />\n\n
\n {stickerSets && stickerSets.map((stickerSet: ApiStickerSet) => (\n \n ))}\n
\n {sticker && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n ...pick(global.settings.byKey, [\n 'messageTextSize',\n 'animationLevel',\n 'messageSendKeyCombo',\n 'shouldSuggestStickers',\n 'shouldLoopStickers',\n 'isSensitiveEnabled',\n 'canChangeSensitive',\n 'timeFormat',\n ]),\n stickerSetIds: global.stickers.added.setIds,\n stickerSetsById: global.stickers.setsById,\n defaultReaction: global.appConfig?.defaultReaction,\n };\n },\n)(SettingsGeneral));\n","let fileSelector: HTMLInputElement;\n\nexport function openSystemFilesDialog(accept = '*', callback: (e: Event) => void, noMultiple = false) {\n if (!fileSelector) {\n fileSelector = document.createElement('input');\n fileSelector.setAttribute('type', 'file');\n }\n\n fileSelector.setAttribute('accept', accept);\n\n if (noMultiple) {\n fileSelector.removeAttribute('multiple');\n } else {\n fileSelector.setAttribute('multiple', 'multiple');\n }\n\n // eslint-disable-next-line no-null/no-null\n fileSelector.onchange = null;\n fileSelector.value = '';\n fileSelector.onchange = callback;\n\n fileSelector.click();\n}\n","/* eslint-disable eqeqeq */\n/* eslint-disable prefer-template */\n/* eslint-disable prefer-const */\n/* eslint-disable prefer-destructuring */\n/* eslint-disable one-var */\n/* eslint-disable one-var-declaration-per-line */\n\nimport { preloadImage } from './files';\n\n/**\n * HEX > RGB\n * input: 'xxxxxx' (ex. 'ed15fa') case-insensitive\n * output: [r, g, b] ([0-255, 0-255, 0-255])\n */\nexport function hex2rgb(param: string): [number, number, number] {\n return [\n parseInt(param.substring(0, 2), 16),\n parseInt(param.substring(2, 4), 16),\n parseInt(param.substring(4, 6), 16),\n ];\n}\n\n/**\n * RGB > HEX\n * input: [r, g, b] ([0-255, 0-255, 0-255])\n * output: 'xxxxxx' (ex. 'ff0000')\n */\nexport function rgb2hex(param: [number, number, number]) {\n const p0 = param[0].toString(16);\n const p1 = param[1].toString(16);\n const p2 = param[2].toString(16);\n return (p0.length == 1 ? '0' + p0 : p0) + (p1.length == 1 ? '0' + p1 : p1) + (p2.length == 1 ? '0' + p2 : p2);\n}\n\n/**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nexport function rgb2hsb([r, g, b]: [number, number, number]): [number, number, number] {\n r /= 255;\n g /= 255;\n b /= 255;\n\n let max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h!: number, s: number, v: number = max;\n\n let d = max - min;\n s = max == 0 ? 0 : d / max;\n\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n\n h /= 6;\n }\n\n return [h, s, v];\n}\n\n/**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nexport function hsb2rgb([h, s, v]: [number, number, number]): [number, number, number] {\n let r!: number, g!: number, b!: number;\n\n let i = Math.floor(h * 6);\n let f = h * 6 - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = v;\n b = p;\n break;\n case 2:\n r = p;\n g = v;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = v;\n break;\n case 4:\n r = t;\n g = p;\n b = v;\n break;\n case 5:\n r = v;\n g = p;\n b = q;\n break;\n }\n\n return [\n Math.round(r * 255),\n Math.round(g * 255),\n Math.round(b * 255),\n ];\n}\n\nexport async function getAverageColor(url: string): Promise<[number, number, number]> {\n // Only visit every 5 pixels\n const blockSize = 5;\n const defaultRGB: [number, number, number] = [0, 0, 0];\n let data;\n let width;\n let height;\n let i = -4;\n let length;\n let rgb: [number, number, number] = [0, 0, 0];\n let count = 0;\n\n const canvas = document.createElement('canvas');\n const context = canvas.getContext && canvas.getContext('2d');\n if (!context) {\n return defaultRGB;\n }\n\n const image = await preloadImage(url);\n height = image.naturalHeight || image.offsetHeight || image.height;\n width = image.naturalWidth || image.offsetWidth || image.width;\n canvas.height = height;\n canvas.width = width;\n\n context.drawImage(image, 0, 0);\n\n try {\n data = context.getImageData(0, 0, width, height);\n } catch (e) {\n return defaultRGB;\n }\n\n length = data.data.length;\n\n // eslint-disable-next-line no-cond-assign\n while ((i += blockSize * 4) < length) {\n ++count;\n rgb[0] += data.data[i];\n rgb[1] += data.data[i + 1];\n rgb[2] += data.data[i + 2];\n }\n\n rgb[0] = Math.floor(rgb[0] / count);\n rgb[1] = Math.floor(rgb[1] / count);\n rgb[2] = Math.floor(rgb[2] / count);\n\n return rgb;\n}\n\n// eslint-disable-next-line max-len\n// Function was adapted from https://github.com/telegramdesktop/tdesktop/blob/35ff621b5b52f7e3553fb0f990ea13ade7101b8e/Telegram/SourceFiles/data/data_wall_paper.cpp#L518\nexport function getPatternColor(rgbColor: [number, number, number]) {\n let [hue, saturation, value] = rgb2hsb(rgbColor);\n\n saturation = Math.min(1, saturation + 0.05 + 0.1 * (1 - saturation));\n value = value > 0.5\n ? Math.max(0, value * 0.65)\n : Math.max(0, Math.min(1, 1 - value * 0.65));\n\n return `hsla(${hue * 360}, ${saturation * 100}%, ${value * 100}%, .4)`;\n}\n","import React, {\n FC, memo, useCallback, useEffect, useState, useRef,\n} from '../../../lib/teact/teact';\nimport { ApiWallpaper } from '../../../api/types';\nimport { ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../../../config';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { fetchBlob } from '../../../util/files';\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useCanvasBlur from '../../../hooks/useCanvasBlur';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './WallpaperTile.scss';\n\ntype OwnProps = {\n wallpaper: ApiWallpaper;\n theme: ThemeKey;\n isSelected: boolean;\n onClick: (slug: string) => void;\n};\n\nconst WallpaperTile: FC = ({\n wallpaper,\n theme,\n isSelected,\n onClick,\n}) => {\n const { slug, document } = wallpaper;\n const localMediaHash = `wallpaper${document.id!}`;\n const localBlobUrl = document.previewBlobUrl;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`);\n const thumbRef = useCanvasBlur(document.thumbnail?.dataUri, Boolean(previewBlobUrl), true);\n const { transitionClassNames } = useShowTransition(\n Boolean(previewBlobUrl || localBlobUrl),\n undefined,\n undefined,\n 'slow',\n );\n const [isLoadAllowed, setIsLoadAllowed] = useState(false);\n const {\n mediaData: fullMedia, loadProgress,\n } = useMediaWithLoadProgress(localMediaHash, !isLoadAllowed);\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n const { shouldRender: shouldRenderSpinner, transitionClassNames: spinnerClassNames } = useShowTransition(\n (isLoadAllowed && !fullMedia) || slug === UPLOADING_WALLPAPER_SLUG,\n undefined,\n wasLoadDisabled,\n 'slow',\n );\n // To prevent triggering of the effect for useCallback\n const cacheKeyRef = useRef();\n cacheKeyRef.current = theme;\n\n const handleSelect = useCallback(() => {\n (async () => {\n const blob = await fetchBlob(fullMedia!);\n await cacheApi.save(CUSTOM_BG_CACHE_NAME, cacheKeyRef.current!, blob);\n onClick(slug);\n })();\n }, [fullMedia, onClick, slug]);\n\n useEffect(() => {\n if (fullMedia) {\n handleSelect();\n }\n }, [fullMedia, handleSelect]);\n\n const handleClick = useCallback(() => {\n if (fullMedia) {\n handleSelect();\n } else {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n }\n }, [fullMedia, handleSelect]);\n\n const className = buildClassName(\n 'WallpaperTile',\n isSelected && 'selected',\n );\n\n return (\n
\n
\n \n \n {shouldRenderSpinner && (\n
\n \n
\n )}\n
\n
\n );\n};\n\nexport default memo(WallpaperTile);\n","import React, {\n FC, memo, useEffect, useCallback, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\nimport { ApiWallpaper } from '../../../api/types';\n\nimport { DARK_THEME_PATTERN_COLOR, DEFAULT_PATTERN_COLOR } from '../../../config';\nimport { throttle } from '../../../util/schedulers';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { getAverageColor, getPatternColor, rgb2hex } from '../../../util/colors';\nimport { selectTheme } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Loading from '../../ui/Loading';\nimport WallpaperTile from './WallpaperTile';\n\nimport './SettingsGeneralBackground.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n background?: string;\n isBlurred?: boolean;\n loadedWallpapers?: ApiWallpaper[];\n theme: ThemeKey;\n};\n\nconst SUPPORTED_TYPES = 'image/jpeg';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n}) => {\n const {\n loadWallpapers,\n uploadWallpaper,\n setThemeSettings,\n } = getDispatch();\n\n const themeRef = useRef();\n themeRef.current = theme;\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadWallpapers();\n });\n }, [loadWallpapers]);\n\n const handleFileSelect = useCallback((e: Event) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n uploadWallpaper(files[0]);\n }\n }, [uploadWallpaper]);\n\n const handleUploadWallpaper = useCallback(() => {\n openSystemFilesDialog(SUPPORTED_TYPES, handleFileSelect, true);\n }, [handleFileSelect]);\n\n const handleSetColor = useCallback(() => {\n onScreenSelect(SettingsScreens.GeneralChatBackgroundColor);\n }, [onScreenSelect]);\n\n const handleResetToDefault = useCallback(() => {\n setThemeSettings({\n theme,\n background: undefined,\n backgroundColor: undefined,\n isBlurred: true,\n patternColor: theme === 'dark' ? DARK_THEME_PATTERN_COLOR : DEFAULT_PATTERN_COLOR,\n });\n }, [setThemeSettings, theme]);\n\n const handleWallPaperSelect = useCallback((slug: string) => {\n setThemeSettings({ theme: themeRef.current, background: slug });\n const currentWallpaper = loadedWallpapers && loadedWallpapers.find((wallpaper) => wallpaper.slug === slug);\n if (currentWallpaper?.document.thumbnail) {\n getAverageColor(currentWallpaper.document.thumbnail.dataUri)\n .then((color) => {\n const patternColor = getPatternColor(color);\n const rgbColor = `#${rgb2hex(color)}`;\n setThemeSettings({ theme: themeRef.current, backgroundColor: rgbColor, patternColor });\n });\n }\n }, [loadedWallpapers, setThemeSettings]);\n\n const handleWallPaperBlurChange = useCallback((e: React.ChangeEvent) => {\n setThemeSettings({ theme: themeRef.current, isBlurred: e.target.checked });\n }, [setThemeSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackground);\n\n const isUploading = loadedWallpapers?.[0] && loadedWallpapers[0].slug === UPLOADING_WALLPAPER_SLUG;\n\n return (\n
\n
\n \n {lang('UploadImage')}\n \n\n \n {lang('SetColor')}\n \n\n \n {lang('ThemeResetToDefaults')}\n \n\n \n
\n\n {loadedWallpapers ? (\n
\n {loadedWallpapers.map((wallpaper) => (\n \n ))}\n
\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, isBlurred } = global.settings.themes[theme] || {};\n const { loadedWallpapers } = global.settings;\n\n return {\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n };\n },\n)(SettingsGeneralBackground));\n","import { ChangeEvent, MutableRefObject, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ThemeKey } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport {\n getPatternColor, hex2rgb, hsb2rgb, rgb2hex, rgb2hsb,\n} from '../../../util/colors';\nimport { captureEvents, RealTouchEvent } from '../../../util/captureEvents';\nimport { selectTheme } from '../../../modules/selectors';\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\n\nimport './SettingsGeneralBackgroundColor.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n backgroundColor?: string;\n theme: ThemeKey;\n};\n\ninterface CanvasRects {\n colorRect: {\n offsetLeft: number;\n top: number;\n width: number;\n height: number;\n };\n hueRect: {\n offsetLeft: number;\n width: number;\n };\n}\n\nconst DEFAULT_HSB = rgb2hsb(hex2rgb('e6ebee'));\nconst PREDEFINED_COLORS = [\n '#e6ebee', '#b2cee1', '#008dd0', '#c6e7cb', '#c4e1a6', '#60b16e',\n '#ccd0af', '#a6a997', '#7a7072', '#fdd7af', '#fdb76e', '#dd8851',\n];\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n theme,\n backgroundColor,\n}) => {\n const { setThemeSettings } = getDispatch();\n\n const themeRef = useRef();\n themeRef.current = theme;\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const colorPickerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const huePickerRef = useRef(null);\n const isFirstRunRef = useRef(true);\n\n const [hsb, setHsb] = useState(getInitialHsb(backgroundColor));\n // Cache for drag handlers\n const hsbRef = useRef(hsb);\n useEffect(() => {\n hsbRef.current = hsb;\n }, [hsb]);\n\n const [isDragging, markIsDragging, unmarkIsDragging] = useFlag();\n const [rgbInput, setRgbInput] = useState('');\n const [hexInput, setHexInput] = useState('');\n\n const rectsRef = useRef();\n const colorCtxRef = useRef();\n\n // Setup: cache rects, subscribe for drag events\n useEffect(() => {\n // We use `offsetLeft` instead of `left` to support screen transition\n const colorRect = {\n offsetLeft: colorPickerRef.current!.offsetLeft,\n ...pick(colorPickerRef.current!.getBoundingClientRect(), ['top', 'width', 'height']),\n };\n const hueRect = {\n offsetLeft: huePickerRef.current!.offsetLeft,\n ...pick(huePickerRef.current!.getBoundingClientRect(), ['width']),\n };\n\n rectsRef.current = { colorRect, hueRect };\n\n function handleColorDrag(e: MouseEvent | RealTouchEvent) {\n const colorPosition = [\n Math.min(Math.max(0, e.pageX! - colorRect.offsetLeft), colorRect.width - 1),\n Math.min(Math.max(0, e.pageY! - colorRect.top + containerRef.current!.scrollTop), colorRect.height - 1),\n ];\n\n const { huePosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(colorPickerRef.current!, {\n onCapture: handleColorDrag,\n onDrag: handleColorDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n\n function handleHueDrag(e: MouseEvent | RealTouchEvent) {\n const { colorPosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n const huePosition = Math.min(Math.max(0, e.pageX! - hueRect.offsetLeft), hueRect.width - 1);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(huePickerRef.current!, {\n onCapture: handleHueDrag,\n onDrag: handleHueDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n }, [markIsDragging, unmarkIsDragging]);\n\n const { colorPosition = [0, 0], huePosition = 0 } = rectsRef.current ? hsb2positions(hsb, rectsRef.current) : {};\n const hex = rgb2hex(hsb2rgb(hsb));\n const hue = hsb[0];\n const hueHex = rgb2hex(hsb2rgb([hue, 1, 1]));\n\n // Save value and update inputs when HSL changes\n useEffect(() => {\n const rgb = hsb2rgb(hsb);\n const color = `#${rgb2hex(rgb)}`;\n\n setRgbInput(rgb.join(', '));\n setHexInput(color);\n\n if (!isFirstRunRef.current) {\n const patternColor = getPatternColor(rgb);\n setThemeSettings({\n theme: themeRef.current,\n background: undefined,\n backgroundColor: color,\n patternColor,\n });\n }\n isFirstRunRef.current = false;\n }, [hsb, setThemeSettings]);\n\n // Redraw color picker when hue changes\n useEffect(() => {\n drawColor(colorPickerRef.current!.firstChild as HTMLCanvasElement, hue, colorCtxRef, rectsRef);\n }, [hue]);\n\n // Initially draw hue picker\n useEffect(() => {\n drawHue(huePickerRef.current!.firstChild as HTMLCanvasElement);\n }, []);\n\n const handleRgbChange = useCallback((e: ChangeEvent) => {\n const rgbValue = e.currentTarget.value.replace(/[^\\d, ]/g, '').slice(0, 13);\n\n if (rgbValue.match(/^\\d{1,3},\\s?\\d{1,3},\\s?\\d{1,3}$/)) {\n const rgb = rgbValue.split(',').map((channel) => Number(channel.trim())) as [number, number, number];\n setHsb(rgb2hsb(rgb));\n }\n\n e.currentTarget.value = rgbValue;\n }, []);\n\n const handleHexChange = useCallback((e: ChangeEvent) => {\n const hexValue = e.currentTarget.value.replace(/[^0-9a-fA-F]/g, '').slice(0, 6);\n\n if (hexValue.match(/^#?[0-9a-fA-F]{6}$/)) {\n setHsb(rgb2hsb(hex2rgb(hexValue.replace('#', ''))));\n }\n\n e.currentTarget.value = hexValue;\n }, []);\n\n const handlePredefinedColorClick = useCallback((e: React.MouseEvent) => {\n setHsb(rgb2hsb(hex2rgb(e.currentTarget.dataset.color!.replace('#', ''))));\n }, []);\n\n const className = buildClassName(\n 'SettingsGeneralBackgroundColor settings-content custom-scroll',\n isDragging && 'is-dragging',\n );\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackgroundColor);\n\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n {PREDEFINED_COLORS.map((color) => (\n \n ))}\n
\n
\n );\n};\n\nfunction getInitialHsb(backgroundColor?: string) {\n return backgroundColor && backgroundColor.startsWith('#')\n ? rgb2hsb(hex2rgb(backgroundColor.replace('#', '')))\n : DEFAULT_HSB;\n}\n\nfunction hsb2positions(hsb: [number, number, number], rects: CanvasRects) {\n return {\n colorPosition: [\n Math.round((hsb[1]) * (rects.colorRect.width - 1)),\n Math.round((1 - hsb[2]) * (rects.colorRect.height - 1)),\n ],\n huePosition: Math.round(hsb[0] * (rects.hueRect.width - 1)),\n };\n}\n\nfunction positions2hsb(\n { colorPosition, huePosition }: { colorPosition: number[]; huePosition: number },\n rects: CanvasRects,\n): [number, number, number] {\n return [\n huePosition / (rects.hueRect.width - 1),\n colorPosition[0] / (rects.colorRect.width - 1),\n 1 - colorPosition[1] / (rects.colorRect.height - 1),\n ];\n}\n\nfunction drawColor(\n canvas: HTMLCanvasElement,\n hue: number,\n colorCtxRef: MutableRefObject,\n rectsRef: RefObject,\n) {\n let w: number;\n let h: number;\n let ctx: CanvasRenderingContext2D;\n\n if (!colorCtxRef.current || !rectsRef.current) {\n // First run\n w = canvas.offsetWidth;\n h = canvas.offsetHeight;\n ctx = canvas.getContext('2d')!;\n\n canvas.width = w;\n canvas.height = h;\n\n colorCtxRef.current = ctx;\n } else {\n w = rectsRef.current.colorRect.width;\n h = rectsRef.current.colorRect.height;\n ctx = colorCtxRef.current;\n }\n\n const imgData = ctx!.createImageData(w, h);\n const pixels = imgData.data;\n const col = hsb2rgb([hue, 1, 1]);\n\n let index = 0;\n\n for (let y = 0; y < h; y++) {\n const perY = 1 - y / (h - 1);\n const st = [255 * perY, 255 * perY, 255 * perY];\n const ed = [col[0] * perY, col[1] * perY, col[2] * perY];\n for (let x = 0; x < w; x++) {\n const perX = x / (w - 1);\n pixels[index++] = st[0] + (ed[0] - st[0]) * perX;\n pixels[index++] = st[1] + (ed[1] - st[1]) * perX;\n pixels[index++] = st[2] + (ed[2] - st[2]) * perX;\n pixels[index++] = 255;\n }\n }\n\n ctx!.putImageData(imgData, 0, 0);\n}\n\nfunction drawHue(canvas: HTMLCanvasElement) {\n const w = canvas.offsetWidth;\n const h = 1;\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d')!;\n\n const imgData = ctx.createImageData(w, h);\n const pixels = imgData.data;\n\n let index = 0;\n\n for (let x = 0; x < w; x++) {\n const hue = x / (w - 1);\n const rgb = hsb2rgb([hue, 1, 1]);\n /* eslint-disable prefer-destructuring */\n pixels[index++] = rgb[0];\n pixels[index++] = rgb[1];\n pixels[index++] = rgb[2];\n /* eslint-enable prefer-destructuring */\n pixels[index++] = 255;\n }\n\n ctx.putImageData(imgData, 0, 0);\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { backgroundColor } = global.settings.themes[theme] || {};\n return {\n backgroundColor,\n theme,\n };\n },\n)(SettingsGeneralBackground));\n","import { ChangeEvent } from 'react';\nimport useDebounce from '../../../hooks/useDebounce';\nimport React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { playNotifySound } from '../../../util/notifications';\n\nimport Checkbox from '../../ui/Checkbox';\nimport RangeSlider from '../../ui/RangeSlider';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPrivateChatsNotifications: boolean;\n hasPrivateChatsMessagePreview: boolean;\n hasGroupNotifications: boolean;\n hasGroupMessagePreview: boolean;\n hasBroadcastNotifications: boolean;\n hasBroadcastMessagePreview: boolean;\n hasContactJoinedNotifications: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\nconst SettingsNotifications: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPrivateChatsNotifications,\n hasPrivateChatsMessagePreview,\n hasGroupNotifications,\n hasGroupMessagePreview,\n hasBroadcastNotifications,\n hasBroadcastMessagePreview,\n hasContactJoinedNotifications,\n hasPushNotifications,\n hasWebNotifications,\n notificationSoundVolume,\n}) => {\n const {\n loadNotificationSettings,\n updateContactSignUpNotification,\n updateNotificationSettings,\n updateWebNotificationSettings,\n } = getDispatch();\n\n useEffect(() => {\n loadNotificationSettings();\n }, [loadNotificationSettings]);\n\n const runDebounced = useDebounce(500, true);\n\n const handleSettingsChange = useCallback((\n e: ChangeEvent,\n peerType: 'contact' | 'group' | 'broadcast',\n setting: 'silent' | 'showPreviews',\n ) => {\n const currentIsSilent = peerType === 'contact'\n ? !hasPrivateChatsNotifications\n : !(peerType === 'group' ? hasGroupNotifications : hasBroadcastNotifications);\n const currentShouldShowPreviews = peerType === 'contact'\n ? hasPrivateChatsMessagePreview\n : (peerType === 'group' ? hasGroupMessagePreview : hasBroadcastMessagePreview);\n\n updateNotificationSettings({\n peerType,\n ...(setting === 'silent' && { isSilent: !e.target.checked, shouldShowPreviews: currentShouldShowPreviews }),\n ...(setting === 'showPreviews' && { shouldShowPreviews: e.target.checked, isSilent: currentIsSilent }),\n });\n }, [\n hasBroadcastMessagePreview, hasBroadcastNotifications,\n hasGroupMessagePreview, hasGroupNotifications,\n hasPrivateChatsMessagePreview, hasPrivateChatsNotifications,\n updateNotificationSettings,\n ]);\n\n const handleContactNotificationChange = useCallback((e: ChangeEvent) => {\n updateContactSignUpNotification({\n isSilent: !e.target.checked,\n });\n }, [updateContactSignUpNotification]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Notifications);\n\n return (\n
\n
\n

\n Web notifications\n

\n {\n updateWebNotificationSettings({ hasWebNotifications: e.target.checked });\n }}\n />\n {\n updateWebNotificationSettings({ hasPushNotifications: e.target.checked });\n }}\n />\n
\n {\n updateWebNotificationSettings({ notificationSoundVolume: volume });\n runDebounced(() => playNotifySound(undefined, volume));\n }}\n />\n
\n
\n
\n

\n {lang('AutodownloadPrivateChats')}\n

\n\n {\n handleSettingsChange(e, 'contact', 'silent');\n }}\n />\n {\n handleSettingsChange(e, 'contact', 'showPreviews');\n }}\n />\n
\n\n
\n

{lang('FilterGroups')}

\n\n {\n handleSettingsChange(e, 'group', 'silent');\n }}\n />\n {\n handleSettingsChange(e, 'group', 'showPreviews');\n }}\n />\n
\n\n
\n

{lang('FilterChannels')}

\n\n {\n handleSettingsChange(e, 'broadcast', 'silent');\n }}\n />\n {\n handleSettingsChange(e, 'broadcast', 'showPreviews');\n }}\n />\n
\n\n
\n

{lang('PhoneOther')}

\n\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n hasPrivateChatsNotifications: Boolean(global.settings.byKey.hasPrivateChatsNotifications),\n hasPrivateChatsMessagePreview: Boolean(global.settings.byKey.hasPrivateChatsMessagePreview),\n hasGroupNotifications: Boolean(global.settings.byKey.hasGroupNotifications),\n hasGroupMessagePreview: Boolean(global.settings.byKey.hasGroupMessagePreview),\n hasBroadcastNotifications: Boolean(global.settings.byKey.hasBroadcastNotifications),\n hasBroadcastMessagePreview: Boolean(global.settings.byKey.hasBroadcastMessagePreview),\n hasContactJoinedNotifications: Boolean(global.settings.byKey.hasContactJoinedNotifications),\n hasWebNotifications: global.settings.byKey.hasWebNotifications,\n hasPushNotifications: global.settings.byKey.hasPushNotifications,\n notificationSoundVolume: global.settings.byKey.notificationSoundVolume,\n };\n },\n)(SettingsNotifications));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { PrivacyVisibility, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPassword?: boolean;\n blockedCount: number;\n sessionsCount: number;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n visibilityPrivacyPhoneNumber?: PrivacyVisibility;\n visibilityPrivacyLastSeen?: PrivacyVisibility;\n visibilityPrivacyProfilePhoto?: PrivacyVisibility;\n visibilityPrivacyForwarding?: PrivacyVisibility;\n visibilityPrivacyGroupChats?: PrivacyVisibility;\n};\n\nconst SettingsPrivacy: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPassword,\n blockedCount,\n sessionsCount,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber,\n visibilityPrivacyLastSeen,\n visibilityPrivacyProfilePhoto,\n visibilityPrivacyForwarding,\n visibilityPrivacyGroupChats,\n\n}) => {\n const {\n loadPrivacySettings,\n loadBlockedContacts,\n loadAuthorizations,\n loadContentSettings,\n updateContentSettings,\n } = getDispatch();\n\n useEffect(() => {\n loadBlockedContacts();\n loadAuthorizations();\n loadPrivacySettings();\n loadContentSettings();\n }, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Privacy);\n\n function getVisibilityValue(visibility?: PrivacyVisibility) {\n switch (visibility) {\n case 'everybody':\n return lang('P2PEverybody');\n\n case 'contacts':\n return lang('P2PContacts');\n\n case 'nobody':\n return lang('P2PNobody');\n }\n\n return undefined;\n }\n\n return (\n
\n
\n onScreenSelect(SettingsScreens.PrivacyBlockedUsers)}\n >\n
\n {lang('BlockedUsers')}\n {blockedCount > 0 && (\n \n {lang('Users', blockedCount)}\n \n )}\n
\n \n onScreenSelect(\n hasPassword ? SettingsScreens.TwoFaEnabled : SettingsScreens.TwoFaDisabled,\n )}\n >\n
\n {lang('TwoStepVerification')}\n \n {lang(hasPassword ? 'PasswordOn' : 'PasswordOff')}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyActiveSessions)}\n >\n
\n {lang('SessionsTitle')}\n {sessionsCount > 0 && (\n \n {sessionsCount === 1 ? '1 session' : `${sessionsCount} sessions`}\n \n )}\n
\n \n
\n\n
\n

{lang('PrivacyTitle')}

\n\n onScreenSelect(SettingsScreens.PrivacyPhoneNumber)}\n >\n
\n {lang('PrivacyPhoneTitle')}\n \n {getVisibilityValue(visibilityPrivacyPhoneNumber)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyLastSeen)}\n >\n
\n {lang('LastSeenTitle')}\n \n {getVisibilityValue(visibilityPrivacyLastSeen)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyProfilePhoto)}\n >\n
\n {lang('PrivacyProfilePhotoTitle')}\n \n {getVisibilityValue(visibilityPrivacyProfilePhoto)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyForwarding)}\n >\n
\n {lang('PrivacyForwardsTitle')}\n \n {getVisibilityValue(visibilityPrivacyForwarding)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyGroupChats)}\n >\n
\n {lang('WhoCanAddMe')}\n \n {getVisibilityValue(visibilityPrivacyGroupChats)}\n \n
\n \n
\n\n {canChangeSensitive && (\n
\n

\n {lang('lng_settings_sensitive_title')}\n

\n \n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: {\n byKey: { hasPassword, isSensitiveEnabled, canChangeSensitive },\n privacy,\n },\n blocked,\n activeSessions,\n } = global;\n\n return {\n hasPassword,\n blockedCount: blocked.totalCount,\n sessionsCount: activeSessions.length,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber: privacy.phoneNumber?.visibility,\n visibilityPrivacyLastSeen: privacy.lastSeen?.visibility,\n visibilityPrivacyProfilePhoto: privacy.profilePhoto?.visibility,\n visibilityPrivacyForwarding: privacy.forwards?.visibility,\n visibilityPrivacyGroupChats: privacy.chatInvite?.visibility,\n };\n },\n)(SettingsPrivacy));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ISettings, LangCode, SettingsScreens } from '../../../types';\nimport { ApiLanguage } from '../../../api/types';\n\nimport { setLanguage } from '../../../util/langProvider';\n\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\nconst SettingsLanguage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n languages,\n language,\n}) => {\n const {\n loadLanguages,\n setSettingOption,\n } = getDispatch();\n\n const [selectedLanguage, setSelectedLanguage] = useState(language);\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n // TODO Throttle\n useEffect(() => {\n loadLanguages();\n }, [loadLanguages]);\n\n const handleChange = useCallback((langCode: string) => {\n setSelectedLanguage(langCode);\n markIsLoading();\n\n void setLanguage(langCode as LangCode, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: langCode });\n });\n }, [markIsLoading, unmarkIsLoading, setSettingOption]);\n\n const options = useMemo(() => {\n return languages ? buildOptions(languages) : undefined;\n }, [languages]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Language);\n\n return (\n
\n {options ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nfunction buildOptions(languages: ApiLanguage[]) {\n const currentLangCode = (window.navigator.language || 'en').toLowerCase();\n const shortLangCode = currentLangCode.substr(0, 2);\n\n return languages.map(({ langCode, nativeName, name }) => ({\n value: langCode,\n label: nativeName,\n subLabel: name,\n })).sort((a) => {\n return currentLangCode && (a.value === currentLangCode || a.value === shortLangCode) ? -1 : 0;\n });\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n languages: global.settings.byKey.languages,\n language: global.settings.byKey.language,\n };\n },\n)(SettingsLanguage));\n","import { ApiPrivacyKey, SettingsScreens } from '../../../../types';\n\nexport function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefined {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return 'phoneNumber';\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return 'lastSeen';\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return 'profilePhoto';\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return 'forwards';\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return 'chatInvite';\n }\n\n return undefined;\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport { getPrivacyKey } from './helper/privacy';\n\ntype OwnProps = {\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps =\n Partial & {\n chatsById?: Record;\n usersById?: Record;\n };\n\nconst SettingsPrivacyVisibility: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n visibility,\n allowUserIds,\n allowChatIds,\n blockUserIds,\n blockChatIds,\n chatsById,\n}) => {\n const { setPrivacyVisibility } = getDispatch();\n\n const lang = useLang();\n\n const visibilityOptions = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyGroupChats:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n ];\n\n default:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n { value: 'nobody', label: lang('P2PNobody') },\n ];\n }\n }, [lang, screen]);\n\n const exceptionLists = {\n shouldShowDenied: visibility !== 'nobody',\n shouldShowAllowed: visibility !== 'everybody',\n };\n\n const privacyKey = getPrivacyKey(screen);\n\n const headerText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return lang('PrivacyPhoneTitle');\n case SettingsScreens.PrivacyLastSeen:\n return lang('LastSeenTitle');\n case SettingsScreens.PrivacyProfilePhoto:\n return lang('PrivacyProfilePhotoTitle');\n case SettingsScreens.PrivacyForwarding:\n return lang('PrivacyForwardsTitle');\n case SettingsScreens.PrivacyGroupChats:\n return lang('WhoCanAddMe');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const descriptionText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyLastSeen:\n return lang('CustomHelp');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n const allowedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberAllowedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenAllowedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoAllowedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingAllowedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsAllowedContacts;\n }\n })();\n\n const deniedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberDeniedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenDeniedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoDeniedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingDeniedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsDeniedContacts;\n }\n })();\n\n const allowedCount = useMemo(() => {\n if (!allowUserIds || !allowChatIds || !chatsById) {\n return 0;\n }\n\n return allowChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, allowUserIds.length);\n }, [allowChatIds, allowUserIds, chatsById]);\n\n const blockCount = useMemo(() => {\n if (!blockUserIds || !blockChatIds || !chatsById) {\n return 0;\n }\n\n return blockChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, blockUserIds.length);\n }, [blockChatIds, blockUserIds, chatsById]);\n\n const handleVisibilityChange = useCallback((value) => {\n setPrivacyVisibility({\n privacyKey,\n visibility: value,\n });\n }, [privacyKey, setPrivacyVisibility]);\n\n return (\n
\n
\n

{headerText}

\n\n \n\n {descriptionText && (\n

{descriptionText}

\n )}\n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n {exceptionLists.shouldShowAllowed && (\n {\n onScreenSelect(allowedContactsScreen);\n }}\n >\n
\n {allowedCount > 0 && +{allowedCount}}\n {lang('AlwaysShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n {exceptionLists.shouldShowDenied && (\n {\n onScreenSelect(deniedContactsScreen);\n }}\n >\n
\n {blockCount > 0 && −{blockCount}}\n {lang('NeverShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n let privacySettings: ApiPrivacySettings | undefined;\n\n const {\n chats: { byId: chatsById },\n settings: { privacy },\n } = global;\n\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n privacySettings = privacy.phoneNumber;\n break;\n\n case SettingsScreens.PrivacyLastSeen:\n privacySettings = privacy.lastSeen;\n break;\n\n case SettingsScreens.PrivacyProfilePhoto:\n privacySettings = privacy.profilePhoto;\n break;\n\n case SettingsScreens.PrivacyForwarding:\n privacySettings = privacy.forwards;\n break;\n\n case SettingsScreens.PrivacyGroupChats:\n privacySettings = privacy.chatInvite;\n break;\n }\n\n if (!privacySettings) {\n return {};\n }\n\n return {\n ...privacySettings,\n chatsById,\n };\n },\n)(SettingsPrivacyVisibility));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSession } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n activeSessions: ApiSession[];\n};\n\nconst SettingsPrivacyActiveSessions: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n activeSessions,\n}) => {\n const {\n loadAuthorizations,\n terminateAuthorization,\n terminateAllAuthorizations,\n } = getDispatch();\n\n const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag();\n useEffect(() => {\n loadAuthorizations();\n }, [loadAuthorizations]);\n\n const handleTerminateSessionClick = useCallback((hash: string) => {\n terminateAuthorization({ hash });\n }, [terminateAuthorization]);\n\n const handleTerminateAllSessions = useCallback(() => {\n closeConfirmTerminateAllDialog();\n terminateAllAuthorizations();\n }, [closeConfirmTerminateAllDialog, terminateAllAuthorizations]);\n\n const currentSession = useMemo(() => {\n return activeSessions.find((session) => session.isCurrent);\n }, [activeSessions]);\n\n const otherSessions = useMemo(() => {\n return activeSessions.filter((session) => !session.isCurrent);\n }, [activeSessions]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyActiveSessions);\n\n function renderCurrentSession(session: ApiSession) {\n return (\n
\n

\n {lang('AuthSessions.CurrentSession')}\n

\n\n \n
\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n
\n\n \n {lang('TerminateAllSessions')}\n \n
\n );\n }\n\n function renderOtherSessions(sessions: ApiSession[]) {\n return (\n
\n

\n {lang('OtherSessions')}\n

\n\n {sessions.map(renderSession)}\n
\n );\n }\n\n function renderSession(session: ApiSession) {\n return (\n {\n handleTerminateSessionClick(session.hash);\n },\n }]}\n className=\"no-icon\"\n >\n
\n {formatPastTimeShort(lang, session.dateActive * 1000)}\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n \n );\n }\n\n return (\n
\n {currentSession && renderCurrentSession(currentSession)}\n {otherSessions && renderOtherSessions(otherSessions)}\n {otherSessions && (\n \n )}\n
\n );\n};\n\nfunction getLocation(session: ApiSession) {\n return [session.region, session.country].filter(Boolean).join(', ');\n}\n\nfunction getDeviceEnvironment(session: ApiSession) {\n return `${session.deviceModel}${session.deviceModel ? ', ' : ''} ${session.platform} ${session.systemVersion}`;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n activeSessions: global.activeSessions,\n };\n },\n)(SettingsPrivacyActiveSessions));\n","import React, {\n FC, useMemo, useState, memo, useRef, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport { filterUsersByName, getUserFullName } from '../../../modules/helpers';\nimport { unique } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\n\nimport ChatOrUserPicker from '../../common/ChatOrUserPicker';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n usersById: Record;\n blockedIds: string[];\n contactIds?: string[];\n localContactIds?: string[];\n currentUserId?: string;\n};\n\nconst BlockUserModal: FC = ({\n usersById,\n blockedIds,\n contactIds,\n localContactIds,\n currentUserId,\n isOpen,\n onClose,\n}) => {\n const {\n loadContactList,\n setUserSearchQuery,\n blockContact,\n } = getDispatch();\n\n const lang = useLang();\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const filterRef = useRef(null);\n\n useEffect(() => {\n setUserSearchQuery({ query: filter });\n }, [filter, setUserSearchQuery]);\n\n const filteredContactIds = useMemo(() => {\n const availableContactIds = unique([\n ...(contactIds || []),\n ...(localContactIds || []),\n ].filter((contactId) => {\n return contactId !== currentUserId && !blockedIds.includes(contactId);\n }));\n\n return filterUsersByName(availableContactIds, usersById, filter)\n .sort((firstId, secondId) => {\n const firstName = getUserFullName(usersById[firstId]) || '';\n const secondName = getUserFullName(usersById[secondId]) || '';\n\n return firstName.localeCompare(secondName);\n });\n }, [blockedIds, contactIds, currentUserId, filter, localContactIds, usersById]);\n\n const handleRemoveUser = useCallback((userId: string) => {\n const { id: contactId, accessHash } = usersById[userId] || {};\n if (!contactId || !accessHash) {\n return;\n }\n blockContact({ contactId, accessHash });\n onClose();\n }, [blockContact, onClose, usersById]);\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n users: {\n byId: usersById,\n },\n blocked: {\n ids: blockedIds,\n },\n contactList,\n currentUserId,\n } = global;\n\n return {\n usersById,\n blockedIds,\n contactIds: contactList?.userIds,\n localContactIds: global.userSearch.localUserIds,\n currentUserId,\n };\n },\n)(BlockUserModal));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { CHAT_HEIGHT_PX } from '../../../config';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport {\n getChatTitle, getUserFullName, isUserId,\n} from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useFlag from '../../../hooks/useFlag';\n\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Avatar from '../../common/Avatar';\nimport Loading from '../../ui/Loading';\nimport BlockUserModal from './BlockUserModal';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsByIds: Record;\n usersByIds: Record;\n blockedIds: string[];\n phoneCodeList: ApiCountryCode[];\n};\n\nconst SettingsPrivacyBlockedUsers: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n chatsByIds,\n usersByIds,\n blockedIds,\n phoneCodeList,\n}) => {\n const { unblockContact } = getDispatch();\n\n const lang = useLang();\n const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag();\n const handleUnblockClick = useCallback((contactId: string) => {\n unblockContact({ contactId });\n }, [unblockContact]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyBlockedUsers);\n\n function renderContact(contactId: string, i: number, viewportOffset: number) {\n const isPrivate = isUserId(contactId);\n const user = isPrivate ? usersByIds[contactId] : undefined;\n const chat = !isPrivate ? chatsByIds[contactId] : undefined;\n\n const className = buildClassName(\n 'Chat chat-item-clickable blocked-list-item small-icon',\n isPrivate ? 'private' : 'group',\n );\n\n return (\n {\n handleUnblockClick(contactId);\n },\n }]}\n style={`top: ${(viewportOffset + i) * CHAT_HEIGHT_PX}px;`}\n >\n \n
\n

{renderText((isPrivate ? getUserFullName(user) : getChatTitle(lang, chat!)) || '')}

\n {user?.phoneNumber && (\n
{formatPhoneNumberWithCode(phoneCodeList, user.phoneNumber)}
\n )}\n {user && !user.phoneNumber && user.username && (\n
@{user.username}
\n )}\n
\n \n );\n }\n\n return (\n
\n
\n
\n

\n {lang('BlockedUsersInfo')}\n

\n
\n\n
\n {blockedIds?.length ? (\n
\n {blockedIds!.map((contactId, i) => renderContact(contactId, i, 0))}\n
\n ) : blockedIds && !blockedIds.length ? (\n
{lang('NoBlocked')}
\n ) : (\n \n )}\n
\n
\n\n \n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsByIds,\n },\n users: {\n byId: usersByIds,\n },\n blocked: {\n ids,\n },\n countryList: {\n phoneCodes: phoneCodeList,\n },\n } = global;\n\n return {\n chatsByIds,\n usersByIds,\n blockedIds: ids,\n phoneCodeList,\n };\n },\n)(SettingsPrivacyBlockedUsers));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaEnabled: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaEnabled);\n\n return (\n
\n
\n \n\n

\n {renderText(lang('EnabledPasswordText'), ['br'])}\n

\n
\n\n
\n onScreenSelect(SettingsScreens.TwoFaChangePasswordCurrent)}\n >\n {lang('ChangePassword')}\n \n onScreenSelect(SettingsScreens.TwoFaTurnOff)}\n >\n {lang('TurnPasswordOff')}\n \n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCurrentPassword)}\n >\n {lang('SetRecoveryEmail')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaEnabled));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport PasswordMonkey from '../../../common/PasswordMonkey';\nimport PasswordForm from '../../../common/PasswordForm';\n\ntype OwnProps = {\n screen: SettingsScreens;\n error?: string;\n isLoading?: boolean;\n expectedPassword?: string;\n placeholder?: string;\n hint?: string;\n submitLabel?: string;\n clearError?: NoneToVoidFunction;\n onSubmit: (password: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst EQUAL_PASSWORD_ERROR = 'Passwords Should Be Equal';\n\nconst SettingsTwoFaPassword: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n error,\n isLoading,\n expectedPassword,\n placeholder = 'Current Password',\n hint,\n submitLabel,\n clearError,\n onSubmit,\n}) => {\n const [validationError, setValidationError] = useState('');\n const [shouldShowPassword, setShouldShowPassword] = useState(false);\n\n const handleSubmit = useCallback((newPassword) => {\n if (expectedPassword && newPassword !== expectedPassword) {\n setValidationError(EQUAL_PASSWORD_ERROR);\n } else {\n onSubmit(newPassword);\n }\n }, [onSubmit, expectedPassword]);\n\n const handleClearError = useCallback(() => {\n if (clearError) {\n clearError();\n }\n setValidationError('');\n }, [clearError]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(SettingsTwoFaPassword);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n onStart: NoneToVoidFunction;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaStart: FC = ({\n isActive, onScreenSelect, onReset, animatedEmoji, onStart,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaDisabled);\n\n return (\n
\n
\n \n\n

\n {lang('SetAdditionalPasswordInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaStart));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useFlag from '../../../../hooks/useFlag';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport Modal from '../../../ui/Modal';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n icon: 'hint' | 'email';\n type?: 'text' | 'email';\n isLoading?: boolean;\n error?: string;\n placeholder: string;\n shouldConfirm?: boolean;\n clearError?: NoneToVoidFunction;\n onSubmit: (value?: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaSkippableForm: FC = ({\n animatedEmoji,\n type = 'text',\n isLoading,\n error,\n placeholder,\n shouldConfirm,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n const [isConfirmShown, markIsConfirmShown, unmarkIsConfirmShown] = useFlag(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n setValue(e.target.value);\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!inputRef.current) {\n return;\n }\n\n onSubmit(value);\n };\n\n const handleSkip = () => {\n onSubmit();\n };\n\n const handleSkipConfirm = () => {\n unmarkIsConfirmShown();\n onSubmit();\n };\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n
\n \n\n {value ? (\n \n ) : (\n \n {lang('YourEmailSkip')}\n \n )}\n \n {shouldConfirm && (\n \n {renderText(lang('YourEmailSkipWarningText'), ['br', 'simple_markdown'])}\n
\n \n {lang('YourEmailSkip')}\n \n \n {lang('Cancel')}\n \n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal((global, { icon }) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, icon === 'email' ? '💌' : '💡'),\n };\n})(SettingsTwoFaSkippableForm));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaCongratulations: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleClick = () => {\n onScreenSelect(SettingsScreens.Privacy);\n };\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaCongratulations);\n\n return (\n
\n
\n \n\n

\n {lang('TwoStepVerificationPasswordSetInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🥳'),\n };\n})(SettingsTwoFaCongratulations));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n isLoading?: boolean;\n error?: string;\n clearError: NoneToVoidFunction;\n onSubmit: (hint: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n codeLength: number;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaEmailCode: FC = ({\n animatedEmoji,\n codeLength,\n isLoading,\n error,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n const newValue = e.target.value.slice(0, codeLength);\n\n if (newValue.length === codeLength) {\n onSubmit(newValue);\n }\n\n setValue(newValue);\n e.target.value = newValue;\n };\n\n return (\n
\n
\n \n
\n\n
\n \n {isLoading && }\n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '💌'),\n codeLength: global.twoFaSettings.waitingEmailCodeLength,\n };\n})(SettingsTwoFaEmailCode));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer';\nimport useLang from '../../../../hooks/useLang';\n\nimport SettingsTwoFaEnabled from './SettingsTwoFaEnabled';\nimport SettingsTwoFaPassword from './SettingsTwoFaPassword';\nimport SettingsTwoFaStart from './SettingsTwoFaStart';\nimport SettingsTwoFaSkippableForm from './SettingsTwoFaSkippableForm';\nimport SettingsTwoFaCongratulations from './SettingsTwoFaCongratulations';\nimport SettingsTwoFaEmailCode from './SettingsTwoFaEmailCode';\n\nexport type OwnProps = {\n state: TwoFaState;\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n dispatch: TwoFaDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = GlobalState['twoFaSettings'];\n\nconst SettingsTwoFa: FC = ({\n currentScreen,\n shownScreen,\n state,\n hint,\n isLoading,\n error,\n waitingEmailCodeLength,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const {\n updatePassword,\n checkPassword,\n clearTwoFaError,\n updateRecoveryEmail,\n provideTwoFaEmailCode,\n clearPassword,\n } = getDispatch();\n\n useEffect(() => {\n if (waitingEmailCodeLength) {\n if (currentScreen === SettingsScreens.TwoFaNewPasswordEmail) {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmailCode);\n } else if (currentScreen === SettingsScreens.TwoFaRecoveryEmail) {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCode);\n }\n }\n }, [currentScreen, onScreenSelect, waitingEmailCodeLength]);\n\n const handleStartWizard = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.TwoFaNewPassword);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPassword = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordHint);\n }, [onScreenSelect]);\n\n const handleNewPasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmail);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updatePassword({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleChangePasswordCurrent = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordNew);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleChangePasswordNew = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaChangePasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleChangePasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordHint);\n }, [onScreenSelect]);\n\n const handleChangePasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n updatePassword({\n ...state,\n hint: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleTurnOff = useCallback((value: string) => {\n clearPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.Privacy);\n },\n });\n }, [clearPassword, onScreenSelect]);\n\n const handleRecoveryEmailCurrentPassword = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmail);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleRecoveryEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updateRecoveryEmail({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updateRecoveryEmail]);\n\n const handleEmailCode = useCallback((code: string) => {\n provideTwoFaEmailCode({ code });\n }, [provideTwoFaEmailCode]);\n\n const lang = useLang();\n\n switch (currentScreen) {\n case SettingsScreens.TwoFaDisabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n return (\n \n );\n\n case SettingsScreens.TwoFaCongratulations:\n return (\n \n );\n\n case SettingsScreens.TwoFaEnabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordCurrent:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordNew:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaTurnOff:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({ ...global.twoFaSettings }),\n)(SettingsTwoFa));\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../config';\nimport { unique } from '../../../util/iteratees';\nimport { filterChatsByName, isChatGroup, isUserId } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { useFolderManagerForOrderedIds } from '../../../hooks/useFolderManager';\nimport { getPrivacyKey } from './helper/privacy';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\n\nexport type OwnProps = {\n isAllowList?: boolean;\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: string;\n settings?: ApiPrivacySettings;\n};\n\nconst SettingsPrivacyVisibilityExceptionList: FC = ({\n isAllowList,\n screen,\n isActive,\n onScreenSelect,\n onReset,\n currentUserId,\n settings,\n}) => {\n const { setPrivacySettings } = getDispatch();\n\n const lang = useLang();\n\n const selectedContactIds = useMemo(() => {\n if (!settings) {\n return [];\n }\n\n if (isAllowList) {\n return [...settings.allowUserIds, ...settings.allowChatIds];\n } else {\n return [...settings.blockUserIds, ...settings.blockChatIds];\n }\n }, [isAllowList, settings]);\n const [searchQuery, setSearchQuery] = useState('');\n const [isSubmitShown, setIsSubmitShown] = useState(false);\n const [newSelectedContactIds, setNewSelectedContactIds] = useState(selectedContactIds);\n\n const folderAllOrderedIds = useFolderManagerForOrderedIds(ALL_FOLDER_ID);\n const folderArchivedOrderedIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID);\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on chats, so we avoid them\n const chatsById = getGlobal().chats.byId;\n\n const chatIds = unique([...folderAllOrderedIds || [], ...folderArchivedOrderedIds || []])\n .filter((chatId) => {\n const chat = chatsById[chatId];\n return chat && ((isUserId(chat.id) && chat.id !== currentUserId) || isChatGroup(chat));\n });\n\n return unique([\n ...selectedContactIds,\n ...filterChatsByName(lang, chatIds, chatsById, searchQuery),\n ]);\n }, [folderAllOrderedIds, folderArchivedOrderedIds, selectedContactIds, lang, searchQuery, currentUserId]);\n\n const handleSelectedContactIdsChange = useCallback((value: string[]) => {\n setNewSelectedContactIds(value);\n setIsSubmitShown(true);\n }, []);\n\n const handleSubmit = useCallback(() => {\n setPrivacySettings({\n privacyKey: getPrivacyKey(screen),\n isAllowList: Boolean(isAllowList),\n contactsIds: newSelectedContactIds,\n });\n\n onScreenSelect(SettingsScreens.Privacy);\n }, [isAllowList, newSelectedContactIds, onScreenSelect, screen, setPrivacySettings]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n \n\n \n \n \n
\n );\n};\n\nfunction getCurrentPrivacySettings(global: GlobalState, screen: SettingsScreens) {\n const { privacy } = global.settings;\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return privacy.phoneNumber;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return privacy.lastSeen;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return privacy.profilePhoto;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return privacy.forwards;\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return privacy.chatInvite;\n }\n\n return undefined;\n}\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n return {\n currentUserId: global.currentUserId,\n settings: getCurrentPrivacySettings(global, screen),\n };\n },\n)(SettingsPrivacyVisibilityExceptionList));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { ApiAvailableReaction } from '../../../api/types';\n\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport RadioGroup from '../../ui/RadioGroup';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n availableReactions?: ApiAvailableReaction[];\n selectedReaction?: string;\n};\n\nconst SettingsQuickReaction: FC = ({\n isActive,\n onReset,\n onScreenSelect,\n availableReactions,\n selectedReaction,\n}) => {\n const { setDefaultReaction } = getDispatch();\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n const options = availableReactions?.filter((l) => !l.isInactive).map((l) => {\n return {\n label: <>{l.title},\n value: l.reaction,\n };\n }) || [];\n\n const handleChange = useCallback((reaction: string) => {\n setDefaultReaction({ reaction });\n }, [setDefaultReaction]);\n\n return (\n
\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global) => {\n const { availableReactions, appConfig } = global;\n\n return {\n availableReactions,\n selectedReaction: appConfig?.defaultReaction,\n };\n },\n)(SettingsQuickReaction));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\nimport useTwoFaReducer from '../../../hooks/reducers/useTwoFaReducer';\n\nimport Transition from '../../ui/Transition';\nimport SettingsHeader from './SettingsHeader';\nimport SettingsMain from './SettingsMain';\nimport SettingsEditProfile from './SettingsEditProfile';\nimport SettingsDataStorage from './SettingsDataStorage';\nimport SettingsFolders from './folders/SettingsFolders';\nimport SettingsGeneral from './SettingsGeneral';\nimport SettingsGeneralBackground from './SettingsGeneralBackground';\nimport SettingsGeneralBackgroundColor from './SettingsGeneralBackgroundColor';\nimport SettingsNotifications from './SettingsNotifications';\nimport SettingsPrivacy from './SettingsPrivacy';\nimport SettingsLanguage from './SettingsLanguage';\nimport SettingsPrivacyVisibility from './SettingsPrivacyVisibility';\nimport SettingsPrivacyActiveSessions from './SettingsPrivacyActiveSessions';\nimport SettingsPrivacyBlockedUsers from './SettingsPrivacyBlockedUsers';\nimport SettingsTwoFa from './twoFa/SettingsTwoFa';\nimport SettingsPrivacyVisibilityExceptionList from './SettingsPrivacyVisibilityExceptionList';\nimport SettingsQuickReaction from './SettingsQuickReaction';\n\nimport './Settings.scss';\n\nconst TRANSITION_RENDER_COUNT = Object.keys(SettingsScreens).length / 2;\nconst TRANSITION_DURATION = 200;\n\nconst TWO_FA_SCREENS = [\n SettingsScreens.TwoFaDisabled,\n SettingsScreens.TwoFaNewPassword,\n SettingsScreens.TwoFaNewPasswordConfirm,\n SettingsScreens.TwoFaNewPasswordHint,\n SettingsScreens.TwoFaNewPasswordEmail,\n SettingsScreens.TwoFaNewPasswordEmailCode,\n SettingsScreens.TwoFaCongratulations,\n SettingsScreens.TwoFaEnabled,\n SettingsScreens.TwoFaChangePasswordCurrent,\n SettingsScreens.TwoFaChangePasswordNew,\n SettingsScreens.TwoFaChangePasswordConfirm,\n SettingsScreens.TwoFaChangePasswordHint,\n SettingsScreens.TwoFaTurnOff,\n SettingsScreens.TwoFaRecoveryEmailCurrentPassword,\n SettingsScreens.TwoFaRecoveryEmail,\n SettingsScreens.TwoFaRecoveryEmailCode,\n];\n\nconst FOLDERS_SCREENS = [\n SettingsScreens.Folders,\n SettingsScreens.FoldersCreateFolder,\n SettingsScreens.FoldersEditFolder,\n SettingsScreens.FoldersEditFolderFromChatList,\n SettingsScreens.FoldersIncludedChats,\n SettingsScreens.FoldersIncludedChatsFromChatList,\n SettingsScreens.FoldersExcludedChats,\n SettingsScreens.FoldersExcludedChatsFromChatList,\n];\n\nconst PRIVACY_SCREENS = [\n SettingsScreens.PrivacyBlockedUsers,\n SettingsScreens.PrivacyActiveSessions,\n];\n\nconst PRIVACY_PHONE_NUMBER_SCREENS = [\n SettingsScreens.PrivacyPhoneNumberAllowedContacts,\n SettingsScreens.PrivacyPhoneNumberDeniedContacts,\n];\n\nconst PRIVACY_LAST_SEEN_PHONE_SCREENS = [\n SettingsScreens.PrivacyLastSeenAllowedContacts,\n SettingsScreens.PrivacyLastSeenDeniedContacts,\n];\n\nconst PRIVACY_PROFILE_PHOTO_SCREENS = [\n SettingsScreens.PrivacyProfilePhotoAllowedContacts,\n SettingsScreens.PrivacyProfilePhotoDeniedContacts,\n];\n\nconst PRIVACY_FORWARDING_SCREENS = [\n SettingsScreens.PrivacyForwardingAllowedContacts,\n SettingsScreens.PrivacyForwardingDeniedContacts,\n];\n\nconst PRIVACY_GROUP_CHATS_SCREENS = [\n SettingsScreens.PrivacyGroupChatsAllowedContacts,\n SettingsScreens.PrivacyGroupChatsDeniedContacts,\n];\n\nexport type OwnProps = {\n isActive: boolean;\n currentScreen: SettingsScreens;\n foldersState: FoldersState;\n foldersDispatch: FolderEditDispatch;\n onScreenSelect: (screen: SettingsScreens) => void;\n shouldSkipTransition?: boolean;\n onReset: () => void;\n};\n\nconst Settings: FC = ({\n isActive,\n currentScreen,\n foldersState,\n foldersDispatch,\n onScreenSelect,\n onReset,\n shouldSkipTransition,\n}) => {\n const [twoFaState, twoFaDispatch] = useTwoFaReducer();\n\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n foldersDispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (foldersState.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n foldersState.mode, foldersDispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleSaveFilter = useCallback(() => {\n foldersDispatch({ type: 'saveFilters' });\n handleReset();\n }, [foldersDispatch, handleReset]);\n\n function renderCurrentSectionContent(isScreenActive: boolean, screen: SettingsScreens) {\n const privacyAllowScreens: Record = {\n [SettingsScreens.PrivacyPhoneNumber]: PRIVACY_PHONE_NUMBER_SCREENS.includes(screen),\n [SettingsScreens.PrivacyLastSeen]: PRIVACY_LAST_SEEN_PHONE_SCREENS.includes(screen),\n [SettingsScreens.PrivacyProfilePhoto]: PRIVACY_PROFILE_PHOTO_SCREENS.includes(screen),\n [SettingsScreens.PrivacyForwarding]: PRIVACY_FORWARDING_SCREENS.includes(screen),\n [SettingsScreens.PrivacyGroupChats]: PRIVACY_GROUP_CHATS_SCREENS.includes(screen),\n };\n\n const isTwoFaScreen = TWO_FA_SCREENS.includes(screen);\n const isFoldersScreen = FOLDERS_SCREENS.includes(screen);\n const isPrivacyScreen = PRIVACY_SCREENS.includes(screen)\n || isTwoFaScreen\n || Object.keys(privacyAllowScreens).includes(screen.toString())\n || Object.values(privacyAllowScreens).find((key) => key === true);\n\n switch (currentScreen) {\n case SettingsScreens.Main:\n return (\n \n );\n case SettingsScreens.EditProfile:\n return (\n \n );\n case SettingsScreens.General:\n return (\n \n );\n case SettingsScreens.QuickReaction:\n return (\n \n );\n case SettingsScreens.Notifications:\n return (\n \n );\n case SettingsScreens.DataStorage:\n return (\n \n );\n case SettingsScreens.Privacy:\n return (\n \n );\n case SettingsScreens.Language:\n return (\n \n );\n case SettingsScreens.GeneralChatBackground:\n return (\n \n );\n case SettingsScreens.GeneralChatBackgroundColor:\n return (\n \n );\n case SettingsScreens.PrivacyActiveSessions:\n return (\n \n );\n case SettingsScreens.PrivacyBlockedUsers:\n return (\n \n );\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return (\n \n );\n\n case SettingsScreens.Folders:\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaNewPasswordConfirm:\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaCongratulations:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n case SettingsScreens.TwoFaChangePasswordHint:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n case SettingsScreens.TwoFaRecoveryEmail:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n }\n\n function renderCurrentSection(isScreenActive: boolean, isFrom: boolean, currentKey: SettingsScreens) {\n return (\n <>\n \n {renderCurrentSectionContent(isScreenActive, currentKey)}\n \n );\n }\n\n return (\n \n {renderCurrentSection}\n \n );\n};\n\nexport default memo(Settings);\n","import React, {\n FC, useEffect, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiUserStatus } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { throttle } from '../../../util/schedulers';\nimport { filterUsersByName, sortUserIds } from '../../../modules/helpers';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ListItem from '../../ui/ListItem';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n filter: string;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n usersById: Record;\n userStatusesById: Record;\n contactIds?: string[];\n serverTimeOffset: number;\n};\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst ContactList: FC = ({\n isActive,\n filter,\n usersById,\n userStatusesById,\n contactIds,\n serverTimeOffset,\n onReset,\n}) => {\n const {\n loadContactList,\n openChat,\n } = getDispatch();\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n useHistoryBack(isActive, onReset);\n\n const handleClick = useCallback((id: string) => {\n openChat({ id, shouldReplaceHistory: true });\n }, [openChat]);\n\n const listIds = useMemo(() => {\n if (!contactIds) {\n return undefined;\n }\n\n const filteredIds = filterUsersByName(contactIds, usersById, filter);\n\n return sortUserIds(filteredIds, usersById, userStatusesById, undefined, serverTimeOffset);\n }, [contactIds, filter, usersById, userStatusesById, serverTimeOffset]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, listIds, Boolean(filter));\n\n return (\n \n {viewportIds?.length ? (\n viewportIds.map((id) => (\n handleClick(id)}\n ripple={!IS_SINGLE_COLUMN_LAYOUT}\n >\n \n \n ))\n ) : viewportIds && !viewportIds.length ? (\n

\n {filter.length ? 'No contacts matched your search.' : 'Contact list is empty.'}\n

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: contactIds } = global.contactList || {};\n const { byId: usersById, statusesById: userStatusesById } = global.users;\n\n return {\n usersById,\n userStatusesById,\n contactIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ContactList));\n","import React, {\n FC, useCallback, useEffect, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { unique } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport { filterUsersByName, isUserBot, sortChatIds } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Button from '../../ui/Button';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n selectedMemberIds: string[];\n onSelectedMemberIdsChange: (ids: string[]) => void;\n onNextStep: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n localContactIds?: string[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: string[];\n globalUserIds?: string[];\n};\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst NewChatStep1: FC = ({\n isChannel,\n isActive,\n selectedMemberIds,\n onSelectedMemberIdsChange,\n onNextStep,\n onReset,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n}) => {\n const {\n loadContactList,\n setGlobalSearchQuery,\n } = getDispatch();\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const handleFilterChange = useCallback((query: string) => {\n setGlobalSearchQuery({ query });\n }, [setGlobalSearchQuery]);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const foundContactIds = localContactIds ? filterUsersByName(localContactIds, usersById, searchQuery) : [];\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n if (!user) {\n return true;\n }\n\n return !user.isSelf && (user.canBeInvitedToGroup || !isUserBot(user));\n }),\n chatsById,\n false,\n selectedMemberIds,\n );\n }, [localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, selectedMemberIds]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length || isChannel) {\n setGlobalSearchQuery({ query: '' });\n onNextStep();\n }\n }, [selectedMemberIds.length, isChannel, setGlobalSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n \n \n

{lang('GroupAddMembers')}

\n
\n
\n \n\n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: chatsById } = global.chats;\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalResults,\n localResults,\n } = global.globalSearch;\n const { userIds: globalUserIds } = globalResults || {};\n const { userIds: localUserIds } = localResults || {};\n\n return {\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus?.chats,\n globalUserIds,\n localUserIds,\n };\n },\n)(NewChatStep1));\n","import React, {\n FC, useState, useCallback, useEffect, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ChatCreationProgress } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport Button from '../../ui/Button';\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n memberIds: string[];\n onReset: (forceReturnToChatList?: boolean) => void;\n};\n\ntype StateProps = {\n creationProgress?: ChatCreationProgress;\n creationError?: string;\n};\n\n// TODO @implement\nconst MAX_USERS_FOR_LEGACY_CHAT = 199; // Accounting for current user\n\nconst NewChatStep2: FC = ({\n isChannel,\n isActive,\n memberIds,\n onReset,\n creationProgress,\n creationError,\n}) => {\n const {\n createGroupChat,\n createChannel,\n } = getDispatch();\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const [title, setTitle] = useState('');\n const [about, setAbout] = useState('');\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n\n const chatTitleEmptyError = 'Chat title can\\'t be empty';\n const channelTitleEmptyError = 'Channel title can\\'t be empty';\n const chatTooManyUsersError = 'Sorry, creating supergroups is not yet supported';\n\n const isLoading = creationProgress === ChatCreationProgress.InProgress;\n\n const handleTitleChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n const newValue = value.replace(/^\\s+/, '');\n\n setTitle(newValue);\n\n if (newValue !== value) {\n e.currentTarget.value = newValue;\n }\n }, []);\n\n const handleDescriptionChange = useCallback((e: React.ChangeEvent) => {\n setAbout(e.currentTarget.value);\n }, []);\n\n const handleCreateGroup = useCallback(() => {\n if (!title.length) {\n setError(chatTitleEmptyError);\n return;\n }\n\n if (memberIds.length > MAX_USERS_FOR_LEGACY_CHAT) {\n setError(chatTooManyUsersError);\n return;\n }\n\n createGroupChat({\n title,\n photo,\n memberIds,\n });\n }, [title, memberIds, createGroupChat, photo, chatTitleEmptyError, chatTooManyUsersError]);\n\n const handleCreateChannel = useCallback(() => {\n if (!title.length) {\n setError(channelTitleEmptyError);\n return;\n }\n\n createChannel({\n title,\n about,\n photo,\n memberIds,\n });\n }, [title, createChannel, about, photo, memberIds, channelTitleEmptyError]);\n\n useEffect(() => {\n if (creationProgress === ChatCreationProgress.Complete) {\n onReset(true);\n }\n }, [creationProgress, onReset]);\n\n const renderedError = (creationError && lang(creationError)) || (\n error !== chatTitleEmptyError && error !== channelTitleEmptyError\n ? error\n : undefined\n );\n\n return (\n
\n
\n onReset()}\n ariaLabel=\"Return to member selection\"\n >\n \n \n

{lang(isChannel ? 'NewChannel' : 'NewGroup')}

\n
\n
\n \n \n {isChannel && (\n <>\n \n

{lang('DescriptionInfo')}

\n \n )}\n\n {renderedError && (\n

{renderedError}

\n )}\n\n {memberIds.length > 0 && (\n <>\n

{lang('GroupInfo.ParticipantCount', memberIds.length, 'i')}

\n\n
\n {memberIds.map((id) => (\n \n \n \n ))}\n
\n \n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n progress: creationProgress,\n error: creationError,\n } = global.chatCreation || {};\n\n return {\n creationProgress,\n creationError,\n };\n },\n)(NewChatStep2));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../lib/teact/teact';\n\nimport { LeftColumnContent } from '../../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\n\nimport Transition from '../../ui/Transition';\nimport NewChatStep1 from './NewChatStep1';\nimport NewChatStep2 from './NewChatStep2';\n\nimport './NewChat.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n isChannel?: boolean;\n content: LeftColumnContent;\n onContentChange: (content: LeftColumnContent) => void;\n onReset: () => void;\n};\n\nconst RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\n\nconst NewChat: FC = ({\n isActive,\n isChannel = false,\n content,\n onContentChange,\n onReset,\n}) => {\n const [newChatMemberIds, setNewChatMemberIds] = useState([]);\n\n const handleNextStep = useCallback(() => {\n onContentChange(isChannel ? LeftColumnContent.NewChannelStep2 : LeftColumnContent.NewGroupStep2);\n }, [isChannel, onContentChange]);\n\n return (\n \n {(isStepActive) => {\n switch (content) {\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewGroupStep1:\n return (\n \n );\n case LeftColumnContent.NewChannelStep2:\n case LeftColumnContent.NewGroupStep2:\n return (\n \n );\n default:\n return undefined;\n }\n }}\n \n );\n};\n\nexport default memo(NewChat);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from '../ui/Button';\nimport ChatList from './main/ChatList';\nimport { LeftColumnContent } from '../../types';\n\nimport './ArchivedChats.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n onReset: () => void;\n onContentChange: (content: LeftColumnContent) => void;\n};\n\nconst ArchivedChats: FC = ({ isActive, onReset, onContentChange }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onContentChange, LeftColumnContent.Archived);\n\n return (\n
\n
\n \n \n \n

{lang('ArchivedChats')}

\n
\n \n
\n );\n};\n\nexport default memo(ArchivedChats);\n","import React, {\n FC, useCallback, memo, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatFolder } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport CheckboxGroup from '../ui/CheckboxGroup';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId: string;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n};\n\ntype StateProps = {\n foldersById?: Record;\n folderOrderedIds?: number[];\n};\n\nconst ChatFolderModal: FC = ({\n isOpen,\n chatId,\n foldersById,\n folderOrderedIds,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const { editChatFolders } = getDispatch();\n\n const lang = useLang();\n\n const initialSelectedFolderIds = useMemo(() => {\n if (!foldersById) {\n return [];\n }\n\n return Object.keys(foldersById).reduce((result, folderId) => {\n const { includedChatIds, pinnedChatIds } = foldersById[Number(folderId)];\n if (includedChatIds.includes(chatId) || pinnedChatIds?.includes(chatId)) {\n result.push(folderId);\n }\n\n return result;\n }, [] as string[]);\n }, [chatId, foldersById]);\n\n const [selectedFolderIds, setSelectedFolderIds] = useState(initialSelectedFolderIds);\n\n const folders = useMemo(() => {\n return folderOrderedIds?.map((folderId) => ({\n label: foldersById ? foldersById[folderId].title : '',\n value: String(folderId),\n })) || [];\n }, [folderOrderedIds, foldersById]);\n\n const handleSubmit = useCallback(() => {\n const idsToRemove = initialSelectedFolderIds.filter((id) => !selectedFolderIds.includes(id)).map(Number);\n const idsToAdd = selectedFolderIds.filter((id) => !initialSelectedFolderIds.includes(id)).map(Number);\n\n editChatFolders({ chatId, idsToRemove, idsToAdd });\n onClose();\n }, [chatId, editChatFolders, initialSelectedFolderIds, onClose, selectedFolderIds]);\n\n if (!foldersById || !folderOrderedIds) {\n return undefined;\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: foldersById, orderedIds: folderOrderedIds } = global.chatFolders;\n\n return {\n foldersById,\n folderOrderedIds,\n };\n },\n)(ChatFolderModal));\n","import { ApiMediaFormat, ApiMessage } from '../../../../api/types';\n\nimport * as mediaLoader from '../../../../util/mediaLoader';\nimport {\n getMessageMediaHash,\n getMessagePhoto,\n getMessageText,\n getMessageTextWithSpoilers,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n hasMessageLocalBlobUrl,\n} from '../../../../modules/helpers';\nimport { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard';\nimport getMessageIdsForSelectedText from '../../../../util/getMessageIdsForSelectedText';\n\ntype ICopyOptions = {\n label: string;\n handler: () => void;\n}[];\n\nexport function getMessageCopyOptions(\n message: ApiMessage,\n afterEffect?: () => void,\n onCopyLink?: () => void,\n onCopyMessages?: (messageIds: number[]) => void,\n): ICopyOptions {\n const options: ICopyOptions = [];\n const text = getMessageText(message);\n const photo = getMessagePhoto(message)\n || (!getMessageWebPageVideo(message) ? getMessageWebPagePhoto(message) : undefined);\n const mediaHash = getMessageMediaHash(message, 'inline');\n const canImageBeCopied = photo && (mediaHash || hasMessageLocalBlobUrl(message)) && CLIPBOARD_ITEM_SUPPORTED;\n const selection = window.getSelection();\n\n if (canImageBeCopied) {\n options.push({\n label: 'lng_context_copy_image',\n handler: () => {\n Promise.resolve(mediaHash ? mediaLoader.fetch(mediaHash, ApiMediaFormat.BlobUrl) : photo!.blobUrl)\n .then(copyImageToClipboard);\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (text) {\n // Detect if the user has selection in the current message\n const hasSelection = Boolean((\n selection?.anchorNode?.parentNode\n && (selection.anchorNode.parentNode as HTMLElement).closest('.Message .content-inner')\n && selection.toString().replace(/(?:\\r\\n|\\r|\\n)/g, '') !== ''\n ));\n\n options.push({\n label: getCopyLabel(hasSelection),\n handler: () => {\n const messageIds = getMessageIdsForSelectedText();\n if (messageIds?.length && onCopyMessages) {\n onCopyMessages(messageIds);\n } else {\n const clipboardText = hasSelection && selection ? selection.toString() : getMessageTextWithSpoilers(message)!;\n copyTextToClipboard(clipboardText);\n }\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (onCopyLink) {\n options.push({\n label: 'lng_context_copy_message_link',\n handler: () => {\n onCopyLink();\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n return options;\n}\n\nfunction getCopyLabel(hasSelection: boolean): string {\n if (hasSelection) {\n return 'lng_context_copy_selected';\n }\n return 'lng_context_copy_text';\n}\n","let scrollLockEl: HTMLElement | null | undefined;\nlet excludedClosestSelector: string | undefined;\n\nconst IGNORED_KEYS: Record = {\n Down: true,\n ArrowDown: true,\n Up: true,\n ArrowUp: true,\n Left: true,\n ArrowLeft: true,\n Right: true,\n ArrowRight: true,\n ' ': true,\n PageUp: true,\n PageDown: true,\n End: true,\n Home: true,\n Tab: true,\n};\n\nfunction isTextBox(target: EventTarget | null) {\n if (!target || !(target instanceof HTMLElement)) return false;\n const element = target;\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'textarea') return true;\n if (tagName !== 'input') return false;\n const type = element.getAttribute('type');\n if (!type) return false;\n const inputTypes = [\n 'text', 'password', 'number', 'email', 'tel', 'url',\n 'search', 'date', 'datetime', 'datetime-local', 'time', 'month', 'week',\n ];\n return inputTypes.indexOf(type.toLowerCase()) > -1;\n}\n\nexport const getTouchY = (e: WheelEvent | TouchEvent | React.WheelEvent | React.TouchEvent) => {\n return ('changedTouches' in e ? e.changedTouches[0].clientY : 0);\n};\n\nconst preventDefault = (e: WheelEvent | TouchEvent) => {\n const deltaY = 'deltaY' in e ? e.deltaY : getTouchY(e);\n\n if (\n !scrollLockEl\n // Allow overlay scrolling\n || !scrollLockEl.contains(e.target as HTMLElement)\n // Prevent top overscroll\n || (scrollLockEl.scrollTop <= 0 && deltaY <= 0)\n // Prevent bottom overscroll\n || (scrollLockEl.scrollTop >= (scrollLockEl.scrollHeight - scrollLockEl.offsetHeight) && deltaY >= 0)\n ) {\n if (excludedClosestSelector && (e.target as HTMLElement).closest(excludedClosestSelector)) return;\n e.preventDefault();\n }\n};\n\nfunction preventDefaultForScrollKeys(e: KeyboardEvent) {\n if (IGNORED_KEYS[e.key] && !isTextBox(e.target)) {\n e.preventDefault();\n }\n}\n\nexport function disableScrolling(el?: HTMLElement | null, _excludedClosestSelector?: string) {\n scrollLockEl = el;\n excludedClosestSelector = _excludedClosestSelector;\n // Disable scrolling in Chrome\n document.addEventListener('wheel', preventDefault, { passive: false });\n document.addEventListener('touchmove', preventDefault, { passive: false });\n document.onkeydown = preventDefaultForScrollKeys;\n}\n\nexport function enableScrolling() {\n scrollLockEl = undefined;\n excludedClosestSelector = undefined;\n document.removeEventListener('wheel', preventDefault); // Enable scrolling in Chrome\n document.removeEventListener('touchmove', preventDefault);\n // eslint-disable-next-line no-null/no-null\n document.onkeydown = null;\n}\n","import React, {\n FC, memo, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types';\n\nimport useMedia from '../../../hooks/useMedia';\nimport useFlag from '../../../hooks/useFlag';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { createClassNameBuilder } from '../../../util/buildClassName';\nimport { IS_COMPACT_MENU } from '../../../util/environment';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\nimport './ReactionSelectorReaction.scss';\n\nconst REACTION_SIZE = IS_COMPACT_MENU ? 24 : 32;\n\ntype OwnProps = {\n reaction: ApiAvailableReaction;\n previewIndex: number;\n isReady?: boolean;\n onSendReaction: (reaction: string, x: number, y: number) => void;\n};\n\nconst cn = createClassNameBuilder('ReactionSelectorReaction');\n\nconst ReactionSelectorReaction: FC = ({ reaction, previewIndex, onSendReaction, isReady }) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const mediaData = useMedia(`document${reaction.selectAnimation?.id}`, !isReady, ApiMediaFormat.Lottie);\n\n const [isActivated, activate, deactivate] = useFlag();\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n\n const shouldRenderAnimated = Boolean(isReady && mediaData);\n const { transitionClassNames: animatedClassNames } = useShowTransition(shouldRenderAnimated);\n const { shouldRender: shouldRenderStatic, transitionClassNames: staticClassNames } = useShowTransition(\n !isReady || !isAnimationLoaded, undefined, true,\n );\n\n function handleClick() {\n if (!containerRef.current) return;\n const { x, y } = containerRef.current.getBoundingClientRect();\n\n onSendReaction(reaction.reaction, x, y);\n }\n\n return (\n \n {shouldRenderStatic && (\n \n )}\n {shouldRenderAnimated && (\n \n )}\n
\n );\n};\n\nexport default memo(ReactionSelectorReaction);\n","import React, {\n FC, memo, useLayoutEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction } from '../../../api/types';\n\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useFlag from '../../../hooks/useFlag';\nimport { getTouchY } from '../../../util/scrollLock';\nimport { createClassNameBuilder } from '../../../util/buildClassName';\nimport { IS_COMPACT_MENU } from '../../../util/environment';\n\nimport ReactionSelectorReaction from './ReactionSelectorReaction';\n\nimport './ReactionSelector.scss';\n\ntype OwnProps = {\n enabledReactions?: string[];\n onSendReaction: (reaction: string, x: number, y: number) => void;\n isPrivate?: boolean;\n availableReactions?: ApiAvailableReaction[];\n isReady?: boolean;\n};\n\nconst cn = createClassNameBuilder('ReactionSelector');\n\nconst ReactionSelector: FC = ({\n availableReactions,\n enabledReactions,\n onSendReaction,\n isPrivate,\n isReady,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const itemsScrollRef = useRef(null);\n const [isHorizontalScrollEnabled, enableHorizontalScroll] = useFlag(false);\n useHorizontalScroll(itemsScrollRef.current, !isHorizontalScrollEnabled);\n\n useLayoutEffect(() => {\n enableHorizontalScroll();\n }, [enableHorizontalScroll]);\n\n const handleWheel = (e: React.WheelEvent | React.TouchEvent) => {\n if (!itemsScrollRef) return;\n const deltaY = 'deltaY' in e ? e.deltaY : getTouchY(e);\n\n if (deltaY) {\n e.preventDefault();\n }\n };\n\n if ((!isPrivate && !enabledReactions?.length) || !availableReactions) return undefined;\n\n return (\n
\n
\n
\n
\n
\n {availableReactions?.map((reaction, i) => {\n if (reaction.isInactive\n || (!isPrivate && (!enabledReactions || !enabledReactions.includes(reaction.reaction)))) return undefined;\n return (\n \n );\n })}\n
\n
\n
\n );\n};\n\nexport default memo(ReactionSelector);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMessage, ApiUser } from '../../../api/types';\nimport { IAnchorPosition } from '../../../types';\n\nimport { getMessageCopyOptions } from './helpers/copyOptions';\nimport { disableScrolling, enableScrolling } from '../../../util/scrollLock';\nimport useContextMenuPosition from '../../../hooks/useContextMenuPosition';\nimport useLang from '../../../hooks/useLang';\nimport buildClassName from '../../../util/buildClassName';\nimport useFlag from '../../../hooks/useFlag';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\nimport Avatar from '../../common/Avatar';\nimport ReactionSelector from './ReactionSelector';\n\nimport './MessageContextMenu.scss';\n\ntype OwnProps = {\n availableReactions?: ApiAvailableReaction[];\n isOpen: boolean;\n anchor: IAnchorPosition;\n message: ApiMessage;\n canSendNow?: boolean;\n enabledReactions?: string[];\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canShowReactionsCount?: boolean;\n canShowReactionList?: boolean;\n canRemoveReaction?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n isPrivate?: boolean;\n canDownload?: boolean;\n isDownloading?: boolean;\n canShowSeenBy?: boolean;\n seenByRecentUsers?: ApiUser[];\n onReply: () => void;\n onEdit: () => void;\n onPin: () => void;\n onUnpin: () => void;\n onForward: () => void;\n onDelete: () => void;\n onReport: () => void;\n onFaveSticker: () => void;\n onUnfaveSticker: () => void;\n onSelect: () => void;\n onSend: () => void;\n onReschedule: () => void;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onCopyLink?: () => void;\n onCopyMessages?: (messageIds: number[]) => void;\n onDownload?: () => void;\n onShowSeenBy?: () => void;\n onShowReactors?: () => void;\n onSendReaction: (reaction: string | undefined, x: number, y: number) => void;\n};\n\nconst SCROLLBAR_WIDTH = 10;\nconst REACTION_BUBBLE_EXTRA_WIDTH = 32;\nconst ANIMATION_DURATION = 200;\n\nconst MessageContextMenu: FC = ({\n availableReactions,\n isOpen,\n message,\n isPrivate,\n enabledReactions,\n anchor,\n canSendNow,\n canReschedule,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n isDownloading,\n canShowSeenBy,\n canShowReactionsCount,\n canRemoveReaction,\n canShowReactionList,\n seenByRecentUsers,\n onReply,\n onEdit,\n onPin,\n onUnpin,\n onForward,\n onDelete,\n onReport,\n onFaveSticker,\n onUnfaveSticker,\n onSelect,\n onSend,\n onReschedule,\n onClose,\n onCloseAnimationEnd,\n onCopyLink,\n onDownload,\n onShowSeenBy,\n onShowReactors,\n onSendReaction,\n onCopyMessages,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const scrollableRef = useRef(null);\n const copyOptions = getMessageCopyOptions(message, onClose, canCopyLink ? onCopyLink : undefined, onCopyMessages);\n const noReactions = !isPrivate && !enabledReactions?.length;\n const withReactions = canShowReactionList && !noReactions;\n\n const [isReady, markIsReady, unmarkIsReady] = useFlag();\n\n const getTriggerElement = useCallback(() => {\n return document.querySelector(`.Transition__slide--active > .MessageList div[data-message-id=\"${message.id}\"]`);\n }, [message.id]);\n\n const getRootElement = useCallback(\n () => document.querySelector('.Transition__slide--active > .MessageList'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => document.querySelector('.MessageContextMenu .bubble'),\n [],\n );\n\n const getLayout = useCallback(() => {\n const extraHeightAudioPlayer = (IS_SINGLE_COLUMN_LAYOUT\n && (document.querySelector('.AudioPlayer-content'))?.offsetHeight) || 0;\n const pinnedElement = document.querySelector('.HeaderPinnedMessage-wrapper');\n const extraHeightPinned = (((IS_SINGLE_COLUMN_LAYOUT && !extraHeightAudioPlayer)\n || (!IS_SINGLE_COLUMN_LAYOUT && pinnedElement?.classList.contains('full-width')))\n && pinnedElement?.offsetHeight) || 0;\n\n return {\n extraPaddingX: SCROLLBAR_WIDTH,\n extraTopPadding: (document.querySelector('.MiddleHeader')!).offsetHeight,\n marginSides: withReactions ? REACTION_BUBBLE_EXTRA_WIDTH : undefined,\n extraMarginTop: extraHeightPinned + extraHeightAudioPlayer,\n };\n }, [withReactions]);\n\n const handleRemoveReaction = useCallback(() => {\n onSendReaction(undefined, 0, 0);\n }, [onSendReaction]);\n\n useEffect(() => {\n if (!isOpen) {\n unmarkIsReady();\n return;\n }\n\n setTimeout(() => {\n markIsReady();\n }, ANIMATION_DURATION);\n }, [isOpen, markIsReady, unmarkIsReady]);\n\n const {\n positionX, positionY, transformOriginX, transformOriginY, style, menuStyle, withScroll,\n } = useContextMenuPosition(anchor, getTriggerElement, getRootElement, getMenuElement, getLayout);\n\n useEffect(() => {\n disableScrolling(withScroll ? scrollableRef.current : undefined, '.ReactionSelector');\n\n return enableScrolling;\n }, [withScroll]);\n\n const lang = useLang();\n\n return (\n \n {canShowReactionList && (\n \n )}\n\n \n {canRemoveReaction && Remove Reaction}\n {canSendNow && {lang('MessageScheduleSend')}}\n {canReschedule && (\n {lang('MessageScheduleEditTime')}\n )}\n {canReply && {lang('Reply')}}\n {canEdit && {lang('Edit')}}\n {canFaveSticker && (\n {lang('AddToFavorites')}\n )}\n {canUnfaveSticker && (\n {lang('Stickers.RemoveFromFavorites')}\n )}\n {canCopy && copyOptions.map((options) => (\n {lang(options.label)}\n ))}\n {canPin && {lang('DialogPin')}}\n {canUnpin && {lang('DialogUnpin')}}\n {canDownload && (\n \n {isDownloading ? lang('lng_context_cancel_download') : lang('lng_media_download')}\n \n )}\n {canForward && {lang('Forward')}}\n {canSelect && {lang('Common.Select')}}\n {canReport && {lang('lng_context_report_msg')}}\n {(canShowSeenBy || canShowReactionsCount) && (\n \n {canShowReactionsCount && message.reactors?.count ? (\n canShowSeenBy && message.seenByUserIds?.length\n ? lang('Chat.OutgoingContextMixedReactionCount', [message.reactors.count, message.seenByUserIds.length])\n : lang('Chat.ContextReactionCount', message.reactors.count, 'i')\n ) : (\n message.seenByUserIds?.length\n ? lang('Conversation.ContextMenuSeen', message.seenByUserIds.length, 'i')\n : lang('Conversation.ContextMenuNoViews')\n )}\n
\n {seenByRecentUsers?.map((user) => (\n \n ))}\n
\n \n )}\n {canDelete && {lang('Delete')}}\n
\n \n );\n};\n\nexport default memo(MessageContextMenu);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { MessageListType } from '../../../global/types';\nimport { ApiAvailableReaction, ApiMessage } from '../../../api/types';\nimport { IAlbum, IAnchorPosition } from '../../../types';\nimport {\n selectActiveDownloadIds,\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectIsMessageProtected,\n} from '../../../modules/selectors';\nimport {\n isActionMessage, isChatChannel,\n isChatGroup, isOwnMessage, areReactionsEmpty, isUserId, isMessageLocal,\n} from '../../../modules/helpers';\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../../../config';\nimport { getDayStartAt } from '../../../util/dateFormat';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport { REM } from '../../common/helpers/mediaDimensions';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal';\nimport ReportMessageModal from '../../common/ReportMessageModal';\nimport PinMessageModal from '../../common/PinMessageModal';\nimport MessageContextMenu from './MessageContextMenu';\nimport CalendarModal from '../../common/CalendarModal';\nimport buildClassName from '../../../util/buildClassName';\n\nconst START_SIZE = 2 * REM;\n\nexport type OwnProps = {\n isOpen: boolean;\n chatUsername?: string;\n message: ApiMessage;\n album?: IAlbum;\n anchor: IAnchorPosition;\n messageListType: MessageListType;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n availableReactions?: ApiAvailableReaction[];\n noOptions?: boolean;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canShowReactionsCount?: boolean;\n canShowReactionList?: boolean;\n canRemoveReaction?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n isPrivate?: boolean;\n hasFullInfo?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n canDownload?: boolean;\n activeDownloads: number[];\n canShowSeenBy?: boolean;\n enabledReactions?: string[];\n};\n\nconst ContextMenuContainer: FC = ({\n availableReactions,\n isOpen,\n messageListType,\n chatUsername,\n message,\n album,\n anchor,\n onClose,\n onCloseAnimationEnd,\n noOptions,\n canSendNow,\n hasFullInfo,\n canReschedule,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canShowReactionsCount,\n canShowReactionList,\n canRemoveReaction,\n canEdit,\n enabledReactions,\n isPrivate,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n activeDownloads,\n canShowSeenBy,\n}) => {\n const {\n setReplyingToId,\n setEditingId,\n pinMessage,\n openForwardMenu,\n faveSticker,\n unfaveSticker,\n toggleMessageSelection,\n sendScheduledMessages,\n rescheduleMessage,\n downloadMessageMedia,\n cancelMessageMediaDownload,\n loadSeenBy,\n openSeenByModal,\n sendReaction,\n openReactorListModal,\n loadFullChat,\n loadReactors,\n copyMessagesByIds,\n } = getDispatch();\n\n const { transitionClassNames } = useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const [isReportModalOpen, setIsReportModalOpen] = useState(false);\n const [isPinModalOpen, setIsPinModalOpen] = useState(false);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n\n useEffect(() => {\n if (canShowSeenBy && isOpen) {\n loadSeenBy({ chatId: message.chatId, messageId: message.id });\n }\n }, [loadSeenBy, isOpen, message.chatId, message.id, canShowSeenBy]);\n\n useEffect(() => {\n if (canShowReactionsCount && isOpen) {\n loadReactors({ chatId: message.chatId, messageId: message.id });\n }\n }, [canShowReactionsCount, isOpen, loadReactors, message.chatId, message.id]);\n\n useEffect(() => {\n if (!hasFullInfo && !isPrivate && isOpen) {\n loadFullChat({ chatId: message.chatId });\n }\n }, [hasFullInfo, isOpen, isPrivate, loadFullChat, message.chatId]);\n\n const seenByRecentUsers = useMemo(() => {\n if (message.reactions?.recentReactions?.length) {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return message.reactions?.recentReactions?.slice(0, 3).map(({ userId }) => usersById[userId]).filter(Boolean);\n }\n\n if (!message.seenByUserIds) {\n return undefined;\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n return message.seenByUserIds?.slice(0, 3).map((id) => usersById[id]).filter(Boolean);\n }, [message.reactions?.recentReactions, message.seenByUserIds]);\n\n const isDownloading = album ? album.messages.some((msg) => activeDownloads.includes(msg.id))\n : activeDownloads.includes(message.id);\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const handleReport = useCallback(() => {\n setIsMenuOpen(false);\n setIsReportModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closeReportModal = useCallback(() => {\n setIsReportModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closePinModal = useCallback(() => {\n setIsPinModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n onClose();\n }, [closeCalendar, onClose]);\n\n const handleReply = useCallback(() => {\n setReplyingToId({ messageId: message.id });\n closeMenu();\n }, [setReplyingToId, message.id, closeMenu]);\n\n const handleEdit = useCallback(() => {\n setEditingId({ messageId: message.id });\n closeMenu();\n }, [setEditingId, message.id, closeMenu]);\n\n const handlePin = useCallback(() => {\n setIsMenuOpen(false);\n setIsPinModalOpen(true);\n }, []);\n\n const handleUnpin = useCallback(() => {\n pinMessage({ messageId: message.id, isUnpin: true });\n closeMenu();\n }, [pinMessage, message.id, closeMenu]);\n\n const handleForward = useCallback(() => {\n closeMenu();\n if (album?.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: message.chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: message.chatId, messageIds: [message.id] });\n }\n }, [openForwardMenu, message, closeMenu, album]);\n\n const handleFaveSticker = useCallback(() => {\n closeMenu();\n faveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, faveSticker]);\n\n const handleUnfaveSticker = useCallback(() => {\n closeMenu();\n unfaveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, unfaveSticker]);\n\n const handleSelectMessage = useCallback(() => {\n const params = album?.messages\n ? {\n messageId: message.id,\n childMessageIds: album.messages.map(({ id }) => id),\n withShift: false,\n }\n : { messageId: message.id, withShift: false };\n\n toggleMessageSelection(params);\n closeMenu();\n }, [closeMenu, message.id, toggleMessageSelection, album]);\n\n const handleScheduledMessageSend = useCallback(() => {\n sendScheduledMessages({ chatId: message.chatId, id: message.id });\n closeMenu();\n }, [closeMenu, message.chatId, message.id, sendScheduledMessages]);\n\n const handleOpenCalendar = useCallback(() => {\n setIsMenuOpen(false);\n openCalendar();\n }, [openCalendar]);\n\n const handleOpenSeenByModal = useCallback(() => {\n closeMenu();\n openSeenByModal({ chatId: message.chatId, messageId: message.id });\n }, [closeMenu, message.chatId, message.id, openSeenByModal]);\n\n const handleOpenReactorListModal = useCallback(() => {\n closeMenu();\n openReactorListModal({ chatId: message.chatId, messageId: message.id });\n }, [closeMenu, openReactorListModal, message.chatId, message.id]);\n\n const handleRescheduleMessage = useCallback((date: Date) => {\n rescheduleMessage({\n chatId: message.chatId,\n messageId: message.id,\n scheduledAt: Math.round(date.getTime() / 1000),\n });\n }, [message.chatId, message.id, rescheduleMessage]);\n\n const handleCopyMessages = useCallback((messageIds: number[]) => {\n copyMessagesByIds({ messageIds });\n closeMenu();\n }, [closeMenu, copyMessagesByIds]);\n\n const handleCopyLink = useCallback(() => {\n copyTextToClipboard(`https://t.me/${chatUsername || `c/${message.chatId.replace('-', '')}`}/${message.id}`);\n closeMenu();\n }, [chatUsername, closeMenu, message.chatId, message.id]);\n\n const handleDownloadClick = useCallback(() => {\n (album?.messages || [message]).forEach((msg) => {\n if (isDownloading) {\n cancelMessageMediaDownload({ message: msg });\n } else {\n downloadMessageMedia({ message: msg });\n }\n });\n closeMenu();\n }, [album, message, closeMenu, isDownloading, cancelMessageMediaDownload, downloadMessageMedia]);\n\n const handleSendReaction = useCallback((reaction: string | undefined, x: number, y: number) => {\n sendReaction({\n chatId: message.chatId, messageId: message.id, reaction, x, y, startSize: START_SIZE,\n });\n closeMenu();\n }, [closeMenu, message.chatId, message.id, sendReaction]);\n\n const reportMessageIds = useMemo(() => (album ? album.messages : [message]).map(({ id }) => id), [album, message]);\n\n if (noOptions) {\n closeMenu();\n\n return undefined;\n }\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n return (\n
\n \n \n \n \n {canReschedule && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message, messageListType }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const activeDownloads = selectActiveDownloadIds(global, message.chatId);\n const chat = selectChat(global, message.chatId);\n const { seenByExpiresAt, seenByMaxChatMembers } = global.appConfig || {};\n const {\n noOptions,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canEdit,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const isPinned = messageListType === 'pinned';\n const isScheduled = messageListType === 'scheduled';\n const isChannel = chat && isChatChannel(chat);\n const isLocal = isMessageLocal(message);\n const canShowSeenBy = Boolean(chat\n && seenByMaxChatMembers\n && seenByExpiresAt\n && isChatGroup(chat)\n && isOwnMessage(message)\n && !isScheduled\n && chat.membersCount\n && chat.membersCount < seenByMaxChatMembers\n && message.date > Date.now() / 1000 - seenByExpiresAt);\n const isPrivate = chat && isUserId(chat.id);\n const isAction = isActionMessage(message);\n const canShowReactionsCount = !isLocal && !isChannel && !isScheduled && !isAction && !isPrivate && message.reactions\n && !areReactionsEmpty(message.reactions) && message.reactions.canSeeList;\n const canRemoveReaction = isPrivate && message.reactions?.results?.some((l) => l.isChosen);\n const isProtected = selectIsMessageProtected(global, message);\n\n return {\n availableReactions: global.availableReactions,\n noOptions,\n canSendNow: isScheduled,\n canReschedule: isScheduled,\n canReply: !isPinned && !isScheduled && canReply,\n canPin: !isScheduled && canPin,\n canUnpin: !isScheduled && canUnpin,\n canDelete,\n canReport,\n canEdit: !isPinned && canEdit,\n canForward: !isProtected && !isScheduled && canForward,\n canFaveSticker: !isScheduled && canFaveSticker,\n canUnfaveSticker: !isScheduled && canUnfaveSticker,\n canCopy: !isProtected && canCopy,\n canCopyLink: !isProtected && !isScheduled && canCopyLink,\n canSelect,\n canDownload: !isProtected && canDownload,\n activeDownloads,\n canShowSeenBy,\n enabledReactions: chat?.fullInfo?.enabledReactions,\n isPrivate,\n hasFullInfo: Boolean(chat?.fullInfo),\n canShowReactionsCount,\n canShowReactionList: !isLocal && !isAction && !isScheduled && chat?.id !== SERVICE_NOTIFICATIONS_USER_ID,\n canRemoveReaction,\n };\n },\n)(ContextMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiStickerSet } from '../../api/types';\n\nimport { STICKER_SIZE_MODAL } from '../../config';\nimport {\n selectChat, selectCurrentMessageList, selectStickerSet, selectStickerSetByShortName,\n} from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\nimport { getAllowedAttachmentOptions, getCanPostInChat } from '../../modules/helpers';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Loading from '../ui/Loading';\nimport StickerButton from './StickerButton';\n\nimport './StickerSetModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n fromSticker?: ApiSticker;\n stickerSetShortName?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n canSendStickers?: boolean;\n stickerSet?: ApiStickerSet;\n};\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerSetModal: FC = ({\n isOpen,\n fromSticker,\n stickerSetShortName,\n stickerSet,\n canSendStickers,\n onClose,\n}) => {\n const {\n loadStickers,\n toggleStickerSet,\n sendMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const lang = useLang();\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });\n\n useEffect(() => {\n if (isOpen) {\n if (fromSticker) {\n const { stickerSetId, stickerSetAccessHash } = fromSticker;\n loadStickers({\n stickerSetId,\n stickerSetAccessHash,\n });\n } else if (stickerSetShortName) {\n loadStickers({\n stickerSetShortName,\n });\n }\n }\n }, [isOpen, fromSticker, loadStickers, stickerSetShortName]);\n\n const handleSelect = useCallback((sticker: ApiSticker) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n sendMessage({ sticker });\n onClose();\n }, [onClose, sendMessage]);\n\n const handleButtonClick = useCallback(() => {\n if (stickerSet) {\n toggleStickerSet({ stickerSetId: stickerSet.id });\n onClose();\n }\n }, [onClose, stickerSet, toggleStickerSet]);\n\n return (\n \n {stickerSet?.stickers ? (\n <>\n
\n {stickerSet.stickers.map((sticker) => (\n \n ))}\n
\n
\n \n {lang(\n stickerSet.installedDate ? 'StickerPack.RemoveStickerCount' : 'StickerPack.AddStickerCount',\n stickerSet.count,\n 'i',\n )}\n \n
\n \n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { fromSticker, stickerSetShortName }): StateProps => {\n const currentMessageList = selectCurrentMessageList(global);\n const { chatId, threadId } = currentMessageList || {};\n const chat = chatId && selectChat(global, chatId);\n const sendOptions = chat ? getAllowedAttachmentOptions(chat) : undefined;\n const canSendStickers = Boolean(\n chat && threadId && getCanPostInChat(chat, threadId) && sendOptions?.canSendStickers,\n );\n\n return {\n canSendStickers,\n stickerSet: fromSticker\n ? selectStickerSet(global, fromSticker.stickerSetId)\n : stickerSetShortName\n ? selectStickerSetByShortName(global, stickerSetShortName)\n : undefined,\n };\n },\n)(StickerSetModal));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { disableScrolling, enableScrolling } from '../../util/scrollLock';\nimport {\n selectChat, selectNotifySettings, selectNotifyExceptions, selectUser,\n} from '../../modules/selectors';\nimport {\n isUserId, getCanDeleteChat, selectIsChatMuted, getCanAddContact,\n} from '../../modules/helpers';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Portal from '../ui/Portal';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\nimport DeleteChatModal from '../common/DeleteChatModal';\n\nimport './HeaderMenuContainer.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId: number;\n isOpen: boolean;\n withExtraActions: boolean;\n anchor: IAnchorPosition;\n isChannel?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canCall?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n canEnterVoiceChat?: boolean;\n canCreateVoiceChat?: boolean;\n onSubscribeChannel: () => void;\n onSearchClick: () => void;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isPrivate?: boolean;\n isMuted?: boolean;\n canAddContact?: boolean;\n canDeleteChat?: boolean;\n hasLinkedChat?: boolean;\n};\n\nconst HeaderMenuContainer: FC = ({\n chatId,\n isOpen,\n withExtraActions,\n anchor,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canCall,\n canMute,\n canLeave,\n canEnterVoiceChat,\n canCreateVoiceChat,\n chat,\n isPrivate,\n isMuted,\n canDeleteChat,\n hasLinkedChat,\n canAddContact,\n onSubscribeChannel,\n onSearchClick,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const {\n updateChatMutedState,\n enterMessageSelectMode,\n sendBotCommand,\n restartBot,\n joinGroupCall,\n createGroupCall,\n openLinkedChat,\n addContact,\n openCallFallbackConfirm,\n } = getDispatch();\n\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const { x, y } = anchor;\n\n useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleToggleMuteClick = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n closeMenu();\n }, [chatId, closeMenu, isMuted, updateChatMutedState]);\n\n const handleEnterVoiceChatClick = useCallback(() => {\n if (canCreateVoiceChat) {\n // TODO show popup to schedule\n createGroupCall({\n chatId,\n });\n } else {\n joinGroupCall({\n chatId,\n });\n }\n closeMenu();\n }, [closeMenu, canCreateVoiceChat, chatId, joinGroupCall, createGroupCall]);\n\n const handleLinkedChatClick = useCallback(() => {\n openLinkedChat({ id: chatId });\n closeMenu();\n }, [chatId, closeMenu, openLinkedChat]);\n\n const handleAddContactClick = useCallback(() => {\n addContact({ userId: chatId });\n closeMenu();\n }, [addContact, chatId, closeMenu]);\n\n const handleSubscribe = useCallback(() => {\n onSubscribeChannel();\n closeMenu();\n }, [closeMenu, onSubscribeChannel]);\n\n const handleCall = useCallback(() => {\n openCallFallbackConfirm();\n closeMenu();\n }, [closeMenu, openCallFallbackConfirm]);\n\n const handleSearch = useCallback(() => {\n onSearchClick();\n closeMenu();\n }, [closeMenu, onSearchClick]);\n\n const handleSelectMessages = useCallback(() => {\n enterMessageSelectMode();\n closeMenu();\n }, [closeMenu, enterMessageSelectMode]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\n\n const lang = useLang();\n\n return (\n \n
\n \n {withExtraActions && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {withExtraActions && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {withExtraActions && canSubscribe && (\n \n {lang(isChannel ? 'ProfileJoinChannel' : 'ProfileJoinGroup')}\n \n )}\n {canAddContact && (\n \n {lang('AddContact')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canCall && (\n \n {lang('Call')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n {lang('Search')}\n \n )}\n {canMute && (\n \n {lang(isMuted ? 'ChatsUnmute' : 'ChatsMute')}\n \n )}\n {(canEnterVoiceChat || canCreateVoiceChat) && (\n \n {lang(canCreateVoiceChat ? 'StartVoipChat' : 'VoipGroupJoinCall')}\n \n )}\n {hasLinkedChat && (\n \n {lang(isChannel ? 'ViewDiscussion' : 'lng_profile_view_channel')}\n \n )}\n \n {lang('ReportSelectMessages')}\n \n {canLeave && (\n \n {lang(isPrivate\n ? 'DeleteChatUser'\n : (canDeleteChat ? 'GroupInfo.DeleteAndExit' : (isChannel ? 'LeaveChannel' : 'Group.LeaveGroup')))}\n \n )}\n \n {chat && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n const isPrivate = isUserId(chat.id);\n const user = isPrivate ? selectUser(global, chatId) : undefined;\n const canAddContact = user && getCanAddContact(user);\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n isPrivate,\n canAddContact,\n canDeleteChat: getCanDeleteChat(chat),\n hasLinkedChat: Boolean(chat?.fullInfo?.linkedChatId),\n };\n },\n)(HeaderMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\n\nimport { debounce } from '../../util/schedulers';\nimport { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors';\nimport { getDayStartAt } from '../../util/dateFormat';\n\nimport Button from '../ui/Button';\nimport SearchInput from '../ui/SearchInput';\n\nimport './MobileSearch.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n};\n\ntype StateProps = {\n isActive?: boolean;\n chat?: ApiChat;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n isHistoryCalendarOpen?: boolean;\n};\n\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nconst MobileSearchFooter: FC = ({\n isActive,\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen,\n}) => {\n const {\n setLocalTextSearchQuery,\n searchTextMessagesLocal,\n focusMessage,\n closeLocalTextSearch,\n openHistoryCalendar,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [focusedIndex, setFocusedIndex] = useState(0);\n\n // Fix for iOS keyboard\n useEffect(() => {\n const { visualViewport } = window as any;\n if (!visualViewport) {\n return undefined;\n }\n\n const mainEl = document.getElementById('Main') as HTMLDivElement;\n const handleResize = () => {\n const { activeElement } = document;\n if (activeElement && (activeElement === inputRef.current)) {\n const { pageTop, height } = visualViewport;\n mainEl.style.transform = `translateY(${pageTop}px)`;\n mainEl.style.height = `${height}px`;\n document.documentElement.scrollTop = pageTop;\n } else {\n mainEl.style.transform = '';\n mainEl.style.height = '';\n }\n };\n\n visualViewport.addEventListener('resize', handleResize);\n\n return () => {\n visualViewport.removeEventListener('resize', handleResize);\n };\n }, []);\n\n // Focus message\n useEffect(() => {\n if (chat?.id && foundIds?.length) {\n focusMessage({ chatId: chat.id, messageId: foundIds[0] });\n setFocusedIndex(0);\n } else {\n setFocusedIndex(-1);\n }\n }, [chat?.id, focusMessage, foundIds]);\n\n // Disable native up/down buttons on iOS\n useEffect(() => {\n Array.from(document.querySelectorAll('input')).forEach((input) => {\n input.disabled = Boolean(isActive && input !== inputRef.current);\n });\n\n Array.from(document.querySelectorAll('div[contenteditable]')).forEach((div) => {\n div.contentEditable = isActive ? 'false' : 'true';\n });\n }, [isActive]);\n\n // Blur on exit\n useEffect(() => {\n if (!isActive) {\n inputRef.current!.blur();\n }\n }, [isActive]);\n\n useLayoutEffect(() => {\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.blur();\n }, [isHistoryCalendarOpen]);\n\n const handleMessageSearchQueryChange = useCallback((newQuery: string) => {\n setLocalTextSearchQuery({ query: newQuery });\n\n if (newQuery.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleUp = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex + 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n const handleDown = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex - 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n return (\n
\n
\n \n \n \n \n
\n
\n
\n {query ? (\n foundIds?.length ? (\n `${focusedIndex + 1} of ${totalCount}`\n ) : foundIds && !foundIds.length ? (\n 'No results'\n ) : (\n ''\n )\n ) : (\n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n )}\n
\n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n };\n },\n)(MobileSearchFooter));\n","export default function findInViewport(\n container: HTMLElement,\n selectorOrElements: string | NodeListOf,\n margin = 0,\n isDense = false,\n shouldContainBottom = false,\n isHorizontal = false,\n) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const allElements = typeof selectorOrElements === 'string'\n ? container.querySelectorAll(selectorOrElements)\n : selectorOrElements;\n const { length } = allElements;\n const visibleIndexes: number[] = [];\n let isFound = false;\n\n for (let i = 0; i < length; i++) {\n const element = allElements[i];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const isVisible = shouldContainBottom\n ? y2 >= viewportY1 - margin && y2 <= viewportY2 + margin\n : y1 <= viewportY2 + margin && y2 >= viewportY1 - margin;\n\n if (isVisible) {\n visibleIndexes.push(i);\n isFound = true;\n } else if (isFound && !isDense) {\n break;\n }\n }\n\n return { allElements, visibleIndexes };\n}\n","function isFullyVisible(container: HTMLElement, element: HTMLElement, isHorizontal = false) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n return y1 > viewportY1 && y2 < viewportY2;\n}\n\nexport default isFullyVisible;\n","import findInViewport from './findInViewport';\nimport isFullyVisible from './isFullyVisible';\nimport fastSmoothScroll from './fastSmoothScroll';\n\nconst VIEWPORT_MARGIN = 8;\nconst SCROLL_MARGIN = 10;\n\nexport default function setTooltipItemVisible(selector: string, index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container || index < 0) {\n return;\n }\n const { visibleIndexes, allElements } = findInViewport(\n container,\n selector,\n VIEWPORT_MARGIN,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first]))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n fastSmoothScroll(container, allElements[index], position, SCROLL_MARGIN);\n }\n}\n","import { useCallback, useEffect, useState } from '../../../../lib/teact/teact';\nimport captureKeyboardListeners from '../../../../util/captureKeyboardListeners';\nimport cycleRestrict from '../../../../util/cycleRestrict';\n\nexport function useKeyboardNavigation({\n isActive,\n isHorizontal,\n shouldSaveSelectionOnUpdateItems,\n shouldRemoveSelectionOnReset,\n noArrowNavigation,\n items,\n shouldSelectOnTab,\n onSelect,\n onClose,\n}: {\n isActive: boolean;\n isHorizontal?: boolean;\n shouldSaveSelectionOnUpdateItems?: boolean;\n shouldRemoveSelectionOnReset?: boolean;\n noArrowNavigation?: boolean;\n items?: any[];\n shouldSelectOnTab?: boolean;\n onSelect: AnyToVoidFunction;\n onClose: NoneToVoidFunction;\n}) {\n const [selectedItemIndex, setSelectedItemIndex] = useState(-1);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!items) {\n return -1;\n }\n\n return cycleRestrict(items.length, newIndex);\n }, [items]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedItemIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedItemIndex, getSelectedIndex]);\n\n const handleItemSelect = useCallback((e: KeyboardEvent) => {\n if (items && items.length && selectedItemIndex > -1) {\n const item = items[selectedItemIndex];\n if (item) {\n e.preventDefault();\n onSelect(item);\n }\n }\n }, [items, onSelect, selectedItemIndex]);\n\n const isSelectionOutOfRange = !items || selectedItemIndex > items.length - 1;\n useEffect(() => {\n if (!shouldSaveSelectionOnUpdateItems || isSelectionOutOfRange) {\n setSelectedItemIndex(shouldRemoveSelectionOnReset ? -1 : 0);\n }\n }, [isSelectionOutOfRange, shouldRemoveSelectionOnReset, shouldSaveSelectionOnUpdateItems]);\n\n useEffect(() => (isActive ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onLeft: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onRight: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onTab: shouldSelectOnTab ? handleItemSelect : undefined,\n onEnter: handleItemSelect,\n }) : undefined), [\n noArrowNavigation, handleArrowKey, handleItemSelect, isActive, isHorizontal, onClose, shouldSelectOnTab,\n ]);\n\n return selectedItemIndex;\n}\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { getGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nimport './MentionTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onInsertUserName: (user: ApiUser, forceFocus?: boolean) => void;\n filteredUsers?: ApiUser[];\n};\n\nconst MentionTooltip: FC = ({\n isOpen,\n onClose,\n onInsertUserName,\n filteredUsers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleUserSelect = useCallback((userId: string, forceFocus = false) => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const user = usersById[userId];\n if (!user) {\n return;\n }\n\n onInsertUserName(user, forceFocus);\n }, [onInsertUserName]);\n\n const handleSelectMention = useCallback((member: ApiUser) => {\n handleUserSelect(member.id, true);\n }, [handleUserSelect]);\n\n const selectedMentionIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: filteredUsers,\n onSelect: handleSelectMention,\n shouldSelectOnTab: true,\n shouldSaveSelectionOnUpdateItems: true,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedMentionIndex, containerRef);\n }, [selectedMentionIndex]);\n\n useEffect(() => {\n if (filteredUsers && !filteredUsers.length) {\n onClose();\n }\n }, [filteredUsers, onClose]);\n\n const prevChatMembers = usePrevious(\n filteredUsers?.length\n ? filteredUsers\n : undefined,\n shouldRender,\n );\n const renderedChatMembers = filteredUsers && !filteredUsers.length\n ? prevChatMembers\n : filteredUsers;\n\n if (!shouldRender || (renderedChatMembers && !renderedChatMembers.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'MentionTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedChatMembers?.map(({ id }, index) => (\n handleUserSelect(id)}\n focus={selectedMentionIndex === index}\n >\n \n \n ))}\n
\n );\n};\n\nexport default memo(MentionTooltip);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAttachment, ApiChatMember } from '../../../api/types';\n\nimport {\n CONTENT_TYPES_WITH_PREVIEW,\n EDITABLE_INPUT_MODAL_ID,\n SUPPORTED_IMAGE_CONTENT_TYPES,\n SUPPORTED_VIDEO_CONTENT_TYPES,\n} from '../../../config';\nimport { getFileExtension } from '../../common/helpers/documentInfo';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { useStateRef } from '../../../hooks/useStateRef';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport File from '../../common/File';\nimport MessageInput from './MessageInput';\nimport MentionTooltip from './MentionTooltip';\nimport EmojiTooltip from './EmojiTooltip.async';\n\nimport './AttachmentModal.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId: number;\n attachments: ApiAttachment[];\n caption: string;\n isReady?: boolean;\n currentUserId?: string;\n groupChatMembers?: ApiChatMember[];\n recentEmojis: string[];\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n addRecentEmoji: AnyToVoidFunction;\n onCaptionUpdate: (html: string) => void;\n onSend: () => void;\n onFileAppend: (files: File[], isQuick: boolean) => void;\n onClear: () => void;\n};\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst AttachmentModal: FC = ({\n chatId,\n threadId,\n attachments,\n caption,\n isReady,\n currentUserId,\n groupChatMembers,\n recentEmojis,\n baseEmojiKeywords,\n emojiKeywords,\n addRecentEmoji,\n onCaptionUpdate,\n onSend,\n onFileAppend,\n onClear,\n}) => {\n const captionRef = useStateRef(caption);\n const hideTimeoutRef = useRef();\n const prevAttachments = usePrevious(attachments);\n const renderingAttachments = attachments.length ? attachments : prevAttachments;\n const isOpen = Boolean(attachments.length);\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n const isQuick = Boolean(renderingAttachments && renderingAttachments.every((a) => a.quick));\n const lang = useLang();\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n isOpen,\n captionRef,\n onCaptionUpdate,\n EDITABLE_INPUT_MODAL_ID,\n groupChatMembers,\n undefined,\n currentUserId,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n isOpen,\n captionRef,\n recentEmojis,\n EDITABLE_INPUT_MODAL_ID,\n onCaptionUpdate,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n\n const sendAttachments = useCallback(() => {\n if (isOpen) {\n onSend();\n }\n }, [isOpen, onSend]);\n\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget, target: fromTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.drop-target') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(unmarkHovered, DROP_LEAVE_TIMEOUT_MS);\n }\n\n // Prevent DragLeave event from firing when the pointer moves inside the AttachmentModal drop target\n if (fromTarget && (fromTarget as HTMLElement).closest('.AttachmentModal.hovered')) {\n return;\n }\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const handleFilesDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n unmarkHovered();\n\n const { dataTransfer: { files } } = e;\n\n if (files?.length) {\n const newFiles = isQuick\n ? Array.from(files).filter((file) => {\n return file.type && CONTENT_TYPES_WITH_PREVIEW.has(file.type);\n })\n : Array.from(files);\n\n onFileAppend(newFiles, isQuick);\n }\n }, [isQuick, onFileAppend, unmarkHovered]);\n\n function handleDragOver(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = undefined;\n }\n }\n\n if (!renderingAttachments) {\n return undefined;\n }\n\n const areAllPhotos = renderingAttachments.every((a) => SUPPORTED_IMAGE_CONTENT_TYPES.has(a.mimeType));\n const areAllVideos = renderingAttachments.every((a) => SUPPORTED_VIDEO_CONTENT_TYPES.has(a.mimeType));\n const areAllAudios = renderingAttachments.every((a) => a.mimeType.startsWith('audio/'));\n\n let title = '';\n if (areAllPhotos) {\n title = lang('PreviewSender.SendPhoto', renderingAttachments.length, 'i');\n } else if (areAllVideos) {\n title = lang('PreviewSender.SendVideo', renderingAttachments.length, 'i');\n } else if (areAllAudios) {\n title = lang('PreviewSender.SendAudio', renderingAttachments.length, 'i');\n } else {\n title = lang('PreviewSender.SendFile', renderingAttachments.length, 'i');\n }\n\n function renderHeader() {\n if (!renderingAttachments) {\n return undefined;\n }\n\n return (\n
\n \n
{title}
\n \n {lang('Send')}\n \n
\n );\n }\n\n return (\n \n \n {isQuick ? (\n
\n {renderingAttachments.map((attachment) => (\n attachment.mimeType.startsWith('image/')\n ? \"\"\n :
\n ) : (\n
\n {renderingAttachments.map((attachment) => (\n \n ))}\n
\n )}\n\n
\n \n \n \n
\n
\n \n );\n};\n\nexport default memo(AttachmentModal);\n","import { ChangeEvent, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiNewPoll } from '../../../api/types';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport InputText from '../../ui/InputText';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup from '../../ui/RadioGroup';\n\nimport './PollModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSend: (pollSummary: ApiNewPoll) => void;\n onClear: () => void;\n};\n\nconst MAX_LIST_HEIGHT = 320;\nconst MAX_OPTIONS_COUNT = 10;\nconst MAX_OPTION_LENGTH = 100;\nconst MAX_QUESTION_LENGTH = 255;\nconst MAX_SOLUTION_LENGTH = 200;\n\nconst PollModal: FC = ({ isOpen, onSend, onClear }) => {\n // eslint-disable-next-line no-null/no-null\n const questionInputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const optionsListRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const solutionRef = useRef(null);\n\n const [question, setQuestion] = useState('');\n const [options, setOptions] = useState(['']);\n const [isAnonymous, setIsAnonymous] = useState(true);\n const [isMultipleAnswers, setIsMultipleAnswers] = useState(false);\n const [isQuizMode, setIsQuizMode] = useState(false);\n const [solution, setSolution] = useState();\n const [correctOption, setCorrectOption] = useState();\n const [hasErrors, setHasErrors] = useState(false);\n\n const lang = useLang();\n\n const focusInput = useCallback((ref: RefObject) => {\n if (isOpen && ref.current) {\n ref.current.focus();\n }\n }, [isOpen]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n useEffect(() => {\n if (!isOpen) {\n setQuestion('');\n setOptions(['']);\n setIsAnonymous(true);\n setIsMultipleAnswers(false);\n setIsQuizMode(false);\n setSolution('');\n setCorrectOption('');\n setHasErrors(false);\n }\n }, [isOpen]);\n\n useEffect(() => focusInput(questionInputRef), [focusInput, isOpen]);\n\n useLayoutEffect(() => {\n const solutionEl = solutionRef.current;\n\n if (solutionEl && solution !== solutionEl.innerHTML) {\n solutionEl.innerHTML = solution;\n }\n }, [solution]);\n\n const addNewOption = useCallback((newOptions: string[] = []) => {\n setOptions([...newOptions, '']);\n requestAnimationFrame(() => {\n const list = optionsListRef.current;\n if (!list) {\n return;\n }\n\n list.classList.toggle('overflown', list.scrollHeight > MAX_LIST_HEIGHT);\n list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' });\n });\n }, []);\n\n const handleCreate = useCallback(() => {\n setHasErrors(false);\n if (!isOpen) {\n return;\n }\n\n const questionTrimmed = question.trim().substring(0, MAX_QUESTION_LENGTH);\n const optionsTrimmed = options.map((o) => o.trim().substring(0, MAX_OPTION_LENGTH)).filter((o) => o.length);\n\n if (!questionTrimmed || optionsTrimmed.length < 2) {\n setQuestion(questionTrimmed);\n if (optionsTrimmed.length) {\n if (optionsTrimmed.length < 2) {\n addNewOption(optionsTrimmed);\n } else {\n setOptions(optionsTrimmed);\n }\n } else {\n addNewOption();\n }\n setHasErrors(true);\n return;\n }\n\n if (isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)])) {\n setHasErrors(true);\n return;\n }\n\n const answers = optionsTrimmed\n .map((text, index) => ({\n text: text.trim(),\n option: String(index),\n ...(String(index) === correctOption && { correct: true }),\n }));\n\n const payload: ApiNewPoll = {\n summary: {\n question: questionTrimmed,\n answers,\n ...(!isAnonymous && { isPublic: true }),\n ...(isMultipleAnswers && { multipleChoice: true }),\n ...(isQuizMode && { quiz: true }),\n },\n };\n\n if (isQuizMode) {\n const { text, entities } = (solution && parseMessageInput(solution.substring(0, MAX_SOLUTION_LENGTH))) || {};\n\n payload.quiz = {\n correctAnswers: [correctOption],\n ...(text && { solution: text }),\n ...(entities && { solutionEntities: entities }),\n };\n }\n\n onSend(payload);\n }, [\n isOpen,\n question,\n options,\n isQuizMode,\n correctOption,\n isAnonymous,\n isMultipleAnswers,\n onSend,\n addNewOption,\n solution,\n ]);\n\n const updateOption = useCallback((index: number, text: string) => {\n const newOptions = [...options];\n newOptions[index] = text;\n if (newOptions[newOptions.length - 1].trim().length && newOptions.length < MAX_OPTIONS_COUNT) {\n addNewOption(newOptions);\n } else {\n setOptions(newOptions);\n }\n }, [options, addNewOption]);\n\n const removeOption = useCallback((index: number) => {\n const newOptions = [...options];\n newOptions.splice(index, 1);\n setOptions(newOptions);\n requestAnimationFrame(() => {\n if (!optionsListRef.current) {\n return;\n }\n\n optionsListRef.current.classList.toggle('overflown', optionsListRef.current.scrollHeight > MAX_LIST_HEIGHT);\n });\n }, [options]);\n\n const handleCorrectOptionChange = useCallback((newValue: string) => {\n setCorrectOption(newValue);\n }, [setCorrectOption]);\n\n const handleIsAnonymousChange = useCallback((e: ChangeEvent) => {\n setIsAnonymous(e.target.checked);\n }, []);\n\n const handleMultipleAnswersChange = useCallback((e: ChangeEvent) => {\n setIsMultipleAnswers(e.target.checked);\n }, []);\n\n const handleQuizModeChange = useCallback((e: ChangeEvent) => {\n setIsQuizMode(e.target.checked);\n }, []);\n\n const handleKeyPress = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode === 13) {\n handleCreate();\n }\n }, [handleCreate]);\n\n const getQuestionError = useCallback(() => {\n if (hasErrors && !question.trim().length) {\n return lang('lng_polls_choose_question');\n }\n\n return undefined;\n }, [hasErrors, lang, question]);\n\n const getOptionsError = useCallback((index: number) => {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n if (hasErrors && optionsTrimmed.length < 2 && !options[index].trim().length) {\n return lang('lng_polls_choose_answers');\n }\n return undefined;\n }, [hasErrors, lang, options]);\n\n function renderHeader() {\n return (\n
\n \n
{lang('NewPoll')}
\n \n {lang('Create')}\n \n
\n );\n }\n\n function renderOptions() {\n return options.map((option, index) => (\n
\n updateOption(index, e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n {index !== options.length - 1 && (\n removeOption(index)}\n >\n \n \n )}\n
\n ));\n }\n\n function renderRadioOptions() {\n return renderOptions()\n .map((label, index) => ({ value: String(index), label, hidden: index === options.length - 1 }));\n }\n\n function renderQuizNoOptionError() {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n\n return isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)]) && (\n

{lang('lng_polls_choose_correct')}

\n );\n }\n\n return (\n \n setQuestion(e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n
\n\n
\n

{lang('PollOptions')}

\n\n {hasErrors && renderQuizNoOptionError()}\n {isQuizMode ? (\n \n ) : (\n renderOptions()\n )}\n\n
\n\n
\n\n
\n \n \n \n {isQuizMode && (\n <>\n

{lang('lng_polls_solution_title')}

\n setSolution(e.currentTarget.innerHTML)}\n />\n
{lang('CreatePoll.ExplanationInfo')}
\n \n )}\n
\n \n );\n};\n\nexport default memo(PollModal);\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\n\nimport './EmojiButton.scss';\n\ntype OwnProps = {\n emoji: Emoji;\n focus?: boolean;\n onClick: (emoji: string, name: string) => void;\n};\n\nconst EmojiButton: FC = ({ emoji, focus, onClick }) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n // Preventing safari from losing focus on Composer MessageInput\n e.preventDefault();\n\n onClick(emoji.native, emoji.id);\n }, [emoji, onClick]);\n\n return (\n \n {IS_EMOJI_SUPPORTED ? emoji.native : \"\"}\n
\n );\n};\n\nexport default memo(EmojiButton);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport EmojiButton from './EmojiButton';\n\nconst EMOJIS_PER_ROW_ON_DESKTOP = 9;\nconst EMOJI_MARGIN = 4;\nconst MOBILE_CONTAINER_PADDING = 8;\nconst EMOJI_SIZE = 40;\n\ntype OwnProps = {\n category: EmojiCategory;\n index: number;\n allEmojis: AllEmojis;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\nconst EmojiCategory: FC = ({\n category, index, allEmojis, observeIntersection, shouldRender, onEmojiSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const transitionClassNames = useMediaTransition(shouldRender);\n\n const lang = useLang();\n\n const emojisPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (EMOJI_SIZE + EMOJI_MARGIN))\n : EMOJIS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(category.emojis.length / emojisPerRow) * (EMOJI_SIZE + EMOJI_MARGIN);\n\n return (\n \n

\n {lang(category.id === 'recent' ? 'RecentStickers' : `Emoji${index}`)}\n

\n \n {shouldRender && category.emojis.map((name) => {\n const emoji = allEmojis[name];\n // Recent emojis may contain emoticons that are no longer in the list\n if (!emoji) {\n return undefined;\n }\n // Some emojis have multiple skins and are represented as an Object with emojis for all skins.\n // For now, we select only the first emoji with 'neutral' skin.\n const displayedEmoji = 'id' in emoji ? emoji : emoji[1];\n\n return (\n \n );\n })}\n
\n \n );\n};\n\nexport default memo(EmojiCategory);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport { MENU_TRANSITION_DURATION } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport {\n EmojiModule,\n EmojiRawData,\n EmojiData,\n uncompressEmoji,\n} from '../../../util/emoji';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Loading from '../../ui/Loading';\nimport EmojiCategory from './EmojiCategory';\n\nimport './EmojiPicker.scss';\n\ntype OwnProps = {\n className?: string;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\ntype StateProps = Pick;\ntype EmojiCategoryData = { id: string; name: string; emojis: string[] };\n\nconst ICONS_BY_CATEGORY: Record = {\n recent: 'icon-recent',\n people: 'icon-smile',\n nature: 'icon-animals',\n foods: 'icon-eats',\n activity: 'icon-sport',\n places: 'icon-car',\n objects: 'icon-lamp',\n symbols: 'icon-language',\n flags: 'icon-flag',\n};\n\nconst OPEN_ANIMATION_DELAY = 200;\n// Only a few categories are above this height.\nconst SMOOTH_SCROLL_DISTANCE = 800;\nconst FOCUS_MARGIN = 50;\nconst HEADER_BUTTON_WIDTH = 42; // px. Includes margins\nconst INTERSECTION_THROTTLE = 200;\n\nconst categoryIntersections: boolean[] = [];\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nconst EmojiPicker: FC = ({\n className, onEmojiSelect, recentEmojis,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n\n const [categories, setCategories] = useState();\n const [emojis, setEmojis] = useState();\n const [activeCategoryIndex, setActiveCategoryIndex] = useState(0);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('emoji-category-')) {\n return;\n }\n\n const index = Number(id.replace('emoji-category-', ''));\n categoryIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = categoryIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveCategoryIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n\n useHorizontalScroll(headerRef.current, !IS_SINGLE_COLUMN_LAYOUT);\n\n // Scroll header when active set updates\n useEffect(() => {\n if (!categories) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeCategoryIndex * HEADER_BUTTON_WIDTH - header.offsetWidth / 2 + HEADER_BUTTON_WIDTH / 2;\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [categories, activeCategoryIndex]);\n\n const lang = useLang();\n\n const allCategories = useMemo(() => {\n if (!categories) {\n return MEMO_EMPTY_ARRAY;\n }\n const themeCategories = [...categories];\n if (recentEmojis?.length) {\n themeCategories.unshift({\n id: 'recent',\n name: lang('RecentStickers'),\n emojis: recentEmojis,\n });\n }\n\n return themeCategories;\n }, [categories, lang, recentEmojis]);\n\n // Initialize data on first render.\n useEffect(() => {\n setTimeout(() => {\n const exec = () => {\n setCategories(emojiData.categories);\n\n setEmojis(emojiData.emojis as AllEmojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, OPEN_ANIMATION_DELAY);\n }, []);\n\n const selectCategory = useCallback((index: number) => {\n setActiveCategoryIndex(index);\n const categoryEl = document.getElementById(`emoji-category-${index}`)!;\n fastSmoothScroll(containerRef.current!, categoryEl, 'start', FOCUS_MARGIN, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n onEmojiSelect(emoji, name);\n }, [onEmojiSelect]);\n\n const canRenderContents = useAsyncRendering([], MENU_TRANSITION_DURATION);\n\n function renderCategoryButton(category: EmojiCategoryData, index: number) {\n const icon = ICONS_BY_CATEGORY[category.id];\n\n return icon && (\n selectCategory(index)}\n ariaLabel={category.name}\n >\n \n \n );\n }\n\n const containerClassName = buildClassName('EmojiPicker', className);\n\n if (!emojis || !canRenderContents) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n {allCategories.map(renderCategoryButton)}\n
\n \n {allCategories.map((category, i) => (\n = i - 1 && activeCategoryIndex <= i + 1}\n onEmojiSelect={handleEmojiSelect}\n />\n ))}\n
\n \n );\n};\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['recentEmojis']),\n)(EmojiPicker));\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport StickerButton from '../../common/StickerButton';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n stickerSet: StickerSetOrRecent;\n loadAndPlay: boolean;\n index: number;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n onStickerUnfave: (sticker: ApiSticker) => void;\n};\n\nconst STICKERS_PER_ROW_ON_DESKTOP = 5;\nconst STICKER_MARGIN = IS_SINGLE_COLUMN_LAYOUT ? 8 : 16;\nconst MOBILE_CONTAINER_PADDING = 8;\n\nconst StickerSet: FC = ({\n stickerSet,\n loadAndPlay,\n index,\n observeIntersection,\n shouldRender,\n onStickerSelect,\n onStickerUnfave,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const transitionClassNames = useMediaTransition(shouldRender);\n\n const stickersPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (STICKER_SIZE_PICKER + STICKER_MARGIN))\n : STICKERS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(stickerSet.count / stickersPerRow) * (STICKER_SIZE_PICKER + STICKER_MARGIN);\n\n return (\n \n

{stickerSet.title}

\n \n {shouldRender && stickerSet.stickers && stickerSet.stickers.map((sticker) => (\n \n ))}\n \n \n );\n};\n\nexport default memo(StickerSet);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiStickerSet, ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION, STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport StickerButton from '../../common/StickerButton';\nimport StickerSet from './StickerSet';\nimport StickerSetCover from './StickerSetCover';\nimport StickerSetCoverAnimated from './StickerSetCoverAnimated';\n\nimport './StickerPicker.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId?: number;\n className: string;\n loadAndPlay: boolean;\n canSendStickers: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n recentStickers: ApiSticker[];\n favoriteStickers: ApiSticker[];\n stickerSetsById: Record;\n addedSetIds?: string[];\n shouldPlay?: boolean;\n};\n\nconst SMOOTH_SCROLL_DISTANCE = 500;\nconst HEADER_BUTTON_WIDTH = 52; // px (including margin)\nconst STICKER_INTERSECTION_THROTTLE = 200;\n\nconst stickerSetIntersections: boolean[] = [];\n\nconst StickerPicker: FC = ({\n chatId,\n threadId,\n className,\n loadAndPlay,\n canSendStickers,\n recentStickers,\n favoriteStickers,\n addedSetIds,\n stickerSetsById,\n shouldPlay,\n onStickerSelect,\n}) => {\n const {\n loadRecentStickers,\n addRecentSticker,\n unfaveSticker,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n const [activeSetIndex, setActiveSetIndex] = useState(0);\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: STICKER_INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('sticker-set-')) {\n return;\n }\n\n const index = Number(id.replace('sticker-set-', ''));\n stickerSetIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = stickerSetIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveSetIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: headerRef });\n\n const lang = useLang();\n\n const areAddedLoaded = Boolean(addedSetIds);\n\n const allSets = useMemo(() => {\n if (!addedSetIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return [\n {\n id: 'recent',\n title: lang('RecentStickers'),\n stickers: recentStickers,\n count: recentStickers.length,\n },\n {\n id: 'favorite',\n title: lang('FavoriteStickers'),\n stickers: favoriteStickers,\n count: favoriteStickers.length,\n },\n ...addedSetIds.map((id) => stickerSetsById[id]).filter(Boolean),\n ];\n }, [addedSetIds, lang, recentStickers, favoriteStickers, stickerSetsById]);\n\n const noPopulatedSets = useMemo(() => (\n areAddedLoaded\n && allSets.filter((set) => set.stickers?.length).length === 0\n ), [allSets, areAddedLoaded]);\n\n useEffect(() => {\n if (loadAndPlay) {\n loadRecentStickers();\n sendMessageAction({ type: 'chooseSticker' });\n }\n }, [loadAndPlay, loadRecentStickers, sendMessageAction]);\n\n useHorizontalScroll(headerRef.current);\n\n // Scroll container and header when active set changes\n useEffect(() => {\n if (!areAddedLoaded) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeSetIndex * HEADER_BUTTON_WIDTH - (header.offsetWidth / 2 - HEADER_BUTTON_WIDTH / 2);\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [areAddedLoaded, activeSetIndex]);\n\n const selectStickerSet = useCallback((index: number) => {\n setActiveSetIndex(index);\n const stickerSetEl = document.getElementById(`sticker-set-${index}`)!;\n fastSmoothScroll(containerRef.current!, stickerSetEl, 'start', undefined, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker);\n addRecentSticker({ sticker });\n }, [addRecentSticker, onStickerSelect]);\n\n const handleStickerUnfave = useCallback((sticker: ApiSticker) => {\n unfaveSticker({ sticker });\n }, [unfaveSticker]);\n\n const handleMouseMove = useCallback(() => {\n sendMessageAction({ type: 'chooseSticker' });\n }, [sendMessageAction]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n function renderCover(stickerSet: StickerSetOrRecent, index: number) {\n const firstSticker = stickerSet.stickers?.[0];\n const buttonClassName = buildClassName(\n 'symbol-set-button sticker-set-button',\n index === activeSetIndex && 'activated',\n );\n\n if (stickerSet.id === 'recent' || stickerSet.id === 'favorite' || stickerSet.hasThumbnail || !firstSticker) {\n return (\n selectStickerSet(index)}\n >\n {stickerSet.id === 'recent' ? (\n \n ) : stickerSet.id === 'favorite' ? (\n \n ) : stickerSet.isLottie ? (\n \n ) : (\n \n )}\n \n );\n } else {\n return (\n \n );\n }\n }\n\n const fullClassName = buildClassName('StickerPicker', className);\n\n if (!areAddedLoaded || !canRenderContents || noPopulatedSets || !canSendStickers) {\n return (\n
\n {!canSendStickers ? (\n
{lang('ErrorSendRestrictedStickersAll')}
\n ) : noPopulatedSets ? (\n
{lang('NoStickers')}
\n ) : (\n \n )}\n
\n );\n }\n\n return (\n
\n \n {allSets.map(renderCover)}\n
\n \n {allSets.map((stickerSet, i) => (\n = i - 1 && activeSetIndex <= i + 1}\n onStickerSelect={handleStickerSelect}\n onStickerUnfave={handleStickerUnfave}\n />\n ))}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n setsById,\n added,\n recent,\n favorite,\n } = global.stickers;\n\n return {\n recentStickers: recent.stickers,\n favoriteStickers: favorite.stickers,\n stickerSetsById: setsById,\n addedSetIds: added.setIds,\n shouldPlay: global.settings.byKey.shouldLoopStickers,\n };\n },\n)(StickerPicker));\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiVideo } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport useBuffering from '../../hooks/useBuffering';\nimport useCanvasBlur from '../../hooks/useCanvasBlur';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport Spinner from '../ui/Spinner';\n\nimport './GifButton.scss';\n\ntype OwnProps = {\n gif: ApiVideo;\n observeIntersection: ObserveFn;\n isDisabled?: boolean;\n className?: string;\n onClick: (gif: ApiVideo) => void;\n};\n\nconst GifButton: FC = ({\n gif, observeIntersection, isDisabled, className, onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const hasThumbnail = Boolean(gif.thumbnail?.dataUri);\n const localMediaHash = `gif${gif.id}`;\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const loadAndPlay = isIntersecting && !isDisabled;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const thumbRef = useCanvasBlur(gif.thumbnail?.dataUri, Boolean(previewBlobUrl));\n const videoData = useMedia(localMediaHash, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const shouldRenderVideo = Boolean(loadAndPlay && videoData);\n const { isBuffered, bufferingHandlers } = useBuffering(true);\n const shouldRenderSpinner = loadAndPlay && !isBuffered;\n const isVideoReady = loadAndPlay && isBuffered;\n\n useVideoCleanup(videoRef, [shouldRenderVideo]);\n\n const handleClick = useCallback(\n () => onClick({\n ...gif,\n blobUrl: videoData,\n }),\n [onClick, gif, videoData],\n );\n\n const fullClassName = buildClassName(\n 'GifButton',\n gif.width && gif.height && gif.width < gif.height ? 'vertical' : 'horizontal',\n localMediaHash,\n className,\n );\n\n return (\n \n {hasThumbnail && (\n \n )}\n {previewBlobUrl && !isVideoReady && (\n \n )}\n {shouldRenderVideo && (\n \n \n \n )}\n {shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(GifButton);\n","import React, {\n FC, useEffect, memo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiVideo } from '../../../api/types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\n\nimport Loading from '../../ui/Loading';\nimport GifButton from '../../common/GifButton';\n\nimport './GifPicker.scss';\n\ntype OwnProps = {\n className: string;\n loadAndPlay: boolean;\n canSendGifs: boolean;\n onGifSelect: (gif: ApiVideo) => void;\n};\n\ntype StateProps = {\n savedGifs?: ApiVideo[];\n};\n\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifPicker: FC = ({\n className,\n loadAndPlay,\n canSendGifs,\n savedGifs,\n onGifSelect,\n}) => {\n const { loadSavedGifs } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n useEffect(() => {\n if (loadAndPlay) {\n loadSavedGifs();\n }\n }, [loadAndPlay, loadSavedGifs]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n return (\n \n {!canSendGifs ? (\n
Sending GIFs is not allowed in this chat.
\n ) : canRenderContents && savedGifs && savedGifs.length ? (\n savedGifs.map((gif) => (\n \n ))\n ) : canRenderContents && savedGifs ? (\n
No saved GIFs.
\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n savedGifs: global.gifs.saved.gifs,\n };\n },\n)(GifPicker));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\ntype OwnProps = {\n activeTab: SymbolMenuTabs;\n onSwitchTab: (tab: SymbolMenuTabs) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n};\n\nexport enum SymbolMenuTabs {\n 'Emoji',\n 'Stickers',\n 'GIFs',\n}\n\n// Getting enum string values for display in Tabs.\n// See: https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\nexport const SYMBOL_MENU_TAB_TITLES = Object.values(SymbolMenuTabs)\n .filter((value): value is string => typeof value === 'string');\n\nconst SYMBOL_MENU_TAB_ICONS = {\n [SymbolMenuTabs.Emoji]: 'icon-smile',\n [SymbolMenuTabs.Stickers]: 'icon-stickers',\n [SymbolMenuTabs.GIFs]: 'icon-gifs',\n};\n\nconst SymbolMenuFooter: FC = ({\n activeTab, onSwitchTab, onRemoveSymbol, onSearchOpen,\n}) => {\n const lang = useLang();\n\n function renderTabButton(tab: SymbolMenuTabs) {\n return (\n onSwitchTab(tab)}\n ariaLabel={SYMBOL_MENU_TAB_TITLES[tab]}\n round\n faded\n color=\"translucent\"\n >\n \n \n );\n }\n\n const handleSearchOpen = useCallback(() => {\n onSearchOpen(activeTab === SymbolMenuTabs.Stickers ? 'stickers' : 'gifs');\n }, [activeTab, onSearchOpen]);\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n return (\n
\n {activeTab !== SymbolMenuTabs.Emoji && (\n \n \n \n )}\n\n {renderTabButton(SymbolMenuTabs.Emoji)}\n {renderTabButton(SymbolMenuTabs.Stickers)}\n {renderTabButton(SymbolMenuTabs.GIFs)}\n\n {activeTab === SymbolMenuTabs.Emoji && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SymbolMenuFooter);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker, ApiVideo } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Menu from '../../ui/Menu';\nimport Transition from '../../ui/Transition';\nimport EmojiPicker from './EmojiPicker';\nimport StickerPicker from './StickerPicker';\nimport GifPicker from './GifPicker';\nimport SymbolMenuFooter, { SYMBOL_MENU_TAB_TITLES, SymbolMenuTabs } from './SymbolMenuFooter';\nimport Portal from '../../ui/Portal';\n\nimport './SymbolMenu.scss';\n\nconst ANIMATION_DURATION = 350;\n\nexport type OwnProps = {\n chatId: string;\n threadId?: number;\n isOpen: boolean;\n canSendStickers: boolean;\n canSendGifs: boolean;\n onLoad: () => void;\n onClose: () => void;\n onEmojiSelect: (emoji: string) => void;\n onStickerSelect: (sticker: ApiSticker, shouldPreserveInput?: boolean) => void;\n onGifSelect: (gif: ApiVideo) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n addRecentEmoji: AnyToVoidFunction;\n};\n\ntype StateProps = {\n isLeftColumnShown: boolean;\n};\n\nlet isActivated = false;\n\nconst SymbolMenu: FC = ({\n chatId,\n threadId,\n isOpen,\n canSendStickers,\n canSendGifs,\n isLeftColumnShown,\n onLoad,\n onClose,\n onEmojiSelect,\n onStickerSelect,\n onGifSelect,\n onRemoveSymbol,\n onSearchOpen,\n addRecentEmoji,\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [recentEmojis, setRecentEmojis] = useState([]);\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, onClose, false, false);\n\n if (!isActivated && isOpen) {\n isActivated = true;\n }\n\n useEffect(() => {\n onLoad();\n }, [onLoad]);\n\n useLayoutEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return undefined;\n }\n\n if (isOpen) {\n document.body.classList.add('enable-symbol-menu-transforms');\n document.body.classList.add('is-symbol-menu-open');\n }\n\n return () => {\n if (isOpen) {\n fastRaf(() => {\n document.body.classList.remove('is-symbol-menu-open');\n setTimeout(() => {\n document.body.classList.remove('enable-symbol-menu-transforms');\n }, ANIMATION_DURATION);\n });\n }\n };\n }, [isOpen]);\n\n const recentEmojisRef = useRef(recentEmojis);\n recentEmojisRef.current = recentEmojis;\n useEffect(() => {\n if (!recentEmojisRef.current.length) {\n return;\n }\n\n recentEmojisRef.current.forEach((name) => {\n addRecentEmoji({ emoji: name });\n });\n\n setRecentEmojis([]);\n }, [isOpen, activeTab, addRecentEmoji]);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n setRecentEmojis((emojis) => {\n return [...emojis, name];\n });\n\n onEmojiSelect(emoji);\n }, [onEmojiSelect]);\n\n const handleSearch = useCallback((type: 'stickers' | 'gifs') => {\n onClose();\n onSearchOpen(type);\n }, [onClose, onSearchOpen]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker, true);\n }, [onStickerSelect]);\n\n const lang = useLang();\n\n function renderContent(isActive: boolean, isFrom: boolean) {\n switch (activeTab) {\n case SymbolMenuTabs.Emoji:\n return (\n \n );\n case SymbolMenuTabs.Stickers:\n return (\n \n );\n case SymbolMenuTabs.GIFs:\n return (\n \n );\n }\n\n return undefined;\n }\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n const content = (\n <>\n
\n {isActivated && (\n \n {renderContent}\n \n )}\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n \n );\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'SymbolMenu mobile-menu',\n transitionClassNames,\n !isLeftColumnShown && 'middle-column-open',\n );\n\n return (\n \n
\n {content}\n
\n
\n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n isLeftColumnShown: global.isLeftColumnShown,\n };\n },\n)(SymbolMenu));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { CONTENT_TYPES_WITH_PREVIEW } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './AttachMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n canAttachMedia: boolean;\n canAttachPolls: boolean;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n onPollCreate: () => void;\n onClose: () => void;\n};\n\nconst AttachMenu: FC = ({\n isOpen, canAttachMedia, canAttachPolls, onFileSelect, onPollCreate, onClose,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const handleFileSelect = useCallback((e: Event, isQuick: boolean) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n onFileSelect(Array.from(files), isQuick);\n }\n }, [onFileSelect]);\n\n const handleQuickSelect = useCallback(() => {\n openSystemFilesDialog(\n Array.from(CONTENT_TYPES_WITH_PREVIEW).join(','),\n (e) => handleFileSelect(e, true),\n );\n }, [handleFileSelect]);\n\n const handleDocumentSelect = useCallback(() => {\n openSystemFilesDialog('*', (e) => handleFileSelect(e, false));\n }, [handleFileSelect]);\n\n const lang = useLang();\n\n return (\n \n {/*\n ** Using ternary operator here causes some attributes from first clause\n ** transferring to the fragment content in the second clause\n */}\n {!canAttachMedia && (\n Posting media content is not allowed in this group.\n )}\n {canAttachMedia && (\n <>\n \n {lang('AttachmentMenu.PhotoOrVideo')}\n \n {lang('AttachDocument')}\n \n )}\n {canAttachPolls && (\n {lang('Poll')}\n )}\n \n );\n};\n\nexport default memo(AttachMenu);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\n\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\n\nimport './BotCommand.scss';\n\ntype OwnProps = {\n botCommand: ApiBotCommand;\n bot?: ApiUser;\n withAvatar?: boolean;\n focus?: boolean;\n onClick: (botCommand: ApiBotCommand) => void;\n};\n\nconst BotCommand: FC = ({\n withAvatar,\n focus,\n botCommand,\n bot,\n onClick,\n}) => {\n return (\n onClick(botCommand)}\n focus={focus}\n >\n {withAvatar && (\n \n )}\n
\n /{botCommand.command}\n {renderText(botCommand.description)}\n
\n \n );\n};\n\nexport default memo(BotCommand);\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport BotCommand from './BotCommand';\n\nimport './BotCommandTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withUsername?: boolean;\n botCommands?: ApiBotCommand[];\n onClick: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n usersById: Record;\n};\n\nconst BotCommandTooltip: FC = ({\n usersById,\n isOpen,\n withUsername,\n botCommands,\n onClick,\n onClose,\n}) => {\n const { sendBotCommand } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleSendCommand = useCallback(({ botId, command }: ApiBotCommand) => {\n const bot = usersById[botId];\n sendBotCommand({\n command: `/${command}${withUsername && bot ? `@${bot.username}` : ''}`,\n botId,\n });\n onClick();\n }, [onClick, sendBotCommand, usersById, withUsername]);\n\n const selectedCommandIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: botCommands,\n onSelect: handleSendCommand,\n onClose,\n });\n\n useEffect(() => {\n if (botCommands && !botCommands.length) {\n onClose();\n }\n }, [botCommands, onClose]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedCommandIndex, containerRef);\n }, [selectedCommandIndex]);\n\n const prevCommands = usePrevious(botCommands && botCommands.length ? botCommands : undefined, shouldRender);\n const renderedCommands = botCommands && !botCommands.length ? prevCommands : botCommands;\n\n if (!shouldRender || (renderedCommands && !renderedCommands.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'BotCommandTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedCommands && renderedCommands.map((chatBotCommand, index) => (\n \n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({\n usersById: global.users.byId,\n }),\n)(BotCommandTooltip));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiBotCommand } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport useMouseInside from '../../../hooks/useMouseInside';\n\nimport Menu from '../../ui/Menu';\nimport BotCommand from './BotCommand';\n\nimport './BotCommandMenu.scss';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nexport type OwnProps = {\n isOpen: boolean;\n botCommands: ApiBotCommand[];\n onClose: NoneToVoidFunction;\n};\n\nconst BotCommandMenu: FC = ({\n isOpen, botCommands, onClose,\n}) => {\n const { sendBotCommand } = getDispatch();\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n\n const handleClick = useCallback((botCommand: ApiBotCommand) => {\n sendBotCommand({\n command: `/${botCommand.command}`,\n botId: botCommand.botId,\n });\n onClose();\n }, [onClose, sendBotCommand]);\n\n return (\n \n {botCommands.map((botCommand) => (\n \n ))}\n \n );\n};\n\nexport default memo(BotCommandMenu);\n","import React, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\n\nimport Loading from '../../ui/Loading';\nimport StickerButton from '../../common/StickerButton';\n\nimport './StickerTooltip.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId?: number;\n isOpen: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n stickers?: ApiSticker[];\n};\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerTooltip: FC = ({\n chatId,\n threadId,\n isOpen,\n onStickerSelect,\n stickers,\n}) => {\n const { clearStickersForEmoji } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const prevStickers = usePrevious(stickers, true);\n const displayedStickers = stickers || prevStickers;\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n useEffect(() => (isOpen ? captureEscKeyListener(clearStickersForEmoji) : undefined), [isOpen, clearStickersForEmoji]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseMove = () => {\n sendMessageAction({ type: 'chooseSticker' });\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'StickerTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n !(displayedStickers?.length) && 'hidden',\n );\n\n return (\n \n {shouldRender && displayedStickers ? (\n displayedStickers.map((sticker) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { stickers } = global.stickers.forEmoji;\n\n return { stickers };\n },\n)(StickerTooltip));\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './CustomSendMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSilentSend?: NoneToVoidFunction;\n onScheduleSend?: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n onCloseAnimationEnd?: NoneToVoidFunction;\n};\n\nconst CustomSendMenu: FC = ({\n isOpen, onSilentSend, onScheduleSend, onClose, onCloseAnimationEnd,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const lang = useLang();\n\n return (\n \n {onSilentSend && {lang('SendWithoutSound')}}\n {onScheduleSend && {lang('ScheduleMessage')}}\n \n );\n};\n\nexport default memo(CustomSendMenu);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport findInViewport from '../../../util/findInViewport';\nimport isFullyVisible from '../../../util/isFullyVisible';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevDuringAnimation from '../../../hooks/usePrevDuringAnimation';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport Loading from '../../ui/Loading';\nimport EmojiButton from './EmojiButton';\n\nimport './EmojiTooltip.scss';\n\nconst VIEWPORT_MARGIN = 8;\nconst EMOJI_BUTTON_WIDTH = 44;\nconst CLOSE_DURATION = 350;\n\nfunction setItemVisible(index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container) {\n return;\n }\n\n const { visibleIndexes, allElements } = findInViewport(\n container,\n '.EmojiButton',\n VIEWPORT_MARGIN,\n true,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first], true))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n const newLeft = position === 'start' ? index * EMOJI_BUTTON_WIDTH : 0;\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\n}\n\nexport type OwnProps = {\n isOpen: boolean;\n onEmojiSelect: (text: string) => void;\n onClose: NoneToVoidFunction;\n addRecentEmoji: AnyToVoidFunction;\n emojis: Emoji[];\n};\n\nconst EmojiTooltip: FC = ({\n isOpen,\n emojis,\n onClose,\n onEmojiSelect,\n addRecentEmoji,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const listEmojis: Emoji[] = usePrevDuringAnimation(emojis.length ? emojis : undefined, CLOSE_DURATION) || [];\n\n const handleSelectEmoji = useCallback((emoji: Emoji) => {\n onEmojiSelect(emoji.native);\n addRecentEmoji({ emoji: emoji.id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const handleClick = useCallback((native: string, id: string) => {\n onEmojiSelect(native);\n addRecentEmoji({ emoji: id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n isHorizontal: true,\n items: emojis,\n onSelect: handleSelectEmoji,\n onClose,\n });\n\n useEffect(() => {\n setItemVisible(selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'EmojiTooltip composer-tooltip custom-scroll-x',\n transitionClassNames,\n );\n\n return (\n \n {shouldRender && listEmojis ? (\n listEmojis.map((emoji, index) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(EmojiTooltip);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiWebDocument } from '../../../../api/types';\n\nimport { getFirstLetters } from '../../../../util/textFormat';\nimport renderText from '../../../common/helpers/renderText';\nimport useMedia from '../../../../hooks/useMedia';\n\nimport ListItem from '../../../ui/ListItem';\n\nimport './BaseResult.scss';\nimport { preventMessageInputBlurWithBubbling } from '../../helpers/preventMessageInputBlur';\n\nexport type OwnProps = {\n focus?: boolean;\n thumbnail?: ApiWebDocument;\n thumbUrl?: string;\n title?: string;\n description?: string;\n transitionClassNames?: string;\n onClick: NoneToVoidFunction;\n};\n\nconst BaseResult: FC = ({\n title,\n description,\n thumbnail,\n thumbUrl,\n focus,\n transitionClassNames = '',\n onClick,\n}) => {\n let content: string | undefined = '';\n\n const thumbnailDataUrl = useMedia(thumbnail ? `webDocument:${thumbnail.url}` : undefined);\n thumbUrl = thumbUrl || thumbnailDataUrl;\n\n if (thumbUrl) {\n content = (\n \"\"\n );\n } else if (title) {\n content = getFirstLetters(title, 1);\n }\n\n return (\n \n \n {typeof content === 'string' ? renderText(content) : content}\n \n
\n {title && (
{title}
)}\n {description && (
{description}
)}\n
\n \n );\n};\n\nexport default memo(BaseResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiPhoto, ApiThumbnail, ApiWebDocument,\n} from '../../../../api/types';\n\nimport buildClassName from '../../../../util/buildClassName';\nimport useMedia from '../../../../hooks/useMedia';\nimport useMediaTransition from '../../../../hooks/useMediaTransition';\n\nimport BaseResult from './BaseResult';\n\nimport './MediaResult.scss';\n\nexport type OwnProps = {\n focus?: boolean;\n isForGallery?: boolean;\n inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst MediaResult: FC = ({\n focus, isForGallery, inlineResult, onClick,\n}) => {\n let photo: ApiPhoto | undefined;\n let thumbnail: ApiThumbnail | undefined;\n let webThumbnail: ApiWebDocument | undefined;\n\n if ('photo' in inlineResult) {\n photo = inlineResult.photo;\n }\n // For results with type=video (for example @stikstokbot)\n if ('thumbnail' in inlineResult) {\n thumbnail = inlineResult.thumbnail;\n }\n if ('webThumbnail' in inlineResult && isForGallery) {\n webThumbnail = inlineResult.webThumbnail;\n }\n\n const thumbnailDataUrl = useMedia(webThumbnail ? `webDocument:${webThumbnail.url}` : undefined);\n const mediaBlobUrl = useMedia(photo && `photo${photo.id}?size=m`);\n const transitionClassNames = useMediaTransition(mediaBlobUrl);\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (isForGallery) {\n return (\n
\n \"\"\n \"\"\n
\n );\n }\n\n const { title, description } = inlineResult;\n\n return (\n \n );\n};\n\nexport default memo(MediaResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineResult } from '../../../../api/types';\n\nimport BaseResult from './BaseResult';\n\nexport type OwnProps = {\n focus?: boolean;\n inlineResult: ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst ArticleResult: FC = ({ focus, inlineResult, onClick }) => {\n const {\n title, url, description, webThumbnail,\n } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n return (\n \n );\n};\n\nexport default memo(ArticleResult);\n","import React, {\n FC, memo, useCallback,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport GifButton from '../../../common/GifButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst GifResult: FC = ({\n inlineResult, observeIntersection, onClick,\n}) => {\n const { gif } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (!gif) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(GifResult);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { STICKER_SIZE_INLINE_BOT_RESULT } from '../../../../config';\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport StickerButton from '../../../common/StickerButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst StickerResult: FC = ({ inlineResult, observeIntersection, onClick }) => {\n const { sticker } = inlineResult;\n\n if (!sticker) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(StickerResult);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { throttle } from '../../../util/schedulers';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport MediaResult from './inlineResults/MediaResult';\nimport ArticleResult from './inlineResults/ArticleResult';\nimport GifResult from './inlineResults/GifResult';\nimport StickerResult from './inlineResults/StickerResult';\nimport ListItem from '../../ui/ListItem';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\nimport './InlineBotTooltip.scss';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nexport type OwnProps = {\n isOpen: boolean;\n botId?: string;\n isGallery?: boolean;\n inlineBotResults?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n switchPm?: ApiBotInlineSwitchPm;\n onSelectResult: (inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult) => void;\n loadMore: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\nconst InlineBotTooltip: FC = ({\n isOpen,\n botId,\n isGallery,\n inlineBotResults,\n switchPm,\n loadMore,\n onClose,\n onSelectResult,\n}) => {\n const {\n openChat,\n startBot,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n isDisabled: !isOpen,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (direction === LoadMoreDirection.Backwards) {\n runThrottled(loadMore);\n }\n }, [loadMore]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n shouldRemoveSelectionOnReset: isGallery,\n noArrowNavigation: isGallery,\n items: inlineBotResults,\n onSelect: onSelectResult,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleSendPm = useCallback(() => {\n openChat({ id: botId });\n startBot({ botId, param: switchPm!.startParam });\n }, [botId, openChat, startBot, switchPm]);\n\n const prevInlineBotResults = usePrevious(\n inlineBotResults?.length\n ? inlineBotResults\n : undefined,\n shouldRender,\n );\n const renderedInlineBotResults = inlineBotResults && !inlineBotResults.length\n ? prevInlineBotResults\n : inlineBotResults;\n\n if (!shouldRender || !(renderedInlineBotResults?.length || switchPm)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'InlineBotTooltip composer-tooltip',\n IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll',\n isGallery && 'gallery',\n transitionClassNames,\n );\n\n function renderSwitchPm() {\n return (\n \n {switchPm!.text}\n \n );\n }\n\n function renderContent() {\n return renderedInlineBotResults!.map((inlineBotResult, index) => {\n switch (inlineBotResult.type) {\n case 'gif':\n return (\n \n );\n\n case 'photo':\n return (\n \n );\n\n case 'sticker':\n return (\n \n );\n\n case 'video':\n case 'file':\n case 'game':\n return (\n \n );\n case 'article':\n case 'audio':\n return (\n \n );\n\n default:\n return undefined;\n }\n });\n }\n\n return (\n \n {switchPm && renderSwitchPm()}\n {renderedInlineBotResults?.length && renderContent()}\n \n );\n};\n\nexport default memo(InlineBotTooltip);\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\n\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport renderText from '../../common/helpers/renderText';\nimport { getUserFullName, isUserId } from '../../../modules/helpers';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\nimport buildClassName from '../../../util/buildClassName';\nimport { getDispatch, getGlobal } from '../../../lib/teact/teactn';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\nimport Menu from '../../ui/Menu';\n\nimport './SendAsMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n chatId?: string;\n selectedSendAsId?: string;\n sendAsIds?: string[];\n};\n\nconst SendAsMenu: FC = ({\n isOpen,\n onClose,\n chatId,\n selectedSendAsId,\n sendAsIds,\n}) => {\n const { saveDefaultSendAs } = getDispatch();\n\n // No need for expensive global updates on users and chats, so we avoid them\n const usersById = getGlobal().users.byId;\n const chatsById = getGlobal().chats.byId;\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const [handleMouseEnter, handleMouseLeave, markMouseInside] = useMouseInside(isOpen, onClose, undefined);\n\n useEffect(() => {\n if (isOpen) {\n markMouseInside();\n }\n }, [isOpen, markMouseInside]);\n\n const handleUserSelect = useCallback((id: string) => {\n onClose();\n saveDefaultSendAs({ chatId, sendAsId: id });\n }, [chatId, onClose, saveDefaultSendAs]);\n\n const selectedSendAsIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: sendAsIds,\n onSelect: handleUserSelect,\n shouldSelectOnTab: true,\n shouldSaveSelectionOnUpdateItems: true,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedSendAsIndex, containerRef);\n }, [selectedSendAsIndex]);\n\n useEffect(() => {\n if (sendAsIds && !sendAsIds.length) {\n onClose();\n }\n }, [sendAsIds, onClose]);\n\n return (\n \n
{lang('SendMessageAsTitle')}
\n {usersById && chatsById && sendAsIds?.map((id, index) => {\n const user = isUserId(id) ? usersById[id] : undefined;\n const chat = !user ? chatsById[id] : undefined;\n const fullName = user ? getUserFullName(user) : chat?.title;\n\n return (\n handleUserSelect(id)}\n focus={selectedSendAsIndex === index}\n >\n \n
\n
\n

{fullName && renderText(fullName)}

\n
\n {user\n ? lang('VoipGroupPersonalAccount')\n : lang('Subscribers', chat?.membersCount, 'i')}\n \n
\n \n );\n })}\n \n );\n};\n\nexport default memo(SendAsMenu);\n","import React, {\n FC, useMemo, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiUser, ApiChat } from '../../api/types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\nimport {\n selectUser,\n selectChatMessages,\n selectChat,\n selectCurrentTextSearch,\n} from '../../modules/selectors';\nimport {\n getChatTitle,\n getUserFullName,\n isChatChannel,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport { renderMessageSummary } from '../common/helpers/renderMessageText';\nimport renderText from '../common/helpers/renderText';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport LastMessageMeta from '../common/LastMessageMeta';\nimport Avatar from '../common/Avatar';\n\nimport './RightSearch.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n messagesById?: Record;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n};\n\nconst RightSearch: FC = ({\n chatId,\n threadId,\n onClose,\n isActive,\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n}) => {\n const {\n searchTextMessagesLocal,\n focusMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n useHistoryBack(isActive, onClose);\n\n const [viewportIds, getMore] = useInfiniteScroll(searchTextMessagesLocal, foundIds);\n\n const viewportResults = useMemo(() => {\n if (!query || !viewportIds?.length || !messagesById) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return viewportIds.map((id) => {\n const message = messagesById[id];\n if (!message) {\n return undefined;\n }\n\n const senderUser = message.senderId ? selectUser(getGlobal(), message.senderId) : undefined;\n\n let senderChat;\n if (chat && isChatChannel(chat)) {\n senderChat = chat;\n } else if (message.forwardInfo) {\n const { isChannelPost, fromChatId } = message.forwardInfo;\n senderChat = isChannelPost && fromChatId ? selectChat(getGlobal(), fromChatId) : undefined;\n } else {\n senderChat = message.senderId ? selectChat(getGlobal(), message.senderId) : undefined;\n }\n\n return {\n message,\n senderUser,\n senderChat,\n onClick: () => focusMessage({ chatId, threadId, messageId: id }),\n };\n }).filter(Boolean);\n }, [query, viewportIds, messagesById, chat, focusMessage, chatId, threadId]);\n\n const handleKeyDown = useKeyboardListNavigation(containerRef, true, (index) => {\n const foundResult = viewportResults?.[index === -1 ? 0 : index];\n if (foundResult) {\n foundResult.onClick();\n }\n }, '.ListItem-button', true);\n\n const renderSearchResult = ({\n message, senderUser, senderChat, onClick,\n }: {\n message: ApiMessage;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n onClick: NoneToVoidFunction;\n }) => {\n const title = senderChat ? getChatTitle(lang, senderChat) : getUserFullName(senderUser);\n const text = renderMessageSummary(lang, message, undefined, query);\n\n return (\n \n \n
\n
\n

{title && renderText(title)}

\n \n
\n
\n {text}\n
\n
\n \n );\n };\n\n const isOnTop = viewportIds?.[0] === foundIds?.[0];\n\n return (\n \n {isOnTop && (\n

\n {!query ? (\n lang('lng_dlg_search_for_messages')\n ) : (totalCount === 0 || !viewportResults.length) ? (\n lang('lng_search_no_results')\n ) : totalCount === 1 ? (\n '1 message found'\n ) : (\n `${(viewportResults.length && (totalCount || viewportResults.length))} messages found`\n )}\n

\n )}\n {viewportResults.map(renderSearchResult)}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const messagesById = chat && selectChatMessages(global, chat.id);\n if (!chat || !messagesById) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n };\n },\n)(RightSearch));\n","import React, {\n FC, useEffect, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiStickerSet } from '../../api/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_SEARCH } from '../../config';\nimport { selectShouldLoopStickers, selectStickerSet } from '../../modules/selectors';\nimport useFlag from '../../hooks/useFlag';\nimport useOnChange from '../../hooks/useOnChange';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport StickerButton from '../common/StickerButton';\nimport StickerSetModal from '../common/StickerSetModal.async';\nimport Spinner from '../ui/Spinner';\n\ntype OwnProps = {\n stickerSetId: string;\n observeIntersection: ObserveFn;\n isSomeModalOpen: boolean;\n onModalToggle: (isOpen: boolean) => void;\n};\n\ntype StateProps = {\n set?: ApiStickerSet;\n shouldPlay?: boolean;\n};\n\nconst STICKERS_TO_DISPLAY = 5;\n\nconst StickerSetResult: FC = ({\n stickerSetId, observeIntersection, set, shouldPlay,\n isSomeModalOpen, onModalToggle,\n}) => {\n const { loadStickers, toggleStickerSet } = getDispatch();\n\n const lang = useLang();\n const isAdded = set && Boolean(set.installedDate);\n const areStickersLoaded = Boolean(set?.stickers);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n useOnChange(() => {\n onModalToggle(isModalOpen);\n }, [isModalOpen, onModalToggle]);\n\n const displayedStickers = useMemo(() => {\n if (!set) {\n return [];\n }\n\n const coverStickerIds = (set.covers || []).map(({ id }) => id);\n const otherStickers = set.stickers ? set.stickers.filter(({ id }) => !coverStickerIds.includes(id)) : [];\n\n return [...(set.covers || []), ...otherStickers].slice(0, STICKERS_TO_DISPLAY);\n }, [set]);\n\n useEffect(() => {\n // Featured stickers are initialized with one sticker in collection (cover of SickerSet)\n if (!areStickersLoaded && displayedStickers.length < STICKERS_TO_DISPLAY) {\n loadStickers({ stickerSetId });\n }\n }, [areStickersLoaded, displayedStickers.length, loadStickers, stickerSetId]);\n\n const handleAddClick = useCallback(() => {\n toggleStickerSet({ stickerSetId });\n }, [toggleStickerSet, stickerSetId]);\n\n if (!set) {\n return undefined;\n }\n\n const canRenderStickers = displayedStickers.length > 0;\n\n return (\n
\n
\n
\n

{set.title}

\n

{lang('Stickers', set.count, 'i')}

\n
\n \n {lang(isAdded ? 'Stickers.Installed' : 'Stickers.Install')}\n \n
\n
\n {!canRenderStickers && }\n {canRenderStickers && displayedStickers.map((sticker) => (\n \n ))}\n
\n {canRenderStickers && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { stickerSetId }): StateProps => {\n return {\n set: selectStickerSet(global, stickerSetId),\n shouldPlay: selectShouldLoopStickers(global),\n };\n },\n)(StickerSetResult));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { throttle } from '../../util/schedulers';\nimport { selectCurrentStickerSearch } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Loading from '../ui/Loading';\nimport StickerSetResult from './StickerSetResult';\n\nimport './StickerSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n featuredIds?: string[];\n resultIds?: string[];\n};\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst StickerSearch: FC = ({\n onClose,\n isActive,\n query,\n featuredIds,\n resultIds,\n}) => {\n const { loadFeaturedStickers } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadFeaturedStickers();\n });\n });\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!query && featuredIds) {\n return featuredIds.map((id) => (\n \n ));\n }\n\n if (resultIds) {\n if (!resultIds.length) {\n return

Nothing found.

;\n }\n\n return resultIds.map((id) => (\n \n ));\n }\n\n return ;\n }\n\n return (\n
\n {renderContent()}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentStickerSearch(global);\n const { query, resultIds } = currentSearch || {};\n const { featured } = global.stickers;\n\n return {\n query,\n featuredIds: featured.setIds,\n resultIds,\n };\n },\n)(StickerSearch));\n","import React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiVideo } from '../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n selectCurrentGifSearch,\n selectChat,\n selectIsChatWithBot,\n selectCurrentMessageList,\n} from '../../modules/selectors';\nimport { getAllowedAttachmentOptions } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport GifButton from '../common/GifButton';\nimport Loading from '../ui/Loading';\n\nimport './GifSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n results?: ApiVideo[];\n chat?: ApiChat;\n isChatWithBot?: boolean;\n};\n\nconst PRELOAD_BACKWARDS = 96; // GIF Search bot results are multiplied by 24\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifSearch: FC = ({\n onClose,\n isActive,\n query,\n results,\n chat,\n isChatWithBot,\n}) => {\n const {\n searchMoreGifs,\n sendMessage,\n setGifSearchQuery,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n const { canSendGifs } = getAllowedAttachmentOptions(chat, isChatWithBot);\n\n const handleGifClick = useCallback((gif: ApiVideo) => {\n if (canSendGifs) {\n sendMessage({ gif });\n }\n\n if (IS_TOUCH_ENV) {\n setGifSearchQuery({ query: undefined });\n }\n }, [canSendGifs, sendMessage, setGifSearchQuery]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!results) {\n return (\n \n );\n }\n\n if (!results.length) {\n return (\n

{lang('NoGIFsFound')}

\n );\n }\n\n return results.map((gif) => (\n \n ));\n }\n\n const hasResults = Boolean(query !== undefined && results && results.length);\n\n return (\n
\n \n {renderContent()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentGifSearch(global);\n const { query, results } = currentSearch || {};\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChatWithBot = chat ? selectIsChatWithBot(global, chat) : undefined;\n\n return {\n query,\n results,\n chat,\n isChatWithBot,\n };\n },\n)(GifSearch));\n","import React, {\n FC, useCallback, useState, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat,\n ApiMessage,\n ApiPollAnswer,\n ApiPollResult,\n} from '../../api/types';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport ShowMoreButton from '../ui/ShowMoreButton';\nimport Loading from '../ui/Loading';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\n\nimport './PollAnswerResults.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n message: ApiMessage;\n answer: ApiPollAnswer;\n answerVote: ApiPollResult;\n totalVoters: number;\n};\n\ntype StateProps = {\n voters?: string[];\n offset: string;\n};\n\nconst INITIAL_LIMIT = 4;\nconst VIEW_MORE_LIMIT = 50;\n\nconst PollAnswerResults: FC = ({\n chat,\n message,\n answer,\n answerVote,\n totalVoters,\n voters,\n offset,\n}) => {\n const {\n loadPollOptionResults,\n openChat,\n closePollResults,\n } = getDispatch();\n\n const prevVotersCount = usePrevious(answerVote.votersCount);\n const [isLoading, setIsLoading] = useState(true);\n const areVotersLoaded = Boolean(voters);\n const { option, text } = answer;\n const lang = useLang();\n\n useEffect(() => {\n // For update when new votes arrive or when the user takes back his vote\n if (!areVotersLoaded || prevVotersCount !== answerVote.votersCount) {\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: INITIAL_LIMIT, shouldResetVoters: true,\n });\n }\n // eslint-disable-next-line\n }, [answerVote.votersCount, areVotersLoaded]);\n\n const handleViewMoreClick = useCallback(() => {\n setIsLoading(true);\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: VIEW_MORE_LIMIT,\n });\n }, [chat, loadPollOptionResults, message.id, offset, option]);\n\n useEffect(() => {\n setIsLoading(false);\n }, [voters]);\n\n const handleMemberClick = useCallback((id: string) => {\n openChat({ id });\n closePollResults();\n }, [closePollResults, openChat]);\n\n function renderViewMoreButton() {\n const leftVotersCount = answerVote.votersCount - voters!.length;\n\n return answerVote.votersCount > INITIAL_LIMIT && leftVotersCount > 0 && (\n \n );\n }\n\n return (\n
\n
\n {voters\n ? voters.map((id) => (\n handleMemberClick(id)}\n >\n \n \n ))\n : }\n {voters && renderViewMoreButton()}\n
\n
\n {text}\n \n {getPercentage(answerVote.votersCount, totalVoters)}%\n \n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default memo(withGlobal(\n (global, { answer }: OwnProps): StateProps => {\n const { voters, offsets } = global.pollResults;\n\n return {\n voters: voters?.[answer.option],\n offset: (offsets?.[answer.option]) || '',\n };\n },\n)(PollAnswerResults));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiChat } from '../../api/types';\nimport { selectChat, selectChatMessage } from '../../modules/selectors';\nimport { buildCollectionByKey } from '../../util/iteratees';\nimport { getMessagePoll } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport PollAnswerResults from './PollAnswerResults';\nimport Loading from '../ui/Loading';\n\nimport './PollResults.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n message?: ApiMessage;\n lastSyncTime?: number;\n};\n\nconst PollResults: FC = ({\n onClose,\n isActive,\n chat,\n message,\n lastSyncTime,\n}) => {\n const lang = useLang();\n useHistoryBack(isActive, onClose);\n\n if (!message || !chat) {\n return ;\n }\n\n const { summary, results } = getMessagePoll(message)!;\n if (!results.results) {\n return undefined;\n }\n\n const resultsByOption = buildCollectionByKey(results.results, 'option');\n\n return (\n
\n

{renderText(summary.question, ['emoji', 'br'])}

\n
\n {lastSyncTime && summary.answers.map((answer) => (\n \n ))}\n {!lastSyncTime && }\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n pollResults: { chatId, messageId },\n lastSyncTime,\n } = global;\n\n if (!chatId || !messageId) {\n return {};\n }\n\n const chat = selectChat(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n chat,\n message,\n lastSyncTime,\n };\n },\n)(PollResults));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../../modules/selectors';\nimport { selectIsChatMuted } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n userId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n progress?: ManagementProgress;\n isMuted?: boolean;\n};\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide first name';\n\nconst ManageUser: FC = ({\n userId,\n user,\n progress,\n isMuted,\n onClose,\n isActive,\n}) => {\n const {\n updateContact,\n deleteContact,\n closeManagement,\n } = getDispatch();\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const currentFirstName = user ? (user.firstName || '') : '';\n const currentLastName = user ? (user.lastName || '') : '';\n\n const [firstName, setFirstName] = useState(currentFirstName);\n const [lastName, setLastName] = useState(currentLastName);\n const [isNotificationsEnabled, setIsNotificationsEnabled] = useState(!isMuted);\n\n useEffect(() => {\n setIsNotificationsEnabled(!isMuted);\n }, [isMuted]);\n\n useEffect(() => {\n setIsProfileFieldsTouched(false);\n closeDeleteDialog();\n }, [closeDeleteDialog, userId]);\n\n useEffect(() => {\n setFirstName(currentFirstName);\n setLastName(currentLastName);\n }, [currentFirstName, currentLastName, user]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n closeDeleteDialog();\n }\n }, [closeDeleteDialog, progress]);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleNotificationChange = useCallback((e: ChangeEvent) => {\n setIsNotificationsEnabled(e.target.checked);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n }\n\n updateContact({\n userId,\n isMuted: !isNotificationsEnabled,\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n });\n }, [firstName, lastName, updateContact, userId, isNotificationsEnabled]);\n\n const handleDeleteContact = useCallback(() => {\n deleteContact({ userId });\n closeDeleteDialog();\n closeManagement();\n }, [closeDeleteDialog, closeManagement, deleteContact, userId]);\n\n if (!user) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n
\n \n
\n
\n
\n \n {lang('DeleteContact')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const user = selectUser(global, userId);\n const chat = selectChat(global, userId)!;\n const { progress } = global.management;\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n return {\n user, progress, isMuted,\n };\n },\n)(ManageUser));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport {\n ApiChat, ApiChatBannedRights, ApiExportedInvite, ApiMediaFormat,\n} from '../../../api/types';\n\nimport { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { selectChat } from '../../../modules/selectors';\nimport { formatInteger } from '../../../util/textFormat';\nimport renderText from '../../common/helpers/renderText';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isBasicGroup: boolean;\n hasLinkedChannel: boolean;\n canChangeInfo?: boolean;\n canBanUsers?: boolean;\n canInvite?: boolean;\n exportedInvites?: ApiExportedInvite[];\n lastSyncTime?: number;\n availableReactionsCount?: number;\n};\n\nconst GROUP_TITLE_EMPTY = 'Group title can\\'t be empty';\n\n// Some checkboxes control multiple rights, and some rights are not controlled from Permissions screen,\n// so we need to define the amount manually\nconst TOTAL_PERMISSIONS_COUNT = 8;\n\nconst ManageGroup: FC = ({\n chatId,\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo,\n canBanUsers,\n canInvite,\n onScreenSelect,\n onClose,\n isActive,\n exportedInvites,\n lastSyncTime,\n availableReactionsCount,\n}) => {\n const {\n togglePreHistoryHidden,\n updateChat,\n deleteChat,\n leaveChannel,\n deleteChannel,\n closeManagement,\n openChat,\n loadExportedChatInvites,\n loadChatJoinRequests,\n } = getDispatch();\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const currentTitle = chat.title;\n const currentAbout = chat.fullInfo ? (chat.fullInfo.about || '') : '';\n\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle || '');\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const isPublicGroup = chat.username || hasLinkedChannel;\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (lastSyncTime && canInvite) {\n loadExportedChatInvites({ chatId });\n loadExportedChatInvites({ chatId, isRevoked: true });\n loadChatJoinRequests({ chatId });\n }\n }, [chatId, loadExportedChatInvites, lastSyncTime, canInvite, loadChatJoinRequests]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickReactions = useCallback(() => {\n onScreenSelect(ManagementScreens.Reactions);\n }, [onScreenSelect]);\n\n const handleClickPermissions = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleClickInvites = () => {\n onScreenSelect(ManagementScreens.Invites);\n };\n\n const handleClickRequests = () => {\n onScreenSelect(ManagementScreens.JoinRequests);\n };\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateGroup = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(GROUP_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleClickMembers = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupMembers);\n }, [onScreenSelect]);\n\n const handleTogglePreHistory = useCallback(() => {\n if (!chat.fullInfo) {\n return;\n }\n\n const { isPreHistoryHidden } = chat.fullInfo;\n\n togglePreHistoryHidden({ chatId: chat.id, isEnabled: !isPreHistoryHidden });\n }, [chat, togglePreHistoryHidden]);\n\n const enabledReactionsCount = chat.fullInfo?.enabledReactions?.length || 0;\n\n const enabledPermissionsCount = useMemo(() => {\n if (!chat.defaultBannedRights) {\n return 0;\n }\n\n let totalCount = [\n 'sendMessages',\n 'sendMedia',\n 'embedLinks',\n 'sendPolls',\n 'changeInfo',\n 'inviteUsers',\n 'pinMessages',\n ].filter(\n (key) => !chat.defaultBannedRights![key as keyof ApiChatBannedRights],\n ).length;\n\n const { sendStickers, sendGifs } = chat.defaultBannedRights;\n\n // These two rights are controlled with a single checkbox\n if (!sendStickers && !sendGifs) {\n totalCount += 1;\n }\n\n return totalCount;\n }, [chat]);\n\n const adminsCount = (chat.fullInfo?.adminMembers?.length) || 0;\n\n const handleDeleteGroup = useCallback(() => {\n if (isBasicGroup) {\n deleteChat({ chatId: chat.id });\n } else if (!chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else {\n deleteChannel({ chatId: chat.id });\n }\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [\n isBasicGroup, chat.isCreator, chat.id,\n closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, deleteChat, openChat,\n ]);\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('GroupType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n {hasLinkedChannel && (\n \n {lang('LinkedChannel')}\n {lang('DiscussionUnlink')}\n \n )}\n \n {lang('ChannelPermissions')}\n \n {enabledPermissionsCount}/{TOTAL_PERMISSIONS_COUNT}\n \n \n\n \n {lang('Reactions')}\n \n {enabledReactionsCount}/{availableReactionsCount}\n \n \n \n {lang('ChannelAdministrators')}\n {formatInteger(adminsCount)}\n \n {canInvite && (\n \n {lang('GroupInfo.InviteLinks')}\n \n {exportedInvites ? formatInteger(exportedInvites.length) : lang('Loading')}\n \n \n )}\n {Boolean(chat.joinRequests?.length) && (\n \n {lang('MemberRequests')}\n \n {formatInteger(chat.joinRequests!.length)}\n \n \n )}\n
\n
\n \n {lang('GroupMembers')}\n {formatInteger(chat.membersCount ?? 0)}\n \n\n {!isPublicGroup && chat.fullInfo && (\n
\n \n
\n )}\n
\n
\n \n {lang('DeleteMega')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const hasLinkedChannel = Boolean(chat.fullInfo?.linkedChatId);\n const isBasicGroup = isChatBasicGroup(chat);\n const { invites } = global.management.byChatId[chatId] || {};\n\n return {\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'changeInfo'),\n canBanUsers: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'banUsers'),\n canInvite: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'inviteUsers'),\n exportedInvites: invites,\n lastSyncTime: global.lastSyncTime,\n availableReactionsCount: global.availableReactions?.filter((l) => !l.isInactive).length,\n };\n },\n)(ManageGroup));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n currentUserId?: string;\n};\n\nconst FLOATING_BUTTON_ANIMATION_TIMEOUT_MS = 250;\n\nfunction getLangKeyForBannedRightKey(key: string) {\n switch (key) {\n case 'sendMessages':\n return 'UserRestrictionsNoSend';\n case 'sendMedia':\n return 'UserRestrictionsNoSendMedia';\n case 'sendStickers':\n return 'UserRestrictionsNoSendStickers';\n case 'embedLinks':\n return 'UserRestrictionsNoEmbedLinks';\n case 'sendPolls':\n return 'UserRestrictionsNoSendPolls';\n case 'changeInfo':\n return 'UserRestrictionsNoChangeInfo';\n case 'inviteUsers':\n return 'UserRestrictionsInviteUsers';\n case 'pinMessages':\n return 'UserRestrictionsPinMessages';\n default:\n return undefined;\n }\n}\n\nconst ManageGroupPermissions: FC = ({\n onScreenSelect,\n onChatMemberSelect,\n chat,\n currentUserId,\n onClose,\n isActive,\n}) => {\n const { updateChatDefaultBannedRights } = getDispatch();\n\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const handleRemovedUsersClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupRemovedUsers);\n }, [onScreenSelect]);\n\n const handleAddExceptionClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupUserPermissionsCreate);\n }, [onScreenSelect]);\n\n const handleExceptionMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n useEffect(() => {\n setPermissions((chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setTimeout(() => {\n setIsLoading(false);\n }, FLOATING_BUTTON_ANIMATION_TIMEOUT_MS);\n }, [chat]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat) {\n return;\n }\n\n setIsLoading(true);\n updateChatDefaultBannedRights({ chatId: chat.id, bannedRights: permissions });\n }, [chat, permissions, updateChatDefaultBannedRights]);\n\n const removedUsersCount = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return 0;\n }\n\n return chat.fullInfo.kickedMembers.length;\n }, [chat]);\n\n const exceptionMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return [];\n }\n\n return chat.fullInfo.members.filter(({ bannedRights }) => Boolean(bannedRights));\n }, [chat]);\n\n const getMemberExceptions = useCallback((member: ApiChatMember) => {\n const { bannedRights } = member;\n if (!bannedRights || !chat) {\n return undefined;\n }\n\n const { defaultBannedRights } = chat;\n\n return Object.keys(bannedRights).reduce((result, key) => {\n if (\n !bannedRights[key as keyof ApiChatBannedRights]\n || (defaultBannedRights?.[key as keyof ApiChatBannedRights])\n || key === 'sendInline' || key === 'viewMessages' || key === 'sendGames'\n ) {\n return result;\n }\n\n const langKey = getLangKeyForBannedRightKey(key);\n\n if (!langKey) {\n return result;\n }\n\n const translatedString = lang(langKey);\n\n return `${result}${!result.length ? translatedString : `, ${translatedString}`}`;\n }, '');\n }, [chat, lang]);\n\n return (\n
\n
\n
\n

{lang('ChannelPermissionsHeader')}

\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 {lang('ChannelBlockedUsers')}\n {removedUsersCount}\n \n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n \n {lang('ChannelAddException')}\n \n\n {exceptionMembers.map((member) => (\n handleExceptionMemberClick(member)}\n >\n \n \n ))}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat, currentUserId: global.currentUserId };\n },\n)(ManageGroupPermissions));\n","import React, {\n FC, useMemo, useState, memo, useRef, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { filterUsersByName } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\n\nimport ChatOrUserPicker from '../../common/ChatOrUserPicker';\n\nexport type OwnProps = {\n chat: ApiChat;\n isOpen: boolean;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n currentUserId?: string;\n};\n\nconst RemoveGroupUserModal: FC = ({\n chat,\n currentUserId,\n isOpen,\n onClose,\n}) => {\n const {\n loadMoreMembers,\n deleteChatMember,\n } = getDispatch();\n\n const lang = useLang();\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const filterRef = useRef(null);\n\n const usersId = useMemo(() => {\n const availableMemberIds = (chat.fullInfo?.members || [])\n .reduce((acc: string[], member) => {\n if (!member.isAdmin && !member.isOwner && member.userId !== currentUserId) {\n acc.push(member.userId);\n }\n return acc;\n }, []);\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return filterUsersByName(availableMemberIds, usersById, filter);\n }, [chat.fullInfo?.members, currentUserId, filter]);\n\n const handleRemoveUser = useCallback((userId: string) => {\n deleteChatMember({ chatId: chat.id, userId });\n onClose();\n }, [chat.id, deleteChatMember, onClose]);\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n\n return { currentUserId };\n },\n)(RemoveGroupUserModal));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getHasAdminRight, getUserFullName, isChatChannel } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useFlag from '../../../hooks/useFlag';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport RemoveGroupUserModal from './RemoveGroupUserModal';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n usersById: Record;\n canDeleteMembers?: boolean;\n isChannel?: boolean;\n};\n\nconst ManageChatRemovedUsers: FC = ({\n chat,\n usersById,\n canDeleteMembers,\n isChannel,\n onClose,\n isActive,\n}) => {\n const { updateChatMemberBannedRights } = getDispatch();\n\n const lang = useLang();\n const [isRemoveUserModalOpen, openRemoveUserModal, closeRemoveUserModal] = useFlag();\n\n useHistoryBack(isActive, onClose);\n\n const removedMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return [];\n }\n\n return chat.fullInfo.kickedMembers;\n }, [chat]);\n\n const getRemovedBy = useCallback((member: ApiChatMember) => {\n if (!member.kickedByUserId) {\n return undefined;\n }\n\n const kickedByUser = usersById[member.kickedByUserId];\n if (!kickedByUser) {\n return undefined;\n }\n\n return lang('UserRemovedBy', getUserFullName(kickedByUser));\n }, [lang, usersById]);\n\n const getContextActions = useCallback((member: ApiChatMember) => {\n if (!chat) {\n return undefined;\n }\n\n return [{\n title: lang('Unblock'),\n icon: 'delete',\n destructive: true,\n handler: () => updateChatMemberBannedRights({\n chatId: chat.id,\n userId: member.userId,\n bannedRights: {},\n }),\n }];\n }, [lang, chat, updateChatMemberBannedRights]);\n\n return (\n
\n
\n
\n

{lang(isChannel ? 'NoBlockedChannel2' : 'NoBlockedGroup2')}

\n\n {removedMembers.map((member) => (\n \n \n \n ))}\n {canDeleteMembers && (\n \n \n \n )}\n {chat && canDeleteMembers && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const canDeleteMembers = chat && (getHasAdminRight(chat, 'banUsers') || chat.isCreator);\n\n return {\n chat,\n usersById,\n canDeleteMembers,\n isChannel: chat && isChatChannel(chat),\n };\n },\n)(ManageChatRemovedUsers));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiExportedInvite, ApiMediaFormat } from '../../../api/types';\n\nimport { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { formatInteger } from '../../../util/textFormat';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isSignaturesShown: boolean;\n canChangeInfo?: boolean;\n canInvite?: boolean;\n exportedInvites?: ApiExportedInvite[];\n lastSyncTime?: number;\n availableReactionsCount?: number;\n};\n\nconst CHANNEL_TITLE_EMPTY = 'Channel title can\\'t be empty';\n\nconst ManageChannel: FC = ({\n chatId,\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo,\n canInvite,\n exportedInvites,\n lastSyncTime,\n availableReactionsCount,\n onScreenSelect,\n onClose,\n isActive,\n}) => {\n const {\n updateChat,\n toggleSignatures,\n closeManagement,\n leaveChannel,\n deleteChannel,\n openChat,\n loadExportedChatInvites,\n loadChatJoinRequests,\n } = getDispatch();\n\n const currentTitle = chat ? (chat.title || '') : '';\n const currentAbout = chat?.fullInfo ? (chat.fullInfo.about || '') : '';\n const hasLinkedChat = chat?.fullInfo?.linkedChatId;\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle);\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = chat && getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (lastSyncTime) {\n loadExportedChatInvites({ chatId });\n loadExportedChatInvites({ chatId, isRevoked: true });\n loadChatJoinRequests({ chatId });\n }\n }, [chatId, loadExportedChatInvites, lastSyncTime, loadChatJoinRequests]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const adminsCount = (chat?.fullInfo?.adminMembers?.length) || 0;\n const removedUsersCount = (chat?.fullInfo?.kickedMembers?.length) || 0;\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickReactions = useCallback(() => {\n onScreenSelect(ManagementScreens.Reactions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleClickInvites = () => {\n onScreenSelect(ManagementScreens.Invites);\n };\n\n const handleClickRequests = () => {\n onScreenSelect(ManagementScreens.JoinRequests);\n };\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateChannel = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(CHANNEL_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleToggleSignatures = useCallback(() => {\n toggleSignatures({ chatId, isEnabled: !isSignaturesShown });\n }, [chatId, isSignaturesShown, toggleSignatures]);\n\n const handleClickSubscribers = useCallback(() => {\n onScreenSelect(ManagementScreens.ChannelSubscribers);\n }, [onScreenSelect]);\n\n const handleRemovedUsersClick = useCallback(() => {\n onScreenSelect(ManagementScreens.ChannelRemovedUsers);\n }, [onScreenSelect]);\n\n const handleDeleteChannel = useCallback(() => {\n if (chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n } else {\n leaveChannel({ chatId: chat.id });\n }\n\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.isCreator, chat.id, closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, openChat]);\n\n const enabledReactionsCount = chat.fullInfo?.enabledReactions?.length || 0;\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('ChannelType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n \n {lang('Discussion')}\n {hasLinkedChat ? lang('DiscussionUnlink') : lang('Add')}\n \n {canInvite && (\n \n {lang('GroupInfo.InviteLinks')}\n \n {exportedInvites ? formatInteger(exportedInvites.length) : lang('Loading')}\n \n \n )}\n {Boolean(chat.joinRequests?.length) && (\n \n {lang('SubscribeRequests')}\n \n {formatInteger(chat.joinRequests!.length)}\n \n \n )}\n \n {lang('Reactions')}\n \n {enabledReactionsCount}/{availableReactionsCount}\n \n \n
\n \n
\n
\n
\n \n {lang('ChannelAdministrators')}\n {adminsCount}\n \n \n {lang('ChannelSubscribers')}\n {lang('Subscribers', chat.membersCount ?? 0, 'i')}\n \n \n {lang('ChannelBlockedUsers')}\n {removedUsersCount}\n \n
\n
\n \n {chat.isCreator ? lang('ChannelDelete') : lang('LeaveChannel')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const isSignaturesShown = Boolean(chat?.isSignaturesShown);\n const { invites } = global.management.byChatId[chatId] || {};\n\n return {\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo: getHasAdminRight(chat, 'changeInfo'),\n canInvite: getHasAdminRight(chat, 'inviteUsers'),\n lastSyncTime: global.lastSyncTime,\n exportedInvites: invites,\n availableReactionsCount: global.availableReactions?.filter((l) => !l.isInactive).length,\n };\n },\n)(ManageChannel));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { selectChat, selectManagement } from '../../../modules/selectors';\nimport { isChatChannel } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport SafeLink from '../../common/SafeLink';\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport UsernameInput from '../../common/UsernameInput';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype PrivacyType = 'private' | 'public';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n isChannel: boolean;\n progress?: ManagementProgress;\n isUsernameAvailable?: boolean;\n isProtected?: boolean;\n};\n\nconst ManageChatPrivacyType: FC = ({\n chat,\n onClose,\n isActive,\n isChannel,\n progress,\n isUsernameAvailable,\n isProtected,\n}) => {\n const {\n checkPublicLink,\n updatePublicLink,\n updatePrivateLink,\n toggleIsProtected,\n } = getDispatch();\n\n const isPublic = Boolean(chat.username);\n const privateLink = chat.fullInfo?.inviteLink;\n\n const [privacyType, setPrivacyType] = useState(isPublic ? 'public' : 'private');\n const [username, setUsername] = useState();\n const [isRevokeConfirmDialogOpen, openRevokeConfirmDialog, closeRevokeConfirmDialog] = useFlag();\n\n const canUpdate = Boolean(\n (privacyType === 'public' && username && isUsernameAvailable)\n || (privacyType === 'private' && isPublic),\n );\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (privacyType && !privateLink) {\n updatePrivateLink();\n }\n }, [privacyType, privateLink, updatePrivateLink]);\n\n const handleOptionChange = useCallback((value: string) => {\n setPrivacyType(value as PrivacyType);\n }, []);\n\n const handleForwardingOptionChange = useCallback((value: string) => {\n toggleIsProtected({\n chatId: chat.id,\n isProtected: value === 'protected',\n });\n }, [chat.id, toggleIsProtected]);\n\n const handleSave = useCallback(() => {\n updatePublicLink({ username: privacyType === 'public' ? username : '' });\n }, [privacyType, updatePublicLink, username]);\n\n const handleRevokePrivateLink = useCallback(() => {\n closeRevokeConfirmDialog();\n updatePrivateLink();\n }, [closeRevokeConfirmDialog, updatePrivateLink]);\n\n const lang = useLang();\n const langPrefix1 = isChannel ? 'Channel' : 'Mega';\n const langPrefix2 = isChannel ? 'Channel' : 'Group';\n\n const options = [\n { value: 'private', label: lang(`${langPrefix1}Private`), subLabel: lang(`${langPrefix1}PrivateInfo`) },\n { value: 'public', label: lang(`${langPrefix1}Public`), subLabel: lang(`${langPrefix1}PublicInfo`) },\n ];\n\n const forwardingOptions = [{\n value: 'allowed',\n label: lang('ChannelVisibility.Forwarding.Enabled'),\n }, {\n value: 'protected',\n label: lang('ChannelVisibility.Forwarding.Disabled'),\n }];\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n

{lang(`${langPrefix2}Type`)}

\n \n
\n {privacyType === 'private' ? (\n
\n {privateLink ? (\n <>\n \n

\n {lang(`${langPrefix1}PrivateLinkHelp`)}\n

\n\n \n {lang('RevokeLink')}\n \n \n \n ) : (\n \n )}\n
\n ) : (\n
\n \n

\n {lang(`${langPrefix2}.Username.CreatePublicLinkHelp`)}\n

\n
\n )}\n
\n

\n {lang(isChannel ? 'ChannelVisibility.Forwarding.ChannelTitle' : 'ChannelVisibility.Forwarding.GroupTitle')}\n

\n \n

\n {isChannel\n ? lang('ChannelVisibility.Forwarding.ChannelInfo')\n : lang('ChannelVisibility.Forwarding.GroupInfo')}\n

\n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { isUsernameAvailable } = selectManagement(global, chatId)!;\n\n return {\n chat,\n isChannel: isChatChannel(chat),\n progress: global.management.progress,\n isUsernameAvailable,\n isProtected: chat?.isProtected,\n };\n },\n)(ManageChatPrivacyType));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config';\nimport { selectChat } from '../../../modules/selectors';\nimport getAnimationData from '../../common/helpers/animatedAssets';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport useFlag from '../../../hooks/useFlag';\nimport renderText from '../../common/helpers/renderText';\nimport Avatar from '../../common/Avatar';\nimport { isChatChannel } from '../../../modules/helpers';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n chatsByIds: Record;\n linkedChat?: ApiChat;\n forDiscussionIds?: string[];\n isChannel?: boolean;\n};\n\nconst ManageDiscussion: FC = ({\n chat,\n onClose,\n isActive,\n chatId,\n chatsByIds,\n linkedChat,\n forDiscussionIds,\n isChannel,\n onScreenSelect,\n}) => {\n const {\n loadGroupsForDiscussion,\n linkDiscussionGroup,\n unlinkDiscussionGroup,\n } = getDispatch();\n\n const [linkedGroupId, setLinkedGroupId] = useState();\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n const [isConfirmUnlinkGroupDialogOpen, openConfirmUnlinkGroupDialog, closeConfirmUnlinkGroupDialog] = useFlag();\n const [isConfirmLinkGroupDialogOpen, openConfirmLinkGroupDialog, closeConfirmLinkGroupDialog] = useFlag();\n const lang = useLang();\n const linkedChatId = linkedChat?.id;\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n loadGroupsForDiscussion();\n }, [loadGroupsForDiscussion]);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('DiscussionGroups').then(setAnimationData);\n }\n }, [animationData]);\n\n const handleUnlinkGroupSessions = useCallback(() => {\n closeConfirmUnlinkGroupDialog();\n unlinkDiscussionGroup({ channelId: isChannel ? chatId : linkedChatId });\n if (!isChannel) {\n onScreenSelect(ManagementScreens.Initial);\n }\n }, [closeConfirmUnlinkGroupDialog, unlinkDiscussionGroup, isChannel, chatId, linkedChatId, onScreenSelect]);\n\n const handleLinkGroupSessions = useCallback(() => {\n closeConfirmLinkGroupDialog();\n linkDiscussionGroup({ channelId: chatId, chatId: linkedGroupId });\n }, [closeConfirmLinkGroupDialog, linkDiscussionGroup, chatId, linkedGroupId]);\n\n const onDiscussionClick = (groupId: string) => {\n setLinkedGroupId(groupId);\n openConfirmLinkGroupDialog();\n };\n\n function renderUnlinkGroupHeader() {\n return (\n
\n \n
\n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n
\n
\n );\n }\n\n function renderLinkGroupHeader() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n return (\n
\n \n
\n {lang('Channel.DiscussionGroup.LinkGroup')}\n
\n
\n );\n }\n\n function renderLinkGroupConfirmText() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n if (linkedGroup.hasPrivateLink) {\n return renderText(\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPublicAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n return renderText(\n // eslint-disable-next-line max-len\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?\\n\\nAnyone from the channel will be able to see messages in this group.`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPrivateAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n function renderLinkedGroup() {\n return (\n
\n \n \n \n \n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n \n \n
\n );\n }\n\n function renderDiscussionGroups() {\n return (\n
\n

{lang('DiscussionChannelHelp')}

\n\n
\n \n {lang('DiscussionCreateGroup')}\n \n {forDiscussionIds ? (\n forDiscussionIds.map((id, i) => (\n {\n onDiscussionClick(id);\n }}\n >\n \n \n ))\n ) : (\n \n )}\n
\n

{lang('DiscussionChannelHelp2')}

\n \n
\n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n {linkedChat && renderLinkedGroup()}\n {!linkedChat && renderDiscussionGroups()}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { forDiscussionIds, byId: chatsByIds } = global.chats;\n const linkedChat = chat?.fullInfo?.linkedChatId\n ? selectChat(global, chat.fullInfo.linkedChatId)\n : undefined;\n\n return {\n chat,\n chatsByIds,\n forDiscussionIds,\n linkedChat,\n isChannel: chat && isChatChannel(chat),\n };\n },\n)(ManageDiscussion));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatBannedRights } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n chatId: string;\n selectedChatMemberId?: string;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isFormFullyDisabled?: boolean;\n};\n\nconst ManageGroupUserPermissions: FC = ({\n chat,\n selectedChatMemberId,\n onScreenSelect,\n isFormFullyDisabled,\n onClose,\n isActive,\n}) => {\n const { updateChatMemberBannedRights } = getDispatch();\n\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [isBanConfirmationDialogOpen, openBanConfirmationDialog, closeBanConfirmationDialog] = useFlag();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return undefined;\n }\n\n return chat.fullInfo.members.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember?.bannedRights) || (chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setIsLoading(false);\n }, [chat, selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: permissions,\n });\n }, [chat, selectedChatMemberId, permissions, updateChatMemberBannedRights]);\n\n const handleBanFromGroup = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: {\n viewMessages: true,\n },\n });\n }, [chat, selectedChatMemberId, updateChatMemberBannedRights]);\n\n const getControlIsDisabled = useCallback((key: Exclude) => {\n if (isFormFullyDisabled) {\n return true;\n }\n\n if (!chat || !chat.defaultBannedRights) {\n return false;\n }\n\n return chat.defaultBannedRights[key];\n }, [chat, isFormFullyDisabled]);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('UserRestrictionsCanDo')}

\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 {!isFormFullyDisabled && (\n
\n \n {lang('UserRestrictionsBlock')}\n \n
\n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return { chat, isFormFullyDisabled };\n },\n)(ManageGroupUserPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatMember } from '../../../api/types';\n\nimport { getUserFullName, isChatChannel } from '../../../modules/helpers';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n currentUserId?: string;\n isChannel: boolean;\n};\n\nconst ManageChatAdministrators: FC = ({\n chat,\n isChannel,\n currentUserId,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function handleRecentActionsClick() {\n onScreenSelect(ManagementScreens.GroupRecentActions);\n }\n\n const adminMembers = useMemo(() => {\n if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const handleAdminMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.ChatAdminRights);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n const handleAddAdminClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupAddAdmins);\n }, [onScreenSelect]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const promotedByUser = member.promotedByUserId ? usersById[member.promotedByUserId] : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [lang]);\n\n return (\n
\n
\n
\n \n {lang('EventLog')}\n {lang(isChannel ? 'EventLogInfoDetailChannel' : 'EventLogInfoDetail')}\n \n
\n\n
\n

\n {isChannel\n ? 'You can add administrators to help you manage your channel.'\n : 'You can add administrators to help you manage your group.'}\n

\n\n {adminMembers.map((member) => (\n handleAdminMemberClick(member)}\n >\n \n \n ))}\n\n \n \n \n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n\n return {\n chat,\n currentUserId: global.currentUserId,\n isChannel: isChatChannel(chat),\n };\n },\n)(ManageChatAdministrators));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember } from '../../../api/types';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n};\n\nconst ManageGroupRecentActions: FC = ({ chat, onClose, isActive }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const adminMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n return lang('ChannelAdmin');\n }, [lang]);\n\n return (\n
\n
\n
\n

Actions

\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

{lang('Channel.Management.Title')}

\n\n
\n \n
\n\n {adminMembers.map((member) => (\n \n \n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat };\n },\n)(ManageGroupRecentActions));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName, isChatBasicGroup, isChatChannel } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport InputText from '../../ui/InputText';\n\ntype OwnProps = {\n chatId: string;\n selectedUserId?: string;\n isPromotedByCurrentUser?: boolean;\n isNewAdmin?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n usersById: Record;\n currentUserId?: string;\n isChannel: boolean;\n isFormFullyDisabled: boolean;\n defaultRights?: ApiChatAdminRights;\n};\n\nconst CUSTOM_TITLE_MAX_LENGTH = 16;\n\nconst ManageGroupAdminRights: FC = ({\n isNewAdmin,\n selectedUserId,\n defaultRights,\n onScreenSelect,\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n onClose,\n isActive,\n}) => {\n const { updateChatAdmin } = getDispatch();\n\n const [permissions, setPermissions] = useState({});\n const [isTouched, setIsTouched] = useState(Boolean(isNewAdmin));\n const [isLoading, setIsLoading] = useState(false);\n const [isDismissConfirmationDialogOpen, openDismissConfirmationDialog, closeDismissConfirmationDialog] = useFlag();\n const [customTitle, setCustomTitle] = useState('');\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n const selectedAdminMember = chat.fullInfo?.adminMembers?.find(({ userId }) => userId === selectedUserId);\n\n // If `selectedAdminMember` variable is filled with a value, then we have already saved the administrator,\n // so now we need to return to the list of administrators\n if (isNewAdmin && (selectedAdminMember || !selectedUserId)) {\n return undefined;\n }\n\n if (isNewAdmin) {\n const user = getGlobal().users.byId[selectedUserId!];\n\n return user ? {\n userId: user.id,\n adminRights: defaultRights,\n customTitle: lang('ChannelAdmin'),\n isOwner: false,\n promotedByUserId: undefined,\n } : undefined;\n }\n\n return selectedAdminMember;\n }, [chat.fullInfo?.adminMembers, defaultRights, isNewAdmin, lang, selectedUserId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedUserId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedUserId]);\n\n useEffect(() => {\n setPermissions(selectedChatMember?.adminRights || {});\n setCustomTitle((selectedChatMember?.customTitle || '').substr(0, CUSTOM_TITLE_MAX_LENGTH));\n setIsTouched(Boolean(isNewAdmin));\n setIsLoading(false);\n }, [defaultRights, isNewAdmin, selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as keyof ApiChatAdminRights]),\n }));\n setIsTouched(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!selectedUserId) {\n return;\n }\n\n setIsLoading(true);\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedUserId,\n adminRights: permissions,\n customTitle,\n });\n }, [selectedUserId, updateChatAdmin, chat.id, permissions, customTitle]);\n\n const handleDismissAdmin = useCallback(() => {\n if (!selectedUserId) {\n return;\n }\n\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedUserId,\n adminRights: {},\n });\n closeDismissConfirmationDialog();\n }, [chat.id, closeDismissConfirmationDialog, selectedUserId, updateChatAdmin]);\n\n const getControlIsDisabled = useCallback((key: keyof ApiChatAdminRights) => {\n if (isChatBasicGroup(chat)) {\n return false;\n }\n\n if (isFormFullyDisabled || !chat.adminRights) {\n return true;\n }\n\n return !chat.adminRights![key];\n }, [chat, isFormFullyDisabled]);\n\n const memberStatus = useMemo(() => {\n if (isNewAdmin || !selectedChatMember) {\n return undefined;\n }\n\n if (selectedChatMember.isOwner) {\n return lang('ChannelCreator');\n }\n\n const promotedByUser = selectedChatMember.promotedByUserId\n ? usersById[selectedChatMember.promotedByUserId]\n : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [isNewAdmin, selectedChatMember, usersById, lang]);\n\n const handleCustomTitleChange = useCallback((e) => {\n const { value } = e.target;\n setCustomTitle(value);\n setIsTouched(true);\n }, []);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('EditAdminWhatCanDo')}

\n\n
\n \n
\n {isChannel && (\n
\n \n
\n )}\n {isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n\n {isFormFullyDisabled && (\n

\n {lang('Channel.EditAdmin.CannotEdit')}\n

\n )}\n\n {!isChannel && (\n \n )}\n\n {currentUserId !== selectedUserId && !isFormFullyDisabled && !isNewAdmin && (\n \n {lang('EditAdminRemoveAdmin')}\n \n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n {!isNewAdmin && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n const { currentUserId } = global;\n const isChannel = isChatChannel(chat);\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return {\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n defaultRights: chat.adminRights,\n };\n },\n)(ManageGroupAdminRights));\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUserStatus } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { unique } from '../../../util/iteratees';\nimport { selectChat } from '../../../modules/selectors';\nimport {\n sortUserIds, isChatChannel, filterUsersByName, sortChatIds, isUserBot,\n} from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport NothingFound from '../../common/NothingFound';\nimport ListItem from '../../ui/ListItem';\nimport InputText from '../../ui/InputText';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Loading from '../../ui/Loading';\n\ntype OwnProps = {\n chatId: string;\n isActive: boolean;\n noAdmins?: boolean;\n onClose: NoneToVoidFunction;\n onScreenSelect?: (screen: ManagementScreens) => void;\n onChatMemberSelect?: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n};\n\ntype StateProps = {\n userStatusesById: Record;\n members?: ApiChatMember[];\n adminMembers?: ApiChatMember[];\n isChannel?: boolean;\n localContactIds?: string[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: string[];\n globalUserIds?: string[];\n serverTimeOffset: number;\n};\n\nconst ManageGroupMembers: FC = ({\n noAdmins,\n members,\n adminMembers,\n userStatusesById,\n isChannel,\n isActive,\n globalUserIds,\n localContactIds,\n localUserIds,\n isSearching,\n searchQuery,\n serverTimeOffset,\n onClose,\n onScreenSelect,\n onChatMemberSelect,\n}) => {\n const { openChat, setUserSearchQuery, loadContactList } = getDispatch();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const adminIds = useMemo(() => {\n return noAdmins ? adminMembers?.map(({ userId }) => userId) || [] : [];\n }, [adminMembers, noAdmins]);\n\n const memberIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n if (!members || !usersById) {\n return [];\n }\n\n const userIds = sortUserIds(\n members.map(({ userId }) => userId),\n usersById,\n userStatusesById,\n undefined,\n serverTimeOffset,\n );\n\n return noAdmins ? userIds.filter((userId) => !adminIds.includes(userId)) : userIds;\n }, [members, userStatusesById, serverTimeOffset, noAdmins, adminIds]);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const chatsById = getGlobal().chats.byId;\n const shouldUseSearchResults = Boolean(searchQuery);\n const listedIds = !shouldUseSearchResults\n ? memberIds\n : (localContactIds ? filterUsersByName(localContactIds, usersById, searchQuery) : []);\n\n return sortChatIds(\n unique([\n ...listedIds,\n ...(shouldUseSearchResults ? localUserIds || [] : []),\n ...(shouldUseSearchResults ? globalUserIds || [] : []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n if (!user) {\n return true;\n }\n\n return (isChannel || user.canBeInvitedToGroup || !isUserBot(user))\n && (!noAdmins || !adminIds.includes(contactId));\n }),\n chatsById,\n true,\n );\n }, [memberIds, localContactIds, searchQuery, localUserIds, globalUserIds, isChannel, noAdmins, adminIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(loadContactList, displayedIds, Boolean(searchQuery));\n\n const handleMemberClick = useCallback((id: string) => {\n if (noAdmins) {\n onChatMemberSelect!(id, false);\n onScreenSelect!(ManagementScreens.ChatNewAdminRights);\n } else {\n openChat({ id });\n }\n }, [noAdmins, onChatMemberSelect, onScreenSelect, openChat]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n setUserSearchQuery({ query: e.target.value });\n }, [setUserSearchQuery]);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isActive, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n handleMemberClick(viewportIds[index === -1 ? 0 : index]);\n }\n }, '.ListItem-button', true);\n\n useHistoryBack(isActive, onClose);\n\n function renderSearchField() {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n {noAdmins && renderSearchField()}\n
\n
\n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n handleMemberClick(id)}\n >\n \n \n ))}\n \n ) : !isSearching && viewportIds && !viewportIds.length ? (\n \n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { statusesById: userStatusesById } = global.users;\n const members = chat?.fullInfo?.members;\n const adminMembers = chat?.fullInfo?.adminMembers;\n const isChannel = chat && isChatChannel(chat);\n const { userIds: localContactIds } = global.contactList || {};\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalUserIds,\n localUserIds,\n } = global.userSearch;\n\n return {\n members,\n adminMembers,\n userStatusesById,\n isChannel,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n globalUserIds,\n localUserIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupMembers));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser, ApiUserStatus } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n userStatusesById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageGroupUserPermissionsCreate: FC = ({\n usersById,\n userStatusesById,\n members,\n isChannel,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(\n members.filter((member) => !member.isOwner).map(({ userId }) => userId),\n usersById,\n userStatusesById,\n undefined,\n serverTimeOffset,\n );\n }, [members, serverTimeOffset, usersById, userStatusesById]);\n\n const handleExceptionMemberClick = useCallback((memberId: string) => {\n onChatMemberSelect(memberId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [onChatMemberSelect, onScreenSelect]);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleExceptionMemberClick(id)}\n >\n \n \n ))\n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById, statusesById: userStatusesById } = global.users;\n const members = chat?.fullInfo?.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n userStatusesById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupUserPermissionsCreate));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiExportedInvite } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_INVITES } from '../../../config';\nimport getAnimationData from '../../common/helpers/animatedAssets';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useLang from '../../../hooks/useLang';\nimport { formatCountdown, MILLISECONDS_IN_DAY } from '../../../util/dateFormat';\nimport useInterval from '../../../hooks/useInterval';\nimport useForceUpdate from '../../../hooks/useForceUpdate';\nimport { selectChat } from '../../../modules/selectors';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { getServerTime } from '../../../util/serverTime';\nimport useFlag from '../../../hooks/useFlag';\nimport { isChatChannel } from '../../../modules/helpers';\n\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\nimport Button from '../../ui/Button';\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n onScreenSelect: (screen: ManagementScreens) => void;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isChannel?: boolean;\n exportedInvites?: ApiExportedInvite[];\n revokedExportedInvites?: ApiExportedInvite[];\n serverTimeOffset: number;\n};\n\nconst BULLET = '\\u2022';\n\nfunction inviteComparator(i1: ApiExportedInvite, i2: ApiExportedInvite) {\n const { isPermanent: i1IsPermanent, usage: i1Usage = 0, date: i1Date } = i1;\n const { isPermanent: i2IsPermanent, usage: i2Usage = 0, date: i2Date } = i2;\n if (i1IsPermanent || i2IsPermanent) return Number(i1IsPermanent) - Number(i2IsPermanent);\n if (i1Usage || i2Usage) return i2Usage - i1Usage;\n return i2Date - i1Date;\n}\n\nconst ManageInvites: FC = ({\n chatId,\n chat,\n exportedInvites,\n revokedExportedInvites,\n isActive,\n isChannel,\n serverTimeOffset,\n onClose,\n onScreenSelect,\n}) => {\n const {\n setEditingExportedInvite,\n showNotification,\n editExportedChatInvite,\n deleteExportedChatInvite,\n deleteRevokedExportedChatInvites,\n setOpenedInviteInfo,\n } = getDispatch();\n\n const lang = useLang();\n\n const [isDeleteRevokeAllDialogOpen, openDeleteRevokeAllDialog, closeDeleteRevokeAllDialog] = useFlag();\n const [isRevokeDialogOpen, openRevokeDialog, closeRevokeDialog] = useFlag();\n const [revokingInvite, setRevokingInvite] = useState();\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [deletingInvite, setDeletingInvite] = useState();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('Invite').then(setAnimationData);\n }\n }, [animationData]);\n\n useHistoryBack(isActive, onClose);\n\n const hasDetailedCountdown = useMemo(() => {\n if (!exportedInvites) return undefined;\n return exportedInvites\n .some(({ expireDate }) => (\n expireDate && (expireDate - getServerTime(serverTimeOffset) < MILLISECONDS_IN_DAY / 1000)\n ));\n }, [exportedInvites, serverTimeOffset]);\n const forceUpdate = useForceUpdate();\n useInterval(() => {\n forceUpdate();\n }, hasDetailedCountdown ? 1000 : undefined);\n\n const primaryInvite = exportedInvites?.find(({ isPermanent }) => isPermanent);\n const primaryInviteLink = chat?.username ? `t.me/${chat.username}` : primaryInvite?.link;\n const temporalInvites = useMemo(() => {\n const invites = chat?.username ? exportedInvites : exportedInvites?.filter(({ isPermanent }) => !isPermanent);\n return invites?.sort(inviteComparator);\n }, [chat?.username, exportedInvites]);\n\n const editInvite = (invite: ApiExportedInvite) => {\n setEditingExportedInvite({ chatId, invite });\n onScreenSelect(ManagementScreens.EditInvite);\n };\n\n const revokeInvite = useCallback((invite: ApiExportedInvite) => {\n const {\n link, title, isRequestNeeded, expireDate, usageLimit,\n } = invite;\n editExportedChatInvite({\n chatId,\n link,\n title,\n isRequestNeeded,\n expireDate,\n usageLimit,\n isRevoked: true,\n });\n }, [chatId, editExportedChatInvite]);\n\n const askToRevoke = useCallback((invite: ApiExportedInvite) => {\n setRevokingInvite(invite);\n openRevokeDialog();\n }, [openRevokeDialog]);\n\n const handleRevoke = useCallback(() => {\n if (!revokingInvite) return;\n revokeInvite(revokingInvite);\n setRevokingInvite(undefined);\n closeRevokeDialog();\n }, [closeRevokeDialog, revokeInvite, revokingInvite]);\n\n const handleCreateNewClick = useCallback(() => {\n onScreenSelect(ManagementScreens.EditInvite);\n }, [onScreenSelect]);\n\n const handlePrimaryRevoke = useCallback(() => {\n if (primaryInvite) {\n askToRevoke(primaryInvite);\n }\n }, [askToRevoke, primaryInvite]);\n\n const handleDeleteAllRevoked = useCallback(() => {\n deleteRevokedExportedChatInvites({ chatId });\n closeDeleteRevokeAllDialog();\n }, [chatId, closeDeleteRevokeAllDialog, deleteRevokedExportedChatInvites]);\n\n const showInviteInfo = useCallback((invite: ApiExportedInvite) => {\n setOpenedInviteInfo({ chatId, invite });\n onScreenSelect(ManagementScreens.InviteInfo);\n }, [chatId, onScreenSelect, setOpenedInviteInfo]);\n\n const deleteInvite = useCallback((invite: ApiExportedInvite) => {\n deleteExportedChatInvite({ chatId, link: invite.link });\n }, [chatId, deleteExportedChatInvite]);\n\n const askToDelete = useCallback((invite: ApiExportedInvite) => {\n setDeletingInvite(invite);\n openDeleteDialog();\n }, [openDeleteDialog]);\n\n const handleDelete = useCallback(() => {\n if (!deletingInvite) return;\n deleteInvite(deletingInvite);\n setDeletingInvite(undefined);\n closeDeleteDialog();\n }, [closeDeleteDialog, deleteInvite, deletingInvite]);\n\n const copyLink = useCallback((link: string) => {\n copyTextToClipboard(link);\n showNotification({\n message: lang('LinkCopied'),\n });\n }, [lang, showNotification]);\n\n const handleCopyPrimaryClicked = useCallback(() => {\n copyLink(primaryInviteLink!);\n }, [copyLink, primaryInviteLink]);\n\n const prepareUsageText = (invite: ApiExportedInvite) => {\n const {\n usage = 0, usageLimit, expireDate, isPermanent, requested, isRevoked,\n } = invite;\n let text = '';\n if (!isRevoked && usageLimit && usage < usageLimit) {\n text = lang('CanJoin', usageLimit - usage);\n } else if (usage) {\n text = lang('PeopleJoined', usage);\n } else {\n text = lang('NoOneJoined');\n }\n\n if (isRevoked) {\n text += ` ${BULLET} ${lang('Revoked')}`;\n return text;\n }\n\n if (requested) {\n text += ` ${BULLET} ${lang('JoinRequests', requested)}`;\n }\n\n if (usageLimit !== undefined && usage === usageLimit) {\n text += ` ${BULLET} ${lang('LinkLimitReached')}`;\n } else if (expireDate) {\n const diff = (expireDate - getServerTime(serverTimeOffset)) * 1000;\n text += ` ${BULLET} `;\n if (diff > 0) {\n text += lang('InviteLink.ExpiresIn', formatCountdown(lang, diff));\n } else {\n text += lang('InviteLink.Expired');\n }\n } else if (isPermanent) {\n text += ` ${BULLET} ${lang('Permanent')}`;\n }\n\n return text;\n };\n\n const prepareContextActions = (invite: ApiExportedInvite) => {\n const actions = [];\n actions.push({\n title: lang('Copy'),\n icon: 'copy',\n handler: () => copyLink(invite.link),\n });\n\n if (!invite.isPermanent && !invite.isRevoked) {\n actions.push({\n title: lang('Edit'),\n icon: 'edit',\n handler: () => editInvite(invite),\n });\n }\n\n if (!invite.isRevoked) {\n actions.push({\n title: lang('RevokeButton'),\n icon: 'delete',\n handler: () => askToRevoke(invite),\n destructive: true,\n });\n } else {\n actions.push({\n title: lang('DeleteLink'),\n icon: 'delete',\n handler: () => askToDelete(invite),\n destructive: true,\n });\n }\n return actions;\n };\n\n const PrimaryLinkMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n

{isChannel ? lang('PrimaryLinkHelpChannel') : lang('PrimaryLinkHelp')}

\n
\n {primaryInviteLink && (\n
\n

\n {chat?.username ? lang('PublicLink') : lang('lng_create_permanent_link_title')}\n

\n
\n \n \n {lang('Copy')}\n {!chat?.username && (\n {lang('RevokeButton')}\n )}\n \n
\n \n
\n )}\n
\n \n {(!temporalInvites || !temporalInvites.length) && }\n {temporalInvites?.map((invite) => (\n showInviteInfo(invite)}\n contextActions={prepareContextActions(invite)}\n key={invite.link}\n >\n {invite.title || invite.link}\n \n {prepareUsageText(invite)}\n \n \n ))}\n

{lang('ManageLinksInfoHelp')}

\n
\n {revokedExportedInvites && Boolean(revokedExportedInvites.length) && (\n
\n

{lang('RevokedLinks')}

\n \n {lang('DeleteAllRevokedLinks')}\n \n {revokedExportedInvites?.map((invite) => (\n showInviteInfo(invite)}\n contextActions={prepareContextActions(invite)}\n key={invite.link}\n >\n {invite.title || invite.link}\n \n {prepareUsageText(invite)}\n \n \n ))}\n
\n )}\n
\n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { invites, revokedInvites } = global.management.byChatId[chatId];\n const chat = selectChat(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n\n return {\n exportedInvites: invites,\n revokedExportedInvites: revokedInvites,\n chat,\n serverTimeOffset: global.serverTimeOffset,\n isChannel,\n };\n },\n)(ManageInvites));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiExportedInvite } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useLang from '../../../hooks/useLang';\nimport { formatFullDate, formatTime } from '../../../util/dateFormat';\nimport useFlag from '../../../hooks/useFlag';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport Checkbox from '../../ui/Checkbox';\nimport InputText from '../../ui/InputText';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Button from '../../ui/Button';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport useOnChange from '../../../hooks/useOnChange';\nimport CalendarModal from '../../common/CalendarModal';\n\nconst DEFAULT_USAGE_LIMITS = [1, 10, 100];\nconst DEFAULT_EXPIRE_DATE = {\n hour: 3600000,\n day: 86400000,\n week: 604800000,\n};\nconst DEFAULT_CUSTOM_EXPIRE_DATE = DEFAULT_EXPIRE_DATE.hour;\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n onScreenSelect: (screen: ManagementScreens) => void;\n isActive: boolean;\n};\n\ntype StateProps = {\n editingInvite?: ApiExportedInvite;\n serverTimeOffset: number;\n};\n\nconst ManageInvite: FC = ({\n chatId,\n editingInvite,\n isActive,\n serverTimeOffset,\n onClose,\n onScreenSelect,\n}) => {\n const { editExportedChatInvite, exportChatInvite } = getDispatch();\n\n const lang = useLang();\n const [isCalendarOpened, openCalendar, closeCalendar] = useFlag();\n const [isRequestNeeded, setIsRequestNeeded] = useState(false);\n const [title, setTitle] = useState('');\n const [customExpireDate, setCustomExpireDate] = useState(Date.now() + DEFAULT_CUSTOM_EXPIRE_DATE);\n const [selectedExpireOption, setSelectedExpireOption] = useState('unlimited');\n const [customUsageLimit, setCustomUsageLimit] = useState(10);\n const [selectedUsageOption, setSelectedUsageOption] = useState('0');\n const [isSubmitBlocked, setIsSubmitBlocked] = useState(false);\n\n useHistoryBack(isActive, onClose);\n\n useOnChange(([oldEditingInvite]) => {\n if (oldEditingInvite === editingInvite) return;\n if (!editingInvite) {\n setTitle('');\n setSelectedExpireOption('unlimited');\n setSelectedUsageOption('0');\n setCustomExpireDate(getServerTime(serverTimeOffset) * 1000 + DEFAULT_CUSTOM_EXPIRE_DATE);\n setCustomUsageLimit(10);\n setIsRequestNeeded(false);\n } else {\n const {\n title: editingTitle, usageLimit, expireDate, isRequestNeeded: editingIsRequestNeeded,\n } = editingInvite;\n if (editingTitle) setTitle(editingTitle);\n if (usageLimit) {\n setSelectedUsageOption(DEFAULT_USAGE_LIMITS.includes(usageLimit) ? usageLimit.toString() : 'custom');\n setCustomUsageLimit(usageLimit);\n }\n if (expireDate) {\n const minSafeDate = getServerTime(serverTimeOffset) + DEFAULT_CUSTOM_EXPIRE_DATE;\n setSelectedExpireOption('custom');\n setCustomExpireDate(Math.max(expireDate, minSafeDate) * 1000);\n }\n if (editingIsRequestNeeded) {\n setIsRequestNeeded(true);\n }\n }\n }, [editingInvite, serverTimeOffset]);\n\n const handleIsRequestChange = useCallback((e: ChangeEvent) => {\n setIsRequestNeeded(e.target.checked);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n }, []);\n\n const handleCustomUsageLimitChange = useCallback((e: ChangeEvent) => {\n setCustomUsageLimit(Number.parseInt(e.target.value, 10));\n }, []);\n\n const handleExpireDateChange = useCallback((date: Date) => {\n setCustomExpireDate(date.getTime());\n closeCalendar();\n }, [closeCalendar]);\n\n const handleSaveClick = useCallback(() => {\n setIsSubmitBlocked(true);\n const usageLimit = selectedUsageOption === 'custom' ? customUsageLimit : selectedUsageOption;\n let expireDate;\n switch (selectedExpireOption) {\n case 'custom':\n expireDate = getServerTime(serverTimeOffset) + (customExpireDate - Date.now()) / 1000;\n break;\n case 'hour':\n case 'day':\n case 'week':\n expireDate = getServerTime(serverTimeOffset) + DEFAULT_EXPIRE_DATE[selectedExpireOption] / 1000;\n break;\n case 'unlimited':\n default:\n expireDate = undefined;\n }\n\n if (editingInvite) {\n editExportedChatInvite({\n link: editingInvite.link,\n chatId,\n title,\n isRequestNeeded,\n expireDate,\n usageLimit,\n });\n } else {\n exportChatInvite({\n chatId,\n title,\n isRequestNeeded,\n expireDate,\n usageLimit,\n });\n }\n onScreenSelect(ManagementScreens.Invites);\n }, [\n chatId, customExpireDate, customUsageLimit, editExportedChatInvite, editingInvite,\n exportChatInvite, isRequestNeeded, selectedExpireOption, selectedUsageOption, title, onScreenSelect,\n serverTimeOffset,\n ]);\n\n return (\n
\n
\n
\n \n
\n
\n \n

{lang('LinkNameHelp')}

\n
\n
\n
{lang('LimitByPeriod')}
\n \n {selectedExpireOption === 'custom' && (\n \n )}\n

{lang('TimeLimitHelp')}

\n
\n {!isRequestNeeded && (\n
\n
{lang('LimitNumberOfUses')}
\n ({ value: n.toString(), label: n })),\n {\n value: '0',\n label: lang('NoLimit'),\n },\n {\n value: 'custom',\n label: lang('lng_group_invite_usage_custom'),\n },\n ]}\n onChange={setSelectedUsageOption}\n selected={selectedUsageOption}\n />\n {selectedUsageOption === 'custom' && (\n \n )}\n

{lang('UsesLimitHelp')}

\n
\n )}\n \n \n \n
\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { editingInvite } = global.management.byChatId[chatId];\n\n return {\n editingInvite,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageInvite));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiAvailableReaction, ApiChat } from '../../../api/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n availableReactions?: ApiAvailableReaction[];\n enabledReactions?: string[];\n};\n\nconst ManageReactions: FC = ({\n availableReactions,\n enabledReactions,\n chat,\n isActive,\n onClose,\n}) => {\n const { setChatEnabledReactions } = getDispatch();\n\n const lang = useLang();\n const [isTouched, setIsTouched] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [localEnabledReactions, setLocalEnabledReactions] = useState(enabledReactions || []);\n\n useHistoryBack(isActive, onClose);\n\n const handleSaveReactions = useCallback(() => {\n if (!chat) return;\n setIsLoading(true);\n\n setChatEnabledReactions({\n chatId: chat.id,\n enabledReactions: localEnabledReactions,\n });\n }, [chat, localEnabledReactions, setChatEnabledReactions]);\n\n useEffect(() => {\n if (enabledReactions) {\n setIsLoading(false);\n setIsTouched(false);\n setLocalEnabledReactions(enabledReactions);\n }\n }, [enabledReactions]);\n\n const handleReactionChange = useCallback((e: React.ChangeEvent) => {\n if (!chat || !availableReactions) return;\n\n const { name, checked } = e.currentTarget;\n const newEnabledReactions = name === 'all' ? (checked ? availableReactions.map((l) => l.reaction) : [])\n : (!checked\n ? localEnabledReactions.filter((l) => l !== name)\n : [...localEnabledReactions, name]);\n\n setLocalEnabledReactions(newEnabledReactions);\n setIsTouched(true);\n }, [availableReactions, chat, localEnabledReactions]);\n\n return (\n
\n
\n
\n
\n 0}\n label={lang('EnableReactions')}\n onChange={handleReactionChange}\n />\n
\n {availableReactions?.filter((l) => !l.isInactive).map(({ reaction, title }) => (\n
\n \n \n {title}\n
\n )}\n onChange={handleReactionChange}\n />\n
\n ))}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n\n return {\n enabledReactions: chat.fullInfo?.enabledReactions,\n availableReactions: global.availableReactions,\n chat,\n };\n },\n)(ManageReactions));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../../api/types';\n\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useLang from '../../../hooks/useLang';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { getServerTime } from '../../../util/serverTime';\nimport { formatFullDate, formatMediaDateTime, formatTime } from '../../../util/dateFormat';\nimport { isChatChannel } from '../../../modules/helpers';\nimport { selectChat } from '../../../modules/selectors';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Button from '../../ui/Button';\nimport Spinner from '../../ui/Spinner';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n invite?: ApiExportedInvite;\n importers?: ApiChatInviteImporter[];\n requesters?: ApiChatInviteImporter[];\n admin?: ApiUser;\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageInviteInfo: FC = ({\n chatId,\n invite,\n importers,\n requesters,\n isChannel,\n isActive,\n serverTimeOffset,\n onClose,\n}) => {\n const {\n showNotification,\n loadChatInviteImporters,\n loadChatInviteRequesters,\n openChat,\n } = getDispatch();\n\n const lang = useLang();\n const {\n usage = 0, usageLimit, link, adminId,\n } = invite || {};\n const expireDate = invite?.expireDate && (invite.expireDate - getServerTime(serverTimeOffset)) * 1000 + Date.now();\n const isExpired = ((invite?.expireDate || 0) - getServerTime(serverTimeOffset)) < 0;\n\n useEffect(() => {\n if (link) {\n loadChatInviteImporters({ chatId, link });\n loadChatInviteRequesters({ chatId, link });\n }\n }, [chatId, link, loadChatInviteImporters, loadChatInviteRequesters]);\n\n const handleCopyClicked = useCallback(() => {\n copyTextToClipboard(invite!.link);\n showNotification({\n message: lang('LinkCopied'),\n });\n }, [invite, lang, showNotification]);\n\n useHistoryBack(isActive, onClose);\n\n const renderImporters = () => {\n if (!importers?.length && requesters?.length) return undefined;\n if (!importers) return ;\n return (\n
\n

{importers.length ? lang('PeopleJoined', usage) : lang('NoOneJoined')}

\n

\n {!importers.length && (\n usageLimit ? lang('PeopleCanJoinViaLinkCount', usageLimit - usage) : lang('NoOneJoinedYet')\n )}\n {importers.map((importer) => (\n openChat({ id: importer.userId })}\n >\n \n \n ))}\n

\n
\n );\n };\n\n const renderRequesters = () => {\n if (invite?.isRevoked) return undefined;\n if (!requesters && importers) return ;\n if (!requesters?.length) return undefined;\n return (\n
\n

{isChannel ? lang('SubscribeRequests') : lang('MemberRequests')}

\n

\n {requesters.map((requester) => (\n openChat({ id: requester.userId })}\n >\n \n \n ))}\n

\n
\n );\n };\n\n return (\n
\n
\n {!invite && (\n

{lang('Loading')}

\n )}\n {invite && (\n <>\n
\n

{invite.title || invite.link}

\n \n \n {expireDate && (\n

\n {isExpired\n ? lang('ExpiredLink')\n : lang('LinkExpiresIn', `${formatFullDate(lang, expireDate)} ${formatTime(lang, expireDate)}`)}\n

\n )}\n
\n {adminId && (\n
\n

{lang('LinkCreatedeBy')}

\n openChat({ id: adminId })}\n >\n \n \n
\n )}\n {renderImporters()}\n {renderRequesters()}\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { inviteInfo } = global.management.byChatId[chatId];\n const { invite, importers, requesters } = inviteInfo || {};\n const chat = selectChat(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n\n return {\n invite,\n importers,\n requesters,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageInviteInfo));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { selectUser } from '../../../modules/selectors';\nimport { formatHumanDate, formatTime, isToday } from '../../../util/dateFormat';\nimport { getServerTime } from '../../../util/serverTime';\nimport { createClassNameBuilder } from '../../../util/buildClassName';\n\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\n\nimport './JoinRequest.scss';\n\ntype OwnProps = {\n userId: string;\n about?: string;\n isChannel?: boolean;\n date: number;\n chatId: string;\n};\n\ntype StateProps = {\n user?: ApiUser;\n isSavedMessages?: boolean;\n serverTimeOffset: number;\n};\n\nconst JoinRequest: FC = ({\n userId,\n about,\n date,\n isChannel,\n user,\n serverTimeOffset,\n chatId,\n}) => {\n const { openChat, hideChatJoinRequest } = getDispatch();\n\n const buildClassName = createClassNameBuilder('JoinRequest');\n const lang = useLang();\n\n const fullName = getUserFullName(user);\n const fixedDate = (date - getServerTime(serverTimeOffset)) * 1000 + Date.now();\n\n const dateString = isToday(new Date(fixedDate))\n ? formatTime(lang, fixedDate) : formatHumanDate(lang, fixedDate, true, false, true);\n\n const handleUserClick = () => {\n openChat({ id: userId });\n };\n\n const handleAcceptRequest = useCallback(() => {\n hideChatJoinRequest({ chatId, userId, isApproved: true });\n }, [chatId, hideChatJoinRequest, userId]);\n\n const handleRejectRequest = useCallback(() => {\n hideChatJoinRequest({ chatId, userId, isApproved: false });\n }, [chatId, hideChatJoinRequest, userId]);\n\n return (\n
\n
\n
\n \n
\n
{fullName}
\n
{about}
\n
\n
\n
{dateString}
\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const user = selectUser(global, userId);\n\n return {\n user,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(JoinRequest));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { STICKER_SIZE_JOIN_REQUESTS } from '../../../config';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { selectChat } from '../../../modules/selectors';\nimport { isChatChannel, isUserId } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport getAnimationData from '../../common/helpers/animatedAssets';\n\nimport JoinRequest from './JoinRequest';\nimport Button from '../../ui/Button';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport Spinner from '../../ui/Spinner';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageJoinRequests: FC = ({\n chat,\n chatId,\n isActive,\n isChannel,\n onClose,\n}) => {\n const { hideAllChatJoinRequests, loadChatJoinRequests } = getDispatch();\n const [isAcceptAllDialogOpen, openAcceptAllDialog, closeAcceptAllDialog] = useFlag();\n const [isRejectAllDialogOpen, openRejectAllDialog, closeRejectAllDialog] = useFlag();\n\n const lang = useLang();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('JoinRequest').then(setAnimationData);\n }\n }, [animationData]);\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (!chat?.joinRequests && !isUserId(chatId)) {\n loadChatJoinRequests({ chatId });\n }\n }, [chat, chatId, loadChatJoinRequests]);\n\n const handleAcceptAllRequests = useCallback(() => {\n hideAllChatJoinRequests({ chatId, isApproved: true });\n closeAcceptAllDialog();\n }, [hideAllChatJoinRequests, chatId, closeAcceptAllDialog]);\n\n const handleRejectAllRequests = useCallback(() => {\n hideAllChatJoinRequests({ chatId, isApproved: false });\n closeRejectAllDialog();\n }, [hideAllChatJoinRequests, chatId, closeRejectAllDialog]);\n\n return (\n
\n
\n
\n {animationData && (\n \n )}\n
\n {Boolean(chat?.joinRequests?.length) && (\n
\n \n \n
\n )}\n
\n
\n
\n

\n {!chat?.joinRequests ? lang('Loading') : chat.joinRequests.length\n ? lang('JoinRequests', chat.joinRequests.length) : lang('NoMemberRequests')}\n

\n {!chat?.joinRequests && (\n \n )}\n {chat?.joinRequests?.length === 0 && (\n

\n {isChannel ? lang('NoSubscribeRequestsDescription') : lang('NoMemberRequestsDescription')}\n

\n )}\n {chat?.joinRequests?.map(({ userId, about, date }) => (\n \n ))}\n
\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return {\n chat,\n serverTimeOffset: global.serverTimeOffset,\n isChannel: chat && isChatChannel(chat),\n };\n },\n)(ManageJoinRequests));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementType } from '../../../types';\n\nimport { selectCurrentManagementType } from '../../../modules/selectors';\n\nimport ManageUser from './ManageUser';\nimport ManageGroup from './ManageGroup';\nimport ManageGroupPermissions from './ManageGroupPermissions';\nimport ManageChatRemovedUsers from './ManageChatRemovedUsers';\nimport ManageChannel from './ManageChannel';\nimport ManageChatPrivacyType from './ManageChatPrivacyType';\nimport ManageDiscussion from './ManageDiscussion';\nimport ManageGroupUserPermissions from './ManageGroupUserPermissions';\nimport ManageChatAdministrators from './ManageChatAdministrators';\nimport ManageGroupRecentActions from './ManageGroupRecentActions';\nimport ManageGroupAdminRights from './ManageGroupAdminRights';\nimport ManageGroupMembers from './ManageGroupMembers';\nimport ManageGroupUserPermissionsCreate from './ManageGroupUserPermissionsCreate';\nimport ManageInvites from './ManageInvites';\nimport ManageInvite from './ManageInvite';\nimport ManageReactions from './ManageReactions';\nimport ManageInviteInfo from './ManageInviteInfo';\nimport ManageJoinRequests from './ManageJoinRequests';\n\nexport type OwnProps = {\n chatId: string;\n currentScreen: ManagementScreens;\n selectedChatMemberId?: string;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n managementType?: ManagementType;\n};\n\nconst Management: FC = ({\n chatId,\n currentScreen,\n selectedChatMemberId,\n isPromotedByCurrentUser,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n managementType,\n}) => {\n switch (currentScreen) {\n case ManagementScreens.Initial: {\n switch (managementType) {\n case 'user':\n return (\n \n );\n case 'group':\n return (\n \n );\n case 'channel':\n return (\n \n );\n }\n\n break;\n }\n\n case ManagementScreens.ChatPrivacyType:\n return (\n \n );\n\n case ManagementScreens.Discussion:\n return (\n \n );\n\n case ManagementScreens.GroupPermissions:\n return (\n \n );\n\n case ManagementScreens.ChannelRemovedUsers:\n case ManagementScreens.GroupRemovedUsers:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissionsCreate:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissions:\n return (\n \n );\n\n case ManagementScreens.ChatAdministrators:\n return (\n \n );\n\n case ManagementScreens.GroupRecentActions:\n return (\n \n );\n\n case ManagementScreens.ChatNewAdminRights:\n case ManagementScreens.ChatAdminRights:\n return (\n \n );\n\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n return (\n \n );\n case ManagementScreens.Invites:\n return (\n \n );\n case ManagementScreens.EditInvite:\n return (\n \n );\n case ManagementScreens.GroupAddAdmins:\n return (\n \n );\n\n case ManagementScreens.Reactions:\n return (\n \n );\n case ManagementScreens.InviteInfo:\n return (\n \n );\n case ManagementScreens.JoinRequests:\n return (\n \n );\n }\n\n return undefined; // Never reached\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const managementType = selectCurrentManagementType(global);\n\n return {\n managementType,\n };\n },\n)(Management));\n","const VISA = /^4[0-9]{12}(?:[0-9]{1,3})?$/;\nconst MASTERCARD1 = /^5[1-5][0-9]{11,14}$/;\nconst MASTERCARD2 = /^2[2-7][0-9]{11,14}$/;\n\nexport enum CardType {\n Default,\n Visa,\n Mastercard,\n}\n\nconst cards: Record = {\n [CardType.Default]: '',\n [CardType.Visa]: 'visa',\n [CardType.Mastercard]: 'mastercard',\n};\n\nexport function detectCardType(cardNumber: string): number {\n cardNumber = cardNumber.replace(/\\s/g, '');\n if (VISA.test(cardNumber)) {\n return CardType.Visa;\n }\n if (MASTERCARD1.test(cardNumber) || MASTERCARD2.test(cardNumber)) {\n return CardType.Mastercard;\n }\n return CardType.Default;\n}\n\nexport function detectCardTypeText(cardNumber: string): string {\n const cardType = detectCardType(cardNumber);\n return cards[cardType as number] || '';\n}\n","// This data was received from Telegram Desktop (Telegram/Resources/numbers.txt)\nconst DATA = `AF🇦🇫93Afghanistan333\nAO🇦🇴244Angola333\nAL🇦🇱355Albania234\nAD🇦🇩376Andorra222\nAE🇦🇪971United Arab Emirates234\nAI🇦🇮1264Anguilla34\nAR🇦🇷54Argentina\nAM🇦🇲374Armenia233\nAG🇦🇬1268Antigua and Barbuda34\nAU🇦🇺61Australia333\nAS🇦🇸1684American Samoa34\nAT🇦🇹43Austria\nAW🇦🇼297Aruba34\nAZ🇦🇿994Azerbaijan2322\nBI🇧🇮257Burundi224\nBE🇧🇪32Belgium3222\nBJ🇧🇯229Benin233\nBF🇧🇫226Burkina Faso2222\nBD🇧🇩880Bangladesh\nBG🇧🇬359Bulgaria\nBH🇧🇭973Bahrain44\nBS🇧🇸1242Bahamas34\nBA🇧🇦387Bosnia and Herzegovina\nBY🇧🇾375Belarus2322\nBZ🇧🇿501Belize\nBO🇧🇴591Bolivia134\nBR🇧🇷55Brazil254\nBB🇧🇧1246Barbados34\nBM🇧🇲1441Bermuda34\nBN🇧🇳673Brunei34\nBQ🇧🇶599Bonaire, Sint Eustatius and Saba\nBT🇧🇹975Bhutan\nBW🇧🇼267Botswana233\nCF🇨🇫236Central African Republic2222\nCA🇨🇦1Canada334\nCH🇨🇭41Switzerland234\nCK🇨🇰682Cook Islands\nCL🇨🇱56Chile144\nCN🇨🇳86China344\nCI🇨🇮225Côte d\\`Ivoire233\nCM🇨🇲237Cameroon44\nCD🇨🇩243DR Congo234\nCG🇨🇬242Republic of the Congo234\nCO🇨🇴57Colombia334\nKM🇰🇲269Comoros34\nCV🇨🇻238Cape Verde34\nCR🇨🇷506Costa Rica\nCU🇨🇺53Cuba44\nCY🇨🇾357Cyprus44\nCW🇨🇼599Curaçao\nCZ🇨🇿420Czech Republic\nDE🇩🇪49Germany38\nDJ🇩🇯253Djibouti2222\nDM🇩🇲1767Dominica34\nDK🇩🇰45Denmark44\nDO🇩🇴1Dominican Republic334\nDZ🇩🇿213Algeria3222\nEC🇪🇨593Ecuador\nEG🇪🇬20Egypt234\nER🇪🇷291Eritrea133\nES🇪🇸34Spain333\nEE🇪🇪372Estonia\nET🇪🇹251Ethiopia234\nFI🇫🇮358Finland\nFJ🇫🇯679Fiji\nFK🇫🇰500Falkland Islands\nFM🇫🇲691Micronesia\nFO🇫🇴298Faroe Islands33\nFR🇫🇷33France12222\nGA🇬🇦241Gabon1222\nGB🇬🇧44United Kingdom46\nGE🇬🇪995Georgia\nGF🇬🇫594French Guiana\nGH🇬🇭233Ghana\nGI🇬🇮350Gibraltar44\nGL🇬🇱299Greenland33\nGN🇬🇳224Guinea333\nGM🇬🇲220Gambia34\nGP🇬🇵590Guadeloupe\nGU🇬🇺1671Guam34\nGW🇬🇼245Guinea-Bissau34\nGQ🇬🇶240Equatorial Guinea333\nGR🇬🇷30Greece244\nGD🇬🇩1473Grenada34\nGT🇬🇹502Guatemala134\nGY🇬🇾592Guyana\nHK🇭🇰852Hong Kong\nHN🇭🇳504Honduras44\nHR🇭🇷385Croatia\nHT🇭🇹509Haiti\nHU🇭🇺36Hungary234\nID🇮🇩62Indonesia\nIN🇮🇳91India55\nIO🇩🇬246Diego Garcia34\nIE🇮🇪353Ireland234\nIR🇮🇷98Iran334\nIQ🇮🇶964Iraq334\nIS🇮🇸354Iceland34\nIL🇮🇱972Israel234\nIT🇮🇹39Italy334\nJM🇯🇲1876Jamaica34\nJO🇯🇴962Jordan144\nJP🇯🇵81Japan244\nKZ🇰🇿7Kazakhstan3322\nKE🇰🇪254Kenya333\nKG🇰🇬996Kyrgyzstan\nKH🇰🇭855Cambodia\nKI🇰🇮686Kiribati\nKN🇰🇳1869Saint Kitts and Nevis34\nKR🇰🇷82South Korea\nKW🇰🇼965Kuwait44\nKY🇰🇾1345Cayman Islands34\nLA🇱🇦856Laos\nLB🇱🇧961Lebanon\nLR🇱🇷231Liberia\nLY🇱🇾218Libya234\nLC🇱🇨1758Saint Lucia34\nLI🇱🇮423Liechtenstein\nLK🇱🇰94Sri Lanka234\nLS🇱🇸266Lesotho233\nLT🇱🇹370Lithuania35\nLU🇱🇺352Luxembourg\nLV🇱🇻371Latvia35\nMA🇲🇦212Morocco234\nMC🇲🇨377Monaco44\nMD🇲🇩373Moldova233\nMG🇲🇬261Madagascar2232\nMP🇲🇵1670Northern Mariana Islands34\nMO🇲🇴853Macau\nMS🇲🇸1664Montserrat34\nMV🇲🇻960Maldives\nMX🇲🇽52Mexico\nMH🇲🇭692Marshall Islands\nMK🇲🇰389Macedonia\nML🇲🇱223Mali44\nMT🇲🇹356Malta2222\nMM🇲🇲95Myanmar\nME🇲🇪382Montenegro\nMN🇲🇳976Mongolia\nMZ🇲🇿258Mozambique234\nMQ🇲🇶596Martinique\nMR🇲🇷222Mauritania44\nMU🇲🇺230Mauritius\nMW🇲🇼265Malawi\nMY🇲🇾60Malaysia\nNA🇳🇦264Namibia234\nNC🇳🇨687New Caledonia6\nNE🇳🇪227Niger2222\nNF🇳🇫672Norfolk Island\nNG🇳🇬234Nigeria\nNI🇳🇮505Nicaragua44\nNL🇳🇱31Netherlands12222\nNO🇳🇴47Norway44\nNP🇳🇵977Nepal\nNU🇳🇺683Niue\nNR🇳🇷674Nauru\nNZ🇳🇿64New Zealand\nOM🇴🇲968Oman44\nPK🇵🇰92Pakistan334\nPA🇵🇦507Panama44\nPE🇵🇪51Peru333\nPF🇵🇫689French Polynesia\nPH🇵🇭63Philippines334\nPM🇵🇲508Saint Pierre and Miquelon\nPR🇵🇷1Puerto Rico334\nPS🇵🇸970Palestine324\nPW🇵🇼680Palau\nPG🇵🇬675Papua New Guinea\nPL🇵🇱48Poland333\nKP🇰🇵850North Korea\nPT🇵🇹351Portugal144\nPY🇵🇾595Paraguay333\nQA🇶🇦974Qatar\nRE🇷🇪262Réunion333\nRO🇷🇴40Romania333\nRU🇷🇺7Russia3322\nRW🇷🇼250Rwanda333\nSA🇸🇦966Saudi Arabia\nSD🇸🇩249Sudan234\nSN🇸🇳221Senegal234\nSG🇸🇬65Singapore44\nSH🇸🇭290Saint Helena23\nSH🇸🇭247Saint Helena4\nSB🇸🇧677Solomon Islands\nSL🇸🇱232Sierra Leone233\nSV🇸🇻503El Salvador44\nSM🇸🇲378San Marino334\nSO🇸🇴252Somalia233\nRS🇷🇸381Serbia234\nSS🇸🇸211South Sudan234\nST🇸🇹239São Tomé and Príncipe25\nSR🇸🇷597Suriname34\nSK🇸🇰421Slovakia\nSI🇸🇮386Slovenia\nSE🇸🇪46Sweden234\nSZ🇸🇿268Swaziland44\nSC🇸🇨248Seychelles1222\nSX🇸🇽1721Sint Maarten34\nSY🇸🇾963Syria\nTC🇹🇨1649Turks and Caicos Islands34\nTD🇹🇩235Chad2222\nTG🇹🇬228Togo233\nTH🇹🇭66Thailand144\nTJ🇹🇯992Tajikistan\nTK🇹🇰690Tokelau\nTM🇹🇲993Turkmenistan26\nTL🇹🇱670Timor-Leste\nTO🇹🇴676Tonga\nTT🇹🇹1868Trinidad and Tobago34\nTN🇹🇳216Tunisia233\nTR🇹🇷90Turkey334\nTV🇹🇻688Tuvalu\nTW🇹🇼886Taiwan\nTZ🇹🇿255Tanzania234\nUG🇺🇬256Uganda234\nUA🇺🇦380Ukraine2322\nUY🇺🇾598Uruguay44\nUS🇺🇸1United States334\nUZ🇺🇿998Uzbekistan27\nVA🇻🇦3Vatican City\nVC🇻🇨1784Saint Vincent and the Grenadines34\nVE🇻🇪58Venezuela334\nVG🇻🇬1284British Virgin Islands34\nVI🇻🇮1340US Virgin Islands34\nVN🇻🇳84Vietnam\nVU🇻🇺678Vanuatu\nWF🇼🇫681Wallis and Futuna\nWS🇼🇸685Samoa\nXK🇽🇰383Kosovo44\nYE🇾🇪967Yemen333\nZA🇿🇦27South Africa234\nZM🇿🇲260Zambia234\nZW🇿🇼263Zimbabwe234`;\n\nconst formatsCache: Record = {};\nexport const defaultPhoneNumberFormat = /(\\d{1,3})(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?/;\n\nconst parsed = DATA\n .split('\\n')\n .map((str) => {\n const id = str.substr(0, 2);\n const flag = str.substr(2, 4);\n const code = `+${str.match(/\\d+/)![0]}`;\n const name = str.split(/\\d+/)[1];\n const format = str.match(/\\d+$/);\n const phoneFormat = getPhoneNumberFormat(format);\n\n return {\n id, flag, code, name, phoneFormat,\n };\n });\n\nfunction getPhoneNumberFormat(format: RegExpMatchArray | null) {\n if (!format) {\n return defaultPhoneNumberFormat;\n }\n\n const formatValue = format[0] as string;\n let phoneNumberFormat;\n\n if (!formatsCache[formatValue]) {\n const phoneNumberGroups = formatValue.split('').map(Number);\n phoneNumberFormat = phoneNumberGroups.reduce((result, count, i) => {\n return `${result}(\\\\d{1,${count}})${i > 0 ? '?' : ''}`;\n }, '');\n formatsCache[formatValue] = new RegExp(`${phoneNumberFormat}${'()?'.repeat(5 - phoneNumberGroups.length)}`);\n }\n\n return formatsCache[formatValue];\n}\n\nexport default parsed;\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport countryList from '../../util/countries';\n\nexport type FormState = {\n streetLine1: string;\n streetLine2: string;\n city: string;\n state: string;\n countryIso2: string;\n postCode: string;\n fullName: string;\n email: string;\n phone: string;\n shipping: string;\n cardNumber: string;\n cardholder: string;\n expiry: string;\n cvv: string;\n billingCountry: string;\n billingZip: string;\n saveInfo: boolean;\n saveCredentials: boolean;\n formErrors: Record;\n};\n\nexport type FormActions = (\n 'changeAddress1' | 'changeAddress2' | 'changeCity' | 'changeState' | 'changeCountry' |\n 'changePostCode' | 'changeFullName' | 'changeEmail' | 'changePhone' | 'changeShipping' | 'updateUserInfo' |\n 'changeCardNumber' | 'changeCardholder' | 'changeExpiryDate' | 'changeCvvCode' | 'changeBillingCountry' |\n 'changeBillingZip' | 'changeSaveInfo' | 'changeSaveCredentials' | 'setFormErrors'\n);\nexport type FormEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FormState = {\n streetLine1: '',\n streetLine2: '',\n city: '',\n state: '',\n countryIso2: '',\n postCode: '',\n fullName: '',\n email: '',\n phone: '',\n shipping: '',\n cardNumber: '',\n cardholder: '',\n expiry: '',\n cvv: '',\n billingCountry: '',\n billingZip: '',\n saveInfo: true,\n saveCredentials: false,\n formErrors: {},\n};\n\nconst reducer: StateReducer = (state, action) => {\n switch (action.type) {\n case 'changeAddress1':\n return {\n ...state,\n streetLine1: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine1: undefined,\n },\n };\n case 'changeAddress2':\n return {\n ...state,\n streetLine2: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine2: undefined,\n },\n };\n case 'changeCity':\n return {\n ...state,\n city: action.payload,\n formErrors: {\n ...state.formErrors,\n city: undefined,\n },\n };\n case 'changeState':\n return {\n ...state,\n state: action.payload,\n formErrors: {\n ...state.formErrors,\n state: undefined,\n },\n };\n case 'changeCountry':\n return {\n ...state,\n countryIso2: action.payload,\n billingCountry: getBillingCountry(action.payload),\n formErrors: {\n ...state.formErrors,\n countryIso2: undefined,\n },\n };\n case 'changePostCode':\n return {\n ...state,\n postCode: action.payload,\n formErrors: {\n ...state.formErrors,\n postCode: undefined,\n },\n };\n case 'changeFullName':\n return {\n ...state,\n fullName: action.payload,\n formErrors: {\n ...state.formErrors,\n fullName: undefined,\n },\n };\n case 'changeEmail':\n return {\n ...state,\n email: action.payload,\n formErrors: {\n ...state.formErrors,\n email: undefined,\n },\n };\n case 'changePhone':\n return {\n ...state,\n phone: action.payload,\n formErrors: {\n ...state.formErrors,\n phone: undefined,\n },\n };\n case 'changeShipping':\n return { ...state, shipping: action.payload };\n case 'changeCardNumber':\n return {\n ...state,\n cardNumber: action.payload,\n formErrors: {\n ...state.formErrors,\n cardNumber: undefined,\n },\n };\n case 'changeCardholder':\n return {\n ...state,\n cardholder: action.payload,\n formErrors: {\n ...state.formErrors,\n cardholder: undefined,\n },\n };\n case 'changeExpiryDate':\n return {\n ...state,\n expiry: action.payload,\n formErrors: {\n ...state.formErrors,\n expiry: undefined,\n },\n };\n case 'changeCvvCode':\n return {\n ...state,\n cvv: action.payload,\n formErrors: {\n ...state.formErrors,\n cvv: undefined,\n },\n };\n case 'changeBillingCountry':\n return {\n ...state,\n billingCountry: action.payload,\n formErrors: {\n ...state.formErrors,\n billingCountry: undefined,\n },\n };\n case 'changeBillingZip':\n return {\n ...state,\n billingZip: action.payload,\n formErrors: {\n ...state.formErrors,\n billingZip: undefined,\n },\n };\n case 'changeSaveInfo':\n return { ...state, saveInfo: action.payload };\n case 'changeSaveCredentials':\n return { ...state, saveCredentials: action.payload };\n case 'updateUserInfo':\n if (action.payload.countryIso2) {\n return {\n ...state,\n ...action.payload,\n billingCountry: getBillingCountry(action.payload.countryIso2),\n };\n }\n return { ...state, ...action.payload };\n case 'setFormErrors':\n return {\n ...state,\n formErrors: {\n ...state.formErrors,\n ...action.payload,\n },\n };\n default:\n return state;\n }\n};\n\nfunction getBillingCountry(countryCode: string) {\n const country = countryList.find(({ id }) => id === countryCode);\n return country ? country.name : '';\n}\n\nconst usePaymentReducer = () => {\n return useReducer(reducer, INITIAL_STATE);\n};\n\nexport default usePaymentReducer;\n","import { RefObject } from 'react';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\nimport { fastRaf } from '../util/schedulers';\nimport { useEffect } from '../lib/teact/teact';\n\nconst DEFAULT_DURATION = 400;\n\nexport default function useFocusAfterAnimation(\n ref: RefObject, animationDuration = DEFAULT_DURATION,\n) {\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n if (ref.current) {\n ref.current.focus();\n }\n });\n }, animationDuration);\n }, [ref, animationDuration]);\n}\n","import { ChangeEvent, RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n id?: string;\n value?: string;\n label?: string;\n error?: string;\n ref?: RefObject;\n hasArrow?: boolean;\n placeholder?: string;\n onChange?: (e: ChangeEvent) => void;\n children: React.ReactNode;\n};\n\nconst Select: FC = (props) => {\n const {\n id,\n value,\n label,\n hasArrow,\n error,\n ref,\n placeholder,\n onChange,\n children,\n } = props;\n const labelText = error || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error && 'error',\n labelText && 'with-label',\n hasArrow && 'with-arrow',\n 'input-group',\n );\n\n return (\n
\n \n {children}\n \n {labelText && id && (\n \n )}\n
\n );\n};\n\nexport default memo(Select);\n","import React, {\n FC, useRef, useCallback, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport useLang from '../../hooks/useLang';\nimport countryList from '../../util/countries';\n\nimport InputText from '../ui/InputText';\nimport Select from '../ui/Select';\nimport Checkbox from '../ui/Checkbox';\n\nimport './ShippingInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n needEmail: boolean;\n needPhone: boolean;\n needName: boolean;\n needAddress: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst ShippingInfo: FC = ({\n state,\n needEmail,\n needPhone,\n needName,\n needAddress,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const phoneRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.countryIso2) {\n selectCountryRef.current.value = state.countryIso2;\n }\n }, [state.countryIso2]);\n\n const lang = useLang();\n\n useFocusAfterAnimation(inputRef);\n\n const handleAddress1Change = useCallback((e) => {\n dispatch({ type: 'changeAddress1', payload: e.target.value });\n }, [dispatch]);\n\n const handleAddress2Change = useCallback((e) => {\n dispatch({ type: 'changeAddress2', payload: e.target.value });\n }, [dispatch]);\n\n const handleCityChange = useCallback((e) => {\n dispatch({ type: 'changeCity', payload: e.target.value });\n }, [dispatch]);\n\n const handleStateChange = useCallback((e) => {\n dispatch({ type: 'changeState', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handlePostCodeChange = useCallback((e) => {\n dispatch({ type: 'changePostCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleFullNameChange = useCallback((e) => {\n dispatch({ type: 'changeFullName', payload: e.target.value });\n }, [dispatch]);\n\n const handleEmailChange = useCallback((e) => {\n dispatch({ type: 'changeEmail', payload: e.target.value });\n }, [dispatch]);\n\n const handlePhoneChange = useCallback((e) => {\n let { value } = e.target;\n value = `+${value.replace(/\\D/g, '')}`;\n if (phoneRef.current) {\n phoneRef.current.value = value;\n }\n dispatch({ type: 'changePhone', payload: value });\n }, [dispatch]);\n\n const handleSaveInfoChange = useCallback((e) => {\n dispatch({ type: 'changeSaveInfo', payload: e.target.value });\n }, [dispatch]);\n\n const { formErrors } = state;\n return (\n
\n
\n {needAddress ? (\n
\n
{lang('PaymentShippingAddress')}
\n \n \n \n \n \n {countryList.map(({ name, id }) => (\n \n {name}\n \n ))}\n \n\n \n
\n ) : undefined}\n { needName || needEmail || needPhone ? (\n
{lang('PaymentShippingReceiver')}
\n ) : undefined }\n { needName && (\n \n ) }\n { needEmail && (\n \n ) }\n { needPhone && (\n \n ) }\n \n \n
\n );\n};\n\nexport default memo(ShippingInfo);\n","import React, {\n FC, useCallback, memo, useMemo, useEffect,\n} from '../../lib/teact/teact';\n\nimport { ShippingOption } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport RadioGroup from '../ui/RadioGroup';\n\nimport './Shipping.scss';\n\nexport type OwnProps = {\n state: FormState;\n shippingOptions: ShippingOption[];\n currency?: string;\n dispatch: FormEditDispatch;\n};\n\nconst Shipping: FC = ({\n state,\n shippingOptions,\n currency,\n dispatch,\n}) => {\n const lang = useLang();\n\n useEffect(() => {\n if (!shippingOptions || state.shipping) {\n return;\n }\n dispatch({ type: 'changeShipping', payload: shippingOptions[0].id });\n }, [shippingOptions, state.shipping, dispatch]);\n\n const handleShippingSelect = useCallback((value) => {\n dispatch({ type: 'changeShipping', payload: value });\n }, [dispatch]);\n\n const options = useMemo(() => (shippingOptions.map(({ id: value, title: label, amount }) => ({\n label,\n subLabel: formatCurrency(amount, currency, lang.code),\n value,\n }))), [shippingOptions, currency, lang.code]);\n\n return (\n
\n
\n

{lang('PaymentShippingMethod')}

\n \n \n
\n );\n};\n\nexport default memo(Shipping);\n","import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { LangCode, Price } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './Checkout.scss';\n\nexport type OwnProps = {\n invoiceContent?: {\n title?: string;\n text?: string;\n photoUrl?: string;\n };\n checkoutInfo?: {\n paymentMethod?: string;\n paymentProvider?: string;\n shippingAddress?: string;\n name?: string;\n phone?: string;\n shippingMethod?: string;\n };\n prices?: Price[];\n totalPrice?: number;\n shippingPrices?: Price[];\n currency?: string;\n};\n\nconst Checkout: FC = ({\n invoiceContent,\n prices,\n shippingPrices,\n checkoutInfo,\n currency,\n totalPrice,\n}) => {\n const lang = useLang();\n\n const { photoUrl, title, text } = invoiceContent || {};\n const {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n } = (checkoutInfo || {});\n\n return (\n
\n
\n {photoUrl && \"\"}\n
\n
{title}
\n

{text}

\n
\n
\n
\n { prices && prices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { shippingPrices && shippingPrices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { totalPrice !== undefined && (\n renderPaymentItem(lang.code, lang('Checkout.TotalAmount'), totalPrice, currency, true)\n ) }\n
\n
\n {paymentMethod && renderCheckoutItem('icon-card', paymentMethod, lang('PaymentCheckoutMethod'))}\n {paymentProvider && renderCheckoutItem(\n buildClassName('provider', paymentProvider.toLowerCase()),\n paymentProvider,\n lang('PaymentCheckoutProvider'),\n )}\n {shippingAddress && renderCheckoutItem('icon-location', shippingAddress, lang('PaymentShippingAddress'))}\n {name && renderCheckoutItem('icon-user', name, lang('PaymentCheckoutName'))}\n {phone && renderCheckoutItem('icon-phone', phone, lang('PaymentCheckoutPhoneNumber'))}\n {shippingMethod && renderCheckoutItem('icon-truck', shippingMethod, lang('PaymentCheckoutShippingMethod'))}\n
\n
\n );\n};\n\nfunction renderPaymentItem(\n langCode: LangCode | undefined, title: string, value: number, currency?: string, main = false,\n) {\n return (\n
\n
\n { title }\n
\n
\n {formatCurrency(value, currency, langCode)}\n
\n
\n );\n}\n\nfunction renderCheckoutItem(icon: string, title: string, data: string) {\n return (\n
\n \n
\n
\n { title }\n
\n

\n { data }\n

\n
\n
\n );\n}\n\nexport default memo(Checkout);\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { formatCardExpiry } from '../middle/helpers/inputFormatters';\n\nimport InputText from '../ui/InputText';\nimport useLang from '../../hooks/useLang';\n\nconst MAX_FIELD_LENGTH = 5;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst ExpiryInput : FC = ({ value, error, onChange }) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const expiryInputRef = useRef(null);\n\n const handleKeyDown = useCallback((e) => {\n if (e.key === 'Backspace' && value.charAt(value.length - 1) === '/') {\n const newValue = value.slice(0, value.length - 1);\n if (expiryInputRef.current) {\n expiryInputRef.current.value = newValue;\n }\n }\n }, [value]);\n\n const handleChange = useCallback((e) => {\n onChange(formatCardExpiry(e.target.value));\n }, [onChange]);\n\n return (\n \n );\n};\n\nexport default memo(ExpiryInput);\n","export function formatCardExpiry(input: string) {\n input = input.replace(/[^\\d]/g, '').slice(0, 4);\n const parts = input.match(/.{1,2}/g);\n if (parts?.[0] && Number(parts[0]) > 12) {\n parts[0] = '12';\n }\n if (parts?.[0] && parts[0].length === 2 && !parts[1]) {\n parts[1] = '';\n }\n return parts ? parts.join('/') : '';\n}\n\nexport function formatCardNumber(input: string) {\n input = input.replace(/[^\\d]/g, '');\n const parts = input.match(/.{1,4}/g);\n return parts ? parts.join(' ') : '';\n}\n","import React, {\n FC, memo, useCallback, useState, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { formatCardNumber } from '../middle/helpers/inputFormatters';\nimport { detectCardType, CardType } from '../common/helpers/detectCardType';\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\n\nimport './CardInput.scss';\n\nimport mastercardIconPath from '../../assets/mastercard.svg';\nimport visaIconPath from '../../assets/visa.svg';\n\nconst CARD_NUMBER_MAX_LENGTH = 23;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst CardInput : FC = ({ value, error, onChange }) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const cardNumberRef = useRef(null);\n\n useFocusAfterAnimation(cardNumberRef);\n\n const [cardType, setCardType] = useState(CardType.Default);\n useEffect(() => {\n const newCardType = detectCardType(value);\n setCardType(newCardType);\n // eslint-disable-next-line\n }, []);\n\n const handleChange = useCallback((e) => {\n const newValue = formatCardNumber(e.target.value);\n const newCardType = detectCardType(e.target.value);\n setCardType(newCardType);\n onChange(newValue);\n if (cardNumberRef.current) {\n cardNumberRef.current.value = newValue;\n }\n }, [onChange, cardNumberRef]);\n\n const cardIcon = getCardIcon(cardType);\n\n return (\n
\n {cardIcon}\n \n
\n );\n};\n\nexport default memo(CardInput);\n\nfunction getCardIcon(cardType: CardType) {\n switch (cardType) {\n case CardType.Mastercard:\n return \"\";\n case CardType.Visa:\n return \"\";\n default:\n return undefined;\n }\n}\n","import React, {\n FC, useCallback, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\nimport countryList from '../../util/countries';\n\nimport InputText from '../ui/InputText';\nimport Checkbox from '../ui/Checkbox';\nimport Select from '../ui/Select';\nimport ExpiryInput from './ExpiryInput';\nimport CardInput from './CardInput';\n\nimport './PaymentInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n canSaveCredentials: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst PaymentInfo: FC = ({\n state,\n canSaveCredentials,\n needCardholderName,\n needCountry,\n needZip,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.billingCountry) {\n selectCountryRef.current.value = state.billingCountry;\n }\n }, [state.billingCountry]);\n\n const handleCardNumberChange = useCallback((value) => {\n dispatch({ type: 'changeCardNumber', payload: value });\n }, [dispatch]);\n\n const handleCardholderChange = useCallback((e) => {\n dispatch({ type: 'changeCardholder', payload: e.target.value.toUpperCase() });\n }, [dispatch]);\n\n const handleExpiryChange = useCallback((value) => {\n dispatch({ type: 'changeExpiryDate', payload: value });\n }, [dispatch]);\n\n const handleCvvChange = useCallback((e) => {\n dispatch({ type: 'changeCvvCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeBillingCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handleBillingPostCodeChange = useCallback((e) => {\n dispatch({ type: 'changeBillingZip', payload: e.target.value });\n }, [dispatch]);\n\n const handleChangeSaveCredentials = useCallback((e) => {\n dispatch({ type: 'changeSaveCredentials', payload: e.target.value });\n }, [dispatch]);\n\n const lang = useLang();\n\n const { formErrors = {} } = state;\n\n return (\n
\n
\n
{lang('PaymentCardTitle')}
\n \n { needCardholderName && (\n \n )}\n
\n \n \n
\n { needCountry || needZip ? (\n
{lang('PaymentBillingAddress')}
\n ) : undefined }\n { needCountry && (\n \n {\n countryList.map(({ name }) => (\n \n {name}\n \n ))\n }\n \n ) }\n { needZip && (\n \n )}\n { canSaveCredentials && (\n \n ) }\n \n
\n );\n};\n\nexport default memo(PaymentInfo);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport './ConfirmPayment.scss';\n\nexport type OwnProps = {\n url: string;\n};\n\nconst ConfirmPayment: FC = ({ url }) => {\n const lang = useLang();\n\n return (\n
\n \n
\n );\n};\n\nexport default memo(ConfirmPayment);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\nimport { PaymentStep, ShippingOption, Price } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { detectCardTypeText } from '../common/helpers/detectCardType';\nimport usePaymentReducer, { FormState } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport ShippingInfo from './ShippingInfo';\nimport Shipping from './Shipping';\nimport Checkout from './Checkout';\nimport PaymentInfo from './PaymentInfo';\nimport Button from '../ui/Button';\nimport Modal from '../ui/Modal';\nimport Transition from '../ui/Transition';\nimport Spinner from '../ui/Spinner';\nimport ConfirmPayment from './ConfirmPayment';\n\nimport './PaymentModal.scss';\n\nconst DEFAULT_PROVIDER = 'stripe';\nconst DONATE_PROVIDER = 'smartglocal';\nconst SUPPORTED_PROVIDERS = new Set([DEFAULT_PROVIDER, DONATE_PROVIDER]);\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n nameRequested?: boolean;\n shippingAddressRequested?: boolean;\n phoneRequested?: boolean;\n emailRequested?: boolean;\n flexible?: boolean;\n phoneToProvider?: boolean;\n emailToProvider?: boolean;\n currency?: string;\n prices?: Price[];\n isProviderError: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n confirmPaymentUrl?: string;\n};\n\ntype GlobalStateProps = Pick;\n\nconst Invoice: FC = ({\n isOpen,\n onClose,\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n phoneToProvider,\n emailToProvider,\n currency,\n passwordMissing,\n isProviderError,\n invoiceContent,\n nativeProvider,\n prices,\n needCardholderName,\n needCountry,\n needZip,\n confirmPaymentUrl,\n error,\n}) => {\n const {\n validateRequestedInfo,\n sendPaymentForm,\n setPaymentStep,\n sendCredentialsInfo,\n clearPaymentError,\n } = getDispatch();\n\n const [paymentState, paymentDispatch] = usePaymentReducer();\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n const canRenderFooter = step !== PaymentStep.ConfirmPayment;\n\n useEffect(() => {\n if (step || error) {\n setIsLoading(false);\n }\n }, [step, error]);\n\n useEffect(() => {\n if (error?.field) {\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n [error.field]: error.message,\n },\n });\n }\n }, [error, paymentDispatch]);\n\n useEffect(() => {\n if (savedInfo) {\n const {\n name: fullName, phone, email, shippingAddress,\n } = savedInfo;\n paymentDispatch({\n type: 'updateUserInfo',\n payload: {\n fullName,\n phone: phone && phone.charAt(0) !== '+'\n ? `+${phone}`\n : phone,\n email,\n ...(shippingAddress || {}),\n },\n });\n }\n }, [savedInfo, paymentDispatch]);\n\n const handleErrorModalClose = useCallback(() => {\n clearPaymentError();\n }, [clearPaymentError]);\n\n const totalPrice = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return 0;\n }\n\n return getTotalPrice(prices, shippingOptions, paymentState.shipping);\n }, [step, paymentState.shipping, prices, shippingOptions]);\n\n const checkoutInfo = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return undefined;\n }\n return getCheckoutInfo(paymentState, shippingOptions, nativeProvider || '');\n }, [step, paymentState, shippingOptions, nativeProvider]);\n\n function renderError() {\n if (!error) {\n return undefined;\n }\n return (\n \n

{error.description || 'Error'}

\n

{error.description || 'Error'}

\n \n {lang('OK')}\n \n
\n );\n }\n\n function renderModalContent(currentStep: PaymentStep) {\n switch (currentStep) {\n case PaymentStep.ShippingInfo:\n return (\n \n );\n case PaymentStep.Shipping:\n return (\n \n );\n case PaymentStep.PaymentInfo:\n return (\n \n );\n case PaymentStep.Checkout:\n return (\n \n );\n case PaymentStep.ConfirmPayment:\n return (\n \n );\n default:\n return undefined;\n }\n }\n\n const validateRequest = useCallback(() => {\n const { saveInfo } = paymentState;\n const requestInfo = getRequestInfo(paymentState);\n validateRequestedInfo({ requestInfo, saveInfo });\n }, [validateRequestedInfo, paymentState]);\n\n const sendCredentials = useCallback(() => {\n const credentials = getCredentials(paymentState);\n sendCredentialsInfo({\n credentials,\n });\n }, [sendCredentialsInfo, paymentState]);\n\n const sendForm = useCallback(() => {\n sendPaymentForm({\n shippingOptionId: paymentState.shipping,\n saveCredentials: paymentState.saveCredentials,\n });\n }, [sendPaymentForm, paymentState]);\n\n const setStep = useCallback((nextStep) => {\n setPaymentStep({ step: nextStep });\n }, [setPaymentStep]);\n\n const handleButtonClick = useCallback(() => {\n setIsLoading(true);\n switch (step) {\n case PaymentStep.ShippingInfo:\n return validateRequest();\n case PaymentStep.Shipping:\n return setStep(PaymentStep.PaymentInfo);\n case PaymentStep.PaymentInfo:\n return sendCredentials();\n case PaymentStep.Checkout:\n return sendForm();\n default:\n return () => {\n };\n }\n }, [step, validateRequest, setStep, sendCredentials, sendForm]);\n\n const modalHeader = useMemo(() => {\n switch (step) {\n case PaymentStep.ShippingInfo:\n return lang('PaymentShippingInfo');\n case PaymentStep.Shipping:\n return lang('PaymentShippingMethod');\n case PaymentStep.PaymentInfo:\n return lang('PaymentCardInfo');\n case PaymentStep.Checkout:\n return lang('PaymentCheckout');\n case PaymentStep.ConfirmPayment:\n return lang('Checkout.WebConfirmation.Title');\n default:\n return '';\n }\n }, [step, lang]);\n\n const buttonText = useMemo(() => {\n switch (step) {\n case PaymentStep.Checkout:\n return lang('Checkout.PayPrice', formatCurrency(totalPrice, currency, lang.code));\n default:\n return lang('Next');\n }\n }, [step, lang, currency, totalPrice]);\n\n if (isProviderError) {\n return (\n \n

\n Sorry, Telegram WebZ doesn't support payments with this provider yet.
\n Please use one of our mobile apps to do this.\n

\n \n {lang('OK')}\n \n \n );\n }\n\n return (\n \n
\n \n \n \n

{modalHeader}

\n
\n {step !== undefined ? (\n \n
\n {renderModalContent(step)}\n
\n
\n ) : (\n
\n \n
\n )}\n {canRenderFooter && (\n
\n \n {buttonText}\n \n
\n )}\n {error && !error.field && renderError()}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps & GlobalStateProps => {\n const {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n invoice,\n invoiceContent,\n nativeProvider,\n nativeParams,\n passwordMissing,\n error,\n confirmPaymentUrl,\n } = global.payment;\n\n const isProviderError = Boolean(invoice && (!nativeProvider || !SUPPORTED_PROVIDERS.has(nativeProvider)));\n const { needCardholderName, needCountry, needZip } = (nativeParams || {});\n const {\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n } = (invoice || {});\n\n return {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nativeProvider,\n passwordMissing,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n isProviderError,\n invoiceContent,\n needCardholderName,\n needCountry,\n needZip,\n error,\n confirmPaymentUrl,\n };\n },\n)(Invoice));\n\nfunction findShippingOption(shippingOptions: ShippingOption[], optionId: string) {\n return shippingOptions.find(({ id }) => id === optionId);\n}\n\nfunction getShippingPrices(shippingOptions: ShippingOption[], shippingOption: string) {\n const option = findShippingOption(shippingOptions, shippingOption);\n return option?.prices;\n}\n\nfunction getTotalPrice(prices: Price[] = [], shippingOptions: ShippingOption[] | undefined, shippingOption: string) {\n const shippingPrices = shippingOptions\n ? getShippingPrices(shippingOptions, shippingOption)\n : [];\n let total = 0;\n const totalPrices = prices.concat(shippingPrices || []);\n total = totalPrices.reduce((acc, cur) => {\n return acc + cur.amount;\n }, total);\n return total;\n}\n\nfunction getCheckoutInfo(state: FormState, shippingOptions: ShippingOption[] | undefined, paymentProvider: string) {\n const cardTypeText = detectCardTypeText(state.cardNumber);\n const paymentMethod = `${cardTypeText} *${state.cardNumber.slice(-4)}`;\n const shippingAddress = state.streetLine1\n ? `${state.streetLine1}, ${state.city}, ${state.countryIso2}`\n : undefined;\n const { phone, fullName: name } = state;\n const shippingOption = shippingOptions ? findShippingOption(shippingOptions, state.shipping) : undefined;\n const shippingMethod = shippingOption?.title;\n return {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n\nfunction getRequestInfo(paymentState: FormState) {\n const {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n fullName: name,\n phone,\n email,\n } = paymentState;\n\n const shippingAddress = {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n };\n\n return {\n name,\n phone,\n email,\n shippingAddress,\n };\n}\n\nfunction getCredentials(paymentState: FormState) {\n const {\n cardNumber, cardholder, expiry, cvv, billingCountry, billingZip,\n } = paymentState;\n const [expiryMonth, expiryYear] = expiry.split('/');\n const data = {\n cardNumber,\n cardholder,\n expiryMonth,\n expiryYear,\n cvv,\n country: billingCountry,\n zip: billingZip,\n };\n\n return {\n data,\n };\n}\n","import React, {\n FC, memo, useMemo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { Price } from '../../types';\nimport { ApiShippingAddress } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Checkout from './Checkout';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './PaymentModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n prices?: Price[];\n shippingPrices: any;\n totalAmount?: number;\n currency?: string;\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n photoUrl?: string;\n text?: string;\n title?: string;\n credentialsTitle?: string;\n shippingMethod?: string;\n};\n\nconst ReceiptModal: FC = ({\n isOpen,\n onClose,\n prices,\n shippingPrices,\n totalAmount,\n currency,\n info,\n photoUrl,\n text,\n title,\n credentialsTitle,\n shippingMethod,\n}) => {\n const lang = useLang();\n const checkoutInfo = useMemo(() => {\n return getCheckoutInfo(credentialsTitle, info, shippingMethod);\n }, [info, shippingMethod, credentialsTitle]);\n\n return (\n \n
\n
\n \n \n \n

{lang('PaymentReceipt')}

\n
\n
\n \n
\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { receipt } = global.payment;\n const {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n } = (receipt || {});\n\n return {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n };\n },\n)(ReceiptModal));\n\nfunction getCheckoutInfo(paymentMethod?: string,\n info?:\n { phone?: string;\n name?: string;\n shippingAddress?: ApiShippingAddress;\n },\n shippingMethod?: string) {\n if (!info) {\n return { paymentMethod };\n }\n const { shippingAddress } = info;\n const fullAddress = shippingAddress?.streetLine1\n ? `${shippingAddress.streetLine1}, ${shippingAddress.city}, ${shippingAddress.countryIso2}`\n : undefined;\n const { phone, name } = info;\n return {\n paymentMethod,\n paymentProvider: 'Stripe',\n shippingAddress: fullAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n
\n \n \n \n \n \n \n \n {canSubmit && (\n \n )}\n \n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState();\n const [peekMonkeyData, setPeekMonkeyData] = useState();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {closeMonkeyData && (\n \n )}\n {peekMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(PasswordMonkey);\n","import React, {\n FC, useEffect, useState, memo,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n size: { width: 1024, height: 1024 },\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n async function handleCropClick() {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }\n\n return (\n \n {isCroppieReady ? (\n
\n ) : (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n function handleAvatarCrop(croppedImg: File) {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }\n\n function handleModalClose() {\n setSelectedFile(undefined);\n }\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n
\n \n \n \n {croppedBlobUrl && \"Avatar\"}\n \n \n
\n );\n};\n\nexport default memo(AvatarEditable);\n"],"names":["createGhost","source","origin","ghost","document","createElement","classList","add","img","Image","draggable","oncontextmenu","stopEvent","src","HTMLVideoElement","poster","appendChild","MediaViewerOrigin","profileInfo","querySelector","cloneNode","isMessageImageFullyVisible","container","imageEl","messageListElement","imgOffsetTop","offsetTop","closest","id","includes","parentElement","scrollTop","offsetHeight","applyStyles","element","styles","Object","assign","style","getNodes","message","containerSelector","mediaSelector","mediaEls","querySelectorAll","mediaEl","length","applyShape","firstChild","objectFit","memo","withGlobal","global","isDownloading","selectIsDownloading","isProtected","selectIsMessageProtected","mediaData","isVideo","isZoomed","fileName","isAvatar","onCloseMediaViewer","onForward","onZoomToggle","downloadMessageMedia","cancelMessageMediaDownload","getDispatch","loadProgress","downloadProgress","useMediaWithLoadProgress","getMessageMediaHash","handleDownloadClick","useCallback","lang","useLang","MenuButton","useMemo","onTrigger","isOpen","Button","round","size","color","className","undefined","onClick","ariaLabel","IS_SINGLE_COLUMN_LAYOUT","DropdownMenu","trigger","positionX","MenuItem","icon","Math","href","download","ProgressSpinner","progress","noCross","renderDownloadButton","text","isHidden","isForVideo","isMultiline","setIsMultiline","useState","useEffect","footerContent","checkIsMultiline","height","clientHeight","REM","handleResize","throttle","window","addEventListener","removeEventListener","classNames","buildClassName","e","stopPropagation","dir","prop","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","units","bytes","number","floor","log","toFixed","bufferedProgress","currentTime","duration","fileSize","isForceMobileVersion","isPlayed","isFullscreenSupported","isFullscreen","onChangeFullscreen","onPlayPause","isVisible","setVisibility","onSeek","seekerRef","useRef","isSeeking","timeout","setTimeout","clearTimeout","body","remove","handleSeek","current","width","left","getBoundingClientRect","clientX","MouseEvent","targetTouches","max","min","handleStartSeek","handleStopSeek","captureEvents","onCapture","onRelease","onDrag","percentagePlayed","percentageBuffered","ref","renderSeekLine","ripple","formatMediaDuration","renderTime","loadedPercent","totalSize","formatFileSize","url","isGif","posterData","posterSize","isMediaViewerOpen","noPlay","onClose","toggleControls","areControlsVisible","videoRef","setIsPlayed","IS_TOUCH_ENV","IS_IOS","setCurrentTime","setFullscreen","exitFullscreen","elRef","setIsFullscreen","Boolean","useLayoutEffect","listener","listenerEnter","listenerExit","video","PLATFORM_ENV","requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","mozRequestFullScreen","mozCancelFullScreen","webkitCancelFullScreen","webkitExitFullscreen","useFullscreenStatus","isBuffered","bufferingHandlers","useBuffering","shouldRender","shouldRenderSpinner","transitionClassNames","spinnerClassNames","useShowTransition","shouldRenderPlayButton","playButtonClassNames","pause","safePlay","togglePlayState","useVideoCleanup","handleMouseMove","handleMouseOut","target","handleTimeUpdate","currentTarget","handleEnded","handleFullscreenChange","position","togglePayingStateBySpace","key","preventDefault","wrapperStyle","videoStyle","onMouseMove","onMouseOut","autoPlay","playsInline","loop","muted","onPlay","onEnded","onDoubleClick","onTimeUpdate","join","square","ownProps","chatId","threadId","messageId","avatarOwnerId","profilePhotoIndex","selectChatMessage","senderId","avatarOwner","selectUser","selectChat","selectScheduledMessage","props","isActive","animationLevel","onFooterClick","isFooterHidden","setIsFooterHidden","photo","getMessagePhoto","getMessageVideo","webPagePhoto","getMessageWebPagePhoto","webPageVideo","getMessageWebPageVideo","isDocumentPhoto","isMessageDocumentPhoto","isDocumentVideo","isMessageDocumentVideo","isPhoto","isFromSharedMedia","isFromSearch","isGhostAnimation","getMediaHash","isFull","photos","getChatAvatarHash","pictogramBlobUrl","useMedia","ApiMediaFormat","previewMediaHash","previewBlobUrl","fullMediaBlobUrl","getMessageMediaFormat","localBlobUrl","blobUrl","bestImageData","thumbDataUri","useBlurSync","getMessageMediaThumbDataUri","videoSize","getMessageFileSize","dimensions","getMessageDocument","mediaSize","getPhotoFullDimensions","getVideoDimensions","AVATAR_FULL_DIMENSIONS","renderPhoto","calculateMediaViewerDimensions","textParts","renderMessageText","hasFooter","onContextMenu","imageSize","canDrag","Spinner","renderVideoPreview","alt","ANIMATION_DURATION","cancelAnimation","SwipeDirection","getMessageId","selectMessage","rest","containerRef","activeSlideRef","transformRef","x","y","scale","swipeDirectionRef","isActiveRef","activeMessageId","setActiveMessageId","forceUpdate","useForceUpdate","setTransform","value","setIsActive","debounceSetMessage","useDebounce","debounceSwipeDirection","debounceActive","handleToggleFooterVisibility","isFooter","innerHeight","pageY","pageX","innerWidth","callback","delay","savedCallback","useTimeout","lastTransform","lastDragOffset","lastZoomCenter","panDelta","initialContentRect","content","lastGestureTime","Date","now","setLastGestureTime","debounce","changeSlide","direction","mId","offset","animateNumber","from","to","timing","timingFunctions","onUpdate","isNotPassive","excludedClosestSelector","arePropsShallowEqual","event","captureEvent","dragOffsetX","dragOffsetY","touches","IOS_SCREEN_EDGE_THRESHOLD","absOffsetX","abs","absOffsetY","h","Vertical","Horizontal","onZoom","zoomFactor","initialCenterX","initialCenterY","currentCenterX","currentCenterY","MAX_ZOOM","scaleFactor","scaledCenterX","scaledCenterY","scaleOffsetX","scaleOffsetY","centerX","centerY","absX","absY","boundaries","s1","x1","y1","k","Vx","Vy","minOffsetX","maxOffsetX","right","minOffsetY","top","maxOffsetY","bottom","dirX","nextMessageId","previousMessageId","offsetX","offsetY","getAnimationStyle","INITIAL_MATRIX","SCALE_VALUES","ZOOM_SAFE_AREA","children","noWrap","canPan","zoomLevel","panDeltaX","panDeltaY","onPan","tunedZoomLevel","isDragging","setIsDragging","dragData","setDragData","dx","dy","matrixData","setMatrixData","panWrapperRef","panContainerRef","newZoomLevel","newPandx","newPandy","newMatrixData","areSortedArraysEqual","oldScale","wrapper","image","wrapperRect","imageRect","newImgWidth","newImgHeight","newImgX","newImgY","calculateSafeZoneOnZoom","transform","toString","onMouseDown","newDragData","onMouseUp","deltaX","deltaY","getNewMatrixData","sender","isUserId","selectSender","closeMediaViewer","focusMessage","toggleChatInfo","handleFocusMessage","forceSyncOnIOs","senderTitle","getSenderTitle","Avatar","user","chat","renderText","formatMediaDateTime","date","Transition","isShown","onChangeZoom","prevIsShown","usePrevious","inputRef","setZoomLevel","disabled","step","type","onChange","Number","mediaViewer","settings","byKey","chatMessages","collectionIds","selectScheduledMessages","selectChatMessages","selectOutlyingIds","selectListedIds","currentSearch","selectCurrentMediaSearch","foundIds","resultsByType","media","openMediaViewer","openForwardMenu","singleMessageId","messageIds","getChatMediaMessageIds","selectedMediaMessageIndex","indexOf","isFirst","isLast","animationKey","prevSenderId","slideAnimation","headerAnimation","canPanZoomWrap","setCanPanZoomWrap","setIsZoomed","setPanDelta","getMessageFileName","toggle","mql","matchMedia","MEDIA_VIEWER_MEDIA_QUERY","addListener","removeListener","prevMessage","prevOrigin","prevAvatarOwner","prevBestImageData","dispatchHeavyAnimationEvent","ANIMATION_END_DELAY","fromImage","windowWidth","windowSize","availableWidth","availableHeight","getMediaViewerAvailableDimensions","toWidth","toHeight","calculateDimensions","toLeft","toTop","topOffsetRem","matches","getTopOffset","fromTop","fromLeft","fromWidth","fromHeight","uncovered","realWidth","realHeight","srcWidth","srcHeight","uncover","fromTranslateX","fromTranslateY","fromScaleX","fromScaleY","requestAnimationFrame","clearShape","contains","removeChild","animateOpening","toImage","getElementById","targetTop","el","display","rect","windowHeight","isElementInViewport","shouldFadeOut","existingGhost","getElementsByClassName","transition","transformOrigin","opacity","animateClosing","timer","closeZoom","handleZoomToggle","handleZoomValue","level","canCloseZoom","close","handleFooterClick","handleForward","fromChatId","forceOnHeavyAnimation","captureEscKeyListener","stopCurrentAudio","fromId","index","handlePan","useHistoryBack","handleKeyDown","shouldCloseOnVideo","ShowTransition","isRtl","activeKey","name","currentUserId","chatOrUserIds","filterRef","filter","filterPlaceholder","loadMore","onFilterChange","onSelectChatOrUser","onCloseAnimationEnd","viewportIds","getMore","useInfiniteScroll","resetFilter","useInputFocusOnOpen","handleFilterChange","useKeyboardListNavigation","modalHeader","InputText","onKeyDown","placeholder","viewportOffset","Modal","header","InfiniteScroll","items","onLoadMore","withAbsolutePositioning","maxHeight","CHAT_HEIGHT_PX","map","i","ListItem","PrivateChatInfo","status","userId","GroupChatInfo","Loading","chats","byId","chatsById","listIds","orderedPinnedIds","activeListIds","active","archivedListIds","archived","pinnedIds","contactIds","contactList","userIds","setForwardChatId","exitForwardMode","setFilter","markIsShown","unmarkIsShown","useFlag","chatAndContactIds","priorityIds","unique","chatIds","getCanPostInChat","MAIN_THREAD_ID","usersById","getGlobal","users","sortChatIds","filterChatsByName","filterUsersByName","handleSelectUser","renderingChatAndContactIds","useCurrentOrPrev","getErrorHeader","error","isSlowMode","hasErrorKey","pick","dialogs","dismissDialog","acceptInviteConfirmation","sendMessage","showNotification","isModalOpen","openModal","closeModal","dialog","contactRequest","invite","hash","title","about","participantsCount","isChannel","isRequestNeeded","participantsText","joinText","requestToJoinText","renderInviteHeader","isText","renderInvite","contact","getReadableErrorText","notifications","dismissNotification","localId","Notification","onDismiss","toggleSafeLinkModal","handleOpen","open","ensureProtocol","handleDismiss","renderingUrl","ConfirmDialog","confirmLabel","confirmHandler","MAX_SAFE_DATE","WEEKDAY_LETTERS","isDisabledDay","year","month","day","minDate","maxDate","selectedDay","fixedMinDate","getDayStart","fixedMaxDate","formatInputTime","String","padStart","formatDay","selectedAt","minAt","maxAt","isFutureMode","isPastMode","withTimePicker","submitButtonLabel","secondButtonLabel","onSubmit","onSecondButtonClick","passedSelectedDate","prevIsOpen","isTimeInputFocused","markTimeInputAsFocused","unmarkTimeInputAsFocused","selectedDate","setSelectedDate","currentMonthAndYear","setCurrentMonthAndYear","getFullYear","getMonth","selectedHours","setSelectedHours","getHours","selectedMinutes","setSelectedMinutes","getMinutes","getDate","currentYear","currentMonth","getTime","newSelectedDate","shouldDisableNextMonth","shouldDisablePrevMonth","prevMonthGrid","currentMonthGrid","nextMonthGrid","setDate","setMonth","setFullYear","firstDay","getDay","totalDaysInPrevMonth","push","gridDate","lastRowDaysCount","buildCalendarGrid","submitLabel","formatDateToString","code","formatTime","formatSubmitLabel","handleChangeHours","replace","hours","setHours","hoursStr","handleChangeMinutes","minutes","setMinutes","minutesStr","d","dateCopy","role","tabIndex","handleDateSelect","inputMode","onFocus","onBlur","historyCalendarSelectedAt","searchMessagesByDate","closeHistoryCalendar","handleJumpToDate","timestamp","valueOf","isSchedule","selectCurrentMessageList","canDeleteForAll","selectAllowedMessageActions","contactName","getUserFirstOrLastName","getPrivateChatUserId","willDeleteForCurrentUserOnly","isChatBasicGroup","willDeleteForAll","isChatSuperGroup","album","deleteMessages","deleteScheduledMessages","handleDeleteMessageForAll","messages","shouldDeleteForAll","handleDeleteMessageForSelf","onEnter","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","isChatChannel","isGroup","isSuperGroup","canPinForAll","pinMessage","handlePinMessageForAll","isUnpin","handlePinMessage","isOneSide","isSilent","pinnedMessagesCount","onUnpin","selectedMessageIds","selectedMessages","selectCanDeleteSelectedMessages","selectCurrentChat","exitMessageSelectMode","reportMessages","selectedReason","setSelectedReason","description","setDescription","handleReport","reason","handleSelectReason","handleDescriptionChange","REPORT_OPTIONS","label","RadioGroup","options","selected","messageListType","canDelete","canReport","selectCanReportSelectedMessages","canDownload","selectCanDownloadSelectedMessages","hasProtectedMessage","selectHasProtectedMessage","selectedMessagesCount","selectSelectedMessagesCount","canDeleteMessages","canReportMessages","canDownloadMessages","canPost","openForwardMenuForSelectedMessages","downloadSelectedMessages","copySelectedMessages","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isReportModalOpen","openReportModal","closeReportModal","handleCopy","IS_MAC_OS","metaKey","ctrlKey","getKeyFromEvent","useCopySelectedMessages","captureKeyboardListeners","onBackspace","onDelete","onEsc","handleDownload","prevSelectedMessagesCount","renderingSelectedMessagesCount","formattedMessagesCount","renderButton","destructive","seenByModal","memberIds","seenByUserIds","openChat","closeSeenByModal","handleClick","renderingMemberIds","noStatusOrTyping","reactorModal","reactions","reactors","loadReactors","closeReactorListModal","isClosing","startClosing","stopClosing","chosenTab","setChosenTab","canShowFilters","count","results","chatIdRef","handleCloseAnimationEnd","handleClose","handleLoadMore","allReactions","l","reaction","concat","nextOffset","LoadMoreDirection","formatIntegerCompact","find","ReactionStaticEmoji","fullName","getUserFullName","activeEmojiInteraction","animatedEffect","selectAnimatedEmojiEffect","effectAnimationId","localEffectAnimation","keys","ANIMATED_STICKERS_PATHS","stopActiveEmojiInteraction","isHiding","startHiding","isPlaying","startPlaying","timeoutRef","stop","handleCancelAnimation","dispatchHeavyAnimationStop","effectAnimationData","localEffectAnimationData","setLocalEffectAnimationData","getAnimationData","then","data","startSize","isReversed","AnimatedSticker","animationData","play","quality","IS_ANDROID","noLoop","onLoad","onSelect","buttonRef","activeElement","privateChatUserId","isPinned","selectIsChatPinned","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","canChangeFolder","chatFolders","orderedIds","withUsername","isChatFolderModalOpen","openChatFolderModal","closeChatFolderModal","contextActions","useChatContextActions","handleDelete","handleChatFolderChange","useSelectWithEnter","avatarSize","DeleteChatModal","runThrottled","cb","topUserIds","topPeers","recentlyFoundChatIds","globalSearch","onReset","loadTopUsers","loadContactList","addRecentlyFoundChatId","clearRecentlyFoundChats","topUsersRef","useHorizontalScroll","shouldReplaceHistory","lastSyncTime","privateChatUser","searchQuery","mediaThumbnail","mediaBlobUrl","isRoundVideo","getMessageRoundVideo","isSavedMessages","isSelf","getChatTitle","isVerified","VerifiedIcon","Link","formatPastTimeShort","renderMessageSummary","renderSummary","searchDate","suggestions","match","suggestion","currentDate","latestYear","getSuggestionsFromDate","localContactIds","fetchingStatus","globalResults","localResults","globalChatIds","globalUserIds","localChatIds","localUserIds","byChatId","globalMessagesByChatId","dateSearchQuery","onSearchDateSelect","searchMessagesGlobal","setGlobalSearchChatId","shouldShowMoreLocal","setShouldShowMoreLocal","shouldShowMoreGlobal","setShouldShowMoreGlobal","query","handleChatClick","handlePickerItemClick","startsWith","MEMO_EMPTY_ARRAY","contactIdsWithMe","foundContactIds","foundMessages","split","sort","a","b","handleClickShowMoreLocal","handleClickShowMoreGlobal","nothingFound","noScrollRestoreOnTop","noFastList","NothingFound","PickerSelectedItem","chatOrUserId","clickArg","createMapStateToProps","currentType","isVoice","activeDownloads","theme","selectTheme","isLoading","searchChatId","isChatProtected","CURRENT_TYPE","observe","observeIntersectionForMedia","useIntersectionObserver","rootRef","throttleMs","handleSelectMedia","canRenderContents","useAsyncRendering","SLIDE_TRANSITION_DURATION","isMediaGrid","isMessageList","itemSelector","Media","idPrefix","observeIntersection","handleMessageFocus","shouldDrawDateDivider","toYearMonth","formatMonthAndYear","WebLink","getSenderName","onMessageClick","Document","withDate","datetime","smaller","onDateClick","openAudioPlayer","handlePlayAudio","Audio","AudioOrigin","TABS","GlobalSearchContent","CHAT_TABS","slice","TRANSITION_RENDER_COUNT","currentContent","setGlobalSearchContent","setGlobalSearchDate","activeTab","setActiveTab","parseDateString","handleSwitchTab","tab","handleSearchDateSelect","TabList","tabs","onSwitchTab","renderCount","INITIAL_STATE","currentPassword","password","hint","email","twoFaReducer","state","action","payload","currentScreen","editedFolderId","onSaveFilter","onScreenSelect","signOut","deleteChatFolder","isSignOutDialogOpen","setIsSignOutDialogOpen","isDeleteFolderDialogOpen","setIsDeleteFolderDialogOpen","openSignOutConfirmation","closeSignOutConfirmation","openDeleteFolderConfirmation","closeDeleteFolderConfirmation","handleSignOutMessage","handleDeleteFolderMessage","SettingsMenuButton","SettingsScreens","renderHeaderContent","confirmIsDestructive","currentUser","loadProfilePhotos","profileId","ProfileInfo","forceShowSelf","ChatExtra","LINK_PREFIX","LINK_PREFIX_REGEX","USERNAME_REGEX","runDebouncedForCheckUsername","currentUsername","asLink","isUsernameAvailable","checkUsername","username","setUsername","langPrefix","usernameSuccess","usernameError","test","handleUsernameChange","newUsername","trim","isValid","isUsernameValid","success","readOnly","ERROR_FIRST_NAME_MISSING","ERROR_BIO_TOO_LONG","profileEdit","firstName","currentFirstName","lastName","currentLastName","fullInfo","bio","currentBio","currentAvatarHash","loadCurrentUser","updateProfile","isUsernameTouched","setIsUsernameTouched","isProfileFieldsTouched","setIsProfileFieldsTouched","setError","setPhoto","setFirstName","setLastName","setBio","currentAvatarBlobUrl","ProfileEditProgress","isUsernameError","isSaveButtonShown","handlePhotoChange","newPhoto","handleFirstNameChange","handleLastNameChange","handleBioChange","handleProfileSave","trimmedFirstName","trimmedLastName","trimmedBio","AvatarEditable","UsernameInput","FloatingActionButton","canAutoLoadPhotoFromContacts","canAutoLoadPhotoInPrivateChats","canAutoLoadPhotoInGroups","canAutoLoadPhotoInChannels","canAutoLoadVideoFromContacts","canAutoLoadVideoInPrivateChats","canAutoLoadVideoInGroups","canAutoLoadVideoInChannels","canAutoLoadFileFromContacts","canAutoLoadFileInPrivateChats","canAutoLoadFileInGroups","canAutoLoadFileInChannels","canAutoPlayGifs","canAutoPlayVideos","autoLoadFileMaxSizeMb","setSettingOption","renderFileSizeCallback","AUTODOWNLOAD_FILESIZE_MB_LIMITS","handleFileSizeChange","renderAutoDownloadBlock","canAutoLoadFromContacts","canAutoLoadInPrivateChats","canAutoLoadInGroups","canAutoLoadInChannels","Checkbox","checked","onCheck","isChecked","RangeSlider","renderValue","renderContentSizeSlider","runThrottledForLoadRecommended","orderedFolderIds","foldersById","recommended","recommendedChatFolders","onCreateFolder","onEditFolder","loadRecommendedChatFolders","addChatFolder","showDialog","setAnimationData","isAnimationLoaded","setIsAnimationLoaded","handleAnimationLoad","handleCreateFolder","chatsCountByFolderId","useFolderManagerForChatsCount","userFolders","folder","subtitle","getFolderDescriptionText","handleCreateFolderFromRecommended","STICKER_SIZE_FOLDER_SETTINGS","pill","fluid","narrow","multiline","itemName","itemPluralName","ERROR_NO_TITLE","ERROR_NO_CHATS","loadedActiveChatIds","loadedArchivedChatIds","dispatch","onAddIncludedChats","onAddExcludedChats","onBack","editChatFolder","isIncludedChatsListExpanded","setIsIncludedChatsListExpanded","isExcludedChatsListExpanded","setIsExcludedChatsListExpanded","selectedChatIds","includedChatIds","selectedChatTypes","includedChatTypes","selectChatFilters","excludedChatIds","excludedChatTypes","folderId","visibleIncludedChatIds","visibleExcludedChatIds","allLoadedChatsSet","Set","loadedIncludedChatIds","findIntersectionWithSet","loadedExcludedChatIds","renderChats","mode","visibleChatIds","isExpanded","leftChatsCount","clickHandler","chatType","INCLUDED_CHAT_TYPES","typeKey","EXCLUDED_CHAT_TYPES","inactive","renderChatType","isTouched","folderUpdate","selectedIds","filterValue","onSelectedIdsChange","onSelectedChatTypesChange","chatTypes","shouldMinimize","hasMaxChats","focus","handleItemClick","newSelectedIds","splice","handleChatTypeClick","newSelectedChatTypes","selectedType","isMinimized","canClose","isSelected","withChatType","chatFilter","folderAllOrderedIds","useFolderManagerForOrderedIds","ALL_FOLDER_ID","folderArchivedOrderedIds","ARCHIVED_FOLDER_ID","displayedIds","newFilter","handleSelectedIdsChange","ids","includeFilters","excludeFilters","handleSelectedChatTypesChange","newFilters","forEach","shownScreen","handleReset","handleEditFolder","handleAddIncludedChats","handleAddExcludedChats","STICKER_SIZE_PICKER_HEADER","stickerSet","isIntersecting","useIsIntersecting","mediaHash","lottieData","useMediaTransition","firstLetters","getFirstLetters","hasThumbnail","isGifs","IS_WEBM_SUPPORTED","stickers","firstSticker","isLottie","STICKER_SIZE_GENERAL_SETTINGS","StickerButton","sticker","ANIMATION_LEVEL_OPTIONS","TIME_FORMAT_OPTIONS","stickerSetIds","added","setIds","stickerSetsById","setsById","defaultReaction","appConfig","messageTextSize","messageSendKeyCombo","shouldSuggestStickers","shouldLoopStickers","timeFormat","stickerSettingsRef","observeIntersectionForCovers","setSticker","KEYBOARD_SEND_OPTIONS","subLabel","handleAnimationLevelChange","newLevel","_","handleMessageTextSizeChange","newSize","documentElement","setProperty","setAttribute","handleTimeFormatChange","newTimeFormat","wasTimeFormatSetManually","setTimeFormat","handleStickerSetClick","stickerSets","installedDate","fromSticker","fileSelector","openSystemFilesDialog","accept","noMultiple","removeAttribute","onchange","click","hex2rgb","param","parseInt","substring","rgb2hex","p0","p1","p2","rgb2hsb","r","g","s","v","hsb2rgb","f","p","q","t","getPatternColor","rgbColor","hue","saturation","wallpaper","slug","localMediaHash","thumbRef","useCanvasBlur","thumbnail","dataUri","isLoadAllowed","setIsLoadAllowed","fullMedia","wasLoadDisabled","UPLOADING_WALLPAPER_SLUG","cacheKeyRef","handleSelect","blob","fetchBlob","cacheApi","save","CUSTOM_BG_CACHE_NAME","isAllowed","background","isBlurred","themes","loadedWallpapers","loadWallpapers","uploadWallpaper","setThemeSettings","themeRef","handleFileSelect","files","handleUploadWallpaper","handleSetColor","handleResetToDefault","backgroundColor","patternColor","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","handleWallPaperSelect","currentWallpaper","async","defaultRGB","rgb","canvas","context","getContext","preloadImage","naturalHeight","naturalWidth","offsetWidth","drawImage","getImageData","blockSize","getAverageColor","handleWallPaperBlurChange","isUploading","DEFAULT_HSB","PREDEFINED_COLORS","hsb2positions","hsb","rects","colorPosition","colorRect","huePosition","hueRect","positions2hsb","colorPickerRef","huePickerRef","isFirstRunRef","setHsb","getInitialHsb","hsbRef","markIsDragging","unmarkIsDragging","rgbInput","setRgbInput","hexInput","setHexInput","rectsRef","colorCtxRef","offsetLeft","handleColorDrag","handleHueDrag","selectorToPreventScroll","withCursor","hex","hueHex","w","ctx","imgData","createImageData","pixels","col","perY","st","ed","perX","putImageData","drawColor","drawHue","handleRgbChange","rgbValue","channel","handleHexChange","hexValue","handlePredefinedColorClick","dataset","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","hasContactJoinedNotifications","hasWebNotifications","hasPushNotifications","notificationSoundVolume","loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings","runDebounced","handleSettingsChange","peerType","setting","currentIsSilent","currentShouldShowPreviews","shouldShowPreviews","handleContactNotificationChange","volume","playNotifySound","hasPassword","isSensitiveEnabled","canChangeSensitive","privacy","blocked","activeSessions","blockedCount","totalCount","sessionsCount","visibilityPrivacyPhoneNumber","phoneNumber","visibility","visibilityPrivacyLastSeen","lastSeen","visibilityPrivacyProfilePhoto","profilePhoto","visibilityPrivacyForwarding","forwards","visibilityPrivacyGroupChats","chatInvite","loadPrivacySettings","loadBlockedContacts","loadAuthorizations","loadContentSettings","updateContentSettings","getVisibilityValue","languages","language","loadLanguages","selectedLanguage","setSelectedLanguage","markIsLoading","unmarkIsLoading","handleChange","langCode","setLanguage","currentLangCode","navigator","toLowerCase","shortLangCode","substr","nativeName","buildOptions","loadingOption","getPrivacyKey","screen","privacySettings","allowUserIds","allowChatIds","blockUserIds","blockChatIds","setPrivacyVisibility","visibilityOptions","exceptionLists","shouldShowDenied","shouldShowAllowed","privacyKey","headerText","descriptionText","allowedContactsScreen","deniedContactsScreen","allowedCount","reduce","result","membersCount","blockCount","handleVisibilityChange","getLocation","session","region","country","getDeviceEnvironment","deviceModel","platform","systemVersion","terminateAuthorization","terminateAllAuthorizations","isConfirmTerminateAllDialogOpen","openConfirmTerminateAllDialog","closeConfirmTerminateAllDialog","handleTerminateSessionClick","handleTerminateAllSessions","currentSession","isCurrent","otherSessions","appName","ip","sessions","handler","dateActive","blockedIds","userSearch","setUserSearchQuery","blockContact","filteredContactIds","availableContactIds","contactId","firstId","secondId","secondName","localeCompare","handleRemoveUser","accessHash","chatsByIds","usersByIds","countryList","phoneCodes","phoneCodeList","unblockContact","isBlockUserModalOpen","openBlockUserModal","closeBlockUserModal","handleUnblockClick","isPrivate","formatPhoneNumberWithCode","renderContact","animatedEmoji","selectAnimatedEmoji","AnimatedEmoji","expectedPassword","clearError","validationError","setValidationError","shouldShowPassword","setShouldShowPassword","handleSubmit","newPassword","handleClearError","PasswordMonkey","isBig","isPasswordVisible","PasswordForm","onChangePasswordVisibility","onStart","FOCUS_DELAY_TIMEOUT_MS","shouldConfirm","setValue","isConfirmShown","markIsConfirmShown","unmarkIsConfirmShown","codeLength","twoFaSettings","waitingEmailCodeLength","newValue","updatePassword","checkPassword","clearTwoFaError","updateRecoveryEmail","provideTwoFaEmailCode","clearPassword","handleStartWizard","handleNewPassword","handleNewPasswordConfirm","handleNewPasswordHint","handleNewPasswordEmail","onSuccess","handleChangePasswordCurrent","handleChangePasswordNew","handleChangePasswordConfirm","handleChangePasswordHint","handleTurnOff","handleRecoveryEmailCurrentPassword","handleRecoveryEmail","handleEmailCode","getCurrentPrivacySettings","isAllowList","setPrivacySettings","selectedContactIds","setSearchQuery","isSubmitShown","setIsSubmitShown","newSelectedContactIds","setNewSelectedContactIds","isChatGroup","handleSelectedContactIdsChange","contactsIds","Picker","itemIds","searchInputId","availableReactions","selectedReaction","setDefaultReaction","isInactive","TWO_FA_SCREENS","FOLDERS_SCREENS","PRIVACY_SCREENS","PRIVACY_PHONE_NUMBER_SCREENS","PRIVACY_LAST_SEEN_PHONE_SCREENS","PRIVACY_PROFILE_PHOTO_SCREENS","PRIVACY_FORWARDING_SCREENS","PRIVACY_GROUP_CHATS_SCREENS","foldersState","foldersDispatch","shouldSkipTransition","twoFaState","twoFaDispatch","useReducer","handleSaveFilter","renderCurrentSection","isScreenActive","isFrom","currentKey","privacyAllowScreens","isTwoFaScreen","isFoldersScreen","isPrivacyScreen","values","SettingsGeneralBackgroundColor","renderCurrentSectionContent","LAYERS_ANIMATION_NAME","statusesById","userStatusesById","serverTimeOffset","filteredIds","sortUserIds","isSearching","selectedMemberIds","onSelectedMemberIdsChange","onNextStep","setGlobalSearchQuery","canBeInvitedToGroup","isUserBot","handleNextStep","creationProgress","creationError","chatCreation","createGroupChat","createChannel","setTitle","setAbout","chatTitleEmptyError","channelTitleEmptyError","chatTooManyUsersError","ChatCreationProgress","handleTitleChange","handleCreateGroup","handleCreateChannel","renderedError","RENDER_COUNT","LeftColumnContent","onContentChange","newChatMemberIds","setNewChatMemberIds","isStepActive","ChatList","folderType","folderOrderedIds","editChatFolders","initialSelectedFolderIds","pinnedChatIds","selectedFolderIds","setSelectedFolderIds","folders","idsToRemove","idsToAdd","CheckboxGroup","getCopyLabel","hasSelection","scrollLockEl","IGNORED_KEYS","Down","ArrowDown","Up","ArrowUp","Left","ArrowLeft","Right","ArrowRight","PageUp","PageDown","End","Home","Tab","getTouchY","changedTouches","clientY","scrollHeight","preventDefaultForScrollKeys","HTMLElement","tagName","getAttribute","isTextBox","disableScrolling","_excludedClosestSelector","passive","onkeydown","enableScrolling","REACTION_SIZE","IS_COMPACT_MENU","cn","createClassNameBuilder","previewIndex","onSendReaction","isReady","selectAnimation","isActivated","activate","deactivate","markAnimationLoaded","shouldRenderAnimated","animatedClassNames","shouldRenderStatic","staticClassNames","onMouseEnter","enabledReactions","itemsScrollRef","isHorizontalScrollEnabled","enableHorizontalScroll","handleWheel","onWheelCapture","onTouchMove","anchor","canSendNow","canReschedule","canReply","canEdit","canPin","canUnpin","canForward","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","canShowSeenBy","canShowReactionsCount","canRemoveReaction","canShowReactionList","seenByRecentUsers","onReply","onEdit","onPin","onReport","onFaveSticker","onUnfaveSticker","onSend","onReschedule","onCopyLink","onDownload","onShowSeenBy","onShowReactors","onCopyMessages","menuRef","scrollableRef","copyOptions","afterEffect","getMessageText","canImageBeCopied","hasMessageLocalBlobUrl","CLIPBOARD_ITEM_SUPPORTED","selection","getSelection","Promise","resolve","mediaLoader","copyImageToClipboard","anchorNode","parentNode","getMessageIdsForSelectedText","clipboardText","getMessageTextWithSpoilers","copyTextToClipboard","getMessageCopyOptions","noReactions","withReactions","markIsReady","unmarkIsReady","getTriggerElement","getRootElement","getMenuElement","getLayout","extraHeightAudioPlayer","pinnedElement","extraHeightPinned","extraPaddingX","extraTopPadding","marginSides","extraMarginTop","handleRemoveReaction","positionY","transformOriginX","transformOriginY","menuStyle","withScroll","useContextMenuPosition","Menu","bubbleStyle","START_SIZE","selectActiveDownloadIds","seenByExpiresAt","seenByMaxChatMembers","noOptions","isScheduled","isLocal","isMessageLocal","isOwnMessage","isAction","isActionMessage","areReactionsEmpty","canSeeList","some","isChosen","hasFullInfo","SERVICE_NOTIFICATIONS_USER_ID","chatUsername","setReplyingToId","setEditingId","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","loadSeenBy","openSeenByModal","sendReaction","openReactorListModal","loadFullChat","copyMessagesByIds","isMenuOpen","setIsMenuOpen","setIsDeleteModalOpen","setIsReportModalOpen","isPinModalOpen","setIsPinModalOpen","isCalendarOpen","openCalendar","closeCalendar","recentReactions","msg","closeMenu","closePinModal","handleCloseCalendar","handleReply","handleEdit","handlePin","handleUnpin","handleFaveSticker","handleUnfaveSticker","handleSelectMessage","params","childMessageIds","withShift","handleScheduledMessageSend","handleOpenCalendar","handleOpenSeenByModal","handleOpenReactorListModal","handleRescheduleMessage","scheduledAt","handleCopyMessages","handleCopyLink","handleSendReaction","reportMessageIds","scheduledMaxDate","getDayStartAt","stickerSetShortName","currentMessageList","sendOptions","getAllowedAttachmentOptions","canSendStickers","selectStickerSet","stickerSetId","selectStickerSetByShortName","loadStickers","toggleStickerSet","isDisabled","stickerSetAccessHash","isPreloadedGlobally","handleButtonClick","hasCloseButton","STICKER_SIZE_MODAL","isRestricted","canAddContact","getCanAddContact","canDeleteChat","getCanDeleteChat","hasLinkedChat","linkedChatId","withExtraActions","canStartBot","canRestartBot","canSubscribe","canSearch","canCall","canMute","canLeave","canEnterVoiceChat","canCreateVoiceChat","onSubscribeChannel","onSearchClick","updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot","joinGroupCall","createGroupCall","openLinkedChat","addContact","openCallFallbackConfirm","handleStartBot","command","handleRestartBot","handleToggleMuteClick","handleEnterVoiceChatClick","handleLinkedChatClick","handleAddContactClick","handleSubscribe","handleCall","handleSearch","handleSelectMessages","Portal","runDebouncedForSearch","selectCurrentTextSearch","isHistoryCalendarOpen","setLocalTextSearchQuery","searchTextMessagesLocal","closeLocalTextSearch","openHistoryCalendar","focusedIndex","setFocusedIndex","visualViewport","mainEl","pageTop","Array","input","div","contentEditable","blur","handleMessageSearchQueryChange","newQuery","handleUp","newFocusIndex","handleDown","SearchInput","findInViewport","selectorOrElements","margin","isDense","shouldContainBottom","isHorizontal","viewportY1","viewportY2","allElements","visibleIndexes","isFound","y2","setTooltipItemVisible","selector","first","isFullyVisible","fastSmoothScroll","useKeyboardNavigation","shouldSaveSelectionOnUpdateItems","shouldRemoveSelectionOnReset","noArrowNavigation","shouldSelectOnTab","selectedItemIndex","setSelectedItemIndex","getSelectedIndex","newIndex","cycleRestrict","handleArrowKey","handleItemSelect","item","isSelectionOutOfRange","onUp","onDown","onLeft","onRight","onTab","onInsertUserName","filteredUsers","handleUserSelect","forceFocus","handleSelectMention","member","selectedMentionIndex","prevChatMembers","renderedChatMembers","attachments","caption","groupChatMembers","recentEmojis","baseEmojiKeywords","emojiKeywords","addRecentEmoji","onCaptionUpdate","onFileAppend","onClear","captionRef","useStateRef","hideTimeoutRef","prevAttachments","renderingAttachments","isHovered","markHovered","unmarkHovered","isQuick","every","quick","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","EDITABLE_INPUT_MODAL_ID","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","sendAttachments","handleFilesDrop","dataTransfer","newFiles","file","CONTENT_TYPES_WITH_PREVIEW","areAllPhotos","SUPPORTED_IMAGE_CONTENT_TYPES","mimeType","areAllVideos","SUPPORTED_VIDEO_CONTENT_TYPES","areAllAudios","renderHeader","onDragEnter","onDrop","onDragOver","onDragLeave","relatedTarget","toTarget","fromTarget","attachment","File","filename","extension","getFileExtension","previewData","emojis","onEmojiSelect","MessageInput","isAttachmentModalInput","html","editableInputId","canAutoFocus","questionInputRef","optionsListRef","solutionRef","question","setQuestion","setOptions","isAnonymous","setIsAnonymous","isMultipleAnswers","setIsMultipleAnswers","isQuizMode","setIsQuizMode","solution","setSolution","correctOption","setCorrectOption","hasErrors","setHasErrors","focusInput","solutionEl","innerHTML","addNewOption","newOptions","list","scrollTo","behavior","handleCreate","questionTrimmed","optionsTrimmed","o","summary","answers","option","correct","isPublic","multipleChoice","quiz","entities","parseMessageInput","correctAnswers","solutionEntities","updateOption","removeOption","handleCorrectOptionChange","handleIsAnonymousChange","handleMultipleAnswersChange","handleQuizModeChange","handleKeyPress","keyCode","getQuestionError","getOptionsError","renderOptions","onKeyPress","renderQuizNoOptionError","hidden","emoji","native","names","IS_EMOJI_SUPPORTED","loading","category","allEmojis","useOnIntersect","emojisPerRow","ceil","displayedEmoji","ICONS_BY_CATEGORY","recent","people","nature","foods","activity","places","objects","symbols","flags","categoryIntersections","emojiDataPromise","emojiRawData","emojiData","headerRef","categories","setCategories","setEmojis","activeCategoryIndex","setActiveCategoryIndex","entries","entry","intersectingWithIndexes","newLeft","HEADER_BUTTON_WIDTH","fastSmoothScrollHorizontal","allCategories","themeCategories","unshift","exec","default","uncompressEmoji","ensureEmojiData","selectCategory","categoryEl","handleEmojiSelect","MENU_TRANSITION_DURATION","containerClassName","faded","STICKER_MARGIN","loadAndPlay","onStickerSelect","onStickerUnfave","stickersPerRow","STICKER_SIZE_PICKER","noAnimate","onUnfaveClick","stickerSetIntersections","favorite","recentStickers","favoriteStickers","addedSetIds","shouldPlay","loadRecentStickers","addRecentSticker","activeSetIndex","setActiveSetIndex","sendMessageAction","useSendMessageAction","areAddedLoaded","allSets","noPopulatedSets","set","stickerSetEl","handleStickerSelect","handleStickerUnfave","fullClassName","buttonClassName","gif","videoData","shouldRenderVideo","isVideoReady","preventMessageInputBlurWithBubbling","preload","savedGifs","gifs","saved","canSendGifs","onGifSelect","loadSavedGifs","debounceMs","SymbolMenuTabs","SYMBOL_MENU_TAB_TITLES","SYMBOL_MENU_TAB_ICONS","Emoji","Stickers","GIFs","onRemoveSymbol","onSearchOpen","renderTabButton","handleSearchOpen","isLeftColumnShown","setRecentEmojis","handleMouseEnter","handleMouseLeave","useMouseInside","fastRaf","recentEmojisRef","renderContent","onMouseLeave","noCloseOnBackdrop","noCompact","canAttachMedia","canAttachPolls","onFileSelect","onPollCreate","handleQuickSelect","handleDocumentSelect","autoClose","withAvatar","botCommand","bot","botCommands","handleSendCommand","botId","selectedCommandIndex","prevCommands","renderedCommands","chatBotCommand","forEmoji","clearStickersForEmoji","prevStickers","displayedStickers","onSilentSend","onScheduleSend","listEmojis","usePrevDuringAnimation","handleSelectEmoji","selectedIndex","setItemVisible","thumbUrl","thumbnailDataUrl","decoding","webThumbnail","isForGallery","inlineResult","STICKER_SIZE_INLINE_BOT_RESULT","isGallery","inlineBotResults","switchPm","onSelectResult","startBot","handleSendPm","startParam","prevInlineBotResults","renderedInlineBotResults","sensitiveArea","inlineBotResult","selectedSendAsId","sendAsIds","saveDefaultSendAs","markMouseInside","sendAsId","selectedSendAsIndex","messagesById","viewportResults","senderUser","senderChat","forwardInfo","isChannelPost","foundResult","isOnTop","preloadBackwards","teactOrderKey","LastMessageMeta","selectShouldLoopStickers","isSomeModalOpen","onModalToggle","isAdded","areStickersLoaded","useOnChange","coverStickerIds","covers","otherStickers","handleAddClick","canRenderStickers","STICKER_SIZE_SEARCH","selectCurrentStickerSearch","resultIds","featured","featuredIds","loadFeaturedStickers","setIsModalOpen","selectCurrentGifSearch","isChatWithBot","selectIsChatWithBot","searchMoreGifs","setGifSearchQuery","handleGifClick","hasResults","answer","voters","offsets","pollResults","answerVote","totalVoters","loadPollOptionResults","closePollResults","prevVotersCount","votersCount","setIsLoading","areVotersLoaded","limit","shouldResetVoters","handleViewMoreClick","handleMemberClick","leftVotersCount","renderViewMoreButton","total","getMessagePoll","resultsByOption","buildCollectionByKey","management","updateContact","deleteContact","closeManagement","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","isNotificationsEnabled","setIsNotificationsEnabled","ManagementProgress","handleNotificationChange","handleDeleteContact","withFullInfo","GROUP_TITLE_EMPTY","hasLinkedChannel","isBasicGroup","invites","canChangeInfo","isCreator","getHasAdminRight","canBanUsers","canInvite","exportedInvites","availableReactionsCount","togglePreHistoryHidden","updateChat","deleteChat","leaveChannel","deleteChannel","loadExportedChatInvites","loadChatJoinRequests","currentTitle","currentAbout","imageHash","isPublicGroup","isRevoked","handleClickEditType","ManagementScreens","handleClickDiscussion","handleClickReactions","handleClickPermissions","handleClickAdministrators","handleSetPhoto","handleAboutChange","handleUpdateGroup","trimmedTitle","trimmedAbout","handleClickMembers","handleTogglePreHistory","isPreHistoryHidden","isEnabled","enabledReactionsCount","enabledPermissionsCount","defaultBannedRights","sendStickers","sendGifs","adminsCount","adminMembers","handleDeleteGroup","formatInteger","joinRequests","onChatMemberSelect","updateChatDefaultBannedRights","permissions","setPermissions","havePermissionChanged","setHavePermissionChanged","handleRemovedUsersClick","handleAddExceptionClick","handleExceptionMemberClick","promotedByUserId","handlePermissionChange","getUpdatedPermissionValue","handleSavePermissions","bannedRights","removedUsersCount","kickedMembers","exceptionMembers","members","getMemberExceptions","langKey","getLangKeyForBannedRightKey","translatedString","sendMessages","blocking","sendMedia","sendPolls","embedLinks","inviteUsers","pinMessages","changeInfo","loadMoreMembers","deleteChatMember","usersId","availableMemberIds","acc","isAdmin","isOwner","canDeleteMembers","updateChatMemberBannedRights","isRemoveUserModalOpen","openRemoveUserModal","closeRemoveUserModal","removedMembers","getRemovedBy","kickedByUserId","kickedByUser","getContextActions","CHANNEL_TITLE_EMPTY","isSignaturesShown","toggleSignatures","handleUpdateChannel","handleToggleSignatures","handleClickSubscribers","handleDeleteChannel","selectManagement","checkPublicLink","updatePublicLink","updatePrivateLink","toggleIsProtected","privateLink","inviteLink","privacyType","setPrivacyType","isRevokeConfirmDialogOpen","openRevokeConfirmDialog","closeRevokeConfirmDialog","canUpdate","handleOptionChange","handleForwardingOptionChange","handleSave","handleRevokePrivateLink","langPrefix1","langPrefix2","forwardingOptions","SafeLink","forDiscussionIds","linkedChat","loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup","linkedGroupId","setLinkedGroupId","isConfirmUnlinkGroupDialogOpen","openConfirmUnlinkGroupDialog","closeConfirmUnlinkGroupDialog","isConfirmLinkGroupDialogOpen","openConfirmLinkGroupDialog","closeConfirmLinkGroupDialog","handleUnlinkGroupSessions","channelId","handleLinkGroupSessions","STICKER_SIZE_DISCUSSION_GROUPS","teactFastList","linkedGroup","renderLinkGroupHeader","hasPrivateLink","renderLinkGroupConfirmText","isButtonsInOneRow","isPromotedByCurrentUser","isFormFullyDisabled","selectedChatMemberId","isBanConfirmationDialogOpen","openBanConfirmationDialog","closeBanConfirmationDialog","selectedChatMember","handleBanFromGroup","viewMessages","getControlIsDisabled","handleAdminMemberClick","handleAddAdminClick","getMemberStatus","promotedByUser","defaultRights","adminRights","isNewAdmin","selectedUserId","updateChatAdmin","setIsTouched","isDismissConfirmationDialogOpen","openDismissConfirmationDialog","closeDismissConfirmationDialog","customTitle","setCustomTitle","selectedAdminMember","handleDismissAdmin","memberStatus","handleCustomTitleChange","postMessages","editMessages","banUsers","addAdmins","manageCall","anonymous","maxLength","noAdmins","adminIds","shouldUseSearchResults","listedIds","noScrollRestore","memberId","inviteComparator","i1","i2","isPermanent","i1IsPermanent","usage","i1Usage","i1Date","i2IsPermanent","i2Usage","i2Date","revokedInvites","revokedExportedInvites","setEditingExportedInvite","editExportedChatInvite","deleteExportedChatInvite","deleteRevokedExportedChatInvites","setOpenedInviteInfo","isDeleteRevokeAllDialogOpen","openDeleteRevokeAllDialog","closeDeleteRevokeAllDialog","isRevokeDialogOpen","openRevokeDialog","closeRevokeDialog","revokingInvite","setRevokingInvite","deletingInvite","setDeletingInvite","hasDetailedCountdown","expireDate","getServerTime","MILLISECONDS_IN_DAY","useInterval","primaryInvite","primaryInviteLink","link","temporalInvites","revokeInvite","usageLimit","askToRevoke","handleRevoke","handleCreateNewClick","handlePrimaryRevoke","handleDeleteAllRevoked","showInviteInfo","deleteInvite","askToDelete","copyLink","handleCopyPrimaryClicked","prepareUsageText","requested","diff","formatCountdown","prepareContextActions","actions","editInvite","PrimaryLinkMenuButton","STICKER_SIZE_INVITES","secondaryIcon","DEFAULT_USAGE_LIMITS","DEFAULT_EXPIRE_DATE","hour","week","DEFAULT_CUSTOM_EXPIRE_DATE","editingInvite","exportChatInvite","isCalendarOpened","setIsRequestNeeded","customExpireDate","setCustomExpireDate","selectedExpireOption","setSelectedExpireOption","customUsageLimit","setCustomUsageLimit","selectedUsageOption","setSelectedUsageOption","isSubmitBlocked","setIsSubmitBlocked","oldEditingInvite","editingTitle","editingIsRequestNeeded","minSafeDate","handleIsRequestChange","handleCustomUsageLimitChange","handleExpireDateChange","handleSaveClick","formatFullDate","n","setChatEnabledReactions","localEnabledReactions","setLocalEnabledReactions","handleSaveReactions","handleReactionChange","newEnabledReactions","inviteInfo","importers","requesters","loadChatInviteImporters","loadChatInviteRequesters","adminId","isExpired","handleCopyClicked","importer","renderImporters","requester","renderRequesters","hideChatJoinRequest","fixedDate","dateString","isToday","formatHumanDate","handleAcceptRequest","isApproved","handleRejectRequest","hideAllChatJoinRequests","isAcceptAllDialogOpen","openAcceptAllDialog","closeAcceptAllDialog","isRejectAllDialogOpen","openRejectAllDialog","closeRejectAllDialog","handleAcceptAllRequests","handleRejectAllRequests","STICKER_SIZE_JOIN_REQUESTS","managementType","selectCurrentManagementType","VISA","MASTERCARD1","MASTERCARD2","CardType","cards","Default","Visa","Mastercard","detectCardType","cardNumber","formatsCache","defaultPhoneNumberFormat","str","flag","phoneFormat","format","formatValue","phoneNumberFormat","phoneNumberGroups","RegExp","repeat","getPhoneNumberFormat","streetLine1","streetLine2","city","countryIso2","postCode","phone","shipping","cardholder","expiry","cvv","billingCountry","billingZip","saveInfo","saveCredentials","formErrors","reducer","getBillingCountry","countryCode","useFocusAfterAnimation","animationDuration","hasArrow","labelText","htmlFor","needEmail","needPhone","needName","needAddress","phoneRef","selectCountryRef","handleAddress1Change","handleAddress2Change","handleCityChange","handleStateChange","handleCountryChange","handlePostCodeChange","handleFullNameChange","handleEmailChange","handlePhoneChange","handleSaveInfoChange","shippingOptions","currency","handleShippingSelect","amount","formatCurrency","renderPaymentItem","main","renderCheckoutItem","invoiceContent","prices","shippingPrices","checkoutInfo","totalPrice","photoUrl","paymentMethod","paymentProvider","shippingAddress","shippingMethod","expiryInputRef","charAt","parts","formatCardExpiry","cardNumberRef","cardType","setCardType","newCardType","formatCardNumber","cardIcon","mastercardIconPath","visaIconPath","getCardIcon","canSaveCredentials","needCardholderName","needCountry","needZip","handleCardNumberChange","handleCardholderChange","toUpperCase","handleExpiryChange","handleCvvChange","handleBillingPostCodeChange","handleChangeSaveCredentials","allow","sandbox","SUPPORTED_PROVIDERS","savedInfo","invoice","nativeProvider","nativeParams","passwordMissing","confirmPaymentUrl","payment","isProviderError","has","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError","paymentState","paymentDispatch","canRenderFooter","PaymentStep","field","handleErrorModalClose","shippingOption","getShippingPrices","totalPrices","cur","getTotalPrice","detectCardTypeText","findShippingOption","getCheckoutInfo","validateRequest","requestInfo","getRequestInfo","sendCredentials","credentials","expiryMonth","expiryYear","zip","getCredentials","sendForm","shippingOptionId","setStep","nextStep","buttonText","currentStep","renderModalContent","renderError","optionId","receipt","info","totalAmount","credentialsTitle","fullAddress","onInputChange","setPassword","canSubmit","setCanSubmit","select","autoComplete","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","STICKER_SIZE","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","isPeekShown","setIsPeekShown","handleFirstMonkeyLoad","STICKER_SIZE_TWO_FA","playSegment","cropperResultOptions","circle","Croppie","croppiePromise","cropper","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","enableZoom","boundary","viewport","blobToDataUri","bind","err","DEBUG","console","initCropper","ensureCroppie","croppedImg","blobToFile","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","URL","revokeObjectURL","createObjectURL"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"687.2509fbfe3b3556358b45.js","mappings":"q0CA+MA,SAASA,EAAYC,EAAsDC,GACzE,MAAMC,EAAQC,SAASC,cAAc,OACrCF,EAAMG,UAAUC,IAAI,SAEpB,MAAMC,EAAM,IAAIC,MAchB,GAbAD,EAAIE,WAAY,EAChBF,EAAIG,cAAgBC,EAAAA,EAEE,iBAAXX,EACTO,EAAIK,IAAMZ,EACDA,aAAkBa,iBAC3BN,EAAIK,IAAMZ,EAAOc,OAEjBP,EAAIK,IAAMZ,EAAOY,IAGnBV,EAAMa,YAAYR,GAEdN,IAAWe,EAAAA,GAAAA,eAAmCf,IAAWe,EAAAA,GAAAA,eAAkC,CAC7Fd,EAAMG,UAAUC,IAAI,eAChBL,IAAWe,EAAAA,GAAAA,gBACbd,EAAMG,UAAUC,IAAI,QAEtB,MAAMW,EAAcd,SAASe,cAC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A,EAAAA,OACjC03F,EAAgBC,IAAqB33F,EAAAA,EAAAA,IAA6BulC,IAEzEtlC,EAAAA,EAAAA,KAAU,KACR03F,EAAkBpyD,KACjB,CAACA,IA2BJ,MAAMqyD,GAAiB/2F,EAAAA,EAAAA,GACrB62F,GAAkB,SAClBr/E,GAAY,YAGd,OACE,0BAAK3Z,UAAU,kBACb,4BACEA,UAAWk5F,EACX7rE,KAAK,SACLC,SAAU,EACV3G,MAAOA,GAEP,4BACE9M,KAAK,OACLC,SAxCR,SAA0BtH,GACxB,MAAMvJ,EAASuJ,EAAMvJ,OAEhBA,GAAWA,EAAOuuC,OAAUvuC,EAAOuuC,MAAM,KAI9CuhD,EAAgB9vF,EAAOuuC,MAAM,IAC7BvuC,EAAO+G,MAAQ,KAiCTgkC,OAAO,0BAET,wBAAGh0C,UAAU,oBACZg5F,GAAkB,0BAAKv9F,IAAKu9F,EAAgBpqF,IAAI,YAEnD,mBAAC,EAAD,CAAWu1D,KAAM20B,EAAcxyF,QAzBnC,WACEyyF,OAAgB94F,IAwB4C6Z,SAnC9D,SAA0B8+E,GACxBG,OAAgB94F,GAChB6Z,EAAS8+E,GAELI,GACFG,IAAIC,gBAAgBJ,GAEtBC,EAAkBE,IAAIE,gBAAgBT,Y","sources":["webpack://telegram-t/./src/components/mediaViewer/helpers/ghostAnimation.ts","webpack://telegram-t/./src/components/mediaViewer/MediaViewerActions.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerFooter.tsx","webpack://telegram-t/./src/hooks/useFullscreen.ts","webpack://telegram-t/./src/components/mediaViewer/helpers/formatFileSize.ts","webpack://telegram-t/./src/components/mediaViewer/VideoPlayerControls.tsx","webpack://telegram-t/./src/components/mediaViewer/VideoPlayer.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerContent.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerSlides.tsx","webpack://telegram-t/./src/hooks/useTimeout.ts","webpack://telegram-t/./src/components/mediaViewer/PanZoom.tsx","webpack://telegram-t/./src/components/mediaViewer/SenderInfo.tsx","webpack://telegram-t/./src/components/mediaViewer/SlideTransition.tsx","webpack://telegram-t/./src/components/mediaViewer/ZoomControls.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.tsx","webpack://telegram-t/./src/components/common/ChatOrUserPicker.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.tsx","webpack://telegram-t/./src/components/main/Dialogs.tsx","webpack://telegram-t/./src/components/main/Notifications.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.tsx","webpack://telegram-t/./src/components/common/CalendarModal.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.tsx","webpack://telegram-t/./src/components/common/DeleteMessageModal.tsx","webpack://telegram-t/./src/components/common/PinMessageModal.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.tsx","webpack://telegram-t/./src/components/middle/hooks/useCopySelectedMessages.ts","webpack://telegram-t/./src/components/middle/DeleteSelectedMessageModal.tsx","webpack://telegram-t/./src/components/common/ReportMessageModal.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.tsx","webpack://telegram-t/./src/components/common/SeenByModal.tsx","webpack://telegram-t/./src/components/middle/ReactorListModal.tsx","webpack://telegram-t/./src/components/middle/EmojiInteractionAnimation.tsx","webpack://telegram-t/./src/hooks/useSelectWithEnter.ts","webpack://telegram-t/./src/components/left/search/LeftSearchResultChat.tsx","webpack://telegram-t/./src/components/left/search/RecentContacts.tsx","webpack://telegram-t/./src/components/left/search/ChatMessage.tsx","webpack://telegram-t/./src/components/left/search/DateSuggest.tsx","webpack://telegram-t/./src/components/left/search/ChatResults.tsx","webpack://telegram-t/./src/components/left/search/ChatMessageResults.tsx","webpack://telegram-t/./src/components/left/search/helpers/createMapStateToProps.ts","webpack://telegram-t/./src/components/left/search/MediaResults.tsx","webpack://telegram-t/./src/components/left/search/LinkResults.tsx","webpack://telegram-t/./src/components/left/search/FileResults.tsx","webpack://telegram-t/./src/components/left/search/AudioResults.tsx","webpack://telegram-t/./src/components/left/search/LeftSearch.tsx","webpack://telegram-t/./src/hooks/reducers/useTwoFaReducer.ts","webpack://telegram-t/./src/components/left/settings/SettingsHeader.tsx","webpack://telegram-t/./src/components/left/settings/SettingsMain.tsx","webpack://telegram-t/./src/components/common/UsernameInput.tsx","webpack://telegram-t/./src/components/left/settings/SettingsEditProfile.tsx","webpack://telegram-t/./src/components/left/settings/SettingsDataStorage.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersMain.tsx","webpack://telegram-t/./src/components/ui/ShowMoreButton.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersEdit.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatFilters.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFolders.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSetCoverAnimated.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSetCover.tsx","webpack://telegram-t/./src/components/left/settings/SettingsStickerSet.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneral.tsx","webpack://telegram-t/./src/util/systemFilesDialog.ts","webpack://telegram-t/./src/util/colors.ts","webpack://telegram-t/./src/components/left/settings/WallpaperTile.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackground.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackgroundColor.tsx","webpack://telegram-t/./src/components/left/settings/SettingsNotifications.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacy.tsx","webpack://telegram-t/./src/components/left/settings/SettingsLanguage.tsx","webpack://telegram-t/./src/components/left/settings/helper/privacy.ts","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyVisibility.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyActiveSessions.tsx","webpack://telegram-t/./src/components/left/settings/BlockUserModal.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyBlockedUsers.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaStart.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFa.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx","webpack://telegram-t/./src/components/left/settings/SettingsQuickReaction.tsx","webpack://telegram-t/./src/components/left/settings/Settings.tsx","webpack://telegram-t/./src/components/left/main/ContactList.tsx","webpack://telegram-t/./src/components/left/newChat/NewChatStep1.tsx","webpack://telegram-t/./src/components/left/newChat/NewChatStep2.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.tsx","webpack://telegram-t/./src/components/left/ChatFolderModal.tsx","webpack://telegram-t/./src/components/middle/message/helpers/copyOptions.ts","webpack://telegram-t/./src/util/scrollLock.ts","webpack://telegram-t/./src/components/middle/message/ReactionSelectorReaction.tsx","webpack://telegram-t/./src/components/middle/message/ReactionSelector.tsx","webpack://telegram-t/./src/components/middle/message/MessageContextMenu.tsx","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.tsx","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.tsx","webpack://telegram-t/./src/components/middle/MobileSearch.tsx","webpack://telegram-t/./src/util/findInViewport.ts","webpack://telegram-t/./src/util/isFullyVisible.ts","webpack://telegram-t/./src/util/setTooltipItemVisible.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useKeyboardNavigation.ts","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiButton.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiCategory.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiPicker.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSet.tsx","webpack://telegram-t/./src/components/middle/composer/StickerPicker.tsx","webpack://telegram-t/./src/components/common/GifButton.tsx","webpack://telegram-t/./src/components/middle/composer/GifPicker.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenuFooter.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommand.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/BaseResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/MediaResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/ArticleResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/GifResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/StickerResult.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/SendAsMenu.tsx","webpack://telegram-t/./src/components/right/RightSearch.tsx","webpack://telegram-t/./src/components/right/StickerSetResult.tsx","webpack://telegram-t/./src/components/right/StickerSearch.tsx","webpack://telegram-t/./src/components/right/GifSearch.tsx","webpack://telegram-t/./src/components/right/PollAnswerResults.tsx","webpack://telegram-t/./src/components/right/PollResults.tsx","webpack://telegram-t/./src/components/right/management/ManageUser.tsx","webpack://telegram-t/./src/components/right/management/ManageGroup.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupPermissions.tsx","webpack://telegram-t/./src/components/right/management/RemoveGroupUserModal.tsx","webpack://telegram-t/./src/components/right/management/ManageChatRemovedUsers.tsx","webpack://telegram-t/./src/components/right/management/ManageChannel.tsx","webpack://telegram-t/./src/components/right/management/ManageChatPrivacyType.tsx","webpack://telegram-t/./src/components/right/management/ManageDiscussion.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupUserPermissions.tsx","webpack://telegram-t/./src/components/right/management/ManageChatAdministrators.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupRecentActions.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupAdminRights.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupMembers.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupUserPermissionsCreate.tsx","webpack://telegram-t/./src/components/right/management/ManageInvites.tsx","webpack://telegram-t/./src/components/right/management/ManageInvite.tsx","webpack://telegram-t/./src/components/right/management/ManageReactions.tsx","webpack://telegram-t/./src/components/right/management/ManageInviteInfo.tsx","webpack://telegram-t/./src/components/right/management/JoinRequest.tsx","webpack://telegram-t/./src/components/right/management/ManageJoinRequests.tsx","webpack://telegram-t/./src/components/right/management/Management.tsx","webpack://telegram-t/./src/components/common/helpers/detectCardType.ts","webpack://telegram-t/./src/util/countries.ts","webpack://telegram-t/./src/hooks/reducers/usePaymentReducer.ts","webpack://telegram-t/./src/hooks/useFocusAfterAnimation.tsx","webpack://telegram-t/./src/components/ui/Select.tsx","webpack://telegram-t/./src/components/payment/ShippingInfo.tsx","webpack://telegram-t/./src/components/payment/Shipping.tsx","webpack://telegram-t/./src/components/payment/Checkout.tsx","webpack://telegram-t/./src/components/payment/ExpiryInput.tsx","webpack://telegram-t/./src/components/middle/helpers/inputFormatters.ts","webpack://telegram-t/./src/components/payment/CardInput.tsx","webpack://telegram-t/./src/components/payment/PaymentInfo.tsx","webpack://telegram-t/./src/components/payment/ConfirmPayment.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.tsx","webpack://telegram-t/./src/components/common/PasswordForm.tsx","webpack://telegram-t/./src/components/common/PasswordMonkey.tsx","webpack://telegram-t/./src/components/ui/CropModal.tsx","webpack://telegram-t/./src/components/ui/AvatarEditable.tsx"],"sourcesContent":["import { ApiMessage, ApiDimensions } from '../../../api/types';\n\nimport { MediaViewerOrigin } from '../../../types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport {\n calculateDimensions,\n getMediaViewerAvailableDimensions,\n MEDIA_VIEWER_MEDIA_QUERY,\n REM,\n} from '../../common/helpers/mediaDimensions';\nimport windowSize from '../../../util/windowSize';\nimport stopEvent from '../../../util/stopEvent';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\n\nconst ANIMATION_DURATION = 200;\n\nexport function animateOpening(\n hasFooter: boolean,\n origin: MediaViewerOrigin,\n bestImageData: string,\n dimensions: ApiDimensions,\n isVideo: boolean,\n message?: ApiMessage,\n) {\n const { mediaEl: fromImage } = getNodes(origin, message);\n if (!fromImage) {\n return;\n }\n\n const { width: windowWidth } = windowSize.get();\n const {\n width: availableWidth, height: availableHeight,\n } = getMediaViewerAvailableDimensions(hasFooter, isVideo);\n const { width: toWidth, height: toHeight } = calculateDimensions(\n availableWidth, availableHeight, dimensions.width, dimensions.height,\n );\n const toLeft = (windowWidth - toWidth) / 2;\n const toTop = getTopOffset(hasFooter) + (availableHeight - toHeight) / 2;\n\n let {\n top: fromTop, left: fromLeft, width: fromWidth, height: fromHeight,\n } = fromImage.getBoundingClientRect();\n\n if ([\n MediaViewerOrigin.SharedMedia,\n MediaViewerOrigin.Album,\n MediaViewerOrigin.ScheduledAlbum,\n MediaViewerOrigin.SearchResult,\n ].includes(origin)) {\n const uncovered = uncover(toWidth, toHeight, fromTop, fromLeft, fromWidth, fromHeight);\n fromTop = uncovered.top;\n fromLeft = uncovered.left;\n fromWidth = uncovered.width;\n fromHeight = uncovered.height;\n }\n\n const fromTranslateX = (fromLeft + fromWidth / 2) - (toLeft + toWidth / 2);\n const fromTranslateY = (fromTop + fromHeight / 2) - (toTop + toHeight / 2);\n const fromScaleX = fromWidth / toWidth;\n const fromScaleY = fromHeight / toHeight;\n\n const ghost = createGhost(bestImageData || fromImage);\n applyStyles(ghost, {\n top: `${toTop}px`,\n left: `${toLeft}px`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n transform: `translate3d(${fromTranslateX}px, ${fromTranslateY}px, 0) scale(${fromScaleX}, ${fromScaleY})`,\n });\n applyShape(ghost, origin);\n\n document.body.classList.add('ghost-animating');\n\n requestAnimationFrame(() => {\n document.body.appendChild(ghost);\n\n requestAnimationFrame(() => {\n ghost.style.transform = '';\n clearShape(ghost);\n\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (document.body.contains(ghost)) {\n document.body.removeChild(ghost);\n }\n document.body.classList.remove('ghost-animating');\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n });\n });\n}\n\nexport function animateClosing(origin: MediaViewerOrigin, bestImageData: string, message?: ApiMessage) {\n const { container, mediaEl: toImage } = getNodes(origin, message);\n if (!toImage) {\n return;\n }\n\n const fromImage = document.getElementById('MediaViewer')!.querySelector(\n '.MediaViewerSlide--active img, .MediaViewerSlide--active video',\n );\n if (!fromImage || !toImage) {\n return;\n }\n\n const {\n top: fromTop, left: fromLeft, width: fromWidth, height: fromHeight,\n } = fromImage.getBoundingClientRect();\n const {\n top: targetTop, left: toLeft, width: toWidth, height: toHeight,\n } = toImage.getBoundingClientRect();\n\n let toTop = targetTop;\n if (!isElementInViewport(container)) {\n const { height: windowHeight } = windowSize.get();\n toTop = targetTop < fromTop ? -toHeight : windowHeight;\n }\n\n const fromTranslateX = (fromLeft + fromWidth / 2) - (toLeft + toWidth / 2);\n const fromTranslateY = (fromTop + fromHeight / 2) - (toTop + toHeight / 2);\n let fromScaleX = fromWidth / toWidth;\n let fromScaleY = fromHeight / toHeight;\n\n const shouldFadeOut = (\n [MediaViewerOrigin.Inline, MediaViewerOrigin.ScheduledInline].includes(origin)\n && !isMessageImageFullyVisible(container, toImage)\n ) || (\n [MediaViewerOrigin.Album, MediaViewerOrigin.ScheduledAlbum].includes(origin)\n && !isMessageImageFullyVisible(container, toImage)\n );\n\n if ([\n MediaViewerOrigin.SharedMedia,\n MediaViewerOrigin.Album,\n MediaViewerOrigin.ScheduledAlbum,\n MediaViewerOrigin.SearchResult,\n ].includes(origin)) {\n if (fromScaleX > fromScaleY) {\n fromScaleX = fromScaleY;\n } else if (fromScaleY > fromScaleX) {\n fromScaleY = fromScaleX;\n }\n }\n\n const existingGhost = document.getElementsByClassName('ghost')[0] as HTMLDivElement;\n\n const ghost = existingGhost || createGhost(bestImageData || toImage, origin);\n if (!existingGhost) {\n applyStyles(ghost, {\n top: `${toTop}px`,\n left: `${toLeft}px`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n transform: `translate3d(${fromTranslateX}px, ${fromTranslateY}px, 0) scale(${fromScaleX}, ${fromScaleY})`,\n });\n }\n\n requestAnimationFrame(() => {\n if (existingGhost) {\n const {\n top,\n left,\n width,\n height,\n } = existingGhost.getBoundingClientRect();\n const scaleX = width / toWidth;\n const scaleY = height / toHeight;\n\n applyStyles(ghost, {\n transition: 'none',\n top: `${toTop}px`,\n left: `${toLeft}px`,\n transformOrigin: 'top left',\n transform: `translate3d(${left - toLeft}px, ${top - toTop}px, 0) scale(${scaleX}, ${scaleY})`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n });\n }\n document.body.classList.add('ghost-animating');\n if (!existingGhost) document.body.appendChild(ghost);\n\n requestAnimationFrame(() => {\n if (existingGhost) {\n existingGhost.style.transition = '';\n }\n\n ghost.style.transform = '';\n\n if (shouldFadeOut) {\n ghost.style.opacity = '0';\n }\n\n applyShape(ghost, origin);\n\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (document.body.contains(ghost)) {\n document.body.removeChild(ghost);\n }\n document.body.classList.remove('ghost-animating');\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n });\n });\n}\n\nfunction createGhost(source: string | HTMLImageElement | HTMLVideoElement, origin?: MediaViewerOrigin) {\n const ghost = document.createElement('div');\n ghost.classList.add('ghost');\n\n const img = new Image();\n img.draggable = false;\n img.oncontextmenu = stopEvent;\n\n if (typeof source === 'string') {\n img.src = source;\n } else if (source instanceof HTMLVideoElement) {\n img.src = source.poster;\n } else {\n img.src = source.src;\n }\n\n ghost.appendChild(img);\n\n if (origin === MediaViewerOrigin.ProfileAvatar || origin === MediaViewerOrigin.SettingsAvatar) {\n ghost.classList.add('ProfileInfo');\n if (origin === MediaViewerOrigin.SettingsAvatar) {\n ghost.classList.add('self');\n }\n const profileInfo = document.querySelector(\n origin === MediaViewerOrigin.ProfileAvatar\n ? '#RightColumn .ProfileInfo .info'\n : '#Settings .ProfileInfo .info',\n );\n if (profileInfo) {\n ghost.appendChild(profileInfo.cloneNode(true));\n }\n }\n\n return ghost;\n}\n\nfunction uncover(realWidth: number, realHeight: number, top: number, left: number, width: number, height: number) {\n if (realWidth === realHeight) {\n const size = Math.max(width, height) * (realWidth / realHeight);\n left -= (size - width) / 2;\n top -= (size - height) / 2;\n width = size;\n height = size;\n } else if (realWidth > realHeight) {\n const srcWidth = width;\n width = height * (realWidth / realHeight);\n left -= (width - srcWidth) / 2;\n } else if (realHeight > realWidth) {\n const srcHeight = height;\n height = width * (realHeight / realWidth);\n top -= (height - srcHeight) / 2;\n }\n\n return {\n top, left, width, height,\n };\n}\n\nfunction isElementInViewport(el: HTMLElement) {\n if (el.style.display === 'none') {\n return false;\n }\n\n const rect = el.getBoundingClientRect();\n const { height: windowHeight } = windowSize.get();\n\n return (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);\n}\n\nfunction isMessageImageFullyVisible(container: HTMLElement, imageEl: HTMLElement) {\n const messageListElement = document.querySelector('.Transition__slide--active > .MessageList')!;\n let imgOffsetTop = container.offsetTop + imageEl.closest('.content-inner, .WebPage')!.offsetTop;\n if (container.id.includes('album-media-')) {\n imgOffsetTop += container.parentElement!.offsetTop + container.closest('.Message')!.offsetTop;\n }\n\n return imgOffsetTop > messageListElement.scrollTop\n && imgOffsetTop + imageEl.offsetHeight < messageListElement.scrollTop + messageListElement.offsetHeight;\n}\n\nfunction getTopOffset(hasFooter: boolean) {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n let topOffsetRem = 4.125;\n if (hasFooter && !IS_TOUCH_ENV) {\n topOffsetRem += mql.matches ? 0.875 : 2.125;\n }\n\n return topOffsetRem * REM;\n}\n\nfunction applyStyles(element: HTMLElement, styles: Record) {\n Object.assign(element.style, styles);\n}\n\nfunction getNodes(origin: MediaViewerOrigin, message?: ApiMessage) {\n let containerSelector;\n let mediaSelector;\n\n switch (origin) {\n case MediaViewerOrigin.Album:\n case MediaViewerOrigin.ScheduledAlbum:\n containerSelector = `.Transition__slide--active > .MessageList #album-media-${message!.id}`;\n mediaSelector = '.full-media';\n break;\n\n case MediaViewerOrigin.SharedMedia:\n containerSelector = `#shared-media${message!.id}`;\n mediaSelector = 'img';\n break;\n\n case MediaViewerOrigin.SearchResult:\n containerSelector = `#search-media${message!.id}`;\n mediaSelector = 'img';\n break;\n\n case MediaViewerOrigin.MiddleHeaderAvatar:\n containerSelector = '.MiddleHeader .Transition__slide--active .ChatInfo .Avatar';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.SettingsAvatar:\n containerSelector = '#Settings .ProfileInfo .Transition__slide--active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ProfileAvatar:\n containerSelector = '#RightColumn .ProfileInfo .Transition__slide--active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ScheduledInline:\n case MediaViewerOrigin.Inline:\n default:\n containerSelector = `.Transition__slide--active > .MessageList #message${message!.id}`;\n mediaSelector = '.message-content .full-media, .message-content .thumbnail';\n }\n\n const container = document.querySelector(containerSelector)!;\n const mediaEls = container && container.querySelectorAll(mediaSelector);\n\n return {\n container,\n mediaEl: mediaEls?.[mediaEls.length - 1],\n };\n}\n\nfunction applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {\n switch (origin) {\n case MediaViewerOrigin.Album:\n case MediaViewerOrigin.ScheduledAlbum:\n case MediaViewerOrigin.Inline:\n case MediaViewerOrigin.ScheduledInline:\n ghost.classList.add('rounded-corners');\n break;\n\n case MediaViewerOrigin.SharedMedia:\n case MediaViewerOrigin.SettingsAvatar:\n case MediaViewerOrigin.ProfileAvatar:\n case MediaViewerOrigin.SearchResult:\n (ghost.firstChild as HTMLElement).style.objectFit = 'cover';\n break;\n\n case MediaViewerOrigin.MiddleHeaderAvatar:\n ghost.classList.add('circle');\n break;\n }\n}\n\nfunction clearShape(ghost: HTMLDivElement) {\n (ghost.firstChild as HTMLElement).style.objectFit = 'default';\n ghost.classList.remove('rounded-corners', 'circle');\n}\n","import React, {\n FC,\n memo,\n useCallback,\n useMemo,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { getMessageMediaHash } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport { selectIsDownloading, selectIsMessageProtected } from '../../modules/selectors';\n\nimport Button from '../ui/Button';\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport ProgressSpinner from '../ui/ProgressSpinner';\n\nimport './MediaViewerActions.scss';\n\ntype StateProps = {\n isDownloading: boolean;\n isProtected?: boolean;\n};\n\ntype OwnProps = {\n mediaData?: string;\n isVideo: boolean;\n isZoomed: boolean;\n message?: ApiMessage;\n fileName?: string;\n isAvatar?: boolean;\n onCloseMediaViewer: NoneToVoidFunction;\n onForward: NoneToVoidFunction;\n onZoomToggle: NoneToVoidFunction;\n};\n\nconst MediaViewerActions: FC = ({\n mediaData,\n isVideo,\n isZoomed,\n message,\n fileName,\n isAvatar,\n isDownloading,\n isProtected,\n onCloseMediaViewer,\n onForward,\n onZoomToggle,\n}) => {\n const {\n downloadMessageMedia,\n cancelMessageMediaDownload,\n } = getDispatch();\n\n const { loadProgress: downloadProgress } = useMediaWithLoadProgress(\n message && getMessageMediaHash(message, 'download'),\n !isDownloading,\n );\n\n const handleDownloadClick = useCallback(() => {\n if (isDownloading) {\n cancelMessageMediaDownload({ message });\n } else {\n downloadMessageMedia({ message });\n }\n }, [cancelMessageMediaDownload, downloadMessageMedia, isDownloading, message]);\n\n const lang = useLang();\n\n const MenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n function renderDownloadButton() {\n if (isProtected) {\n return undefined;\n }\n\n return isVideo ? (\n \n {isDownloading ? (\n \n ) : (\n \n )}\n \n ) : (\n \n \n \n );\n }\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n if (isProtected) {\n return undefined;\n }\n\n return (\n
\n \n {!isAvatar && (\n \n {lang('Forward')}\n \n )}\n {isVideo ? (\n \n {isDownloading ? `${Math.round(downloadProgress * 100)}% Downloading...` : 'Download'}\n \n ) : (\n \n {lang('AccActionDownload')}\n \n )}\n \n {isDownloading && }\n
\n );\n }\n\n return (\n
\n {!isAvatar && !isProtected && (\n <>\n \n \n \n \n )}\n {renderDownloadButton()}\n \n \n \n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message }): StateProps => {\n const isDownloading = message ? selectIsDownloading(global, message) : false;\n const isProtected = selectIsMessageProtected(global, message);\n\n return {\n isDownloading,\n isProtected,\n };\n },\n)(MediaViewerActions));\n","import React, { FC, useEffect, useState } from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { throttle } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport { REM } from '../common/helpers/mediaDimensions';\n\nimport './MediaViewerFooter.scss';\n\nconst RESIZE_THROTTLE_MS = 500;\n\ntype OwnProps = {\n text: TextPart | TextPart[];\n onClick: () => void;\n isHidden?: boolean;\n isForVideo: boolean;\n};\n\nconst MediaViewerFooter: FC = ({\n text = '', isHidden, isForVideo, onClick,\n}) => {\n const [isMultiline, setIsMultiline] = useState(false);\n useEffect(() => {\n const footerContent = document.querySelector('.MediaViewerFooter .media-text') as HTMLDivElement | null;\n\n const checkIsMultiline = () => {\n const height = footerContent ? footerContent.clientHeight : 0;\n\n setIsMultiline(height > REM * 2);\n };\n\n // First run for initial detection of multiline footer text\n checkIsMultiline();\n\n const handleResize = throttle(checkIsMultiline, RESIZE_THROTTLE_MS, true);\n\n window.addEventListener('resize', handleResize, false);\n\n return () => {\n window.removeEventListener('resize', handleResize, false);\n };\n }, []);\n\n function stopEvent(e: React.MouseEvent) {\n if (text) {\n e.stopPropagation();\n }\n }\n\n const classNames = buildClassName(\n 'MediaViewerFooter',\n isForVideo && 'is-for-video',\n isHidden && 'is-hidden',\n );\n\n return (\n
\n {text && (\n
\n

{text}

\n
\n )}\n
\n );\n};\n\nexport default MediaViewerFooter;\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\nimport { PLATFORM_ENV } from '../util/environment';\n\ntype RefType = {\n current: HTMLElement | null;\n};\n\ntype ReturnType = [boolean, () => void, () => void] | [false];\ntype CallbackType = (isPlayed: boolean) => void;\n\nconst prop = getBrowserFullscreenElementProp();\n\nexport default function useFullscreenStatus(elRef: RefType, setIsPlayed: CallbackType): ReturnType {\n const [isFullscreen, setIsFullscreen] = useState(Boolean(prop && document[prop]));\n\n const setFullscreen = () => {\n if (!elRef.current || !(prop || PLATFORM_ENV === 'iOS')) {\n return;\n }\n\n if (elRef.current.requestFullscreen) {\n elRef.current.requestFullscreen();\n } else if (elRef.current.webkitRequestFullscreen) {\n elRef.current.webkitRequestFullscreen();\n } else if (elRef.current.webkitEnterFullscreen) {\n elRef.current.webkitEnterFullscreen();\n } else if (elRef.current.mozRequestFullScreen) {\n elRef.current.mozRequestFullScreen();\n }\n\n setIsFullscreen(true);\n };\n\n const exitFullscreen = () => {\n if (!elRef.current) {\n return;\n }\n\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n\n setIsFullscreen(false);\n };\n\n useLayoutEffect(() => {\n const listener = () => { setIsFullscreen(Boolean(prop && document[prop])); };\n const listenerEnter = () => { setIsFullscreen(true); };\n const listenerExit = () => {\n setIsFullscreen(false);\n setIsPlayed(false);\n };\n const video = elRef.current;\n\n document.addEventListener('fullscreenchange', listener, false);\n document.addEventListener('webkitfullscreenchange', listener, false);\n document.addEventListener('mozfullscreenchange', listener, false);\n\n if (video) {\n video.addEventListener('webkitbeginfullscreen', listenerEnter, false);\n video.addEventListener('webkitendfullscreen', listenerExit, false);\n }\n\n return () => {\n document.removeEventListener('fullscreenchange', listener, false);\n document.removeEventListener('webkitfullscreenchange', listener, false);\n document.removeEventListener('mozfullscreenchange', listener, false);\n if (video) {\n video.removeEventListener('webkitbeginfullscreen', listenerEnter, false);\n video.removeEventListener('webkitendfullscreen', listenerExit, false);\n }\n };\n // eslint-disable-next-line\n }, []);\n\n if (!prop && PLATFORM_ENV !== 'iOS') {\n return [false];\n }\n\n return [isFullscreen, setFullscreen, exitFullscreen];\n}\n\nfunction getBrowserFullscreenElementProp() {\n if (typeof document.fullscreenElement !== 'undefined') {\n return 'fullscreenElement';\n } else if (typeof document.mozFullScreenElement !== 'undefined') {\n return 'mozFullScreenElement';\n } else if (typeof document.webkitFullscreenElement !== 'undefined') {\n return 'webkitFullscreenElement';\n }\n\n return '';\n}\n","const units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'];\n\nconst formatFileSize = (bytes: number) => {\n const number = bytes === 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024));\n\n return `${(bytes / 1024 ** Math.floor(number)).toFixed(1)} ${units[number]}`;\n};\n\nexport default formatFileSize;\n","import React, {\n FC, useEffect, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport buildClassName from '../../util/buildClassName';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport formatFileSize from './helpers/formatFileSize';\nimport useLang from '../../hooks/useLang';\nimport { captureEvents } from '../../util/captureEvents';\n\nimport Button from '../ui/Button';\n\nimport './VideoPlayerControls.scss';\n\ntype IProps = {\n bufferedProgress: number;\n currentTime: number;\n duration: number;\n fileSize: number;\n isForceMobileVersion?: boolean;\n isPlayed: boolean;\n isFullscreenSupported: boolean;\n isFullscreen: boolean;\n onChangeFullscreen: (e: React.MouseEvent) => void;\n onPlayPause: (e: React.MouseEvent) => void;\n isVisible: boolean;\n setVisibility: (isVisible: boolean) => void;\n onSeek: (position: number) => void;\n};\n\nconst stopEvent = (e: React.MouseEvent) => {\n e.stopPropagation();\n};\n\nconst HIDE_CONTROLS_TIMEOUT_MS = 1500;\n\nconst VideoPlayerControls: FC = ({\n bufferedProgress,\n currentTime,\n duration,\n fileSize,\n isForceMobileVersion,\n isPlayed,\n isFullscreenSupported,\n isFullscreen,\n onChangeFullscreen,\n onPlayPause,\n isVisible,\n setVisibility,\n onSeek,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const seekerRef = useRef(null);\n const isSeeking = useRef(false);\n\n\n useEffect(() => {\n let timeout: number | undefined;\n if (!isVisible || !isPlayed) {\n if (timeout) window.clearTimeout(timeout);\n return;\n }\n timeout = window.setTimeout(() => {\n setVisibility(false);\n }, HIDE_CONTROLS_TIMEOUT_MS);\n return () => {\n if (timeout) window.clearTimeout(timeout);\n };\n }, [isPlayed, isVisible, setVisibility]);\n\n useEffect(() => {\n if (isVisible) {\n document.body.classList.add('video-controls-visible');\n } else {\n document.body.classList.remove('video-controls-visible');\n }\n return () => {\n document.body.classList.remove('video-controls-visible');\n };\n }, [isVisible]);\n\n const lang = useLang();\n\n const handleSeek = useCallback((e: MouseEvent | TouchEvent) => {\n if (isSeeking.current && seekerRef.current) {\n const {\n width,\n left,\n } = seekerRef.current.getBoundingClientRect();\n const clientX = e instanceof MouseEvent ? e.clientX : e.targetTouches[0].clientX;\n onSeek(Math.max(Math.min(duration * ((clientX - left) / width), duration), 0));\n }\n }, [duration, onSeek]);\n\n const handleStartSeek = useCallback((e: MouseEvent | TouchEvent) => {\n isSeeking.current = true;\n handleSeek(e);\n }, [handleSeek]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n }, []);\n\n useEffect(() => {\n if (!seekerRef.current || !isVisible) return undefined;\n return captureEvents(seekerRef.current, {\n onCapture: handleStartSeek,\n onRelease: handleStopSeek,\n onClick: handleStopSeek,\n onDrag: handleSeek,\n });\n }, [isVisible, handleStartSeek, handleSeek, handleStopSeek]);\n\n\n return (\n \n {renderSeekLine(currentTime, duration, bufferedProgress, seekerRef)}\n \n \n \n {renderTime(currentTime, duration)}\n {bufferedProgress < 1 && renderFileSize(bufferedProgress, fileSize)}\n {isFullscreenSupported && (\n \n \n \n )}\n
\n );\n};\n\nfunction renderTime(currentTime: number, duration: number) {\n return (\n
\n {`${formatMediaDuration(currentTime)} / ${formatMediaDuration(duration)}`}\n
\n );\n}\n\nfunction renderFileSize(loadedPercent: number, totalSize: number) {\n return (\n
\n {`${formatFileSize(totalSize * loadedPercent)} / ${formatFileSize(totalSize)}`}\n
\n );\n}\n\nfunction renderSeekLine(\n currentTime: number, duration: number, bufferedProgress: number, seekerRef: React.RefObject,\n) {\n const percentagePlayed = (currentTime / duration) * 100;\n const percentageBuffered = bufferedProgress * 100;\n\n return (\n
\n
\n \n \n
\n
\n );\n}\n\nexport default VideoPlayerControls;\n","import { ApiDimensions } from '../../api/types';\nimport useBuffering from '../../hooks/useBuffering';\nimport useFullscreenStatus from '../../hooks/useFullscreen';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport React, { FC, memo, useCallback, useEffect, useRef, useState } from '../../lib/teact/teact';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport safePlay from '../../util/safePlay';\nimport Button from '../ui/Button';\nimport ProgressSpinner from '../ui/ProgressSpinner';\n\nimport './VideoPlayer.scss';\n\nimport VideoPlayerControls from './VideoPlayerControls';\n\ntype OwnProps = {\n url?: string;\n isGif?: boolean;\n posterData?: string;\n posterSize?: ApiDimensions;\n loadProgress?: number;\n fileSize: number;\n isMediaViewerOpen?: boolean;\n noPlay?: boolean;\n areControlsVisible: boolean;\n toggleControls: (isVisible: boolean) => void;\n onClose: (e: React.MouseEvent) => void;\n};\n\nconst MOBILE_VERSION_CONTROL_WIDTH = 400;\n\nconst VideoPlayer: FC = ({\n url,\n isGif,\n posterData,\n posterSize,\n loadProgress,\n fileSize,\n isMediaViewerOpen,\n noPlay,\n onClose,\n toggleControls,\n areControlsVisible,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n const [isPlayed, setIsPlayed] = useState(!IS_TOUCH_ENV || !IS_IOS);\n const [currentTime, setCurrentTime] = useState(0);\n\n const [isFullscreen, setFullscreen, exitFullscreen] = useFullscreenStatus(videoRef, setIsPlayed);\n\n const { isBuffered, bufferedProgress, bufferingHandlers } = useBuffering();\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(!isBuffered, undefined, undefined, 'slow');\n const {\n shouldRender: shouldRenderPlayButton,\n transitionClassNames: playButtonClassNames,\n } = useShowTransition(IS_IOS && !isPlayed && !shouldRenderSpinner, undefined, undefined, 'slow');\n\n useEffect(() => {\n if (noPlay || !isMediaViewerOpen) {\n videoRef.current!.pause();\n } else if (url && !IS_TOUCH_ENV) {\n // Chrome does not automatically start playing when `url` becomes available (even with `autoPlay`),\n // so we force it here. Contrary, iOS does not allow to call `play` without mouse event,\n // so we need to use `autoPlay` instead to allow pre-buffering.\n safePlay(videoRef.current!);\n }\n }, [noPlay, isMediaViewerOpen, url]);\n\n useEffect(() => {\n if (videoRef.current!.currentTime === videoRef.current!.duration) {\n setCurrentTime(0);\n setIsPlayed(false);\n } else {\n setCurrentTime(videoRef.current!.currentTime);\n }\n }, [currentTime]);\n\n const togglePlayState = useCallback((e: React.MouseEvent | KeyboardEvent) => {\n e.stopPropagation();\n if (isPlayed) {\n videoRef.current!.pause();\n setIsPlayed(false);\n } else {\n safePlay(videoRef.current!);\n setIsPlayed(true);\n }\n }, [isPlayed]);\n\n useVideoCleanup(videoRef, []);\n\n const handleMouseMove = useCallback(() => {\n toggleControls(true);\n }, [toggleControls]);\n\n const handleMouseOut = useCallback((e: React.MouseEvent) => {\n if (e.target === videoRef.current) {\n toggleControls(false);\n }\n }, [toggleControls]);\n\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setCurrentTime(e.currentTarget.currentTime);\n }, []);\n\n const handleEnded = useCallback(() => {\n setCurrentTime(0);\n setIsPlayed(false);\n toggleControls(true);\n }, [toggleControls]);\n\n const handleFullscreenChange = useCallback(() => {\n if (isFullscreen && exitFullscreen) {\n exitFullscreen();\n } else if (!isFullscreen && setFullscreen) {\n setFullscreen();\n }\n }, [exitFullscreen, isFullscreen, setFullscreen]);\n\n const handleSeek = useCallback((position: number) => {\n videoRef.current!.currentTime = position;\n }, []);\n\n useEffect(() => {\n const togglePayingStateBySpace = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n togglePlayState(e);\n }\n };\n\n document.addEventListener('keydown', togglePayingStateBySpace, false);\n\n return () => {\n document.removeEventListener('keydown', togglePayingStateBySpace, false);\n };\n }, [togglePlayState]);\n\n const wrapperStyle = posterSize && `width: ${posterSize.width}px; height: ${posterSize.height}px`;\n const videoStyle = `background-image: url(${posterData})`;\n\n return (\n \n \n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n setIsPlayed(true) : undefined}\n onEnded={handleEnded}\n onClick={!IS_SINGLE_COLUMN_LAYOUT ? togglePlayState : undefined}\n onDoubleClick={!IS_TOUCH_ENV ? handleFullscreenChange : undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...bufferingHandlers}\n onTimeUpdate={handleTimeUpdate}\n >\n {url && }\n \n
\n {shouldRenderPlayButton && (\n \n )}\n {shouldRenderSpinner && (\n
\n {!isBuffered &&
Buffering...
}\n \n
\n )}\n {!isGif && !shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(VideoPlayer);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../../api/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport {\n getChatAvatarHash,\n getMessageDocument,\n getMessageFileSize,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport {\n selectChat, selectChatMessage, selectIsMessageProtected, selectScheduledMessage, selectUser,\n} from '../../modules/selectors';\nimport { AVATAR_FULL_DIMENSIONS, calculateMediaViewerDimensions } from '../common/helpers/mediaDimensions';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport stopEvent from '../../util/stopEvent';\n\nimport Spinner from '../ui/Spinner';\nimport MediaViewerFooter from './MediaViewerFooter';\nimport VideoPlayer from './VideoPlayer';\n\nimport './MediaViewerContent.scss';\n\ntype OwnProps = {\n messageId?: number;\n chatId?: string;\n threadId?: number;\n avatarOwnerId?: string;\n profilePhotoIndex?: number;\n origin?: MediaViewerOrigin;\n isActive?: boolean;\n animationLevel: 0 | 1 | 2;\n onClose: () => void;\n onFooterClick: () => void;\n setIsFooterHidden?: (isHidden: boolean) => void;\n isFooterHidden?: boolean;\n};\n\ntype StateProps = {\n chatId?: string;\n messageId?: number;\n senderId?: string;\n threadId?: number;\n avatarOwner?: ApiChat | ApiUser;\n profilePhotoIndex?: number;\n message?: ApiMessage;\n origin?: MediaViewerOrigin;\n isProtected?: boolean;\n};\n\nconst ANIMATION_DURATION = 350;\n\nconst MediaViewerContent: FC = (props) => {\n const {\n messageId,\n isActive,\n avatarOwner,\n chatId,\n message,\n profilePhotoIndex,\n origin,\n animationLevel,\n onClose,\n onFooterClick,\n isFooterHidden,\n isProtected,\n setIsFooterHidden,\n } = props;\n /* Content */\n const photo = message ? getMessagePhoto(message) : undefined;\n const video = message ? getMessageVideo(message) : undefined;\n const webPagePhoto = message ? getMessageWebPagePhoto(message) : undefined;\n const webPageVideo = message ? getMessageWebPageVideo(message) : undefined;\n const isDocumentPhoto = message ? isMessageDocumentPhoto(message) : false;\n const isDocumentVideo = message ? isMessageDocumentVideo(message) : false;\n const isVideo = Boolean(video || webPageVideo || isDocumentVideo);\n const isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const { isGif } = video || webPageVideo || {};\n\n const isOpen = Boolean(avatarOwner || messageId);\n const isAvatar = Boolean(avatarOwner);\n\n const isFromSharedMedia = origin === MediaViewerOrigin.SharedMedia;\n const isFromSearch = origin === MediaViewerOrigin.SearchResult;\n\n const isGhostAnimation = animationLevel === 2;\n\n /* Media data */\n function getMediaHash(isFull?: boolean) {\n if (isAvatar && profilePhotoIndex !== undefined) {\n const { photos } = avatarOwner!;\n return photos && photos[profilePhotoIndex]\n ? `photo${photos[profilePhotoIndex].id}?size=c`\n : getChatAvatarHash(avatarOwner!, isFull ? 'big' : 'normal');\n }\n\n return message && getMessageMediaHash(message, isFull ? 'viewerFull' : 'viewerPreview');\n }\n\n const pictogramBlobUrl = useMedia(\n message && (isFromSharedMedia || isFromSearch) && getMessageMediaHash(message, 'pictogram'),\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const previewMediaHash = getMediaHash();\n const previewBlobUrl = useMedia(\n previewMediaHash,\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const {\n mediaData: fullMediaBlobUrl,\n loadProgress,\n } = useMediaWithLoadProgress(\n getMediaHash(true),\n undefined,\n message && getMessageMediaFormat(message, 'viewerFull'),\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n\n const toggleControls = useCallback((isVisible) => {\n setIsFooterHidden?.(!isVisible);\n }, [setIsFooterHidden]);\n\n const localBlobUrl = (photo || video) ? (photo || video)!.blobUrl : undefined;\n let bestImageData = (!isVideo && (localBlobUrl || fullMediaBlobUrl)) || previewBlobUrl || pictogramBlobUrl;\n const thumbDataUri = useBlurSync(!bestImageData && message && getMessageMediaThumbDataUri(message));\n if (!bestImageData && origin !== MediaViewerOrigin.SearchResult) {\n bestImageData = thumbDataUri;\n }\n\n const videoSize = message ? getMessageFileSize(message) : undefined;\n\n let dimensions!: ApiDimensions;\n if (message) {\n if (isDocumentPhoto || isDocumentVideo) {\n dimensions = getMessageDocument(message)!.mediaSize!;\n } else if (photo || webPagePhoto) {\n dimensions = getPhotoFullDimensions((photo || webPagePhoto)!)!;\n } else if (video || webPageVideo) {\n dimensions = getVideoDimensions((video || webPageVideo)!)!;\n }\n } else {\n dimensions = AVATAR_FULL_DIMENSIONS;\n }\n\n if (isAvatar) {\n return (\n
\n {renderPhoto(\n fullMediaBlobUrl || previewBlobUrl,\n calculateMediaViewerDimensions(AVATAR_FULL_DIMENSIONS, false),\n !IS_SINGLE_COLUMN_LAYOUT && !isProtected,\n )}\n
\n );\n }\n\n if (!message) return undefined;\n const textParts = renderMessageText(message);\n const hasFooter = Boolean(textParts);\n\n return (\n \n {isProtected &&
}\n {isPhoto && renderPhoto(\n localBlobUrl || fullMediaBlobUrl || previewBlobUrl || pictogramBlobUrl,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter),\n !IS_SINGLE_COLUMN_LAYOUT && !isProtected,\n )}\n {isVideo && ((!isActive && IS_TOUCH_ENV) ? renderVideoPreview(\n bestImageData,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter, true),\n !IS_SINGLE_COLUMN_LAYOUT && !isProtected,\n ) : (\n \n ))}\n {textParts && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n } = ownProps;\n\n if (origin === MediaViewerOrigin.SearchResult) {\n if (!(chatId && messageId)) {\n return {};\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n if (!message) {\n return {};\n }\n\n return {\n chatId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n isProtected: selectIsMessageProtected(global, message),\n };\n }\n\n if (avatarOwnerId) {\n const sender = selectUser(global, avatarOwnerId) || selectChat(global, avatarOwnerId);\n\n return {\n messageId: -1,\n senderId: avatarOwnerId,\n avatarOwner: sender,\n profilePhotoIndex: profilePhotoIndex || 0,\n origin,\n };\n }\n\n if (!(chatId && threadId && messageId)) {\n return {};\n }\n\n let message: ApiMessage | undefined;\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n message = selectScheduledMessage(global, chatId, messageId);\n } else {\n message = selectChatMessage(global, chatId, messageId);\n }\n\n if (!message) {\n return {};\n }\n\n return {\n chatId,\n threadId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n isProtected: selectIsMessageProtected(global, message),\n };\n },\n)(MediaViewerContent));\n\nfunction renderPhoto(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n return blobUrl\n ? (\n \n )\n : (\n \n \n \n );\n}\n\nfunction renderVideoPreview(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n const wrapperStyle = imageSize && `width: ${imageSize.width}px; height: ${imageSize.height}px`;\n const videoStyle = `background-image: url(${blobUrl})`;\n return blobUrl\n ? (\n \n \n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n \n \n )\n : (\n \n \n \n );\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MediaViewerOrigin } from '../../types';\n\nimport useDebounce from '../../hooks/useDebounce';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport { animateNumber, timingFunctions } from '../../util/animation';\nimport arePropsShallowEqual from '../../util/arePropsShallowEqual';\nimport { captureEvents, IOS_SCREEN_EDGE_THRESHOLD, RealTouchEvent } from '../../util/captureEvents';\nimport { IS_IOS, IS_TOUCH_ENV } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\n\nimport MediaViewerContent from './MediaViewerContent';\n\nimport './MediaViewerSlides.scss';\nimport useTimeout from '../../hooks/useTimeout';\n\ntype OwnProps = {\n messageId?: number;\n getMessageId: (fromId?: number, direction?: number) => number | undefined;\n isVideo?: boolean;\n isGif?: boolean;\n isPhoto?: boolean;\n isOpen?: boolean;\n selectMessage: (id?: number) => void;\n chatId?: string;\n threadId?: number;\n isActive?: boolean;\n avatarOwnerId?: string;\n profilePhotoIndex?: number;\n origin?: MediaViewerOrigin;\n isZoomed?: boolean;\n animationLevel: 0 | 1 | 2;\n onClose: () => void;\n hasFooter?: boolean;\n onFooterClick: () => void;\n};\n\nconst SWIPE_X_THRESHOLD = 50;\nconst SWIPE_Y_THRESHOLD = 50;\nconst SLIDES_GAP = 40;\nconst ANIMATION_DURATION = 350;\nconst DEBOUNCE_MESSAGE = 350;\nconst DEBOUNCE_SWIPE = 500;\nconst DEBOUNCE_ACTIVE = 800;\nconst MAX_ZOOM = 4;\nconst MIN_ZOOM = 0.6;\nconst DOUBLE_TAP_ZOOM = 3;\nconst CLICK_X_THRESHOLD = 40;\nconst CLICK_Y_THRESHOLD = 80;\nlet cancelAnimation: Function | undefined;\n\ntype Transform = {\n x: number;\n y: number;\n scale: number;\n};\n\nenum SwipeDirection {\n Horizontal,\n Vertical,\n}\n\nconst MediaViewerSlides: FC = ({\n messageId,\n getMessageId,\n selectMessage,\n isVideo,\n isGif,\n isPhoto,\n isOpen,\n isActive,\n hasFooter,\n ...rest\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const activeSlideRef = useRef(null);\n const transformRef = useRef({ x: 0, y: 0, scale: 1 });\n const swipeDirectionRef = useRef(undefined);\n const isActiveRef = useRef(true);\n const [activeMessageId, setActiveMessageId] = useState(messageId);\n const forceUpdate = useForceUpdate();\n const [isFooterHidden, setIsFooterHidden] = useState(true);\n\n const {\n isZoomed,\n onClose,\n } = rest;\n\n const setTransform = useCallback((value: Transform) => {\n transformRef.current = value;\n forceUpdate();\n }, [forceUpdate]);\n\n const setIsActive = useCallback((value: boolean) => {\n isActiveRef.current = value;\n forceUpdate();\n }, [forceUpdate]);\n\n const debounceSetMessage = useDebounce(DEBOUNCE_MESSAGE, true);\n const debounceSwipeDirection = useDebounce(DEBOUNCE_SWIPE, true);\n const debounceActive = useDebounce(DEBOUNCE_ACTIVE, true);\n\n const handleToggleFooterVisibility = useCallback((e: React.MouseEvent) => {\n if (!IS_TOUCH_ENV) return;\n const isFooter = window.innerHeight - e.pageY < CLICK_Y_THRESHOLD;\n if (!isFooter && e.pageX < CLICK_X_THRESHOLD) return;\n if (!isFooter && e.pageX > window.innerWidth - CLICK_X_THRESHOLD) return;\n setIsFooterHidden(!isFooterHidden);\n }, [isFooterHidden]);\n\n useTimeout(() => setIsFooterHidden(false), ANIMATION_DURATION - 150);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV || !containerRef.current || isZoomed || !activeMessageId) {\n return undefined;\n }\n let lastTransform = { x: 0, y: 0, scale: 1 };\n const lastDragOffset = {\n x: 0,\n y: 0,\n };\n const lastZoomCenter = {\n x: 0,\n y: 0,\n };\n const panDelta = {\n x: 0,\n y: 0,\n };\n let lastGestureTime = Date.now();\n let initialContentRect: DOMRect;\n let content: HTMLElement | null;\n const setLastGestureTime = debounce(() => {\n lastGestureTime = Date.now();\n }, 500, false, true);\n\n const changeSlide = (e: MouseEvent) => {\n if (transformRef.current.scale !== 1) return false;\n let direction = 0;\n if (window.innerHeight - e.pageY < CLICK_Y_THRESHOLD) {\n return false;\n }\n if (e.pageX < CLICK_X_THRESHOLD) {\n direction = -1;\n } else if (e.pageX > window.innerWidth - CLICK_X_THRESHOLD) {\n direction = 1;\n }\n const mId = getMessageId(activeMessageId, direction);\n if (mId) {\n const offset = (window.innerWidth + SLIDES_GAP) * direction;\n transformRef.current.x += offset;\n isActiveRef.current = false;\n setActiveMessageId(mId);\n debounceSetMessage(() => selectMessage(mId));\n debounceActive(() => {\n setIsActive(true);\n });\n lastTransform = { x: 0, y: 0, scale: 1 };\n cancelAnimation = animateNumber({\n from: transformRef.current.x,\n to: 0,\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n y: 0,\n x: value,\n scale: 1,\n }),\n });\n }\n return direction !== 0;\n };\n\n return captureEvents(containerRef.current, {\n isNotPassive: true,\n excludedClosestSelector: '.VideoPlayerControls, .MediaViewerFooter',\n onCapture: () => {\n lastGestureTime = Date.now();\n if (arePropsShallowEqual(transformRef.current, { x: 0, y: 0, scale: 1 })) {\n if (!activeSlideRef.current) return;\n content = activeSlideRef.current.querySelector('img, video');\n if (!content) return;\n // Store initial content rect, without transformations\n initialContentRect = content.getBoundingClientRect();\n }\n },\n onDrag: (event, captureEvent, {\n dragOffsetX,\n dragOffsetY,\n }) => {\n // Avoid conflicts with swipe-to-back gestures\n if (IS_IOS) {\n const { pageX } = (captureEvent as RealTouchEvent).touches[0];\n if (pageX <= IOS_SCREEN_EDGE_THRESHOLD || pageX >= window.innerWidth - IOS_SCREEN_EDGE_THRESHOLD) {\n return;\n }\n }\n if (cancelAnimation) {\n cancelAnimation();\n cancelAnimation = undefined;\n }\n panDelta.x = lastDragOffset.x - dragOffsetX;\n panDelta.y = lastDragOffset.y - dragOffsetY;\n lastDragOffset.x = dragOffsetX;\n lastDragOffset.y = dragOffsetY;\n const absOffsetX = Math.abs(dragOffsetX);\n const absOffsetY = Math.abs(dragOffsetY);\n const {\n scale,\n x,\n y,\n } = transformRef.current;\n const h = 10;\n\n // If user is inactive but is still touching the screen\n // we reset last gesture time\n setLastGestureTime();\n\n // If image is scaled we just need to pan it\n if (scale !== 1) {\n if ('touches' in event && event.touches.length === 1) {\n setTransform({\n x: lastTransform.x + dragOffsetX,\n y: lastTransform.y + dragOffsetY,\n scale,\n });\n }\n return;\n }\n if (swipeDirectionRef.current !== SwipeDirection.Vertical) {\n // If user is swiping horizontally or horizontal shift is dominant\n // we change only horizontal position\n if (swipeDirectionRef.current === SwipeDirection.Horizontal\n || Math.abs(x) > h || (absOffsetX > h && absOffsetY < h)) {\n swipeDirectionRef.current = SwipeDirection.Horizontal;\n isActiveRef.current = false;\n setTransform({\n x: dragOffsetX,\n y: 0,\n scale,\n });\n return;\n }\n }\n // If vertical shift is dominant we change only vertical position\n if (swipeDirectionRef.current === SwipeDirection.Vertical\n || Math.abs(y) > h || (absOffsetY > h && absOffsetX < h)) {\n swipeDirectionRef.current = SwipeDirection.Vertical;\n setTransform({\n x: 0,\n y: dragOffsetY,\n scale,\n });\n }\n },\n onZoom: (e, {\n zoomFactor,\n initialCenterX,\n initialCenterY,\n dragOffsetX,\n dragOffsetY,\n currentCenterX,\n currentCenterY,\n }) => {\n // Calculate current scale based on zoom factor and limits, add max zoom margin for bounce back effect\n const scale = Math.min(MAX_ZOOM * 3, Math.max(lastTransform.scale * zoomFactor, MIN_ZOOM));\n const scaleFactor = scale / lastTransform.scale;\n const offsetX = Math.abs(Math.min(lastTransform.x, 0));\n const offsetY = Math.abs(Math.min(lastTransform.y, 0));\n\n // Calculate new center relative to the shifted image\n const scaledCenterX = offsetX + initialCenterX;\n const scaledCenterY = offsetY + initialCenterY;\n\n // Save last zoom center for bounce back effect\n lastZoomCenter.x = currentCenterX;\n lastZoomCenter.y = currentCenterY;\n\n // Calculate how much we need to shift the image to keep the zoom center at the same position\n const scaleOffsetX = (scaledCenterX - scaleFactor * scaledCenterX);\n const scaleOffsetY = (scaledCenterY - scaleFactor * scaledCenterY);\n\n setTransform({\n x: lastTransform.x + scaleOffsetX + dragOffsetX,\n y: lastTransform.y + scaleOffsetY + dragOffsetY,\n scale,\n });\n },\n onClick(e) {\n if (changeSlide(e as MouseEvent)) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n onDoubleClick(e, {\n centerX,\n centerY,\n }) {\n if (changeSlide(e as MouseEvent)) {\n e.preventDefault();\n e.stopPropagation();\n return undefined;\n }\n // Calculate how much we need to shift the image to keep the zoom center at the same position\n const scaleOffsetX = (centerX - DOUBLE_TAP_ZOOM * centerX);\n const scaleOffsetY = (centerY - DOUBLE_TAP_ZOOM * centerY);\n const {\n scale,\n x,\n y,\n } = transformRef.current;\n if (scale === 1) {\n if (x !== 0 || y !== 0) return undefined;\n lastTransform = {\n x: scaleOffsetX,\n y: scaleOffsetY,\n scale: DOUBLE_TAP_ZOOM,\n };\n } else {\n lastTransform = {\n x: 0,\n y: 0,\n scale: 1,\n };\n }\n return animateNumber({\n from: [x, y, scale],\n to: [lastTransform.x, lastTransform.y, lastTransform.scale],\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: value[0],\n y: value[1],\n scale: value[2],\n }),\n });\n },\n onRelease: () => {\n const absX = Math.abs(transformRef.current.x);\n const absY = Math.abs(transformRef.current.y);\n const {\n scale,\n x,\n y,\n } = transformRef.current;\n\n debounceSwipeDirection(() => {\n swipeDirectionRef.current = undefined;\n });\n debounceActive(() => {\n setIsActive(true);\n });\n\n // If scale is less than 1 we need to bounce back\n if (scale < 1) {\n lastTransform = { x: 0, y: 0, scale: 1 };\n return animateNumber({\n from: [x, y, scale],\n to: [0, 0, 1],\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: value[0],\n y: value[1],\n scale: value[2],\n }),\n });\n }\n if (scale > 1) {\n if (!content || !initialContentRect) {\n lastTransform = {\n x,\n y,\n scale,\n };\n return undefined;\n }\n // Get current content boundaries\n const boundaries = content.getBoundingClientRect();\n const s1 = Math.min(scale, MAX_ZOOM);\n const scaleFactor = s1 / scale;\n\n // Calculate new position based on the last zoom center to keep the zoom center\n // at the same position when bouncing back from max zoom\n let x1 = x * scaleFactor + (lastZoomCenter.x - scaleFactor * lastZoomCenter.x);\n let y1 = y * scaleFactor + (lastZoomCenter.y - scaleFactor * lastZoomCenter.y);\n\n // Arbitrary pan velocity coefficient\n const k = 0.15;\n\n // If scale didn't change, we need to add inertia to pan gesture\n if (lastTransform.scale === scale) {\n // Calculate user gesture velocity\n const Vx = Math.abs(lastDragOffset.x) / (Date.now() - lastGestureTime);\n const Vy = Math.abs(lastDragOffset.y) / (Date.now() - lastGestureTime);\n\n // Add extra distance based on gesture velocity and last pan delta\n x1 -= Math.abs(lastDragOffset.x) * Vx * k * panDelta.x;\n y1 -= Math.abs(lastDragOffset.y) * Vy * k * panDelta.y;\n }\n\n // If content is outside window we calculate offset boundaries\n // based on initial content rect and current scale\n if (boundaries.width > window.innerWidth) {\n const minOffsetX = -initialContentRect.left * s1;\n const maxOffsetX = window.innerWidth - initialContentRect.right * s1;\n x1 = Math.min(minOffsetX, Math.max(maxOffsetX, x1));\n } else {\n // Else we center the content on the screen\n x1 = (window.innerWidth - window.innerWidth * s1) / 2;\n }\n\n if (boundaries.height > window.innerHeight) {\n const minOffsetY = -initialContentRect.top * s1;\n const maxOffsetY = window.innerHeight - initialContentRect.bottom * s1;\n y1 = Math.min(minOffsetY, Math.max(maxOffsetY, y1));\n } else {\n y1 = (window.innerHeight - window.innerHeight * s1) / 2;\n }\n lastTransform = {\n x: x1,\n y: y1,\n scale: s1,\n };\n cancelAnimation = animateNumber({\n from: [x, y, scale],\n to: [x1, y1, s1],\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: value[0],\n y: value[1],\n scale: value[2],\n }),\n });\n return undefined;\n }\n lastTransform = {\n x,\n y,\n scale,\n };\n if (absY >= SWIPE_Y_THRESHOLD) return onClose();\n // Bounce back if vertical swipe is below threshold\n if (absY > 0) {\n return animateNumber({\n from: y,\n to: 0,\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n x: 0,\n y: value,\n scale,\n }),\n });\n }\n // Get horizontal swipe direction\n const direction = x < 0 ? 1 : -1;\n const mId = getMessageId(activeMessageId, x < 0 ? 1 : -1);\n // Get the direction of the last pan gesture.\n // Could be different from the total horizontal swipe direction\n // if user starts a swipe in one direction and then changes the direction\n // we need to cancel slide transition\n const dirX = panDelta.x < 0 ? -1 : 1;\n if (mId && absX >= SWIPE_X_THRESHOLD && direction === dirX) {\n const offset = (window.innerWidth + SLIDES_GAP) * direction;\n // If image is shifted by more than SWIPE_X_THRESHOLD,\n // We shift everything by one screen width and then set new active message id\n transformRef.current.x += offset;\n setActiveMessageId(mId);\n debounceSetMessage(() => selectMessage(mId));\n }\n // Then we always return to the original position\n cancelAnimation = animateNumber({\n from: transformRef.current.x,\n to: 0,\n duration: ANIMATION_DURATION,\n timing: timingFunctions.easeOutCubic,\n onUpdate: (value) => setTransform({\n y: 0,\n x: value,\n scale: transformRef.current.scale,\n }),\n });\n return undefined;\n },\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n isZoomed,\n onClose,\n setTransform,\n getMessageId,\n activeMessageId,\n setIsActive,\n ]);\n\n if (!activeMessageId) return undefined;\n\n const nextMessageId = getMessageId(activeMessageId, 1);\n const previousMessageId = getMessageId(activeMessageId, -1);\n const offsetX = transformRef.current.x;\n const offsetY = transformRef.current.y;\n const { scale } = transformRef.current;\n\n return (\n
\n {previousMessageId && scale === 1 && (\n
\n \n
\n )}\n {activeMessageId && (\n \n \n
\n )}\n {nextMessageId && scale === 1 && (\n
\n \n
\n )}\n \n );\n};\n\nexport default memo(MediaViewerSlides);\n\nfunction getAnimationStyle(x = 0, y = 0, scale = 1) {\n return `transform: translate3d(${x.toFixed(3)}px, ${y.toFixed(3)}px, 0px) scale(${scale.toFixed(3)});`;\n}\n","import { useEffect, useLayoutEffect, useRef } from '../lib/teact/teact';\n\nfunction useTimeout(callback: () => void, delay: number | null) {\n const savedCallback = useRef(callback);\n\n useLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n if (typeof delay !== 'number') {\n return undefined;\n }\n const id = setTimeout(() => savedCallback.current(), delay);\n return () => clearTimeout(id);\n }, [delay]);\n}\n\nexport default useTimeout;\n","/*\n @source https://github.com/ajainarayanan/react-pan-zoom\n\n Heavily inspired/lifted from this idea: https://stackoverflow.com/a/39311435/661768\n without jqueryUI or jquery dependency.\n*/\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nimport './PanZoom.scss';\n\nexport interface IDragData {\n x: number;\n y: number;\n dx: number;\n dy: number;\n}\n\nexport interface OwnProps {\n children: React.ReactNode;\n className?: string;\n noWrap: boolean;\n canPan: boolean;\n zoomLevel: number;\n panDeltaX: number;\n panDeltaY: number;\n onPan?: (x: number, y: number) => void;\n}\n\nconst INITIAL_MATRIX = [\n 1, 0, 0, 1, 0, 0,\n];\n\nconst SCALE_VALUES = {\n 1: 1,\n 1.5: 1.5,\n 2: 2.2,\n 2.5: 3.3,\n 3: 5.5,\n};\n\nconst ZOOM_SAFE_AREA = 150;\n\nfunction calculateSafeZoneOnZoom(oldScale: number, matrixData: number[], wrapper: HTMLDivElement | null) {\n const image = wrapper && wrapper.querySelector('.Transition__slide--active img');\n if (!wrapper || !image) {\n return matrixData;\n }\n const wrapperRect = wrapper.getBoundingClientRect();\n const imageRect = image.getBoundingClientRect();\n\n const newImgWidth = (imageRect.width / oldScale) * matrixData[0];\n const newImgHeight = (imageRect.height / oldScale) * matrixData[3];\n const newImgX = (wrapperRect.width - newImgWidth) / 2 + matrixData[4];\n const newImgY = (wrapperRect.height - newImgHeight) / 2 + matrixData[5];\n if (wrapperRect.width && wrapperRect.width - ZOOM_SAFE_AREA < newImgX) {\n matrixData[4] -= newImgX + wrapperRect.width - ZOOM_SAFE_AREA;\n } else if (newImgWidth && newImgWidth + newImgX < ZOOM_SAFE_AREA) {\n matrixData[4] -= newImgWidth + newImgX - ZOOM_SAFE_AREA;\n }\n if (wrapperRect.height && wrapperRect.height - ZOOM_SAFE_AREA < newImgY) {\n matrixData[5] -= newImgY + wrapperRect.height - ZOOM_SAFE_AREA;\n } else if (newImgHeight && newImgHeight + newImgY < ZOOM_SAFE_AREA) {\n matrixData[5] -= newImgHeight + newImgY - ZOOM_SAFE_AREA;\n }\n\n return matrixData;\n}\n\nconst PanZoom: FC = ({\n children,\n className,\n noWrap,\n canPan,\n zoomLevel,\n panDeltaX,\n panDeltaY,\n onPan,\n}) => {\n const tunedZoomLevel = SCALE_VALUES[zoomLevel as keyof typeof SCALE_VALUES] || zoomLevel;\n const [isDragging, setIsDragging] = useState(false);\n const [dragData, setDragData] = useState({\n dx: panDeltaX, dy: panDeltaY, x: 0, y: 0,\n });\n // [zoom, skew, skew, zoom, dx, dy] - see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix()\n const [matrixData, setMatrixData] = useState(INITIAL_MATRIX);\n // Used to set cursor while moving.\n // eslint-disable-next-line no-null/no-null\n const panWrapperRef = useRef(null);\n // Used to set transform for pan.\n // eslint-disable-next-line no-null/no-null\n const panContainerRef = useRef(null);\n\n useEffect(() => {\n const newZoomLevel = tunedZoomLevel || matrixData[0];\n const newPandx = panDeltaX || matrixData[4];\n const newPandy = panDeltaY || matrixData[5];\n\n const newMatrixData = [...matrixData];\n if (matrixData[0] !== newZoomLevel) {\n newMatrixData[0] = newZoomLevel || newMatrixData[0];\n newMatrixData[3] = newZoomLevel || newMatrixData[3];\n }\n if (matrixData[4] !== newPandx) {\n newMatrixData[4] = newPandx;\n }\n if (matrixData[5] !== newPandy) {\n newMatrixData[5] = newPandy;\n }\n\n if (!areSortedArraysEqual(matrixData, newMatrixData)) {\n setMatrixData(calculateSafeZoneOnZoom(matrixData[0], newMatrixData, panWrapperRef.current));\n }\n // eslint-disable-next-line\n }, [panDeltaX, panDeltaY, tunedZoomLevel]);\n\n useEffect(() => {\n if (!canPan) {\n setMatrixData(INITIAL_MATRIX);\n }\n }, [canPan]);\n\n useEffect(() => {\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }, [noWrap, matrixData]);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n if (!canPan) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n const offsetX = matrixData[4];\n const offsetY = matrixData[5];\n const newDragData: IDragData = {\n dx: offsetX,\n dy: offsetY,\n x: e.pageX,\n y: e.pageY,\n };\n setDragData(newDragData);\n setIsDragging(true);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.add('move');\n }\n };\n\n const handleMouseUp = () => {\n setIsDragging(false);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.remove('move');\n }\n\n if (onPan) {\n onPan(matrixData[4], matrixData[5]);\n }\n };\n\n function getNewMatrixData(x: number, y: number): number[] {\n const newMatrixData = [...matrixData];\n const deltaX = dragData.x - x;\n const deltaY = dragData.y - y;\n newMatrixData[4] = dragData.dx - deltaX;\n newMatrixData[5] = dragData.dy - deltaY;\n\n return newMatrixData;\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (isDragging) {\n const newMatrixData = getNewMatrixData(e.pageX, e.pageY);\n setMatrixData(newMatrixData);\n\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }\n };\n\n if (noWrap) {\n return children;\n }\n\n return (\n \n \n {children}\n \n \n );\n};\n\nexport default memo(PanZoom);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { getSenderTitle, isUserId } from '../../modules/helpers';\nimport { formatMediaDateTime } from '../../util/dateFormat';\nimport renderText from '../common/helpers/renderText';\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectUser,\n} from '../../modules/selectors';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from '../common/Avatar';\n\nimport './SenderInfo.scss';\n\ntype OwnProps = {\n chatId?: string;\n messageId?: number;\n isAvatar?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiUser | ApiChat;\n message?: ApiMessage;\n};\n\nconst ANIMATION_DURATION = 350;\n\nconst SenderInfo: FC = ({\n chatId,\n messageId,\n sender,\n isAvatar,\n message,\n}) => {\n const {\n closeMediaViewer,\n focusMessage,\n toggleChatInfo,\n } = getDispatch();\n\n const handleFocusMessage = useCallback(() => {\n closeMediaViewer();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n toggleChatInfo(false, { forceSyncOnIOs: true });\n focusMessage({ chatId, messageId });\n }, ANIMATION_DURATION);\n } else {\n focusMessage({ chatId, messageId });\n }\n }, [chatId, focusMessage, toggleChatInfo, messageId, closeMediaViewer]);\n\n const lang = useLang();\n\n if (!sender || (!message && !isAvatar)) {\n return undefined;\n }\n\n const senderTitle = getSenderTitle(lang, sender);\n\n return (\n
\n {isUserId(sender.id) ? (\n \n ) : (\n \n )}\n
\n
\n {senderTitle && renderText(senderTitle)}\n
\n
\n {isAvatar\n ? lang('lng_mediaview_profile_photo')\n : formatMediaDateTime(lang, message!.date * 1000, true)}\n
\n
\n
\n );\n};\n\nexport default withGlobal(\n (global, { chatId, messageId, isAvatar }): StateProps => {\n if (isAvatar && chatId) {\n return {\n sender: isUserId(chatId) ? selectUser(global, chatId) : selectChat(global, chatId),\n };\n }\n\n if (!messageId || !chatId) {\n return {};\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n message,\n sender: message && selectSender(global, message),\n };\n },\n)(SenderInfo);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\n\nimport Transition, { ChildrenFn, TransitionProps } from '../ui/Transition';\n\nconst SlideTransition: FC = ({ children, ...props }) => {\n if (IS_TOUCH_ENV) return children(true, true, 1);\n // eslint-disable-next-line react/jsx-props-no-spreading\n return {children};\n};\n\nexport default SlideTransition;\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ZoomControls.scss';\n\ntype OwnProps = {\n isShown: boolean;\n onChangeZoom: (level: number, canCloseZoom?: boolean) => void;\n};\n\nexport const MAX_ZOOM_LEVEL = 3;\nexport const MIN_ZOOM_LEVEL = 1;\nconst ONE_STEP_PERCENT = 100 / (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL);\nconst RESET_ZOOM_LEVEL = 1.5;\n\nconst ZoomControls: FC = ({ isShown, onChangeZoom }) => {\n const { transitionClassNames } = useShowTransition(isShown);\n const prevIsShown = usePrevious(isShown);\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [zoomLevel, setZoomLevel] = useState(1);\n const isSeeking = useRef(false);\n\n useEffect(() => {\n if (isShown && !prevIsShown) {\n setZoomLevel(RESET_ZOOM_LEVEL);\n }\n }, [isShown, prevIsShown]);\n\n const handleZoomOut = () => {\n if (inputRef.current) {\n setZoomLevel(Math.max(MIN_ZOOM_LEVEL, zoomLevel - 0.5));\n }\n };\n\n const handleZoomIn = () => {\n if (inputRef.current) {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, zoomLevel + 0.5));\n }\n };\n\n const handleStartSeek = useCallback(() => {\n isSeeking.current = true;\n }, []);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n if (zoomLevel === 1) {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }\n }, [onChangeZoom, zoomLevel]);\n\n const handleSeeklineChange = (e:React.ChangeEvent) => {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, Math.max(Number(e.target.value), MIN_ZOOM_LEVEL)));\n };\n\n useEffect(() => {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }, [zoomLevel, onChangeZoom]);\n\n const lang = useLang();\n\n const className = buildClassName(\n 'ZoomControls',\n transitionClassNames,\n );\n\n return (\n
\n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n );\n};\n\nexport default memo(ZoomControls);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../../api/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useLang from '../../hooks/useLang';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';\nimport usePrevious from '../../hooks/usePrevious';\nimport {\n getChatAvatarHash,\n getChatMediaMessageIds,\n getMessageDocument,\n getMessageFileName,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectCurrentMediaSearch,\n selectListedIds,\n selectOutlyingIds,\n selectScheduledMessage,\n selectScheduledMessages,\n selectUser,\n} from '../../modules/selectors';\nimport { stopCurrentAudio } from '../../util/audioPlayer';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { captureEvents } from '../../util/captureEvents';\nimport windowSize from '../../util/windowSize';\nimport { AVATAR_FULL_DIMENSIONS, MEDIA_VIEWER_MEDIA_QUERY } from '../common/helpers/mediaDimensions';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport { animateClosing, animateOpening } from './helpers/ghostAnimation';\n\nimport Button from '../ui/Button';\nimport ShowTransition from '../ui/ShowTransition';\nimport Transition from '../ui/Transition';\nimport MediaViewerActions from './MediaViewerActions';\nimport MediaViewerSlides from './MediaViewerSlides';\nimport PanZoom from './PanZoom';\nimport SenderInfo from './SenderInfo';\nimport SlideTransition from './SlideTransition';\nimport ZoomControls from './ZoomControls';\n\nimport './MediaViewer.scss';\n\ntype StateProps = {\n chatId?: string;\n threadId?: number;\n messageId?: number;\n senderId?: string;\n origin?: MediaViewerOrigin;\n avatarOwner?: ApiChat | ApiUser;\n profilePhotoIndex?: number;\n message?: ApiMessage;\n chatMessages?: Record;\n collectionIds?: number[];\n animationLevel: 0 | 1 | 2;\n};\n\nconst ANIMATION_DURATION = 350;\n\nconst MediaViewer: FC = ({\n chatId,\n threadId,\n messageId,\n senderId,\n origin,\n avatarOwner,\n profilePhotoIndex,\n message,\n chatMessages,\n collectionIds,\n animationLevel,\n}) => {\n const {\n openMediaViewer,\n closeMediaViewer,\n openForwardMenu,\n focusMessage,\n toggleChatInfo,\n } = getDispatch();\n\n const isOpen = Boolean(avatarOwner || messageId);\n\n const isFromSharedMedia = origin === MediaViewerOrigin.SharedMedia;\n const isFromSearch = origin === MediaViewerOrigin.SearchResult;\n\n /* Content */\n const photo = message ? getMessagePhoto(message) : undefined;\n const video = message ? getMessageVideo(message) : undefined;\n const webPagePhoto = message ? getMessageWebPagePhoto(message) : undefined;\n const webPageVideo = message ? getMessageWebPageVideo(message) : undefined;\n const isDocumentPhoto = message ? isMessageDocumentPhoto(message) : false;\n const isDocumentVideo = message ? isMessageDocumentVideo(message) : false;\n const isVideo = Boolean(video || webPageVideo || isDocumentVideo);\n const { isGif } = video || webPageVideo || {};\n const isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const isAvatar = Boolean(avatarOwner);\n\n /* Navigation */\n const singleMessageId = webPagePhoto || webPageVideo ? messageId : undefined;\n\n const messageIds = useMemo(() => {\n return singleMessageId\n ? [singleMessageId]\n : getChatMediaMessageIds(chatMessages || {}, collectionIds || [], isFromSharedMedia);\n }, [singleMessageId, chatMessages, collectionIds, isFromSharedMedia]);\n\n const selectedMediaMessageIndex = messageId ? messageIds.indexOf(messageId) : -1;\n const isFirst = selectedMediaMessageIndex === 0 || selectedMediaMessageIndex === -1;\n const isLast = selectedMediaMessageIndex === messageIds.length - 1 || selectedMediaMessageIndex === -1;\n\n /* Animation */\n const animationKey = useRef();\n const prevSenderId = usePrevious(senderId);\n if (isOpen && (!prevSenderId || prevSenderId !== senderId || !animationKey.current)) {\n animationKey.current = selectedMediaMessageIndex;\n }\n const slideAnimation = animationLevel >= 1 && !IS_TOUCH_ENV ? 'mv-slide' : 'none';\n const headerAnimation = animationLevel === 2 ? 'slide-fade' : 'none';\n const isGhostAnimation = animationLevel === 2;\n\n /* Controls */\n const [canPanZoomWrap, setCanPanZoomWrap] = useState(false);\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomLevel, setZoomLevel] = useState(1);\n const [panDelta, setPanDelta] = useState({\n x: 0,\n y: 0,\n });\n\n /* Media data */\n function getMediaHash(isFull?: boolean) {\n if (isAvatar && profilePhotoIndex !== undefined) {\n const { photos } = avatarOwner!;\n return photos && photos[profilePhotoIndex]\n ? `photo${photos[profilePhotoIndex].id}?size=c`\n : getChatAvatarHash(avatarOwner!, isFull ? 'big' : 'normal');\n }\n\n return message && getMessageMediaHash(message, isFull ? 'viewerFull' : 'viewerPreview');\n }\n\n const pictogramBlobUrl = useMedia(\n message && (isFromSharedMedia || isFromSearch) && getMessageMediaHash(message, 'pictogram'),\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const previewMediaHash = getMediaHash();\n const previewBlobUrl = useMedia(\n previewMediaHash,\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const { mediaData: fullMediaBlobUrl } = useMediaWithLoadProgress(\n getMediaHash(true),\n undefined,\n message && getMessageMediaFormat(message, 'viewerFull'),\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n\n const localBlobUrl = (photo || video) ? (photo || video)!.blobUrl : undefined;\n let bestImageData = (!isVideo && (localBlobUrl || fullMediaBlobUrl)) || previewBlobUrl || pictogramBlobUrl;\n const thumbDataUri = useBlurSync(!bestImageData && message && getMessageMediaThumbDataUri(message));\n if (!bestImageData && origin !== MediaViewerOrigin.SearchResult) {\n bestImageData = thumbDataUri;\n }\n\n const fileName = message\n ? getMessageFileName(message)\n : isAvatar\n ? `avatar${avatarOwner!.id}-${profilePhotoIndex}.jpg`\n : undefined;\n\n let dimensions!: ApiDimensions;\n if (message) {\n if (isDocumentPhoto || isDocumentVideo) {\n dimensions = getMessageDocument(message)!.mediaSize!;\n } else if (photo || webPagePhoto) {\n dimensions = getPhotoFullDimensions((photo || webPagePhoto)!)!;\n } else if (video || webPageVideo) {\n dimensions = getVideoDimensions((video || webPageVideo)!)!;\n }\n } else {\n dimensions = AVATAR_FULL_DIMENSIONS;\n }\n\n useEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return;\n }\n\n document.body.classList.toggle('is-media-viewer-open', isOpen);\n }, [isOpen]);\n\n const forceUpdate = useForceUpdate();\n useEffect(() => {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', forceUpdate);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(forceUpdate);\n }\n\n return () => {\n if (typeof mql.removeEventListener === 'function') {\n mql.removeEventListener('change', forceUpdate);\n } else if (typeof mql.removeListener === 'function') {\n mql.removeListener(forceUpdate);\n }\n };\n }, [forceUpdate]);\n\n const prevMessage = usePrevious(message);\n const prevOrigin = usePrevious(origin);\n const prevAvatarOwner = usePrevious(avatarOwner);\n const prevBestImageData = usePrevious(bestImageData);\n const textParts = message ? renderMessageText(message) : undefined;\n const hasFooter = Boolean(textParts);\n\n useEffect(() => {\n if (isGhostAnimation && isOpen && !prevMessage && !prevAvatarOwner) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n animateOpening(hasFooter, origin!, bestImageData!, dimensions, isVideo, message);\n }\n\n if (isGhostAnimation && !isOpen && (prevMessage || prevAvatarOwner)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n animateClosing(prevOrigin!, prevBestImageData!, prevMessage || undefined);\n }\n }, [\n isGhostAnimation, isOpen, origin, prevOrigin, message, prevMessage, prevAvatarOwner,\n bestImageData, prevBestImageData, dimensions, isVideo, hasFooter,\n ]);\n\n useEffect(() => {\n let timer: number | undefined;\n\n if (isZoomed) {\n setCanPanZoomWrap(true);\n } else {\n timer = window.setTimeout(() => {\n setCanPanZoomWrap(false);\n }, ANIMATION_DURATION);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [isZoomed]);\n\n const closeZoom = () => {\n setIsZoomed(false);\n setZoomLevel(1);\n setPanDelta({\n x: 0,\n y: 0,\n });\n };\n\n const handleZoomToggle = useCallback(() => {\n setIsZoomed(!isZoomed);\n setZoomLevel(!isZoomed ? 1.5 : 1);\n if (isZoomed) {\n setPanDelta({\n x: 0,\n y: 0,\n });\n }\n }, [isZoomed]);\n\n const handleZoomValue = useCallback((level: number, canCloseZoom = false) => {\n setZoomLevel(level);\n if (level === 1 && canCloseZoom) {\n closeZoom();\n }\n }, []);\n\n const close = useCallback(() => {\n closeMediaViewer();\n closeZoom();\n }, [closeMediaViewer]);\n\n const handleFooterClick = useCallback(() => {\n close();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n toggleChatInfo(false, { forceSyncOnIOs: true });\n focusMessage({ chatId, threadId, messageId });\n }, ANIMATION_DURATION);\n } else {\n focusMessage({ chatId, threadId, messageId });\n }\n }, [close, chatId, threadId, focusMessage, toggleChatInfo, messageId]);\n\n const handleForward = useCallback(() => {\n openForwardMenu({\n fromChatId: chatId,\n messageIds: [messageId],\n });\n closeZoom();\n }, [openForwardMenu, chatId, messageId]);\n\n const selectMessage = useCallback((id?: number) => openMediaViewer({\n chatId,\n threadId,\n messageId: id,\n origin,\n }, {\n forceOnHeavyAnimation: true,\n }), [chatId, openMediaViewer, origin, threadId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(() => {\n if (isZoomed) {\n closeZoom();\n } else {\n close();\n }\n }) : undefined), [close, isOpen, isZoomed]);\n\n useEffect(() => {\n if (isVideo && !isGif) {\n stopCurrentAudio();\n }\n }, [isGif, isVideo]);\n\n // Prevent refresh when rotating device to watch a video\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [isOpen]);\n\n const getMessageId = useCallback((fromId?: number, direction?: number): number | undefined => {\n if (!fromId) return undefined;\n const index = messageIds.indexOf(fromId);\n if ((direction === -1 && index > 0) || (direction === 1 && index < messageIds.length - 1)) {\n return messageIds[index + direction];\n }\n return undefined;\n }, [messageIds]);\n\n const nextMessageId = getMessageId(messageId, 1);\n const previousMessageId = getMessageId(messageId, -1);\n\n const handlePan = useCallback((x: number, y: number) => {\n setPanDelta({\n x,\n y,\n });\n }, []);\n\n const lang = useLang();\n\n useHistoryBack(isOpen, closeMediaViewer, openMediaViewer, {\n chatId,\n threadId,\n messageId,\n origin,\n avatarOwnerId: avatarOwner && avatarOwner.id,\n });\n\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n switch (e.key) {\n case 'Left': // IE/Edge specific value\n case 'ArrowLeft':\n selectMessage(previousMessageId);\n break;\n\n case 'Right': // IE/Edge specific value\n case 'ArrowRight':\n selectMessage(nextMessageId);\n break;\n }\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n }, [isOpen, nextMessageId, previousMessageId, selectMessage]);\n\n useEffect(() => {\n if (isZoomed || IS_TOUCH_ENV) return undefined;\n const element = document.querySelector('.MediaViewerSlide--active');\n if (!element) {\n return undefined;\n }\n\n const shouldCloseOnVideo = isGif && !IS_IOS;\n\n return captureEvents(element, {\n // eslint-disable-next-line max-len\n excludedClosestSelector: `.backdrop, .navigation, .media-viewer-head, .Spoiler, .media-viewer-footer${!shouldCloseOnVideo ? ', .VideoPlayer' : ''}`,\n onClick: close,\n });\n }, [close, isGif, isZoomed, messageId]);\n\n function renderSenderInfo() {\n return isAvatar ? (\n \n ) : (\n \n );\n }\n\n return (\n \n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n {renderSenderInfo()}\n \n \n
\n \n \n {(isActive: boolean) => (\n \n )}\n \n \n {!isFirst && !IS_TOUCH_ENV && (\n selectMessage(previousMessageId)}\n />\n )}\n {!isLast && !IS_TOUCH_ENV && (\n selectMessage(nextMessageId)}\n />\n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n } = global.mediaViewer;\n const {\n animationLevel,\n } = global.settings.byKey;\n\n if (origin === MediaViewerOrigin.SearchResult) {\n if (!(chatId && messageId)) {\n return { animationLevel };\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n if (!message) {\n return { animationLevel };\n }\n\n return {\n chatId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n animationLevel,\n };\n }\n\n if (avatarOwnerId) {\n const sender = selectUser(global, avatarOwnerId) || selectChat(global, avatarOwnerId);\n\n return {\n messageId: -1,\n senderId: avatarOwnerId,\n avatarOwner: sender,\n profilePhotoIndex: profilePhotoIndex || 0,\n animationLevel,\n origin,\n };\n }\n\n if (!(chatId && threadId && messageId)) {\n return { animationLevel };\n }\n\n let message: ApiMessage | undefined;\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n message = selectScheduledMessage(global, chatId, messageId);\n } else {\n message = selectChatMessage(global, chatId, messageId);\n }\n\n if (!message) {\n return { animationLevel };\n }\n\n let chatMessages: Record | undefined;\n\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n chatMessages = selectScheduledMessages(global, chatId);\n } else {\n chatMessages = selectChatMessages(global, chatId);\n }\n let collectionIds: number[] | undefined;\n\n if (origin === MediaViewerOrigin.Inline || origin === MediaViewerOrigin.Album) {\n collectionIds = selectOutlyingIds(global, chatId, threadId) || selectListedIds(global, chatId, threadId);\n } else if (origin === MediaViewerOrigin.SharedMedia) {\n const currentSearch = selectCurrentMediaSearch(global);\n const { foundIds } = (currentSearch && currentSearch.resultsByType && currentSearch.resultsByType.media) || {};\n collectionIds = foundIds;\n }\n\n return {\n chatId,\n threadId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n chatMessages,\n collectionIds,\n animationLevel,\n };\n },\n)(MediaViewer));\n","import { RefObject } from 'react';\nimport React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\n\nimport { CHAT_HEIGHT_PX } from '../../config';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen';\nimport { isUserId } from '../../modules/helpers';\n\nimport Loading from '../ui/Loading';\nimport Modal from '../ui/Modal';\nimport InputText from '../ui/InputText';\nimport Button from '../ui/Button';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport GroupChatInfo from './GroupChatInfo';\nimport PrivateChatInfo from './PrivateChatInfo';\n\nimport './ChatOrUserPicker.scss';\n\nexport type OwnProps = {\n currentUserId?: string;\n chatOrUserIds: string[];\n isOpen: boolean;\n filterRef: RefObject;\n filterPlaceholder: string;\n filter: string;\n loadMore?: NoneToVoidFunction;\n onFilterChange: (filter: string) => void;\n onSelectChatOrUser: (chatOrUserId: string) => void;\n onClose: NoneToVoidFunction;\n onCloseAnimationEnd?: NoneToVoidFunction;\n};\n\nconst ChatOrUserPicker: FC = ({\n isOpen,\n currentUserId,\n chatOrUserIds,\n filterRef,\n filter,\n filterPlaceholder,\n loadMore,\n onFilterChange,\n onSelectChatOrUser,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const lang = useLang();\n const [viewportIds, getMore] = useInfiniteScroll(loadMore, chatOrUserIds, Boolean(filter));\n\n const resetFilter = useCallback(() => {\n onFilterChange('');\n }, [onFilterChange]);\n useInputFocusOnOpen(filterRef, isOpen, resetFilter);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n onFilterChange(e.currentTarget.value);\n }, [onFilterChange]);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n onSelectChatOrUser(viewportIds[index === -1 ? 0 : index]);\n }\n }, '.ListItem-button', true);\n\n const modalHeader = (\n
\n \n \n \n \n
\n );\n\n const viewportOffset = chatOrUserIds!.indexOf(viewportIds![0]);\n\n return (\n \n {viewportIds?.length ? (\n \n {viewportIds.map((id, i) => (\n onSelectChatOrUser(id)}\n >\n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : viewportIds && !viewportIds.length ? (\n

{lang('lng_blocked_list_not_found')}

\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(ChatOrUserPicker);\n","import React, {\n FC, useMemo, useState, memo, useRef, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, MAIN_THREAD_ID } from '../../api/types';\n\nimport {\n filterChatsByName,\n filterUsersByName,\n getCanPostInChat,\n sortChatIds,\n} from '../../modules/helpers';\nimport { unique } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useFlag from '../../hooks/useFlag';\n\nimport ChatOrUserPicker from '../common/ChatOrUserPicker';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n chatsById: Record;\n activeListIds?: string[];\n archivedListIds?: string[];\n pinnedIds?: string[];\n contactIds?: string[];\n currentUserId?: string;\n};\n\nconst ForwardPicker: FC = ({\n chatsById,\n activeListIds,\n archivedListIds,\n pinnedIds,\n contactIds,\n currentUserId,\n isOpen,\n}) => {\n const {\n setForwardChatId,\n exitForwardMode,\n } = getDispatch();\n\n const lang = useLang();\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const filterRef = useRef(null);\n\n const [isShown, markIsShown, unmarkIsShown] = useFlag();\n useEffect(() => {\n if (isOpen) {\n markIsShown();\n }\n }, [isOpen, markIsShown]);\n\n const chatAndContactIds = useMemo(() => {\n if (!isOpen) {\n return undefined;\n }\n\n let priorityIds = pinnedIds || [];\n if (currentUserId) {\n priorityIds = unique([currentUserId, ...priorityIds]);\n }\n\n const chatIds = [\n ...(activeListIds || []),\n ...(archivedListIds || []),\n ].filter((id) => {\n const chat = chatsById[id];\n\n return chat && getCanPostInChat(chat, MAIN_THREAD_ID);\n });\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return sortChatIds(unique([\n ...filterChatsByName(lang, chatIds, chatsById, filter, currentUserId),\n ...(contactIds ? filterUsersByName(contactIds, usersById, filter) : []),\n ]), chatsById, undefined, priorityIds);\n }, [activeListIds, archivedListIds, chatsById, contactIds, currentUserId, filter, isOpen, lang, pinnedIds]);\n\n const handleSelectUser = useCallback((userId: string) => {\n setForwardChatId({ id: userId });\n }, [setForwardChatId]);\n\n const renderingChatAndContactIds = useCurrentOrPrev(chatAndContactIds, true)!;\n\n if (!isOpen && !isShown) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n chatsById,\n activeListIds: listIds.active,\n archivedListIds: listIds.archived,\n pinnedIds: orderedPinnedIds.active,\n contactIds: global.contactList?.userIds,\n currentUserId,\n };\n },\n)(ForwardPicker));\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiContact, ApiError, ApiInviteInfo, ApiPhoto,\n} from '../../api/types';\n\nimport getReadableErrorText from '../../util/getReadableErrorText';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Avatar from '../common/Avatar';\n\nimport './Dialogs.scss';\n\ntype StateProps = {\n dialogs: (ApiError | ApiInviteInfo)[];\n};\n\nconst Dialogs: FC = ({ dialogs }) => {\n const {\n dismissDialog,\n acceptInviteConfirmation,\n sendMessage,\n showNotification,\n } = getDispatch();\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n const lang = useLang();\n\n useEffect(() => {\n if (dialogs.length > 0) {\n openModal();\n }\n }, [dialogs, openModal]);\n\n if (!dialogs.length) {\n return undefined;\n }\n\n function renderInviteHeader(title: string, photo?: ApiPhoto) {\n return (\n
\n {photo && }\n
\n {renderText(title)}\n
\n \n
\n );\n }\n\n const renderInvite = (invite: ApiInviteInfo) => {\n const {\n hash, title, about, participantsCount, isChannel, photo, isRequestNeeded,\n } = invite;\n\n const handleJoinClick = () => {\n acceptInviteConfirmation({\n hash,\n });\n showNotification({\n message: isChannel ? lang('RequestToJoinChannelSentDescription') : lang('RequestToJoinGroupSentDescription'),\n });\n closeModal();\n };\n\n const participantsText = isChannel\n ? lang('Subscribers', participantsCount, 'i')\n : lang('Members', participantsCount, 'i');\n\n const joinText = isChannel ? lang('ChannelJoin') : lang('JoinGroup');\n const requestToJoinText = isChannel\n ? lang('MemberRequests.RequestToJoinChannel') : lang('MemberRequests.RequestToJoinGroup');\n\n return (\n \n {participantsCount !== undefined &&

{participantsText}

}\n {about &&

{renderText(about, ['br'])}

}\n {isRequestNeeded && (\n

\n {isChannel\n ? lang('MemberRequests.RequestToJoinDescriptionChannel')\n : lang('MemberRequests.RequestToJoinDescriptionGroup')}\n

\n )}\n \n \n \n );\n };\n\n const renderContactRequest = (contactRequest: ApiContact) => {\n const handleConfirm = () => {\n sendMessage({\n contact: pick(contactRequest, ['firstName', 'lastName', 'phoneNumber']),\n });\n closeModal();\n };\n\n return (\n \n {lang('AreYouSureShareMyContactInfoBot')}\n
\n \n \n
\n \n );\n };\n\n const renderError = (error: ApiError) => {\n return (\n \n {error.hasErrorKey ? getReadableErrorText(error) : renderText(error.message!, ['emoji', 'br'])}\n
\n \n
\n \n );\n };\n\n const renderDialog = (dialog: ApiError | ApiInviteInfo | ApiContact) => {\n if ('hash' in dialog) {\n return renderInvite(dialog);\n }\n\n if ('phoneNumber' in dialog) {\n return renderContactRequest(dialog);\n }\n\n return renderError(dialog);\n };\n\n return (\n
\n {Boolean(dialogs.length) && renderDialog(dialogs[dialogs.length - 1])}\n
\n );\n};\n\nfunction getErrorHeader(error: ApiError) {\n if (error.isSlowMode) {\n return 'Slowmode enabled';\n }\n\n if (!error.hasErrorKey) {\n return 'Telegram';\n }\n\n return 'Something went wrong';\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['dialogs']),\n)(Dialogs));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiNotification } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\n\nimport Notification from '../ui/Notification';\n\ntype StateProps = {\n notifications: ApiNotification[];\n};\n\nconst Notifications: FC = ({ notifications }) => {\n const { dismissNotification } = getDispatch();\n\n if (!notifications.length) {\n return undefined;\n }\n\n return (\n
\n {notifications.map(({ message, localId }) => (\n dismissNotification({ localId })}\n />\n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['notifications']),\n)(Notifications));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ensureProtocol } from '../../util/ensureProtocol';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\n\nexport type OwnProps = {\n url?: string;\n};\n\nconst SafeLinkModal: FC = ({ url }) => {\n const { toggleSafeLinkModal } = getDispatch();\n\n const lang = useLang();\n\n const handleOpen = useCallback(() => {\n window.open(ensureProtocol(url));\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal, url]);\n\n const handleDismiss = useCallback(() => {\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal]);\n\n const renderingUrl = useCurrentOrPrev(url);\n\n return (\n \n );\n};\n\nexport default memo(SafeLinkModal);\n","import React, {\n FC, memo, useState, useEffect, useMemo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport { formatTime, formatDateToString, getDayStart } from '../../util/dateFormat';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useFlag from '../../hooks/useFlag';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './CalendarModal.scss';\n\nconst MAX_SAFE_DATE = 2147483647 * 1000; // API has int for dates\nconst MIN_SAFE_DATE = 0;\n\nexport type OwnProps = {\n selectedAt?: number;\n minAt?: number;\n maxAt?: number;\n isFutureMode?: boolean;\n isPastMode?: boolean;\n isOpen: boolean;\n withTimePicker?: boolean;\n submitButtonLabel?: string;\n secondButtonLabel?: string;\n onClose: () => void;\n onSubmit: (date: Date) => void;\n onSecondButtonClick?: NoneToVoidFunction;\n};\n\nconst WEEKDAY_LETTERS = [\n 'lng_weekday1',\n 'lng_weekday2',\n 'lng_weekday3',\n 'lng_weekday4',\n 'lng_weekday5',\n 'lng_weekday6',\n 'lng_weekday7',\n];\n\nconst CalendarModal: FC = ({\n selectedAt,\n minAt,\n maxAt,\n isFutureMode,\n isPastMode,\n isOpen,\n withTimePicker,\n submitButtonLabel,\n secondButtonLabel,\n onClose,\n onSubmit,\n onSecondButtonClick,\n}) => {\n const lang = useLang();\n const now = new Date();\n\n const minDate = useMemo(() => {\n if (isFutureMode && !minAt) return new Date();\n return new Date(Math.max(minAt || MIN_SAFE_DATE, MIN_SAFE_DATE));\n }, [isFutureMode, minAt]);\n const maxDate = useMemo(() => {\n if (isPastMode && !maxAt) return new Date();\n return new Date(Math.min(maxAt || MAX_SAFE_DATE, MAX_SAFE_DATE));\n }, [isPastMode, maxAt]);\n\n const passedSelectedDate = useMemo(() => (selectedAt ? new Date(selectedAt) : new Date()), [selectedAt]);\n const prevIsOpen = usePrevious(isOpen);\n const [isTimeInputFocused, markTimeInputAsFocused, unmarkTimeInputAsFocused] = useFlag(false);\n\n const [selectedDate, setSelectedDate] = useState(passedSelectedDate);\n const [currentMonthAndYear, setCurrentMonthAndYear] = useState(\n new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1),\n );\n const [selectedHours, setSelectedHours] = useState(\n formatInputTime(passedSelectedDate.getHours()),\n );\n const [selectedMinutes, setSelectedMinutes] = useState(\n formatInputTime(passedSelectedDate.getMinutes()),\n );\n\n const selectedDay = formatDay(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate());\n const currentYear = currentMonthAndYear.getFullYear();\n const currentMonth = currentMonthAndYear.getMonth();\n\n useEffect(() => {\n if (!prevIsOpen && isOpen) {\n setSelectedDate(passedSelectedDate);\n setCurrentMonthAndYear(new Date(passedSelectedDate.getFullYear(), passedSelectedDate.getMonth(), 1));\n if (withTimePicker) {\n setSelectedHours(formatInputTime(passedSelectedDate.getHours()));\n setSelectedMinutes(formatInputTime(passedSelectedDate.getMinutes()));\n }\n }\n }, [passedSelectedDate, isOpen, prevIsOpen, withTimePicker]);\n\n useEffect(() => {\n if (isFutureMode && !isTimeInputFocused && selectedDate.getTime() < minDate.getTime()) {\n setSelectedDate(minDate);\n setSelectedHours(formatInputTime(minDate.getHours()));\n setSelectedMinutes(formatInputTime(minDate.getMinutes()));\n }\n }, [isFutureMode, isTimeInputFocused, minDate, selectedDate]);\n\n useEffect(() => {\n if (isPastMode && !isTimeInputFocused && selectedDate.getTime() > maxDate.getTime()) {\n setSelectedDate(maxDate);\n setSelectedHours(formatInputTime(maxDate.getHours()));\n setSelectedMinutes(formatInputTime(maxDate.getMinutes()));\n }\n }, [isFutureMode, isPastMode, isTimeInputFocused, maxDate, minDate, selectedDate]);\n\n useEffect(() => {\n if (selectedAt) {\n const newSelectedDate = new Date(selectedAt);\n setSelectedDate(newSelectedDate);\n setSelectedHours(formatInputTime(newSelectedDate.getHours()));\n setSelectedMinutes(formatInputTime(newSelectedDate.getMinutes()));\n }\n }, [selectedAt]);\n\n const shouldDisableNextMonth = (isPastMode && currentYear >= now.getFullYear() && currentMonth >= now.getMonth())\n || (maxDate && currentYear >= maxDate.getFullYear() && currentMonth >= maxDate.getMonth());\n const shouldDisablePrevMonth = isFutureMode && currentYear <= now.getFullYear() && currentMonth <= now.getMonth();\n\n const { prevMonthGrid, currentMonthGrid, nextMonthGrid } = useMemo(() => (\n buildCalendarGrid(currentYear, currentMonth)\n ), [currentMonth, currentYear]);\n\n const submitLabel = useMemo(() => {\n return submitButtonLabel || formatSubmitLabel(lang, selectedDate);\n }, [lang, selectedDate, submitButtonLabel]);\n\n function handlePrevMonth() {\n setCurrentMonthAndYear((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() - 1);\n\n return dateCopy;\n });\n }\n\n function handleNextMonth() {\n setCurrentMonthAndYear((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() + 1);\n\n return dateCopy;\n });\n }\n\n function handleDateSelect(date: number) {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setDate(date);\n dateCopy.setMonth(currentMonth);\n dateCopy.setFullYear(currentYear);\n\n return dateCopy;\n });\n }\n\n function handleSubmit() {\n onSubmit(selectedDate);\n }\n\n const handleChangeHours = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedHours('');\n e.target.value = '';\n return;\n }\n\n const hours = Math.max(0, Math.min(Number(value), 23));\n\n const date = new Date(selectedDate.getTime());\n date.setHours(hours);\n setSelectedDate(date);\n\n const hoursStr = formatInputTime(hours);\n setSelectedHours(hoursStr);\n e.target.value = hoursStr;\n }, [selectedDate]);\n\n const handleChangeMinutes = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedMinutes('');\n e.target.value = '';\n return;\n }\n\n const minutes = Math.max(0, Math.min(Number(value), 59));\n\n const date = new Date(selectedDate.getTime());\n date.setMinutes(minutes);\n setSelectedDate(date);\n\n const minutesStr = formatInputTime(minutes);\n setSelectedMinutes(minutesStr);\n e.target.value = minutesStr;\n }, [selectedDate]);\n\n function renderTimePicker() {\n return (\n
\n \n :\n \n
\n );\n }\n\n return (\n \n
\n
\n \n \n \n\n

\n {lang(`lng_month${currentMonth + 1}`)}\n {' '}\n {currentYear}\n

\n\n \n \n \n\n \n \n \n
\n
\n\n
\n
\n {WEEKDAY_LETTERS.map((day) => (\n
\n {lang(day)}\n
\n ))}\n {prevMonthGrid.map((gridDate) => (\n
{gridDate}
\n ))}\n {currentMonthGrid.map((gridDate) => (\n handleDateSelect(gridDate)}\n className={buildClassName(\n 'day-button',\n isDisabledDay(\n currentYear, currentMonth, gridDate, minDate, maxDate,\n )\n ? 'disabled'\n : `${gridDate ? 'clickable' : ''}`,\n selectedDay === formatDay(currentYear, currentMonth, gridDate) && 'selected',\n )}\n >\n {Boolean(gridDate) && (\n {gridDate}\n )}\n
\n ))}\n {nextMonthGrid.map((gridDate) => (\n
{gridDate}
\n ))}\n
\n \n\n {withTimePicker && renderTimePicker()}\n\n
\n \n {secondButtonLabel && (\n \n )}\n
\n \n );\n};\n\nfunction buildCalendarGrid(year: number, month: number) {\n const prevMonthGrid: number[] = [];\n const currentMonthGrid: number[] = [];\n const nextMonthGrid: number[] = [];\n\n const date = new Date();\n date.setDate(1);\n date.setMonth(month);\n date.setFullYear(year);\n const firstDay = date.getDay();\n const totalDaysInPrevMonth = new Date(year, month, 0).getDate();\n\n for (let i = 1; i < firstDay; i++) {\n prevMonthGrid.push(totalDaysInPrevMonth - firstDay + i + 1);\n }\n\n while (date.getMonth() === month) {\n const gridDate = date.getDate();\n currentMonthGrid.push(gridDate);\n date.setDate(gridDate + 1);\n }\n\n const lastRowDaysCount = (currentMonthGrid.length + prevMonthGrid.length) % 7;\n if (lastRowDaysCount > 0) {\n for (let i = 1; i <= 7 - lastRowDaysCount; i++) {\n nextMonthGrid.push(i);\n }\n }\n\n return { prevMonthGrid, currentMonthGrid, nextMonthGrid };\n}\n\nfunction isDisabledDay(year: number, month: number, day: number, minDate?: Date, maxDate?: Date) {\n const selectedDay = new Date(year, month, day);\n const fixedMinDate = minDate && getDayStart(minDate);\n const fixedMaxDate = maxDate && getDayStart(maxDate);\n\n if (fixedMaxDate && selectedDay > fixedMaxDate) {\n return true;\n } else if (fixedMinDate && selectedDay < fixedMinDate) {\n return true;\n }\n\n return false;\n}\n\nfunction formatInputTime(value: string | number) {\n return String(value).padStart(2, '0');\n}\n\nfunction formatDay(year: number, month: number, day: number) {\n return `${year}-${month + 1}-${day}`;\n}\n\nfunction formatSubmitLabel(lang: LangFn, date: Date) {\n const day = formatDateToString(date, lang.code);\n const today = formatDateToString(new Date(), lang.code);\n\n if (day === today) {\n return lang('Conversation.ScheduleMessage.SendToday', formatTime(lang, date));\n }\n\n return lang('Conversation.ScheduleMessage.SendOn', [day, formatTime(lang, date)]);\n}\n\nexport default memo(CalendarModal);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport useLang from '../../hooks/useLang';\n\nimport CalendarModal from '../common/CalendarModal';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n selectedAt?: number;\n};\n\nconst HistoryCalendar: FC = ({\n isOpen, selectedAt,\n}) => {\n const { searchMessagesByDate, closeHistoryCalendar } = getDispatch();\n\n const handleJumpToDate = useCallback((date: Date) => {\n searchMessagesByDate({ timestamp: date.valueOf() / 1000 });\n closeHistoryCalendar();\n }, [closeHistoryCalendar, searchMessagesByDate]);\n\n const lang = useLang();\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return { selectedAt: global.historyCalendarSelectedAt };\n },\n)(HistoryCalendar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { IAlbum } from '../../types';\n\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectUser,\n} from '../../modules/selectors';\nimport {\n isUserId,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n message: ApiMessage;\n album?: IAlbum;\n onClose: () => void;\n};\n\ntype StateProps = {\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\nconst DeleteMessageModal: FC = ({\n isOpen,\n isSchedule,\n message,\n album,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n}) => {\n const {\n deleteMessages,\n deleteScheduledMessages,\n } = getDispatch();\n\n const handleDeleteMessageForAll = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n deleteMessages({ messageIds, shouldDeleteForAll: true });\n onClose();\n }, [deleteMessages, message.id, onClose, album]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n if (isSchedule) {\n deleteScheduledMessages({ messageIds });\n } else {\n deleteMessages({\n messageIds,\n shouldDeleteForAll: false,\n });\n }\n onClose();\n }, [album, message.id, isSchedule, onClose, deleteScheduledMessages, deleteMessages]);\n\n const lang = useLang();\n\n return (\n \n

{lang('AreYouSureDeleteSingleMessage')}

\n {willDeleteForCurrentUserOnly && (\n

{lang('lng_delete_for_me_chat_hint', 1, 'i')}

\n )}\n {willDeleteForAll && (\n

{lang('lng_delete_for_everyone_hint', 1, 'i')}

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { message, isSchedule }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const { canDeleteForAll } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const chat = selectChat(global, message.chatId);\n const contactName = chat && isUserId(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n)(DeleteMessageModal));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isUserId,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId: string;\n messageId: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isPrivateChat: boolean;\n isChatWithSelf: boolean;\n isGroup: boolean;\n isSuperGroup: boolean;\n canPinForAll: boolean;\n contactName?: string;\n};\n\nconst PinMessageModal: FC = ({\n isOpen,\n messageId,\n chatId,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n onClose,\n}) => {\n const { pinMessage } = getDispatch();\n\n const handlePinMessageForAll = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false,\n });\n onClose();\n }, [pinMessage, chatId, messageId, onClose]);\n\n const handlePinMessage = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false, isOneSide: true, isSilent: true,\n });\n onClose();\n }, [chatId, messageId, onClose, pinMessage]);\n\n const lang = useLang();\n\n function renderMessage() {\n if (isChannel) {\n return lang('PinMessageAlertChannel');\n }\n\n if (isGroup || isSuperGroup) {\n return lang('PinMessageAlert');\n }\n\n return lang('PinMessageAlertChat');\n }\n\n return (\n \n

{renderMessage()}

\n \n {canPinForAll && (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const isPrivateChat = isUserId(chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const chat = selectChat(global, chatId);\n const isChannel = Boolean(chat) && isChatChannel(chat);\n const isGroup = Boolean(chat) && isChatBasicGroup(chat);\n const isSuperGroup = Boolean(chat) && isChatSuperGroup(chat);\n const canPinForAll = (isPrivateChat && !isChatWithSelf) || isSuperGroup || isGroup;\n const contactName = chat && isUserId(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n };\n },\n)(PinMessageModal));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId?: string;\n pinnedMessagesCount?: number;\n onClose: () => void;\n onUnpin: () => void;\n};\n\nconst UnpinAllMessagesModal: FC = ({\n isOpen,\n pinnedMessagesCount = 0,\n onClose,\n onUnpin,\n}) => {\n const lang = useLang();\n\n return (\n \n

{lang('Chat.UnpinAllMessagesConfirmation', pinnedMessagesCount, 'i')}

\n \n \n \n );\n};\n\nexport default memo(UnpinAllMessagesModal);\n","import { useEffect } from '../../../lib/teact/teact';\nimport { IS_MAC_OS } from '../../../util/environment';\nimport getKeyFromEvent from '../../../util/getKeyFromEvent';\n\nconst useCopySelectedMessages = (isActive: boolean, copySelectedMessages: NoneToVoidFunction) => {\n useEffect(() => {\n function handleCopy(e: KeyboardEvent) {\n if (((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && getKeyFromEvent(e) === 'c') {\n e.preventDefault();\n copySelectedMessages();\n }\n }\n\n if (isActive) {\n document.addEventListener('keydown', handleCopy, false);\n }\n\n return () => {\n document.removeEventListener('keydown', handleCopy, false);\n };\n }, [copySelectedMessages, isActive]);\n};\n\nexport default useCopySelectedMessages;\n","import React, {\n FC, useCallback, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';\nimport {\n isUserId,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n selectedMessageIds?: number[];\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\nconst DeleteSelectedMessageModal: FC = ({\n isOpen,\n isSchedule,\n selectedMessageIds,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n}) => {\n const {\n deleteMessages,\n deleteScheduledMessages,\n exitMessageSelectMode,\n } = getDispatch();\n\n const prevIsOpen = usePrevious(isOpen);\n\n const handleDeleteMessageForAll = useCallback(() => {\n onClose();\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: true });\n }, [deleteMessages, selectedMessageIds, onClose]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n if (isSchedule) {\n deleteScheduledMessages({ messageIds: selectedMessageIds });\n } else {\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: false });\n }\n\n onClose();\n }, [isSchedule, onClose, deleteScheduledMessages, selectedMessageIds, deleteMessages]);\n\n const lang = useLang();\n\n // Returning `undefined` from FC instead of `` doesn't trigger useHistoryBack\n useEffect(() => {\n if (!isOpen && prevIsOpen) {\n exitMessageSelectMode();\n }\n }, [exitMessageSelectMode, isOpen, prevIsOpen]);\n\n if (!selectedMessageIds) {\n return undefined;\n }\n\n return (\n \n

{lang('AreYouSureDeleteFewMessages')}

\n {willDeleteForCurrentUserOnly && (\n

This will delete them just for you, not for other participants in the chat.

\n )}\n {willDeleteForAll && (\n

This will delete them for everyone in this chat.

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { isSchedule }): StateProps => {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { canDeleteForAll } = selectCanDeleteSelectedMessages(global);\n const chat = selectCurrentChat(global);\n const contactName = chat && isUserId(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n selectedMessageIds,\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n)(DeleteSelectedMessageModal));\n","import { ChangeEvent } from 'react';\n\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ApiReportReason } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport RadioGroup from '../ui/RadioGroup';\nimport InputText from '../ui/InputText';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageIds?: number[];\n onClose: () => void;\n};\n\nconst ReportMessageModal: FC = ({\n isOpen,\n messageIds,\n onClose,\n}) => {\n const {\n reportMessages,\n exitMessageSelectMode,\n } = getDispatch();\n\n const [selectedReason, setSelectedReason] = useState('spam');\n const [description, setDescription] = useState('');\n\n const handleReport = () => {\n reportMessages({ messageIds, reason: selectedReason, description });\n exitMessageSelectMode();\n onClose();\n };\n\n const handleSelectReason = useCallback((value: string) => {\n setSelectedReason(value as ApiReportReason);\n }, []);\n\n const handleDescriptionChange = useCallback((e: ChangeEvent) => {\n setDescription(e.target.value);\n }, []);\n\n const lang = useLang();\n\n const REPORT_OPTIONS: { value: ApiReportReason; label: string }[] = [\n { value: 'spam', label: lang('lng_report_reason_spam') },\n { value: 'violence', label: lang('lng_report_reason_violence') },\n { value: 'pornography', label: lang('lng_report_reason_pornography') },\n { value: 'childAbuse', label: lang('lng_report_reason_child_abuse') },\n { value: 'copyright', label: lang('ReportPeer.ReasonCopyright') },\n { value: 'other', label: lang('lng_report_reason_other') },\n ];\n\n if (!messageIds) {\n return undefined;\n }\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default memo(ReportMessageModal);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { MessageListType } from '../../global/types';\n\nimport {\n selectCanDeleteSelectedMessages,\n selectCanDownloadSelectedMessages,\n selectCanReportSelectedMessages,\n selectCurrentMessageList,\n selectHasProtectedMessage,\n selectSelectedMessagesCount,\n} from '../../modules/selectors';\nimport useFlag from '../../hooks/useFlag';\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\nimport useCopySelectedMessages from './hooks/useCopySelectedMessages';\n\nimport Button from '../ui/Button';\n\nimport DeleteSelectedMessageModal from './DeleteSelectedMessageModal';\nimport ReportMessageModal from '../common/ReportMessageModal';\n\nimport './MessageSelectToolbar.scss';\n\nexport type OwnProps = {\n isActive?: boolean;\n canPost?: boolean;\n messageListType?: MessageListType;\n};\n\ntype StateProps = {\n isSchedule: boolean;\n selectedMessagesCount?: number;\n canDeleteMessages?: boolean;\n canReportMessages?: boolean;\n canDownloadMessages?: boolean;\n hasProtectedMessage?: boolean;\n selectedMessageIds?: number[];\n};\n\nconst MessageSelectToolbar: FC = ({\n canPost,\n isActive,\n messageListType,\n isSchedule,\n selectedMessagesCount,\n canDeleteMessages,\n canReportMessages,\n canDownloadMessages,\n hasProtectedMessage,\n selectedMessageIds,\n}) => {\n const {\n exitMessageSelectMode,\n openForwardMenuForSelectedMessages,\n downloadSelectedMessages,\n copySelectedMessages,\n } = getDispatch();\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();\n\n useCopySelectedMessages(Boolean(isActive), copySelectedMessages);\n useEffect(() => {\n return isActive && !isDeleteModalOpen && !isReportModalOpen\n ? captureKeyboardListeners({\n onBackspace: openDeleteModal,\n onDelete: openDeleteModal,\n onEsc: exitMessageSelectMode,\n })\n : undefined;\n }, [isActive, isDeleteModalOpen, isReportModalOpen, openDeleteModal, exitMessageSelectMode]);\n\n const handleCopy = useCallback(() => {\n copySelectedMessages();\n exitMessageSelectMode();\n }, [copySelectedMessages, exitMessageSelectMode]);\n\n const handleDownload = useCallback(() => {\n downloadSelectedMessages();\n exitMessageSelectMode();\n }, [downloadSelectedMessages, exitMessageSelectMode]);\n\n const prevSelectedMessagesCount = usePrevious(selectedMessagesCount || undefined, true);\n const renderingSelectedMessagesCount = isActive ? selectedMessagesCount : prevSelectedMessagesCount;\n\n const lang = useLang();\n\n const formattedMessagesCount = lang('VoiceOver.Chat.MessagesSelected', renderingSelectedMessagesCount, 'i');\n\n const className = buildClassName(\n 'MessageSelectToolbar',\n canPost && 'with-composer',\n isActive && 'shown',\n );\n\n const renderButton = (\n icon: string, label: string, onClick: AnyToVoidFunction, disabled?: boolean, destructive?: boolean,\n ) => {\n return (\n \n \n \n );\n };\n\n return (\n
\n
\n \n \n \n \n {formattedMessagesCount}\n \n\n {Boolean(selectedMessagesCount) && (\n
\n {messageListType !== 'scheduled' && (\n renderButton(\n 'forward', lang('Chat.ForwardActionHeader'), openForwardMenuForSelectedMessages, hasProtectedMessage,\n )\n )}\n {canReportMessages && (\n renderButton('flag', lang('Conversation.ReportMessages'), openReportModal)\n )}\n {canDownloadMessages && (\n renderButton('download', lang('lng_media_download'), handleDownload, hasProtectedMessage)\n )}\n {renderButton('copy', lang('lng_context_copy_selected_items'), handleCopy, hasProtectedMessage)}\n {renderButton('delete', lang('EditAdminGroupDeleteMessages'), openDeleteModal, !canDeleteMessages, true)}\n
\n )}\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { type: messageListType, chatId } = selectCurrentMessageList(global) || {};\n const { canDelete } = selectCanDeleteSelectedMessages(global);\n const canReport = selectCanReportSelectedMessages(global);\n const canDownload = selectCanDownloadSelectedMessages(global);\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const hasProtectedMessage = chatId ? selectHasProtectedMessage(global, chatId, selectedMessageIds) : false;\n\n return {\n isSchedule: messageListType === 'scheduled',\n selectedMessagesCount: selectSelectedMessagesCount(global),\n canDeleteMessages: canDelete,\n canReportMessages: canReport,\n canDownloadMessages: canDownload,\n selectedMessageIds,\n hasProtectedMessage,\n };\n },\n)(MessageSelectToolbar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport useLang from '../../hooks/useLang';\nimport { selectChatMessage } from '../../modules/selectors';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport PrivateChatInfo from './PrivateChatInfo';\nimport ListItem from '../ui/ListItem';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\nexport type StateProps = {\n memberIds?: string[];\n};\n\nconst CLOSE_ANIMATION_DURATION = 100;\n\nconst SeenByModal: FC = ({\n isOpen,\n memberIds,\n}) => {\n const {\n openChat,\n closeSeenByModal,\n } = getDispatch();\n\n const lang = useLang();\n\n const handleClick = useCallback((userId: string) => {\n closeSeenByModal();\n\n setTimeout(() => {\n openChat({ id: userId });\n }, CLOSE_ANIMATION_DURATION);\n }, [closeSeenByModal, openChat]);\n\n const renderingMemberIds = useCurrentOrPrev(memberIds, true);\n\n return (\n \n
\n {renderingMemberIds && renderingMemberIds.map((userId) => (\n handleClick(userId)}\n >\n \n \n ))}\n
\n \n {lang('Close')}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, messageId } = global.seenByModal || {};\n if (!chatId || !messageId) {\n return {};\n }\n\n return {\n memberIds: selectChatMessage(global, chatId, messageId)?.seenByUserIds,\n };\n },\n)(SeenByModal));\n","import React, {\n FC, useCallback, memo, useMemo, useEffect, useState, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport useLang from '../../hooks/useLang';\nimport { selectChatMessage } from '../../modules/selectors';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport { getUserFullName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport { unique } from '../../util/iteratees';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Avatar from '../common/Avatar';\nimport ListItem from '../ui/ListItem';\nimport ReactionStaticEmoji from '../common/ReactionStaticEmoji';\nimport Loading from '../ui/Loading';\n\nimport './ReactorListModal.scss';\n\nconst MIN_REACTIONS_COUNT_FOR_FILTERS = 10;\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\nexport type StateProps = Pick & {\n chatId?: string;\n messageId?: number;\n};\n\nconst ReactorListModal: FC = ({\n isOpen,\n reactors,\n reactions,\n chatId,\n messageId,\n seenByUserIds,\n}) => {\n const {\n loadReactors,\n closeReactorListModal,\n openChat,\n } = getDispatch();\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n const lang = useLang();\n const [isClosing, startClosing, stopClosing] = useFlag(false);\n const [chosenTab, setChosenTab] = useState(undefined);\n const canShowFilters = reactors && reactions && reactors.count >= MIN_REACTIONS_COUNT_FOR_FILTERS\n && reactions.results.length > 1;\n const chatIdRef = useRef();\n\n useEffect(() => {\n if (isClosing && !isOpen) {\n stopClosing();\n setChosenTab(undefined);\n }\n }, [isClosing, isOpen, stopClosing]);\n\n const handleCloseAnimationEnd = useCallback(() => {\n if (chatIdRef.current) {\n openChat({ id: chatIdRef.current });\n }\n closeReactorListModal();\n }, [closeReactorListModal, openChat]);\n\n const handleClose = useCallback(() => {\n startClosing();\n }, [startClosing]);\n\n const handleClick = useCallback((userId: string) => {\n chatIdRef.current = userId;\n handleClose();\n }, [handleClose]);\n\n const handleLoadMore = useCallback(() => {\n loadReactors({\n chatId,\n messageId,\n });\n }, [chatId, loadReactors, messageId]);\n\n const allReactions = useMemo(() => {\n return reactors?.reactions ? unique(reactors.reactions.map((l) => l.reaction)) : [];\n }, [reactors?.reactions]);\n\n const userIds = useMemo(() => {\n if (chosenTab) {\n return reactors?.reactions.filter((l) => l.reaction === chosenTab).map((l) => l.userId);\n }\n return unique(reactors?.reactions.map((l) => l.userId).concat(seenByUserIds || []) || []);\n }, [chosenTab, reactors?.reactions, seenByUserIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n handleLoadMore, userIds, reactors && reactors.nextOffset === undefined,\n );\n\n useEffect(() => {\n getMore?.({ direction: LoadMoreDirection.Backwards });\n }, [getMore]);\n\n return (\n \n {canShowFilters && (\n
\n setChosenTab(undefined)}\n >\n \n {reactors?.count && formatIntegerCompact(reactors.count)}\n \n {allReactions.map((reaction) => {\n const count = reactions?.results.find((l) => l.reaction === reaction)?.count;\n return (\n setChosenTab(reaction)}\n >\n \n {count && formatIntegerCompact(count)}\n \n );\n })}\n
\n )}\n\n
\n {viewportIds?.length ? (\n \n {viewportIds?.map(\n (userId) => {\n const user = usersById[userId];\n const fullName = getUserFullName(user);\n const reaction = reactors?.reactions.find((l) => l.userId === userId)?.reaction;\n return (\n handleClick(userId)}\n >\n \n
\n

{fullName && renderText(fullName)}

\n
\n {reaction && }\n \n );\n },\n )}\n \n ) : }\n
\n \n {lang('Close')}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, messageId } = global.reactorModal || {};\n const message = chatId && messageId ? selectChatMessage(global, chatId, messageId) : undefined;\n\n return {\n chatId,\n messageId,\n reactions: message?.reactions,\n reactors: message?.reactors,\n seenByUserIds: message?.seenByUserIds,\n };\n },\n)(ReactorListModal));\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ActiveEmojiInteraction } from '../../global/types';\nimport { ApiMediaFormat } from '../../api/types';\n\nimport { IS_ANDROID } from '../../util/environment';\nimport useFlag from '../../hooks/useFlag';\nimport useMedia from '../../hooks/useMedia';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectAnimatedEmojiEffect,\n} from '../../modules/selectors';\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from '../common/helpers/animatedAssets';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\n\nimport AnimatedSticker from '../common/AnimatedSticker';\n\nimport './EmojiInteractionAnimation.scss';\n\nexport type OwnProps = {\n activeEmojiInteraction: ActiveEmojiInteraction;\n};\n\ntype StateProps = {\n effectAnimationId?: string;\n localEffectAnimation?: string;\n};\n\nconst HIDE_ANIMATION_DURATION = 250;\nconst PLAYING_DURATION = 3000;\nconst EFFECT_SIZE = 240;\n\nconst EmojiInteractionAnimation: FC = ({\n effectAnimationId,\n localEffectAnimation,\n activeEmojiInteraction,\n}) => {\n const { stopActiveEmojiInteraction } = getDispatch();\n\n const [isHiding, startHiding] = useFlag(false);\n const [isPlaying, startPlaying] = useFlag(false);\n const timeoutRef = useRef();\n\n const stop = useCallback(() => {\n startHiding();\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n setTimeout(() => {\n stopActiveEmojiInteraction({ id: activeEmojiInteraction.id });\n }, HIDE_ANIMATION_DURATION);\n }, [activeEmojiInteraction.id, startHiding, stopActiveEmojiInteraction]);\n\n const handleCancelAnimation = useCallback((e: UIEvent) => {\n if (!(e.target as HTMLElement)?.closest('.AnimatedEmoji')) {\n stop();\n }\n }, [stop]);\n\n useEffect(() => {\n document.addEventListener('touchstart', handleCancelAnimation);\n document.addEventListener('touchmove', handleCancelAnimation);\n document.addEventListener('mousedown', handleCancelAnimation);\n document.addEventListener('wheel', handleCancelAnimation);\n\n return () => {\n document.removeEventListener('touchstart', handleCancelAnimation);\n document.removeEventListener('touchmove', handleCancelAnimation);\n document.removeEventListener('mousedown', handleCancelAnimation);\n document.removeEventListener('wheel', handleCancelAnimation);\n };\n }, [handleCancelAnimation]);\n\n useLayoutEffect(() => {\n const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n timeoutRef.current = setTimeout(() => {\n stop();\n dispatchHeavyAnimationStop();\n }, PLAYING_DURATION);\n }, [stop]);\n\n const effectAnimationData = useMedia(`sticker${effectAnimationId}`, !effectAnimationId, ApiMediaFormat.Lottie);\n\n const [localEffectAnimationData, setLocalEffectAnimationData] = useState();\n useEffect(() => {\n if (localEffectAnimation) {\n getAnimationData(localEffectAnimation as keyof typeof ANIMATED_STICKERS_PATHS).then((data) => {\n setLocalEffectAnimationData(data);\n });\n }\n }, [localEffectAnimation]);\n\n if (!activeEmojiInteraction.startSize) {\n return undefined;\n }\n\n const scale = (activeEmojiInteraction.startSize || 0) / EFFECT_SIZE;\n\n return (\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { activeEmojiInteraction }): StateProps => {\n const animatedEffect = activeEmojiInteraction.animatedEffect !== undefined\n && selectAnimatedEmojiEffect(global, activeEmojiInteraction.animatedEffect);\n return {\n effectAnimationId: animatedEffect ? animatedEffect.id : undefined,\n localEffectAnimation: !animatedEffect && activeEmojiInteraction.animatedEffect\n && Object.keys(ANIMATED_STICKERS_PATHS).includes(activeEmojiInteraction.animatedEffect)\n ? activeEmojiInteraction.animatedEffect : undefined,\n };\n },\n)(EmojiInteractionAnimation));\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nconst useSendWithEnter = (\n onSelect: NoneToVoidFunction,\n) => {\n // eslint-disable-next-line no-null/no-null\n const buttonRef = useRef(null);\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n const isFocused = buttonRef.current === document.activeElement;\n\n if (isFocused) {\n onSelect();\n }\n }, [onSelect]);\n\n useEffect(() => {\n window.addEventListener('keydown', handleKeyDown, false);\n\n return () => window.removeEventListener('keydown', handleKeyDown, false);\n }, [handleKeyDown]);\n\n return buttonRef;\n};\n\nexport default useSendWithEnter;\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport { isUserId, getPrivateChatUserId, selectIsChatMuted } from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectIsChatPinned, selectNotifySettings, selectNotifyExceptions,\n} from '../../../modules/selectors';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\nimport ChatFolderModal from '../ChatFolderModal.async';\n\ntype OwnProps = {\n chatId: string;\n withUsername?: boolean;\n onClick: (id: string) => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n user?: ApiUser;\n isPinned?: boolean;\n isMuted?: boolean;\n canChangeFolder?: boolean;\n};\n\nconst LeftSearchResultChat: FC = ({\n chatId,\n withUsername,\n onClick,\n chat,\n user,\n isPinned,\n isMuted,\n canChangeFolder,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isChatFolderModalOpen, openChatFolderModal, closeChatFolderModal] = useFlag();\n\n const contextActions = useChatContextActions({\n chat,\n user,\n isPinned,\n isMuted,\n canChangeFolder,\n handleDelete: openDeleteModal,\n handleChatFolderChange: openChatFolderModal,\n }, true);\n\n const handleClick = () => {\n onClick(chatId);\n };\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n {isUserId(chatId) ? (\n \n ) : (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const privateChatUserId = chat && getPrivateChatUserId(chat);\n const user = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n const isPinned = selectIsChatPinned(global, chatId);\n const isMuted = chat\n ? selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global))\n : undefined;\n\n return {\n chat,\n user,\n isPinned,\n isMuted,\n canChangeFolder: Boolean(global.chatFolders.orderedIds?.length),\n };\n },\n)(LeftSearchResultChat));\n","import React, {\n FC, useEffect, useCallback, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport { getUserFirstOrLastName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport { throttle } from '../../../util/schedulers';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport LeftSearchResultChat from './LeftSearchResultChat';\n\nimport './RecentContacts.scss';\n\ntype OwnProps = {\n onReset: () => void;\n};\n\ntype StateProps = {\n topUserIds?: string[];\n usersById: Record;\n recentlyFoundChatIds?: string[];\n};\n\nconst SEARCH_CLOSE_TIMEOUT_MS = 250;\nconst NBSP = '\\u00A0';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst RecentContacts: FC = ({\n topUserIds, usersById, recentlyFoundChatIds,\n onReset,\n}) => {\n const {\n loadTopUsers, loadContactList, openChat,\n addRecentlyFoundChatId, clearRecentlyFoundChats,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const topUsersRef = useRef(null);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadTopUsers();\n // Loading full contact list for quick local search before user enters the query\n loadContactList();\n });\n }, [loadTopUsers, loadContactList]);\n\n useHorizontalScroll(topUsersRef.current, !topUserIds);\n\n const handleClick = useCallback((id: string) => {\n openChat({ id, shouldReplaceHistory: true });\n onReset();\n setTimeout(() => {\n addRecentlyFoundChatId({ id });\n }, SEARCH_CLOSE_TIMEOUT_MS);\n }, [openChat, addRecentlyFoundChatId, onReset]);\n\n const lang = useLang();\n\n return (\n
\n {topUserIds && (\n
\n
\n {topUserIds.map((userId) => (\n
handleClick(userId)} dir={lang.isRtl ? 'rtl' : undefined}>\n \n
{renderText(getUserFirstOrLastName(usersById[userId]) || NBSP)}
\n
\n ))}\n
\n
\n )}\n {recentlyFoundChatIds && (\n
\n

\n {lang('Recent')}\n\n \n \n \n

\n {recentlyFoundChatIds.map((id) => (\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: topUserIds } = global.topPeers;\n const usersById = global.users.byId;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n return {\n topUserIds,\n usersById,\n recentlyFoundChatIds,\n };\n },\n)(RecentContacts));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus,\n} from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n getPrivateChatUserId,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport renderText from '../../common/helpers/renderText';\nimport useMedia from '../../../hooks/useMedia';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport ListItem from '../../ui/ListItem';\nimport Link from '../../ui/Link';\n\nimport './ChatMessage.scss';\n\ntype OwnProps = {\n searchQuery?: string;\n message: ApiMessage;\n chatId: string;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n lastSyncTime?: number;\n};\n\nconst ChatMessage: FC = ({\n message,\n searchQuery,\n chatId,\n chat,\n privateChatUser,\n lastSyncTime,\n}) => {\n const { focusMessage } = getDispatch();\n\n const mediaThumbnail = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'micro'));\n const isRoundVideo = Boolean(getMessageRoundVideo(message));\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId, messageId: message.id });\n }, [chatId, focusMessage, message.id]);\n\n const lang = useLang();\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n \n
\n
\n
\n

{renderText(getChatTitle(lang, chat, privateChatUser))}

\n {chat.isVerified && }\n
\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n\n
\n
\n
\n {renderSummary(lang, message, mediaBlobUrl || mediaThumbnail, searchQuery, isRoundVideo)}\n
\n
\n
\n \n );\n};\n\nfunction renderSummary(\n lang: LangFn, message: ApiMessage, blobUrl?: string, searchQuery?: string, isRoundVideo?: boolean,\n) {\n if (!blobUrl) {\n return renderMessageSummary(lang, message, undefined, searchQuery);\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderMessageSummary(lang, message, true, searchQuery)}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const privateChatUserId = getPrivateChatUserId(chat);\n\n return {\n chat,\n lastSyncTime: global.lastSyncTime,\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n };\n },\n)(ChatMessage));\n","import React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { formatDateToString } from '../../../util/dateFormat';\n\nimport './DateSuggest.scss';\n\nconst SUGGESTION_COUNT = 8;\n\nexport type OwnProps = {\n searchDate: string;\n onSelect: (value: Date) => void;\n};\n\nconst DateSuggest: FC = ({\n searchDate, onSelect,\n}) => {\n const suggestions = useMemo(() => getSuggestionsFromDate(searchDate), [searchDate]);\n return (\n
\n {suggestions.map(({ date, text }) => {\n return (\n onSelect(date)}\n className=\"date-item\"\n key={text}\n >\n \n {text}\n \n );\n })}\n
\n );\n};\n\nfunction getSuggestionsFromDate(searchDate: string) {\n const hasYear = searchDate.match(/^\\d{2,4}-\\d{2}-\\d{2}$/g);\n if (hasYear) {\n const date = new Date(searchDate);\n return [{ date, text: formatDateToString(date) }];\n }\n\n const suggestion = [];\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n const latestYear = currentDate.getTime() > (new Date(`${currentYear}-${searchDate}`)).getTime()\n ? currentYear\n : currentYear - 1;\n\n for (let i = 0; i < SUGGESTION_COUNT; i++) {\n const date = new Date(`${latestYear - i}-${searchDate}`);\n suggestion.push({ date, text: formatDateToString(date) });\n }\n\n return suggestion;\n}\n\nexport default memo(DateSuggest);\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { unique } from '../../../util/iteratees';\nimport {\n sortChatIds,\n filterUsersByName,\n} from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport LeftSearchResultChat from './LeftSearchResultChat';\nimport RecentContacts from './RecentContacts';\nimport ChatMessage from './ChatMessage';\nimport DateSuggest from './DateSuggest';\nimport Link from '../../ui/Link';\nimport NothingFound from '../../common/NothingFound';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n searchDate?: number;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: string;\n localContactIds?: string[];\n localChatIds?: string[];\n localUserIds?: string[];\n globalChatIds?: string[];\n globalUserIds?: string[];\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\nconst MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH = 4;\nconst LESS_LIST_ITEMS_AMOUNT = 5;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatResults: FC = ({\n searchQuery, searchDate, dateSearchQuery, currentUserId,\n localContactIds, localChatIds, localUserIds, globalChatIds, globalUserIds,\n foundIds, globalMessagesByChatId, chatsById, fetchingStatus, lastSyncTime,\n onReset, onSearchDateSelect,\n}) => {\n const {\n openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,\n } = getDispatch();\n\n const lang = useLang();\n\n const [shouldShowMoreLocal, setShouldShowMoreLocal] = useState(false);\n const [shouldShowMoreGlobal, setShouldShowMoreGlobal] = useState(false);\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const handleChatClick = useCallback(\n (id: string) => {\n openChat({ id, shouldReplaceHistory: true });\n\n if (id !== currentUserId) {\n addRecentlyFoundChatId({ id });\n }\n\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n onReset();\n }\n },\n [currentUserId, openChat, addRecentlyFoundChatId, onReset],\n );\n\n const handlePickerItemClick = useCallback((id: string) => {\n setGlobalSearchChatId({ id });\n }, [setGlobalSearchChatId]);\n\n const localResults = useMemo(() => {\n if (!searchQuery || (searchQuery.startsWith('@') && searchQuery.length < 2)) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const contactIdsWithMe = [\n ...(currentUserId ? [currentUserId] : []),\n ...(localContactIds || []),\n ];\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const foundContactIds = filterUsersByName(\n contactIdsWithMe, usersById, searchQuery, currentUserId, lang('SavedMessages'),\n );\n\n return [\n ...sortChatIds(unique([\n ...(foundContactIds || []),\n ...(localChatIds || []),\n ...(localUserIds || []),\n ]), chatsById, undefined, currentUserId ? [currentUserId] : undefined),\n ];\n }, [searchQuery, currentUserId, localContactIds, lang, localChatIds, localUserIds, chatsById]);\n\n const globalResults = useMemo(() => {\n if (!searchQuery || searchQuery.length < MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH || !globalChatIds || !globalUserIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return sortChatIds(\n unique([...globalChatIds, ...globalUserIds]),\n chatsById,\n true,\n );\n }, [chatsById, globalChatIds, globalUserIds, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if ((!searchQuery && !searchDate) || !foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId?.[chatId]?.byId[Number(messageId)];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId, searchQuery, searchDate]);\n\n const handleClickShowMoreLocal = useCallback(() => {\n setShouldShowMoreLocal(!shouldShowMoreLocal);\n }, [shouldShowMoreLocal]);\n\n const handleClickShowMoreGlobal = useCallback(() => {\n setShouldShowMoreGlobal(!shouldShowMoreGlobal);\n }, [shouldShowMoreGlobal]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = renderMessageSummary(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages\n && !localResults.length && !globalResults.length && !foundMessages.length;\n\n if (!searchQuery && !searchDate) {\n return ;\n }\n\n return (\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {Boolean(localResults.length) && (\n
\n {localResults.map((id) => (\n \n ))}\n
\n )}\n {Boolean(localResults.length) && (\n
\n

\n {localResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreLocal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionDialogs')}\n

\n {localResults.map((id, index) => {\n if (!shouldShowMoreLocal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {Boolean(globalResults.length) && (\n
\n

\n {globalResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreGlobal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionGlobal')}\n

\n {globalResults.map((id, index) => {\n if (!shouldShowMoreGlobal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {Boolean(foundMessages.length) && (\n
\n

{lang('SearchMessages')}

\n {foundMessages.map(renderFoundMessage)}\n
\n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n\n const { userIds: localContactIds } = global.contactList || {};\n\n if (!localContactIds) {\n return {\n chatsById,\n };\n }\n\n const {\n currentUserId, messages, lastSyncTime,\n } = global;\n const {\n fetchingStatus, globalResults, localResults, resultsByType,\n } = global.globalSearch;\n const { chatIds: globalChatIds, userIds: globalUserIds } = globalResults || {};\n const { chatIds: localChatIds, userIds: localUserIds } = localResults || {};\n const { byChatId: globalMessagesByChatId } = messages;\n const foundIds = resultsByType?.text?.foundIds;\n\n return {\n currentUserId,\n localContactIds,\n localChatIds,\n localUserIds,\n globalChatIds,\n globalUserIds,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n)(ChatResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport { renderMessageSummary } from '../../common/helpers/renderMessageText';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport NothingFound from '../../common/NothingFound';\nimport ChatMessage from './ChatMessage';\nimport DateSuggest from './DateSuggest';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: string;\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatMessageResults: FC = ({\n searchQuery,\n currentUserId,\n dateSearchQuery,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n onSearchDateSelect,\n}) => {\n const { searchMessagesGlobal } = getDispatch();\n\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n chatId: currentUserId,\n });\n });\n }\n }, [currentUserId, lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId?.[chatId]?.byId[Number(messageId)];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = renderMessageSummary(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages && !foundMessages.length;\n\n return (\n
\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {foundMessages.map(renderFoundMessage)}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n const { currentUserId, messages: { byChatId: globalMessagesByChatId }, lastSyncTime } = global;\n const { fetchingStatus, resultsByType } = global.globalSearch;\n\n const { foundIds } = (resultsByType?.text) || {};\n\n return {\n currentUserId,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n)(ChatMessageResults));\n","import { GlobalState } from '../../../../global/types';\nimport {\n ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser,\n} from '../../../../api/types';\nimport { ISettings } from '../../../../types';\n\nimport { selectChat, selectTheme } from '../../../../modules/selectors';\n\nexport type StateProps = {\n theme: ISettings['theme'];\n isLoading?: boolean;\n chatsById: Record;\n usersById: Record;\n globalMessagesByChatId?: Record }>;\n foundIds?: string[];\n lastSyncTime?: number;\n searchChatId?: string;\n activeDownloads: Record;\n isChatProtected?: boolean;\n};\n\nexport function createMapStateToProps(type: ApiGlobalMessageSearchType) {\n return (global: GlobalState, props: any) => {\n const { byId: chatsById } = global.chats;\n const { byId: usersById } = global.users;\n const {\n fetchingStatus, resultsByType, chatId,\n } = global.globalSearch;\n\n // One component is used for two different types of results.\n // The differences between them are only in the isVoice property.\n // The rest of the search results use their own personal components.\n const currentType = type !== 'audio' ? type : (props?.isVoice ? 'voice' : 'audio');\n\n const { byChatId: globalMessagesByChatId } = global.messages;\n const foundIds = resultsByType?.[currentType]?.foundIds;\n\n const activeDownloads = global.activeDownloads.byChatId;\n\n return {\n theme: selectTheme(global),\n isLoading: foundIds === undefined\n || (fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false),\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n searchChatId: chatId,\n activeDownloads,\n isChatProtected: chatId ? selectChat(global, chatId)?.isProtected : undefined,\n lastSyncTime: global.lastSyncTime,\n };\n };\n}\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { LoadMoreDirection, MediaViewerOrigin } from '../../../types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport buildClassName from '../../../util/buildClassName';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Media from '../../common/Media';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\nconst CURRENT_TYPE = 'media';\nconst INTERSECTION_THROTTLE = 500;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst MediaResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n isChatProtected,\n}) => {\n const {\n searchMessagesGlobal,\n openMediaViewer,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleSelectMedia = useCallback((messageId: number, chatId: string) => {\n openMediaViewer({\n chatId,\n messageId,\n origin: MediaViewerOrigin.SearchResult,\n });\n }, [openMediaViewer]);\n\n function renderGallery() {\n return (\n
\n {foundMessages.map((message) => (\n \n ))}\n
\n );\n }\n\n function renderSearchResult() {\n return foundMessages.map((message) => (\n \n ));\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n const isMediaGrid = canRenderContents && foundIds && foundIds.length > 0 && !searchQuery;\n const isMessageList = canRenderContents && foundIds && foundIds.length > 0 && searchQuery;\n\n const classNames = buildClassName(\n 'search-content custom-scroll',\n isMessageList && 'chat-list',\n );\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {isMediaGrid && renderGallery()}\n {isMessageList && renderSearchResult()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n)(MediaResults));\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport WebLink from '../../common/WebLink';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\nconst CURRENT_TYPE = 'links';\nconst INTERSECTION_THROTTLE = 500;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst LinkResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n isChatProtected,\n}) => {\n const {\n searchMessagesGlobal,\n focusMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: string) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n)(LinkResults));\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport { getMessageDocument } from '../../../modules/helpers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\n\nimport Document from '../../common/Document';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\nconst CURRENT_TYPE = 'documents';\nconst INTERSECTION_THROTTLE = 500;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst FileResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n activeDownloads,\n lastSyncTime,\n}) => {\n const {\n searchMessagesGlobal,\n focusMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const { observe: observeIntersectionForMedia } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n const message = globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n\n return message && getMessageDocument(message) ? message : undefined;\n }).filter(Boolean) as ApiMessage[];\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: string) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

{formatMonthAndYear(lang, new Date(message.date * 1000))}

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n)(FileResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { AudioOrigin, LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Audio from '../../common/Audio';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n isVoice?: boolean;\n searchQuery?: string;\n};\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst AudioResults: FC = ({\n theme,\n isVoice,\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n activeDownloads,\n}) => {\n const {\n searchMessagesGlobal,\n focusMessage,\n openAudioPlayer,\n } = getDispatch();\n\n const lang = useLang();\n const currentType = isVoice ? 'voice' : 'audio';\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: currentType,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [currentType, lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_');\n\n return globalMessagesByChatId[chatId]?.byId[Number(messageId)];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: string) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n const handlePlayAudio = useCallback((messageId: number, chatId: string) => {\n openAudioPlayer({ chatId, messageId });\n }, [openAudioPlayer]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps('audio'),\n)(AudioResults));\n","import React, {\n FC, memo, useCallback, useState, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalSearchContent } from '../../../types';\n\nimport { parseDateString } from '../../../util/dateFormat';\nimport useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport TabList from '../../ui/TabList';\nimport Transition from '../../ui/Transition';\nimport ChatResults from './ChatResults';\nimport UserChatResults from './ChatMessageResults';\nimport MediaResults from './MediaResults';\nimport LinkResults from './LinkResults';\nimport FileResults from './FileResults';\nimport AudioResults from './AudioResults';\n\nimport './LeftSearch.scss';\n\nexport type OwnProps = {\n searchQuery?: string;\n searchDate?: number;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentContent?: GlobalSearchContent;\n chatId?: string;\n};\n\nconst TABS = [\n { type: GlobalSearchContent.ChatList, title: 'SearchAllChatsShort' },\n { type: GlobalSearchContent.Media, title: 'SharedMediaTab2' },\n { type: GlobalSearchContent.Links, title: 'SharedLinksTab2' },\n { type: GlobalSearchContent.Files, title: 'SharedFilesTab2' },\n { type: GlobalSearchContent.Music, title: 'SharedMusicTab2' },\n { type: GlobalSearchContent.Voice, title: 'SharedVoiceTab2' },\n];\n\nconst CHAT_TABS = [\n { type: GlobalSearchContent.ChatList, title: 'All Messages' },\n ...TABS.slice(1),\n];\n\nconst TRANSITION_RENDER_COUNT = Object.keys(GlobalSearchContent).length / 2;\n\nconst LeftSearch: FC = ({\n searchQuery,\n searchDate,\n isActive,\n currentContent = GlobalSearchContent.ChatList,\n chatId,\n onReset,\n}) => {\n const {\n setGlobalSearchContent,\n setGlobalSearchDate,\n } = getDispatch();\n\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(currentContent);\n const dateSearchQuery = useMemo(() => parseDateString(searchQuery), [searchQuery]);\n\n const handleSwitchTab = useCallback((index: number) => {\n const tab = TABS[index];\n setGlobalSearchContent({ content: tab.type });\n setActiveTab(index);\n }, [setGlobalSearchContent]);\n\n const handleSearchDateSelect = useCallback((value: Date) => {\n setGlobalSearchDate({ date: value.getTime() / 1000 });\n }, [setGlobalSearchDate]);\n\n useHistoryBack(isActive, onReset, undefined, undefined, true);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isActive, undefined, '.ListItem-button', true);\n\n return (\n
\n \n \n {(() => {\n switch (currentContent) {\n case GlobalSearchContent.ChatList:\n if (chatId) {\n return (\n \n );\n }\n return (\n \n );\n case GlobalSearchContent.Media:\n return ;\n case GlobalSearchContent.Links:\n return ;\n case GlobalSearchContent.Files:\n return ;\n case GlobalSearchContent.Music:\n return (\n \n );\n case GlobalSearchContent.Voice:\n return (\n \n );\n default:\n return undefined;\n }\n })()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentContent, chatId } = global.globalSearch;\n\n return { currentContent, chatId };\n },\n)(LeftSearch));\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\n\nexport type TwoFaActions = (\n 'setCurrentPassword' | 'setPassword' | 'setHint' | 'setEmail' | 'reset'\n);\nexport type TwoFaDispatch = Dispatch;\n\nexport type TwoFaState = {\n currentPassword: string;\n password: string;\n hint: string;\n email: string;\n};\n\nconst INITIAL_STATE: TwoFaState = {\n currentPassword: '',\n password: '',\n hint: '',\n email: '',\n};\n\nconst twoFaReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setCurrentPassword':\n return {\n ...state,\n currentPassword: action.payload,\n };\n\n case 'setPassword':\n return {\n ...state,\n password: action.payload,\n };\n\n case 'setHint':\n return {\n ...state,\n hint: action.payload,\n };\n\n case 'setEmail':\n return {\n ...state,\n email: action.payload,\n };\n\n case 'reset':\n return INITIAL_STATE;\n\n default:\n return state;\n }\n};\n\nconst useTwoFaReducer = () => {\n return useReducer(twoFaReducer, INITIAL_STATE);\n};\n\nexport default useTwoFaReducer;\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport useLang from '../../../hooks/useLang';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n currentScreen: SettingsScreens;\n editedFolderId?: number;\n onReset: () => void;\n onSaveFilter: () => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n};\n\nconst SettingsHeader: FC = ({\n currentScreen,\n editedFolderId,\n onReset,\n onSaveFilter,\n onScreenSelect,\n}) => {\n const {\n signOut,\n deleteChatFolder,\n } = getDispatch();\n\n const [isSignOutDialogOpen, setIsSignOutDialogOpen] = useState(false);\n const [isDeleteFolderDialogOpen, setIsDeleteFolderDialogOpen] = useState(false);\n\n const openSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(true);\n }, []);\n\n const closeSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(false);\n }, []);\n\n const openDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(true);\n }, []);\n\n const closeDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(false);\n }, []);\n\n const handleSignOutMessage = useCallback(() => {\n closeSignOutConfirmation();\n signOut();\n }, [closeSignOutConfirmation, signOut]);\n\n const handleDeleteFolderMessage = useCallback(() => {\n closeDeleteFolderConfirmation();\n deleteChatFolder({ id: editedFolderId });\n onReset();\n }, [editedFolderId, closeDeleteFolderConfirmation, deleteChatFolder, onReset]);\n\n const SettingsMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n const lang = useLang();\n\n function renderHeaderContent() {\n switch (currentScreen) {\n case SettingsScreens.EditProfile:\n return

{lang('lng_settings_information')}

;\n case SettingsScreens.General:\n return

{lang('General')}

;\n case SettingsScreens.QuickReaction:\n return

{lang('DoubleTapSetting')}

;\n case SettingsScreens.Notifications:\n return

{lang('Notifications')}

;\n case SettingsScreens.DataStorage:\n return

{lang('DataSettings')}

;\n case SettingsScreens.Privacy:\n return

{lang('PrivacySettings')}

;\n case SettingsScreens.Language:\n return

{lang('Language')}

;\n\n case SettingsScreens.GeneralChatBackground:\n return

{lang('ChatBackground')}

;\n case SettingsScreens.GeneralChatBackgroundColor:\n return

{lang('SetColor')}

;\n\n case SettingsScreens.PrivacyPhoneNumber:\n return

{lang('PrivacyPhone')}

;\n case SettingsScreens.PrivacyLastSeen:\n return

{lang('PrivacyLastSeen')}

;\n case SettingsScreens.PrivacyProfilePhoto:\n return

{lang('Privacy.ProfilePhoto')}

;\n case SettingsScreens.PrivacyForwarding:\n return

{lang('PrivacyForwards')}

;\n case SettingsScreens.PrivacyGroupChats:\n return

{lang('AutodownloadGroupChats')}

;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return

{lang('AlwaysShareWith')}

;\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return

{lang('NeverShareWith')}

;\n\n case SettingsScreens.PrivacyActiveSessions:\n return

{lang('SessionsTitle')}

;\n case SettingsScreens.PrivacyBlockedUsers:\n return

{lang('BlockedUsers')}

;\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n return

{lang('TwoStepVerification')}

;\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return

{lang('PleaseEnterCurrentPassword')}

;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return

{lang('PleaseReEnterPassword')}

;\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaChangePasswordHint:\n return

{lang('PasswordHint')}

;\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaRecoveryEmail:\n return

{lang('RecoveryEmailTitle')}

;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return

Recovery Email Code

;\n case SettingsScreens.TwoFaCongratulations:\n return

{lang('TwoStepVerificationPasswordSet')}

;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return

{lang('PleaseEnterCurrentPassword')}

;\n\n case SettingsScreens.Folders:\n return

{lang('Filters')}

;\n case SettingsScreens.FoldersCreateFolder:\n return

{lang('FilterNew')}

;\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n
\n

{lang('FilterEdit')}

\n\n {editedFolderId && (\n \n \n {lang('Delete')}\n \n \n )}\n
\n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n
\n {(currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersIncludedChatsFromChatList) ? (\n

{lang('FilterInclude')}

\n ) : (\n

{lang('FilterExclude')}

\n )}\n\n \n \n \n
\n );\n\n default:\n return (\n
\n

{lang('SETTINGS')}

\n\n onScreenSelect(SettingsScreens.EditProfile)}\n ariaLabel={lang('lng_settings_information')}\n >\n \n \n \n {lang('LogOutTitle')}\n \n
\n );\n }\n }\n\n return (\n
\n \n \n \n {renderHeaderContent()}\n \n \n
\n );\n};\n\nexport default memo(SettingsHeader);\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ProfileInfo from '../../common/ProfileInfo';\nimport ChatExtra from '../../common/ChatExtra';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUser?: ApiUser;\n lastSyncTime?: number;\n};\n\nconst SettingsMain: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentUser,\n lastSyncTime,\n}) => {\n const { loadProfilePhotos } = getDispatch();\n\n const lang = useLang();\n const profileId = currentUser?.id;\n\n useEffect(() => {\n if (profileId && lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [lastSyncTime, profileId, loadProfilePhotos]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Main);\n\n return (\n
\n
\n {currentUser && (\n \n )}\n {currentUser && (\n \n )}\n onScreenSelect(SettingsScreens.General)}\n >\n {lang('Telegram.GeneralSettingsViewController')}\n \n onScreenSelect(SettingsScreens.Notifications)}\n >\n {lang('Notifications')}\n \n onScreenSelect(SettingsScreens.Privacy)}\n >\n {lang('PrivacySettings')}\n \n onScreenSelect(SettingsScreens.DataStorage)}\n >\n {lang('DataSettings')}\n \n onScreenSelect(SettingsScreens.Folders)}\n >\n {lang('Filters')}\n \n onScreenSelect(SettingsScreens.Language)}\n >\n {lang('Language')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId, lastSyncTime } = global;\n\n return {\n currentUser: currentUserId ? selectUser(global, currentUserId) : undefined,\n lastSyncTime,\n };\n },\n)(SettingsMain));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\n\ntype OwnProps = {\n currentUsername?: string;\n asLink?: boolean;\n isLoading?: boolean;\n isUsernameAvailable?: boolean;\n checkUsername: AnyToVoidFunction;\n onChange: (value: string | false) => void;\n};\n\nconst MIN_USERNAME_LENGTH = 5;\nconst MAX_USERNAME_LENGTH = 32;\nconst LINK_PREFIX = 'https://t.me/';\nconst LINK_PREFIX_REGEX = /https:\\/\\/t\\.me\\/?/i;\nconst USERNAME_REGEX = /^([a-zA-Z0-9_]+)$/;\n\nconst runDebouncedForCheckUsername = debounce((cb) => cb(), 250, false);\n\nfunction isUsernameValid(username: string) {\n return username.length >= MIN_USERNAME_LENGTH\n && username.length <= MAX_USERNAME_LENGTH\n && USERNAME_REGEX.test(username);\n}\n\nconst SettingsEditProfile: FC = ({\n currentUsername,\n asLink,\n isLoading,\n isUsernameAvailable,\n checkUsername,\n onChange,\n}) => {\n const [username, setUsername] = useState(currentUsername || '');\n\n const lang = useLang();\n const langPrefix = asLink ? 'SetUrl' : 'Username';\n const label = asLink ? lang('SetUrlPlaceholder') : lang('Username');\n\n const [usernameSuccess, usernameError] = useMemo(() => {\n if (!username.length) {\n return [];\n }\n\n if (username.length < MIN_USERNAME_LENGTH) {\n return [undefined, `${label} is too short`];\n }\n if (username.length > MAX_USERNAME_LENGTH) {\n return [undefined, `${label} is too long`];\n }\n if (!USERNAME_REGEX.test(username)) {\n return [undefined, `${label} contains invalid characters`];\n }\n\n if (isUsernameAvailable === undefined) {\n return [];\n }\n\n // Variable `isUsernameAvailable` is initialized with `undefined`, so a strict false check is required\n return [\n isUsernameAvailable ? lang(`${langPrefix}Available`, 'Username') : undefined,\n isUsernameAvailable === false ? lang(`${langPrefix}InUse`) : undefined,\n ];\n }, [username, isUsernameAvailable, lang, langPrefix, label]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [asLink, currentUsername]);\n\n const handleUsernameChange = useCallback((e: ChangeEvent) => {\n const newUsername = e.target.value.trim().replace(LINK_PREFIX_REGEX, '');\n setUsername(newUsername);\n e.target.value = `${asLink ? LINK_PREFIX : ''}${newUsername}`;\n\n const isValid = isUsernameValid(newUsername);\n\n if (isValid) {\n runDebouncedForCheckUsername(() => {\n checkUsername({ username: newUsername });\n });\n }\n\n if (onChange) {\n onChange(isValid ? newUsername : false);\n }\n }, [asLink, checkUsername, onChange]);\n\n return (\n \n );\n};\n\nexport default memo(SettingsEditProfile);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../../api/types';\nimport { ProfileEditProgress, SettingsScreens } from '../../../types';\n\nimport { throttle } from '../../../util/schedulers';\nimport { selectUser } from '../../../modules/selectors';\nimport { getChatAvatarHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport InputText from '../../ui/InputText';\nimport renderText from '../../common/helpers/renderText';\nimport UsernameInput from '../../common/UsernameInput';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentAvatarHash?: string;\n currentFirstName?: string;\n currentLastName?: string;\n currentBio?: string;\n currentUsername?: string;\n progress?: ProfileEditProgress;\n isUsernameAvailable?: boolean;\n};\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst MAX_BIO_LENGTH = 70;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide your first name';\nconst ERROR_BIO_TOO_LONG = 'Bio can\\' be longer than 70 characters';\n\nconst SettingsEditProfile: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n}) => {\n const {\n loadCurrentUser,\n updateProfile,\n checkUsername,\n } = getDispatch();\n\n const lang = useLang();\n\n const [isUsernameTouched, setIsUsernameTouched] = useState(false);\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n\n const [photo, setPhoto] = useState();\n const [firstName, setFirstName] = useState(currentFirstName || '');\n const [lastName, setLastName] = useState(currentLastName || '');\n const [bio, setBio] = useState(currentBio || '');\n const [username, setUsername] = useState(currentUsername || '');\n\n const currentAvatarBlobUrl = useMedia(currentAvatarHash, false, ApiMediaFormat.BlobUrl);\n\n const isLoading = progress === ProfileEditProgress.InProgress;\n const isUsernameError = username === false;\n\n const isSaveButtonShown = useMemo(() => {\n if (isUsernameError) {\n return false;\n }\n\n return Boolean(photo) || isProfileFieldsTouched || isUsernameAvailable === true;\n }, [photo, isProfileFieldsTouched, isUsernameError, isUsernameAvailable]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.EditProfile);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadCurrentUser();\n });\n }, [loadCurrentUser]);\n\n useEffect(() => {\n setPhoto(undefined);\n }, [currentAvatarBlobUrl]);\n\n useEffect(() => {\n setFirstName(currentFirstName || '');\n setLastName(currentLastName || '');\n setBio(currentBio || '');\n }, [currentFirstName, currentLastName, currentBio]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [currentUsername]);\n\n useEffect(() => {\n if (progress === ProfileEditProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setIsUsernameTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handlePhotoChange = useCallback((newPhoto: File) => {\n setPhoto(newPhoto);\n }, []);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleBioChange = useCallback((e: ChangeEvent) => {\n setBio(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUsernameChange = useCallback((value: string | false) => {\n setUsername(value);\n setIsUsernameTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n const trimmedBio = bio.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n return;\n }\n\n if (trimmedBio.length > MAX_BIO_LENGTH) {\n setError(ERROR_BIO_TOO_LONG);\n return;\n }\n\n updateProfile({\n photo,\n ...(isProfileFieldsTouched && {\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n bio: trimmedBio,\n }),\n ...(isUsernameTouched && {\n username,\n }),\n });\n }, [\n photo,\n firstName, lastName, bio, isProfileFieldsTouched,\n username, isUsernameTouched,\n updateProfile,\n ]);\n\n return (\n
\n
\n
\n \n \n \n \n\n

\n {renderText(lang('lng_settings_about_bio'), ['br', 'simple_markdown'])}\n

\n
\n\n
\n

{lang('Username')}

\n\n \n\n

\n {renderText(lang('UsernameHelp'), ['br', 'simple_markdown'])}\n

\n {username && (\n

\n {lang('lng_username_link')}
\n https://t.me/{username}\n

\n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n const { progress, isUsernameAvailable } = global.profileEdit || {};\n const currentUser = currentUserId ? selectUser(global, currentUserId) : undefined;\n\n if (!currentUser) {\n return {\n progress,\n isUsernameAvailable,\n };\n }\n\n const {\n firstName: currentFirstName,\n lastName: currentLastName,\n username: currentUsername,\n fullInfo,\n } = currentUser;\n const { bio: currentBio } = fullInfo || {};\n const currentAvatarHash = getChatAvatarHash(currentUser);\n\n return {\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n };\n },\n)(SettingsEditProfile));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ISettings } from '../../../types';\n\nimport { AUTODOWNLOAD_FILESIZE_MB_LIMITS } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Checkbox from '../../ui/Checkbox';\nimport RangeSlider from '../../ui/RangeSlider';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\nconst SettingsDataStorage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n canAutoLoadPhotoFromContacts,\n canAutoLoadPhotoInPrivateChats,\n canAutoLoadPhotoInGroups,\n canAutoLoadPhotoInChannels,\n canAutoLoadVideoFromContacts,\n canAutoLoadVideoInPrivateChats,\n canAutoLoadVideoInGroups,\n canAutoLoadVideoInChannels,\n canAutoLoadFileFromContacts,\n canAutoLoadFileInPrivateChats,\n canAutoLoadFileInGroups,\n canAutoLoadFileInChannels,\n canAutoPlayGifs,\n canAutoPlayVideos,\n autoLoadFileMaxSizeMb,\n}) => {\n const { setSettingOption } = getDispatch();\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n const renderFileSizeCallback = useCallback((value: number) => {\n return lang('AutodownloadSizeLimitUpTo', lang('FileSize.MB', String(AUTODOWNLOAD_FILESIZE_MB_LIMITS[value]), 'i'));\n }, [lang]);\n\n const handleFileSizeChange = useCallback((value: number) => {\n setSettingOption({ autoLoadFileMaxSizeMb: AUTODOWNLOAD_FILESIZE_MB_LIMITS[value] });\n }, [setSettingOption]);\n\n function renderContentSizeSlider() {\n const value = AUTODOWNLOAD_FILESIZE_MB_LIMITS.indexOf(autoLoadFileMaxSizeMb);\n\n return (\n
\n \n
\n );\n }\n\n function renderAutoDownloadBlock(\n title: string,\n key: 'Photo' | 'Video' | 'File',\n canAutoLoadFromContacts: boolean,\n canAutoLoadInPrivateChats: boolean,\n canAutoLoadInGroups: boolean,\n canAutoLoadInChannels: boolean,\n ) {\n return (\n
\n

{title}

\n\n setSettingOption({ [`canAutoLoad${key}FromContacts`]: isChecked })}\n />\n setSettingOption({ [`canAutoLoad${key}InPrivateChats`]: isChecked })}\n />\n setSettingOption({ [`canAutoLoad${key}InGroups`]: isChecked })}\n />\n setSettingOption({ [`canAutoLoad${key}InChannels`]: isChecked })}\n />\n\n {key === 'File' && renderContentSizeSlider()}\n
\n );\n }\n\n return (\n
\n {renderAutoDownloadBlock(\n lang('AutoDownloadPhotosTitle'),\n 'Photo',\n canAutoLoadPhotoFromContacts,\n canAutoLoadPhotoInPrivateChats,\n canAutoLoadPhotoInGroups,\n canAutoLoadPhotoInChannels,\n )}\n {renderAutoDownloadBlock(\n lang('AutoDownloadVideosTitle'),\n 'Video',\n canAutoLoadVideoFromContacts,\n canAutoLoadVideoInPrivateChats,\n canAutoLoadVideoInGroups,\n canAutoLoadVideoInChannels,\n )}\n {renderAutoDownloadBlock(\n 'Auto-download files', // Proper translation is not available yet\n 'File',\n canAutoLoadFileFromContacts,\n canAutoLoadFileInPrivateChats,\n canAutoLoadFileInGroups,\n canAutoLoadFileInChannels,\n )}\n\n
\n

{lang('AutoplayMedia')}

\n\n setSettingOption({ canAutoPlayGifs: isChecked })}\n />\n setSettingOption({ canAutoPlayVideos: isChecked })}\n />\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return pick(global.settings.byKey, [\n 'canAutoLoadPhotoFromContacts',\n 'canAutoLoadPhotoInPrivateChats',\n 'canAutoLoadPhotoInGroups',\n 'canAutoLoadPhotoInChannels',\n 'canAutoLoadVideoFromContacts',\n 'canAutoLoadVideoInPrivateChats',\n 'canAutoLoadVideoInGroups',\n 'canAutoLoadVideoInChannels',\n 'canAutoLoadFileFromContacts',\n 'canAutoLoadFileInPrivateChats',\n 'canAutoLoadFileInGroups',\n 'canAutoLoadFileInChannels',\n 'canAutoPlayGifs',\n 'canAutoPlayVideos',\n 'autoLoadFileMaxSizeMb',\n ]);\n },\n)(SettingsDataStorage));\n","import React, {\n FC, memo, useMemo, useCallback, useState, useEffect,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiChatFolder } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { throttle } from '../../../../util/schedulers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport { getFolderDescriptionText } from '../../../../modules/helpers';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\nimport { useFolderManagerForChatsCount } from '../../../../hooks/useFolderManager';\n\nimport ListItem from '../../../ui/ListItem';\nimport Button from '../../../ui/Button';\nimport Loading from '../../../ui/Loading';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\n\ntype OwnProps = {\n isActive?: boolean;\n onCreateFolder: () => void;\n onEditFolder: (folder: ApiChatFolder) => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n orderedFolderIds?: number[];\n foldersById: Record;\n recommendedChatFolders?: ApiChatFolder[];\n};\n\nconst runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);\n\nconst MAX_ALLOWED_FOLDERS = 10;\n\nconst SettingsFoldersMain: FC = ({\n isActive,\n onCreateFolder,\n onEditFolder,\n onScreenSelect,\n onReset,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n}) => {\n const {\n loadRecommendedChatFolders,\n addChatFolder,\n showDialog,\n } = getDispatch();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersAll').then(setAnimationData);\n }\n }, [animationData]);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottledForLoadRecommended(() => {\n loadRecommendedChatFolders();\n });\n }, [loadRecommendedChatFolders]);\n\n const handleCreateFolder = useCallback(() => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n onCreateFolder();\n }, [foldersById, showDialog, onCreateFolder]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Folders);\n\n const chatsCountByFolderId = useFolderManagerForChatsCount();\n const userFolders = useMemo(() => {\n if (!orderedFolderIds) {\n return undefined;\n }\n\n return orderedFolderIds.map((id) => {\n const folder = foldersById[id];\n\n return {\n id: folder.id,\n title: folder.title,\n subtitle: getFolderDescriptionText(lang, folder, chatsCountByFolderId[folder.id]),\n };\n });\n }, [orderedFolderIds, foldersById, lang, chatsCountByFolderId]);\n\n const handleCreateFolderFromRecommended = useCallback((folder: ApiChatFolder) => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n addChatFolder({ folder });\n }, [foldersById, addChatFolder, showDialog]);\n\n return (\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n

\n {lang('CreateNewFilterInfo')}\n

\n\n \n \n {lang('CreateNewFilter')}\n \n
\n\n
\n

{lang('Filters')}

\n\n {userFolders?.length ? userFolders.map((folder) => (\n onEditFolder(foldersById[folder.id])}\n >\n {folder.title}\n {folder.subtitle}\n \n )) : userFolders && !userFolders.length ? (\n

\n You have no folders yet.\n

\n ) : }\n
\n\n {(recommendedChatFolders && Boolean(recommendedChatFolders.length)) && (\n
\n

\n {lang('FilterRecommended')}\n

\n\n {recommendedChatFolders.map((folder) => (\n handleCreateFolderFromRecommended(folder)}\n >\n
\n
\n {folder.title}\n {folder.description}\n
\n\n \n {lang('Add')}\n \n
\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n orderedIds: orderedFolderIds,\n byId: foldersById,\n recommended: recommendedChatFolders,\n } = global.chatFolders;\n\n return {\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n };\n },\n)(SettingsFoldersMain));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\n\nimport './ShowMoreButton.scss';\n\ntype OwnProps = {\n count: number;\n itemName: string;\n itemPluralName?: string;\n isLoading?: boolean;\n onClick: () => void;\n};\n\nconst ShowMoreButton: FC = ({\n count,\n itemName,\n itemPluralName,\n isLoading,\n onClick,\n}) => {\n const lang = useLang();\n\n return (\n \n \n Show {count} more {count > 1 ? itemPluralName || `${itemName}s` : itemName}\n \n );\n};\n\nexport default ShowMoreButton;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { findIntersectionWithSet } from '../../../../util/iteratees';\nimport { isUserId } from '../../../../modules/helpers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport {\n EXCLUDED_CHAT_TYPES,\n FolderEditDispatch,\n FoldersState,\n INCLUDED_CHAT_TYPES,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\nimport InputText from '../../../ui/InputText';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport FloatingActionButton from '../../../ui/FloatingActionButton';\nimport Spinner from '../../../ui/Spinner';\nimport ShowMoreButton from '../../../ui/ShowMoreButton';\n\ntype OwnProps = {\n state: FoldersState;\n dispatch: FolderEditDispatch;\n onAddIncludedChats: () => void;\n onAddExcludedChats: () => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n onBack: () => void;\n};\n\ntype StateProps = {\n loadedActiveChatIds?: string[];\n loadedArchivedChatIds?: string[];\n};\n\nconst SUBMIT_TIMEOUT = 500;\n\nconst INITIAL_CHATS_LIMIT = 5;\n\nconst ERROR_NO_TITLE = 'Please provide a title for this folder.';\nconst ERROR_NO_CHATS = 'ChatList.Filter.Error.Empty';\n\nconst SettingsFoldersEdit: FC = ({\n state,\n dispatch,\n onAddIncludedChats,\n onAddExcludedChats,\n isActive,\n onScreenSelect,\n onReset,\n onBack,\n loadedActiveChatIds,\n loadedArchivedChatIds,\n}) => {\n const {\n editChatFolder,\n addChatFolder,\n } = getDispatch();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n const [isIncludedChatsListExpanded, setIsIncludedChatsListExpanded] = useState(false);\n const [isExcludedChatsListExpanded, setIsExcludedChatsListExpanded] = useState(false);\n\n const {\n selectedChatIds: includedChatIds,\n selectedChatTypes: includedChatTypes,\n } = selectChatFilters(state, 'included');\n const {\n selectedChatIds: excludedChatIds,\n selectedChatTypes: excludedChatTypes,\n } = selectChatFilters(state, 'excluded');\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersNew').then(setAnimationData);\n }\n }, [animationData]);\n\n useEffect(() => {\n setIsIncludedChatsListExpanded(false);\n setIsExcludedChatsListExpanded(false);\n }, [state.folderId]);\n\n const [visibleIncludedChatIds, visibleExcludedChatIds] = useMemo(() => {\n const allLoadedChatsSet = new Set([\n ...(loadedActiveChatIds || []),\n ...(loadedArchivedChatIds || []),\n ]);\n\n const loadedIncludedChatIds = findIntersectionWithSet(includedChatIds, allLoadedChatsSet);\n const loadedExcludedChatIds = findIntersectionWithSet(excludedChatIds, allLoadedChatsSet);\n\n return [\n isIncludedChatsListExpanded\n ? loadedIncludedChatIds\n : loadedIncludedChatIds.slice(0, INITIAL_CHATS_LIMIT - includedChatTypes.length),\n isExcludedChatsListExpanded\n ? loadedExcludedChatIds\n : loadedExcludedChatIds.slice(0, INITIAL_CHATS_LIMIT - excludedChatTypes.length),\n ];\n }, [\n excludedChatIds, includedChatIds, includedChatTypes, excludedChatTypes,\n isExcludedChatsListExpanded, isIncludedChatsListExpanded,\n loadedActiveChatIds, loadedArchivedChatIds,\n ]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onBack, onScreenSelect, state.mode === 'edit'\n ? SettingsScreens.FoldersEditFolder\n : SettingsScreens.FoldersCreateFolder);\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n dispatch({ type: 'setTitle', payload: currentTarget.value.trim() });\n }\n\n function handleSubmit() {\n const { title } = state.folder;\n\n if (!title) {\n dispatch({ type: 'setError', payload: ERROR_NO_TITLE });\n return;\n }\n\n if (!includedChatIds.length && !Object.keys(includedChatTypes).length) {\n dispatch({ type: 'setError', payload: ERROR_NO_CHATS });\n return;\n }\n\n dispatch({ type: 'setIsLoading', payload: true });\n if (state.mode === 'edit') {\n editChatFolder({ id: state.folderId, folderUpdate: state.folder });\n } else {\n addChatFolder({ folder: state.folder });\n }\n\n setTimeout(() => {\n onReset();\n }, SUBMIT_TIMEOUT);\n }\n\n function renderChatType(key: string, mode: 'included' | 'excluded') {\n const chatType = mode === 'included'\n ? INCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key)\n : EXCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key);\n\n if (!chatType) {\n return undefined;\n }\n\n return (\n \n {lang(chatType.title)}\n \n );\n }\n\n function renderChats(mode: 'included' | 'excluded') {\n const selectedChatTypes = mode === 'included' ? includedChatTypes : excludedChatTypes;\n const visibleChatIds = mode === 'included' ? visibleIncludedChatIds : visibleExcludedChatIds;\n\n const isExpanded = mode === 'included' ? isIncludedChatsListExpanded : isExcludedChatsListExpanded;\n const allChatIds = mode === 'included' ? includedChatIds : excludedChatIds;\n const leftChatsCount = allChatIds.length - selectedChatTypes.length - visibleChatIds.length;\n const clickHandler = mode === 'included'\n ? () => setIsIncludedChatsListExpanded(true)\n : () => setIsExcludedChatsListExpanded(true);\n\n return (\n <>\n {selectedChatTypes.map((key) => renderChatType(key, mode))}\n {visibleChatIds.map((id) => (\n \n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n ))}\n {(!isExpanded && leftChatsCount > 0) && (\n \n )}\n \n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n {state.mode === 'create' && (\n

\n {lang('FilterIncludeInfo')}\n

\n )}\n\n \n
\n\n
\n {state.error && state.error === ERROR_NO_CHATS && (\n

\n {lang(state.error)}\n

\n )}\n\n

{lang('FilterInclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('included')}\n
\n\n
\n

{lang('FilterExclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('excluded')}\n
\n
\n\n \n {state.isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { listIds } = global.chats;\n\n return {\n loadedActiveChatIds: listIds.active,\n loadedArchivedChatIds: listIds.archived,\n };\n },\n)(SettingsFoldersEdit));\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../../../lib/teact/teact';\n\nimport { isUserId } from '../../../../modules/helpers';\nimport {\n INCLUDED_CHAT_TYPES,\n EXCLUDED_CHAT_TYPES,\n FolderChatType,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useInfiniteScroll from '../../../../hooks/useInfiniteScroll';\nimport useLang from '../../../../hooks/useLang';\n\nimport Checkbox from '../../../ui/Checkbox';\nimport InputText from '../../../ui/InputText';\nimport ListItem from '../../../ui/ListItem';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport PickerSelectedItem from '../../../common/PickerSelectedItem';\nimport InfiniteScroll from '../../../ui/InfiniteScroll';\nimport Loading from '../../../ui/Loading';\n\nimport '../../../common/Picker.scss';\nimport './SettingsFoldersChatsPicker.scss';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n chatIds: string[];\n selectedIds: string[];\n selectedChatTypes: string[];\n filterValue?: string;\n onSelectedIdsChange: (ids: string[]) => void;\n onSelectedChatTypesChange: (types: string[]) => void;\n onFilterChange: (value: string) => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_CHATS = 100;\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst SettingsFoldersChatsPicker: FC = ({\n mode,\n chatIds,\n selectedIds,\n selectedChatTypes,\n filterValue,\n onSelectedIdsChange,\n onSelectedChatTypesChange,\n onFilterChange,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const chatTypes = mode === 'included' ? INCLUDED_CHAT_TYPES : EXCLUDED_CHAT_TYPES;\n const shouldMinimize = selectedIds.length + selectedChatTypes.length > MAX_FULL_ITEMS;\n const hasMaxChats = selectedIds.length >= MAX_CHATS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: string) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n }, [selectedIds, onSelectedIdsChange]);\n\n const handleChatTypeClick = useCallback((key: FolderChatType['key']) => {\n const newSelectedChatTypes = [...selectedChatTypes];\n if (newSelectedChatTypes.includes(key)) {\n newSelectedChatTypes.splice(newSelectedChatTypes.indexOf(key), 1);\n } else {\n newSelectedChatTypes.push(key);\n }\n onSelectedChatTypesChange(newSelectedChatTypes);\n }, [selectedChatTypes, onSelectedChatTypesChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const lang = useLang();\n\n function renderSelectedChatType(key: string) {\n const selectedType = chatTypes.find(({ key: typeKey }) => key === typeKey);\n if (!selectedType) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n function renderChatType(type: FolderChatType) {\n return (\n handleChatTypeClick(type.key)}\n ripple\n >\n \n

{lang(type.title)}

\n \n \n );\n }\n\n function renderItem(id: string) {\n const isSelected = selectedIds.includes(id);\n\n return (\n handleItemClick(id)}\n ripple\n disabled={!isSelected && hasMaxChats}\n >\n {isUserId(id) ? (\n \n ) : (\n \n )}\n \n \n );\n }\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, chatIds, Boolean(filterValue));\n\n return (\n
\n
\n {selectedChatTypes.map(renderSelectedChatType)}\n {selectedIds.map((id, i) => (\n \n ))}\n {!hasMaxChats ? (\n \n ) : (\n

\n {`Sorry, you can't add more than ${MAX_CHATS} chats.`}\n

\n )}\n
\n \n {(!viewportIds || !viewportIds.length || viewportIds.includes(chatIds[0])) && (\n <>\n

\n {lang('FilterChatTypes')}\n

\n {chatTypes.map(renderChatType)}\n
\n

\n {lang('FilterChats')}\n

\n \n )}\n\n {viewportIds?.length ? (\n viewportIds.map(renderItem)\n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(SettingsFoldersChatsPicker);\n","import React, {\n FC, memo, useMemo, useCallback,\n} from '../../../../lib/teact/teact';\nimport { getGlobal } from '../../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport { unique } from '../../../../util/iteratees';\n\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../../config';\nimport { filterChatsByName } from '../../../../modules/helpers';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\nimport { useFolderManagerForOrderedIds } from '../../../../hooks/useFolderManager';\nimport {\n FoldersState,\n FolderEditDispatch,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\n\nimport SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker';\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst SettingsFoldersChatFilters: FC = ({\n mode,\n state,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const { chatFilter } = state;\n const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true);\n\n const lang = useLang();\n\n const folderAllOrderedIds = useFolderManagerForOrderedIds(ALL_FOLDER_ID);\n const folderArchivedOrderedIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on chats, so we avoid them\n const chatsById = getGlobal().chats.byId;\n\n const chatIds = [...folderAllOrderedIds || [], ...folderArchivedOrderedIds || []];\n return unique([\n ...selectedChatIds,\n ...filterChatsByName(lang, chatIds, chatsById, chatFilter),\n ]);\n }, [folderAllOrderedIds, folderArchivedOrderedIds, selectedChatIds, lang, chatFilter]);\n\n const handleFilterChange = useCallback((newFilter: string) => {\n dispatch({\n type: 'setChatFilter',\n payload: newFilter,\n });\n }, [dispatch]);\n\n const handleSelectedIdsChange = useCallback((ids: string[]) => {\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: { ...state.includeFilters, includedChatIds: ids },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: { ...state.excludeFilters, excludedChatIds: ids },\n });\n }\n }, [mode, state, dispatch]);\n\n const handleSelectedChatTypesChange = useCallback((keys: string[]) => {\n const newFilters: Record = {};\n keys.forEach((key) => {\n newFilters[key] = true;\n });\n\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: {\n includedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: {\n excludedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n }\n }, [mode, selectedChatIds, dispatch]);\n\n useHistoryBack(\n isActive, onReset, onScreenSelect,\n mode === 'included' ? SettingsScreens.FoldersIncludedChats : SettingsScreens.FoldersExcludedChats,\n );\n\n if (!displayedIds) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default memo(SettingsFoldersChatFilters);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiChatFolder } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { FolderEditDispatch, FoldersState } from '../../../../hooks/reducers/useFoldersReducer';\n\nimport SettingsFoldersMain from './SettingsFoldersMain';\nimport SettingsFoldersEdit from './SettingsFoldersEdit';\nimport SettingsFoldersChatFilters from './SettingsFoldersChatFilters';\n\nimport './SettingsFolders.scss';\n\nconst TRANSITION_DURATION = 200;\n\nexport type OwnProps = {\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst SettingsFolders: FC = ({\n currentScreen,\n shownScreen,\n state,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n dispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (state.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n state.mode, dispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleCreateFolder = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n }, [onScreenSelect, dispatch]);\n\n const handleEditFolder = useCallback((folder: ApiChatFolder) => {\n dispatch({ type: 'editFolder', payload: folder });\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }, [dispatch, onScreenSelect]);\n\n const handleAddIncludedChats = useCallback(() => {\n dispatch({ type: 'editIncludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersIncludedChatsFromChatList\n : SettingsScreens.FoldersIncludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n const handleAddExcludedChats = useCallback(() => {\n dispatch({ type: 'editExcludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersExcludedChatsFromChatList\n : SettingsScreens.FoldersExcludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n switch (currentScreen) {\n case SettingsScreens.Folders:\n return (\n \n );\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(SettingsFolders);\n","import React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport { getFirstLetters } from '../../../util/textFormat';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\ntype OwnProps = {\n size?: number;\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCoverAnimated: FC = ({\n size = STICKER_SIZE_PICKER_HEADER,\n stickerSet,\n observeIntersection,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaHash = `stickerSet${stickerSet.id}`;\n const lottieData = useMedia(mediaHash, !isIntersecting, ApiMediaFormat.Lottie);\n const transitionClassNames = useMediaTransition(lottieData);\n\n const firstLetters = useMemo(() => {\n if (lottieData) return undefined;\n\n return getFirstLetters(stickerSet.title, 2);\n }, [lottieData, stickerSet.title]);\n\n return (\n
\n {firstLetters}\n {lottieData && (\n \n )}\n
\n );\n};\n\nexport default memo(StickerSetCoverAnimated);\n","import React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiStickerSet } from '../../../api/types';\n\nimport { IS_WEBM_SUPPORTED } from '../../../util/environment';\nimport { getFirstLetters } from '../../../util/textFormat';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\n\ntype OwnProps = {\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCover: FC = ({ stickerSet, observeIntersection }) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaData = useMedia(stickerSet.hasThumbnail && `stickerSet${stickerSet.id}`, !isIntersecting);\n const transitionClassNames = useMediaTransition(mediaData);\n const isGif = stickerSet.isGifs;\n\n const firstLetters = useMemo(() => {\n if ((isGif && !IS_WEBM_SUPPORTED) || !mediaData) return getFirstLetters(stickerSet.title, 2);\n }, [isGif, mediaData, stickerSet.title]);\n\n return (\n
\n {firstLetters}\n {isGif ? (\n
\n );\n};\n\nexport default memo(StickerSetCover);\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_GENERAL_SETTINGS } from '../../../config';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\n\nimport ListItem from '../../ui/ListItem';\nimport Button from '../../ui/Button';\nimport StickerSetCoverAnimated from '../../middle/composer/StickerSetCoverAnimated';\nimport StickerSetCover from '../../middle/composer/StickerSetCover';\nimport StickerButton from '../../common/StickerButton';\n\nimport './SettingsStickerSet.scss';\n\ntype OwnProps = {\n stickerSet?: ApiStickerSet;\n observeIntersection: ObserveFn;\n onClick: (value: ApiSticker) => void;\n};\n\nconst SettingsStickerSet: FC = ({\n stickerSet,\n observeIntersection,\n onClick,\n}) => {\n const lang = useLang();\n\n if (!stickerSet || !stickerSet.stickers) {\n return undefined;\n }\n\n const firstSticker = stickerSet.stickers?.[0];\n\n if (stickerSet.hasThumbnail || !firstSticker) {\n return (\n firstSticker && onClick(firstSticker)}\n >\n \n {stickerSet.isLottie ? (\n \n ) : (\n \n )}\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n } else {\n return (\n onClick(firstSticker)}\n >\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n }\n};\n\nexport default memo(SettingsStickerSet);\n","import React, {\n FC, useCallback, memo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ISettings, TimeFormat } from '../../../types';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { IS_IOS, IS_MAC_OS, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport { setTimeFormat } from '../../../util/langProvider';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RangeSlider from '../../ui/RangeSlider';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup, { IRadioOption } from '../../ui/RadioGroup';\nimport SettingsStickerSet from './SettingsStickerSet';\nimport StickerSetModal from '../../common/StickerSetModal.async';\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps =\n Pick & {\n stickerSetIds?: string[];\n stickerSetsById?: Record;\n defaultReaction?: string;\n };\n\nconst ANIMATION_LEVEL_OPTIONS = [\n 'Solid and Steady',\n 'Nice and Fast',\n 'Lots of Stuff',\n];\n\nconst TIME_FORMAT_OPTIONS: IRadioOption[] = [{\n label: '12-hour',\n value: '12h',\n}, {\n label: '24-hour',\n value: '24h',\n}];\n\nconst SettingsGeneral: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n stickerSetIds,\n stickerSetsById,\n defaultReaction,\n messageTextSize,\n animationLevel,\n messageSendKeyCombo,\n shouldSuggestStickers,\n shouldLoopStickers,\n timeFormat,\n}) => {\n const {\n setSettingOption,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const stickerSettingsRef = useRef(null);\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: stickerSettingsRef });\n const [isModalOpen, openModal, closeModal] = useFlag();\n const [sticker, setSticker] = useState();\n\n const lang = useLang();\n\n const KEYBOARD_SEND_OPTIONS = !IS_TOUCH_ENV ? [\n { value: 'enter', label: lang('lng_settings_send_enter'), subLabel: 'New line by Shift + Enter' },\n {\n value: 'ctrl-enter',\n label: lang(IS_MAC_OS ? 'lng_settings_send_cmdenter' : 'lng_settings_send_ctrlenter'),\n subLabel: 'New line by Enter',\n },\n ] : undefined;\n\n const handleAnimationLevelChange = useCallback((newLevel: number) => {\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [setSettingOption]);\n\n const handleMessageTextSizeChange = useCallback((newSize: number) => {\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(newSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(newSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${newSize}px`);\n document.documentElement.setAttribute('data-message-text-size', newSize.toString());\n\n setSettingOption({ messageTextSize: newSize });\n }, [setSettingOption]);\n\n const handleTimeFormatChange = useCallback((newTimeFormat: string) => {\n setSettingOption({ timeFormat: newTimeFormat });\n setSettingOption({ wasTimeFormatSetManually: true });\n\n setTimeFormat(newTimeFormat as TimeFormat);\n }, [setSettingOption]);\n\n const handleStickerSetClick = useCallback((value: ApiSticker) => {\n setSticker(value);\n openModal();\n }, [openModal]);\n\n const stickerSets = stickerSetIds && stickerSetIds.map((id: string) => {\n return stickerSetsById?.[id]?.installedDate ? stickerSetsById[id] : false;\n }).filter(Boolean as any);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n return (\n
\n
\n

{lang('SETTINGS')}

\n\n \n\n onScreenSelect(SettingsScreens.GeneralChatBackground)}\n >\n {lang('ChatBackground')}\n \n
\n\n
\n

\n Time Format\n

\n \n
\n\n
\n

\n Animation Level\n

\n

\n Choose the desired animations amount.\n

\n\n \n
\n\n {KEYBOARD_SEND_OPTIONS && (\n
\n

{lang('VoiceOver.Keyboard')}

\n\n setSettingOption({ messageSendKeyCombo: value })}\n selected={messageSendKeyCombo}\n />\n
\n )}\n\n
\n

{lang('AccDescrStickers')}

\n\n {defaultReaction && (\n onScreenSelect(SettingsScreens.QuickReaction)}\n >\n \n
{lang('DoubleTapSetting')}
\n \n )}\n\n setSettingOption({ shouldSuggestStickers: isChecked })}\n />\n setSettingOption({ shouldLoopStickers: isChecked })}\n />\n\n
\n {stickerSets && stickerSets.map((stickerSet: ApiStickerSet) => (\n \n ))}\n
\n {sticker && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n ...pick(global.settings.byKey, [\n 'messageTextSize',\n 'animationLevel',\n 'messageSendKeyCombo',\n 'shouldSuggestStickers',\n 'shouldLoopStickers',\n 'isSensitiveEnabled',\n 'canChangeSensitive',\n 'timeFormat',\n ]),\n stickerSetIds: global.stickers.added.setIds,\n stickerSetsById: global.stickers.setsById,\n defaultReaction: global.appConfig?.defaultReaction,\n };\n },\n)(SettingsGeneral));\n","let fileSelector: HTMLInputElement;\n\nexport function openSystemFilesDialog(accept = '*', callback: (e: Event) => void, noMultiple = false) {\n if (!fileSelector) {\n fileSelector = document.createElement('input');\n fileSelector.setAttribute('type', 'file');\n }\n\n fileSelector.setAttribute('accept', accept);\n\n if (noMultiple) {\n fileSelector.removeAttribute('multiple');\n } else {\n fileSelector.setAttribute('multiple', 'multiple');\n }\n\n // eslint-disable-next-line no-null/no-null\n fileSelector.onchange = null;\n fileSelector.value = '';\n fileSelector.onchange = callback;\n\n fileSelector.click();\n}\n","/* eslint-disable eqeqeq */\n/* eslint-disable prefer-template */\n/* eslint-disable prefer-const */\n/* eslint-disable prefer-destructuring */\n/* eslint-disable one-var */\n/* eslint-disable one-var-declaration-per-line */\n\nimport { preloadImage } from './files';\n\n/**\n * HEX > RGB\n * input: 'xxxxxx' (ex. 'ed15fa') case-insensitive\n * output: [r, g, b] ([0-255, 0-255, 0-255])\n */\nexport function hex2rgb(param: string): [number, number, number] {\n return [\n parseInt(param.substring(0, 2), 16),\n parseInt(param.substring(2, 4), 16),\n parseInt(param.substring(4, 6), 16),\n ];\n}\n\n/**\n * RGB > HEX\n * input: [r, g, b] ([0-255, 0-255, 0-255])\n * output: 'xxxxxx' (ex. 'ff0000')\n */\nexport function rgb2hex(param: [number, number, number]) {\n const p0 = param[0].toString(16);\n const p1 = param[1].toString(16);\n const p2 = param[2].toString(16);\n return (p0.length == 1 ? '0' + p0 : p0) + (p1.length == 1 ? '0' + p1 : p1) + (p2.length == 1 ? '0' + p2 : p2);\n}\n\n/**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nexport function rgb2hsb([r, g, b]: [number, number, number]): [number, number, number] {\n r /= 255;\n g /= 255;\n b /= 255;\n\n let max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h!: number, s: number, v: number = max;\n\n let d = max - min;\n s = max == 0 ? 0 : d / max;\n\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n\n h /= 6;\n }\n\n return [h, s, v];\n}\n\n/**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nexport function hsb2rgb([h, s, v]: [number, number, number]): [number, number, number] {\n let r!: number, g!: number, b!: number;\n\n let i = Math.floor(h * 6);\n let f = h * 6 - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = v;\n b = p;\n break;\n case 2:\n r = p;\n g = v;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = v;\n break;\n case 4:\n r = t;\n g = p;\n b = v;\n break;\n case 5:\n r = v;\n g = p;\n b = q;\n break;\n }\n\n return [\n Math.round(r * 255),\n Math.round(g * 255),\n Math.round(b * 255),\n ];\n}\n\nexport async function getAverageColor(url: string): Promise<[number, number, number]> {\n // Only visit every 5 pixels\n const blockSize = 5;\n const defaultRGB: [number, number, number] = [0, 0, 0];\n let data;\n let width;\n let height;\n let i = -4;\n let length;\n let rgb: [number, number, number] = [0, 0, 0];\n let count = 0;\n\n const canvas = document.createElement('canvas');\n const context = canvas.getContext && canvas.getContext('2d');\n if (!context) {\n return defaultRGB;\n }\n\n const image = await preloadImage(url);\n height = image.naturalHeight || image.offsetHeight || image.height;\n width = image.naturalWidth || image.offsetWidth || image.width;\n canvas.height = height;\n canvas.width = width;\n\n context.drawImage(image, 0, 0);\n\n try {\n data = context.getImageData(0, 0, width, height);\n } catch (e) {\n return defaultRGB;\n }\n\n length = data.data.length;\n\n // eslint-disable-next-line no-cond-assign\n while ((i += blockSize * 4) < length) {\n ++count;\n rgb[0] += data.data[i];\n rgb[1] += data.data[i + 1];\n rgb[2] += data.data[i + 2];\n }\n\n rgb[0] = Math.floor(rgb[0] / count);\n rgb[1] = Math.floor(rgb[1] / count);\n rgb[2] = Math.floor(rgb[2] / count);\n\n return rgb;\n}\n\n// eslint-disable-next-line max-len\n// Function was adapted from https://github.com/telegramdesktop/tdesktop/blob/35ff621b5b52f7e3553fb0f990ea13ade7101b8e/Telegram/SourceFiles/data/data_wall_paper.cpp#L518\nexport function getPatternColor(rgbColor: [number, number, number]) {\n let [hue, saturation, value] = rgb2hsb(rgbColor);\n\n saturation = Math.min(1, saturation + 0.05 + 0.1 * (1 - saturation));\n value = value > 0.5\n ? Math.max(0, value * 0.65)\n : Math.max(0, Math.min(1, 1 - value * 0.65));\n\n return `hsla(${hue * 360}, ${saturation * 100}%, ${value * 100}%, .4)`;\n}\n","import React, {\n FC, memo, useCallback, useEffect, useState, useRef,\n} from '../../../lib/teact/teact';\nimport { ApiWallpaper } from '../../../api/types';\nimport { ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../../../config';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { fetchBlob } from '../../../util/files';\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useCanvasBlur from '../../../hooks/useCanvasBlur';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './WallpaperTile.scss';\n\ntype OwnProps = {\n wallpaper: ApiWallpaper;\n theme: ThemeKey;\n isSelected: boolean;\n onClick: (slug: string) => void;\n};\n\nconst WallpaperTile: FC = ({\n wallpaper,\n theme,\n isSelected,\n onClick,\n}) => {\n const { slug, document } = wallpaper;\n const localMediaHash = `wallpaper${document.id!}`;\n const localBlobUrl = document.previewBlobUrl;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`);\n const thumbRef = useCanvasBlur(document.thumbnail?.dataUri, Boolean(previewBlobUrl), true);\n const { transitionClassNames } = useShowTransition(\n Boolean(previewBlobUrl || localBlobUrl),\n undefined,\n undefined,\n 'slow',\n );\n const [isLoadAllowed, setIsLoadAllowed] = useState(false);\n const {\n mediaData: fullMedia, loadProgress,\n } = useMediaWithLoadProgress(localMediaHash, !isLoadAllowed);\n const wasLoadDisabled = usePrevious(isLoadAllowed) === false;\n const { shouldRender: shouldRenderSpinner, transitionClassNames: spinnerClassNames } = useShowTransition(\n (isLoadAllowed && !fullMedia) || slug === UPLOADING_WALLPAPER_SLUG,\n undefined,\n wasLoadDisabled,\n 'slow',\n );\n // To prevent triggering of the effect for useCallback\n const cacheKeyRef = useRef();\n cacheKeyRef.current = theme;\n\n const handleSelect = useCallback(() => {\n (async () => {\n const blob = await fetchBlob(fullMedia!);\n await cacheApi.save(CUSTOM_BG_CACHE_NAME, cacheKeyRef.current!, blob);\n onClick(slug);\n })();\n }, [fullMedia, onClick, slug]);\n\n useEffect(() => {\n if (fullMedia) {\n handleSelect();\n }\n }, [fullMedia, handleSelect]);\n\n const handleClick = useCallback(() => {\n if (fullMedia) {\n handleSelect();\n } else {\n setIsLoadAllowed((isAllowed) => !isAllowed);\n }\n }, [fullMedia, handleSelect]);\n\n const className = buildClassName(\n 'WallpaperTile',\n isSelected && 'selected',\n );\n\n return (\n
\n
\n \n \n {shouldRenderSpinner && (\n
\n \n
\n )}\n
\n
\n );\n};\n\nexport default memo(WallpaperTile);\n","import React, {\n FC, memo, useEffect, useCallback, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\nimport { ApiWallpaper } from '../../../api/types';\n\nimport { DARK_THEME_PATTERN_COLOR, DEFAULT_PATTERN_COLOR } from '../../../config';\nimport { throttle } from '../../../util/schedulers';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { getAverageColor, getPatternColor, rgb2hex } from '../../../util/colors';\nimport { selectTheme } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Loading from '../../ui/Loading';\nimport WallpaperTile from './WallpaperTile';\n\nimport './SettingsGeneralBackground.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n background?: string;\n isBlurred?: boolean;\n loadedWallpapers?: ApiWallpaper[];\n theme: ThemeKey;\n};\n\nconst SUPPORTED_TYPES = 'image/jpeg';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n}) => {\n const {\n loadWallpapers,\n uploadWallpaper,\n setThemeSettings,\n } = getDispatch();\n\n const themeRef = useRef();\n themeRef.current = theme;\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadWallpapers();\n });\n }, [loadWallpapers]);\n\n const handleFileSelect = useCallback((e: Event) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n uploadWallpaper(files[0]);\n }\n }, [uploadWallpaper]);\n\n const handleUploadWallpaper = useCallback(() => {\n openSystemFilesDialog(SUPPORTED_TYPES, handleFileSelect, true);\n }, [handleFileSelect]);\n\n const handleSetColor = useCallback(() => {\n onScreenSelect(SettingsScreens.GeneralChatBackgroundColor);\n }, [onScreenSelect]);\n\n const handleResetToDefault = useCallback(() => {\n setThemeSettings({\n theme,\n background: undefined,\n backgroundColor: undefined,\n isBlurred: true,\n patternColor: theme === 'dark' ? DARK_THEME_PATTERN_COLOR : DEFAULT_PATTERN_COLOR,\n });\n }, [setThemeSettings, theme]);\n\n const handleWallPaperSelect = useCallback((slug: string) => {\n setThemeSettings({ theme: themeRef.current, background: slug });\n const currentWallpaper = loadedWallpapers && loadedWallpapers.find((wallpaper) => wallpaper.slug === slug);\n if (currentWallpaper?.document.thumbnail) {\n getAverageColor(currentWallpaper.document.thumbnail.dataUri)\n .then((color) => {\n const patternColor = getPatternColor(color);\n const rgbColor = `#${rgb2hex(color)}`;\n setThemeSettings({ theme: themeRef.current, backgroundColor: rgbColor, patternColor });\n });\n }\n }, [loadedWallpapers, setThemeSettings]);\n\n const handleWallPaperBlurChange = useCallback((e: React.ChangeEvent) => {\n setThemeSettings({ theme: themeRef.current, isBlurred: e.target.checked });\n }, [setThemeSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackground);\n\n const isUploading = loadedWallpapers?.[0] && loadedWallpapers[0].slug === UPLOADING_WALLPAPER_SLUG;\n\n return (\n
\n
\n \n {lang('UploadImage')}\n \n\n \n {lang('SetColor')}\n \n\n \n {lang('ThemeResetToDefaults')}\n \n\n \n
\n\n {loadedWallpapers ? (\n
\n {loadedWallpapers.map((wallpaper) => (\n \n ))}\n
\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, isBlurred } = global.settings.themes[theme] || {};\n const { loadedWallpapers } = global.settings;\n\n return {\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n };\n },\n)(SettingsGeneralBackground));\n","import { ChangeEvent, MutableRefObject, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens, ThemeKey } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport {\n getPatternColor, hex2rgb, hsb2rgb, rgb2hex, rgb2hsb,\n} from '../../../util/colors';\nimport { captureEvents, RealTouchEvent } from '../../../util/captureEvents';\nimport { selectTheme } from '../../../modules/selectors';\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\n\nimport './SettingsGeneralBackgroundColor.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n backgroundColor?: string;\n theme: ThemeKey;\n};\n\ninterface CanvasRects {\n colorRect: {\n offsetLeft: number;\n top: number;\n width: number;\n height: number;\n };\n hueRect: {\n offsetLeft: number;\n width: number;\n };\n}\n\nconst DEFAULT_HSB = rgb2hsb(hex2rgb('e6ebee'));\nconst PREDEFINED_COLORS = [\n '#e6ebee', '#b2cee1', '#008dd0', '#c6e7cb', '#c4e1a6', '#60b16e',\n '#ccd0af', '#a6a997', '#7a7072', '#fdd7af', '#fdb76e', '#dd8851',\n];\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n theme,\n backgroundColor,\n}) => {\n const { setThemeSettings } = getDispatch();\n\n const themeRef = useRef();\n themeRef.current = theme;\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const colorPickerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const huePickerRef = useRef(null);\n const isFirstRunRef = useRef(true);\n\n const [hsb, setHsb] = useState(getInitialHsb(backgroundColor));\n // Cache for drag handlers\n const hsbRef = useRef(hsb);\n useEffect(() => {\n hsbRef.current = hsb;\n }, [hsb]);\n\n const [isDragging, markIsDragging, unmarkIsDragging] = useFlag();\n const [rgbInput, setRgbInput] = useState('');\n const [hexInput, setHexInput] = useState('');\n\n const rectsRef = useRef();\n const colorCtxRef = useRef();\n\n // Setup: cache rects, subscribe for drag events\n useEffect(() => {\n // We use `offsetLeft` instead of `left` to support screen transition\n const colorRect = {\n offsetLeft: colorPickerRef.current!.offsetLeft,\n ...pick(colorPickerRef.current!.getBoundingClientRect(), ['top', 'width', 'height']),\n };\n const hueRect = {\n offsetLeft: huePickerRef.current!.offsetLeft,\n ...pick(huePickerRef.current!.getBoundingClientRect(), ['width']),\n };\n\n rectsRef.current = { colorRect, hueRect };\n\n function handleColorDrag(e: MouseEvent | RealTouchEvent) {\n const colorPosition = [\n Math.min(Math.max(0, e.pageX! - colorRect.offsetLeft), colorRect.width - 1),\n Math.min(Math.max(0, e.pageY! - colorRect.top + containerRef.current!.scrollTop), colorRect.height - 1),\n ];\n\n const { huePosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(colorPickerRef.current!, {\n onCapture: handleColorDrag,\n onDrag: handleColorDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n\n function handleHueDrag(e: MouseEvent | RealTouchEvent) {\n const { colorPosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n const huePosition = Math.min(Math.max(0, e.pageX! - hueRect.offsetLeft), hueRect.width - 1);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(huePickerRef.current!, {\n onCapture: handleHueDrag,\n onDrag: handleHueDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n }, [markIsDragging, unmarkIsDragging]);\n\n const { colorPosition = [0, 0], huePosition = 0 } = rectsRef.current ? hsb2positions(hsb, rectsRef.current) : {};\n const hex = rgb2hex(hsb2rgb(hsb));\n const hue = hsb[0];\n const hueHex = rgb2hex(hsb2rgb([hue, 1, 1]));\n\n // Save value and update inputs when HSL changes\n useEffect(() => {\n const rgb = hsb2rgb(hsb);\n const color = `#${rgb2hex(rgb)}`;\n\n setRgbInput(rgb.join(', '));\n setHexInput(color);\n\n if (!isFirstRunRef.current) {\n const patternColor = getPatternColor(rgb);\n setThemeSettings({\n theme: themeRef.current,\n background: undefined,\n backgroundColor: color,\n patternColor,\n });\n }\n isFirstRunRef.current = false;\n }, [hsb, setThemeSettings]);\n\n // Redraw color picker when hue changes\n useEffect(() => {\n drawColor(colorPickerRef.current!.firstChild as HTMLCanvasElement, hue, colorCtxRef, rectsRef);\n }, [hue]);\n\n // Initially draw hue picker\n useEffect(() => {\n drawHue(huePickerRef.current!.firstChild as HTMLCanvasElement);\n }, []);\n\n const handleRgbChange = useCallback((e: ChangeEvent) => {\n const rgbValue = e.currentTarget.value.replace(/[^\\d, ]/g, '').slice(0, 13);\n\n if (rgbValue.match(/^\\d{1,3},\\s?\\d{1,3},\\s?\\d{1,3}$/)) {\n const rgb = rgbValue.split(',').map((channel) => Number(channel.trim())) as [number, number, number];\n setHsb(rgb2hsb(rgb));\n }\n\n e.currentTarget.value = rgbValue;\n }, []);\n\n const handleHexChange = useCallback((e: ChangeEvent) => {\n const hexValue = e.currentTarget.value.replace(/[^0-9a-fA-F]/g, '').slice(0, 6);\n\n if (hexValue.match(/^#?[0-9a-fA-F]{6}$/)) {\n setHsb(rgb2hsb(hex2rgb(hexValue.replace('#', ''))));\n }\n\n e.currentTarget.value = hexValue;\n }, []);\n\n const handlePredefinedColorClick = useCallback((e: React.MouseEvent) => {\n setHsb(rgb2hsb(hex2rgb(e.currentTarget.dataset.color!.replace('#', ''))));\n }, []);\n\n const className = buildClassName(\n 'SettingsGeneralBackgroundColor settings-content custom-scroll',\n isDragging && 'is-dragging',\n );\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackgroundColor);\n\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n {PREDEFINED_COLORS.map((color) => (\n \n ))}\n
\n
\n );\n};\n\nfunction getInitialHsb(backgroundColor?: string) {\n return backgroundColor && backgroundColor.startsWith('#')\n ? rgb2hsb(hex2rgb(backgroundColor.replace('#', '')))\n : DEFAULT_HSB;\n}\n\nfunction hsb2positions(hsb: [number, number, number], rects: CanvasRects) {\n return {\n colorPosition: [\n Math.round((hsb[1]) * (rects.colorRect.width - 1)),\n Math.round((1 - hsb[2]) * (rects.colorRect.height - 1)),\n ],\n huePosition: Math.round(hsb[0] * (rects.hueRect.width - 1)),\n };\n}\n\nfunction positions2hsb(\n { colorPosition, huePosition }: { colorPosition: number[]; huePosition: number },\n rects: CanvasRects,\n): [number, number, number] {\n return [\n huePosition / (rects.hueRect.width - 1),\n colorPosition[0] / (rects.colorRect.width - 1),\n 1 - colorPosition[1] / (rects.colorRect.height - 1),\n ];\n}\n\nfunction drawColor(\n canvas: HTMLCanvasElement,\n hue: number,\n colorCtxRef: MutableRefObject,\n rectsRef: RefObject,\n) {\n let w: number;\n let h: number;\n let ctx: CanvasRenderingContext2D;\n\n if (!colorCtxRef.current || !rectsRef.current) {\n // First run\n w = canvas.offsetWidth;\n h = canvas.offsetHeight;\n ctx = canvas.getContext('2d')!;\n\n canvas.width = w;\n canvas.height = h;\n\n colorCtxRef.current = ctx;\n } else {\n w = rectsRef.current.colorRect.width;\n h = rectsRef.current.colorRect.height;\n ctx = colorCtxRef.current;\n }\n\n const imgData = ctx!.createImageData(w, h);\n const pixels = imgData.data;\n const col = hsb2rgb([hue, 1, 1]);\n\n let index = 0;\n\n for (let y = 0; y < h; y++) {\n const perY = 1 - y / (h - 1);\n const st = [255 * perY, 255 * perY, 255 * perY];\n const ed = [col[0] * perY, col[1] * perY, col[2] * perY];\n for (let x = 0; x < w; x++) {\n const perX = x / (w - 1);\n pixels[index++] = st[0] + (ed[0] - st[0]) * perX;\n pixels[index++] = st[1] + (ed[1] - st[1]) * perX;\n pixels[index++] = st[2] + (ed[2] - st[2]) * perX;\n pixels[index++] = 255;\n }\n }\n\n ctx!.putImageData(imgData, 0, 0);\n}\n\nfunction drawHue(canvas: HTMLCanvasElement) {\n const w = canvas.offsetWidth;\n const h = 1;\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d')!;\n\n const imgData = ctx.createImageData(w, h);\n const pixels = imgData.data;\n\n let index = 0;\n\n for (let x = 0; x < w; x++) {\n const hue = x / (w - 1);\n const rgb = hsb2rgb([hue, 1, 1]);\n /* eslint-disable prefer-destructuring */\n pixels[index++] = rgb[0];\n pixels[index++] = rgb[1];\n pixels[index++] = rgb[2];\n /* eslint-enable prefer-destructuring */\n pixels[index++] = 255;\n }\n\n ctx.putImageData(imgData, 0, 0);\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { backgroundColor } = global.settings.themes[theme] || {};\n return {\n backgroundColor,\n theme,\n };\n },\n)(SettingsGeneralBackground));\n","import { ChangeEvent } from 'react';\nimport useDebounce from '../../../hooks/useDebounce';\nimport React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { playNotifySound } from '../../../util/notifications';\n\nimport Checkbox from '../../ui/Checkbox';\nimport RangeSlider from '../../ui/RangeSlider';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPrivateChatsNotifications: boolean;\n hasPrivateChatsMessagePreview: boolean;\n hasGroupNotifications: boolean;\n hasGroupMessagePreview: boolean;\n hasBroadcastNotifications: boolean;\n hasBroadcastMessagePreview: boolean;\n hasContactJoinedNotifications: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\nconst SettingsNotifications: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPrivateChatsNotifications,\n hasPrivateChatsMessagePreview,\n hasGroupNotifications,\n hasGroupMessagePreview,\n hasBroadcastNotifications,\n hasBroadcastMessagePreview,\n hasContactJoinedNotifications,\n hasPushNotifications,\n hasWebNotifications,\n notificationSoundVolume,\n}) => {\n const {\n loadNotificationSettings,\n updateContactSignUpNotification,\n updateNotificationSettings,\n updateWebNotificationSettings,\n } = getDispatch();\n\n useEffect(() => {\n loadNotificationSettings();\n }, [loadNotificationSettings]);\n\n const runDebounced = useDebounce(500, true);\n\n const handleSettingsChange = useCallback((\n e: ChangeEvent,\n peerType: 'contact' | 'group' | 'broadcast',\n setting: 'silent' | 'showPreviews',\n ) => {\n const currentIsSilent = peerType === 'contact'\n ? !hasPrivateChatsNotifications\n : !(peerType === 'group' ? hasGroupNotifications : hasBroadcastNotifications);\n const currentShouldShowPreviews = peerType === 'contact'\n ? hasPrivateChatsMessagePreview\n : (peerType === 'group' ? hasGroupMessagePreview : hasBroadcastMessagePreview);\n\n updateNotificationSettings({\n peerType,\n ...(setting === 'silent' && { isSilent: !e.target.checked, shouldShowPreviews: currentShouldShowPreviews }),\n ...(setting === 'showPreviews' && { shouldShowPreviews: e.target.checked, isSilent: currentIsSilent }),\n });\n }, [\n hasBroadcastMessagePreview, hasBroadcastNotifications,\n hasGroupMessagePreview, hasGroupNotifications,\n hasPrivateChatsMessagePreview, hasPrivateChatsNotifications,\n updateNotificationSettings,\n ]);\n\n const handleContactNotificationChange = useCallback((e: ChangeEvent) => {\n updateContactSignUpNotification({\n isSilent: !e.target.checked,\n });\n }, [updateContactSignUpNotification]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Notifications);\n\n return (\n
\n
\n

\n Web notifications\n

\n {\n updateWebNotificationSettings({ hasWebNotifications: e.target.checked });\n }}\n />\n {\n updateWebNotificationSettings({ hasPushNotifications: e.target.checked });\n }}\n />\n
\n {\n updateWebNotificationSettings({ notificationSoundVolume: volume });\n runDebounced(() => playNotifySound(undefined, volume));\n }}\n />\n
\n
\n
\n

\n {lang('AutodownloadPrivateChats')}\n

\n\n {\n handleSettingsChange(e, 'contact', 'silent');\n }}\n />\n {\n handleSettingsChange(e, 'contact', 'showPreviews');\n }}\n />\n
\n\n
\n

{lang('FilterGroups')}

\n\n {\n handleSettingsChange(e, 'group', 'silent');\n }}\n />\n {\n handleSettingsChange(e, 'group', 'showPreviews');\n }}\n />\n
\n\n
\n

{lang('FilterChannels')}

\n\n {\n handleSettingsChange(e, 'broadcast', 'silent');\n }}\n />\n {\n handleSettingsChange(e, 'broadcast', 'showPreviews');\n }}\n />\n
\n\n
\n

{lang('PhoneOther')}

\n\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n hasPrivateChatsNotifications: Boolean(global.settings.byKey.hasPrivateChatsNotifications),\n hasPrivateChatsMessagePreview: Boolean(global.settings.byKey.hasPrivateChatsMessagePreview),\n hasGroupNotifications: Boolean(global.settings.byKey.hasGroupNotifications),\n hasGroupMessagePreview: Boolean(global.settings.byKey.hasGroupMessagePreview),\n hasBroadcastNotifications: Boolean(global.settings.byKey.hasBroadcastNotifications),\n hasBroadcastMessagePreview: Boolean(global.settings.byKey.hasBroadcastMessagePreview),\n hasContactJoinedNotifications: Boolean(global.settings.byKey.hasContactJoinedNotifications),\n hasWebNotifications: global.settings.byKey.hasWebNotifications,\n hasPushNotifications: global.settings.byKey.hasPushNotifications,\n notificationSoundVolume: global.settings.byKey.notificationSoundVolume,\n };\n },\n)(SettingsNotifications));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { PrivacyVisibility, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPassword?: boolean;\n blockedCount: number;\n sessionsCount: number;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n visibilityPrivacyPhoneNumber?: PrivacyVisibility;\n visibilityPrivacyLastSeen?: PrivacyVisibility;\n visibilityPrivacyProfilePhoto?: PrivacyVisibility;\n visibilityPrivacyForwarding?: PrivacyVisibility;\n visibilityPrivacyGroupChats?: PrivacyVisibility;\n};\n\nconst SettingsPrivacy: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPassword,\n blockedCount,\n sessionsCount,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber,\n visibilityPrivacyLastSeen,\n visibilityPrivacyProfilePhoto,\n visibilityPrivacyForwarding,\n visibilityPrivacyGroupChats,\n\n}) => {\n const {\n loadPrivacySettings,\n loadBlockedContacts,\n loadAuthorizations,\n loadContentSettings,\n updateContentSettings,\n } = getDispatch();\n\n useEffect(() => {\n loadBlockedContacts();\n loadAuthorizations();\n loadPrivacySettings();\n loadContentSettings();\n }, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Privacy);\n\n function getVisibilityValue(visibility?: PrivacyVisibility) {\n switch (visibility) {\n case 'everybody':\n return lang('P2PEverybody');\n\n case 'contacts':\n return lang('P2PContacts');\n\n case 'nobody':\n return lang('P2PNobody');\n }\n\n return undefined;\n }\n\n return (\n
\n
\n onScreenSelect(SettingsScreens.PrivacyBlockedUsers)}\n >\n
\n {lang('BlockedUsers')}\n {blockedCount > 0 && (\n \n {lang('Users', blockedCount)}\n \n )}\n
\n \n onScreenSelect(\n hasPassword ? SettingsScreens.TwoFaEnabled : SettingsScreens.TwoFaDisabled,\n )}\n >\n
\n {lang('TwoStepVerification')}\n \n {lang(hasPassword ? 'PasswordOn' : 'PasswordOff')}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyActiveSessions)}\n >\n
\n {lang('SessionsTitle')}\n {sessionsCount > 0 && (\n \n {sessionsCount === 1 ? '1 session' : `${sessionsCount} sessions`}\n \n )}\n
\n \n
\n\n
\n

{lang('PrivacyTitle')}

\n\n onScreenSelect(SettingsScreens.PrivacyPhoneNumber)}\n >\n
\n {lang('PrivacyPhoneTitle')}\n \n {getVisibilityValue(visibilityPrivacyPhoneNumber)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyLastSeen)}\n >\n
\n {lang('LastSeenTitle')}\n \n {getVisibilityValue(visibilityPrivacyLastSeen)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyProfilePhoto)}\n >\n
\n {lang('PrivacyProfilePhotoTitle')}\n \n {getVisibilityValue(visibilityPrivacyProfilePhoto)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyForwarding)}\n >\n
\n {lang('PrivacyForwardsTitle')}\n \n {getVisibilityValue(visibilityPrivacyForwarding)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyGroupChats)}\n >\n
\n {lang('WhoCanAddMe')}\n \n {getVisibilityValue(visibilityPrivacyGroupChats)}\n \n
\n \n
\n\n {canChangeSensitive && (\n
\n

\n {lang('lng_settings_sensitive_title')}\n

\n \n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: {\n byKey: { hasPassword, isSensitiveEnabled, canChangeSensitive },\n privacy,\n },\n blocked,\n activeSessions,\n } = global;\n\n return {\n hasPassword,\n blockedCount: blocked.totalCount,\n sessionsCount: activeSessions.length,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber: privacy.phoneNumber?.visibility,\n visibilityPrivacyLastSeen: privacy.lastSeen?.visibility,\n visibilityPrivacyProfilePhoto: privacy.profilePhoto?.visibility,\n visibilityPrivacyForwarding: privacy.forwards?.visibility,\n visibilityPrivacyGroupChats: privacy.chatInvite?.visibility,\n };\n },\n)(SettingsPrivacy));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ISettings, LangCode, SettingsScreens } from '../../../types';\nimport { ApiLanguage } from '../../../api/types';\n\nimport { setLanguage } from '../../../util/langProvider';\n\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\nconst SettingsLanguage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n languages,\n language,\n}) => {\n const {\n loadLanguages,\n setSettingOption,\n } = getDispatch();\n\n const [selectedLanguage, setSelectedLanguage] = useState(language);\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n // TODO Throttle\n useEffect(() => {\n loadLanguages();\n }, [loadLanguages]);\n\n const handleChange = useCallback((langCode: string) => {\n setSelectedLanguage(langCode);\n markIsLoading();\n\n void setLanguage(langCode as LangCode, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: langCode });\n });\n }, [markIsLoading, unmarkIsLoading, setSettingOption]);\n\n const options = useMemo(() => {\n return languages ? buildOptions(languages) : undefined;\n }, [languages]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Language);\n\n return (\n
\n {options ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nfunction buildOptions(languages: ApiLanguage[]) {\n const currentLangCode = (window.navigator.language || 'en').toLowerCase();\n const shortLangCode = currentLangCode.substr(0, 2);\n\n return languages.map(({ langCode, nativeName, name }) => ({\n value: langCode,\n label: nativeName,\n subLabel: name,\n })).sort((a) => {\n return currentLangCode && (a.value === currentLangCode || a.value === shortLangCode) ? -1 : 0;\n });\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n languages: global.settings.byKey.languages,\n language: global.settings.byKey.language,\n };\n },\n)(SettingsLanguage));\n","import { ApiPrivacyKey, SettingsScreens } from '../../../../types';\n\nexport function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefined {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return 'phoneNumber';\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return 'lastSeen';\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return 'profilePhoto';\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return 'forwards';\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return 'chatInvite';\n }\n\n return undefined;\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport { getPrivacyKey } from './helper/privacy';\n\ntype OwnProps = {\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps =\n Partial & {\n chatsById?: Record;\n usersById?: Record;\n };\n\nconst SettingsPrivacyVisibility: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n visibility,\n allowUserIds,\n allowChatIds,\n blockUserIds,\n blockChatIds,\n chatsById,\n}) => {\n const { setPrivacyVisibility } = getDispatch();\n\n const lang = useLang();\n\n const visibilityOptions = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyGroupChats:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n ];\n\n default:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n { value: 'nobody', label: lang('P2PNobody') },\n ];\n }\n }, [lang, screen]);\n\n const exceptionLists = {\n shouldShowDenied: visibility !== 'nobody',\n shouldShowAllowed: visibility !== 'everybody',\n };\n\n const privacyKey = getPrivacyKey(screen);\n\n const headerText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return lang('PrivacyPhoneTitle');\n case SettingsScreens.PrivacyLastSeen:\n return lang('LastSeenTitle');\n case SettingsScreens.PrivacyProfilePhoto:\n return lang('PrivacyProfilePhotoTitle');\n case SettingsScreens.PrivacyForwarding:\n return lang('PrivacyForwardsTitle');\n case SettingsScreens.PrivacyGroupChats:\n return lang('WhoCanAddMe');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const descriptionText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyLastSeen:\n return lang('CustomHelp');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n const allowedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberAllowedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenAllowedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoAllowedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingAllowedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsAllowedContacts;\n }\n })();\n\n const deniedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberDeniedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenDeniedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoDeniedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingDeniedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsDeniedContacts;\n }\n })();\n\n const allowedCount = useMemo(() => {\n if (!allowUserIds || !allowChatIds || !chatsById) {\n return 0;\n }\n\n return allowChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, allowUserIds.length);\n }, [allowChatIds, allowUserIds, chatsById]);\n\n const blockCount = useMemo(() => {\n if (!blockUserIds || !blockChatIds || !chatsById) {\n return 0;\n }\n\n return blockChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, blockUserIds.length);\n }, [blockChatIds, blockUserIds, chatsById]);\n\n const handleVisibilityChange = useCallback((value) => {\n setPrivacyVisibility({\n privacyKey,\n visibility: value,\n });\n }, [privacyKey, setPrivacyVisibility]);\n\n return (\n
\n
\n

{headerText}

\n\n \n\n {descriptionText && (\n

{descriptionText}

\n )}\n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n {exceptionLists.shouldShowAllowed && (\n {\n onScreenSelect(allowedContactsScreen);\n }}\n >\n
\n {allowedCount > 0 && +{allowedCount}}\n {lang('AlwaysShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n {exceptionLists.shouldShowDenied && (\n {\n onScreenSelect(deniedContactsScreen);\n }}\n >\n
\n {blockCount > 0 && −{blockCount}}\n {lang('NeverShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n let privacySettings: ApiPrivacySettings | undefined;\n\n const {\n chats: { byId: chatsById },\n settings: { privacy },\n } = global;\n\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n privacySettings = privacy.phoneNumber;\n break;\n\n case SettingsScreens.PrivacyLastSeen:\n privacySettings = privacy.lastSeen;\n break;\n\n case SettingsScreens.PrivacyProfilePhoto:\n privacySettings = privacy.profilePhoto;\n break;\n\n case SettingsScreens.PrivacyForwarding:\n privacySettings = privacy.forwards;\n break;\n\n case SettingsScreens.PrivacyGroupChats:\n privacySettings = privacy.chatInvite;\n break;\n }\n\n if (!privacySettings) {\n return {};\n }\n\n return {\n ...privacySettings,\n chatsById,\n };\n },\n)(SettingsPrivacyVisibility));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSession } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n activeSessions: ApiSession[];\n};\n\nconst SettingsPrivacyActiveSessions: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n activeSessions,\n}) => {\n const {\n loadAuthorizations,\n terminateAuthorization,\n terminateAllAuthorizations,\n } = getDispatch();\n\n const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag();\n useEffect(() => {\n loadAuthorizations();\n }, [loadAuthorizations]);\n\n const handleTerminateSessionClick = useCallback((hash: string) => {\n terminateAuthorization({ hash });\n }, [terminateAuthorization]);\n\n const handleTerminateAllSessions = useCallback(() => {\n closeConfirmTerminateAllDialog();\n terminateAllAuthorizations();\n }, [closeConfirmTerminateAllDialog, terminateAllAuthorizations]);\n\n const currentSession = useMemo(() => {\n return activeSessions.find((session) => session.isCurrent);\n }, [activeSessions]);\n\n const otherSessions = useMemo(() => {\n return activeSessions.filter((session) => !session.isCurrent);\n }, [activeSessions]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyActiveSessions);\n\n function renderCurrentSession(session: ApiSession) {\n return (\n
\n

\n {lang('AuthSessions.CurrentSession')}\n

\n\n \n
\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n
\n\n \n {lang('TerminateAllSessions')}\n \n
\n );\n }\n\n function renderOtherSessions(sessions: ApiSession[]) {\n return (\n
\n

\n {lang('OtherSessions')}\n

\n\n {sessions.map(renderSession)}\n
\n );\n }\n\n function renderSession(session: ApiSession) {\n return (\n {\n handleTerminateSessionClick(session.hash);\n },\n }]}\n className=\"no-icon\"\n >\n
\n {formatPastTimeShort(lang, session.dateActive * 1000)}\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n \n );\n }\n\n return (\n
\n {currentSession && renderCurrentSession(currentSession)}\n {otherSessions && renderOtherSessions(otherSessions)}\n {otherSessions && (\n \n )}\n
\n );\n};\n\nfunction getLocation(session: ApiSession) {\n return [session.region, session.country].filter(Boolean).join(', ');\n}\n\nfunction getDeviceEnvironment(session: ApiSession) {\n return `${session.deviceModel}${session.deviceModel ? ', ' : ''} ${session.platform} ${session.systemVersion}`;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n activeSessions: global.activeSessions,\n };\n },\n)(SettingsPrivacyActiveSessions));\n","import React, {\n FC, useMemo, useState, memo, useRef, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport { filterUsersByName, getUserFullName } from '../../../modules/helpers';\nimport { unique } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\n\nimport ChatOrUserPicker from '../../common/ChatOrUserPicker';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n usersById: Record;\n blockedIds: string[];\n contactIds?: string[];\n localContactIds?: string[];\n currentUserId?: string;\n};\n\nconst BlockUserModal: FC = ({\n usersById,\n blockedIds,\n contactIds,\n localContactIds,\n currentUserId,\n isOpen,\n onClose,\n}) => {\n const {\n loadContactList,\n setUserSearchQuery,\n blockContact,\n } = getDispatch();\n\n const lang = useLang();\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const filterRef = useRef(null);\n\n useEffect(() => {\n setUserSearchQuery({ query: filter });\n }, [filter, setUserSearchQuery]);\n\n const filteredContactIds = useMemo(() => {\n const availableContactIds = unique([\n ...(contactIds || []),\n ...(localContactIds || []),\n ].filter((contactId) => {\n return contactId !== currentUserId && !blockedIds.includes(contactId);\n }));\n\n return filterUsersByName(availableContactIds, usersById, filter)\n .sort((firstId, secondId) => {\n const firstName = getUserFullName(usersById[firstId]) || '';\n const secondName = getUserFullName(usersById[secondId]) || '';\n\n return firstName.localeCompare(secondName);\n });\n }, [blockedIds, contactIds, currentUserId, filter, localContactIds, usersById]);\n\n const handleRemoveUser = useCallback((userId: string) => {\n const { id: contactId, accessHash } = usersById[userId] || {};\n if (!contactId || !accessHash) {\n return;\n }\n blockContact({ contactId, accessHash });\n onClose();\n }, [blockContact, onClose, usersById]);\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n users: {\n byId: usersById,\n },\n blocked: {\n ids: blockedIds,\n },\n contactList,\n currentUserId,\n } = global;\n\n return {\n usersById,\n blockedIds,\n contactIds: contactList?.userIds,\n localContactIds: global.userSearch.localUserIds,\n currentUserId,\n };\n },\n)(BlockUserModal));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { CHAT_HEIGHT_PX } from '../../../config';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport {\n getChatTitle, getUserFullName, isUserId,\n} from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useFlag from '../../../hooks/useFlag';\n\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Avatar from '../../common/Avatar';\nimport Loading from '../../ui/Loading';\nimport BlockUserModal from './BlockUserModal';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsByIds: Record;\n usersByIds: Record;\n blockedIds: string[];\n phoneCodeList: ApiCountryCode[];\n};\n\nconst SettingsPrivacyBlockedUsers: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n chatsByIds,\n usersByIds,\n blockedIds,\n phoneCodeList,\n}) => {\n const { unblockContact } = getDispatch();\n\n const lang = useLang();\n const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag();\n const handleUnblockClick = useCallback((contactId: string) => {\n unblockContact({ contactId });\n }, [unblockContact]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyBlockedUsers);\n\n function renderContact(contactId: string, i: number, viewportOffset: number) {\n const isPrivate = isUserId(contactId);\n const user = isPrivate ? usersByIds[contactId] : undefined;\n const chat = !isPrivate ? chatsByIds[contactId] : undefined;\n\n const className = buildClassName(\n 'Chat chat-item-clickable blocked-list-item small-icon',\n isPrivate ? 'private' : 'group',\n );\n\n return (\n {\n handleUnblockClick(contactId);\n },\n }]}\n style={`top: ${(viewportOffset + i) * CHAT_HEIGHT_PX}px;`}\n >\n \n
\n

{renderText((isPrivate ? getUserFullName(user) : getChatTitle(lang, chat!)) || '')}

\n {user?.phoneNumber && (\n
{formatPhoneNumberWithCode(phoneCodeList, user.phoneNumber)}
\n )}\n {user && !user.phoneNumber && user.username && (\n
@{user.username}
\n )}\n
\n \n );\n }\n\n return (\n
\n
\n
\n

\n {lang('BlockedUsersInfo')}\n

\n
\n\n
\n {blockedIds?.length ? (\n
\n {blockedIds!.map((contactId, i) => renderContact(contactId, i, 0))}\n
\n ) : blockedIds && !blockedIds.length ? (\n
{lang('NoBlocked')}
\n ) : (\n \n )}\n
\n
\n\n \n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsByIds,\n },\n users: {\n byId: usersByIds,\n },\n blocked: {\n ids,\n },\n countryList: {\n phoneCodes: phoneCodeList,\n },\n } = global;\n\n return {\n chatsByIds,\n usersByIds,\n blockedIds: ids,\n phoneCodeList,\n };\n },\n)(SettingsPrivacyBlockedUsers));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaEnabled: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaEnabled);\n\n return (\n
\n
\n \n\n

\n {renderText(lang('EnabledPasswordText'), ['br'])}\n

\n
\n\n
\n onScreenSelect(SettingsScreens.TwoFaChangePasswordCurrent)}\n >\n {lang('ChangePassword')}\n \n onScreenSelect(SettingsScreens.TwoFaTurnOff)}\n >\n {lang('TurnPasswordOff')}\n \n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCurrentPassword)}\n >\n {lang('SetRecoveryEmail')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaEnabled));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport PasswordMonkey from '../../../common/PasswordMonkey';\nimport PasswordForm from '../../../common/PasswordForm';\n\ntype OwnProps = {\n screen: SettingsScreens;\n error?: string;\n isLoading?: boolean;\n expectedPassword?: string;\n placeholder?: string;\n hint?: string;\n submitLabel?: string;\n clearError?: NoneToVoidFunction;\n onSubmit: (password: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst EQUAL_PASSWORD_ERROR = 'Passwords Should Be Equal';\n\nconst SettingsTwoFaPassword: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n error,\n isLoading,\n expectedPassword,\n placeholder = 'Current Password',\n hint,\n submitLabel,\n clearError,\n onSubmit,\n}) => {\n const [validationError, setValidationError] = useState('');\n const [shouldShowPassword, setShouldShowPassword] = useState(false);\n\n const handleSubmit = useCallback((newPassword) => {\n if (expectedPassword && newPassword !== expectedPassword) {\n setValidationError(EQUAL_PASSWORD_ERROR);\n } else {\n onSubmit(newPassword);\n }\n }, [onSubmit, expectedPassword]);\n\n const handleClearError = useCallback(() => {\n if (clearError) {\n clearError();\n }\n setValidationError('');\n }, [clearError]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(SettingsTwoFaPassword);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n onStart: NoneToVoidFunction;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaStart: FC = ({\n isActive, onScreenSelect, onReset, animatedEmoji, onStart,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaDisabled);\n\n return (\n
\n
\n \n\n

\n {lang('SetAdditionalPasswordInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaStart));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useFlag from '../../../../hooks/useFlag';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport Modal from '../../../ui/Modal';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n icon: 'hint' | 'email';\n type?: 'text' | 'email';\n isLoading?: boolean;\n error?: string;\n placeholder: string;\n shouldConfirm?: boolean;\n clearError?: NoneToVoidFunction;\n onSubmit: (value?: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaSkippableForm: FC = ({\n animatedEmoji,\n type = 'text',\n isLoading,\n error,\n placeholder,\n shouldConfirm,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n const [isConfirmShown, markIsConfirmShown, unmarkIsConfirmShown] = useFlag(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n setValue(e.target.value);\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!inputRef.current) {\n return;\n }\n\n onSubmit(value);\n };\n\n const handleSkip = () => {\n onSubmit();\n };\n\n const handleSkipConfirm = () => {\n unmarkIsConfirmShown();\n onSubmit();\n };\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n
\n \n\n {value ? (\n \n ) : (\n \n {lang('YourEmailSkip')}\n \n )}\n \n {shouldConfirm && (\n \n {renderText(lang('YourEmailSkipWarningText'), ['br', 'simple_markdown'])}\n
\n \n {lang('YourEmailSkip')}\n \n \n {lang('Cancel')}\n \n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal((global, { icon }) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, icon === 'email' ? '💌' : '💡'),\n };\n})(SettingsTwoFaSkippableForm));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaCongratulations: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleClick = () => {\n onScreenSelect(SettingsScreens.Privacy);\n };\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaCongratulations);\n\n return (\n
\n
\n \n\n

\n {lang('TwoStepVerificationPasswordSetInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🥳'),\n };\n})(SettingsTwoFaCongratulations));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n isLoading?: boolean;\n error?: string;\n clearError: NoneToVoidFunction;\n onSubmit: (hint: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n codeLength: number;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaEmailCode: FC = ({\n animatedEmoji,\n codeLength,\n isLoading,\n error,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n const newValue = e.target.value.slice(0, codeLength);\n\n if (newValue.length === codeLength) {\n onSubmit(newValue);\n }\n\n setValue(newValue);\n e.target.value = newValue;\n };\n\n return (\n
\n
\n \n
\n\n
\n \n {isLoading && }\n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '💌'),\n codeLength: global.twoFaSettings.waitingEmailCodeLength,\n };\n})(SettingsTwoFaEmailCode));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer';\nimport useLang from '../../../../hooks/useLang';\n\nimport SettingsTwoFaEnabled from './SettingsTwoFaEnabled';\nimport SettingsTwoFaPassword from './SettingsTwoFaPassword';\nimport SettingsTwoFaStart from './SettingsTwoFaStart';\nimport SettingsTwoFaSkippableForm from './SettingsTwoFaSkippableForm';\nimport SettingsTwoFaCongratulations from './SettingsTwoFaCongratulations';\nimport SettingsTwoFaEmailCode from './SettingsTwoFaEmailCode';\n\nexport type OwnProps = {\n state: TwoFaState;\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n dispatch: TwoFaDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = GlobalState['twoFaSettings'];\n\nconst SettingsTwoFa: FC = ({\n currentScreen,\n shownScreen,\n state,\n hint,\n isLoading,\n error,\n waitingEmailCodeLength,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const {\n updatePassword,\n checkPassword,\n clearTwoFaError,\n updateRecoveryEmail,\n provideTwoFaEmailCode,\n clearPassword,\n } = getDispatch();\n\n useEffect(() => {\n if (waitingEmailCodeLength) {\n if (currentScreen === SettingsScreens.TwoFaNewPasswordEmail) {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmailCode);\n } else if (currentScreen === SettingsScreens.TwoFaRecoveryEmail) {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCode);\n }\n }\n }, [currentScreen, onScreenSelect, waitingEmailCodeLength]);\n\n const handleStartWizard = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.TwoFaNewPassword);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPassword = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordHint);\n }, [onScreenSelect]);\n\n const handleNewPasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmail);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updatePassword({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleChangePasswordCurrent = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordNew);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleChangePasswordNew = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaChangePasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleChangePasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordHint);\n }, [onScreenSelect]);\n\n const handleChangePasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n updatePassword({\n ...state,\n hint: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleTurnOff = useCallback((value: string) => {\n clearPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.Privacy);\n },\n });\n }, [clearPassword, onScreenSelect]);\n\n const handleRecoveryEmailCurrentPassword = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmail);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleRecoveryEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updateRecoveryEmail({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updateRecoveryEmail]);\n\n const handleEmailCode = useCallback((code: string) => {\n provideTwoFaEmailCode({ code });\n }, [provideTwoFaEmailCode]);\n\n const lang = useLang();\n\n switch (currentScreen) {\n case SettingsScreens.TwoFaDisabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n return (\n \n );\n\n case SettingsScreens.TwoFaCongratulations:\n return (\n \n );\n\n case SettingsScreens.TwoFaEnabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordCurrent:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordNew:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaTurnOff:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({ ...global.twoFaSettings }),\n)(SettingsTwoFa));\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../config';\nimport { unique } from '../../../util/iteratees';\nimport { filterChatsByName, isChatGroup, isUserId } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { useFolderManagerForOrderedIds } from '../../../hooks/useFolderManager';\nimport { getPrivacyKey } from './helper/privacy';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\n\nexport type OwnProps = {\n isAllowList?: boolean;\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: string;\n settings?: ApiPrivacySettings;\n};\n\nconst SettingsPrivacyVisibilityExceptionList: FC = ({\n isAllowList,\n screen,\n isActive,\n onScreenSelect,\n onReset,\n currentUserId,\n settings,\n}) => {\n const { setPrivacySettings } = getDispatch();\n\n const lang = useLang();\n\n const selectedContactIds = useMemo(() => {\n if (!settings) {\n return [];\n }\n\n if (isAllowList) {\n return [...settings.allowUserIds, ...settings.allowChatIds];\n } else {\n return [...settings.blockUserIds, ...settings.blockChatIds];\n }\n }, [isAllowList, settings]);\n const [searchQuery, setSearchQuery] = useState('');\n const [isSubmitShown, setIsSubmitShown] = useState(false);\n const [newSelectedContactIds, setNewSelectedContactIds] = useState(selectedContactIds);\n\n const folderAllOrderedIds = useFolderManagerForOrderedIds(ALL_FOLDER_ID);\n const folderArchivedOrderedIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID);\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on chats, so we avoid them\n const chatsById = getGlobal().chats.byId;\n\n const chatIds = unique([...folderAllOrderedIds || [], ...folderArchivedOrderedIds || []])\n .filter((chatId) => {\n const chat = chatsById[chatId];\n return chat && ((isUserId(chat.id) && chat.id !== currentUserId) || isChatGroup(chat));\n });\n\n return unique([\n ...selectedContactIds,\n ...filterChatsByName(lang, chatIds, chatsById, searchQuery),\n ]);\n }, [folderAllOrderedIds, folderArchivedOrderedIds, selectedContactIds, lang, searchQuery, currentUserId]);\n\n const handleSelectedContactIdsChange = useCallback((value: string[]) => {\n setNewSelectedContactIds(value);\n setIsSubmitShown(true);\n }, []);\n\n const handleSubmit = useCallback(() => {\n setPrivacySettings({\n privacyKey: getPrivacyKey(screen),\n isAllowList: Boolean(isAllowList),\n contactsIds: newSelectedContactIds,\n });\n\n onScreenSelect(SettingsScreens.Privacy);\n }, [isAllowList, newSelectedContactIds, onScreenSelect, screen, setPrivacySettings]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n \n\n \n \n \n
\n );\n};\n\nfunction getCurrentPrivacySettings(global: GlobalState, screen: SettingsScreens) {\n const { privacy } = global.settings;\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return privacy.phoneNumber;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return privacy.lastSeen;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return privacy.profilePhoto;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return privacy.forwards;\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return privacy.chatInvite;\n }\n\n return undefined;\n}\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n return {\n currentUserId: global.currentUserId,\n settings: getCurrentPrivacySettings(global, screen),\n };\n },\n)(SettingsPrivacyVisibilityExceptionList));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { ApiAvailableReaction } from '../../../api/types';\n\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport RadioGroup from '../../ui/RadioGroup';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n availableReactions?: ApiAvailableReaction[];\n selectedReaction?: string;\n};\n\nconst SettingsQuickReaction: FC = ({\n isActive,\n onReset,\n onScreenSelect,\n availableReactions,\n selectedReaction,\n}) => {\n const { setDefaultReaction } = getDispatch();\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n const options = availableReactions?.filter((l) => !l.isInactive).map((l) => {\n return {\n label: <>{l.title},\n value: l.reaction,\n };\n }) || [];\n\n const handleChange = useCallback((reaction: string) => {\n setDefaultReaction({ reaction });\n }, [setDefaultReaction]);\n\n return (\n
\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global) => {\n const { availableReactions, appConfig } = global;\n\n return {\n availableReactions,\n selectedReaction: appConfig?.defaultReaction,\n };\n },\n)(SettingsQuickReaction));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\nimport useTwoFaReducer from '../../../hooks/reducers/useTwoFaReducer';\n\nimport Transition from '../../ui/Transition';\nimport SettingsHeader from './SettingsHeader';\nimport SettingsMain from './SettingsMain';\nimport SettingsEditProfile from './SettingsEditProfile';\nimport SettingsDataStorage from './SettingsDataStorage';\nimport SettingsFolders from './folders/SettingsFolders';\nimport SettingsGeneral from './SettingsGeneral';\nimport SettingsGeneralBackground from './SettingsGeneralBackground';\nimport SettingsGeneralBackgroundColor from './SettingsGeneralBackgroundColor';\nimport SettingsNotifications from './SettingsNotifications';\nimport SettingsPrivacy from './SettingsPrivacy';\nimport SettingsLanguage from './SettingsLanguage';\nimport SettingsPrivacyVisibility from './SettingsPrivacyVisibility';\nimport SettingsPrivacyActiveSessions from './SettingsPrivacyActiveSessions';\nimport SettingsPrivacyBlockedUsers from './SettingsPrivacyBlockedUsers';\nimport SettingsTwoFa from './twoFa/SettingsTwoFa';\nimport SettingsPrivacyVisibilityExceptionList from './SettingsPrivacyVisibilityExceptionList';\nimport SettingsQuickReaction from './SettingsQuickReaction';\n\nimport './Settings.scss';\n\nconst TRANSITION_RENDER_COUNT = Object.keys(SettingsScreens).length / 2;\nconst TRANSITION_DURATION = 200;\n\nconst TWO_FA_SCREENS = [\n SettingsScreens.TwoFaDisabled,\n SettingsScreens.TwoFaNewPassword,\n SettingsScreens.TwoFaNewPasswordConfirm,\n SettingsScreens.TwoFaNewPasswordHint,\n SettingsScreens.TwoFaNewPasswordEmail,\n SettingsScreens.TwoFaNewPasswordEmailCode,\n SettingsScreens.TwoFaCongratulations,\n SettingsScreens.TwoFaEnabled,\n SettingsScreens.TwoFaChangePasswordCurrent,\n SettingsScreens.TwoFaChangePasswordNew,\n SettingsScreens.TwoFaChangePasswordConfirm,\n SettingsScreens.TwoFaChangePasswordHint,\n SettingsScreens.TwoFaTurnOff,\n SettingsScreens.TwoFaRecoveryEmailCurrentPassword,\n SettingsScreens.TwoFaRecoveryEmail,\n SettingsScreens.TwoFaRecoveryEmailCode,\n];\n\nconst FOLDERS_SCREENS = [\n SettingsScreens.Folders,\n SettingsScreens.FoldersCreateFolder,\n SettingsScreens.FoldersEditFolder,\n SettingsScreens.FoldersEditFolderFromChatList,\n SettingsScreens.FoldersIncludedChats,\n SettingsScreens.FoldersIncludedChatsFromChatList,\n SettingsScreens.FoldersExcludedChats,\n SettingsScreens.FoldersExcludedChatsFromChatList,\n];\n\nconst PRIVACY_SCREENS = [\n SettingsScreens.PrivacyBlockedUsers,\n SettingsScreens.PrivacyActiveSessions,\n];\n\nconst PRIVACY_PHONE_NUMBER_SCREENS = [\n SettingsScreens.PrivacyPhoneNumberAllowedContacts,\n SettingsScreens.PrivacyPhoneNumberDeniedContacts,\n];\n\nconst PRIVACY_LAST_SEEN_PHONE_SCREENS = [\n SettingsScreens.PrivacyLastSeenAllowedContacts,\n SettingsScreens.PrivacyLastSeenDeniedContacts,\n];\n\nconst PRIVACY_PROFILE_PHOTO_SCREENS = [\n SettingsScreens.PrivacyProfilePhotoAllowedContacts,\n SettingsScreens.PrivacyProfilePhotoDeniedContacts,\n];\n\nconst PRIVACY_FORWARDING_SCREENS = [\n SettingsScreens.PrivacyForwardingAllowedContacts,\n SettingsScreens.PrivacyForwardingDeniedContacts,\n];\n\nconst PRIVACY_GROUP_CHATS_SCREENS = [\n SettingsScreens.PrivacyGroupChatsAllowedContacts,\n SettingsScreens.PrivacyGroupChatsDeniedContacts,\n];\n\nexport type OwnProps = {\n isActive: boolean;\n currentScreen: SettingsScreens;\n foldersState: FoldersState;\n foldersDispatch: FolderEditDispatch;\n onScreenSelect: (screen: SettingsScreens) => void;\n shouldSkipTransition?: boolean;\n onReset: () => void;\n};\n\nconst Settings: FC = ({\n isActive,\n currentScreen,\n foldersState,\n foldersDispatch,\n onScreenSelect,\n onReset,\n shouldSkipTransition,\n}) => {\n const [twoFaState, twoFaDispatch] = useTwoFaReducer();\n\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n foldersDispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (foldersState.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n foldersState.mode, foldersDispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleSaveFilter = useCallback(() => {\n foldersDispatch({ type: 'saveFilters' });\n handleReset();\n }, [foldersDispatch, handleReset]);\n\n function renderCurrentSectionContent(isScreenActive: boolean, screen: SettingsScreens) {\n const privacyAllowScreens: Record = {\n [SettingsScreens.PrivacyPhoneNumber]: PRIVACY_PHONE_NUMBER_SCREENS.includes(screen),\n [SettingsScreens.PrivacyLastSeen]: PRIVACY_LAST_SEEN_PHONE_SCREENS.includes(screen),\n [SettingsScreens.PrivacyProfilePhoto]: PRIVACY_PROFILE_PHOTO_SCREENS.includes(screen),\n [SettingsScreens.PrivacyForwarding]: PRIVACY_FORWARDING_SCREENS.includes(screen),\n [SettingsScreens.PrivacyGroupChats]: PRIVACY_GROUP_CHATS_SCREENS.includes(screen),\n };\n\n const isTwoFaScreen = TWO_FA_SCREENS.includes(screen);\n const isFoldersScreen = FOLDERS_SCREENS.includes(screen);\n const isPrivacyScreen = PRIVACY_SCREENS.includes(screen)\n || isTwoFaScreen\n || Object.keys(privacyAllowScreens).includes(screen.toString())\n || Object.values(privacyAllowScreens).find((key) => key === true);\n\n switch (currentScreen) {\n case SettingsScreens.Main:\n return (\n \n );\n case SettingsScreens.EditProfile:\n return (\n \n );\n case SettingsScreens.General:\n return (\n \n );\n case SettingsScreens.QuickReaction:\n return (\n \n );\n case SettingsScreens.Notifications:\n return (\n \n );\n case SettingsScreens.DataStorage:\n return (\n \n );\n case SettingsScreens.Privacy:\n return (\n \n );\n case SettingsScreens.Language:\n return (\n \n );\n case SettingsScreens.GeneralChatBackground:\n return (\n \n );\n case SettingsScreens.GeneralChatBackgroundColor:\n return (\n \n );\n case SettingsScreens.PrivacyActiveSessions:\n return (\n \n );\n case SettingsScreens.PrivacyBlockedUsers:\n return (\n \n );\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return (\n \n );\n\n case SettingsScreens.Folders:\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaNewPasswordConfirm:\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaCongratulations:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n case SettingsScreens.TwoFaChangePasswordHint:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n case SettingsScreens.TwoFaRecoveryEmail:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n }\n\n function renderCurrentSection(isScreenActive: boolean, isFrom: boolean, currentKey: SettingsScreens) {\n return (\n <>\n \n {renderCurrentSectionContent(isScreenActive, currentKey)}\n \n );\n }\n\n return (\n \n {renderCurrentSection}\n \n );\n};\n\nexport default memo(Settings);\n","import React, {\n FC, useEffect, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiUserStatus } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { throttle } from '../../../util/schedulers';\nimport { filterUsersByName, sortUserIds } from '../../../modules/helpers';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ListItem from '../../ui/ListItem';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n filter: string;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n usersById: Record;\n userStatusesById: Record;\n contactIds?: string[];\n serverTimeOffset: number;\n};\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst ContactList: FC = ({\n isActive,\n filter,\n usersById,\n userStatusesById,\n contactIds,\n serverTimeOffset,\n onReset,\n}) => {\n const {\n loadContactList,\n openChat,\n } = getDispatch();\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n useHistoryBack(isActive, onReset);\n\n const handleClick = useCallback((id: string) => {\n openChat({ id, shouldReplaceHistory: true });\n }, [openChat]);\n\n const listIds = useMemo(() => {\n if (!contactIds) {\n return undefined;\n }\n\n const filteredIds = filterUsersByName(contactIds, usersById, filter);\n\n return sortUserIds(filteredIds, usersById, userStatusesById, undefined, serverTimeOffset);\n }, [contactIds, filter, usersById, userStatusesById, serverTimeOffset]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, listIds, Boolean(filter));\n\n return (\n \n {viewportIds?.length ? (\n viewportIds.map((id) => (\n handleClick(id)}\n ripple={!IS_SINGLE_COLUMN_LAYOUT}\n >\n \n \n ))\n ) : viewportIds && !viewportIds.length ? (\n

\n {filter.length ? 'No contacts matched your search.' : 'Contact list is empty.'}\n

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: contactIds } = global.contactList || {};\n const { byId: usersById, statusesById: userStatusesById } = global.users;\n\n return {\n usersById,\n userStatusesById,\n contactIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ContactList));\n","import React, {\n FC, useCallback, useEffect, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { unique } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport { filterUsersByName, isUserBot, sortChatIds } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Button from '../../ui/Button';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n selectedMemberIds: string[];\n onSelectedMemberIdsChange: (ids: string[]) => void;\n onNextStep: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n localContactIds?: string[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: string[];\n globalUserIds?: string[];\n};\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst NewChatStep1: FC = ({\n isChannel,\n isActive,\n selectedMemberIds,\n onSelectedMemberIdsChange,\n onNextStep,\n onReset,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n}) => {\n const {\n loadContactList,\n setGlobalSearchQuery,\n } = getDispatch();\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const handleFilterChange = useCallback((query: string) => {\n setGlobalSearchQuery({ query });\n }, [setGlobalSearchQuery]);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const foundContactIds = localContactIds ? filterUsersByName(localContactIds, usersById, searchQuery) : [];\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n if (!user) {\n return true;\n }\n\n return !user.isSelf && (user.canBeInvitedToGroup || !isUserBot(user));\n }),\n chatsById,\n false,\n selectedMemberIds,\n );\n }, [localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, selectedMemberIds]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length || isChannel) {\n setGlobalSearchQuery({ query: '' });\n onNextStep();\n }\n }, [selectedMemberIds.length, isChannel, setGlobalSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n \n \n

{lang('GroupAddMembers')}

\n
\n
\n \n\n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: chatsById } = global.chats;\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalResults,\n localResults,\n } = global.globalSearch;\n const { userIds: globalUserIds } = globalResults || {};\n const { userIds: localUserIds } = localResults || {};\n\n return {\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus?.chats,\n globalUserIds,\n localUserIds,\n };\n },\n)(NewChatStep1));\n","import React, {\n FC, useState, useCallback, useEffect, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ChatCreationProgress } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport Button from '../../ui/Button';\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n memberIds: string[];\n onReset: (forceReturnToChatList?: boolean) => void;\n};\n\ntype StateProps = {\n creationProgress?: ChatCreationProgress;\n creationError?: string;\n};\n\n// TODO @implement\nconst MAX_USERS_FOR_LEGACY_CHAT = 199; // Accounting for current user\n\nconst NewChatStep2: FC = ({\n isChannel,\n isActive,\n memberIds,\n onReset,\n creationProgress,\n creationError,\n}) => {\n const {\n createGroupChat,\n createChannel,\n } = getDispatch();\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const [title, setTitle] = useState('');\n const [about, setAbout] = useState('');\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n\n const chatTitleEmptyError = 'Chat title can\\'t be empty';\n const channelTitleEmptyError = 'Channel title can\\'t be empty';\n const chatTooManyUsersError = 'Sorry, creating supergroups is not yet supported';\n\n const isLoading = creationProgress === ChatCreationProgress.InProgress;\n\n const handleTitleChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n const newValue = value.replace(/^\\s+/, '');\n\n setTitle(newValue);\n\n if (newValue !== value) {\n e.currentTarget.value = newValue;\n }\n }, []);\n\n const handleDescriptionChange = useCallback((e: React.ChangeEvent) => {\n setAbout(e.currentTarget.value);\n }, []);\n\n const handleCreateGroup = useCallback(() => {\n if (!title.length) {\n setError(chatTitleEmptyError);\n return;\n }\n\n if (memberIds.length > MAX_USERS_FOR_LEGACY_CHAT) {\n setError(chatTooManyUsersError);\n return;\n }\n\n createGroupChat({\n title,\n photo,\n memberIds,\n });\n }, [title, memberIds, createGroupChat, photo, chatTitleEmptyError, chatTooManyUsersError]);\n\n const handleCreateChannel = useCallback(() => {\n if (!title.length) {\n setError(channelTitleEmptyError);\n return;\n }\n\n createChannel({\n title,\n about,\n photo,\n memberIds,\n });\n }, [title, createChannel, about, photo, memberIds, channelTitleEmptyError]);\n\n useEffect(() => {\n if (creationProgress === ChatCreationProgress.Complete) {\n onReset(true);\n }\n }, [creationProgress, onReset]);\n\n const renderedError = (creationError && lang(creationError)) || (\n error !== chatTitleEmptyError && error !== channelTitleEmptyError\n ? error\n : undefined\n );\n\n return (\n
\n
\n onReset()}\n ariaLabel=\"Return to member selection\"\n >\n \n \n

{lang(isChannel ? 'NewChannel' : 'NewGroup')}

\n
\n
\n \n \n {isChannel && (\n <>\n \n

{lang('DescriptionInfo')}

\n \n )}\n\n {renderedError && (\n

{renderedError}

\n )}\n\n {memberIds.length > 0 && (\n <>\n

{lang('GroupInfo.ParticipantCount', memberIds.length, 'i')}

\n\n
\n {memberIds.map((id) => (\n \n \n \n ))}\n
\n \n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n progress: creationProgress,\n error: creationError,\n } = global.chatCreation || {};\n\n return {\n creationProgress,\n creationError,\n };\n },\n)(NewChatStep2));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../lib/teact/teact';\n\nimport { LeftColumnContent } from '../../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\n\nimport Transition from '../../ui/Transition';\nimport NewChatStep1 from './NewChatStep1';\nimport NewChatStep2 from './NewChatStep2';\n\nimport './NewChat.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n isChannel?: boolean;\n content: LeftColumnContent;\n onContentChange: (content: LeftColumnContent) => void;\n onReset: () => void;\n};\n\nconst RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\n\nconst NewChat: FC = ({\n isActive,\n isChannel = false,\n content,\n onContentChange,\n onReset,\n}) => {\n const [newChatMemberIds, setNewChatMemberIds] = useState([]);\n\n const handleNextStep = useCallback(() => {\n onContentChange(isChannel ? LeftColumnContent.NewChannelStep2 : LeftColumnContent.NewGroupStep2);\n }, [isChannel, onContentChange]);\n\n return (\n \n {(isStepActive) => {\n switch (content) {\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewGroupStep1:\n return (\n \n );\n case LeftColumnContent.NewChannelStep2:\n case LeftColumnContent.NewGroupStep2:\n return (\n \n );\n default:\n return undefined;\n }\n }}\n \n );\n};\n\nexport default memo(NewChat);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from '../ui/Button';\nimport ChatList from './main/ChatList';\nimport { LeftColumnContent } from '../../types';\n\nimport './ArchivedChats.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n onReset: () => void;\n onContentChange: (content: LeftColumnContent) => void;\n};\n\nconst ArchivedChats: FC = ({ isActive, onReset, onContentChange }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onContentChange, LeftColumnContent.Archived);\n\n return (\n
\n
\n \n \n \n

{lang('ArchivedChats')}

\n
\n \n
\n );\n};\n\nexport default memo(ArchivedChats);\n","import React, {\n FC, useCallback, memo, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatFolder } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport CheckboxGroup from '../ui/CheckboxGroup';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId: string;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n};\n\ntype StateProps = {\n foldersById?: Record;\n folderOrderedIds?: number[];\n};\n\nconst ChatFolderModal: FC = ({\n isOpen,\n chatId,\n foldersById,\n folderOrderedIds,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const { editChatFolders } = getDispatch();\n\n const lang = useLang();\n\n const initialSelectedFolderIds = useMemo(() => {\n if (!foldersById) {\n return [];\n }\n\n return Object.keys(foldersById).reduce((result, folderId) => {\n const { includedChatIds, pinnedChatIds } = foldersById[Number(folderId)];\n if (includedChatIds.includes(chatId) || pinnedChatIds?.includes(chatId)) {\n result.push(folderId);\n }\n\n return result;\n }, [] as string[]);\n }, [chatId, foldersById]);\n\n const [selectedFolderIds, setSelectedFolderIds] = useState(initialSelectedFolderIds);\n\n const folders = useMemo(() => {\n return folderOrderedIds?.map((folderId) => ({\n label: foldersById ? foldersById[folderId].title : '',\n value: String(folderId),\n })) || [];\n }, [folderOrderedIds, foldersById]);\n\n const handleSubmit = useCallback(() => {\n const idsToRemove = initialSelectedFolderIds.filter((id) => !selectedFolderIds.includes(id)).map(Number);\n const idsToAdd = selectedFolderIds.filter((id) => !initialSelectedFolderIds.includes(id)).map(Number);\n\n editChatFolders({ chatId, idsToRemove, idsToAdd });\n onClose();\n }, [chatId, editChatFolders, initialSelectedFolderIds, onClose, selectedFolderIds]);\n\n if (!foldersById || !folderOrderedIds) {\n return undefined;\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: foldersById, orderedIds: folderOrderedIds } = global.chatFolders;\n\n return {\n foldersById,\n folderOrderedIds,\n };\n },\n)(ChatFolderModal));\n","import { ApiMediaFormat, ApiMessage } from '../../../../api/types';\n\nimport * as mediaLoader from '../../../../util/mediaLoader';\nimport {\n getMessageMediaHash,\n getMessagePhoto,\n getMessageText,\n getMessageTextWithSpoilers,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n hasMessageLocalBlobUrl,\n} from '../../../../modules/helpers';\nimport { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard';\nimport getMessageIdsForSelectedText from '../../../../util/getMessageIdsForSelectedText';\n\ntype ICopyOptions = {\n label: string;\n handler: () => void;\n}[];\n\nexport function getMessageCopyOptions(\n message: ApiMessage,\n afterEffect?: () => void,\n onCopyLink?: () => void,\n onCopyMessages?: (messageIds: number[]) => void,\n): ICopyOptions {\n const options: ICopyOptions = [];\n const text = getMessageText(message);\n const photo = getMessagePhoto(message)\n || (!getMessageWebPageVideo(message) ? getMessageWebPagePhoto(message) : undefined);\n const mediaHash = getMessageMediaHash(message, 'inline');\n const canImageBeCopied = photo && (mediaHash || hasMessageLocalBlobUrl(message)) && CLIPBOARD_ITEM_SUPPORTED;\n const selection = window.getSelection();\n\n if (canImageBeCopied) {\n options.push({\n label: 'lng_context_copy_image',\n handler: () => {\n Promise.resolve(mediaHash ? mediaLoader.fetch(mediaHash, ApiMediaFormat.BlobUrl) : photo!.blobUrl)\n .then(copyImageToClipboard);\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (text) {\n // Detect if the user has selection in the current message\n const hasSelection = Boolean((\n selection?.anchorNode?.parentNode\n && (selection.anchorNode.parentNode as HTMLElement).closest('.Message .content-inner')\n && selection.toString().replace(/(?:\\r\\n|\\r|\\n)/g, '') !== ''\n ));\n\n options.push({\n label: getCopyLabel(hasSelection),\n handler: () => {\n const messageIds = getMessageIdsForSelectedText();\n if (messageIds?.length && onCopyMessages) {\n onCopyMessages(messageIds);\n } else {\n const clipboardText = hasSelection && selection ? selection.toString() : getMessageTextWithSpoilers(message)!;\n copyTextToClipboard(clipboardText);\n }\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (onCopyLink) {\n options.push({\n label: 'lng_context_copy_message_link',\n handler: () => {\n onCopyLink();\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n return options;\n}\n\nfunction getCopyLabel(hasSelection: boolean): string {\n if (hasSelection) {\n return 'lng_context_copy_selected';\n }\n return 'lng_context_copy_text';\n}\n","let scrollLockEl: HTMLElement | null | undefined;\nlet excludedClosestSelector: string | undefined;\n\nconst IGNORED_KEYS: Record = {\n Down: true,\n ArrowDown: true,\n Up: true,\n ArrowUp: true,\n Left: true,\n ArrowLeft: true,\n Right: true,\n ArrowRight: true,\n ' ': true,\n PageUp: true,\n PageDown: true,\n End: true,\n Home: true,\n Tab: true,\n};\n\nfunction isTextBox(target: EventTarget | null) {\n if (!target || !(target instanceof HTMLElement)) return false;\n const element = target;\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'textarea') return true;\n if (tagName !== 'input') return false;\n const type = element.getAttribute('type');\n if (!type) return false;\n const inputTypes = [\n 'text', 'password', 'number', 'email', 'tel', 'url',\n 'search', 'date', 'datetime', 'datetime-local', 'time', 'month', 'week',\n ];\n return inputTypes.indexOf(type.toLowerCase()) > -1;\n}\n\nexport const getTouchY = (e: WheelEvent | TouchEvent | React.WheelEvent | React.TouchEvent) => {\n return ('changedTouches' in e ? e.changedTouches[0].clientY : 0);\n};\n\nconst preventDefault = (e: WheelEvent | TouchEvent) => {\n const deltaY = 'deltaY' in e ? e.deltaY : getTouchY(e);\n\n if (\n !scrollLockEl\n // Allow overlay scrolling\n || !scrollLockEl.contains(e.target as HTMLElement)\n // Prevent top overscroll\n || (scrollLockEl.scrollTop <= 0 && deltaY <= 0)\n // Prevent bottom overscroll\n || (scrollLockEl.scrollTop >= (scrollLockEl.scrollHeight - scrollLockEl.offsetHeight) && deltaY >= 0)\n ) {\n if (excludedClosestSelector && (e.target as HTMLElement).closest(excludedClosestSelector)) return;\n e.preventDefault();\n }\n};\n\nfunction preventDefaultForScrollKeys(e: KeyboardEvent) {\n if (IGNORED_KEYS[e.key] && !isTextBox(e.target)) {\n e.preventDefault();\n }\n}\n\nexport function disableScrolling(el?: HTMLElement | null, _excludedClosestSelector?: string) {\n scrollLockEl = el;\n excludedClosestSelector = _excludedClosestSelector;\n // Disable scrolling in Chrome\n document.addEventListener('wheel', preventDefault, { passive: false });\n document.addEventListener('touchmove', preventDefault, { passive: false });\n document.onkeydown = preventDefaultForScrollKeys;\n}\n\nexport function enableScrolling() {\n scrollLockEl = undefined;\n excludedClosestSelector = undefined;\n document.removeEventListener('wheel', preventDefault); // Enable scrolling in Chrome\n document.removeEventListener('touchmove', preventDefault);\n // eslint-disable-next-line no-null/no-null\n document.onkeydown = null;\n}\n","import React, {\n FC, memo, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types';\n\nimport useMedia from '../../../hooks/useMedia';\nimport useFlag from '../../../hooks/useFlag';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { createClassNameBuilder } from '../../../util/buildClassName';\nimport { IS_COMPACT_MENU } from '../../../util/environment';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\nimport './ReactionSelectorReaction.scss';\n\nconst REACTION_SIZE = IS_COMPACT_MENU ? 24 : 32;\n\ntype OwnProps = {\n reaction: ApiAvailableReaction;\n previewIndex: number;\n isReady?: boolean;\n onSendReaction: (reaction: string, x: number, y: number) => void;\n};\n\nconst cn = createClassNameBuilder('ReactionSelectorReaction');\n\nconst ReactionSelectorReaction: FC = ({ reaction, previewIndex, onSendReaction, isReady }) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const mediaData = useMedia(`document${reaction.selectAnimation?.id}`, !isReady, ApiMediaFormat.Lottie);\n\n const [isActivated, activate, deactivate] = useFlag();\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n\n const shouldRenderAnimated = Boolean(isReady && mediaData);\n const { transitionClassNames: animatedClassNames } = useShowTransition(shouldRenderAnimated);\n const { shouldRender: shouldRenderStatic, transitionClassNames: staticClassNames } = useShowTransition(\n !isReady || !isAnimationLoaded, undefined, true,\n );\n\n function handleClick() {\n if (!containerRef.current) return;\n const { x, y } = containerRef.current.getBoundingClientRect();\n\n onSendReaction(reaction.reaction, x, y);\n }\n\n return (\n \n {shouldRenderStatic && (\n \n )}\n {shouldRenderAnimated && (\n \n )}\n
\n );\n};\n\nexport default memo(ReactionSelectorReaction);\n","import React, {\n FC, memo, useLayoutEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction } from '../../../api/types';\n\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useFlag from '../../../hooks/useFlag';\nimport { getTouchY } from '../../../util/scrollLock';\nimport { createClassNameBuilder } from '../../../util/buildClassName';\nimport { IS_COMPACT_MENU } from '../../../util/environment';\n\nimport ReactionSelectorReaction from './ReactionSelectorReaction';\n\nimport './ReactionSelector.scss';\n\ntype OwnProps = {\n enabledReactions?: string[];\n onSendReaction: (reaction: string, x: number, y: number) => void;\n isPrivate?: boolean;\n availableReactions?: ApiAvailableReaction[];\n isReady?: boolean;\n};\n\nconst cn = createClassNameBuilder('ReactionSelector');\n\nconst ReactionSelector: FC = ({\n availableReactions,\n enabledReactions,\n onSendReaction,\n isPrivate,\n isReady,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const itemsScrollRef = useRef(null);\n const [isHorizontalScrollEnabled, enableHorizontalScroll] = useFlag(false);\n useHorizontalScroll(itemsScrollRef.current, !isHorizontalScrollEnabled);\n\n useLayoutEffect(() => {\n enableHorizontalScroll();\n }, [enableHorizontalScroll]);\n\n const handleWheel = (e: React.WheelEvent | React.TouchEvent) => {\n if (!itemsScrollRef) return;\n const deltaY = 'deltaY' in e ? e.deltaY : getTouchY(e);\n\n if (deltaY) {\n e.preventDefault();\n }\n };\n\n if ((!isPrivate && !enabledReactions?.length) || !availableReactions) return undefined;\n\n return (\n
\n
\n
\n
\n
\n {availableReactions?.map((reaction, i) => {\n if (reaction.isInactive\n || (!isPrivate && (!enabledReactions || !enabledReactions.includes(reaction.reaction)))) return undefined;\n return (\n \n );\n })}\n
\n
\n
\n );\n};\n\nexport default memo(ReactionSelector);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAvailableReaction, ApiMessage, ApiUser } from '../../../api/types';\nimport { IAnchorPosition } from '../../../types';\n\nimport { getMessageCopyOptions } from './helpers/copyOptions';\nimport { disableScrolling, enableScrolling } from '../../../util/scrollLock';\nimport useContextMenuPosition from '../../../hooks/useContextMenuPosition';\nimport useLang from '../../../hooks/useLang';\nimport buildClassName from '../../../util/buildClassName';\nimport useFlag from '../../../hooks/useFlag';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\nimport Avatar from '../../common/Avatar';\nimport ReactionSelector from './ReactionSelector';\n\nimport './MessageContextMenu.scss';\n\ntype OwnProps = {\n availableReactions?: ApiAvailableReaction[];\n isOpen: boolean;\n anchor: IAnchorPosition;\n message: ApiMessage;\n canSendNow?: boolean;\n enabledReactions?: string[];\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canShowReactionsCount?: boolean;\n canShowReactionList?: boolean;\n canRemoveReaction?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n isPrivate?: boolean;\n canDownload?: boolean;\n isDownloading?: boolean;\n canShowSeenBy?: boolean;\n seenByRecentUsers?: ApiUser[];\n onReply: () => void;\n onEdit: () => void;\n onPin: () => void;\n onUnpin: () => void;\n onForward: () => void;\n onDelete: () => void;\n onReport: () => void;\n onFaveSticker: () => void;\n onUnfaveSticker: () => void;\n onSelect: () => void;\n onSend: () => void;\n onReschedule: () => void;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onCopyLink?: () => void;\n onCopyMessages?: (messageIds: number[]) => void;\n onDownload?: () => void;\n onShowSeenBy?: () => void;\n onShowReactors?: () => void;\n onSendReaction: (reaction: string | undefined, x: number, y: number) => void;\n};\n\nconst SCROLLBAR_WIDTH = 10;\nconst REACTION_BUBBLE_EXTRA_WIDTH = 32;\nconst ANIMATION_DURATION = 200;\n\nconst MessageContextMenu: FC = ({\n availableReactions,\n isOpen,\n message,\n isPrivate,\n enabledReactions,\n anchor,\n canSendNow,\n canReschedule,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n isDownloading,\n canShowSeenBy,\n canShowReactionsCount,\n canRemoveReaction,\n canShowReactionList,\n seenByRecentUsers,\n onReply,\n onEdit,\n onPin,\n onUnpin,\n onForward,\n onDelete,\n onReport,\n onFaveSticker,\n onUnfaveSticker,\n onSelect,\n onSend,\n onReschedule,\n onClose,\n onCloseAnimationEnd,\n onCopyLink,\n onDownload,\n onShowSeenBy,\n onShowReactors,\n onSendReaction,\n onCopyMessages,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const scrollableRef = useRef(null);\n const copyOptions = getMessageCopyOptions(message, onClose, canCopyLink ? onCopyLink : undefined, onCopyMessages);\n const noReactions = !isPrivate && !enabledReactions?.length;\n const withReactions = canShowReactionList && !noReactions;\n\n const [isReady, markIsReady, unmarkIsReady] = useFlag();\n\n const getTriggerElement = useCallback(() => {\n return document.querySelector(`.Transition__slide--active > .MessageList div[data-message-id=\"${message.id}\"]`);\n }, [message.id]);\n\n const getRootElement = useCallback(\n () => document.querySelector('.Transition__slide--active > .MessageList'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => document.querySelector('.MessageContextMenu .bubble'),\n [],\n );\n\n const getLayout = useCallback(() => {\n const extraHeightAudioPlayer = (IS_SINGLE_COLUMN_LAYOUT\n && (document.querySelector('.AudioPlayer-content'))?.offsetHeight) || 0;\n const pinnedElement = document.querySelector('.HeaderPinnedMessage-wrapper');\n const extraHeightPinned = (((IS_SINGLE_COLUMN_LAYOUT && !extraHeightAudioPlayer)\n || (!IS_SINGLE_COLUMN_LAYOUT && pinnedElement?.classList.contains('full-width')))\n && pinnedElement?.offsetHeight) || 0;\n\n return {\n extraPaddingX: SCROLLBAR_WIDTH,\n extraTopPadding: (document.querySelector('.MiddleHeader')!).offsetHeight,\n marginSides: withReactions ? REACTION_BUBBLE_EXTRA_WIDTH : undefined,\n extraMarginTop: extraHeightPinned + extraHeightAudioPlayer,\n };\n }, [withReactions]);\n\n const handleRemoveReaction = useCallback(() => {\n onSendReaction(undefined, 0, 0);\n }, [onSendReaction]);\n\n useEffect(() => {\n if (!isOpen) {\n unmarkIsReady();\n return;\n }\n\n setTimeout(() => {\n markIsReady();\n }, ANIMATION_DURATION);\n }, [isOpen, markIsReady, unmarkIsReady]);\n\n const {\n positionX, positionY, transformOriginX, transformOriginY, style, menuStyle, withScroll,\n } = useContextMenuPosition(anchor, getTriggerElement, getRootElement, getMenuElement, getLayout);\n\n useEffect(() => {\n disableScrolling(withScroll ? scrollableRef.current : undefined, '.ReactionSelector');\n\n return enableScrolling;\n }, [withScroll]);\n\n const lang = useLang();\n\n return (\n \n {canShowReactionList && (\n \n )}\n\n \n {canRemoveReaction && Remove Reaction}\n {canSendNow && {lang('MessageScheduleSend')}}\n {canReschedule && (\n {lang('MessageScheduleEditTime')}\n )}\n {canReply && {lang('Reply')}}\n {canEdit && {lang('Edit')}}\n {canFaveSticker && (\n {lang('AddToFavorites')}\n )}\n {canUnfaveSticker && (\n {lang('Stickers.RemoveFromFavorites')}\n )}\n {canCopy && copyOptions.map((options) => (\n {lang(options.label)}\n ))}\n {canPin && {lang('DialogPin')}}\n {canUnpin && {lang('DialogUnpin')}}\n {canDownload && (\n \n {isDownloading ? lang('lng_context_cancel_download') : lang('lng_media_download')}\n \n )}\n {canForward && {lang('Forward')}}\n {canSelect && {lang('Common.Select')}}\n {canReport && {lang('lng_context_report_msg')}}\n {(canShowSeenBy || canShowReactionsCount) && (\n \n {canShowReactionsCount && message.reactors?.count ? (\n canShowSeenBy && message.seenByUserIds?.length\n ? lang('Chat.OutgoingContextMixedReactionCount', [message.reactors.count, message.seenByUserIds.length])\n : lang('Chat.ContextReactionCount', message.reactors.count, 'i')\n ) : (\n message.seenByUserIds?.length\n ? lang('Conversation.ContextMenuSeen', message.seenByUserIds.length, 'i')\n : lang('Conversation.ContextMenuNoViews')\n )}\n
\n {seenByRecentUsers?.map((user) => (\n \n ))}\n
\n \n )}\n {canDelete && {lang('Delete')}}\n
\n \n );\n};\n\nexport default memo(MessageContextMenu);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { MessageListType } from '../../../global/types';\nimport { ApiAvailableReaction, ApiMessage } from '../../../api/types';\nimport { IAlbum, IAnchorPosition } from '../../../types';\nimport {\n selectActiveDownloadIds,\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectIsMessageProtected,\n} from '../../../modules/selectors';\nimport {\n isActionMessage, isChatChannel,\n isChatGroup, isOwnMessage, areReactionsEmpty, isUserId, isMessageLocal,\n} from '../../../modules/helpers';\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../../../config';\nimport { getDayStartAt } from '../../../util/dateFormat';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport { REM } from '../../common/helpers/mediaDimensions';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal';\nimport ReportMessageModal from '../../common/ReportMessageModal';\nimport PinMessageModal from '../../common/PinMessageModal';\nimport MessageContextMenu from './MessageContextMenu';\nimport CalendarModal from '../../common/CalendarModal';\nimport buildClassName from '../../../util/buildClassName';\n\nconst START_SIZE = 2 * REM;\n\nexport type OwnProps = {\n isOpen: boolean;\n chatUsername?: string;\n message: ApiMessage;\n album?: IAlbum;\n anchor: IAnchorPosition;\n messageListType: MessageListType;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n availableReactions?: ApiAvailableReaction[];\n noOptions?: boolean;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canShowReactionsCount?: boolean;\n canShowReactionList?: boolean;\n canRemoveReaction?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n isPrivate?: boolean;\n hasFullInfo?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n canDownload?: boolean;\n activeDownloads: number[];\n canShowSeenBy?: boolean;\n enabledReactions?: string[];\n};\n\nconst ContextMenuContainer: FC = ({\n availableReactions,\n isOpen,\n messageListType,\n chatUsername,\n message,\n album,\n anchor,\n onClose,\n onCloseAnimationEnd,\n noOptions,\n canSendNow,\n hasFullInfo,\n canReschedule,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canShowReactionsCount,\n canShowReactionList,\n canRemoveReaction,\n canEdit,\n enabledReactions,\n isPrivate,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n activeDownloads,\n canShowSeenBy,\n}) => {\n const {\n setReplyingToId,\n setEditingId,\n pinMessage,\n openForwardMenu,\n faveSticker,\n unfaveSticker,\n toggleMessageSelection,\n sendScheduledMessages,\n rescheduleMessage,\n downloadMessageMedia,\n cancelMessageMediaDownload,\n loadSeenBy,\n openSeenByModal,\n sendReaction,\n openReactorListModal,\n loadFullChat,\n loadReactors,\n copyMessagesByIds,\n } = getDispatch();\n\n const { transitionClassNames } = useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const [isReportModalOpen, setIsReportModalOpen] = useState(false);\n const [isPinModalOpen, setIsPinModalOpen] = useState(false);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n\n useEffect(() => {\n if (canShowSeenBy && isOpen) {\n loadSeenBy({ chatId: message.chatId, messageId: message.id });\n }\n }, [loadSeenBy, isOpen, message.chatId, message.id, canShowSeenBy]);\n\n useEffect(() => {\n if (canShowReactionsCount && isOpen) {\n loadReactors({ chatId: message.chatId, messageId: message.id });\n }\n }, [canShowReactionsCount, isOpen, loadReactors, message.chatId, message.id]);\n\n useEffect(() => {\n if (!hasFullInfo && !isPrivate && isOpen) {\n loadFullChat({ chatId: message.chatId });\n }\n }, [hasFullInfo, isOpen, isPrivate, loadFullChat, message.chatId]);\n\n const seenByRecentUsers = useMemo(() => {\n if (message.reactions?.recentReactions?.length) {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return message.reactions?.recentReactions?.slice(0, 3).map(({ userId }) => usersById[userId]).filter(Boolean);\n }\n\n if (!message.seenByUserIds) {\n return undefined;\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n return message.seenByUserIds?.slice(0, 3).map((id) => usersById[id]).filter(Boolean);\n }, [message.reactions?.recentReactions, message.seenByUserIds]);\n\n const isDownloading = album ? album.messages.some((msg) => activeDownloads.includes(msg.id))\n : activeDownloads.includes(message.id);\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const handleReport = useCallback(() => {\n setIsMenuOpen(false);\n setIsReportModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closeReportModal = useCallback(() => {\n setIsReportModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closePinModal = useCallback(() => {\n setIsPinModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n onClose();\n }, [closeCalendar, onClose]);\n\n const handleReply = useCallback(() => {\n setReplyingToId({ messageId: message.id });\n closeMenu();\n }, [setReplyingToId, message.id, closeMenu]);\n\n const handleEdit = useCallback(() => {\n setEditingId({ messageId: message.id });\n closeMenu();\n }, [setEditingId, message.id, closeMenu]);\n\n const handlePin = useCallback(() => {\n setIsMenuOpen(false);\n setIsPinModalOpen(true);\n }, []);\n\n const handleUnpin = useCallback(() => {\n pinMessage({ messageId: message.id, isUnpin: true });\n closeMenu();\n }, [pinMessage, message.id, closeMenu]);\n\n const handleForward = useCallback(() => {\n closeMenu();\n if (album?.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: message.chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: message.chatId, messageIds: [message.id] });\n }\n }, [openForwardMenu, message, closeMenu, album]);\n\n const handleFaveSticker = useCallback(() => {\n closeMenu();\n faveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, faveSticker]);\n\n const handleUnfaveSticker = useCallback(() => {\n closeMenu();\n unfaveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, unfaveSticker]);\n\n const handleSelectMessage = useCallback(() => {\n const params = album?.messages\n ? {\n messageId: message.id,\n childMessageIds: album.messages.map(({ id }) => id),\n withShift: false,\n }\n : { messageId: message.id, withShift: false };\n\n toggleMessageSelection(params);\n closeMenu();\n }, [closeMenu, message.id, toggleMessageSelection, album]);\n\n const handleScheduledMessageSend = useCallback(() => {\n sendScheduledMessages({ chatId: message.chatId, id: message.id });\n closeMenu();\n }, [closeMenu, message.chatId, message.id, sendScheduledMessages]);\n\n const handleOpenCalendar = useCallback(() => {\n setIsMenuOpen(false);\n openCalendar();\n }, [openCalendar]);\n\n const handleOpenSeenByModal = useCallback(() => {\n closeMenu();\n openSeenByModal({ chatId: message.chatId, messageId: message.id });\n }, [closeMenu, message.chatId, message.id, openSeenByModal]);\n\n const handleOpenReactorListModal = useCallback(() => {\n closeMenu();\n openReactorListModal({ chatId: message.chatId, messageId: message.id });\n }, [closeMenu, openReactorListModal, message.chatId, message.id]);\n\n const handleRescheduleMessage = useCallback((date: Date) => {\n rescheduleMessage({\n chatId: message.chatId,\n messageId: message.id,\n scheduledAt: Math.round(date.getTime() / 1000),\n });\n }, [message.chatId, message.id, rescheduleMessage]);\n\n const handleCopyMessages = useCallback((messageIds: number[]) => {\n copyMessagesByIds({ messageIds });\n closeMenu();\n }, [closeMenu, copyMessagesByIds]);\n\n const handleCopyLink = useCallback(() => {\n copyTextToClipboard(`https://t.me/${chatUsername || `c/${message.chatId.replace('-', '')}`}/${message.id}`);\n closeMenu();\n }, [chatUsername, closeMenu, message.chatId, message.id]);\n\n const handleDownloadClick = useCallback(() => {\n (album?.messages || [message]).forEach((msg) => {\n if (isDownloading) {\n cancelMessageMediaDownload({ message: msg });\n } else {\n downloadMessageMedia({ message: msg });\n }\n });\n closeMenu();\n }, [album, message, closeMenu, isDownloading, cancelMessageMediaDownload, downloadMessageMedia]);\n\n const handleSendReaction = useCallback((reaction: string | undefined, x: number, y: number) => {\n sendReaction({\n chatId: message.chatId, messageId: message.id, reaction, x, y, startSize: START_SIZE,\n });\n closeMenu();\n }, [closeMenu, message.chatId, message.id, sendReaction]);\n\n const reportMessageIds = useMemo(() => (album ? album.messages : [message]).map(({ id }) => id), [album, message]);\n\n if (noOptions) {\n closeMenu();\n\n return undefined;\n }\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n return (\n
\n \n \n \n \n {canReschedule && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message, messageListType }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const activeDownloads = selectActiveDownloadIds(global, message.chatId);\n const chat = selectChat(global, message.chatId);\n const { seenByExpiresAt, seenByMaxChatMembers } = global.appConfig || {};\n const {\n noOptions,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canEdit,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const isPinned = messageListType === 'pinned';\n const isScheduled = messageListType === 'scheduled';\n const isChannel = chat && isChatChannel(chat);\n const isLocal = isMessageLocal(message);\n const canShowSeenBy = Boolean(chat\n && seenByMaxChatMembers\n && seenByExpiresAt\n && isChatGroup(chat)\n && isOwnMessage(message)\n && !isScheduled\n && chat.membersCount\n && chat.membersCount < seenByMaxChatMembers\n && message.date > Date.now() / 1000 - seenByExpiresAt);\n const isPrivate = chat && isUserId(chat.id);\n const isAction = isActionMessage(message);\n const canShowReactionsCount = !isLocal && !isChannel && !isScheduled && !isAction && !isPrivate && message.reactions\n && !areReactionsEmpty(message.reactions) && message.reactions.canSeeList;\n const canRemoveReaction = isPrivate && message.reactions?.results?.some((l) => l.isChosen);\n const isProtected = selectIsMessageProtected(global, message);\n\n return {\n availableReactions: global.availableReactions,\n noOptions,\n canSendNow: isScheduled,\n canReschedule: isScheduled,\n canReply: !isPinned && !isScheduled && canReply,\n canPin: !isScheduled && canPin,\n canUnpin: !isScheduled && canUnpin,\n canDelete,\n canReport,\n canEdit: !isPinned && canEdit,\n canForward: !isProtected && !isScheduled && canForward,\n canFaveSticker: !isScheduled && canFaveSticker,\n canUnfaveSticker: !isScheduled && canUnfaveSticker,\n canCopy: !isProtected && canCopy,\n canCopyLink: !isProtected && !isScheduled && canCopyLink,\n canSelect,\n canDownload: !isProtected && canDownload,\n activeDownloads,\n canShowSeenBy,\n enabledReactions: chat?.fullInfo?.enabledReactions,\n isPrivate,\n hasFullInfo: Boolean(chat?.fullInfo),\n canShowReactionsCount,\n canShowReactionList: !isLocal && !isAction && !isScheduled && chat?.id !== SERVICE_NOTIFICATIONS_USER_ID,\n canRemoveReaction,\n };\n },\n)(ContextMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiStickerSet } from '../../api/types';\n\nimport { STICKER_SIZE_MODAL } from '../../config';\nimport {\n selectChat, selectCurrentMessageList, selectStickerSet, selectStickerSetByShortName,\n} from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\nimport { getAllowedAttachmentOptions, getCanPostInChat } from '../../modules/helpers';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Loading from '../ui/Loading';\nimport StickerButton from './StickerButton';\n\nimport './StickerSetModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n fromSticker?: ApiSticker;\n stickerSetShortName?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n canSendStickers?: boolean;\n stickerSet?: ApiStickerSet;\n};\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerSetModal: FC = ({\n isOpen,\n fromSticker,\n stickerSetShortName,\n stickerSet,\n canSendStickers,\n onClose,\n}) => {\n const {\n loadStickers,\n toggleStickerSet,\n sendMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const lang = useLang();\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });\n\n useEffect(() => {\n if (isOpen) {\n if (fromSticker) {\n const { stickerSetId, stickerSetAccessHash } = fromSticker;\n loadStickers({\n stickerSetId,\n stickerSetAccessHash,\n });\n } else if (stickerSetShortName) {\n loadStickers({\n stickerSetShortName,\n });\n }\n }\n }, [isOpen, fromSticker, loadStickers, stickerSetShortName]);\n\n const handleSelect = useCallback((sticker: ApiSticker) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n sendMessage({ sticker });\n onClose();\n }, [onClose, sendMessage]);\n\n const handleButtonClick = useCallback(() => {\n if (stickerSet) {\n toggleStickerSet({ stickerSetId: stickerSet.id });\n onClose();\n }\n }, [onClose, stickerSet, toggleStickerSet]);\n\n return (\n \n {stickerSet?.stickers ? (\n <>\n
\n {stickerSet.stickers.map((sticker) => (\n \n ))}\n
\n
\n \n {lang(\n stickerSet.installedDate ? 'StickerPack.RemoveStickerCount' : 'StickerPack.AddStickerCount',\n stickerSet.count,\n 'i',\n )}\n \n
\n \n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { fromSticker, stickerSetShortName }): StateProps => {\n const currentMessageList = selectCurrentMessageList(global);\n const { chatId, threadId } = currentMessageList || {};\n const chat = chatId && selectChat(global, chatId);\n const sendOptions = chat ? getAllowedAttachmentOptions(chat) : undefined;\n const canSendStickers = Boolean(\n chat && threadId && getCanPostInChat(chat, threadId) && sendOptions?.canSendStickers,\n );\n\n return {\n canSendStickers,\n stickerSet: fromSticker\n ? selectStickerSet(global, fromSticker.stickerSetId)\n : stickerSetShortName\n ? selectStickerSetByShortName(global, stickerSetShortName)\n : undefined,\n };\n },\n)(StickerSetModal));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { disableScrolling, enableScrolling } from '../../util/scrollLock';\nimport {\n selectChat, selectNotifySettings, selectNotifyExceptions, selectUser,\n} from '../../modules/selectors';\nimport {\n isUserId, getCanDeleteChat, selectIsChatMuted, getCanAddContact,\n} from '../../modules/helpers';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Portal from '../ui/Portal';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\nimport DeleteChatModal from '../common/DeleteChatModal';\n\nimport './HeaderMenuContainer.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId: number;\n isOpen: boolean;\n withExtraActions: boolean;\n anchor: IAnchorPosition;\n isChannel?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canCall?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n canEnterVoiceChat?: boolean;\n canCreateVoiceChat?: boolean;\n onSubscribeChannel: () => void;\n onSearchClick: () => void;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isPrivate?: boolean;\n isMuted?: boolean;\n canAddContact?: boolean;\n canDeleteChat?: boolean;\n hasLinkedChat?: boolean;\n};\n\nconst HeaderMenuContainer: FC = ({\n chatId,\n isOpen,\n withExtraActions,\n anchor,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canCall,\n canMute,\n canLeave,\n canEnterVoiceChat,\n canCreateVoiceChat,\n chat,\n isPrivate,\n isMuted,\n canDeleteChat,\n hasLinkedChat,\n canAddContact,\n onSubscribeChannel,\n onSearchClick,\n onClose,\n onCloseAnimationEnd,\n}) => {\n const {\n updateChatMutedState,\n enterMessageSelectMode,\n sendBotCommand,\n restartBot,\n joinGroupCall,\n createGroupCall,\n openLinkedChat,\n addContact,\n openCallFallbackConfirm,\n } = getDispatch();\n\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const { x, y } = anchor;\n\n useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleToggleMuteClick = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n closeMenu();\n }, [chatId, closeMenu, isMuted, updateChatMutedState]);\n\n const handleEnterVoiceChatClick = useCallback(() => {\n if (canCreateVoiceChat) {\n // TODO show popup to schedule\n createGroupCall({\n chatId,\n });\n } else {\n joinGroupCall({\n chatId,\n });\n }\n closeMenu();\n }, [closeMenu, canCreateVoiceChat, chatId, joinGroupCall, createGroupCall]);\n\n const handleLinkedChatClick = useCallback(() => {\n openLinkedChat({ id: chatId });\n closeMenu();\n }, [chatId, closeMenu, openLinkedChat]);\n\n const handleAddContactClick = useCallback(() => {\n addContact({ userId: chatId });\n closeMenu();\n }, [addContact, chatId, closeMenu]);\n\n const handleSubscribe = useCallback(() => {\n onSubscribeChannel();\n closeMenu();\n }, [closeMenu, onSubscribeChannel]);\n\n const handleCall = useCallback(() => {\n openCallFallbackConfirm();\n closeMenu();\n }, [closeMenu, openCallFallbackConfirm]);\n\n const handleSearch = useCallback(() => {\n onSearchClick();\n closeMenu();\n }, [closeMenu, onSearchClick]);\n\n const handleSelectMessages = useCallback(() => {\n enterMessageSelectMode();\n closeMenu();\n }, [closeMenu, enterMessageSelectMode]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\n\n const lang = useLang();\n\n return (\n \n
\n \n {withExtraActions && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {withExtraActions && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {withExtraActions && canSubscribe && (\n \n {lang(isChannel ? 'ProfileJoinChannel' : 'ProfileJoinGroup')}\n \n )}\n {canAddContact && (\n \n {lang('AddContact')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canCall && (\n \n {lang('Call')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n {lang('Search')}\n \n )}\n {canMute && (\n \n {lang(isMuted ? 'ChatsUnmute' : 'ChatsMute')}\n \n )}\n {(canEnterVoiceChat || canCreateVoiceChat) && (\n \n {lang(canCreateVoiceChat ? 'StartVoipChat' : 'VoipGroupJoinCall')}\n \n )}\n {hasLinkedChat && (\n \n {lang(isChannel ? 'ViewDiscussion' : 'lng_profile_view_channel')}\n \n )}\n \n {lang('ReportSelectMessages')}\n \n {canLeave && (\n \n {lang(isPrivate\n ? 'DeleteChatUser'\n : (canDeleteChat ? 'GroupInfo.DeleteAndExit' : (isChannel ? 'LeaveChannel' : 'Group.LeaveGroup')))}\n \n )}\n \n {chat && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n const isPrivate = isUserId(chat.id);\n const user = isPrivate ? selectUser(global, chatId) : undefined;\n const canAddContact = user && getCanAddContact(user);\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n isPrivate,\n canAddContact,\n canDeleteChat: getCanDeleteChat(chat),\n hasLinkedChat: Boolean(chat?.fullInfo?.linkedChatId),\n };\n },\n)(HeaderMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\n\nimport { debounce } from '../../util/schedulers';\nimport { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors';\nimport { getDayStartAt } from '../../util/dateFormat';\n\nimport Button from '../ui/Button';\nimport SearchInput from '../ui/SearchInput';\n\nimport './MobileSearch.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n};\n\ntype StateProps = {\n isActive?: boolean;\n chat?: ApiChat;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n isHistoryCalendarOpen?: boolean;\n};\n\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nconst MobileSearchFooter: FC = ({\n isActive,\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen,\n}) => {\n const {\n setLocalTextSearchQuery,\n searchTextMessagesLocal,\n focusMessage,\n closeLocalTextSearch,\n openHistoryCalendar,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [focusedIndex, setFocusedIndex] = useState(0);\n\n // Fix for iOS keyboard\n useEffect(() => {\n const { visualViewport } = window as any;\n if (!visualViewport) {\n return undefined;\n }\n\n const mainEl = document.getElementById('Main') as HTMLDivElement;\n const handleResize = () => {\n const { activeElement } = document;\n if (activeElement && (activeElement === inputRef.current)) {\n const { pageTop, height } = visualViewport;\n mainEl.style.transform = `translateY(${pageTop}px)`;\n mainEl.style.height = `${height}px`;\n document.documentElement.scrollTop = pageTop;\n } else {\n mainEl.style.transform = '';\n mainEl.style.height = '';\n }\n };\n\n visualViewport.addEventListener('resize', handleResize);\n\n return () => {\n visualViewport.removeEventListener('resize', handleResize);\n };\n }, []);\n\n // Focus message\n useEffect(() => {\n if (chat?.id && foundIds?.length) {\n focusMessage({ chatId: chat.id, messageId: foundIds[0] });\n setFocusedIndex(0);\n } else {\n setFocusedIndex(-1);\n }\n }, [chat?.id, focusMessage, foundIds]);\n\n // Disable native up/down buttons on iOS\n useEffect(() => {\n Array.from(document.querySelectorAll('input')).forEach((input) => {\n input.disabled = Boolean(isActive && input !== inputRef.current);\n });\n\n Array.from(document.querySelectorAll('div[contenteditable]')).forEach((div) => {\n div.contentEditable = isActive ? 'false' : 'true';\n });\n }, [isActive]);\n\n // Blur on exit\n useEffect(() => {\n if (!isActive) {\n inputRef.current!.blur();\n }\n }, [isActive]);\n\n useLayoutEffect(() => {\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.blur();\n }, [isHistoryCalendarOpen]);\n\n const handleMessageSearchQueryChange = useCallback((newQuery: string) => {\n setLocalTextSearchQuery({ query: newQuery });\n\n if (newQuery.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleUp = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex + 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n const handleDown = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex - 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n return (\n
\n
\n \n \n \n \n
\n
\n
\n {query ? (\n foundIds?.length ? (\n `${focusedIndex + 1} of ${totalCount}`\n ) : foundIds && !foundIds.length ? (\n 'No results'\n ) : (\n ''\n )\n ) : (\n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n )}\n
\n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n };\n },\n)(MobileSearchFooter));\n","export default function findInViewport(\n container: HTMLElement,\n selectorOrElements: string | NodeListOf,\n margin = 0,\n isDense = false,\n shouldContainBottom = false,\n isHorizontal = false,\n) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const allElements = typeof selectorOrElements === 'string'\n ? container.querySelectorAll(selectorOrElements)\n : selectorOrElements;\n const { length } = allElements;\n const visibleIndexes: number[] = [];\n let isFound = false;\n\n for (let i = 0; i < length; i++) {\n const element = allElements[i];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const isVisible = shouldContainBottom\n ? y2 >= viewportY1 - margin && y2 <= viewportY2 + margin\n : y1 <= viewportY2 + margin && y2 >= viewportY1 - margin;\n\n if (isVisible) {\n visibleIndexes.push(i);\n isFound = true;\n } else if (isFound && !isDense) {\n break;\n }\n }\n\n return { allElements, visibleIndexes };\n}\n","function isFullyVisible(container: HTMLElement, element: HTMLElement, isHorizontal = false) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n return y1 > viewportY1 && y2 < viewportY2;\n}\n\nexport default isFullyVisible;\n","import findInViewport from './findInViewport';\nimport isFullyVisible from './isFullyVisible';\nimport fastSmoothScroll from './fastSmoothScroll';\n\nconst VIEWPORT_MARGIN = 8;\nconst SCROLL_MARGIN = 10;\n\nexport default function setTooltipItemVisible(selector: string, index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container || index < 0) {\n return;\n }\n const { visibleIndexes, allElements } = findInViewport(\n container,\n selector,\n VIEWPORT_MARGIN,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first]))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n fastSmoothScroll(container, allElements[index], position, SCROLL_MARGIN);\n }\n}\n","import { useCallback, useEffect, useState } from '../../../../lib/teact/teact';\nimport captureKeyboardListeners from '../../../../util/captureKeyboardListeners';\nimport cycleRestrict from '../../../../util/cycleRestrict';\n\nexport function useKeyboardNavigation({\n isActive,\n isHorizontal,\n shouldSaveSelectionOnUpdateItems,\n shouldRemoveSelectionOnReset,\n noArrowNavigation,\n items,\n shouldSelectOnTab,\n onSelect,\n onClose,\n}: {\n isActive: boolean;\n isHorizontal?: boolean;\n shouldSaveSelectionOnUpdateItems?: boolean;\n shouldRemoveSelectionOnReset?: boolean;\n noArrowNavigation?: boolean;\n items?: any[];\n shouldSelectOnTab?: boolean;\n onSelect: AnyToVoidFunction;\n onClose: NoneToVoidFunction;\n}) {\n const [selectedItemIndex, setSelectedItemIndex] = useState(-1);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!items) {\n return -1;\n }\n\n return cycleRestrict(items.length, newIndex);\n }, [items]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedItemIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedItemIndex, getSelectedIndex]);\n\n const handleItemSelect = useCallback((e: KeyboardEvent) => {\n if (items && items.length && selectedItemIndex > -1) {\n const item = items[selectedItemIndex];\n if (item) {\n e.preventDefault();\n onSelect(item);\n }\n }\n }, [items, onSelect, selectedItemIndex]);\n\n const isSelectionOutOfRange = !items || selectedItemIndex > items.length - 1;\n useEffect(() => {\n if (!shouldSaveSelectionOnUpdateItems || isSelectionOutOfRange) {\n setSelectedItemIndex(shouldRemoveSelectionOnReset ? -1 : 0);\n }\n }, [isSelectionOutOfRange, shouldRemoveSelectionOnReset, shouldSaveSelectionOnUpdateItems]);\n\n useEffect(() => (isActive ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onLeft: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onRight: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onTab: shouldSelectOnTab ? handleItemSelect : undefined,\n onEnter: handleItemSelect,\n }) : undefined), [\n noArrowNavigation, handleArrowKey, handleItemSelect, isActive, isHorizontal, onClose, shouldSelectOnTab,\n ]);\n\n return selectedItemIndex;\n}\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { getGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nimport './MentionTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onInsertUserName: (user: ApiUser, forceFocus?: boolean) => void;\n filteredUsers?: ApiUser[];\n};\n\nconst MentionTooltip: FC = ({\n isOpen,\n onClose,\n onInsertUserName,\n filteredUsers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleUserSelect = useCallback((userId: string, forceFocus = false) => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const user = usersById[userId];\n if (!user) {\n return;\n }\n\n onInsertUserName(user, forceFocus);\n }, [onInsertUserName]);\n\n const handleSelectMention = useCallback((member: ApiUser) => {\n handleUserSelect(member.id, true);\n }, [handleUserSelect]);\n\n const selectedMentionIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: filteredUsers,\n onSelect: handleSelectMention,\n shouldSelectOnTab: true,\n shouldSaveSelectionOnUpdateItems: true,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedMentionIndex, containerRef);\n }, [selectedMentionIndex]);\n\n useEffect(() => {\n if (filteredUsers && !filteredUsers.length) {\n onClose();\n }\n }, [filteredUsers, onClose]);\n\n const prevChatMembers = usePrevious(\n filteredUsers?.length\n ? filteredUsers\n : undefined,\n shouldRender,\n );\n const renderedChatMembers = filteredUsers && !filteredUsers.length\n ? prevChatMembers\n : filteredUsers;\n\n if (!shouldRender || (renderedChatMembers && !renderedChatMembers.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'MentionTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedChatMembers?.map(({ id }, index) => (\n handleUserSelect(id)}\n focus={selectedMentionIndex === index}\n >\n \n \n ))}\n
\n );\n};\n\nexport default memo(MentionTooltip);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAttachment, ApiChatMember } from '../../../api/types';\n\nimport {\n CONTENT_TYPES_WITH_PREVIEW,\n EDITABLE_INPUT_MODAL_ID,\n SUPPORTED_IMAGE_CONTENT_TYPES,\n SUPPORTED_VIDEO_CONTENT_TYPES,\n} from '../../../config';\nimport { getFileExtension } from '../../common/helpers/documentInfo';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { useStateRef } from '../../../hooks/useStateRef';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport File from '../../common/File';\nimport MessageInput from './MessageInput';\nimport MentionTooltip from './MentionTooltip';\nimport EmojiTooltip from './EmojiTooltip.async';\n\nimport './AttachmentModal.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId: number;\n attachments: ApiAttachment[];\n caption: string;\n isReady?: boolean;\n currentUserId?: string;\n groupChatMembers?: ApiChatMember[];\n recentEmojis: string[];\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n addRecentEmoji: AnyToVoidFunction;\n onCaptionUpdate: (html: string) => void;\n onSend: () => void;\n onFileAppend: (files: File[], isQuick: boolean) => void;\n onClear: () => void;\n};\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst AttachmentModal: FC = ({\n chatId,\n threadId,\n attachments,\n caption,\n isReady,\n currentUserId,\n groupChatMembers,\n recentEmojis,\n baseEmojiKeywords,\n emojiKeywords,\n addRecentEmoji,\n onCaptionUpdate,\n onSend,\n onFileAppend,\n onClear,\n}) => {\n const captionRef = useStateRef(caption);\n const hideTimeoutRef = useRef();\n const prevAttachments = usePrevious(attachments);\n const renderingAttachments = attachments.length ? attachments : prevAttachments;\n const isOpen = Boolean(attachments.length);\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n const isQuick = Boolean(renderingAttachments && renderingAttachments.every((a) => a.quick));\n const lang = useLang();\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n isOpen,\n captionRef,\n onCaptionUpdate,\n EDITABLE_INPUT_MODAL_ID,\n groupChatMembers,\n undefined,\n currentUserId,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n isOpen,\n captionRef,\n recentEmojis,\n EDITABLE_INPUT_MODAL_ID,\n onCaptionUpdate,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n\n const sendAttachments = useCallback(() => {\n if (isOpen) {\n onSend();\n }\n }, [isOpen, onSend]);\n\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget, target: fromTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.drop-target') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(unmarkHovered, DROP_LEAVE_TIMEOUT_MS);\n }\n\n // Prevent DragLeave event from firing when the pointer moves inside the AttachmentModal drop target\n if (fromTarget && (fromTarget as HTMLElement).closest('.AttachmentModal.hovered')) {\n return;\n }\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const handleFilesDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n unmarkHovered();\n\n const { dataTransfer: { files } } = e;\n\n if (files?.length) {\n const newFiles = isQuick\n ? Array.from(files).filter((file) => {\n return file.type && CONTENT_TYPES_WITH_PREVIEW.has(file.type);\n })\n : Array.from(files);\n\n onFileAppend(newFiles, isQuick);\n }\n }, [isQuick, onFileAppend, unmarkHovered]);\n\n function handleDragOver(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = undefined;\n }\n }\n\n if (!renderingAttachments) {\n return undefined;\n }\n\n const areAllPhotos = renderingAttachments.every((a) => SUPPORTED_IMAGE_CONTENT_TYPES.has(a.mimeType));\n const areAllVideos = renderingAttachments.every((a) => SUPPORTED_VIDEO_CONTENT_TYPES.has(a.mimeType));\n const areAllAudios = renderingAttachments.every((a) => a.mimeType.startsWith('audio/'));\n\n let title = '';\n if (areAllPhotos) {\n title = lang('PreviewSender.SendPhoto', renderingAttachments.length, 'i');\n } else if (areAllVideos) {\n title = lang('PreviewSender.SendVideo', renderingAttachments.length, 'i');\n } else if (areAllAudios) {\n title = lang('PreviewSender.SendAudio', renderingAttachments.length, 'i');\n } else {\n title = lang('PreviewSender.SendFile', renderingAttachments.length, 'i');\n }\n\n function renderHeader() {\n if (!renderingAttachments) {\n return undefined;\n }\n\n return (\n
\n \n
{title}
\n \n {lang('Send')}\n \n
\n );\n }\n\n return (\n \n \n {isQuick ? (\n
\n {renderingAttachments.map((attachment) => (\n attachment.mimeType.startsWith('image/')\n ? \"\"\n :
\n ) : (\n
\n {renderingAttachments.map((attachment) => (\n \n ))}\n
\n )}\n\n
\n \n \n \n
\n
\n \n );\n};\n\nexport default memo(AttachmentModal);\n","import { ChangeEvent, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiNewPoll } from '../../../api/types';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport parseMessageInput from '../../../util/parseMessageInput';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport InputText from '../../ui/InputText';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup from '../../ui/RadioGroup';\n\nimport './PollModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSend: (pollSummary: ApiNewPoll) => void;\n onClear: () => void;\n};\n\nconst MAX_LIST_HEIGHT = 320;\nconst MAX_OPTIONS_COUNT = 10;\nconst MAX_OPTION_LENGTH = 100;\nconst MAX_QUESTION_LENGTH = 255;\nconst MAX_SOLUTION_LENGTH = 200;\n\nconst PollModal: FC = ({ isOpen, onSend, onClear }) => {\n // eslint-disable-next-line no-null/no-null\n const questionInputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const optionsListRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const solutionRef = useRef(null);\n\n const [question, setQuestion] = useState('');\n const [options, setOptions] = useState(['']);\n const [isAnonymous, setIsAnonymous] = useState(true);\n const [isMultipleAnswers, setIsMultipleAnswers] = useState(false);\n const [isQuizMode, setIsQuizMode] = useState(false);\n const [solution, setSolution] = useState();\n const [correctOption, setCorrectOption] = useState();\n const [hasErrors, setHasErrors] = useState(false);\n\n const lang = useLang();\n\n const focusInput = useCallback((ref: RefObject) => {\n if (isOpen && ref.current) {\n ref.current.focus();\n }\n }, [isOpen]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n useEffect(() => {\n if (!isOpen) {\n setQuestion('');\n setOptions(['']);\n setIsAnonymous(true);\n setIsMultipleAnswers(false);\n setIsQuizMode(false);\n setSolution('');\n setCorrectOption('');\n setHasErrors(false);\n }\n }, [isOpen]);\n\n useEffect(() => focusInput(questionInputRef), [focusInput, isOpen]);\n\n useLayoutEffect(() => {\n const solutionEl = solutionRef.current;\n\n if (solutionEl && solution !== solutionEl.innerHTML) {\n solutionEl.innerHTML = solution;\n }\n }, [solution]);\n\n const addNewOption = useCallback((newOptions: string[] = []) => {\n setOptions([...newOptions, '']);\n requestAnimationFrame(() => {\n const list = optionsListRef.current;\n if (!list) {\n return;\n }\n\n list.classList.toggle('overflown', list.scrollHeight > MAX_LIST_HEIGHT);\n list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' });\n });\n }, []);\n\n const handleCreate = useCallback(() => {\n setHasErrors(false);\n if (!isOpen) {\n return;\n }\n\n const questionTrimmed = question.trim().substring(0, MAX_QUESTION_LENGTH);\n const optionsTrimmed = options.map((o) => o.trim().substring(0, MAX_OPTION_LENGTH)).filter((o) => o.length);\n\n if (!questionTrimmed || optionsTrimmed.length < 2) {\n setQuestion(questionTrimmed);\n if (optionsTrimmed.length) {\n if (optionsTrimmed.length < 2) {\n addNewOption(optionsTrimmed);\n } else {\n setOptions(optionsTrimmed);\n }\n } else {\n addNewOption();\n }\n setHasErrors(true);\n return;\n }\n\n if (isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)])) {\n setHasErrors(true);\n return;\n }\n\n const answers = optionsTrimmed\n .map((text, index) => ({\n text: text.trim(),\n option: String(index),\n ...(String(index) === correctOption && { correct: true }),\n }));\n\n const payload: ApiNewPoll = {\n summary: {\n question: questionTrimmed,\n answers,\n ...(!isAnonymous && { isPublic: true }),\n ...(isMultipleAnswers && { multipleChoice: true }),\n ...(isQuizMode && { quiz: true }),\n },\n };\n\n if (isQuizMode) {\n const { text, entities } = (solution && parseMessageInput(solution.substring(0, MAX_SOLUTION_LENGTH))) || {};\n\n payload.quiz = {\n correctAnswers: [correctOption],\n ...(text && { solution: text }),\n ...(entities && { solutionEntities: entities }),\n };\n }\n\n onSend(payload);\n }, [\n isOpen,\n question,\n options,\n isQuizMode,\n correctOption,\n isAnonymous,\n isMultipleAnswers,\n onSend,\n addNewOption,\n solution,\n ]);\n\n const updateOption = useCallback((index: number, text: string) => {\n const newOptions = [...options];\n newOptions[index] = text;\n if (newOptions[newOptions.length - 1].trim().length && newOptions.length < MAX_OPTIONS_COUNT) {\n addNewOption(newOptions);\n } else {\n setOptions(newOptions);\n }\n }, [options, addNewOption]);\n\n const removeOption = useCallback((index: number) => {\n const newOptions = [...options];\n newOptions.splice(index, 1);\n setOptions(newOptions);\n requestAnimationFrame(() => {\n if (!optionsListRef.current) {\n return;\n }\n\n optionsListRef.current.classList.toggle('overflown', optionsListRef.current.scrollHeight > MAX_LIST_HEIGHT);\n });\n }, [options]);\n\n const handleCorrectOptionChange = useCallback((newValue: string) => {\n setCorrectOption(newValue);\n }, [setCorrectOption]);\n\n const handleIsAnonymousChange = useCallback((e: ChangeEvent) => {\n setIsAnonymous(e.target.checked);\n }, []);\n\n const handleMultipleAnswersChange = useCallback((e: ChangeEvent) => {\n setIsMultipleAnswers(e.target.checked);\n }, []);\n\n const handleQuizModeChange = useCallback((e: ChangeEvent) => {\n setIsQuizMode(e.target.checked);\n }, []);\n\n const handleKeyPress = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode === 13) {\n handleCreate();\n }\n }, [handleCreate]);\n\n const getQuestionError = useCallback(() => {\n if (hasErrors && !question.trim().length) {\n return lang('lng_polls_choose_question');\n }\n\n return undefined;\n }, [hasErrors, lang, question]);\n\n const getOptionsError = useCallback((index: number) => {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n if (hasErrors && optionsTrimmed.length < 2 && !options[index].trim().length) {\n return lang('lng_polls_choose_answers');\n }\n return undefined;\n }, [hasErrors, lang, options]);\n\n function renderHeader() {\n return (\n
\n \n
{lang('NewPoll')}
\n \n {lang('Create')}\n \n
\n );\n }\n\n function renderOptions() {\n return options.map((option, index) => (\n
\n updateOption(index, e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n {index !== options.length - 1 && (\n removeOption(index)}\n >\n \n \n )}\n
\n ));\n }\n\n function renderRadioOptions() {\n return renderOptions()\n .map((label, index) => ({ value: String(index), label, hidden: index === options.length - 1 }));\n }\n\n function renderQuizNoOptionError() {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n\n return isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)]) && (\n

{lang('lng_polls_choose_correct')}

\n );\n }\n\n return (\n \n setQuestion(e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n
\n\n
\n

{lang('PollOptions')}

\n\n {hasErrors && renderQuizNoOptionError()}\n {isQuizMode ? (\n \n ) : (\n renderOptions()\n )}\n\n
\n\n
\n\n
\n \n \n \n {isQuizMode && (\n <>\n

{lang('lng_polls_solution_title')}

\n setSolution(e.currentTarget.innerHTML)}\n />\n
{lang('CreatePoll.ExplanationInfo')}
\n \n )}\n
\n \n );\n};\n\nexport default memo(PollModal);\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\n\nimport './EmojiButton.scss';\n\ntype OwnProps = {\n emoji: Emoji;\n focus?: boolean;\n onClick: (emoji: string, name: string) => void;\n};\n\nconst EmojiButton: FC = ({ emoji, focus, onClick }) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n // Preventing safari from losing focus on Composer MessageInput\n e.preventDefault();\n\n onClick(emoji.native, emoji.id);\n }, [emoji, onClick]);\n\n return (\n \n {IS_EMOJI_SUPPORTED ? emoji.native : \"\"}\n
\n );\n};\n\nexport default memo(EmojiButton);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport EmojiButton from './EmojiButton';\n\nconst EMOJIS_PER_ROW_ON_DESKTOP = 9;\nconst EMOJI_MARGIN = 4;\nconst MOBILE_CONTAINER_PADDING = 8;\nconst EMOJI_SIZE = 40;\n\ntype OwnProps = {\n category: EmojiCategory;\n index: number;\n allEmojis: AllEmojis;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\nconst EmojiCategory: FC = ({\n category, index, allEmojis, observeIntersection, shouldRender, onEmojiSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const transitionClassNames = useMediaTransition(shouldRender);\n\n const lang = useLang();\n\n const emojisPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (EMOJI_SIZE + EMOJI_MARGIN))\n : EMOJIS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(category.emojis.length / emojisPerRow) * (EMOJI_SIZE + EMOJI_MARGIN);\n\n return (\n \n

\n {lang(category.id === 'recent' ? 'RecentStickers' : `Emoji${index}`)}\n

\n \n {shouldRender && category.emojis.map((name) => {\n const emoji = allEmojis[name];\n // Recent emojis may contain emoticons that are no longer in the list\n if (!emoji) {\n return undefined;\n }\n // Some emojis have multiple skins and are represented as an Object with emojis for all skins.\n // For now, we select only the first emoji with 'neutral' skin.\n const displayedEmoji = 'id' in emoji ? emoji : emoji[1];\n\n return (\n \n );\n })}\n
\n \n );\n};\n\nexport default memo(EmojiCategory);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport { MENU_TRANSITION_DURATION } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport {\n EmojiModule,\n EmojiRawData,\n EmojiData,\n uncompressEmoji,\n} from '../../../util/emoji';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Loading from '../../ui/Loading';\nimport EmojiCategory from './EmojiCategory';\n\nimport './EmojiPicker.scss';\n\ntype OwnProps = {\n className?: string;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\ntype StateProps = Pick;\ntype EmojiCategoryData = { id: string; name: string; emojis: string[] };\n\nconst ICONS_BY_CATEGORY: Record = {\n recent: 'icon-recent',\n people: 'icon-smile',\n nature: 'icon-animals',\n foods: 'icon-eats',\n activity: 'icon-sport',\n places: 'icon-car',\n objects: 'icon-lamp',\n symbols: 'icon-language',\n flags: 'icon-flag',\n};\n\nconst OPEN_ANIMATION_DELAY = 200;\n// Only a few categories are above this height.\nconst SMOOTH_SCROLL_DISTANCE = 800;\nconst FOCUS_MARGIN = 50;\nconst HEADER_BUTTON_WIDTH = 42; // px. Includes margins\nconst INTERSECTION_THROTTLE = 200;\n\nconst categoryIntersections: boolean[] = [];\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nconst EmojiPicker: FC = ({\n className, onEmojiSelect, recentEmojis,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n\n const [categories, setCategories] = useState();\n const [emojis, setEmojis] = useState();\n const [activeCategoryIndex, setActiveCategoryIndex] = useState(0);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('emoji-category-')) {\n return;\n }\n\n const index = Number(id.replace('emoji-category-', ''));\n categoryIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = categoryIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveCategoryIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n\n useHorizontalScroll(headerRef.current, !IS_SINGLE_COLUMN_LAYOUT);\n\n // Scroll header when active set updates\n useEffect(() => {\n if (!categories) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeCategoryIndex * HEADER_BUTTON_WIDTH - header.offsetWidth / 2 + HEADER_BUTTON_WIDTH / 2;\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [categories, activeCategoryIndex]);\n\n const lang = useLang();\n\n const allCategories = useMemo(() => {\n if (!categories) {\n return MEMO_EMPTY_ARRAY;\n }\n const themeCategories = [...categories];\n if (recentEmojis?.length) {\n themeCategories.unshift({\n id: 'recent',\n name: lang('RecentStickers'),\n emojis: recentEmojis,\n });\n }\n\n return themeCategories;\n }, [categories, lang, recentEmojis]);\n\n // Initialize data on first render.\n useEffect(() => {\n setTimeout(() => {\n const exec = () => {\n setCategories(emojiData.categories);\n\n setEmojis(emojiData.emojis as AllEmojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, OPEN_ANIMATION_DELAY);\n }, []);\n\n const selectCategory = useCallback((index: number) => {\n setActiveCategoryIndex(index);\n const categoryEl = document.getElementById(`emoji-category-${index}`)!;\n fastSmoothScroll(containerRef.current!, categoryEl, 'start', FOCUS_MARGIN, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n onEmojiSelect(emoji, name);\n }, [onEmojiSelect]);\n\n const canRenderContents = useAsyncRendering([], MENU_TRANSITION_DURATION);\n\n function renderCategoryButton(category: EmojiCategoryData, index: number) {\n const icon = ICONS_BY_CATEGORY[category.id];\n\n return icon && (\n selectCategory(index)}\n ariaLabel={category.name}\n >\n \n \n );\n }\n\n const containerClassName = buildClassName('EmojiPicker', className);\n\n if (!emojis || !canRenderContents) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n {allCategories.map(renderCategoryButton)}\n
\n \n {allCategories.map((category, i) => (\n = i - 1 && activeCategoryIndex <= i + 1}\n onEmojiSelect={handleEmojiSelect}\n />\n ))}\n
\n \n );\n};\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['recentEmojis']),\n)(EmojiPicker));\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport StickerButton from '../../common/StickerButton';\nimport useMediaTransition from '../../../hooks/useMediaTransition';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n stickerSet: StickerSetOrRecent;\n loadAndPlay: boolean;\n index: number;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n onStickerUnfave: (sticker: ApiSticker) => void;\n};\n\nconst STICKERS_PER_ROW_ON_DESKTOP = 5;\nconst STICKER_MARGIN = IS_SINGLE_COLUMN_LAYOUT ? 8 : 16;\nconst MOBILE_CONTAINER_PADDING = 8;\n\nconst StickerSet: FC = ({\n stickerSet,\n loadAndPlay,\n index,\n observeIntersection,\n shouldRender,\n onStickerSelect,\n onStickerUnfave,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const transitionClassNames = useMediaTransition(shouldRender);\n\n const stickersPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (STICKER_SIZE_PICKER + STICKER_MARGIN))\n : STICKERS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(stickerSet.count / stickersPerRow) * (STICKER_SIZE_PICKER + STICKER_MARGIN);\n\n return (\n \n

{stickerSet.title}

\n \n {shouldRender && stickerSet.stickers && stickerSet.stickers.map((sticker) => (\n \n ))}\n \n \n );\n};\n\nexport default memo(StickerSet);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiStickerSet, ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION, STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport StickerButton from '../../common/StickerButton';\nimport StickerSet from './StickerSet';\nimport StickerSetCover from './StickerSetCover';\nimport StickerSetCoverAnimated from './StickerSetCoverAnimated';\n\nimport './StickerPicker.scss';\n\ntype OwnProps = {\n chatId: string;\n threadId?: number;\n className: string;\n loadAndPlay: boolean;\n canSendStickers: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n recentStickers: ApiSticker[];\n favoriteStickers: ApiSticker[];\n stickerSetsById: Record;\n addedSetIds?: string[];\n shouldPlay?: boolean;\n};\n\nconst SMOOTH_SCROLL_DISTANCE = 500;\nconst HEADER_BUTTON_WIDTH = 52; // px (including margin)\nconst STICKER_INTERSECTION_THROTTLE = 200;\n\nconst stickerSetIntersections: boolean[] = [];\n\nconst StickerPicker: FC = ({\n chatId,\n threadId,\n className,\n loadAndPlay,\n canSendStickers,\n recentStickers,\n favoriteStickers,\n addedSetIds,\n stickerSetsById,\n shouldPlay,\n onStickerSelect,\n}) => {\n const {\n loadRecentStickers,\n addRecentSticker,\n unfaveSticker,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n const [activeSetIndex, setActiveSetIndex] = useState(0);\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: STICKER_INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('sticker-set-')) {\n return;\n }\n\n const index = Number(id.replace('sticker-set-', ''));\n stickerSetIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = stickerSetIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveSetIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: headerRef });\n\n const lang = useLang();\n\n const areAddedLoaded = Boolean(addedSetIds);\n\n const allSets = useMemo(() => {\n if (!addedSetIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return [\n {\n id: 'recent',\n title: lang('RecentStickers'),\n stickers: recentStickers,\n count: recentStickers.length,\n },\n {\n id: 'favorite',\n title: lang('FavoriteStickers'),\n stickers: favoriteStickers,\n count: favoriteStickers.length,\n },\n ...addedSetIds.map((id) => stickerSetsById[id]).filter(Boolean),\n ];\n }, [addedSetIds, lang, recentStickers, favoriteStickers, stickerSetsById]);\n\n const noPopulatedSets = useMemo(() => (\n areAddedLoaded\n && allSets.filter((set) => set.stickers?.length).length === 0\n ), [allSets, areAddedLoaded]);\n\n useEffect(() => {\n if (loadAndPlay) {\n loadRecentStickers();\n sendMessageAction({ type: 'chooseSticker' });\n }\n }, [loadAndPlay, loadRecentStickers, sendMessageAction]);\n\n useHorizontalScroll(headerRef.current);\n\n // Scroll container and header when active set changes\n useEffect(() => {\n if (!areAddedLoaded) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeSetIndex * HEADER_BUTTON_WIDTH - (header.offsetWidth / 2 - HEADER_BUTTON_WIDTH / 2);\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [areAddedLoaded, activeSetIndex]);\n\n const selectStickerSet = useCallback((index: number) => {\n setActiveSetIndex(index);\n const stickerSetEl = document.getElementById(`sticker-set-${index}`)!;\n fastSmoothScroll(containerRef.current!, stickerSetEl, 'start', undefined, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker);\n addRecentSticker({ sticker });\n }, [addRecentSticker, onStickerSelect]);\n\n const handleStickerUnfave = useCallback((sticker: ApiSticker) => {\n unfaveSticker({ sticker });\n }, [unfaveSticker]);\n\n const handleMouseMove = useCallback(() => {\n sendMessageAction({ type: 'chooseSticker' });\n }, [sendMessageAction]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n function renderCover(stickerSet: StickerSetOrRecent, index: number) {\n const firstSticker = stickerSet.stickers?.[0];\n const buttonClassName = buildClassName(\n 'symbol-set-button sticker-set-button',\n index === activeSetIndex && 'activated',\n );\n\n if (stickerSet.id === 'recent' || stickerSet.id === 'favorite' || stickerSet.hasThumbnail || !firstSticker) {\n return (\n selectStickerSet(index)}\n >\n {stickerSet.id === 'recent' ? (\n \n ) : stickerSet.id === 'favorite' ? (\n \n ) : stickerSet.isLottie ? (\n \n ) : (\n \n )}\n \n );\n } else {\n return (\n \n );\n }\n }\n\n const fullClassName = buildClassName('StickerPicker', className);\n\n if (!areAddedLoaded || !canRenderContents || noPopulatedSets || !canSendStickers) {\n return (\n
\n {!canSendStickers ? (\n
{lang('ErrorSendRestrictedStickersAll')}
\n ) : noPopulatedSets ? (\n
{lang('NoStickers')}
\n ) : (\n \n )}\n
\n );\n }\n\n return (\n
\n \n {allSets.map(renderCover)}\n
\n \n {allSets.map((stickerSet, i) => (\n = i - 1 && activeSetIndex <= i + 1}\n onStickerSelect={handleStickerSelect}\n onStickerUnfave={handleStickerUnfave}\n />\n ))}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n setsById,\n added,\n recent,\n favorite,\n } = global.stickers;\n\n return {\n recentStickers: recent.stickers,\n favoriteStickers: favorite.stickers,\n stickerSetsById: setsById,\n addedSetIds: added.setIds,\n shouldPlay: global.settings.byKey.shouldLoopStickers,\n };\n },\n)(StickerPicker));\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiVideo } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport useBuffering from '../../hooks/useBuffering';\nimport useCanvasBlur from '../../hooks/useCanvasBlur';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport Spinner from '../ui/Spinner';\n\nimport './GifButton.scss';\n\ntype OwnProps = {\n gif: ApiVideo;\n observeIntersection: ObserveFn;\n isDisabled?: boolean;\n className?: string;\n onClick: (gif: ApiVideo) => void;\n};\n\nconst GifButton: FC = ({\n gif, observeIntersection, isDisabled, className, onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const hasThumbnail = Boolean(gif.thumbnail?.dataUri);\n const localMediaHash = `gif${gif.id}`;\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const loadAndPlay = isIntersecting && !isDisabled;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const thumbRef = useCanvasBlur(gif.thumbnail?.dataUri, Boolean(previewBlobUrl));\n const videoData = useMedia(localMediaHash, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const shouldRenderVideo = Boolean(loadAndPlay && videoData);\n const { isBuffered, bufferingHandlers } = useBuffering(true);\n const shouldRenderSpinner = loadAndPlay && !isBuffered;\n const isVideoReady = loadAndPlay && isBuffered;\n\n useVideoCleanup(videoRef, [shouldRenderVideo]);\n\n const handleClick = useCallback(\n () => onClick({\n ...gif,\n blobUrl: videoData,\n }),\n [onClick, gif, videoData],\n );\n\n const fullClassName = buildClassName(\n 'GifButton',\n gif.width && gif.height && gif.width < gif.height ? 'vertical' : 'horizontal',\n localMediaHash,\n className,\n );\n\n return (\n \n {hasThumbnail && (\n \n )}\n {previewBlobUrl && !isVideoReady && (\n \n )}\n {shouldRenderVideo && (\n \n \n \n )}\n {shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(GifButton);\n","import React, {\n FC, useEffect, memo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiVideo } from '../../../api/types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\n\nimport Loading from '../../ui/Loading';\nimport GifButton from '../../common/GifButton';\n\nimport './GifPicker.scss';\n\ntype OwnProps = {\n className: string;\n loadAndPlay: boolean;\n canSendGifs: boolean;\n onGifSelect: (gif: ApiVideo) => void;\n};\n\ntype StateProps = {\n savedGifs?: ApiVideo[];\n};\n\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifPicker: FC = ({\n className,\n loadAndPlay,\n canSendGifs,\n savedGifs,\n onGifSelect,\n}) => {\n const { loadSavedGifs } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n useEffect(() => {\n if (loadAndPlay) {\n loadSavedGifs();\n }\n }, [loadAndPlay, loadSavedGifs]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n return (\n \n {!canSendGifs ? (\n
Sending GIFs is not allowed in this chat.
\n ) : canRenderContents && savedGifs && savedGifs.length ? (\n savedGifs.map((gif) => (\n \n ))\n ) : canRenderContents && savedGifs ? (\n
No saved GIFs.
\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n savedGifs: global.gifs.saved.gifs,\n };\n },\n)(GifPicker));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\ntype OwnProps = {\n activeTab: SymbolMenuTabs;\n onSwitchTab: (tab: SymbolMenuTabs) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n};\n\nexport enum SymbolMenuTabs {\n 'Emoji',\n 'Stickers',\n 'GIFs',\n}\n\n// Getting enum string values for display in Tabs.\n// See: https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\nexport const SYMBOL_MENU_TAB_TITLES = Object.values(SymbolMenuTabs)\n .filter((value): value is string => typeof value === 'string');\n\nconst SYMBOL_MENU_TAB_ICONS = {\n [SymbolMenuTabs.Emoji]: 'icon-smile',\n [SymbolMenuTabs.Stickers]: 'icon-stickers',\n [SymbolMenuTabs.GIFs]: 'icon-gifs',\n};\n\nconst SymbolMenuFooter: FC = ({\n activeTab, onSwitchTab, onRemoveSymbol, onSearchOpen,\n}) => {\n const lang = useLang();\n\n function renderTabButton(tab: SymbolMenuTabs) {\n return (\n onSwitchTab(tab)}\n ariaLabel={SYMBOL_MENU_TAB_TITLES[tab]}\n round\n faded\n color=\"translucent\"\n >\n \n \n );\n }\n\n const handleSearchOpen = useCallback(() => {\n onSearchOpen(activeTab === SymbolMenuTabs.Stickers ? 'stickers' : 'gifs');\n }, [activeTab, onSearchOpen]);\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n return (\n
\n {activeTab !== SymbolMenuTabs.Emoji && (\n \n \n \n )}\n\n {renderTabButton(SymbolMenuTabs.Emoji)}\n {renderTabButton(SymbolMenuTabs.Stickers)}\n {renderTabButton(SymbolMenuTabs.GIFs)}\n\n {activeTab === SymbolMenuTabs.Emoji && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SymbolMenuFooter);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker, ApiVideo } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Menu from '../../ui/Menu';\nimport Transition from '../../ui/Transition';\nimport EmojiPicker from './EmojiPicker';\nimport StickerPicker from './StickerPicker';\nimport GifPicker from './GifPicker';\nimport SymbolMenuFooter, { SYMBOL_MENU_TAB_TITLES, SymbolMenuTabs } from './SymbolMenuFooter';\nimport Portal from '../../ui/Portal';\n\nimport './SymbolMenu.scss';\n\nconst ANIMATION_DURATION = 350;\n\nexport type OwnProps = {\n chatId: string;\n threadId?: number;\n isOpen: boolean;\n canSendStickers: boolean;\n canSendGifs: boolean;\n onLoad: () => void;\n onClose: () => void;\n onEmojiSelect: (emoji: string) => void;\n onStickerSelect: (sticker: ApiSticker, shouldPreserveInput?: boolean) => void;\n onGifSelect: (gif: ApiVideo) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n addRecentEmoji: AnyToVoidFunction;\n};\n\ntype StateProps = {\n isLeftColumnShown: boolean;\n};\n\nlet isActivated = false;\n\nconst SymbolMenu: FC = ({\n chatId,\n threadId,\n isOpen,\n canSendStickers,\n canSendGifs,\n isLeftColumnShown,\n onLoad,\n onClose,\n onEmojiSelect,\n onStickerSelect,\n onGifSelect,\n onRemoveSymbol,\n onSearchOpen,\n addRecentEmoji,\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [recentEmojis, setRecentEmojis] = useState([]);\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, onClose, false, false);\n\n if (!isActivated && isOpen) {\n isActivated = true;\n }\n\n useEffect(() => {\n onLoad();\n }, [onLoad]);\n\n useLayoutEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return undefined;\n }\n\n if (isOpen) {\n document.body.classList.add('enable-symbol-menu-transforms');\n document.body.classList.add('is-symbol-menu-open');\n }\n\n return () => {\n if (isOpen) {\n fastRaf(() => {\n document.body.classList.remove('is-symbol-menu-open');\n setTimeout(() => {\n document.body.classList.remove('enable-symbol-menu-transforms');\n }, ANIMATION_DURATION);\n });\n }\n };\n }, [isOpen]);\n\n const recentEmojisRef = useRef(recentEmojis);\n recentEmojisRef.current = recentEmojis;\n useEffect(() => {\n if (!recentEmojisRef.current.length) {\n return;\n }\n\n recentEmojisRef.current.forEach((name) => {\n addRecentEmoji({ emoji: name });\n });\n\n setRecentEmojis([]);\n }, [isOpen, activeTab, addRecentEmoji]);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n setRecentEmojis((emojis) => {\n return [...emojis, name];\n });\n\n onEmojiSelect(emoji);\n }, [onEmojiSelect]);\n\n const handleSearch = useCallback((type: 'stickers' | 'gifs') => {\n onClose();\n onSearchOpen(type);\n }, [onClose, onSearchOpen]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker, true);\n }, [onStickerSelect]);\n\n const lang = useLang();\n\n function renderContent(isActive: boolean, isFrom: boolean) {\n switch (activeTab) {\n case SymbolMenuTabs.Emoji:\n return (\n \n );\n case SymbolMenuTabs.Stickers:\n return (\n \n );\n case SymbolMenuTabs.GIFs:\n return (\n \n );\n }\n\n return undefined;\n }\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n const content = (\n <>\n
\n {isActivated && (\n \n {renderContent}\n \n )}\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n \n );\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'SymbolMenu mobile-menu',\n transitionClassNames,\n !isLeftColumnShown && 'middle-column-open',\n );\n\n return (\n \n
\n {content}\n
\n
\n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n isLeftColumnShown: global.isLeftColumnShown,\n };\n },\n)(SymbolMenu));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { CONTENT_TYPES_WITH_PREVIEW } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './AttachMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n canAttachMedia: boolean;\n canAttachPolls: boolean;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n onPollCreate: () => void;\n onClose: () => void;\n};\n\nconst AttachMenu: FC = ({\n isOpen, canAttachMedia, canAttachPolls, onFileSelect, onPollCreate, onClose,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const handleFileSelect = useCallback((e: Event, isQuick: boolean) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n onFileSelect(Array.from(files), isQuick);\n }\n }, [onFileSelect]);\n\n const handleQuickSelect = useCallback(() => {\n openSystemFilesDialog(\n Array.from(CONTENT_TYPES_WITH_PREVIEW).join(','),\n (e) => handleFileSelect(e, true),\n );\n }, [handleFileSelect]);\n\n const handleDocumentSelect = useCallback(() => {\n openSystemFilesDialog('*', (e) => handleFileSelect(e, false));\n }, [handleFileSelect]);\n\n const lang = useLang();\n\n return (\n \n {/*\n ** Using ternary operator here causes some attributes from first clause\n ** transferring to the fragment content in the second clause\n */}\n {!canAttachMedia && (\n Posting media content is not allowed in this group.\n )}\n {canAttachMedia && (\n <>\n \n {lang('AttachmentMenu.PhotoOrVideo')}\n \n {lang('AttachDocument')}\n \n )}\n {canAttachPolls && (\n {lang('Poll')}\n )}\n \n );\n};\n\nexport default memo(AttachMenu);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\n\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\n\nimport './BotCommand.scss';\n\ntype OwnProps = {\n botCommand: ApiBotCommand;\n bot?: ApiUser;\n withAvatar?: boolean;\n focus?: boolean;\n onClick: (botCommand: ApiBotCommand) => void;\n};\n\nconst BotCommand: FC = ({\n withAvatar,\n focus,\n botCommand,\n bot,\n onClick,\n}) => {\n return (\n onClick(botCommand)}\n focus={focus}\n >\n {withAvatar && (\n \n )}\n
\n /{botCommand.command}\n {renderText(botCommand.description)}\n
\n \n );\n};\n\nexport default memo(BotCommand);\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport BotCommand from './BotCommand';\n\nimport './BotCommandTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withUsername?: boolean;\n botCommands?: ApiBotCommand[];\n onClick: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n usersById: Record;\n};\n\nconst BotCommandTooltip: FC = ({\n usersById,\n isOpen,\n withUsername,\n botCommands,\n onClick,\n onClose,\n}) => {\n const { sendBotCommand } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleSendCommand = useCallback(({ botId, command }: ApiBotCommand) => {\n const bot = usersById[botId];\n sendBotCommand({\n command: `/${command}${withUsername && bot ? `@${bot.username}` : ''}`,\n botId,\n });\n onClick();\n }, [onClick, sendBotCommand, usersById, withUsername]);\n\n const selectedCommandIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: botCommands,\n onSelect: handleSendCommand,\n onClose,\n });\n\n useEffect(() => {\n if (botCommands && !botCommands.length) {\n onClose();\n }\n }, [botCommands, onClose]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedCommandIndex, containerRef);\n }, [selectedCommandIndex]);\n\n const prevCommands = usePrevious(botCommands && botCommands.length ? botCommands : undefined, shouldRender);\n const renderedCommands = botCommands && !botCommands.length ? prevCommands : botCommands;\n\n if (!shouldRender || (renderedCommands && !renderedCommands.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'BotCommandTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedCommands && renderedCommands.map((chatBotCommand, index) => (\n \n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({\n usersById: global.users.byId,\n }),\n)(BotCommandTooltip));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiBotCommand } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport useMouseInside from '../../../hooks/useMouseInside';\n\nimport Menu from '../../ui/Menu';\nimport BotCommand from './BotCommand';\n\nimport './BotCommandMenu.scss';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nexport type OwnProps = {\n isOpen: boolean;\n botCommands: ApiBotCommand[];\n onClose: NoneToVoidFunction;\n};\n\nconst BotCommandMenu: FC = ({\n isOpen, botCommands, onClose,\n}) => {\n const { sendBotCommand } = getDispatch();\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n\n const handleClick = useCallback((botCommand: ApiBotCommand) => {\n sendBotCommand({\n command: `/${botCommand.command}`,\n botId: botCommand.botId,\n });\n onClose();\n }, [onClose, sendBotCommand]);\n\n return (\n \n {botCommands.map((botCommand) => (\n \n ))}\n \n );\n};\n\nexport default memo(BotCommandMenu);\n","import React, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useSendMessageAction from '../../../hooks/useSendMessageAction';\n\nimport Loading from '../../ui/Loading';\nimport StickerButton from '../../common/StickerButton';\n\nimport './StickerTooltip.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId?: number;\n isOpen: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n stickers?: ApiSticker[];\n};\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerTooltip: FC = ({\n chatId,\n threadId,\n isOpen,\n onStickerSelect,\n stickers,\n}) => {\n const { clearStickersForEmoji } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const prevStickers = usePrevious(stickers, true);\n const displayedStickers = stickers || prevStickers;\n const sendMessageAction = useSendMessageAction(chatId, threadId);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n useEffect(() => (isOpen ? captureEscKeyListener(clearStickersForEmoji) : undefined), [isOpen, clearStickersForEmoji]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseMove = () => {\n sendMessageAction({ type: 'chooseSticker' });\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'StickerTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n !(displayedStickers?.length) && 'hidden',\n );\n\n return (\n \n {shouldRender && displayedStickers ? (\n displayedStickers.map((sticker) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { stickers } = global.stickers.forEmoji;\n\n return { stickers };\n },\n)(StickerTooltip));\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './CustomSendMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSilentSend?: NoneToVoidFunction;\n onScheduleSend?: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n onCloseAnimationEnd?: NoneToVoidFunction;\n};\n\nconst CustomSendMenu: FC = ({\n isOpen, onSilentSend, onScheduleSend, onClose, onCloseAnimationEnd,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const lang = useLang();\n\n return (\n \n {onSilentSend && {lang('SendWithoutSound')}}\n {onScheduleSend && {lang('ScheduleMessage')}}\n \n );\n};\n\nexport default memo(CustomSendMenu);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport findInViewport from '../../../util/findInViewport';\nimport isFullyVisible from '../../../util/isFullyVisible';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevDuringAnimation from '../../../hooks/usePrevDuringAnimation';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport Loading from '../../ui/Loading';\nimport EmojiButton from './EmojiButton';\n\nimport './EmojiTooltip.scss';\n\nconst VIEWPORT_MARGIN = 8;\nconst EMOJI_BUTTON_WIDTH = 44;\nconst CLOSE_DURATION = 350;\n\nfunction setItemVisible(index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container) {\n return;\n }\n\n const { visibleIndexes, allElements } = findInViewport(\n container,\n '.EmojiButton',\n VIEWPORT_MARGIN,\n true,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first], true))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n const newLeft = position === 'start' ? index * EMOJI_BUTTON_WIDTH : 0;\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\n}\n\nexport type OwnProps = {\n isOpen: boolean;\n onEmojiSelect: (text: string) => void;\n onClose: NoneToVoidFunction;\n addRecentEmoji: AnyToVoidFunction;\n emojis: Emoji[];\n};\n\nconst EmojiTooltip: FC = ({\n isOpen,\n emojis,\n onClose,\n onEmojiSelect,\n addRecentEmoji,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const listEmojis: Emoji[] = usePrevDuringAnimation(emojis.length ? emojis : undefined, CLOSE_DURATION) || [];\n\n const handleSelectEmoji = useCallback((emoji: Emoji) => {\n onEmojiSelect(emoji.native);\n addRecentEmoji({ emoji: emoji.id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const handleClick = useCallback((native: string, id: string) => {\n onEmojiSelect(native);\n addRecentEmoji({ emoji: id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n isHorizontal: true,\n items: emojis,\n onSelect: handleSelectEmoji,\n onClose,\n });\n\n useEffect(() => {\n setItemVisible(selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'EmojiTooltip composer-tooltip custom-scroll-x',\n transitionClassNames,\n );\n\n return (\n \n {shouldRender && listEmojis ? (\n listEmojis.map((emoji, index) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(EmojiTooltip);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiWebDocument } from '../../../../api/types';\n\nimport { getFirstLetters } from '../../../../util/textFormat';\nimport renderText from '../../../common/helpers/renderText';\nimport useMedia from '../../../../hooks/useMedia';\n\nimport ListItem from '../../../ui/ListItem';\n\nimport './BaseResult.scss';\nimport { preventMessageInputBlurWithBubbling } from '../../helpers/preventMessageInputBlur';\n\nexport type OwnProps = {\n focus?: boolean;\n thumbnail?: ApiWebDocument;\n thumbUrl?: string;\n title?: string;\n description?: string;\n transitionClassNames?: string;\n onClick: NoneToVoidFunction;\n};\n\nconst BaseResult: FC = ({\n title,\n description,\n thumbnail,\n thumbUrl,\n focus,\n transitionClassNames = '',\n onClick,\n}) => {\n let content: string | undefined = '';\n\n const thumbnailDataUrl = useMedia(thumbnail ? `webDocument:${thumbnail.url}` : undefined);\n thumbUrl = thumbUrl || thumbnailDataUrl;\n\n if (thumbUrl) {\n content = (\n \"\"\n );\n } else if (title) {\n content = getFirstLetters(title, 1);\n }\n\n return (\n \n \n {typeof content === 'string' ? renderText(content) : content}\n \n
\n {title && (
{title}
)}\n {description && (
{description}
)}\n
\n \n );\n};\n\nexport default memo(BaseResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiPhoto, ApiThumbnail, ApiWebDocument,\n} from '../../../../api/types';\n\nimport buildClassName from '../../../../util/buildClassName';\nimport useMedia from '../../../../hooks/useMedia';\nimport useMediaTransition from '../../../../hooks/useMediaTransition';\n\nimport BaseResult from './BaseResult';\n\nimport './MediaResult.scss';\n\nexport type OwnProps = {\n focus?: boolean;\n isForGallery?: boolean;\n inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst MediaResult: FC = ({\n focus, isForGallery, inlineResult, onClick,\n}) => {\n let photo: ApiPhoto | undefined;\n let thumbnail: ApiThumbnail | undefined;\n let webThumbnail: ApiWebDocument | undefined;\n\n if ('photo' in inlineResult) {\n photo = inlineResult.photo;\n }\n // For results with type=video (for example @stikstokbot)\n if ('thumbnail' in inlineResult) {\n thumbnail = inlineResult.thumbnail;\n }\n if ('webThumbnail' in inlineResult && isForGallery) {\n webThumbnail = inlineResult.webThumbnail;\n }\n\n const thumbnailDataUrl = useMedia(webThumbnail ? `webDocument:${webThumbnail.url}` : undefined);\n const mediaBlobUrl = useMedia(photo && `photo${photo.id}?size=m`);\n const transitionClassNames = useMediaTransition(mediaBlobUrl);\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (isForGallery) {\n return (\n
\n \"\"\n \"\"\n
\n );\n }\n\n const { title, description } = inlineResult;\n\n return (\n \n );\n};\n\nexport default memo(MediaResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineResult } from '../../../../api/types';\n\nimport BaseResult from './BaseResult';\n\nexport type OwnProps = {\n focus?: boolean;\n inlineResult: ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst ArticleResult: FC = ({ focus, inlineResult, onClick }) => {\n const {\n title, url, description, webThumbnail,\n } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n return (\n \n );\n};\n\nexport default memo(ArticleResult);\n","import React, {\n FC, memo, useCallback,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport GifButton from '../../../common/GifButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst GifResult: FC = ({\n inlineResult, observeIntersection, onClick,\n}) => {\n const { gif } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (!gif) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(GifResult);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { STICKER_SIZE_INLINE_BOT_RESULT } from '../../../../config';\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport StickerButton from '../../../common/StickerButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst StickerResult: FC = ({ inlineResult, observeIntersection, onClick }) => {\n const { sticker } = inlineResult;\n\n if (!sticker) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(StickerResult);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { throttle } from '../../../util/schedulers';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport MediaResult from './inlineResults/MediaResult';\nimport ArticleResult from './inlineResults/ArticleResult';\nimport GifResult from './inlineResults/GifResult';\nimport StickerResult from './inlineResults/StickerResult';\nimport ListItem from '../../ui/ListItem';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\nimport './InlineBotTooltip.scss';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nexport type OwnProps = {\n isOpen: boolean;\n botId?: string;\n isGallery?: boolean;\n inlineBotResults?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n switchPm?: ApiBotInlineSwitchPm;\n onSelectResult: (inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult) => void;\n loadMore: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\nconst InlineBotTooltip: FC = ({\n isOpen,\n botId,\n isGallery,\n inlineBotResults,\n switchPm,\n loadMore,\n onClose,\n onSelectResult,\n}) => {\n const {\n openChat,\n startBot,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n isDisabled: !isOpen,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (direction === LoadMoreDirection.Backwards) {\n runThrottled(loadMore);\n }\n }, [loadMore]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n shouldRemoveSelectionOnReset: isGallery,\n noArrowNavigation: isGallery,\n items: inlineBotResults,\n onSelect: onSelectResult,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleSendPm = useCallback(() => {\n openChat({ id: botId });\n startBot({ botId, param: switchPm!.startParam });\n }, [botId, openChat, startBot, switchPm]);\n\n const prevInlineBotResults = usePrevious(\n inlineBotResults?.length\n ? inlineBotResults\n : undefined,\n shouldRender,\n );\n const renderedInlineBotResults = inlineBotResults && !inlineBotResults.length\n ? prevInlineBotResults\n : inlineBotResults;\n\n if (!shouldRender || !(renderedInlineBotResults?.length || switchPm)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'InlineBotTooltip composer-tooltip',\n IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll',\n isGallery && 'gallery',\n transitionClassNames,\n );\n\n function renderSwitchPm() {\n return (\n \n {switchPm!.text}\n \n );\n }\n\n function renderContent() {\n return renderedInlineBotResults!.map((inlineBotResult, index) => {\n switch (inlineBotResult.type) {\n case 'gif':\n return (\n \n );\n\n case 'photo':\n return (\n \n );\n\n case 'sticker':\n return (\n \n );\n\n case 'video':\n case 'file':\n case 'game':\n return (\n \n );\n case 'article':\n case 'audio':\n return (\n \n );\n\n default:\n return undefined;\n }\n });\n }\n\n return (\n \n {switchPm && renderSwitchPm()}\n {renderedInlineBotResults?.length && renderContent()}\n \n );\n};\n\nexport default memo(InlineBotTooltip);\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\n\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport renderText from '../../common/helpers/renderText';\nimport { getUserFullName, isUserId } from '../../../modules/helpers';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\nimport buildClassName from '../../../util/buildClassName';\nimport { getDispatch, getGlobal } from '../../../lib/teact/teactn';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\nimport Menu from '../../ui/Menu';\n\nimport './SendAsMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n chatId?: string;\n selectedSendAsId?: string;\n sendAsIds?: string[];\n};\n\nconst SendAsMenu: FC = ({\n isOpen,\n onClose,\n chatId,\n selectedSendAsId,\n sendAsIds,\n}) => {\n const { saveDefaultSendAs } = getDispatch();\n\n // No need for expensive global updates on users and chats, so we avoid them\n const usersById = getGlobal().users.byId;\n const chatsById = getGlobal().chats.byId;\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const [handleMouseEnter, handleMouseLeave, markMouseInside] = useMouseInside(isOpen, onClose, undefined);\n\n useEffect(() => {\n if (isOpen) {\n markMouseInside();\n }\n }, [isOpen, markMouseInside]);\n\n const handleUserSelect = useCallback((id: string) => {\n onClose();\n saveDefaultSendAs({ chatId, sendAsId: id });\n }, [chatId, onClose, saveDefaultSendAs]);\n\n const selectedSendAsIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: sendAsIds,\n onSelect: handleUserSelect,\n shouldSelectOnTab: true,\n shouldSaveSelectionOnUpdateItems: true,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedSendAsIndex, containerRef);\n }, [selectedSendAsIndex]);\n\n useEffect(() => {\n if (sendAsIds && !sendAsIds.length) {\n onClose();\n }\n }, [sendAsIds, onClose]);\n\n return (\n \n
{lang('SendMessageAsTitle')}
\n {usersById && chatsById && sendAsIds?.map((id, index) => {\n const user = isUserId(id) ? usersById[id] : undefined;\n const chat = !user ? chatsById[id] : undefined;\n const fullName = user ? getUserFullName(user) : chat?.title;\n\n return (\n handleUserSelect(id)}\n focus={selectedSendAsIndex === index}\n >\n \n
\n
\n

{fullName && renderText(fullName)}

\n
\n {user\n ? lang('VoipGroupPersonalAccount')\n : lang('Subscribers', chat?.membersCount, 'i')}\n \n
\n \n );\n })}\n \n );\n};\n\nexport default memo(SendAsMenu);\n","import React, {\n FC, useMemo, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiUser, ApiChat } from '../../api/types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\nimport {\n selectUser,\n selectChatMessages,\n selectChat,\n selectCurrentTextSearch,\n} from '../../modules/selectors';\nimport {\n getChatTitle,\n getUserFullName,\n isChatChannel,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport { renderMessageSummary } from '../common/helpers/renderMessageText';\nimport renderText from '../common/helpers/renderText';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport LastMessageMeta from '../common/LastMessageMeta';\nimport Avatar from '../common/Avatar';\n\nimport './RightSearch.scss';\n\nexport type OwnProps = {\n chatId: string;\n threadId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n messagesById?: Record;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n};\n\nconst RightSearch: FC = ({\n chatId,\n threadId,\n onClose,\n isActive,\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n}) => {\n const {\n searchTextMessagesLocal,\n focusMessage,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n useHistoryBack(isActive, onClose);\n\n const [viewportIds, getMore] = useInfiniteScroll(searchTextMessagesLocal, foundIds);\n\n const viewportResults = useMemo(() => {\n if (!query || !viewportIds?.length || !messagesById) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return viewportIds.map((id) => {\n const message = messagesById[id];\n if (!message) {\n return undefined;\n }\n\n const senderUser = message.senderId ? selectUser(getGlobal(), message.senderId) : undefined;\n\n let senderChat;\n if (chat && isChatChannel(chat)) {\n senderChat = chat;\n } else if (message.forwardInfo) {\n const { isChannelPost, fromChatId } = message.forwardInfo;\n senderChat = isChannelPost && fromChatId ? selectChat(getGlobal(), fromChatId) : undefined;\n } else {\n senderChat = message.senderId ? selectChat(getGlobal(), message.senderId) : undefined;\n }\n\n return {\n message,\n senderUser,\n senderChat,\n onClick: () => focusMessage({ chatId, threadId, messageId: id }),\n };\n }).filter(Boolean);\n }, [query, viewportIds, messagesById, chat, focusMessage, chatId, threadId]);\n\n const handleKeyDown = useKeyboardListNavigation(containerRef, true, (index) => {\n const foundResult = viewportResults?.[index === -1 ? 0 : index];\n if (foundResult) {\n foundResult.onClick();\n }\n }, '.ListItem-button', true);\n\n const renderSearchResult = ({\n message, senderUser, senderChat, onClick,\n }: {\n message: ApiMessage;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n onClick: NoneToVoidFunction;\n }) => {\n const title = senderChat ? getChatTitle(lang, senderChat) : getUserFullName(senderUser);\n const text = renderMessageSummary(lang, message, undefined, query);\n\n return (\n \n \n
\n
\n

{title && renderText(title)}

\n \n
\n
\n {text}\n
\n
\n \n );\n };\n\n const isOnTop = viewportIds?.[0] === foundIds?.[0];\n\n return (\n \n {isOnTop && (\n

\n {!query ? (\n lang('lng_dlg_search_for_messages')\n ) : (totalCount === 0 || !viewportResults.length) ? (\n lang('lng_search_no_results')\n ) : totalCount === 1 ? (\n '1 message found'\n ) : (\n `${(viewportResults.length && (totalCount || viewportResults.length))} messages found`\n )}\n

\n )}\n {viewportResults.map(renderSearchResult)}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const messagesById = chat && selectChatMessages(global, chat.id);\n if (!chat || !messagesById) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n };\n },\n)(RightSearch));\n","import React, {\n FC, useEffect, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiStickerSet } from '../../api/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_SEARCH } from '../../config';\nimport { selectShouldLoopStickers, selectStickerSet } from '../../modules/selectors';\nimport useFlag from '../../hooks/useFlag';\nimport useOnChange from '../../hooks/useOnChange';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport StickerButton from '../common/StickerButton';\nimport StickerSetModal from '../common/StickerSetModal.async';\nimport Spinner from '../ui/Spinner';\n\ntype OwnProps = {\n stickerSetId: string;\n observeIntersection: ObserveFn;\n isSomeModalOpen: boolean;\n onModalToggle: (isOpen: boolean) => void;\n};\n\ntype StateProps = {\n set?: ApiStickerSet;\n shouldPlay?: boolean;\n};\n\nconst STICKERS_TO_DISPLAY = 5;\n\nconst StickerSetResult: FC = ({\n stickerSetId, observeIntersection, set, shouldPlay,\n isSomeModalOpen, onModalToggle,\n}) => {\n const { loadStickers, toggleStickerSet } = getDispatch();\n\n const lang = useLang();\n const isAdded = set && Boolean(set.installedDate);\n const areStickersLoaded = Boolean(set?.stickers);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n useOnChange(() => {\n onModalToggle(isModalOpen);\n }, [isModalOpen, onModalToggle]);\n\n const displayedStickers = useMemo(() => {\n if (!set) {\n return [];\n }\n\n const coverStickerIds = (set.covers || []).map(({ id }) => id);\n const otherStickers = set.stickers ? set.stickers.filter(({ id }) => !coverStickerIds.includes(id)) : [];\n\n return [...(set.covers || []), ...otherStickers].slice(0, STICKERS_TO_DISPLAY);\n }, [set]);\n\n useEffect(() => {\n // Featured stickers are initialized with one sticker in collection (cover of SickerSet)\n if (!areStickersLoaded && displayedStickers.length < STICKERS_TO_DISPLAY) {\n loadStickers({ stickerSetId });\n }\n }, [areStickersLoaded, displayedStickers.length, loadStickers, stickerSetId]);\n\n const handleAddClick = useCallback(() => {\n toggleStickerSet({ stickerSetId });\n }, [toggleStickerSet, stickerSetId]);\n\n if (!set) {\n return undefined;\n }\n\n const canRenderStickers = displayedStickers.length > 0;\n\n return (\n
\n
\n
\n

{set.title}

\n

{lang('Stickers', set.count, 'i')}

\n
\n \n {lang(isAdded ? 'Stickers.Installed' : 'Stickers.Install')}\n \n
\n
\n {!canRenderStickers && }\n {canRenderStickers && displayedStickers.map((sticker) => (\n \n ))}\n
\n {canRenderStickers && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { stickerSetId }): StateProps => {\n return {\n set: selectStickerSet(global, stickerSetId),\n shouldPlay: selectShouldLoopStickers(global),\n };\n },\n)(StickerSetResult));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { throttle } from '../../util/schedulers';\nimport { selectCurrentStickerSearch } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Loading from '../ui/Loading';\nimport StickerSetResult from './StickerSetResult';\n\nimport './StickerSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n featuredIds?: string[];\n resultIds?: string[];\n};\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst StickerSearch: FC = ({\n onClose,\n isActive,\n query,\n featuredIds,\n resultIds,\n}) => {\n const { loadFeaturedStickers } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadFeaturedStickers();\n });\n });\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!query && featuredIds) {\n return featuredIds.map((id) => (\n \n ));\n }\n\n if (resultIds) {\n if (!resultIds.length) {\n return

Nothing found.

;\n }\n\n return resultIds.map((id) => (\n \n ));\n }\n\n return ;\n }\n\n return (\n
\n {renderContent()}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentStickerSearch(global);\n const { query, resultIds } = currentSearch || {};\n const { featured } = global.stickers;\n\n return {\n query,\n featuredIds: featured.setIds,\n resultIds,\n };\n },\n)(StickerSearch));\n","import React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiVideo } from '../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n selectCurrentGifSearch,\n selectChat,\n selectIsChatWithBot,\n selectCurrentMessageList,\n} from '../../modules/selectors';\nimport { getAllowedAttachmentOptions } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport GifButton from '../common/GifButton';\nimport Loading from '../ui/Loading';\n\nimport './GifSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n results?: ApiVideo[];\n chat?: ApiChat;\n isChatWithBot?: boolean;\n};\n\nconst PRELOAD_BACKWARDS = 96; // GIF Search bot results are multiplied by 24\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifSearch: FC = ({\n onClose,\n isActive,\n query,\n results,\n chat,\n isChatWithBot,\n}) => {\n const {\n searchMoreGifs,\n sendMessage,\n setGifSearchQuery,\n } = getDispatch();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n const { canSendGifs } = getAllowedAttachmentOptions(chat, isChatWithBot);\n\n const handleGifClick = useCallback((gif: ApiVideo) => {\n if (canSendGifs) {\n sendMessage({ gif });\n }\n\n if (IS_TOUCH_ENV) {\n setGifSearchQuery({ query: undefined });\n }\n }, [canSendGifs, sendMessage, setGifSearchQuery]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!results) {\n return (\n \n );\n }\n\n if (!results.length) {\n return (\n

{lang('NoGIFsFound')}

\n );\n }\n\n return results.map((gif) => (\n \n ));\n }\n\n const hasResults = Boolean(query !== undefined && results && results.length);\n\n return (\n
\n \n {renderContent()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentGifSearch(global);\n const { query, results } = currentSearch || {};\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChatWithBot = chat ? selectIsChatWithBot(global, chat) : undefined;\n\n return {\n query,\n results,\n chat,\n isChatWithBot,\n };\n },\n)(GifSearch));\n","import React, {\n FC, useCallback, useState, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat,\n ApiMessage,\n ApiPollAnswer,\n ApiPollResult,\n} from '../../api/types';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport ShowMoreButton from '../ui/ShowMoreButton';\nimport Loading from '../ui/Loading';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\n\nimport './PollAnswerResults.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n message: ApiMessage;\n answer: ApiPollAnswer;\n answerVote: ApiPollResult;\n totalVoters: number;\n};\n\ntype StateProps = {\n voters?: string[];\n offset: string;\n};\n\nconst INITIAL_LIMIT = 4;\nconst VIEW_MORE_LIMIT = 50;\n\nconst PollAnswerResults: FC = ({\n chat,\n message,\n answer,\n answerVote,\n totalVoters,\n voters,\n offset,\n}) => {\n const {\n loadPollOptionResults,\n openChat,\n closePollResults,\n } = getDispatch();\n\n const prevVotersCount = usePrevious(answerVote.votersCount);\n const [isLoading, setIsLoading] = useState(true);\n const areVotersLoaded = Boolean(voters);\n const { option, text } = answer;\n const lang = useLang();\n\n useEffect(() => {\n // For update when new votes arrive or when the user takes back his vote\n if (!areVotersLoaded || prevVotersCount !== answerVote.votersCount) {\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: INITIAL_LIMIT, shouldResetVoters: true,\n });\n }\n // eslint-disable-next-line\n }, [answerVote.votersCount, areVotersLoaded]);\n\n const handleViewMoreClick = useCallback(() => {\n setIsLoading(true);\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: VIEW_MORE_LIMIT,\n });\n }, [chat, loadPollOptionResults, message.id, offset, option]);\n\n useEffect(() => {\n setIsLoading(false);\n }, [voters]);\n\n const handleMemberClick = useCallback((id: string) => {\n openChat({ id });\n closePollResults();\n }, [closePollResults, openChat]);\n\n function renderViewMoreButton() {\n const leftVotersCount = answerVote.votersCount - voters!.length;\n\n return answerVote.votersCount > INITIAL_LIMIT && leftVotersCount > 0 && (\n \n );\n }\n\n return (\n
\n
\n {voters\n ? voters.map((id) => (\n handleMemberClick(id)}\n >\n \n \n ))\n : }\n {voters && renderViewMoreButton()}\n
\n
\n {text}\n \n {getPercentage(answerVote.votersCount, totalVoters)}%\n \n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default memo(withGlobal(\n (global, { answer }: OwnProps): StateProps => {\n const { voters, offsets } = global.pollResults;\n\n return {\n voters: voters?.[answer.option],\n offset: (offsets?.[answer.option]) || '',\n };\n },\n)(PollAnswerResults));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiChat } from '../../api/types';\nimport { selectChat, selectChatMessage } from '../../modules/selectors';\nimport { buildCollectionByKey } from '../../util/iteratees';\nimport { getMessagePoll } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport PollAnswerResults from './PollAnswerResults';\nimport Loading from '../ui/Loading';\n\nimport './PollResults.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n message?: ApiMessage;\n lastSyncTime?: number;\n};\n\nconst PollResults: FC = ({\n onClose,\n isActive,\n chat,\n message,\n lastSyncTime,\n}) => {\n const lang = useLang();\n useHistoryBack(isActive, onClose);\n\n if (!message || !chat) {\n return ;\n }\n\n const { summary, results } = getMessagePoll(message)!;\n if (!results.results) {\n return undefined;\n }\n\n const resultsByOption = buildCollectionByKey(results.results, 'option');\n\n return (\n
\n

{renderText(summary.question, ['emoji', 'br'])}

\n
\n {lastSyncTime && summary.answers.map((answer) => (\n \n ))}\n {!lastSyncTime && }\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n pollResults: { chatId, messageId },\n lastSyncTime,\n } = global;\n\n if (!chatId || !messageId) {\n return {};\n }\n\n const chat = selectChat(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n chat,\n message,\n lastSyncTime,\n };\n },\n)(PollResults));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../../modules/selectors';\nimport { selectIsChatMuted } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n userId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n progress?: ManagementProgress;\n isMuted?: boolean;\n};\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide first name';\n\nconst ManageUser: FC = ({\n userId,\n user,\n progress,\n isMuted,\n onClose,\n isActive,\n}) => {\n const {\n updateContact,\n deleteContact,\n closeManagement,\n } = getDispatch();\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const currentFirstName = user ? (user.firstName || '') : '';\n const currentLastName = user ? (user.lastName || '') : '';\n\n const [firstName, setFirstName] = useState(currentFirstName);\n const [lastName, setLastName] = useState(currentLastName);\n const [isNotificationsEnabled, setIsNotificationsEnabled] = useState(!isMuted);\n\n useEffect(() => {\n setIsNotificationsEnabled(!isMuted);\n }, [isMuted]);\n\n useEffect(() => {\n setIsProfileFieldsTouched(false);\n closeDeleteDialog();\n }, [closeDeleteDialog, userId]);\n\n useEffect(() => {\n setFirstName(currentFirstName);\n setLastName(currentLastName);\n }, [currentFirstName, currentLastName, user]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n closeDeleteDialog();\n }\n }, [closeDeleteDialog, progress]);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleNotificationChange = useCallback((e: ChangeEvent) => {\n setIsNotificationsEnabled(e.target.checked);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n }\n\n updateContact({\n userId,\n isMuted: !isNotificationsEnabled,\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n });\n }, [firstName, lastName, updateContact, userId, isNotificationsEnabled]);\n\n const handleDeleteContact = useCallback(() => {\n deleteContact({ userId });\n closeDeleteDialog();\n closeManagement();\n }, [closeDeleteDialog, closeManagement, deleteContact, userId]);\n\n if (!user) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n
\n \n
\n
\n
\n \n {lang('DeleteContact')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const user = selectUser(global, userId);\n const chat = selectChat(global, userId)!;\n const { progress } = global.management;\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n return {\n user, progress, isMuted,\n };\n },\n)(ManageUser));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport {\n ApiChat, ApiChatBannedRights, ApiExportedInvite, ApiMediaFormat,\n} from '../../../api/types';\n\nimport { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { selectChat } from '../../../modules/selectors';\nimport { formatInteger } from '../../../util/textFormat';\nimport renderText from '../../common/helpers/renderText';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isBasicGroup: boolean;\n hasLinkedChannel: boolean;\n canChangeInfo?: boolean;\n canBanUsers?: boolean;\n canInvite?: boolean;\n exportedInvites?: ApiExportedInvite[];\n lastSyncTime?: number;\n availableReactionsCount?: number;\n};\n\nconst GROUP_TITLE_EMPTY = 'Group title can\\'t be empty';\n\n// Some checkboxes control multiple rights, and some rights are not controlled from Permissions screen,\n// so we need to define the amount manually\nconst TOTAL_PERMISSIONS_COUNT = 8;\n\nconst ManageGroup: FC = ({\n chatId,\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo,\n canBanUsers,\n canInvite,\n onScreenSelect,\n onClose,\n isActive,\n exportedInvites,\n lastSyncTime,\n availableReactionsCount,\n}) => {\n const {\n togglePreHistoryHidden,\n updateChat,\n deleteChat,\n leaveChannel,\n deleteChannel,\n closeManagement,\n openChat,\n loadExportedChatInvites,\n loadChatJoinRequests,\n } = getDispatch();\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const currentTitle = chat.title;\n const currentAbout = chat.fullInfo ? (chat.fullInfo.about || '') : '';\n\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle || '');\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const isPublicGroup = chat.username || hasLinkedChannel;\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (lastSyncTime && canInvite) {\n loadExportedChatInvites({ chatId });\n loadExportedChatInvites({ chatId, isRevoked: true });\n loadChatJoinRequests({ chatId });\n }\n }, [chatId, loadExportedChatInvites, lastSyncTime, canInvite, loadChatJoinRequests]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickReactions = useCallback(() => {\n onScreenSelect(ManagementScreens.Reactions);\n }, [onScreenSelect]);\n\n const handleClickPermissions = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleClickInvites = () => {\n onScreenSelect(ManagementScreens.Invites);\n };\n\n const handleClickRequests = () => {\n onScreenSelect(ManagementScreens.JoinRequests);\n };\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateGroup = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(GROUP_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleClickMembers = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupMembers);\n }, [onScreenSelect]);\n\n const handleTogglePreHistory = useCallback(() => {\n if (!chat.fullInfo) {\n return;\n }\n\n const { isPreHistoryHidden } = chat.fullInfo;\n\n togglePreHistoryHidden({ chatId: chat.id, isEnabled: !isPreHistoryHidden });\n }, [chat, togglePreHistoryHidden]);\n\n const enabledReactionsCount = chat.fullInfo?.enabledReactions?.length || 0;\n\n const enabledPermissionsCount = useMemo(() => {\n if (!chat.defaultBannedRights) {\n return 0;\n }\n\n let totalCount = [\n 'sendMessages',\n 'sendMedia',\n 'embedLinks',\n 'sendPolls',\n 'changeInfo',\n 'inviteUsers',\n 'pinMessages',\n ].filter(\n (key) => !chat.defaultBannedRights![key as keyof ApiChatBannedRights],\n ).length;\n\n const { sendStickers, sendGifs } = chat.defaultBannedRights;\n\n // These two rights are controlled with a single checkbox\n if (!sendStickers && !sendGifs) {\n totalCount += 1;\n }\n\n return totalCount;\n }, [chat]);\n\n const adminsCount = (chat.fullInfo?.adminMembers?.length) || 0;\n\n const handleDeleteGroup = useCallback(() => {\n if (isBasicGroup) {\n deleteChat({ chatId: chat.id });\n } else if (!chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else {\n deleteChannel({ chatId: chat.id });\n }\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [\n isBasicGroup, chat.isCreator, chat.id,\n closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, deleteChat, openChat,\n ]);\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('GroupType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n {hasLinkedChannel && (\n \n {lang('LinkedChannel')}\n {lang('DiscussionUnlink')}\n \n )}\n \n {lang('ChannelPermissions')}\n \n {enabledPermissionsCount}/{TOTAL_PERMISSIONS_COUNT}\n \n \n\n \n {lang('Reactions')}\n \n {enabledReactionsCount}/{availableReactionsCount}\n \n \n \n {lang('ChannelAdministrators')}\n {formatInteger(adminsCount)}\n \n {canInvite && (\n \n {lang('GroupInfo.InviteLinks')}\n \n {exportedInvites ? formatInteger(exportedInvites.length) : lang('Loading')}\n \n \n )}\n {Boolean(chat.joinRequests?.length) && (\n \n {lang('MemberRequests')}\n \n {formatInteger(chat.joinRequests!.length)}\n \n \n )}\n
\n
\n \n {lang('GroupMembers')}\n {formatInteger(chat.membersCount ?? 0)}\n \n\n {!isPublicGroup && chat.fullInfo && (\n
\n \n
\n )}\n
\n
\n \n {lang('DeleteMega')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const hasLinkedChannel = Boolean(chat.fullInfo?.linkedChatId);\n const isBasicGroup = isChatBasicGroup(chat);\n const { invites } = global.management.byChatId[chatId] || {};\n\n return {\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'changeInfo'),\n canBanUsers: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'banUsers'),\n canInvite: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'inviteUsers'),\n exportedInvites: invites,\n lastSyncTime: global.lastSyncTime,\n availableReactionsCount: global.availableReactions?.filter((l) => !l.isInactive).length,\n };\n },\n)(ManageGroup));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n currentUserId?: string;\n};\n\nconst FLOATING_BUTTON_ANIMATION_TIMEOUT_MS = 250;\n\nfunction getLangKeyForBannedRightKey(key: string) {\n switch (key) {\n case 'sendMessages':\n return 'UserRestrictionsNoSend';\n case 'sendMedia':\n return 'UserRestrictionsNoSendMedia';\n case 'sendStickers':\n return 'UserRestrictionsNoSendStickers';\n case 'embedLinks':\n return 'UserRestrictionsNoEmbedLinks';\n case 'sendPolls':\n return 'UserRestrictionsNoSendPolls';\n case 'changeInfo':\n return 'UserRestrictionsNoChangeInfo';\n case 'inviteUsers':\n return 'UserRestrictionsInviteUsers';\n case 'pinMessages':\n return 'UserRestrictionsPinMessages';\n default:\n return undefined;\n }\n}\n\nconst ManageGroupPermissions: FC = ({\n onScreenSelect,\n onChatMemberSelect,\n chat,\n currentUserId,\n onClose,\n isActive,\n}) => {\n const { updateChatDefaultBannedRights } = getDispatch();\n\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const handleRemovedUsersClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupRemovedUsers);\n }, [onScreenSelect]);\n\n const handleAddExceptionClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupUserPermissionsCreate);\n }, [onScreenSelect]);\n\n const handleExceptionMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n useEffect(() => {\n setPermissions((chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setTimeout(() => {\n setIsLoading(false);\n }, FLOATING_BUTTON_ANIMATION_TIMEOUT_MS);\n }, [chat]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat) {\n return;\n }\n\n setIsLoading(true);\n updateChatDefaultBannedRights({ chatId: chat.id, bannedRights: permissions });\n }, [chat, permissions, updateChatDefaultBannedRights]);\n\n const removedUsersCount = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return 0;\n }\n\n return chat.fullInfo.kickedMembers.length;\n }, [chat]);\n\n const exceptionMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return [];\n }\n\n return chat.fullInfo.members.filter(({ bannedRights }) => Boolean(bannedRights));\n }, [chat]);\n\n const getMemberExceptions = useCallback((member: ApiChatMember) => {\n const { bannedRights } = member;\n if (!bannedRights || !chat) {\n return undefined;\n }\n\n const { defaultBannedRights } = chat;\n\n return Object.keys(bannedRights).reduce((result, key) => {\n if (\n !bannedRights[key as keyof ApiChatBannedRights]\n || (defaultBannedRights?.[key as keyof ApiChatBannedRights])\n || key === 'sendInline' || key === 'viewMessages' || key === 'sendGames'\n ) {\n return result;\n }\n\n const langKey = getLangKeyForBannedRightKey(key);\n\n if (!langKey) {\n return result;\n }\n\n const translatedString = lang(langKey);\n\n return `${result}${!result.length ? translatedString : `, ${translatedString}`}`;\n }, '');\n }, [chat, lang]);\n\n return (\n
\n
\n
\n

{lang('ChannelPermissionsHeader')}

\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 {lang('ChannelBlockedUsers')}\n {removedUsersCount}\n \n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n \n {lang('ChannelAddException')}\n \n\n {exceptionMembers.map((member) => (\n handleExceptionMemberClick(member)}\n >\n \n \n ))}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat, currentUserId: global.currentUserId };\n },\n)(ManageGroupPermissions));\n","import React, {\n FC, useMemo, useState, memo, useRef, useCallback,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { filterUsersByName } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\n\nimport ChatOrUserPicker from '../../common/ChatOrUserPicker';\n\nexport type OwnProps = {\n chat: ApiChat;\n isOpen: boolean;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n currentUserId?: string;\n};\n\nconst RemoveGroupUserModal: FC = ({\n chat,\n currentUserId,\n isOpen,\n onClose,\n}) => {\n const {\n loadMoreMembers,\n deleteChatMember,\n } = getDispatch();\n\n const lang = useLang();\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const filterRef = useRef(null);\n\n const usersId = useMemo(() => {\n const availableMemberIds = (chat.fullInfo?.members || [])\n .reduce((acc: string[], member) => {\n if (!member.isAdmin && !member.isOwner && member.userId !== currentUserId) {\n acc.push(member.userId);\n }\n return acc;\n }, []);\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n\n return filterUsersByName(availableMemberIds, usersById, filter);\n }, [chat.fullInfo?.members, currentUserId, filter]);\n\n const handleRemoveUser = useCallback((userId: string) => {\n deleteChatMember({ chatId: chat.id, userId });\n onClose();\n }, [chat.id, deleteChatMember, onClose]);\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n\n return { currentUserId };\n },\n)(RemoveGroupUserModal));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getHasAdminRight, getUserFullName, isChatChannel } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useFlag from '../../../hooks/useFlag';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport RemoveGroupUserModal from './RemoveGroupUserModal';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n usersById: Record;\n canDeleteMembers?: boolean;\n isChannel?: boolean;\n};\n\nconst ManageChatRemovedUsers: FC = ({\n chat,\n usersById,\n canDeleteMembers,\n isChannel,\n onClose,\n isActive,\n}) => {\n const { updateChatMemberBannedRights } = getDispatch();\n\n const lang = useLang();\n const [isRemoveUserModalOpen, openRemoveUserModal, closeRemoveUserModal] = useFlag();\n\n useHistoryBack(isActive, onClose);\n\n const removedMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return [];\n }\n\n return chat.fullInfo.kickedMembers;\n }, [chat]);\n\n const getRemovedBy = useCallback((member: ApiChatMember) => {\n if (!member.kickedByUserId) {\n return undefined;\n }\n\n const kickedByUser = usersById[member.kickedByUserId];\n if (!kickedByUser) {\n return undefined;\n }\n\n return lang('UserRemovedBy', getUserFullName(kickedByUser));\n }, [lang, usersById]);\n\n const getContextActions = useCallback((member: ApiChatMember) => {\n if (!chat) {\n return undefined;\n }\n\n return [{\n title: lang('Unblock'),\n icon: 'delete',\n destructive: true,\n handler: () => updateChatMemberBannedRights({\n chatId: chat.id,\n userId: member.userId,\n bannedRights: {},\n }),\n }];\n }, [lang, chat, updateChatMemberBannedRights]);\n\n return (\n
\n
\n
\n

{lang(isChannel ? 'NoBlockedChannel2' : 'NoBlockedGroup2')}

\n\n {removedMembers.map((member) => (\n \n \n \n ))}\n {canDeleteMembers && (\n \n \n \n )}\n {chat && canDeleteMembers && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const canDeleteMembers = chat && (getHasAdminRight(chat, 'banUsers') || chat.isCreator);\n\n return {\n chat,\n usersById,\n canDeleteMembers,\n isChannel: chat && isChatChannel(chat),\n };\n },\n)(ManageChatRemovedUsers));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiExportedInvite, ApiMediaFormat } from '../../../api/types';\n\nimport { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { formatInteger } from '../../../util/textFormat';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isSignaturesShown: boolean;\n canChangeInfo?: boolean;\n canInvite?: boolean;\n exportedInvites?: ApiExportedInvite[];\n lastSyncTime?: number;\n availableReactionsCount?: number;\n};\n\nconst CHANNEL_TITLE_EMPTY = 'Channel title can\\'t be empty';\n\nconst ManageChannel: FC = ({\n chatId,\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo,\n canInvite,\n exportedInvites,\n lastSyncTime,\n availableReactionsCount,\n onScreenSelect,\n onClose,\n isActive,\n}) => {\n const {\n updateChat,\n toggleSignatures,\n closeManagement,\n leaveChannel,\n deleteChannel,\n openChat,\n loadExportedChatInvites,\n loadChatJoinRequests,\n } = getDispatch();\n\n const currentTitle = chat ? (chat.title || '') : '';\n const currentAbout = chat?.fullInfo ? (chat.fullInfo.about || '') : '';\n const hasLinkedChat = chat?.fullInfo?.linkedChatId;\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle);\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = chat && getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (lastSyncTime) {\n loadExportedChatInvites({ chatId });\n loadExportedChatInvites({ chatId, isRevoked: true });\n loadChatJoinRequests({ chatId });\n }\n }, [chatId, loadExportedChatInvites, lastSyncTime, loadChatJoinRequests]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const adminsCount = (chat?.fullInfo?.adminMembers?.length) || 0;\n const removedUsersCount = (chat?.fullInfo?.kickedMembers?.length) || 0;\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickReactions = useCallback(() => {\n onScreenSelect(ManagementScreens.Reactions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleClickInvites = () => {\n onScreenSelect(ManagementScreens.Invites);\n };\n\n const handleClickRequests = () => {\n onScreenSelect(ManagementScreens.JoinRequests);\n };\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateChannel = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(CHANNEL_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleToggleSignatures = useCallback(() => {\n toggleSignatures({ chatId, isEnabled: !isSignaturesShown });\n }, [chatId, isSignaturesShown, toggleSignatures]);\n\n const handleClickSubscribers = useCallback(() => {\n onScreenSelect(ManagementScreens.ChannelSubscribers);\n }, [onScreenSelect]);\n\n const handleRemovedUsersClick = useCallback(() => {\n onScreenSelect(ManagementScreens.ChannelRemovedUsers);\n }, [onScreenSelect]);\n\n const handleDeleteChannel = useCallback(() => {\n if (chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n } else {\n leaveChannel({ chatId: chat.id });\n }\n\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.isCreator, chat.id, closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, openChat]);\n\n const enabledReactionsCount = chat.fullInfo?.enabledReactions?.length || 0;\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('ChannelType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n \n {lang('Discussion')}\n {hasLinkedChat ? lang('DiscussionUnlink') : lang('Add')}\n \n {canInvite && (\n \n {lang('GroupInfo.InviteLinks')}\n \n {exportedInvites ? formatInteger(exportedInvites.length) : lang('Loading')}\n \n \n )}\n {Boolean(chat.joinRequests?.length) && (\n \n {lang('SubscribeRequests')}\n \n {formatInteger(chat.joinRequests!.length)}\n \n \n )}\n \n {lang('Reactions')}\n \n {enabledReactionsCount}/{availableReactionsCount}\n \n \n
\n \n
\n
\n
\n \n {lang('ChannelAdministrators')}\n {adminsCount}\n \n \n {lang('ChannelSubscribers')}\n {lang('Subscribers', chat.membersCount ?? 0, 'i')}\n \n \n {lang('ChannelBlockedUsers')}\n {removedUsersCount}\n \n
\n
\n \n {chat.isCreator ? lang('ChannelDelete') : lang('LeaveChannel')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const isSignaturesShown = Boolean(chat?.isSignaturesShown);\n const { invites } = global.management.byChatId[chatId] || {};\n\n return {\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo: getHasAdminRight(chat, 'changeInfo'),\n canInvite: getHasAdminRight(chat, 'inviteUsers'),\n lastSyncTime: global.lastSyncTime,\n exportedInvites: invites,\n availableReactionsCount: global.availableReactions?.filter((l) => !l.isInactive).length,\n };\n },\n)(ManageChannel));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { selectChat, selectManagement } from '../../../modules/selectors';\nimport { isChatChannel } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport SafeLink from '../../common/SafeLink';\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport UsernameInput from '../../common/UsernameInput';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype PrivacyType = 'private' | 'public';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n isChannel: boolean;\n progress?: ManagementProgress;\n isUsernameAvailable?: boolean;\n isProtected?: boolean;\n};\n\nconst ManageChatPrivacyType: FC = ({\n chat,\n onClose,\n isActive,\n isChannel,\n progress,\n isUsernameAvailable,\n isProtected,\n}) => {\n const {\n checkPublicLink,\n updatePublicLink,\n updatePrivateLink,\n toggleIsProtected,\n } = getDispatch();\n\n const isPublic = Boolean(chat.username);\n const privateLink = chat.fullInfo?.inviteLink;\n\n const [privacyType, setPrivacyType] = useState(isPublic ? 'public' : 'private');\n const [username, setUsername] = useState();\n const [isRevokeConfirmDialogOpen, openRevokeConfirmDialog, closeRevokeConfirmDialog] = useFlag();\n\n const canUpdate = Boolean(\n (privacyType === 'public' && username && isUsernameAvailable)\n || (privacyType === 'private' && isPublic),\n );\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (privacyType && !privateLink) {\n updatePrivateLink();\n }\n }, [privacyType, privateLink, updatePrivateLink]);\n\n const handleOptionChange = useCallback((value: string) => {\n setPrivacyType(value as PrivacyType);\n }, []);\n\n const handleForwardingOptionChange = useCallback((value: string) => {\n toggleIsProtected({\n chatId: chat.id,\n isProtected: value === 'protected',\n });\n }, [chat.id, toggleIsProtected]);\n\n const handleSave = useCallback(() => {\n updatePublicLink({ username: privacyType === 'public' ? username : '' });\n }, [privacyType, updatePublicLink, username]);\n\n const handleRevokePrivateLink = useCallback(() => {\n closeRevokeConfirmDialog();\n updatePrivateLink();\n }, [closeRevokeConfirmDialog, updatePrivateLink]);\n\n const lang = useLang();\n const langPrefix1 = isChannel ? 'Channel' : 'Mega';\n const langPrefix2 = isChannel ? 'Channel' : 'Group';\n\n const options = [\n { value: 'private', label: lang(`${langPrefix1}Private`), subLabel: lang(`${langPrefix1}PrivateInfo`) },\n { value: 'public', label: lang(`${langPrefix1}Public`), subLabel: lang(`${langPrefix1}PublicInfo`) },\n ];\n\n const forwardingOptions = [{\n value: 'allowed',\n label: lang('ChannelVisibility.Forwarding.Enabled'),\n }, {\n value: 'protected',\n label: lang('ChannelVisibility.Forwarding.Disabled'),\n }];\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n

{lang(`${langPrefix2}Type`)}

\n \n
\n {privacyType === 'private' ? (\n
\n {privateLink ? (\n <>\n \n

\n {lang(`${langPrefix1}PrivateLinkHelp`)}\n

\n\n \n {lang('RevokeLink')}\n \n \n \n ) : (\n \n )}\n
\n ) : (\n
\n \n

\n {lang(`${langPrefix2}.Username.CreatePublicLinkHelp`)}\n

\n
\n )}\n
\n

\n {lang(isChannel ? 'ChannelVisibility.Forwarding.ChannelTitle' : 'ChannelVisibility.Forwarding.GroupTitle')}\n

\n \n

\n {isChannel\n ? lang('ChannelVisibility.Forwarding.ChannelInfo')\n : lang('ChannelVisibility.Forwarding.GroupInfo')}\n

\n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { isUsernameAvailable } = selectManagement(global, chatId)!;\n\n return {\n chat,\n isChannel: isChatChannel(chat),\n progress: global.management.progress,\n isUsernameAvailable,\n isProtected: chat?.isProtected,\n };\n },\n)(ManageChatPrivacyType));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config';\nimport { selectChat } from '../../../modules/selectors';\nimport getAnimationData from '../../common/helpers/animatedAssets';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport useFlag from '../../../hooks/useFlag';\nimport renderText from '../../common/helpers/renderText';\nimport Avatar from '../../common/Avatar';\nimport { isChatChannel } from '../../../modules/helpers';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n chatsByIds: Record;\n linkedChat?: ApiChat;\n forDiscussionIds?: string[];\n isChannel?: boolean;\n};\n\nconst ManageDiscussion: FC = ({\n chat,\n onClose,\n isActive,\n chatId,\n chatsByIds,\n linkedChat,\n forDiscussionIds,\n isChannel,\n onScreenSelect,\n}) => {\n const {\n loadGroupsForDiscussion,\n linkDiscussionGroup,\n unlinkDiscussionGroup,\n } = getDispatch();\n\n const [linkedGroupId, setLinkedGroupId] = useState();\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n const [isConfirmUnlinkGroupDialogOpen, openConfirmUnlinkGroupDialog, closeConfirmUnlinkGroupDialog] = useFlag();\n const [isConfirmLinkGroupDialogOpen, openConfirmLinkGroupDialog, closeConfirmLinkGroupDialog] = useFlag();\n const lang = useLang();\n const linkedChatId = linkedChat?.id;\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n loadGroupsForDiscussion();\n }, [loadGroupsForDiscussion]);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('DiscussionGroups').then(setAnimationData);\n }\n }, [animationData]);\n\n const handleUnlinkGroupSessions = useCallback(() => {\n closeConfirmUnlinkGroupDialog();\n unlinkDiscussionGroup({ channelId: isChannel ? chatId : linkedChatId });\n if (!isChannel) {\n onScreenSelect(ManagementScreens.Initial);\n }\n }, [closeConfirmUnlinkGroupDialog, unlinkDiscussionGroup, isChannel, chatId, linkedChatId, onScreenSelect]);\n\n const handleLinkGroupSessions = useCallback(() => {\n closeConfirmLinkGroupDialog();\n linkDiscussionGroup({ channelId: chatId, chatId: linkedGroupId });\n }, [closeConfirmLinkGroupDialog, linkDiscussionGroup, chatId, linkedGroupId]);\n\n const onDiscussionClick = (groupId: string) => {\n setLinkedGroupId(groupId);\n openConfirmLinkGroupDialog();\n };\n\n function renderUnlinkGroupHeader() {\n return (\n
\n \n
\n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n
\n
\n );\n }\n\n function renderLinkGroupHeader() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n return (\n
\n \n
\n {lang('Channel.DiscussionGroup.LinkGroup')}\n
\n
\n );\n }\n\n function renderLinkGroupConfirmText() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n if (linkedGroup.hasPrivateLink) {\n return renderText(\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPublicAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n return renderText(\n // eslint-disable-next-line max-len\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?\\n\\nAnyone from the channel will be able to see messages in this group.`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPrivateAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n function renderLinkedGroup() {\n return (\n
\n \n \n \n \n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n \n \n
\n );\n }\n\n function renderDiscussionGroups() {\n return (\n
\n

{lang('DiscussionChannelHelp')}

\n\n
\n \n {lang('DiscussionCreateGroup')}\n \n {forDiscussionIds ? (\n forDiscussionIds.map((id, i) => (\n {\n onDiscussionClick(id);\n }}\n >\n \n \n ))\n ) : (\n \n )}\n
\n

{lang('DiscussionChannelHelp2')}

\n \n
\n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n {linkedChat && renderLinkedGroup()}\n {!linkedChat && renderDiscussionGroups()}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { forDiscussionIds, byId: chatsByIds } = global.chats;\n const linkedChat = chat?.fullInfo?.linkedChatId\n ? selectChat(global, chat.fullInfo.linkedChatId)\n : undefined;\n\n return {\n chat,\n chatsByIds,\n forDiscussionIds,\n linkedChat,\n isChannel: chat && isChatChannel(chat),\n };\n },\n)(ManageDiscussion));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatBannedRights } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n chatId: string;\n selectedChatMemberId?: string;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isFormFullyDisabled?: boolean;\n};\n\nconst ManageGroupUserPermissions: FC = ({\n chat,\n selectedChatMemberId,\n onScreenSelect,\n isFormFullyDisabled,\n onClose,\n isActive,\n}) => {\n const { updateChatMemberBannedRights } = getDispatch();\n\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [isBanConfirmationDialogOpen, openBanConfirmationDialog, closeBanConfirmationDialog] = useFlag();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return undefined;\n }\n\n return chat.fullInfo.members.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember?.bannedRights) || (chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setIsLoading(false);\n }, [chat, selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: permissions,\n });\n }, [chat, selectedChatMemberId, permissions, updateChatMemberBannedRights]);\n\n const handleBanFromGroup = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: {\n viewMessages: true,\n },\n });\n }, [chat, selectedChatMemberId, updateChatMemberBannedRights]);\n\n const getControlIsDisabled = useCallback((key: Exclude) => {\n if (isFormFullyDisabled) {\n return true;\n }\n\n if (!chat || !chat.defaultBannedRights) {\n return false;\n }\n\n return chat.defaultBannedRights[key];\n }, [chat, isFormFullyDisabled]);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('UserRestrictionsCanDo')}

\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 {!isFormFullyDisabled && (\n
\n \n {lang('UserRestrictionsBlock')}\n \n
\n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return { chat, isFormFullyDisabled };\n },\n)(ManageGroupUserPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatMember } from '../../../api/types';\n\nimport { getUserFullName, isChatChannel } from '../../../modules/helpers';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n currentUserId?: string;\n isChannel: boolean;\n};\n\nconst ManageChatAdministrators: FC = ({\n chat,\n isChannel,\n currentUserId,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function handleRecentActionsClick() {\n onScreenSelect(ManagementScreens.GroupRecentActions);\n }\n\n const adminMembers = useMemo(() => {\n if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const handleAdminMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.ChatAdminRights);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n const handleAddAdminClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupAddAdmins);\n }, [onScreenSelect]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const promotedByUser = member.promotedByUserId ? usersById[member.promotedByUserId] : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [lang]);\n\n return (\n
\n
\n
\n \n {lang('EventLog')}\n {lang(isChannel ? 'EventLogInfoDetailChannel' : 'EventLogInfoDetail')}\n \n
\n\n
\n

\n {isChannel\n ? 'You can add administrators to help you manage your channel.'\n : 'You can add administrators to help you manage your group.'}\n

\n\n {adminMembers.map((member) => (\n handleAdminMemberClick(member)}\n >\n \n \n ))}\n\n \n \n \n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n\n return {\n chat,\n currentUserId: global.currentUserId,\n isChannel: isChatChannel(chat),\n };\n },\n)(ManageChatAdministrators));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember } from '../../../api/types';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n};\n\nconst ManageGroupRecentActions: FC = ({ chat, onClose, isActive }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const adminMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n return lang('ChannelAdmin');\n }, [lang]);\n\n return (\n
\n
\n
\n

Actions

\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

{lang('Channel.Management.Title')}

\n\n
\n \n
\n\n {adminMembers.map((member) => (\n \n \n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat };\n },\n)(ManageGroupRecentActions));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName, isChatBasicGroup, isChatChannel } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport InputText from '../../ui/InputText';\n\ntype OwnProps = {\n chatId: string;\n selectedUserId?: string;\n isPromotedByCurrentUser?: boolean;\n isNewAdmin?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n usersById: Record;\n currentUserId?: string;\n isChannel: boolean;\n isFormFullyDisabled: boolean;\n defaultRights?: ApiChatAdminRights;\n};\n\nconst CUSTOM_TITLE_MAX_LENGTH = 16;\n\nconst ManageGroupAdminRights: FC = ({\n isNewAdmin,\n selectedUserId,\n defaultRights,\n onScreenSelect,\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n onClose,\n isActive,\n}) => {\n const { updateChatAdmin } = getDispatch();\n\n const [permissions, setPermissions] = useState({});\n const [isTouched, setIsTouched] = useState(Boolean(isNewAdmin));\n const [isLoading, setIsLoading] = useState(false);\n const [isDismissConfirmationDialogOpen, openDismissConfirmationDialog, closeDismissConfirmationDialog] = useFlag();\n const [customTitle, setCustomTitle] = useState('');\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n const selectedAdminMember = chat.fullInfo?.adminMembers?.find(({ userId }) => userId === selectedUserId);\n\n // If `selectedAdminMember` variable is filled with a value, then we have already saved the administrator,\n // so now we need to return to the list of administrators\n if (isNewAdmin && (selectedAdminMember || !selectedUserId)) {\n return undefined;\n }\n\n if (isNewAdmin) {\n const user = getGlobal().users.byId[selectedUserId!];\n\n return user ? {\n userId: user.id,\n adminRights: defaultRights,\n customTitle: lang('ChannelAdmin'),\n isOwner: false,\n promotedByUserId: undefined,\n } : undefined;\n }\n\n return selectedAdminMember;\n }, [chat.fullInfo?.adminMembers, defaultRights, isNewAdmin, lang, selectedUserId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedUserId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedUserId]);\n\n useEffect(() => {\n setPermissions(selectedChatMember?.adminRights || {});\n setCustomTitle((selectedChatMember?.customTitle || '').substr(0, CUSTOM_TITLE_MAX_LENGTH));\n setIsTouched(Boolean(isNewAdmin));\n setIsLoading(false);\n }, [defaultRights, isNewAdmin, selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as keyof ApiChatAdminRights]),\n }));\n setIsTouched(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!selectedUserId) {\n return;\n }\n\n setIsLoading(true);\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedUserId,\n adminRights: permissions,\n customTitle,\n });\n }, [selectedUserId, updateChatAdmin, chat.id, permissions, customTitle]);\n\n const handleDismissAdmin = useCallback(() => {\n if (!selectedUserId) {\n return;\n }\n\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedUserId,\n adminRights: {},\n });\n closeDismissConfirmationDialog();\n }, [chat.id, closeDismissConfirmationDialog, selectedUserId, updateChatAdmin]);\n\n const getControlIsDisabled = useCallback((key: keyof ApiChatAdminRights) => {\n if (isChatBasicGroup(chat)) {\n return false;\n }\n\n if (isFormFullyDisabled || !chat.adminRights) {\n return true;\n }\n\n return !chat.adminRights![key];\n }, [chat, isFormFullyDisabled]);\n\n const memberStatus = useMemo(() => {\n if (isNewAdmin || !selectedChatMember) {\n return undefined;\n }\n\n if (selectedChatMember.isOwner) {\n return lang('ChannelCreator');\n }\n\n const promotedByUser = selectedChatMember.promotedByUserId\n ? usersById[selectedChatMember.promotedByUserId]\n : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [isNewAdmin, selectedChatMember, usersById, lang]);\n\n const handleCustomTitleChange = useCallback((e) => {\n const { value } = e.target;\n setCustomTitle(value);\n setIsTouched(true);\n }, []);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('EditAdminWhatCanDo')}

\n\n
\n \n
\n {isChannel && (\n
\n \n
\n )}\n {isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n\n {isFormFullyDisabled && (\n

\n {lang('Channel.EditAdmin.CannotEdit')}\n

\n )}\n\n {!isChannel && (\n \n )}\n\n {currentUserId !== selectedUserId && !isFormFullyDisabled && !isNewAdmin && (\n \n {lang('EditAdminRemoveAdmin')}\n \n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n {!isNewAdmin && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n const { currentUserId } = global;\n const isChannel = isChatChannel(chat);\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return {\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n defaultRights: chat.adminRights,\n };\n },\n)(ManageGroupAdminRights));\n","import React, {\n FC, memo, useCallback, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUserStatus } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { unique } from '../../../util/iteratees';\nimport { selectChat } from '../../../modules/selectors';\nimport {\n sortUserIds, isChatChannel, filterUsersByName, sortChatIds, isUserBot,\n} from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport NothingFound from '../../common/NothingFound';\nimport ListItem from '../../ui/ListItem';\nimport InputText from '../../ui/InputText';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Loading from '../../ui/Loading';\n\ntype OwnProps = {\n chatId: string;\n isActive: boolean;\n noAdmins?: boolean;\n onClose: NoneToVoidFunction;\n onScreenSelect?: (screen: ManagementScreens) => void;\n onChatMemberSelect?: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n};\n\ntype StateProps = {\n userStatusesById: Record;\n members?: ApiChatMember[];\n adminMembers?: ApiChatMember[];\n isChannel?: boolean;\n localContactIds?: string[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: string[];\n globalUserIds?: string[];\n serverTimeOffset: number;\n};\n\nconst ManageGroupMembers: FC = ({\n noAdmins,\n members,\n adminMembers,\n userStatusesById,\n isChannel,\n isActive,\n globalUserIds,\n localContactIds,\n localUserIds,\n isSearching,\n searchQuery,\n serverTimeOffset,\n onClose,\n onScreenSelect,\n onChatMemberSelect,\n}) => {\n const { openChat, setUserSearchQuery, loadContactList } = getDispatch();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const adminIds = useMemo(() => {\n return noAdmins ? adminMembers?.map(({ userId }) => userId) || [] : [];\n }, [adminMembers, noAdmins]);\n\n const memberIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n if (!members || !usersById) {\n return [];\n }\n\n const userIds = sortUserIds(\n members.map(({ userId }) => userId),\n usersById,\n userStatusesById,\n undefined,\n serverTimeOffset,\n );\n\n return noAdmins ? userIds.filter((userId) => !adminIds.includes(userId)) : userIds;\n }, [members, userStatusesById, serverTimeOffset, noAdmins, adminIds]);\n\n const displayedIds = useMemo(() => {\n // No need for expensive global updates on users, so we avoid them\n const usersById = getGlobal().users.byId;\n const chatsById = getGlobal().chats.byId;\n const shouldUseSearchResults = Boolean(searchQuery);\n const listedIds = !shouldUseSearchResults\n ? memberIds\n : (localContactIds ? filterUsersByName(localContactIds, usersById, searchQuery) : []);\n\n return sortChatIds(\n unique([\n ...listedIds,\n ...(shouldUseSearchResults ? localUserIds || [] : []),\n ...(shouldUseSearchResults ? globalUserIds || [] : []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n if (!user) {\n return true;\n }\n\n return (isChannel || user.canBeInvitedToGroup || !isUserBot(user))\n && (!noAdmins || !adminIds.includes(contactId));\n }),\n chatsById,\n true,\n );\n }, [memberIds, localContactIds, searchQuery, localUserIds, globalUserIds, isChannel, noAdmins, adminIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(loadContactList, displayedIds, Boolean(searchQuery));\n\n const handleMemberClick = useCallback((id: string) => {\n if (noAdmins) {\n onChatMemberSelect!(id, false);\n onScreenSelect!(ManagementScreens.ChatNewAdminRights);\n } else {\n openChat({ id });\n }\n }, [noAdmins, onChatMemberSelect, onScreenSelect, openChat]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n setUserSearchQuery({ query: e.target.value });\n }, [setUserSearchQuery]);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isActive, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n handleMemberClick(viewportIds[index === -1 ? 0 : index]);\n }\n }, '.ListItem-button', true);\n\n useHistoryBack(isActive, onClose);\n\n function renderSearchField() {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n {noAdmins && renderSearchField()}\n
\n
\n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n handleMemberClick(id)}\n >\n \n \n ))}\n \n ) : !isSearching && viewportIds && !viewportIds.length ? (\n \n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { statusesById: userStatusesById } = global.users;\n const members = chat?.fullInfo?.members;\n const adminMembers = chat?.fullInfo?.adminMembers;\n const isChannel = chat && isChatChannel(chat);\n const { userIds: localContactIds } = global.contactList || {};\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalUserIds,\n localUserIds,\n } = global.userSearch;\n\n return {\n members,\n adminMembers,\n userStatusesById,\n isChannel,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n globalUserIds,\n localUserIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupMembers));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser, ApiUserStatus } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\n\ntype OwnProps = {\n chatId: string;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n userStatusesById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageGroupUserPermissionsCreate: FC = ({\n usersById,\n userStatusesById,\n members,\n isChannel,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(\n members.filter((member) => !member.isOwner).map(({ userId }) => userId),\n usersById,\n userStatusesById,\n undefined,\n serverTimeOffset,\n );\n }, [members, serverTimeOffset, usersById, userStatusesById]);\n\n const handleExceptionMemberClick = useCallback((memberId: string) => {\n onChatMemberSelect(memberId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [onChatMemberSelect, onScreenSelect]);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleExceptionMemberClick(id)}\n >\n \n \n ))\n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById, statusesById: userStatusesById } = global.users;\n const members = chat?.fullInfo?.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n userStatusesById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupUserPermissionsCreate));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiExportedInvite } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_INVITES } from '../../../config';\nimport getAnimationData from '../../common/helpers/animatedAssets';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useLang from '../../../hooks/useLang';\nimport { formatCountdown, MILLISECONDS_IN_DAY } from '../../../util/dateFormat';\nimport useInterval from '../../../hooks/useInterval';\nimport useForceUpdate from '../../../hooks/useForceUpdate';\nimport { selectChat } from '../../../modules/selectors';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { getServerTime } from '../../../util/serverTime';\nimport useFlag from '../../../hooks/useFlag';\nimport { isChatChannel } from '../../../modules/helpers';\n\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\nimport Button from '../../ui/Button';\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n onScreenSelect: (screen: ManagementScreens) => void;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isChannel?: boolean;\n exportedInvites?: ApiExportedInvite[];\n revokedExportedInvites?: ApiExportedInvite[];\n serverTimeOffset: number;\n};\n\nconst BULLET = '\\u2022';\n\nfunction inviteComparator(i1: ApiExportedInvite, i2: ApiExportedInvite) {\n const { isPermanent: i1IsPermanent, usage: i1Usage = 0, date: i1Date } = i1;\n const { isPermanent: i2IsPermanent, usage: i2Usage = 0, date: i2Date } = i2;\n if (i1IsPermanent || i2IsPermanent) return Number(i1IsPermanent) - Number(i2IsPermanent);\n if (i1Usage || i2Usage) return i2Usage - i1Usage;\n return i2Date - i1Date;\n}\n\nconst ManageInvites: FC = ({\n chatId,\n chat,\n exportedInvites,\n revokedExportedInvites,\n isActive,\n isChannel,\n serverTimeOffset,\n onClose,\n onScreenSelect,\n}) => {\n const {\n setEditingExportedInvite,\n showNotification,\n editExportedChatInvite,\n deleteExportedChatInvite,\n deleteRevokedExportedChatInvites,\n setOpenedInviteInfo,\n } = getDispatch();\n\n const lang = useLang();\n\n const [isDeleteRevokeAllDialogOpen, openDeleteRevokeAllDialog, closeDeleteRevokeAllDialog] = useFlag();\n const [isRevokeDialogOpen, openRevokeDialog, closeRevokeDialog] = useFlag();\n const [revokingInvite, setRevokingInvite] = useState();\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [deletingInvite, setDeletingInvite] = useState();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('Invite').then(setAnimationData);\n }\n }, [animationData]);\n\n useHistoryBack(isActive, onClose);\n\n const hasDetailedCountdown = useMemo(() => {\n if (!exportedInvites) return undefined;\n return exportedInvites\n .some(({ expireDate }) => (\n expireDate && (expireDate - getServerTime(serverTimeOffset) < MILLISECONDS_IN_DAY / 1000)\n ));\n }, [exportedInvites, serverTimeOffset]);\n const forceUpdate = useForceUpdate();\n useInterval(() => {\n forceUpdate();\n }, hasDetailedCountdown ? 1000 : undefined);\n\n const primaryInvite = exportedInvites?.find(({ isPermanent }) => isPermanent);\n const primaryInviteLink = chat?.username ? `t.me/${chat.username}` : primaryInvite?.link;\n const temporalInvites = useMemo(() => {\n const invites = chat?.username ? exportedInvites : exportedInvites?.filter(({ isPermanent }) => !isPermanent);\n return invites?.sort(inviteComparator);\n }, [chat?.username, exportedInvites]);\n\n const editInvite = (invite: ApiExportedInvite) => {\n setEditingExportedInvite({ chatId, invite });\n onScreenSelect(ManagementScreens.EditInvite);\n };\n\n const revokeInvite = useCallback((invite: ApiExportedInvite) => {\n const {\n link, title, isRequestNeeded, expireDate, usageLimit,\n } = invite;\n editExportedChatInvite({\n chatId,\n link,\n title,\n isRequestNeeded,\n expireDate,\n usageLimit,\n isRevoked: true,\n });\n }, [chatId, editExportedChatInvite]);\n\n const askToRevoke = useCallback((invite: ApiExportedInvite) => {\n setRevokingInvite(invite);\n openRevokeDialog();\n }, [openRevokeDialog]);\n\n const handleRevoke = useCallback(() => {\n if (!revokingInvite) return;\n revokeInvite(revokingInvite);\n setRevokingInvite(undefined);\n closeRevokeDialog();\n }, [closeRevokeDialog, revokeInvite, revokingInvite]);\n\n const handleCreateNewClick = useCallback(() => {\n onScreenSelect(ManagementScreens.EditInvite);\n }, [onScreenSelect]);\n\n const handlePrimaryRevoke = useCallback(() => {\n if (primaryInvite) {\n askToRevoke(primaryInvite);\n }\n }, [askToRevoke, primaryInvite]);\n\n const handleDeleteAllRevoked = useCallback(() => {\n deleteRevokedExportedChatInvites({ chatId });\n closeDeleteRevokeAllDialog();\n }, [chatId, closeDeleteRevokeAllDialog, deleteRevokedExportedChatInvites]);\n\n const showInviteInfo = useCallback((invite: ApiExportedInvite) => {\n setOpenedInviteInfo({ chatId, invite });\n onScreenSelect(ManagementScreens.InviteInfo);\n }, [chatId, onScreenSelect, setOpenedInviteInfo]);\n\n const deleteInvite = useCallback((invite: ApiExportedInvite) => {\n deleteExportedChatInvite({ chatId, link: invite.link });\n }, [chatId, deleteExportedChatInvite]);\n\n const askToDelete = useCallback((invite: ApiExportedInvite) => {\n setDeletingInvite(invite);\n openDeleteDialog();\n }, [openDeleteDialog]);\n\n const handleDelete = useCallback(() => {\n if (!deletingInvite) return;\n deleteInvite(deletingInvite);\n setDeletingInvite(undefined);\n closeDeleteDialog();\n }, [closeDeleteDialog, deleteInvite, deletingInvite]);\n\n const copyLink = useCallback((link: string) => {\n copyTextToClipboard(link);\n showNotification({\n message: lang('LinkCopied'),\n });\n }, [lang, showNotification]);\n\n const handleCopyPrimaryClicked = useCallback(() => {\n copyLink(primaryInviteLink!);\n }, [copyLink, primaryInviteLink]);\n\n const prepareUsageText = (invite: ApiExportedInvite) => {\n const {\n usage = 0, usageLimit, expireDate, isPermanent, requested, isRevoked,\n } = invite;\n let text = '';\n if (!isRevoked && usageLimit && usage < usageLimit) {\n text = lang('CanJoin', usageLimit - usage);\n } else if (usage) {\n text = lang('PeopleJoined', usage);\n } else {\n text = lang('NoOneJoined');\n }\n\n if (isRevoked) {\n text += ` ${BULLET} ${lang('Revoked')}`;\n return text;\n }\n\n if (requested) {\n text += ` ${BULLET} ${lang('JoinRequests', requested)}`;\n }\n\n if (usageLimit !== undefined && usage === usageLimit) {\n text += ` ${BULLET} ${lang('LinkLimitReached')}`;\n } else if (expireDate) {\n const diff = (expireDate - getServerTime(serverTimeOffset)) * 1000;\n text += ` ${BULLET} `;\n if (diff > 0) {\n text += lang('InviteLink.ExpiresIn', formatCountdown(lang, diff));\n } else {\n text += lang('InviteLink.Expired');\n }\n } else if (isPermanent) {\n text += ` ${BULLET} ${lang('Permanent')}`;\n }\n\n return text;\n };\n\n const prepareContextActions = (invite: ApiExportedInvite) => {\n const actions = [];\n actions.push({\n title: lang('Copy'),\n icon: 'copy',\n handler: () => copyLink(invite.link),\n });\n\n if (!invite.isPermanent && !invite.isRevoked) {\n actions.push({\n title: lang('Edit'),\n icon: 'edit',\n handler: () => editInvite(invite),\n });\n }\n\n if (!invite.isRevoked) {\n actions.push({\n title: lang('RevokeButton'),\n icon: 'delete',\n handler: () => askToRevoke(invite),\n destructive: true,\n });\n } else {\n actions.push({\n title: lang('DeleteLink'),\n icon: 'delete',\n handler: () => askToDelete(invite),\n destructive: true,\n });\n }\n return actions;\n };\n\n const PrimaryLinkMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n

{isChannel ? lang('PrimaryLinkHelpChannel') : lang('PrimaryLinkHelp')}

\n
\n {primaryInviteLink && (\n
\n

\n {chat?.username ? lang('PublicLink') : lang('lng_create_permanent_link_title')}\n

\n
\n \n \n {lang('Copy')}\n {!chat?.username && (\n {lang('RevokeButton')}\n )}\n \n
\n \n
\n )}\n
\n \n {(!temporalInvites || !temporalInvites.length) && }\n {temporalInvites?.map((invite) => (\n showInviteInfo(invite)}\n contextActions={prepareContextActions(invite)}\n key={invite.link}\n >\n {invite.title || invite.link}\n \n {prepareUsageText(invite)}\n \n \n ))}\n

{lang('ManageLinksInfoHelp')}

\n
\n {revokedExportedInvites && Boolean(revokedExportedInvites.length) && (\n
\n

{lang('RevokedLinks')}

\n \n {lang('DeleteAllRevokedLinks')}\n \n {revokedExportedInvites?.map((invite) => (\n showInviteInfo(invite)}\n contextActions={prepareContextActions(invite)}\n key={invite.link}\n >\n {invite.title || invite.link}\n \n {prepareUsageText(invite)}\n \n \n ))}\n
\n )}\n
\n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { invites, revokedInvites } = global.management.byChatId[chatId];\n const chat = selectChat(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n\n return {\n exportedInvites: invites,\n revokedExportedInvites: revokedInvites,\n chat,\n serverTimeOffset: global.serverTimeOffset,\n isChannel,\n };\n },\n)(ManageInvites));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiExportedInvite } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useLang from '../../../hooks/useLang';\nimport { formatFullDate, formatTime } from '../../../util/dateFormat';\nimport useFlag from '../../../hooks/useFlag';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport Checkbox from '../../ui/Checkbox';\nimport InputText from '../../ui/InputText';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Button from '../../ui/Button';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport useOnChange from '../../../hooks/useOnChange';\nimport CalendarModal from '../../common/CalendarModal';\n\nconst DEFAULT_USAGE_LIMITS = [1, 10, 100];\nconst DEFAULT_EXPIRE_DATE = {\n hour: 3600000,\n day: 86400000,\n week: 604800000,\n};\nconst DEFAULT_CUSTOM_EXPIRE_DATE = DEFAULT_EXPIRE_DATE.hour;\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n onScreenSelect: (screen: ManagementScreens) => void;\n isActive: boolean;\n};\n\ntype StateProps = {\n editingInvite?: ApiExportedInvite;\n serverTimeOffset: number;\n};\n\nconst ManageInvite: FC = ({\n chatId,\n editingInvite,\n isActive,\n serverTimeOffset,\n onClose,\n onScreenSelect,\n}) => {\n const { editExportedChatInvite, exportChatInvite } = getDispatch();\n\n const lang = useLang();\n const [isCalendarOpened, openCalendar, closeCalendar] = useFlag();\n const [isRequestNeeded, setIsRequestNeeded] = useState(false);\n const [title, setTitle] = useState('');\n const [customExpireDate, setCustomExpireDate] = useState(Date.now() + DEFAULT_CUSTOM_EXPIRE_DATE);\n const [selectedExpireOption, setSelectedExpireOption] = useState('unlimited');\n const [customUsageLimit, setCustomUsageLimit] = useState(10);\n const [selectedUsageOption, setSelectedUsageOption] = useState('0');\n const [isSubmitBlocked, setIsSubmitBlocked] = useState(false);\n\n useHistoryBack(isActive, onClose);\n\n useOnChange(([oldEditingInvite]) => {\n if (oldEditingInvite === editingInvite) return;\n if (!editingInvite) {\n setTitle('');\n setSelectedExpireOption('unlimited');\n setSelectedUsageOption('0');\n setCustomExpireDate(getServerTime(serverTimeOffset) * 1000 + DEFAULT_CUSTOM_EXPIRE_DATE);\n setCustomUsageLimit(10);\n setIsRequestNeeded(false);\n } else {\n const {\n title: editingTitle, usageLimit, expireDate, isRequestNeeded: editingIsRequestNeeded,\n } = editingInvite;\n if (editingTitle) setTitle(editingTitle);\n if (usageLimit) {\n setSelectedUsageOption(DEFAULT_USAGE_LIMITS.includes(usageLimit) ? usageLimit.toString() : 'custom');\n setCustomUsageLimit(usageLimit);\n }\n if (expireDate) {\n const minSafeDate = getServerTime(serverTimeOffset) + DEFAULT_CUSTOM_EXPIRE_DATE;\n setSelectedExpireOption('custom');\n setCustomExpireDate(Math.max(expireDate, minSafeDate) * 1000);\n }\n if (editingIsRequestNeeded) {\n setIsRequestNeeded(true);\n }\n }\n }, [editingInvite, serverTimeOffset]);\n\n const handleIsRequestChange = useCallback((e: ChangeEvent) => {\n setIsRequestNeeded(e.target.checked);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n }, []);\n\n const handleCustomUsageLimitChange = useCallback((e: ChangeEvent) => {\n setCustomUsageLimit(Number.parseInt(e.target.value, 10));\n }, []);\n\n const handleExpireDateChange = useCallback((date: Date) => {\n setCustomExpireDate(date.getTime());\n closeCalendar();\n }, [closeCalendar]);\n\n const handleSaveClick = useCallback(() => {\n setIsSubmitBlocked(true);\n const usageLimit = selectedUsageOption === 'custom' ? customUsageLimit : selectedUsageOption;\n let expireDate;\n switch (selectedExpireOption) {\n case 'custom':\n expireDate = getServerTime(serverTimeOffset) + (customExpireDate - Date.now()) / 1000;\n break;\n case 'hour':\n case 'day':\n case 'week':\n expireDate = getServerTime(serverTimeOffset) + DEFAULT_EXPIRE_DATE[selectedExpireOption] / 1000;\n break;\n case 'unlimited':\n default:\n expireDate = undefined;\n }\n\n if (editingInvite) {\n editExportedChatInvite({\n link: editingInvite.link,\n chatId,\n title,\n isRequestNeeded,\n expireDate,\n usageLimit,\n });\n } else {\n exportChatInvite({\n chatId,\n title,\n isRequestNeeded,\n expireDate,\n usageLimit,\n });\n }\n onScreenSelect(ManagementScreens.Invites);\n }, [\n chatId, customExpireDate, customUsageLimit, editExportedChatInvite, editingInvite,\n exportChatInvite, isRequestNeeded, selectedExpireOption, selectedUsageOption, title, onScreenSelect,\n serverTimeOffset,\n ]);\n\n return (\n
\n
\n
\n \n
\n
\n \n

{lang('LinkNameHelp')}

\n
\n
\n
{lang('LimitByPeriod')}
\n \n {selectedExpireOption === 'custom' && (\n \n )}\n

{lang('TimeLimitHelp')}

\n
\n {!isRequestNeeded && (\n
\n
{lang('LimitNumberOfUses')}
\n ({ value: n.toString(), label: n })),\n {\n value: '0',\n label: lang('NoLimit'),\n },\n {\n value: 'custom',\n label: lang('lng_group_invite_usage_custom'),\n },\n ]}\n onChange={setSelectedUsageOption}\n selected={selectedUsageOption}\n />\n {selectedUsageOption === 'custom' && (\n \n )}\n

{lang('UsesLimitHelp')}

\n
\n )}\n \n \n \n
\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { editingInvite } = global.management.byChatId[chatId];\n\n return {\n editingInvite,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageInvite));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiAvailableReaction, ApiChat } from '../../../api/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ReactionStaticEmoji from '../../common/ReactionStaticEmoji';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n availableReactions?: ApiAvailableReaction[];\n enabledReactions?: string[];\n};\n\nconst ManageReactions: FC = ({\n availableReactions,\n enabledReactions,\n chat,\n isActive,\n onClose,\n}) => {\n const { setChatEnabledReactions } = getDispatch();\n\n const lang = useLang();\n const [isTouched, setIsTouched] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [localEnabledReactions, setLocalEnabledReactions] = useState(enabledReactions || []);\n\n useHistoryBack(isActive, onClose);\n\n const handleSaveReactions = useCallback(() => {\n if (!chat) return;\n setIsLoading(true);\n\n setChatEnabledReactions({\n chatId: chat.id,\n enabledReactions: localEnabledReactions,\n });\n }, [chat, localEnabledReactions, setChatEnabledReactions]);\n\n useEffect(() => {\n if (enabledReactions) {\n setIsLoading(false);\n setIsTouched(false);\n setLocalEnabledReactions(enabledReactions);\n }\n }, [enabledReactions]);\n\n const handleReactionChange = useCallback((e: React.ChangeEvent) => {\n if (!chat || !availableReactions) return;\n\n const { name, checked } = e.currentTarget;\n const newEnabledReactions = name === 'all' ? (checked ? availableReactions.map((l) => l.reaction) : [])\n : (!checked\n ? localEnabledReactions.filter((l) => l !== name)\n : [...localEnabledReactions, name]);\n\n setLocalEnabledReactions(newEnabledReactions);\n setIsTouched(true);\n }, [availableReactions, chat, localEnabledReactions]);\n\n return (\n
\n
\n
\n
\n 0}\n label={lang('EnableReactions')}\n onChange={handleReactionChange}\n />\n
\n {availableReactions?.filter((l) => !l.isInactive).map(({ reaction, title }) => (\n
\n \n \n {title}\n
\n )}\n onChange={handleReactionChange}\n />\n
\n ))}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n\n return {\n enabledReactions: chat.fullInfo?.enabledReactions,\n availableReactions: global.availableReactions,\n chat,\n };\n },\n)(ManageReactions));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../../api/types';\n\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport useLang from '../../../hooks/useLang';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { getServerTime } from '../../../util/serverTime';\nimport { formatFullDate, formatMediaDateTime, formatTime } from '../../../util/dateFormat';\nimport { isChatChannel } from '../../../modules/helpers';\nimport { selectChat } from '../../../modules/selectors';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Button from '../../ui/Button';\nimport Spinner from '../../ui/Spinner';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n invite?: ApiExportedInvite;\n importers?: ApiChatInviteImporter[];\n requesters?: ApiChatInviteImporter[];\n admin?: ApiUser;\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageInviteInfo: FC = ({\n chatId,\n invite,\n importers,\n requesters,\n isChannel,\n isActive,\n serverTimeOffset,\n onClose,\n}) => {\n const {\n showNotification,\n loadChatInviteImporters,\n loadChatInviteRequesters,\n openChat,\n } = getDispatch();\n\n const lang = useLang();\n const {\n usage = 0, usageLimit, link, adminId,\n } = invite || {};\n const expireDate = invite?.expireDate && (invite.expireDate - getServerTime(serverTimeOffset)) * 1000 + Date.now();\n const isExpired = ((invite?.expireDate || 0) - getServerTime(serverTimeOffset)) < 0;\n\n useEffect(() => {\n if (link) {\n loadChatInviteImporters({ chatId, link });\n loadChatInviteRequesters({ chatId, link });\n }\n }, [chatId, link, loadChatInviteImporters, loadChatInviteRequesters]);\n\n const handleCopyClicked = useCallback(() => {\n copyTextToClipboard(invite!.link);\n showNotification({\n message: lang('LinkCopied'),\n });\n }, [invite, lang, showNotification]);\n\n useHistoryBack(isActive, onClose);\n\n const renderImporters = () => {\n if (!importers?.length && requesters?.length) return undefined;\n if (!importers) return ;\n return (\n
\n

{importers.length ? lang('PeopleJoined', usage) : lang('NoOneJoined')}

\n

\n {!importers.length && (\n usageLimit ? lang('PeopleCanJoinViaLinkCount', usageLimit - usage) : lang('NoOneJoinedYet')\n )}\n {importers.map((importer) => (\n openChat({ id: importer.userId })}\n >\n \n \n ))}\n

\n
\n );\n };\n\n const renderRequesters = () => {\n if (invite?.isRevoked) return undefined;\n if (!requesters && importers) return ;\n if (!requesters?.length) return undefined;\n return (\n
\n

{isChannel ? lang('SubscribeRequests') : lang('MemberRequests')}

\n

\n {requesters.map((requester) => (\n openChat({ id: requester.userId })}\n >\n \n \n ))}\n

\n
\n );\n };\n\n return (\n
\n
\n {!invite && (\n

{lang('Loading')}

\n )}\n {invite && (\n <>\n
\n

{invite.title || invite.link}

\n \n \n {expireDate && (\n

\n {isExpired\n ? lang('ExpiredLink')\n : lang('LinkExpiresIn', `${formatFullDate(lang, expireDate)} ${formatTime(lang, expireDate)}`)}\n

\n )}\n
\n {adminId && (\n
\n

{lang('LinkCreatedeBy')}

\n openChat({ id: adminId })}\n >\n \n \n
\n )}\n {renderImporters()}\n {renderRequesters()}\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { inviteInfo } = global.management.byChatId[chatId];\n const { invite, importers, requesters } = inviteInfo || {};\n const chat = selectChat(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n\n return {\n invite,\n importers,\n requesters,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageInviteInfo));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { selectUser } from '../../../modules/selectors';\nimport { formatHumanDate, formatTime, isToday } from '../../../util/dateFormat';\nimport { getServerTime } from '../../../util/serverTime';\nimport { createClassNameBuilder } from '../../../util/buildClassName';\n\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\n\nimport './JoinRequest.scss';\n\ntype OwnProps = {\n userId: string;\n about?: string;\n isChannel?: boolean;\n date: number;\n chatId: string;\n};\n\ntype StateProps = {\n user?: ApiUser;\n isSavedMessages?: boolean;\n serverTimeOffset: number;\n};\n\nconst JoinRequest: FC = ({\n userId,\n about,\n date,\n isChannel,\n user,\n serverTimeOffset,\n chatId,\n}) => {\n const { openChat, hideChatJoinRequest } = getDispatch();\n\n const buildClassName = createClassNameBuilder('JoinRequest');\n const lang = useLang();\n\n const fullName = getUserFullName(user);\n const fixedDate = (date - getServerTime(serverTimeOffset)) * 1000 + Date.now();\n\n const dateString = isToday(new Date(fixedDate))\n ? formatTime(lang, fixedDate) : formatHumanDate(lang, fixedDate, true, false, true);\n\n const handleUserClick = () => {\n openChat({ id: userId });\n };\n\n const handleAcceptRequest = useCallback(() => {\n hideChatJoinRequest({ chatId, userId, isApproved: true });\n }, [chatId, hideChatJoinRequest, userId]);\n\n const handleRejectRequest = useCallback(() => {\n hideChatJoinRequest({ chatId, userId, isApproved: false });\n }, [chatId, hideChatJoinRequest, userId]);\n\n return (\n
\n
\n
\n \n
\n
{fullName}
\n
{about}
\n
\n
\n
{dateString}
\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const user = selectUser(global, userId);\n\n return {\n user,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(JoinRequest));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { STICKER_SIZE_JOIN_REQUESTS } from '../../../config';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport { selectChat } from '../../../modules/selectors';\nimport { isChatChannel, isUserId } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport getAnimationData from '../../common/helpers/animatedAssets';\n\nimport JoinRequest from './JoinRequest';\nimport Button from '../../ui/Button';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport Spinner from '../../ui/Spinner';\n\ntype OwnProps = {\n chatId: string;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageJoinRequests: FC = ({\n chat,\n chatId,\n isActive,\n isChannel,\n onClose,\n}) => {\n const { hideAllChatJoinRequests, loadChatJoinRequests } = getDispatch();\n const [isAcceptAllDialogOpen, openAcceptAllDialog, closeAcceptAllDialog] = useFlag();\n const [isRejectAllDialogOpen, openRejectAllDialog, closeRejectAllDialog] = useFlag();\n\n const lang = useLang();\n\n const [animationData, setAnimationData] = useState();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('JoinRequest').then(setAnimationData);\n }\n }, [animationData]);\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (!chat?.joinRequests && !isUserId(chatId)) {\n loadChatJoinRequests({ chatId });\n }\n }, [chat, chatId, loadChatJoinRequests]);\n\n const handleAcceptAllRequests = useCallback(() => {\n hideAllChatJoinRequests({ chatId, isApproved: true });\n closeAcceptAllDialog();\n }, [hideAllChatJoinRequests, chatId, closeAcceptAllDialog]);\n\n const handleRejectAllRequests = useCallback(() => {\n hideAllChatJoinRequests({ chatId, isApproved: false });\n closeRejectAllDialog();\n }, [hideAllChatJoinRequests, chatId, closeRejectAllDialog]);\n\n return (\n
\n
\n
\n {animationData && (\n \n )}\n
\n {Boolean(chat?.joinRequests?.length) && (\n
\n \n \n
\n )}\n
\n
\n
\n

\n {!chat?.joinRequests ? lang('Loading') : chat.joinRequests.length\n ? lang('JoinRequests', chat.joinRequests.length) : lang('NoMemberRequests')}\n

\n {!chat?.joinRequests && (\n \n )}\n {chat?.joinRequests?.length === 0 && (\n

\n {isChannel ? lang('NoSubscribeRequestsDescription') : lang('NoMemberRequestsDescription')}\n

\n )}\n {chat?.joinRequests?.map(({ userId, about, date }) => (\n \n ))}\n
\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return {\n chat,\n serverTimeOffset: global.serverTimeOffset,\n isChannel: chat && isChatChannel(chat),\n };\n },\n)(ManageJoinRequests));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementType } from '../../../types';\n\nimport { selectCurrentManagementType } from '../../../modules/selectors';\n\nimport ManageUser from './ManageUser';\nimport ManageGroup from './ManageGroup';\nimport ManageGroupPermissions from './ManageGroupPermissions';\nimport ManageChatRemovedUsers from './ManageChatRemovedUsers';\nimport ManageChannel from './ManageChannel';\nimport ManageChatPrivacyType from './ManageChatPrivacyType';\nimport ManageDiscussion from './ManageDiscussion';\nimport ManageGroupUserPermissions from './ManageGroupUserPermissions';\nimport ManageChatAdministrators from './ManageChatAdministrators';\nimport ManageGroupRecentActions from './ManageGroupRecentActions';\nimport ManageGroupAdminRights from './ManageGroupAdminRights';\nimport ManageGroupMembers from './ManageGroupMembers';\nimport ManageGroupUserPermissionsCreate from './ManageGroupUserPermissionsCreate';\nimport ManageInvites from './ManageInvites';\nimport ManageInvite from './ManageInvite';\nimport ManageReactions from './ManageReactions';\nimport ManageInviteInfo from './ManageInviteInfo';\nimport ManageJoinRequests from './ManageJoinRequests';\n\nexport type OwnProps = {\n chatId: string;\n currentScreen: ManagementScreens;\n selectedChatMemberId?: string;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: string, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n managementType?: ManagementType;\n};\n\nconst Management: FC = ({\n chatId,\n currentScreen,\n selectedChatMemberId,\n isPromotedByCurrentUser,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n managementType,\n}) => {\n switch (currentScreen) {\n case ManagementScreens.Initial: {\n switch (managementType) {\n case 'user':\n return (\n \n );\n case 'group':\n return (\n \n );\n case 'channel':\n return (\n \n );\n }\n\n break;\n }\n\n case ManagementScreens.ChatPrivacyType:\n return (\n \n );\n\n case ManagementScreens.Discussion:\n return (\n \n );\n\n case ManagementScreens.GroupPermissions:\n return (\n \n );\n\n case ManagementScreens.ChannelRemovedUsers:\n case ManagementScreens.GroupRemovedUsers:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissionsCreate:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissions:\n return (\n \n );\n\n case ManagementScreens.ChatAdministrators:\n return (\n \n );\n\n case ManagementScreens.GroupRecentActions:\n return (\n \n );\n\n case ManagementScreens.ChatNewAdminRights:\n case ManagementScreens.ChatAdminRights:\n return (\n \n );\n\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n return (\n \n );\n case ManagementScreens.Invites:\n return (\n \n );\n case ManagementScreens.EditInvite:\n return (\n \n );\n case ManagementScreens.GroupAddAdmins:\n return (\n \n );\n\n case ManagementScreens.Reactions:\n return (\n \n );\n case ManagementScreens.InviteInfo:\n return (\n \n );\n case ManagementScreens.JoinRequests:\n return (\n \n );\n }\n\n return undefined; // Never reached\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const managementType = selectCurrentManagementType(global);\n\n return {\n managementType,\n };\n },\n)(Management));\n","const VISA = /^4[0-9]{12}(?:[0-9]{1,3})?$/;\nconst MASTERCARD1 = /^5[1-5][0-9]{11,14}$/;\nconst MASTERCARD2 = /^2[2-7][0-9]{11,14}$/;\n\nexport enum CardType {\n Default,\n Visa,\n Mastercard,\n}\n\nconst cards: Record = {\n [CardType.Default]: '',\n [CardType.Visa]: 'visa',\n [CardType.Mastercard]: 'mastercard',\n};\n\nexport function detectCardType(cardNumber: string): number {\n cardNumber = cardNumber.replace(/\\s/g, '');\n if (VISA.test(cardNumber)) {\n return CardType.Visa;\n }\n if (MASTERCARD1.test(cardNumber) || MASTERCARD2.test(cardNumber)) {\n return CardType.Mastercard;\n }\n return CardType.Default;\n}\n\nexport function detectCardTypeText(cardNumber: string): string {\n const cardType = detectCardType(cardNumber);\n return cards[cardType as number] || '';\n}\n","// This data was received from Telegram Desktop (Telegram/Resources/numbers.txt)\nconst DATA = `AF🇦🇫93Afghanistan333\nAO🇦🇴244Angola333\nAL🇦🇱355Albania234\nAD🇦🇩376Andorra222\nAE🇦🇪971United Arab Emirates234\nAI🇦🇮1264Anguilla34\nAR🇦🇷54Argentina\nAM🇦🇲374Armenia233\nAG🇦🇬1268Antigua and Barbuda34\nAU🇦🇺61Australia333\nAS🇦🇸1684American Samoa34\nAT🇦🇹43Austria\nAW🇦🇼297Aruba34\nAZ🇦🇿994Azerbaijan2322\nBI🇧🇮257Burundi224\nBE🇧🇪32Belgium3222\nBJ🇧🇯229Benin233\nBF🇧🇫226Burkina Faso2222\nBD🇧🇩880Bangladesh\nBG🇧🇬359Bulgaria\nBH🇧🇭973Bahrain44\nBS🇧🇸1242Bahamas34\nBA🇧🇦387Bosnia and Herzegovina\nBY🇧🇾375Belarus2322\nBZ🇧🇿501Belize\nBO🇧🇴591Bolivia134\nBR🇧🇷55Brazil254\nBB🇧🇧1246Barbados34\nBM🇧🇲1441Bermuda34\nBN🇧🇳673Brunei34\nBQ🇧🇶599Bonaire, Sint Eustatius and Saba\nBT🇧🇹975Bhutan\nBW🇧🇼267Botswana233\nCF🇨🇫236Central African Republic2222\nCA🇨🇦1Canada334\nCH🇨🇭41Switzerland234\nCK🇨🇰682Cook Islands\nCL🇨🇱56Chile144\nCN🇨🇳86China344\nCI🇨🇮225Côte d\\`Ivoire233\nCM🇨🇲237Cameroon44\nCD🇨🇩243DR Congo234\nCG🇨🇬242Republic of the Congo234\nCO🇨🇴57Colombia334\nKM🇰🇲269Comoros34\nCV🇨🇻238Cape Verde34\nCR🇨🇷506Costa Rica\nCU🇨🇺53Cuba44\nCY🇨🇾357Cyprus44\nCW🇨🇼599Curaçao\nCZ🇨🇿420Czech Republic\nDE🇩🇪49Germany38\nDJ🇩🇯253Djibouti2222\nDM🇩🇲1767Dominica34\nDK🇩🇰45Denmark44\nDO🇩🇴1Dominican Republic334\nDZ🇩🇿213Algeria3222\nEC🇪🇨593Ecuador\nEG🇪🇬20Egypt234\nER🇪🇷291Eritrea133\nES🇪🇸34Spain333\nEE🇪🇪372Estonia\nET🇪🇹251Ethiopia234\nFI🇫🇮358Finland\nFJ🇫🇯679Fiji\nFK🇫🇰500Falkland Islands\nFM🇫🇲691Micronesia\nFO🇫🇴298Faroe Islands33\nFR🇫🇷33France12222\nGA🇬🇦241Gabon1222\nGB🇬🇧44United Kingdom46\nGE🇬🇪995Georgia\nGF🇬🇫594French Guiana\nGH🇬🇭233Ghana\nGI🇬🇮350Gibraltar44\nGL🇬🇱299Greenland33\nGN🇬🇳224Guinea333\nGM🇬🇲220Gambia34\nGP🇬🇵590Guadeloupe\nGU🇬🇺1671Guam34\nGW🇬🇼245Guinea-Bissau34\nGQ🇬🇶240Equatorial Guinea333\nGR🇬🇷30Greece244\nGD🇬🇩1473Grenada34\nGT🇬🇹502Guatemala134\nGY🇬🇾592Guyana\nHK🇭🇰852Hong Kong\nHN🇭🇳504Honduras44\nHR🇭🇷385Croatia\nHT🇭🇹509Haiti\nHU🇭🇺36Hungary234\nID🇮🇩62Indonesia\nIN🇮🇳91India55\nIO🇩🇬246Diego Garcia34\nIE🇮🇪353Ireland234\nIR🇮🇷98Iran334\nIQ🇮🇶964Iraq334\nIS🇮🇸354Iceland34\nIL🇮🇱972Israel234\nIT🇮🇹39Italy334\nJM🇯🇲1876Jamaica34\nJO🇯🇴962Jordan144\nJP🇯🇵81Japan244\nKZ🇰🇿7Kazakhstan3322\nKE🇰🇪254Kenya333\nKG🇰🇬996Kyrgyzstan\nKH🇰🇭855Cambodia\nKI🇰🇮686Kiribati\nKN🇰🇳1869Saint Kitts and Nevis34\nKR🇰🇷82South Korea\nKW🇰🇼965Kuwait44\nKY🇰🇾1345Cayman Islands34\nLA🇱🇦856Laos\nLB🇱🇧961Lebanon\nLR🇱🇷231Liberia\nLY🇱🇾218Libya234\nLC🇱🇨1758Saint Lucia34\nLI🇱🇮423Liechtenstein\nLK🇱🇰94Sri Lanka234\nLS🇱🇸266Lesotho233\nLT🇱🇹370Lithuania35\nLU🇱🇺352Luxembourg\nLV🇱🇻371Latvia35\nMA🇲🇦212Morocco234\nMC🇲🇨377Monaco44\nMD🇲🇩373Moldova233\nMG🇲🇬261Madagascar2232\nMP🇲🇵1670Northern Mariana Islands34\nMO🇲🇴853Macau\nMS🇲🇸1664Montserrat34\nMV🇲🇻960Maldives\nMX🇲🇽52Mexico\nMH🇲🇭692Marshall Islands\nMK🇲🇰389Macedonia\nML🇲🇱223Mali44\nMT🇲🇹356Malta2222\nMM🇲🇲95Myanmar\nME🇲🇪382Montenegro\nMN🇲🇳976Mongolia\nMZ🇲🇿258Mozambique234\nMQ🇲🇶596Martinique\nMR🇲🇷222Mauritania44\nMU🇲🇺230Mauritius\nMW🇲🇼265Malawi\nMY🇲🇾60Malaysia\nNA🇳🇦264Namibia234\nNC🇳🇨687New Caledonia6\nNE🇳🇪227Niger2222\nNF🇳🇫672Norfolk Island\nNG🇳🇬234Nigeria\nNI🇳🇮505Nicaragua44\nNL🇳🇱31Netherlands12222\nNO🇳🇴47Norway44\nNP🇳🇵977Nepal\nNU🇳🇺683Niue\nNR🇳🇷674Nauru\nNZ🇳🇿64New Zealand\nOM🇴🇲968Oman44\nPK🇵🇰92Pakistan334\nPA🇵🇦507Panama44\nPE🇵🇪51Peru333\nPF🇵🇫689French Polynesia\nPH🇵🇭63Philippines334\nPM🇵🇲508Saint Pierre and Miquelon\nPR🇵🇷1Puerto Rico334\nPS🇵🇸970Palestine324\nPW🇵🇼680Palau\nPG🇵🇬675Papua New Guinea\nPL🇵🇱48Poland333\nKP🇰🇵850North Korea\nPT🇵🇹351Portugal144\nPY🇵🇾595Paraguay333\nQA🇶🇦974Qatar\nRE🇷🇪262Réunion333\nRO🇷🇴40Romania333\nRU🇷🇺7Russia3322\nRW🇷🇼250Rwanda333\nSA🇸🇦966Saudi Arabia\nSD🇸🇩249Sudan234\nSN🇸🇳221Senegal234\nSG🇸🇬65Singapore44\nSH🇸🇭290Saint Helena23\nSH🇸🇭247Saint Helena4\nSB🇸🇧677Solomon Islands\nSL🇸🇱232Sierra Leone233\nSV🇸🇻503El Salvador44\nSM🇸🇲378San Marino334\nSO🇸🇴252Somalia233\nRS🇷🇸381Serbia234\nSS🇸🇸211South Sudan234\nST🇸🇹239São Tomé and Príncipe25\nSR🇸🇷597Suriname34\nSK🇸🇰421Slovakia\nSI🇸🇮386Slovenia\nSE🇸🇪46Sweden234\nSZ🇸🇿268Swaziland44\nSC🇸🇨248Seychelles1222\nSX🇸🇽1721Sint Maarten34\nSY🇸🇾963Syria\nTC🇹🇨1649Turks and Caicos Islands34\nTD🇹🇩235Chad2222\nTG🇹🇬228Togo233\nTH🇹🇭66Thailand144\nTJ🇹🇯992Tajikistan\nTK🇹🇰690Tokelau\nTM🇹🇲993Turkmenistan26\nTL🇹🇱670Timor-Leste\nTO🇹🇴676Tonga\nTT🇹🇹1868Trinidad and Tobago34\nTN🇹🇳216Tunisia233\nTR🇹🇷90Turkey334\nTV🇹🇻688Tuvalu\nTW🇹🇼886Taiwan\nTZ🇹🇿255Tanzania234\nUG🇺🇬256Uganda234\nUA🇺🇦380Ukraine2322\nUY🇺🇾598Uruguay44\nUS🇺🇸1United States334\nUZ🇺🇿998Uzbekistan27\nVA🇻🇦3Vatican City\nVC🇻🇨1784Saint Vincent and the Grenadines34\nVE🇻🇪58Venezuela334\nVG🇻🇬1284British Virgin Islands34\nVI🇻🇮1340US Virgin Islands34\nVN🇻🇳84Vietnam\nVU🇻🇺678Vanuatu\nWF🇼🇫681Wallis and Futuna\nWS🇼🇸685Samoa\nXK🇽🇰383Kosovo44\nYE🇾🇪967Yemen333\nZA🇿🇦27South Africa234\nZM🇿🇲260Zambia234\nZW🇿🇼263Zimbabwe234`;\n\nconst formatsCache: Record = {};\nexport const defaultPhoneNumberFormat = /(\\d{1,3})(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?/;\n\nconst parsed = DATA\n .split('\\n')\n .map((str) => {\n const id = str.substr(0, 2);\n const flag = str.substr(2, 4);\n const code = `+${str.match(/\\d+/)![0]}`;\n const name = str.split(/\\d+/)[1];\n const format = str.match(/\\d+$/);\n const phoneFormat = getPhoneNumberFormat(format);\n\n return {\n id, flag, code, name, phoneFormat,\n };\n });\n\nfunction getPhoneNumberFormat(format: RegExpMatchArray | null) {\n if (!format) {\n return defaultPhoneNumberFormat;\n }\n\n const formatValue = format[0] as string;\n let phoneNumberFormat;\n\n if (!formatsCache[formatValue]) {\n const phoneNumberGroups = formatValue.split('').map(Number);\n phoneNumberFormat = phoneNumberGroups.reduce((result, count, i) => {\n return `${result}(\\\\d{1,${count}})${i > 0 ? '?' : ''}`;\n }, '');\n formatsCache[formatValue] = new RegExp(`${phoneNumberFormat}${'()?'.repeat(5 - phoneNumberGroups.length)}`);\n }\n\n return formatsCache[formatValue];\n}\n\nexport default parsed;\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport countryList from '../../util/countries';\n\nexport type FormState = {\n streetLine1: string;\n streetLine2: string;\n city: string;\n state: string;\n countryIso2: string;\n postCode: string;\n fullName: string;\n email: string;\n phone: string;\n shipping: string;\n cardNumber: string;\n cardholder: string;\n expiry: string;\n cvv: string;\n billingCountry: string;\n billingZip: string;\n saveInfo: boolean;\n saveCredentials: boolean;\n formErrors: Record;\n};\n\nexport type FormActions = (\n 'changeAddress1' | 'changeAddress2' | 'changeCity' | 'changeState' | 'changeCountry' |\n 'changePostCode' | 'changeFullName' | 'changeEmail' | 'changePhone' | 'changeShipping' | 'updateUserInfo' |\n 'changeCardNumber' | 'changeCardholder' | 'changeExpiryDate' | 'changeCvvCode' | 'changeBillingCountry' |\n 'changeBillingZip' | 'changeSaveInfo' | 'changeSaveCredentials' | 'setFormErrors'\n);\nexport type FormEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FormState = {\n streetLine1: '',\n streetLine2: '',\n city: '',\n state: '',\n countryIso2: '',\n postCode: '',\n fullName: '',\n email: '',\n phone: '',\n shipping: '',\n cardNumber: '',\n cardholder: '',\n expiry: '',\n cvv: '',\n billingCountry: '',\n billingZip: '',\n saveInfo: true,\n saveCredentials: false,\n formErrors: {},\n};\n\nconst reducer: StateReducer = (state, action) => {\n switch (action.type) {\n case 'changeAddress1':\n return {\n ...state,\n streetLine1: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine1: undefined,\n },\n };\n case 'changeAddress2':\n return {\n ...state,\n streetLine2: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine2: undefined,\n },\n };\n case 'changeCity':\n return {\n ...state,\n city: action.payload,\n formErrors: {\n ...state.formErrors,\n city: undefined,\n },\n };\n case 'changeState':\n return {\n ...state,\n state: action.payload,\n formErrors: {\n ...state.formErrors,\n state: undefined,\n },\n };\n case 'changeCountry':\n return {\n ...state,\n countryIso2: action.payload,\n billingCountry: getBillingCountry(action.payload),\n formErrors: {\n ...state.formErrors,\n countryIso2: undefined,\n },\n };\n case 'changePostCode':\n return {\n ...state,\n postCode: action.payload,\n formErrors: {\n ...state.formErrors,\n postCode: undefined,\n },\n };\n case 'changeFullName':\n return {\n ...state,\n fullName: action.payload,\n formErrors: {\n ...state.formErrors,\n fullName: undefined,\n },\n };\n case 'changeEmail':\n return {\n ...state,\n email: action.payload,\n formErrors: {\n ...state.formErrors,\n email: undefined,\n },\n };\n case 'changePhone':\n return {\n ...state,\n phone: action.payload,\n formErrors: {\n ...state.formErrors,\n phone: undefined,\n },\n };\n case 'changeShipping':\n return { ...state, shipping: action.payload };\n case 'changeCardNumber':\n return {\n ...state,\n cardNumber: action.payload,\n formErrors: {\n ...state.formErrors,\n cardNumber: undefined,\n },\n };\n case 'changeCardholder':\n return {\n ...state,\n cardholder: action.payload,\n formErrors: {\n ...state.formErrors,\n cardholder: undefined,\n },\n };\n case 'changeExpiryDate':\n return {\n ...state,\n expiry: action.payload,\n formErrors: {\n ...state.formErrors,\n expiry: undefined,\n },\n };\n case 'changeCvvCode':\n return {\n ...state,\n cvv: action.payload,\n formErrors: {\n ...state.formErrors,\n cvv: undefined,\n },\n };\n case 'changeBillingCountry':\n return {\n ...state,\n billingCountry: action.payload,\n formErrors: {\n ...state.formErrors,\n billingCountry: undefined,\n },\n };\n case 'changeBillingZip':\n return {\n ...state,\n billingZip: action.payload,\n formErrors: {\n ...state.formErrors,\n billingZip: undefined,\n },\n };\n case 'changeSaveInfo':\n return { ...state, saveInfo: action.payload };\n case 'changeSaveCredentials':\n return { ...state, saveCredentials: action.payload };\n case 'updateUserInfo':\n if (action.payload.countryIso2) {\n return {\n ...state,\n ...action.payload,\n billingCountry: getBillingCountry(action.payload.countryIso2),\n };\n }\n return { ...state, ...action.payload };\n case 'setFormErrors':\n return {\n ...state,\n formErrors: {\n ...state.formErrors,\n ...action.payload,\n },\n };\n default:\n return state;\n }\n};\n\nfunction getBillingCountry(countryCode: string) {\n const country = countryList.find(({ id }) => id === countryCode);\n return country ? country.name : '';\n}\n\nconst usePaymentReducer = () => {\n return useReducer(reducer, INITIAL_STATE);\n};\n\nexport default usePaymentReducer;\n","import { RefObject } from 'react';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\nimport { fastRaf } from '../util/schedulers';\nimport { useEffect } from '../lib/teact/teact';\n\nconst DEFAULT_DURATION = 400;\n\nexport default function useFocusAfterAnimation(\n ref: RefObject, animationDuration = DEFAULT_DURATION,\n) {\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n if (ref.current) {\n ref.current.focus();\n }\n });\n }, animationDuration);\n }, [ref, animationDuration]);\n}\n","import { ChangeEvent, RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n id?: string;\n value?: string;\n label?: string;\n error?: string;\n ref?: RefObject;\n hasArrow?: boolean;\n placeholder?: string;\n onChange?: (e: ChangeEvent) => void;\n children: React.ReactNode;\n};\n\nconst Select: FC = (props) => {\n const {\n id,\n value,\n label,\n hasArrow,\n error,\n ref,\n placeholder,\n onChange,\n children,\n } = props;\n const labelText = error || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error && 'error',\n labelText && 'with-label',\n hasArrow && 'with-arrow',\n 'input-group',\n );\n\n return (\n
\n \n {children}\n \n {labelText && id && (\n \n )}\n
\n );\n};\n\nexport default memo(Select);\n","import React, {\n FC, useRef, useCallback, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport useLang from '../../hooks/useLang';\nimport countryList from '../../util/countries';\n\nimport InputText from '../ui/InputText';\nimport Select from '../ui/Select';\nimport Checkbox from '../ui/Checkbox';\n\nimport './ShippingInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n needEmail: boolean;\n needPhone: boolean;\n needName: boolean;\n needAddress: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst ShippingInfo: FC = ({\n state,\n needEmail,\n needPhone,\n needName,\n needAddress,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const phoneRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.countryIso2) {\n selectCountryRef.current.value = state.countryIso2;\n }\n }, [state.countryIso2]);\n\n const lang = useLang();\n\n useFocusAfterAnimation(inputRef);\n\n const handleAddress1Change = useCallback((e) => {\n dispatch({ type: 'changeAddress1', payload: e.target.value });\n }, [dispatch]);\n\n const handleAddress2Change = useCallback((e) => {\n dispatch({ type: 'changeAddress2', payload: e.target.value });\n }, [dispatch]);\n\n const handleCityChange = useCallback((e) => {\n dispatch({ type: 'changeCity', payload: e.target.value });\n }, [dispatch]);\n\n const handleStateChange = useCallback((e) => {\n dispatch({ type: 'changeState', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handlePostCodeChange = useCallback((e) => {\n dispatch({ type: 'changePostCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleFullNameChange = useCallback((e) => {\n dispatch({ type: 'changeFullName', payload: e.target.value });\n }, [dispatch]);\n\n const handleEmailChange = useCallback((e) => {\n dispatch({ type: 'changeEmail', payload: e.target.value });\n }, [dispatch]);\n\n const handlePhoneChange = useCallback((e) => {\n let { value } = e.target;\n value = `+${value.replace(/\\D/g, '')}`;\n if (phoneRef.current) {\n phoneRef.current.value = value;\n }\n dispatch({ type: 'changePhone', payload: value });\n }, [dispatch]);\n\n const handleSaveInfoChange = useCallback((e) => {\n dispatch({ type: 'changeSaveInfo', payload: e.target.value });\n }, [dispatch]);\n\n const { formErrors } = state;\n return (\n
\n
\n {needAddress ? (\n
\n
{lang('PaymentShippingAddress')}
\n \n \n \n \n \n {countryList.map(({ name, id }) => (\n \n {name}\n \n ))}\n \n\n \n
\n ) : undefined}\n { needName || needEmail || needPhone ? (\n
{lang('PaymentShippingReceiver')}
\n ) : undefined }\n { needName && (\n \n ) }\n { needEmail && (\n \n ) }\n { needPhone && (\n \n ) }\n \n \n
\n );\n};\n\nexport default memo(ShippingInfo);\n","import React, {\n FC, useCallback, memo, useMemo, useEffect,\n} from '../../lib/teact/teact';\n\nimport { ShippingOption } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport RadioGroup from '../ui/RadioGroup';\n\nimport './Shipping.scss';\n\nexport type OwnProps = {\n state: FormState;\n shippingOptions: ShippingOption[];\n currency?: string;\n dispatch: FormEditDispatch;\n};\n\nconst Shipping: FC = ({\n state,\n shippingOptions,\n currency,\n dispatch,\n}) => {\n const lang = useLang();\n\n useEffect(() => {\n if (!shippingOptions || state.shipping) {\n return;\n }\n dispatch({ type: 'changeShipping', payload: shippingOptions[0].id });\n }, [shippingOptions, state.shipping, dispatch]);\n\n const handleShippingSelect = useCallback((value) => {\n dispatch({ type: 'changeShipping', payload: value });\n }, [dispatch]);\n\n const options = useMemo(() => (shippingOptions.map(({ id: value, title: label, amount }) => ({\n label,\n subLabel: formatCurrency(amount, currency, lang.code),\n value,\n }))), [shippingOptions, currency, lang.code]);\n\n return (\n
\n
\n

{lang('PaymentShippingMethod')}

\n \n \n
\n );\n};\n\nexport default memo(Shipping);\n","import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { LangCode, Price } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './Checkout.scss';\n\nexport type OwnProps = {\n invoiceContent?: {\n title?: string;\n text?: string;\n photoUrl?: string;\n };\n checkoutInfo?: {\n paymentMethod?: string;\n paymentProvider?: string;\n shippingAddress?: string;\n name?: string;\n phone?: string;\n shippingMethod?: string;\n };\n prices?: Price[];\n totalPrice?: number;\n shippingPrices?: Price[];\n currency?: string;\n};\n\nconst Checkout: FC = ({\n invoiceContent,\n prices,\n shippingPrices,\n checkoutInfo,\n currency,\n totalPrice,\n}) => {\n const lang = useLang();\n\n const { photoUrl, title, text } = invoiceContent || {};\n const {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n } = (checkoutInfo || {});\n\n return (\n
\n
\n {photoUrl && \"\"}\n
\n
{title}
\n

{text}

\n
\n
\n
\n { prices && prices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { shippingPrices && shippingPrices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { totalPrice !== undefined && (\n renderPaymentItem(lang.code, lang('Checkout.TotalAmount'), totalPrice, currency, true)\n ) }\n
\n
\n {paymentMethod && renderCheckoutItem('icon-card', paymentMethod, lang('PaymentCheckoutMethod'))}\n {paymentProvider && renderCheckoutItem(\n buildClassName('provider', paymentProvider.toLowerCase()),\n paymentProvider,\n lang('PaymentCheckoutProvider'),\n )}\n {shippingAddress && renderCheckoutItem('icon-location', shippingAddress, lang('PaymentShippingAddress'))}\n {name && renderCheckoutItem('icon-user', name, lang('PaymentCheckoutName'))}\n {phone && renderCheckoutItem('icon-phone', phone, lang('PaymentCheckoutPhoneNumber'))}\n {shippingMethod && renderCheckoutItem('icon-truck', shippingMethod, lang('PaymentCheckoutShippingMethod'))}\n
\n
\n );\n};\n\nfunction renderPaymentItem(\n langCode: LangCode | undefined, title: string, value: number, currency?: string, main = false,\n) {\n return (\n
\n
\n { title }\n
\n
\n {formatCurrency(value, currency, langCode)}\n
\n
\n );\n}\n\nfunction renderCheckoutItem(icon: string, title: string, data: string) {\n return (\n
\n \n
\n
\n { title }\n
\n

\n { data }\n

\n
\n
\n );\n}\n\nexport default memo(Checkout);\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { formatCardExpiry } from '../middle/helpers/inputFormatters';\n\nimport InputText from '../ui/InputText';\nimport useLang from '../../hooks/useLang';\n\nconst MAX_FIELD_LENGTH = 5;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst ExpiryInput : FC = ({ value, error, onChange }) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const expiryInputRef = useRef(null);\n\n const handleKeyDown = useCallback((e) => {\n if (e.key === 'Backspace' && value.charAt(value.length - 1) === '/') {\n const newValue = value.slice(0, value.length - 1);\n if (expiryInputRef.current) {\n expiryInputRef.current.value = newValue;\n }\n }\n }, [value]);\n\n const handleChange = useCallback((e) => {\n onChange(formatCardExpiry(e.target.value));\n }, [onChange]);\n\n return (\n \n );\n};\n\nexport default memo(ExpiryInput);\n","export function formatCardExpiry(input: string) {\n input = input.replace(/[^\\d]/g, '').slice(0, 4);\n const parts = input.match(/.{1,2}/g);\n if (parts?.[0] && Number(parts[0]) > 12) {\n parts[0] = '12';\n }\n if (parts?.[0] && parts[0].length === 2 && !parts[1]) {\n parts[1] = '';\n }\n return parts ? parts.join('/') : '';\n}\n\nexport function formatCardNumber(input: string) {\n input = input.replace(/[^\\d]/g, '');\n const parts = input.match(/.{1,4}/g);\n return parts ? parts.join(' ') : '';\n}\n","import React, {\n FC, memo, useCallback, useState, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { formatCardNumber } from '../middle/helpers/inputFormatters';\nimport { detectCardType, CardType } from '../common/helpers/detectCardType';\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\n\nimport './CardInput.scss';\n\nimport mastercardIconPath from '../../assets/mastercard.svg';\nimport visaIconPath from '../../assets/visa.svg';\n\nconst CARD_NUMBER_MAX_LENGTH = 23;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst CardInput : FC = ({ value, error, onChange }) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const cardNumberRef = useRef(null);\n\n useFocusAfterAnimation(cardNumberRef);\n\n const [cardType, setCardType] = useState(CardType.Default);\n useEffect(() => {\n const newCardType = detectCardType(value);\n setCardType(newCardType);\n // eslint-disable-next-line\n }, []);\n\n const handleChange = useCallback((e) => {\n const newValue = formatCardNumber(e.target.value);\n const newCardType = detectCardType(e.target.value);\n setCardType(newCardType);\n onChange(newValue);\n if (cardNumberRef.current) {\n cardNumberRef.current.value = newValue;\n }\n }, [onChange, cardNumberRef]);\n\n const cardIcon = getCardIcon(cardType);\n\n return (\n
\n {cardIcon}\n \n
\n );\n};\n\nexport default memo(CardInput);\n\nfunction getCardIcon(cardType: CardType) {\n switch (cardType) {\n case CardType.Mastercard:\n return \"\";\n case CardType.Visa:\n return \"\";\n default:\n return undefined;\n }\n}\n","import React, {\n FC, useCallback, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\nimport countryList from '../../util/countries';\n\nimport InputText from '../ui/InputText';\nimport Checkbox from '../ui/Checkbox';\nimport Select from '../ui/Select';\nimport ExpiryInput from './ExpiryInput';\nimport CardInput from './CardInput';\n\nimport './PaymentInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n canSaveCredentials: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst PaymentInfo: FC = ({\n state,\n canSaveCredentials,\n needCardholderName,\n needCountry,\n needZip,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.billingCountry) {\n selectCountryRef.current.value = state.billingCountry;\n }\n }, [state.billingCountry]);\n\n const handleCardNumberChange = useCallback((value) => {\n dispatch({ type: 'changeCardNumber', payload: value });\n }, [dispatch]);\n\n const handleCardholderChange = useCallback((e) => {\n dispatch({ type: 'changeCardholder', payload: e.target.value.toUpperCase() });\n }, [dispatch]);\n\n const handleExpiryChange = useCallback((value) => {\n dispatch({ type: 'changeExpiryDate', payload: value });\n }, [dispatch]);\n\n const handleCvvChange = useCallback((e) => {\n dispatch({ type: 'changeCvvCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeBillingCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handleBillingPostCodeChange = useCallback((e) => {\n dispatch({ type: 'changeBillingZip', payload: e.target.value });\n }, [dispatch]);\n\n const handleChangeSaveCredentials = useCallback((e) => {\n dispatch({ type: 'changeSaveCredentials', payload: e.target.value });\n }, [dispatch]);\n\n const lang = useLang();\n\n const { formErrors = {} } = state;\n\n return (\n
\n
\n
{lang('PaymentCardTitle')}
\n \n { needCardholderName && (\n \n )}\n
\n \n \n
\n { needCountry || needZip ? (\n
{lang('PaymentBillingAddress')}
\n ) : undefined }\n { needCountry && (\n \n {\n countryList.map(({ name }) => (\n \n {name}\n \n ))\n }\n \n ) }\n { needZip && (\n \n )}\n { canSaveCredentials && (\n \n ) }\n \n
\n );\n};\n\nexport default memo(PaymentInfo);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport './ConfirmPayment.scss';\n\nexport type OwnProps = {\n url: string;\n};\n\nconst ConfirmPayment: FC = ({ url }) => {\n const lang = useLang();\n\n return (\n
\n \n
\n );\n};\n\nexport default memo(ConfirmPayment);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\nimport { PaymentStep, ShippingOption, Price } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { detectCardTypeText } from '../common/helpers/detectCardType';\nimport usePaymentReducer, { FormState } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport ShippingInfo from './ShippingInfo';\nimport Shipping from './Shipping';\nimport Checkout from './Checkout';\nimport PaymentInfo from './PaymentInfo';\nimport Button from '../ui/Button';\nimport Modal from '../ui/Modal';\nimport Transition from '../ui/Transition';\nimport Spinner from '../ui/Spinner';\nimport ConfirmPayment from './ConfirmPayment';\n\nimport './PaymentModal.scss';\n\nconst DEFAULT_PROVIDER = 'stripe';\nconst DONATE_PROVIDER = 'smartglocal';\nconst SUPPORTED_PROVIDERS = new Set([DEFAULT_PROVIDER, DONATE_PROVIDER]);\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n nameRequested?: boolean;\n shippingAddressRequested?: boolean;\n phoneRequested?: boolean;\n emailRequested?: boolean;\n flexible?: boolean;\n phoneToProvider?: boolean;\n emailToProvider?: boolean;\n currency?: string;\n prices?: Price[];\n isProviderError: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n confirmPaymentUrl?: string;\n};\n\ntype GlobalStateProps = Pick;\n\nconst Invoice: FC = ({\n isOpen,\n onClose,\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n phoneToProvider,\n emailToProvider,\n currency,\n passwordMissing,\n isProviderError,\n invoiceContent,\n nativeProvider,\n prices,\n needCardholderName,\n needCountry,\n needZip,\n confirmPaymentUrl,\n error,\n}) => {\n const {\n validateRequestedInfo,\n sendPaymentForm,\n setPaymentStep,\n sendCredentialsInfo,\n clearPaymentError,\n } = getDispatch();\n\n const [paymentState, paymentDispatch] = usePaymentReducer();\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n const canRenderFooter = step !== PaymentStep.ConfirmPayment;\n\n useEffect(() => {\n if (step || error) {\n setIsLoading(false);\n }\n }, [step, error]);\n\n useEffect(() => {\n if (error?.field) {\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n [error.field]: error.message,\n },\n });\n }\n }, [error, paymentDispatch]);\n\n useEffect(() => {\n if (savedInfo) {\n const {\n name: fullName, phone, email, shippingAddress,\n } = savedInfo;\n paymentDispatch({\n type: 'updateUserInfo',\n payload: {\n fullName,\n phone: phone && phone.charAt(0) !== '+'\n ? `+${phone}`\n : phone,\n email,\n ...(shippingAddress || {}),\n },\n });\n }\n }, [savedInfo, paymentDispatch]);\n\n const handleErrorModalClose = useCallback(() => {\n clearPaymentError();\n }, [clearPaymentError]);\n\n const totalPrice = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return 0;\n }\n\n return getTotalPrice(prices, shippingOptions, paymentState.shipping);\n }, [step, paymentState.shipping, prices, shippingOptions]);\n\n const checkoutInfo = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return undefined;\n }\n return getCheckoutInfo(paymentState, shippingOptions, nativeProvider || '');\n }, [step, paymentState, shippingOptions, nativeProvider]);\n\n function renderError() {\n if (!error) {\n return undefined;\n }\n return (\n \n

{error.description || 'Error'}

\n

{error.description || 'Error'}

\n \n {lang('OK')}\n \n
\n );\n }\n\n function renderModalContent(currentStep: PaymentStep) {\n switch (currentStep) {\n case PaymentStep.ShippingInfo:\n return (\n \n );\n case PaymentStep.Shipping:\n return (\n \n );\n case PaymentStep.PaymentInfo:\n return (\n \n );\n case PaymentStep.Checkout:\n return (\n \n );\n case PaymentStep.ConfirmPayment:\n return (\n \n );\n default:\n return undefined;\n }\n }\n\n const validateRequest = useCallback(() => {\n const { saveInfo } = paymentState;\n const requestInfo = getRequestInfo(paymentState);\n validateRequestedInfo({ requestInfo, saveInfo });\n }, [validateRequestedInfo, paymentState]);\n\n const sendCredentials = useCallback(() => {\n const credentials = getCredentials(paymentState);\n sendCredentialsInfo({\n credentials,\n });\n }, [sendCredentialsInfo, paymentState]);\n\n const sendForm = useCallback(() => {\n sendPaymentForm({\n shippingOptionId: paymentState.shipping,\n saveCredentials: paymentState.saveCredentials,\n });\n }, [sendPaymentForm, paymentState]);\n\n const setStep = useCallback((nextStep) => {\n setPaymentStep({ step: nextStep });\n }, [setPaymentStep]);\n\n const handleButtonClick = useCallback(() => {\n setIsLoading(true);\n switch (step) {\n case PaymentStep.ShippingInfo:\n return validateRequest();\n case PaymentStep.Shipping:\n return setStep(PaymentStep.PaymentInfo);\n case PaymentStep.PaymentInfo:\n return sendCredentials();\n case PaymentStep.Checkout:\n return sendForm();\n default:\n return () => {\n };\n }\n }, [step, validateRequest, setStep, sendCredentials, sendForm]);\n\n const modalHeader = useMemo(() => {\n switch (step) {\n case PaymentStep.ShippingInfo:\n return lang('PaymentShippingInfo');\n case PaymentStep.Shipping:\n return lang('PaymentShippingMethod');\n case PaymentStep.PaymentInfo:\n return lang('PaymentCardInfo');\n case PaymentStep.Checkout:\n return lang('PaymentCheckout');\n case PaymentStep.ConfirmPayment:\n return lang('Checkout.WebConfirmation.Title');\n default:\n return '';\n }\n }, [step, lang]);\n\n const buttonText = useMemo(() => {\n switch (step) {\n case PaymentStep.Checkout:\n return lang('Checkout.PayPrice', formatCurrency(totalPrice, currency, lang.code));\n default:\n return lang('Next');\n }\n }, [step, lang, currency, totalPrice]);\n\n if (isProviderError) {\n return (\n \n

\n Sorry, Telegram WebZ doesn't support payments with this provider yet.
\n Please use one of our mobile apps to do this.\n

\n \n {lang('OK')}\n \n \n );\n }\n\n return (\n \n
\n \n \n \n

{modalHeader}

\n
\n {step !== undefined ? (\n \n
\n {renderModalContent(step)}\n
\n
\n ) : (\n
\n \n
\n )}\n {canRenderFooter && (\n
\n \n {buttonText}\n \n
\n )}\n {error && !error.field && renderError()}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps & GlobalStateProps => {\n const {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n invoice,\n invoiceContent,\n nativeProvider,\n nativeParams,\n passwordMissing,\n error,\n confirmPaymentUrl,\n } = global.payment;\n\n const isProviderError = Boolean(invoice && (!nativeProvider || !SUPPORTED_PROVIDERS.has(nativeProvider)));\n const { needCardholderName, needCountry, needZip } = (nativeParams || {});\n const {\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n } = (invoice || {});\n\n return {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nativeProvider,\n passwordMissing,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n isProviderError,\n invoiceContent,\n needCardholderName,\n needCountry,\n needZip,\n error,\n confirmPaymentUrl,\n };\n },\n)(Invoice));\n\nfunction findShippingOption(shippingOptions: ShippingOption[], optionId: string) {\n return shippingOptions.find(({ id }) => id === optionId);\n}\n\nfunction getShippingPrices(shippingOptions: ShippingOption[], shippingOption: string) {\n const option = findShippingOption(shippingOptions, shippingOption);\n return option?.prices;\n}\n\nfunction getTotalPrice(prices: Price[] = [], shippingOptions: ShippingOption[] | undefined, shippingOption: string) {\n const shippingPrices = shippingOptions\n ? getShippingPrices(shippingOptions, shippingOption)\n : [];\n let total = 0;\n const totalPrices = prices.concat(shippingPrices || []);\n total = totalPrices.reduce((acc, cur) => {\n return acc + cur.amount;\n }, total);\n return total;\n}\n\nfunction getCheckoutInfo(state: FormState, shippingOptions: ShippingOption[] | undefined, paymentProvider: string) {\n const cardTypeText = detectCardTypeText(state.cardNumber);\n const paymentMethod = `${cardTypeText} *${state.cardNumber.slice(-4)}`;\n const shippingAddress = state.streetLine1\n ? `${state.streetLine1}, ${state.city}, ${state.countryIso2}`\n : undefined;\n const { phone, fullName: name } = state;\n const shippingOption = shippingOptions ? findShippingOption(shippingOptions, state.shipping) : undefined;\n const shippingMethod = shippingOption?.title;\n return {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n\nfunction getRequestInfo(paymentState: FormState) {\n const {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n fullName: name,\n phone,\n email,\n } = paymentState;\n\n const shippingAddress = {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n };\n\n return {\n name,\n phone,\n email,\n shippingAddress,\n };\n}\n\nfunction getCredentials(paymentState: FormState) {\n const {\n cardNumber, cardholder, expiry, cvv, billingCountry, billingZip,\n } = paymentState;\n const [expiryMonth, expiryYear] = expiry.split('/');\n const data = {\n cardNumber,\n cardholder,\n expiryMonth,\n expiryYear,\n cvv,\n country: billingCountry,\n zip: billingZip,\n };\n\n return {\n data,\n };\n}\n","import React, {\n FC, memo, useMemo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { Price } from '../../types';\nimport { ApiShippingAddress } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Checkout from './Checkout';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './PaymentModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n prices?: Price[];\n shippingPrices: any;\n totalAmount?: number;\n currency?: string;\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n photoUrl?: string;\n text?: string;\n title?: string;\n credentialsTitle?: string;\n shippingMethod?: string;\n};\n\nconst ReceiptModal: FC = ({\n isOpen,\n onClose,\n prices,\n shippingPrices,\n totalAmount,\n currency,\n info,\n photoUrl,\n text,\n title,\n credentialsTitle,\n shippingMethod,\n}) => {\n const lang = useLang();\n const checkoutInfo = useMemo(() => {\n return getCheckoutInfo(credentialsTitle, info, shippingMethod);\n }, [info, shippingMethod, credentialsTitle]);\n\n return (\n \n
\n
\n \n \n \n

{lang('PaymentReceipt')}

\n
\n
\n \n
\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { receipt } = global.payment;\n const {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n } = (receipt || {});\n\n return {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n };\n },\n)(ReceiptModal));\n\nfunction getCheckoutInfo(paymentMethod?: string,\n info?:\n { phone?: string;\n name?: string;\n shippingAddress?: ApiShippingAddress;\n },\n shippingMethod?: string) {\n if (!info) {\n return { paymentMethod };\n }\n const { shippingAddress } = info;\n const fullAddress = shippingAddress?.streetLine1\n ? `${shippingAddress.streetLine1}, ${shippingAddress.city}, ${shippingAddress.countryIso2}`\n : undefined;\n const { phone, name } = info;\n return {\n paymentMethod,\n paymentProvider: 'Stripe',\n shippingAddress: fullAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n
\n \n \n \n \n \n \n \n {canSubmit && (\n \n )}\n \n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState();\n const [peekMonkeyData, setPeekMonkeyData] = useState();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {closeMonkeyData && (\n \n )}\n {peekMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(PasswordMonkey);\n","import React, {\n FC, useEffect, useState, memo,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n size: { width: 1024, height: 1024 },\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n async function handleCropClick() {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }\n\n return (\n \n {isCroppieReady ? (\n
\n ) : (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n function handleAvatarCrop(croppedImg: File) {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }\n\n function handleModalClose() {\n setSelectedFile(undefined);\n }\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n
\n \n \n \n {croppedBlobUrl && \"Avatar\"}\n \n \n
\n );\n};\n\nexport default memo(AvatarEditable);\n"],"names":["createGhost","source","origin","ghost","document","createElement","classList","add","img","Image","draggable","oncontextmenu","stopEvent","src","HTMLVideoElement","poster","appendChild","MediaViewerOrigin","profileInfo","querySelector","cloneNode","isMessageImageFullyVisible","container","imageEl","messageListElement","imgOffsetTop","offsetTop","closest","id","includes","parentElement","scrollTop","offsetHeight","applyStyles","element","styles","Object","assign","style","getNodes","message","containerSelector","mediaSelector","mediaEls","querySelectorAll","mediaEl","length","applyShape","firstChild","objectFit","memo","withGlobal","global","isDownloading","selectIsDownloading","isProtected","selectIsMessageProtected","mediaData","isVideo","isZoomed","fileName","isAvatar","onCloseMediaViewer","onForward","onZoomToggle","downloadMessageMedia","cancelMessageMediaDownload","getDispatch","loadProgress","downloadProgress","useMediaWithLoadProgress","getMessageMediaHash","handleDownloadClick","useCallback","lang","useLang","MenuButton","useMemo","onTrigger","isOpen","Button","round","size","color","className","undefined","onClick","ariaLabel","IS_SINGLE_COLUMN_LAYOUT","DropdownMenu","trigger","positionX","MenuItem","icon","Math","href","download","ProgressSpinner","progress","noCross","renderDownloadButton","text","isHidden","isForVideo","isMultiline","setIsMultiline","useState","useEffect","footerContent","checkIsMultiline","height","clientHeight","REM","handleResize","throttle","window","addEventListener","removeEventListener","classNames","buildClassName","e","stopPropagation","dir","prop","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","units","bytes","number","floor","log","toFixed","bufferedProgress","currentTime","duration","fileSize","isForceMobileVersion","isPlayed","isFullscreenSupported","isFullscreen","onChangeFullscreen","onPlayPause","isVisible","setVisibility","onSeek","seekerRef","useRef","isSeeking","timeout","setTimeout","clearTimeout","body","remove","handleSeek","current","width","left","getBoundingClientRect","clientX","MouseEvent","targetTouches","max","min","handleStartSeek","handleStopSeek","captureEvents","onCapture","onRelease","onDrag","percentagePlayed","percentageBuffered","ref","renderSeekLine","ripple","formatMediaDuration","renderTime","loadedPercent","totalSize","formatFileSize","url","isGif","posterData","posterSize","isMediaViewerOpen","noPlay","onClose","toggleControls","areControlsVisible","videoRef","setIsPlayed","IS_TOUCH_ENV","IS_IOS","setCurrentTime","setFullscreen","exitFullscreen","elRef","setIsFullscreen","Boolean","useLayoutEffect","listener","listenerEnter","listenerExit","video","PLATFORM_ENV","requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","mozRequestFullScreen","mozCancelFullScreen","webkitCancelFullScreen","webkitExitFullscreen","useFullscreenStatus","isBuffered","bufferingHandlers","useBuffering","shouldRender","shouldRenderSpinner","transitionClassNames","spinnerClassNames","useShowTransition","shouldRenderPlayButton","playButtonClassNames","pause","safePlay","togglePlayState","useVideoCleanup","handleMouseMove","handleMouseOut","target","handleTimeUpdate","currentTarget","handleEnded","handleFullscreenChange","position","togglePayingStateBySpace","key","preventDefault","wrapperStyle","videoStyle","onMouseMove","onMouseOut","autoPlay","playsInline","loop","muted","onPlay","onEnded","onDoubleClick","onTimeUpdate","join","square","ownProps","chatId","threadId","messageId","avatarOwnerId","profilePhotoIndex","selectChatMessage","senderId","avatarOwner","selectUser","selectChat","selectScheduledMessage","props","isActive","animationLevel","onFooterClick","isFooterHidden","setIsFooterHidden","photo","getMessagePhoto","getMessageVideo","webPagePhoto","getMessageWebPagePhoto","webPageVideo","getMessageWebPageVideo","isDocumentPhoto","isMessageDocumentPhoto","isDocumentVideo","isMessageDocumentVideo","isPhoto","isFromSharedMedia","isFromSearch","isGhostAnimation","getMediaHash","isFull","photos","getChatAvatarHash","pictogramBlobUrl","useMedia","ApiMediaFormat","previewMediaHash","previewBlobUrl","fullMediaBlobUrl","getMessageMediaFormat","localBlobUrl","blobUrl","bestImageData","thumbDataUri","useBlurSync","getMessageMediaThumbDataUri","videoSize","getMessageFileSize","dimensions","getMessageDocument","mediaSize","getPhotoFullDimensions","getVideoDimensions","AVATAR_FULL_DIMENSIONS","renderPhoto","calculateMediaViewerDimensions","textParts","renderMessageText","hasFooter","onContextMenu","imageSize","canDrag","Spinner","renderVideoPreview","alt","ANIMATION_DURATION","cancelAnimation","SwipeDirection","getMessageId","selectMessage","rest","containerRef","activeSlideRef","transformRef","x","y","scale","swipeDirectionRef","isActiveRef","activeMessageId","setActiveMessageId","forceUpdate","useForceUpdate","setTransform","value","setIsActive","debounceSetMessage","useDebounce","debounceSwipeDirection","debounceActive","handleToggleFooterVisibility","isFooter","innerHeight","pageY","pageX","innerWidth","callback","delay","savedCallback","useTimeout","lastTransform","lastDragOffset","lastZoomCenter","panDelta","initialContentRect","content","lastGestureTime","Date","now","setLastGestureTime","debounce","changeSlide","direction","mId","offset","animateNumber","from","to","timing","timingFunctions","onUpdate","isNotPassive","excludedClosestSelector","arePropsShallowEqual","event","captureEvent","dragOffsetX","dragOffsetY","touches","IOS_SCREEN_EDGE_THRESHOLD","absOffsetX","abs","absOffsetY","h","Vertical","Horizontal","onZoom","zoomFactor","initialCenterX","initialCenterY","currentCenterX","currentCenterY","MAX_ZOOM","scaleFactor","scaledCenterX","scaledCenterY","scaleOffsetX","scaleOffsetY","centerX","centerY","absX","absY","boundaries","s1","x1","y1","k","Vx","Vy","minOffsetX","maxOffsetX","right","minOffsetY","top","maxOffsetY","bottom","dirX","nextMessageId","previousMessageId","offsetX","offsetY","getAnimationStyle","INITIAL_MATRIX","SCALE_VALUES","ZOOM_SAFE_AREA","children","noWrap","canPan","zoomLevel","panDeltaX","panDeltaY","onPan","tunedZoomLevel","isDragging","setIsDragging","dragData","setDragData","dx","dy","matrixData","setMatrixData","panWrapperRef","panContainerRef","newZoomLevel","newPandx","newPandy","newMatrixData","areSortedArraysEqual","oldScale","wrapper","image","wrapperRect","imageRect","newImgWidth","newImgHeight","newImgX","newImgY","calculateSafeZoneOnZoom","transform","toString","onMouseDown","newDragData","onMouseUp","deltaX","deltaY","getNewMatrixData","sender","isUserId","selectSender","closeMediaViewer","focusMessage","toggleChatInfo","handleFocusMessage","forceSyncOnIOs","senderTitle","getSenderTitle","Avatar","user","chat","renderText","formatMediaDateTime","date","Transition","isShown","onChangeZoom","prevIsShown","usePrevious","inputRef","setZoomLevel","disabled","step","type","onChange","Number","mediaViewer","settings","byKey","chatMessages","collectionIds","selectScheduledMessages","selectChatMessages","selectOutlyingIds","selectListedIds","currentSearch","selectCurrentMediaSearch","foundIds","resultsByType","media","openMediaViewer","openForwardMenu","singleMessageId","messageIds","getChatMediaMessageIds","selectedMediaMessageIndex","indexOf","isFirst","isLast","animationKey","prevSenderId","slideAnimation","headerAnimation","canPanZoomWrap","setCanPanZoomWrap","setIsZoomed","setPanDelta","getMessageFileName","toggle","mql","matchMedia","MEDIA_VIEWER_MEDIA_QUERY","addListener","removeListener","prevMessage","prevOrigin","prevAvatarOwner","prevBestImageData","dispatchHeavyAnimationEvent","ANIMATION_END_DELAY","fromImage","windowWidth","windowSize","availableWidth","availableHeight","getMediaViewerAvailableDimensions","toWidth","toHeight","calculateDimensions","toLeft","toTop","topOffsetRem","matches","getTopOffset","fromTop","fromLeft","fromWidth","fromHeight","uncovered","realWidth","realHeight","srcWidth","srcHeight","uncover","fromTranslateX","fromTranslateY","fromScaleX","fromScaleY","requestAnimationFrame","clearShape","contains","removeChild","animateOpening","toImage","getElementById","targetTop","el","display","rect","windowHeight","isElementInViewport","shouldFadeOut","existingGhost","getElementsByClassName","transition","transformOrigin","opacity","animateClosing","timer","closeZoom","handleZoomToggle","handleZoomValue","level","canCloseZoom","close","handleFooterClick","handleForward","fromChatId","forceOnHeavyAnimation","captureEscKeyListener","stopCurrentAudio","fromId","index","handlePan","useHistoryBack","handleKeyDown","shouldCloseOnVideo","ShowTransition","isRtl","activeKey","name","currentUserId","chatOrUserIds","filterRef","filter","filterPlaceholder","loadMore","onFilterChange","onSelectChatOrUser","onCloseAnimationEnd","viewportIds","getMore","useInfiniteScroll","resetFilter","useInputFocusOnOpen","handleFilterChange","useKeyboardListNavigation","modalHeader","InputText","onKeyDown","placeholder","viewportOffset","Modal","header","InfiniteScroll","items","onLoadMore","withAbsolutePositioning","maxHeight","CHAT_HEIGHT_PX","map","i","ListItem","PrivateChatInfo","status","userId","GroupChatInfo","Loading","chats","byId","chatsById","listIds","orderedPinnedIds","activeListIds","active","archivedListIds","archived","pinnedIds","contactIds","contactList","userIds","setForwardChatId","exitForwardMode","setFilter","markIsShown","unmarkIsShown","useFlag","chatAndContactIds","priorityIds","unique","chatIds","getCanPostInChat","MAIN_THREAD_ID","usersById","getGlobal","users","sortChatIds","filterChatsByName","filterUsersByName","handleSelectUser","renderingChatAndContactIds","useCurrentOrPrev","getErrorHeader","error","isSlowMode","hasErrorKey","pick","dialogs","dismissDialog","acceptInviteConfirmation","sendMessage","showNotification","isModalOpen","openModal","closeModal","dialog","contactRequest","invite","hash","title","about","participantsCount","isChannel","isRequestNeeded","participantsText","joinText","requestToJoinText","renderInviteHeader","isText","renderInvite","contact","getReadableErrorText","notifications","dismissNotification","localId","Notification","onDismiss","toggleSafeLinkModal","handleOpen","open","ensureProtocol","handleDismiss","renderingUrl","ConfirmDialog","confirmLabel","confirmHandler","MAX_SAFE_DATE","WEEKDAY_LETTERS","isDisabledDay","year","month","day","minDate","maxDate","selectedDay","fixedMinDate","getDayStart","fixedMaxDate","formatInputTime","String","padStart","formatDay","selectedAt","minAt","maxAt","isFutureMode","isPastMode","withTimePicker","submitButtonLabel","secondButtonLabel","onSubmit","onSecondButtonClick","passedSelectedDate","prevIsOpen","isTimeInputFocused","markTimeInputAsFocused","unmarkTimeInputAsFocused","selectedDate","setSelectedDate","currentMonthAndYear","setCurrentMonthAndYear","getFullYear","getMonth","selectedHours","setSelectedHours","getHours","selectedMinutes","setSelectedMinutes","getMinutes","getDate","currentYear","currentMonth","getTime","newSelectedDate","shouldDisableNextMonth","shouldDisablePrevMonth","prevMonthGrid","currentMonthGrid","nextMonthGrid","setDate","setMonth","setFullYear","firstDay","getDay","totalDaysInPrevMonth","push","gridDate","lastRowDaysCount","buildCalendarGrid","submitLabel","formatDateToString","code","formatTime","formatSubmitLabel","handleChangeHours","replace","hours","setHours","hoursStr","handleChangeMinutes","minutes","setMinutes","minutesStr","d","dateCopy","role","tabIndex","handleDateSelect","inputMode","onFocus","onBlur","historyCalendarSelectedAt","searchMessagesByDate","closeHistoryCalendar","handleJumpToDate","timestamp","valueOf","isSchedule","selectCurrentMessageList","canDeleteForAll","selectAllowedMessageActions","contactName","getUserFirstOrLastName","getPrivateChatUserId","willDeleteForCurrentUserOnly","isChatBasicGroup","willDeleteForAll","isChatSuperGroup","album","deleteMessages","deleteScheduledMessages","handleDeleteMessageForAll","messages","shouldDeleteForAll","handleDeleteMessageForSelf","onEnter","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","isChatChannel","isGroup","isSuperGroup","canPinForAll","pinMessage","handlePinMessageForAll","isUnpin","handlePinMessage","isOneSide","isSilent","pinnedMessagesCount","onUnpin","selectedMessageIds","selectedMessages","selectCanDeleteSelectedMessages","selectCurrentChat","exitMessageSelectMode","reportMessages","selectedReason","setSelectedReason","description","setDescription","handleReport","reason","handleSelectReason","handleDescriptionChange","REPORT_OPTIONS","label","RadioGroup","options","selected","messageListType","canDelete","canReport","selectCanReportSelectedMessages","canDownload","selectCanDownloadSelectedMessages","hasProtectedMessage","selectHasProtectedMessage","selectedMessagesCount","selectSelectedMessagesCount","canDeleteMessages","canReportMessages","canDownloadMessages","canPost","openForwardMenuForSelectedMessages","downloadSelectedMessages","copySelectedMessages","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isReportModalOpen","openReportModal","closeReportModal","handleCopy","IS_MAC_OS","metaKey","ctrlKey","getKeyFromEvent","useCopySelectedMessages","captureKeyboardListeners","onBackspace","onDelete","onEsc","handleDownload","prevSelectedMessagesCount","renderingSelectedMessagesCount","formattedMessagesCount","renderButton","destructive","seenByModal","memberIds","seenByUserIds","openChat","closeSeenByModal","handleClick","renderingMemberIds","noStatusOrTyping","reactorModal","reactions","reactors","loadReactors","closeReactorListModal","isClosing","startClosing","stopClosing","chosenTab","setChosenTab","canShowFilters","count","results","chatIdRef","handleCloseAnimationEnd","handleClose","handleLoadMore","allReactions","l","reaction","concat","nextOffset","LoadMoreDirection","formatIntegerCompact","find","ReactionStaticEmoji","fullName","getUserFullName","activeEmojiInteraction","animatedEffect","selectAnimatedEmojiEffect","effectAnimationId","localEffectAnimation","keys","ANIMATED_STICKERS_PATHS","stopActiveEmojiInteraction","isHiding","startHiding","isPlaying","startPlaying","timeoutRef","stop","handleCancelAnimation","dispatchHeavyAnimationStop","effectAnimationData","localEffectAnimationData","setLocalEffectAnimationData","getAnimationData","then","data","startSize","isReversed","AnimatedSticker","animationData","play","quality","IS_ANDROID","noLoop","onLoad","onSelect","buttonRef","activeElement","privateChatUserId","isPinned","selectIsChatPinned","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","canChangeFolder","chatFolders","orderedIds","withUsername","isChatFolderModalOpen","openChatFolderModal","closeChatFolderModal","contextActions","useChatContextActions","handleDelete","handleChatFolderChange","useSelectWithEnter","avatarSize","DeleteChatModal","runThrottled","cb","topUserIds","topPeers","recentlyFoundChatIds","globalSearch","onReset","loadTopUsers","loadContactList","addRecentlyFoundChatId","clearRecentlyFoundChats","topUsersRef","useHorizontalScroll","shouldReplaceHistory","lastSyncTime","privateChatUser","searchQuery","mediaThumbnail","mediaBlobUrl","isRoundVideo","getMessageRoundVideo","isSavedMessages","isSelf","getChatTitle","isVerified","VerifiedIcon","Link","formatPastTimeShort","renderMessageSummary","renderSummary","searchDate","suggestions","match","suggestion","currentDate","latestYear","getSuggestionsFromDate","localContactIds","fetchingStatus","globalResults","localResults","globalChatIds","globalUserIds","localChatIds","localUserIds","byChatId","globalMessagesByChatId","dateSearchQuery","onSearchDateSelect","searchMessagesGlobal","setGlobalSearchChatId","shouldShowMoreLocal","setShouldShowMoreLocal","shouldShowMoreGlobal","setShouldShowMoreGlobal","query","handleChatClick","handlePickerItemClick","startsWith","MEMO_EMPTY_ARRAY","contactIdsWithMe","foundContactIds","foundMessages","split","sort","a","b","handleClickShowMoreLocal","handleClickShowMoreGlobal","nothingFound","noScrollRestoreOnTop","noFastList","NothingFound","PickerSelectedItem","chatOrUserId","clickArg","createMapStateToProps","currentType","isVoice","activeDownloads","theme","selectTheme","isLoading","searchChatId","isChatProtected","CURRENT_TYPE","observe","observeIntersectionForMedia","useIntersectionObserver","rootRef","throttleMs","handleSelectMedia","canRenderContents","useAsyncRendering","SLIDE_TRANSITION_DURATION","isMediaGrid","isMessageList","itemSelector","Media","idPrefix","observeIntersection","handleMessageFocus","shouldDrawDateDivider","toYearMonth","formatMonthAndYear","WebLink","getSenderName","onMessageClick","Document","withDate","datetime","smaller","onDateClick","openAudioPlayer","handlePlayAudio","Audio","AudioOrigin","TABS","GlobalSearchContent","CHAT_TABS","slice","TRANSITION_RENDER_COUNT","currentContent","setGlobalSearchContent","setGlobalSearchDate","activeTab","setActiveTab","parseDateString","handleSwitchTab","tab","handleSearchDateSelect","TabList","tabs","onSwitchTab","renderCount","INITIAL_STATE","currentPassword","password","hint","email","twoFaReducer","state","action","payload","currentScreen","editedFolderId","onSaveFilter","onScreenSelect","signOut","deleteChatFolder","isSignOutDialogOpen","setIsSignOutDialogOpen","isDeleteFolderDialogOpen","setIsDeleteFolderDialogOpen","openSignOutConfirmation","closeSignOutConfirmation","openDeleteFolderConfirmation","closeDeleteFolderConfirmation","handleSignOutMessage","handleDeleteFolderMessage","SettingsMenuButton","SettingsScreens","renderHeaderContent","confirmIsDestructive","currentUser","loadProfilePhotos","profileId","ProfileInfo","forceShowSelf","ChatExtra","LINK_PREFIX","LINK_PREFIX_REGEX","USERNAME_REGEX","runDebouncedForCheckUsername","currentUsername","asLink","isUsernameAvailable","checkUsername","username","setUsername","langPrefix","usernameSuccess","usernameError","test","handleUsernameChange","newUsername","trim","isValid","isUsernameValid","success","readOnly","ERROR_FIRST_NAME_MISSING","ERROR_BIO_TOO_LONG","profileEdit","firstName","currentFirstName","lastName","currentLastName","fullInfo","bio","currentBio","currentAvatarHash","loadCurrentUser","updateProfile","isUsernameTouched","setIsUsernameTouched","isProfileFieldsTouched","setIsProfileFieldsTouched","setError","setPhoto","setFirstName","setLastName","setBio","currentAvatarBlobUrl","ProfileEditProgress","isUsernameError","isSaveButtonShown","handlePhotoChange","newPhoto","handleFirstNameChange","handleLastNameChange","handleBioChange","handleProfileSave","trimmedFirstName","trimmedLastName","trimmedBio","AvatarEditable","UsernameInput","FloatingActionButton","canAutoLoadPhotoFromContacts","canAutoLoadPhotoInPrivateChats","canAutoLoadPhotoInGroups","canAutoLoadPhotoInChannels","canAutoLoadVideoFromContacts","canAutoLoadVideoInPrivateChats","canAutoLoadVideoInGroups","canAutoLoadVideoInChannels","canAutoLoadFileFromContacts","canAutoLoadFileInPrivateChats","canAutoLoadFileInGroups","canAutoLoadFileInChannels","canAutoPlayGifs","canAutoPlayVideos","autoLoadFileMaxSizeMb","setSettingOption","renderFileSizeCallback","AUTODOWNLOAD_FILESIZE_MB_LIMITS","handleFileSizeChange","renderAutoDownloadBlock","canAutoLoadFromContacts","canAutoLoadInPrivateChats","canAutoLoadInGroups","canAutoLoadInChannels","Checkbox","checked","onCheck","isChecked","RangeSlider","renderValue","renderContentSizeSlider","runThrottledForLoadRecommended","orderedFolderIds","foldersById","recommended","recommendedChatFolders","onCreateFolder","onEditFolder","loadRecommendedChatFolders","addChatFolder","showDialog","setAnimationData","isAnimationLoaded","setIsAnimationLoaded","handleAnimationLoad","handleCreateFolder","chatsCountByFolderId","useFolderManagerForChatsCount","userFolders","folder","subtitle","getFolderDescriptionText","handleCreateFolderFromRecommended","STICKER_SIZE_FOLDER_SETTINGS","pill","fluid","narrow","multiline","itemName","itemPluralName","ERROR_NO_TITLE","ERROR_NO_CHATS","loadedActiveChatIds","loadedArchivedChatIds","dispatch","onAddIncludedChats","onAddExcludedChats","onBack","editChatFolder","isIncludedChatsListExpanded","setIsIncludedChatsListExpanded","isExcludedChatsListExpanded","setIsExcludedChatsListExpanded","selectedChatIds","includedChatIds","selectedChatTypes","includedChatTypes","selectChatFilters","excludedChatIds","excludedChatTypes","folderId","visibleIncludedChatIds","visibleExcludedChatIds","allLoadedChatsSet","Set","loadedIncludedChatIds","findIntersectionWithSet","loadedExcludedChatIds","renderChats","mode","visibleChatIds","isExpanded","leftChatsCount","clickHandler","chatType","INCLUDED_CHAT_TYPES","typeKey","EXCLUDED_CHAT_TYPES","inactive","renderChatType","isTouched","folderUpdate","selectedIds","filterValue","onSelectedIdsChange","onSelectedChatTypesChange","chatTypes","shouldMinimize","hasMaxChats","focus","handleItemClick","newSelectedIds","splice","handleChatTypeClick","newSelectedChatTypes","selectedType","isMinimized","canClose","isSelected","withChatType","chatFilter","folderAllOrderedIds","useFolderManagerForOrderedIds","ALL_FOLDER_ID","folderArchivedOrderedIds","ARCHIVED_FOLDER_ID","displayedIds","newFilter","handleSelectedIdsChange","ids","includeFilters","excludeFilters","handleSelectedChatTypesChange","newFilters","forEach","shownScreen","handleReset","handleEditFolder","handleAddIncludedChats","handleAddExcludedChats","STICKER_SIZE_PICKER_HEADER","stickerSet","isIntersecting","useIsIntersecting","mediaHash","lottieData","useMediaTransition","firstLetters","getFirstLetters","hasThumbnail","isGifs","IS_WEBM_SUPPORTED","stickers","firstSticker","isLottie","STICKER_SIZE_GENERAL_SETTINGS","StickerButton","sticker","ANIMATION_LEVEL_OPTIONS","TIME_FORMAT_OPTIONS","stickerSetIds","added","setIds","stickerSetsById","setsById","defaultReaction","appConfig","messageTextSize","messageSendKeyCombo","shouldSuggestStickers","shouldLoopStickers","timeFormat","stickerSettingsRef","observeIntersectionForCovers","setSticker","KEYBOARD_SEND_OPTIONS","subLabel","handleAnimationLevelChange","newLevel","_","handleMessageTextSizeChange","newSize","documentElement","setProperty","setAttribute","handleTimeFormatChange","newTimeFormat","wasTimeFormatSetManually","setTimeFormat","handleStickerSetClick","stickerSets","installedDate","fromSticker","fileSelector","openSystemFilesDialog","accept","noMultiple","removeAttribute","onchange","click","hex2rgb","param","parseInt","substring","rgb2hex","p0","p1","p2","rgb2hsb","r","g","s","v","hsb2rgb","f","p","q","t","getPatternColor","rgbColor","hue","saturation","wallpaper","slug","localMediaHash","thumbRef","useCanvasBlur","thumbnail","dataUri","isLoadAllowed","setIsLoadAllowed","fullMedia","wasLoadDisabled","UPLOADING_WALLPAPER_SLUG","cacheKeyRef","handleSelect","blob","fetchBlob","cacheApi","save","CUSTOM_BG_CACHE_NAME","isAllowed","background","isBlurred","themes","loadedWallpapers","loadWallpapers","uploadWallpaper","setThemeSettings","themeRef","handleFileSelect","files","handleUploadWallpaper","handleSetColor","handleResetToDefault","backgroundColor","patternColor","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","handleWallPaperSelect","currentWallpaper","async","defaultRGB","rgb","canvas","context","getContext","preloadImage","naturalHeight","naturalWidth","offsetWidth","drawImage","getImageData","blockSize","getAverageColor","handleWallPaperBlurChange","isUploading","DEFAULT_HSB","PREDEFINED_COLORS","hsb2positions","hsb","rects","colorPosition","colorRect","huePosition","hueRect","positions2hsb","colorPickerRef","huePickerRef","isFirstRunRef","setHsb","getInitialHsb","hsbRef","markIsDragging","unmarkIsDragging","rgbInput","setRgbInput","hexInput","setHexInput","rectsRef","colorCtxRef","offsetLeft","handleColorDrag","handleHueDrag","selectorToPreventScroll","withCursor","hex","hueHex","w","ctx","imgData","createImageData","pixels","col","perY","st","ed","perX","putImageData","drawColor","drawHue","handleRgbChange","rgbValue","channel","handleHexChange","hexValue","handlePredefinedColorClick","dataset","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","hasContactJoinedNotifications","hasWebNotifications","hasPushNotifications","notificationSoundVolume","loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings","runDebounced","handleSettingsChange","peerType","setting","currentIsSilent","currentShouldShowPreviews","shouldShowPreviews","handleContactNotificationChange","volume","playNotifySound","hasPassword","isSensitiveEnabled","canChangeSensitive","privacy","blocked","activeSessions","blockedCount","totalCount","sessionsCount","visibilityPrivacyPhoneNumber","phoneNumber","visibility","visibilityPrivacyLastSeen","lastSeen","visibilityPrivacyProfilePhoto","profilePhoto","visibilityPrivacyForwarding","forwards","visibilityPrivacyGroupChats","chatInvite","loadPrivacySettings","loadBlockedContacts","loadAuthorizations","loadContentSettings","updateContentSettings","getVisibilityValue","languages","language","loadLanguages","selectedLanguage","setSelectedLanguage","markIsLoading","unmarkIsLoading","handleChange","langCode","setLanguage","currentLangCode","navigator","toLowerCase","shortLangCode","substr","nativeName","buildOptions","loadingOption","getPrivacyKey","screen","privacySettings","allowUserIds","allowChatIds","blockUserIds","blockChatIds","setPrivacyVisibility","visibilityOptions","exceptionLists","shouldShowDenied","shouldShowAllowed","privacyKey","headerText","descriptionText","allowedContactsScreen","deniedContactsScreen","allowedCount","reduce","result","membersCount","blockCount","handleVisibilityChange","getLocation","session","region","country","getDeviceEnvironment","deviceModel","platform","systemVersion","terminateAuthorization","terminateAllAuthorizations","isConfirmTerminateAllDialogOpen","openConfirmTerminateAllDialog","closeConfirmTerminateAllDialog","handleTerminateSessionClick","handleTerminateAllSessions","currentSession","isCurrent","otherSessions","appName","ip","sessions","handler","dateActive","blockedIds","userSearch","setUserSearchQuery","blockContact","filteredContactIds","availableContactIds","contactId","firstId","secondId","secondName","localeCompare","handleRemoveUser","accessHash","chatsByIds","usersByIds","countryList","phoneCodes","phoneCodeList","unblockContact","isBlockUserModalOpen","openBlockUserModal","closeBlockUserModal","handleUnblockClick","isPrivate","formatPhoneNumberWithCode","renderContact","animatedEmoji","selectAnimatedEmoji","AnimatedEmoji","expectedPassword","clearError","validationError","setValidationError","shouldShowPassword","setShouldShowPassword","handleSubmit","newPassword","handleClearError","PasswordMonkey","isBig","isPasswordVisible","PasswordForm","onChangePasswordVisibility","onStart","FOCUS_DELAY_TIMEOUT_MS","shouldConfirm","setValue","isConfirmShown","markIsConfirmShown","unmarkIsConfirmShown","codeLength","twoFaSettings","waitingEmailCodeLength","newValue","updatePassword","checkPassword","clearTwoFaError","updateRecoveryEmail","provideTwoFaEmailCode","clearPassword","handleStartWizard","handleNewPassword","handleNewPasswordConfirm","handleNewPasswordHint","handleNewPasswordEmail","onSuccess","handleChangePasswordCurrent","handleChangePasswordNew","handleChangePasswordConfirm","handleChangePasswordHint","handleTurnOff","handleRecoveryEmailCurrentPassword","handleRecoveryEmail","handleEmailCode","getCurrentPrivacySettings","isAllowList","setPrivacySettings","selectedContactIds","setSearchQuery","isSubmitShown","setIsSubmitShown","newSelectedContactIds","setNewSelectedContactIds","isChatGroup","handleSelectedContactIdsChange","contactsIds","Picker","itemIds","searchInputId","availableReactions","selectedReaction","setDefaultReaction","isInactive","TWO_FA_SCREENS","FOLDERS_SCREENS","PRIVACY_SCREENS","PRIVACY_PHONE_NUMBER_SCREENS","PRIVACY_LAST_SEEN_PHONE_SCREENS","PRIVACY_PROFILE_PHOTO_SCREENS","PRIVACY_FORWARDING_SCREENS","PRIVACY_GROUP_CHATS_SCREENS","foldersState","foldersDispatch","shouldSkipTransition","twoFaState","twoFaDispatch","useReducer","handleSaveFilter","renderCurrentSection","isScreenActive","isFrom","currentKey","privacyAllowScreens","isTwoFaScreen","isFoldersScreen","isPrivacyScreen","values","SettingsGeneralBackgroundColor","renderCurrentSectionContent","LAYERS_ANIMATION_NAME","statusesById","userStatusesById","serverTimeOffset","filteredIds","sortUserIds","isSearching","selectedMemberIds","onSelectedMemberIdsChange","onNextStep","setGlobalSearchQuery","canBeInvitedToGroup","isUserBot","handleNextStep","creationProgress","creationError","chatCreation","createGroupChat","createChannel","setTitle","setAbout","chatTitleEmptyError","channelTitleEmptyError","chatTooManyUsersError","ChatCreationProgress","handleTitleChange","handleCreateGroup","handleCreateChannel","renderedError","RENDER_COUNT","LeftColumnContent","onContentChange","newChatMemberIds","setNewChatMemberIds","isStepActive","ChatList","folderType","folderOrderedIds","editChatFolders","initialSelectedFolderIds","pinnedChatIds","selectedFolderIds","setSelectedFolderIds","folders","idsToRemove","idsToAdd","CheckboxGroup","getCopyLabel","hasSelection","scrollLockEl","IGNORED_KEYS","Down","ArrowDown","Up","ArrowUp","Left","ArrowLeft","Right","ArrowRight","PageUp","PageDown","End","Home","Tab","getTouchY","changedTouches","clientY","scrollHeight","preventDefaultForScrollKeys","HTMLElement","tagName","getAttribute","isTextBox","disableScrolling","_excludedClosestSelector","passive","onkeydown","enableScrolling","REACTION_SIZE","IS_COMPACT_MENU","cn","createClassNameBuilder","previewIndex","onSendReaction","isReady","selectAnimation","isActivated","activate","deactivate","markAnimationLoaded","shouldRenderAnimated","animatedClassNames","shouldRenderStatic","staticClassNames","onMouseEnter","enabledReactions","itemsScrollRef","isHorizontalScrollEnabled","enableHorizontalScroll","handleWheel","onWheelCapture","onTouchMove","anchor","canSendNow","canReschedule","canReply","canEdit","canPin","canUnpin","canForward","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","canShowSeenBy","canShowReactionsCount","canRemoveReaction","canShowReactionList","seenByRecentUsers","onReply","onEdit","onPin","onReport","onFaveSticker","onUnfaveSticker","onSend","onReschedule","onCopyLink","onDownload","onShowSeenBy","onShowReactors","onCopyMessages","menuRef","scrollableRef","copyOptions","afterEffect","getMessageText","canImageBeCopied","hasMessageLocalBlobUrl","CLIPBOARD_ITEM_SUPPORTED","selection","getSelection","Promise","resolve","mediaLoader","copyImageToClipboard","anchorNode","parentNode","getMessageIdsForSelectedText","clipboardText","getMessageTextWithSpoilers","copyTextToClipboard","getMessageCopyOptions","noReactions","withReactions","markIsReady","unmarkIsReady","getTriggerElement","getRootElement","getMenuElement","getLayout","extraHeightAudioPlayer","pinnedElement","extraHeightPinned","extraPaddingX","extraTopPadding","marginSides","extraMarginTop","handleRemoveReaction","positionY","transformOriginX","transformOriginY","menuStyle","withScroll","useContextMenuPosition","Menu","bubbleStyle","START_SIZE","selectActiveDownloadIds","seenByExpiresAt","seenByMaxChatMembers","noOptions","isScheduled","isLocal","isMessageLocal","isOwnMessage","isAction","isActionMessage","areReactionsEmpty","canSeeList","some","isChosen","hasFullInfo","SERVICE_NOTIFICATIONS_USER_ID","chatUsername","setReplyingToId","setEditingId","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","loadSeenBy","openSeenByModal","sendReaction","openReactorListModal","loadFullChat","copyMessagesByIds","isMenuOpen","setIsMenuOpen","setIsDeleteModalOpen","setIsReportModalOpen","isPinModalOpen","setIsPinModalOpen","isCalendarOpen","openCalendar","closeCalendar","recentReactions","msg","closeMenu","closePinModal","handleCloseCalendar","handleReply","handleEdit","handlePin","handleUnpin","handleFaveSticker","handleUnfaveSticker","handleSelectMessage","params","childMessageIds","withShift","handleScheduledMessageSend","handleOpenCalendar","handleOpenSeenByModal","handleOpenReactorListModal","handleRescheduleMessage","scheduledAt","handleCopyMessages","handleCopyLink","handleSendReaction","reportMessageIds","scheduledMaxDate","getDayStartAt","stickerSetShortName","currentMessageList","sendOptions","getAllowedAttachmentOptions","canSendStickers","selectStickerSet","stickerSetId","selectStickerSetByShortName","loadStickers","toggleStickerSet","isDisabled","stickerSetAccessHash","isPreloadedGlobally","handleButtonClick","hasCloseButton","STICKER_SIZE_MODAL","isRestricted","canAddContact","getCanAddContact","canDeleteChat","getCanDeleteChat","hasLinkedChat","linkedChatId","withExtraActions","canStartBot","canRestartBot","canSubscribe","canSearch","canCall","canMute","canLeave","canEnterVoiceChat","canCreateVoiceChat","onSubscribeChannel","onSearchClick","updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot","joinGroupCall","createGroupCall","openLinkedChat","addContact","openCallFallbackConfirm","handleStartBot","command","handleRestartBot","handleToggleMuteClick","handleEnterVoiceChatClick","handleLinkedChatClick","handleAddContactClick","handleSubscribe","handleCall","handleSearch","handleSelectMessages","Portal","runDebouncedForSearch","selectCurrentTextSearch","isHistoryCalendarOpen","setLocalTextSearchQuery","searchTextMessagesLocal","closeLocalTextSearch","openHistoryCalendar","focusedIndex","setFocusedIndex","visualViewport","mainEl","pageTop","Array","input","div","contentEditable","blur","handleMessageSearchQueryChange","newQuery","handleUp","newFocusIndex","handleDown","SearchInput","findInViewport","selectorOrElements","margin","isDense","shouldContainBottom","isHorizontal","viewportY1","viewportY2","allElements","visibleIndexes","isFound","y2","setTooltipItemVisible","selector","first","isFullyVisible","fastSmoothScroll","useKeyboardNavigation","shouldSaveSelectionOnUpdateItems","shouldRemoveSelectionOnReset","noArrowNavigation","shouldSelectOnTab","selectedItemIndex","setSelectedItemIndex","getSelectedIndex","newIndex","cycleRestrict","handleArrowKey","handleItemSelect","item","isSelectionOutOfRange","onUp","onDown","onLeft","onRight","onTab","onInsertUserName","filteredUsers","handleUserSelect","forceFocus","handleSelectMention","member","selectedMentionIndex","prevChatMembers","renderedChatMembers","attachments","caption","groupChatMembers","recentEmojis","baseEmojiKeywords","emojiKeywords","addRecentEmoji","onCaptionUpdate","onFileAppend","onClear","captionRef","useStateRef","hideTimeoutRef","prevAttachments","renderingAttachments","isHovered","markHovered","unmarkHovered","isQuick","every","quick","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","EDITABLE_INPUT_MODAL_ID","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","sendAttachments","handleFilesDrop","dataTransfer","newFiles","file","CONTENT_TYPES_WITH_PREVIEW","areAllPhotos","SUPPORTED_IMAGE_CONTENT_TYPES","mimeType","areAllVideos","SUPPORTED_VIDEO_CONTENT_TYPES","areAllAudios","renderHeader","onDragEnter","onDrop","onDragOver","onDragLeave","relatedTarget","toTarget","fromTarget","attachment","File","filename","extension","getFileExtension","previewData","emojis","onEmojiSelect","MessageInput","isAttachmentModalInput","html","editableInputId","canAutoFocus","questionInputRef","optionsListRef","solutionRef","question","setQuestion","setOptions","isAnonymous","setIsAnonymous","isMultipleAnswers","setIsMultipleAnswers","isQuizMode","setIsQuizMode","solution","setSolution","correctOption","setCorrectOption","hasErrors","setHasErrors","focusInput","solutionEl","innerHTML","addNewOption","newOptions","list","scrollTo","behavior","handleCreate","questionTrimmed","optionsTrimmed","o","summary","answers","option","correct","isPublic","multipleChoice","quiz","entities","parseMessageInput","correctAnswers","solutionEntities","updateOption","removeOption","handleCorrectOptionChange","handleIsAnonymousChange","handleMultipleAnswersChange","handleQuizModeChange","handleKeyPress","keyCode","getQuestionError","getOptionsError","renderOptions","onKeyPress","renderQuizNoOptionError","hidden","emoji","native","names","IS_EMOJI_SUPPORTED","loading","category","allEmojis","useOnIntersect","emojisPerRow","ceil","displayedEmoji","ICONS_BY_CATEGORY","recent","people","nature","foods","activity","places","objects","symbols","flags","categoryIntersections","emojiDataPromise","emojiRawData","emojiData","headerRef","categories","setCategories","setEmojis","activeCategoryIndex","setActiveCategoryIndex","entries","entry","intersectingWithIndexes","newLeft","HEADER_BUTTON_WIDTH","fastSmoothScrollHorizontal","allCategories","themeCategories","unshift","exec","default","uncompressEmoji","ensureEmojiData","selectCategory","categoryEl","handleEmojiSelect","MENU_TRANSITION_DURATION","containerClassName","faded","STICKER_MARGIN","loadAndPlay","onStickerSelect","onStickerUnfave","stickersPerRow","STICKER_SIZE_PICKER","noAnimate","onUnfaveClick","stickerSetIntersections","favorite","recentStickers","favoriteStickers","addedSetIds","shouldPlay","loadRecentStickers","addRecentSticker","activeSetIndex","setActiveSetIndex","sendMessageAction","useSendMessageAction","areAddedLoaded","allSets","noPopulatedSets","set","stickerSetEl","handleStickerSelect","handleStickerUnfave","fullClassName","buttonClassName","gif","videoData","shouldRenderVideo","isVideoReady","preventMessageInputBlurWithBubbling","preload","savedGifs","gifs","saved","canSendGifs","onGifSelect","loadSavedGifs","debounceMs","SymbolMenuTabs","SYMBOL_MENU_TAB_TITLES","SYMBOL_MENU_TAB_ICONS","Emoji","Stickers","GIFs","onRemoveSymbol","onSearchOpen","renderTabButton","handleSearchOpen","isLeftColumnShown","setRecentEmojis","handleMouseEnter","handleMouseLeave","useMouseInside","fastRaf","recentEmojisRef","renderContent","onMouseLeave","noCloseOnBackdrop","noCompact","canAttachMedia","canAttachPolls","onFileSelect","onPollCreate","handleQuickSelect","handleDocumentSelect","autoClose","withAvatar","botCommand","bot","botCommands","handleSendCommand","botId","selectedCommandIndex","prevCommands","renderedCommands","chatBotCommand","forEmoji","clearStickersForEmoji","prevStickers","displayedStickers","onSilentSend","onScheduleSend","listEmojis","usePrevDuringAnimation","handleSelectEmoji","selectedIndex","setItemVisible","thumbUrl","thumbnailDataUrl","decoding","webThumbnail","isForGallery","inlineResult","STICKER_SIZE_INLINE_BOT_RESULT","isGallery","inlineBotResults","switchPm","onSelectResult","startBot","handleSendPm","startParam","prevInlineBotResults","renderedInlineBotResults","sensitiveArea","inlineBotResult","selectedSendAsId","sendAsIds","saveDefaultSendAs","markMouseInside","sendAsId","selectedSendAsIndex","messagesById","viewportResults","senderUser","senderChat","forwardInfo","isChannelPost","foundResult","isOnTop","preloadBackwards","teactOrderKey","LastMessageMeta","selectShouldLoopStickers","isSomeModalOpen","onModalToggle","isAdded","areStickersLoaded","useOnChange","coverStickerIds","covers","otherStickers","handleAddClick","canRenderStickers","STICKER_SIZE_SEARCH","selectCurrentStickerSearch","resultIds","featured","featuredIds","loadFeaturedStickers","setIsModalOpen","selectCurrentGifSearch","isChatWithBot","selectIsChatWithBot","searchMoreGifs","setGifSearchQuery","handleGifClick","hasResults","answer","voters","offsets","pollResults","answerVote","totalVoters","loadPollOptionResults","closePollResults","prevVotersCount","votersCount","setIsLoading","areVotersLoaded","limit","shouldResetVoters","handleViewMoreClick","handleMemberClick","leftVotersCount","renderViewMoreButton","total","getMessagePoll","resultsByOption","buildCollectionByKey","management","updateContact","deleteContact","closeManagement","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","isNotificationsEnabled","setIsNotificationsEnabled","ManagementProgress","handleNotificationChange","handleDeleteContact","withFullInfo","GROUP_TITLE_EMPTY","hasLinkedChannel","isBasicGroup","invites","canChangeInfo","isCreator","getHasAdminRight","canBanUsers","canInvite","exportedInvites","availableReactionsCount","togglePreHistoryHidden","updateChat","deleteChat","leaveChannel","deleteChannel","loadExportedChatInvites","loadChatJoinRequests","currentTitle","currentAbout","imageHash","isPublicGroup","isRevoked","handleClickEditType","ManagementScreens","handleClickDiscussion","handleClickReactions","handleClickPermissions","handleClickAdministrators","handleSetPhoto","handleAboutChange","handleUpdateGroup","trimmedTitle","trimmedAbout","handleClickMembers","handleTogglePreHistory","isPreHistoryHidden","isEnabled","enabledReactionsCount","enabledPermissionsCount","defaultBannedRights","sendStickers","sendGifs","adminsCount","adminMembers","handleDeleteGroup","formatInteger","joinRequests","onChatMemberSelect","updateChatDefaultBannedRights","permissions","setPermissions","havePermissionChanged","setHavePermissionChanged","handleRemovedUsersClick","handleAddExceptionClick","handleExceptionMemberClick","promotedByUserId","handlePermissionChange","getUpdatedPermissionValue","handleSavePermissions","bannedRights","removedUsersCount","kickedMembers","exceptionMembers","members","getMemberExceptions","langKey","getLangKeyForBannedRightKey","translatedString","sendMessages","blocking","sendMedia","sendPolls","embedLinks","inviteUsers","pinMessages","changeInfo","loadMoreMembers","deleteChatMember","usersId","availableMemberIds","acc","isAdmin","isOwner","canDeleteMembers","updateChatMemberBannedRights","isRemoveUserModalOpen","openRemoveUserModal","closeRemoveUserModal","removedMembers","getRemovedBy","kickedByUserId","kickedByUser","getContextActions","CHANNEL_TITLE_EMPTY","isSignaturesShown","toggleSignatures","handleUpdateChannel","handleToggleSignatures","handleClickSubscribers","handleDeleteChannel","selectManagement","checkPublicLink","updatePublicLink","updatePrivateLink","toggleIsProtected","privateLink","inviteLink","privacyType","setPrivacyType","isRevokeConfirmDialogOpen","openRevokeConfirmDialog","closeRevokeConfirmDialog","canUpdate","handleOptionChange","handleForwardingOptionChange","handleSave","handleRevokePrivateLink","langPrefix1","langPrefix2","forwardingOptions","SafeLink","forDiscussionIds","linkedChat","loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup","linkedGroupId","setLinkedGroupId","isConfirmUnlinkGroupDialogOpen","openConfirmUnlinkGroupDialog","closeConfirmUnlinkGroupDialog","isConfirmLinkGroupDialogOpen","openConfirmLinkGroupDialog","closeConfirmLinkGroupDialog","handleUnlinkGroupSessions","channelId","handleLinkGroupSessions","STICKER_SIZE_DISCUSSION_GROUPS","teactFastList","linkedGroup","renderLinkGroupHeader","hasPrivateLink","renderLinkGroupConfirmText","isButtonsInOneRow","isPromotedByCurrentUser","isFormFullyDisabled","selectedChatMemberId","isBanConfirmationDialogOpen","openBanConfirmationDialog","closeBanConfirmationDialog","selectedChatMember","handleBanFromGroup","viewMessages","getControlIsDisabled","handleAdminMemberClick","handleAddAdminClick","getMemberStatus","promotedByUser","defaultRights","adminRights","isNewAdmin","selectedUserId","updateChatAdmin","setIsTouched","isDismissConfirmationDialogOpen","openDismissConfirmationDialog","closeDismissConfirmationDialog","customTitle","setCustomTitle","selectedAdminMember","handleDismissAdmin","memberStatus","handleCustomTitleChange","postMessages","editMessages","banUsers","addAdmins","manageCall","anonymous","maxLength","noAdmins","adminIds","shouldUseSearchResults","listedIds","noScrollRestore","memberId","inviteComparator","i1","i2","isPermanent","i1IsPermanent","usage","i1Usage","i1Date","i2IsPermanent","i2Usage","i2Date","revokedInvites","revokedExportedInvites","setEditingExportedInvite","editExportedChatInvite","deleteExportedChatInvite","deleteRevokedExportedChatInvites","setOpenedInviteInfo","isDeleteRevokeAllDialogOpen","openDeleteRevokeAllDialog","closeDeleteRevokeAllDialog","isRevokeDialogOpen","openRevokeDialog","closeRevokeDialog","revokingInvite","setRevokingInvite","deletingInvite","setDeletingInvite","hasDetailedCountdown","expireDate","getServerTime","MILLISECONDS_IN_DAY","useInterval","primaryInvite","primaryInviteLink","link","temporalInvites","revokeInvite","usageLimit","askToRevoke","handleRevoke","handleCreateNewClick","handlePrimaryRevoke","handleDeleteAllRevoked","showInviteInfo","deleteInvite","askToDelete","copyLink","handleCopyPrimaryClicked","prepareUsageText","requested","diff","formatCountdown","prepareContextActions","actions","editInvite","PrimaryLinkMenuButton","STICKER_SIZE_INVITES","secondaryIcon","DEFAULT_USAGE_LIMITS","DEFAULT_EXPIRE_DATE","hour","week","DEFAULT_CUSTOM_EXPIRE_DATE","editingInvite","exportChatInvite","isCalendarOpened","setIsRequestNeeded","customExpireDate","setCustomExpireDate","selectedExpireOption","setSelectedExpireOption","customUsageLimit","setCustomUsageLimit","selectedUsageOption","setSelectedUsageOption","isSubmitBlocked","setIsSubmitBlocked","oldEditingInvite","editingTitle","editingIsRequestNeeded","minSafeDate","handleIsRequestChange","handleCustomUsageLimitChange","handleExpireDateChange","handleSaveClick","formatFullDate","n","setChatEnabledReactions","localEnabledReactions","setLocalEnabledReactions","handleSaveReactions","handleReactionChange","newEnabledReactions","inviteInfo","importers","requesters","loadChatInviteImporters","loadChatInviteRequesters","adminId","isExpired","handleCopyClicked","importer","renderImporters","requester","renderRequesters","hideChatJoinRequest","fixedDate","dateString","isToday","formatHumanDate","handleAcceptRequest","isApproved","handleRejectRequest","hideAllChatJoinRequests","isAcceptAllDialogOpen","openAcceptAllDialog","closeAcceptAllDialog","isRejectAllDialogOpen","openRejectAllDialog","closeRejectAllDialog","handleAcceptAllRequests","handleRejectAllRequests","STICKER_SIZE_JOIN_REQUESTS","managementType","selectCurrentManagementType","VISA","MASTERCARD1","MASTERCARD2","CardType","cards","Default","Visa","Mastercard","detectCardType","cardNumber","formatsCache","defaultPhoneNumberFormat","str","flag","phoneFormat","format","formatValue","phoneNumberFormat","phoneNumberGroups","RegExp","repeat","getPhoneNumberFormat","streetLine1","streetLine2","city","countryIso2","postCode","phone","shipping","cardholder","expiry","cvv","billingCountry","billingZip","saveInfo","saveCredentials","formErrors","reducer","getBillingCountry","countryCode","useFocusAfterAnimation","animationDuration","hasArrow","labelText","htmlFor","needEmail","needPhone","needName","needAddress","phoneRef","selectCountryRef","handleAddress1Change","handleAddress2Change","handleCityChange","handleStateChange","handleCountryChange","handlePostCodeChange","handleFullNameChange","handleEmailChange","handlePhoneChange","handleSaveInfoChange","shippingOptions","currency","handleShippingSelect","amount","formatCurrency","renderPaymentItem","main","renderCheckoutItem","invoiceContent","prices","shippingPrices","checkoutInfo","totalPrice","photoUrl","paymentMethod","paymentProvider","shippingAddress","shippingMethod","expiryInputRef","charAt","parts","formatCardExpiry","cardNumberRef","cardType","setCardType","newCardType","formatCardNumber","cardIcon","mastercardIconPath","visaIconPath","getCardIcon","canSaveCredentials","needCardholderName","needCountry","needZip","handleCardNumberChange","handleCardholderChange","toUpperCase","handleExpiryChange","handleCvvChange","handleBillingPostCodeChange","handleChangeSaveCredentials","allow","sandbox","SUPPORTED_PROVIDERS","savedInfo","invoice","nativeProvider","nativeParams","passwordMissing","confirmPaymentUrl","payment","isProviderError","has","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError","paymentState","paymentDispatch","canRenderFooter","PaymentStep","field","handleErrorModalClose","shippingOption","getShippingPrices","totalPrices","cur","getTotalPrice","detectCardTypeText","findShippingOption","getCheckoutInfo","validateRequest","requestInfo","getRequestInfo","sendCredentials","credentials","expiryMonth","expiryYear","zip","getCredentials","sendForm","shippingOptionId","setStep","nextStep","buttonText","currentStep","renderModalContent","renderError","optionId","receipt","info","totalAmount","credentialsTitle","fullAddress","onInputChange","setPassword","canSubmit","setCanSubmit","select","autoComplete","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","STICKER_SIZE","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","isPeekShown","setIsPeekShown","handleFirstMonkeyLoad","STICKER_SIZE_TWO_FA","playSegment","cropperResultOptions","circle","Croppie","croppiePromise","cropper","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","enableZoom","boundary","viewport","blobToDataUri","bind","err","DEBUG","console","initCropper","ensureCroppie","croppedImg","blobToFile","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","URL","revokeObjectURL","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/830.3dad49e3bca3c0b28df2.js b/dist/830.743a3bc23208a5ae5b3b.js similarity index 99% rename from dist/830.3dad49e3bca3c0b28df2.js rename to dist/830.743a3bc23208a5ae5b3b.js index 74b8b940..e9c57104 100644 --- a/dist/830.3dad49e3bca3c0b28df2.js +++ b/dist/830.743a3bc23208a5ae5b3b.js @@ -1,2 +1,2 @@ "use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[830],{7799:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(4050),r=n(9118),c=n(6752),s=n(8674),a=n(5332);let l,i;async function d(){return l||(l=n.e(941).then(n.bind(n,7941)),i=(await l).default),l}setTimeout(d,3e3);const u=(0,o.X$)((e=>{let{className:t,id:n,animationData:l,play:u,playSegment:m,speed:p,noLoop:f,size:g,quality:h,isLowPriority:v,color:Z,forceOnHeavyAnimation:w,onLoad:b,onEnded:y}=e;const[C,E]=(0,o.eJ)(),x=(0,o.sO)(null),k=(0,o.sO)(!1),P=(0,o.sO)(!1),I=(0,o.sO)(!0),T=(0,o.sO)();T.current=u;const A=(0,o.sO)();A.current=m,(0,o.d4)((()=>{if(C||!l)return;const e=()=>{if(!x.current)return;const e=new i(n,x.current,l,{noLoop:f,size:g,quality:h,isLowPriority:v},b,Z,y);p&&e.setSpeed(p),E(e)};i?e():d().then((()=>{(0,r.T2)((()=>{x.current&&e()}))}))}),[Z,C,l,n,v,f,b,h,g,p,y]),(0,o.d4)((()=>{C&&C.setColor(Z)}),[Z,C]),(0,o.d4)((()=>()=>{C&&C.destroy()}),[C]);const N=(0,o.I4)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];C&&(T.current||A.current)&&(A.current?C.playSegment(A.current):e?C.goToAndPlay(0):C.play())}),[C]),S=(0,o.I4)((()=>{C&&C.pause()}),[C]),L=(0,o.I4)((()=>{P.current=!0,C&&(k.current||(k.current=C.isPlaying()),S())}),[C,S]),O=(0,o.I4)((()=>{k.current&&N(),k.current=!1,P.current=!1}),[N]),B=(0,o.I4)((()=>{(0,r.T2)(O)}),[O]);(0,o.d4)((()=>{C&&(u||m?P.current?k.current=!0:N(f):P.current?k.current=!1:S())}),[C,u,m,f,N,S]),(0,o.d4)((()=>{C&&(I.current?I.current=!1:l&&(C.changeData(l),N()))}),[N,C,l]),(0,s.ZP)(L,O,w),(0,a.Z)(L,B);const F=(0,c.Z)("AnimatedSticker",t),R=g?`width: ${g}px; height: ${g}px;`:void 0;return o.ZP.createElement("div",{ref:x,className:F,style:R})}))},172:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(4050),r=n(6137),c=n(3716),s=n(8415),a=n(2155),l=n(6752),i=n(2340),d=n(6202),u=n(1212),m=n(9107);const p=(0,o.X$)((e=>{let{className:t,size:n="large",chat:p,user:f,photo:g,userStatus:h,text:v,isSavedMessages:Z,lastSyncTime:w,onClick:b}=e;const y=f&&(0,s.NB)(f),C=f&&(0,s.pK)(f.id);let E;Z||y||(f?E=(0,s.RT)(f):p?E=(0,s.RT)(p):g&&(E=`photo${g.id}?size=m`));const x=(0,d.Z)(E,!1,r.IU.BlobUrl,w),k=Boolean(x),{transitionClassNames:P}=(0,u.Z)(k,void 0,k,"slow"),I=(0,m.Z)();let T="";if(Z)T=o.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(y)T=o.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(C)T=o.ZP.createElement("i",{className:"icon-reply-filled"});else if(x)T=o.ZP.createElement("img",{src:x,className:(0,l.Z)("avatar-media",P),alt:"",decoding:"async"});else if(f){const e=(0,s.Js)(f);T=e?(0,a.Xv)(e,2):void 0}else if(p){const e=(0,s.U)(I,p);T=e&&(0,a.Xv)(e,(0,s.YC)(p.id)?2:1)}else v&&(T=(0,a.Xv)(v,2));const A=!Z&&f&&h&&(0,s.kM)(f,h),N=(0,l.Z)(`Avatar size-${n}`,t,`color-bg-${(0,s.Rs)(f||p)}`,Z&&"saved-messages",y&&"deleted-account",C&&"replies-bot-account",A&&"online",b&&"interactive",!Z&&!x&&"no-photo"),S=Boolean(Z||x),L=(0,o.I4)((e=>{b&&b(e,S)}),[b,S]),O=(f||p)&&(f||p).id;return o.ZP.createElement("div",{className:N,onClick:L,"data-test-sender-id":c.Cg?O:void 0},"string"==typeof T?(0,i.Z)(T,["jumbo"===n?"hq_emoji":"emoji"]):T)}))},7324:(e,t,n)=>{n.d(t,{x:()=>c,Z:()=>s});var o=n(6137),r=n(647);const c={MonkeyIdle:n(8760),MonkeyTracking:n(6917),MonkeyClose:n(6257),MonkeyPeek:n(7785),FoldersAll:n(9356),FoldersNew:n(5485),DiscussionGroups:n(6978),CameraFlip:n(5665),HandFilled:n(2456),HandOutline:n(5667),Speaker:n(8763),VoiceAllowTalk:n(401),VoiceMini:n(5106),VoiceMuted:n(487),VoiceOutlined:n(5740),Peach:n(3677),Eggplant:n(5435),Cumshot:n(1879),JoinRequest:n(5095),Invite:n(7879)};function s(e){const t=c[e].replace(window.location.origin,"");return r.he(`file${t}`,o.IU.Lottie)}},7551:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(4050),r=n(9107),c=n(2313),s=n(3103),a=n(231);const l=(0,o.X$)((e=>{let{isOpen:t,onClose:n,onCloseAnimationEnd:l,title:i,header:d,text:u,textParts:m,confirmLabel:p="Confirm",confirmHandler:f,confirmIsDestructive:g,isButtonsInOneRow:h,children:v}=e;const Z=(0,r.Z)(),w=(0,o.sO)(null),b=(0,o.I4)((e=>{-1===e&&f()}),[f]),y=(0,c.Z)(w,t,b,".Button");return o.ZP.createElement(s.Z,{className:"confirm",title:i,header:d,isOpen:t,onClose:n,onCloseAnimationEnd:l},u&&u.split("\\n").map((e=>o.ZP.createElement("p",null,e))),m||v,o.ZP.createElement("div",{className:h?"dialog-buttons mt-2":"",ref:w,onKeyDown:y},o.ZP.createElement(a.Z,{className:"confirm-dialog-button",isText:!0,onClick:f,color:g?"danger":"primary"},p),o.ZP.createElement(a.Z,{className:"confirm-dialog-button",isText:!0,onClick:n},Z("Cancel"))))}))},1273:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(1713),r=n(4050),c=n(9118),s=n(7675),a=n(7361);const l=".ListItem",i=20,d=800,u=e=>{let{ref:t,className:n,onLoadMore:u,onScroll:m,onKeyDown:p,items:f,itemSelector:g=l,preloadBackwards:h=i,sensitiveArea:v=d,withAbsolutePositioning:Z,maxHeight:w,noScrollRestore:b=!1,noScrollRestoreOnTop:y=!1,noFastList:C,cacheBuster:E,children:x}=e,k=(0,r.sO)(null);t&&(k=t);const P=(0,r.sO)({}),[I,T]=(0,r.Ye)((()=>u?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u({direction:o.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{u({direction:o.Uq.Forwards})}),1e3,!0,!1)]:[]),[u,f]);(0,r.d4)((()=>{if(!I)return;if(h>0&&(!f||f.length{const e=k.current,t=P.current;let n;if(t.listItemElements=e.querySelectorAll(g),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:o}=e;n=o+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}Z||b||y&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[f,g,b,y,E,Z]);const A=(0,r.I4)((e=>{if(T&&I){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=P.current,o=P.current.listItemElements;if(e)return void(P.current.isScrollTopJustUpdated=!1);const r=o.length,c=k.current,{scrollTop:s,scrollHeight:a,offsetHeight:l}=c,i=s<=(r?o[0].offsetTop:0)+v,d=(r?o[r-1].offsetTop+o[r-1].offsetHeight:a)-(s+l)<=v;let u=!1;if(i){const e=o[0];if(e){const o=e.getBoundingClientRect().top,r=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:o;t&&void 0!==n&&r>n&&(P.current.currentAnchor=e,P.current.currentAnchorTop=o,u=!0,T())}}if(d){const e=o[r-1];if(e){const o=e.getBoundingClientRect().top,r=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:o;t&&void 0!==n&&r{n.d(t,{Z:()=>p});var o=n(4050),r=n(517),c=n(6752),s=n(8674),a=n(1212),l=n(274),i=n(9107),d=n(6590),u=n(231),m=n(2898);const p=e=>{let{dialogRef:t,title:n,className:p,isOpen:f,header:g,hasCloseButton:h,noBackdrop:v,children:Z,onClose:w,onCloseAnimationEnd:b,onEnter:y,shouldSkipHistoryAnimations:C}=e;const{shouldRender:E,transitionClassNames:x}=(0,a.Z)(f,b,C,void 0,C),k=(0,o.sO)(null);(0,o.d4)((()=>f?(0,r.Z)({onEsc:w,onEnter:y}):void 0),[f,w,y]),(0,o.d4)((()=>f&&k.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const o=n.findIndex((e=>e.isSameNode(document.activeElement)));let r=0;o>=0&&(r=t.shiftKey?o>0?o-1:n.length-1:o{document.removeEventListener("keydown",t,!1)}}(k.current):void 0),[f]);const{forceClose:P}=(0,d.ZP)(f,w);(0,o.d4)((()=>()=>{f&&P()}),[]),(0,l.Z)((e=>{let[t]=e;return document.body.classList.toggle("has-open-dialog",f),(f||!f&&void 0!==t)&&(0,s.YW)(200),()=>{document.body.classList.remove("has-open-dialog")}}),[f]);const I=(0,i.Z)();if(!E)return;const T=(0,c.Z)("Modal",p,x,v&&"transparent-backdrop");return o.ZP.createElement(m.Z,null,o.ZP.createElement("div",{ref:k,className:T,tabIndex:-1,role:"dialog"},o.ZP.createElement("div",{className:"modal-container"},o.ZP.createElement("div",{className:"modal-backdrop",onClick:w}),o.ZP.createElement("div",{className:"modal-dialog",ref:t},g||(n?o.ZP.createElement("div",{className:"modal-header"},h&&o.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:I("Close"),onClick:w},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement("div",{className:"modal-title"},n)):void 0),o.ZP.createElement("div",{className:"modal-content custom-scroll"},Z)))))}},2898:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(4050),r=n(2916);const c=e=>{let{containerId:t,className:n,children:c}=e;const s=(0,o.sO)();return s.current||(s.current=document.createElement("div")),(0,o.bt)((()=>{const e=document.querySelector(t||"#portals");if(!e)return;const o=s.current;return n&&o.classList.add(n),e.appendChild(o),()=>{r.Z.render(void 0,o),e.removeChild(o)}}),[n,t]),r.Z.render(c,s.current)}},5332:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(4050);function r(e,t){(0,o.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},8360:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(7204);function r(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(0,o.Z)(e,t);return n||null!=e?e:r}},7407:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(4050),r=n(1713),c=n(782),s=n(5326),a=n(7204);function l(e,t,n,o){const{length:c}=e,s=o?e.indexOf(o):0,a=t===r.Uq.Forwards?s:s+1||c,l=Math.max(0,a-n),i=a+n-1,d=e.slice(Math.max(0,l),i+1);let u,m;switch(t){case r.Uq.Forwards:u=a>0,m=l>=0;break;case r.Uq.Backwards:u=a2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;const d=(0,o.sO)(),u=(0,o.sO)((()=>{if(!t||d.current)return;const{newViewportIds:e}=l(t,r.Uq.Forwards,i,t[0]);return e})()),m=(0,s.Z)();n&&(d.current={});const p=(0,a.Z)(t),f=(0,a.Z)(n);if(t&&!n&&(t!==p||n!==f)){const{offsetId:e=t[0],direction:n=r.Uq.Forwards}=d.current||{},{newViewportIds:o}=l(t,n,i,e);u.current&&(0,c.et)(u.current,o)||(u.current=o)}const g=(0,o.I4)((n=>{let{direction:o,noScroll:s}=n;const a=u.current,p=a?o===r.Uq.Backwards?a[a.length-1]:a[0]:void 0;if(!t)return void(e&&e({offsetId:p}));s||(d.current={...d.current,direction:o,offsetId:p});const{newViewportIds:f,areSomeLocal:g,areAllLocal:h}=l(t,o,i,p);!g||a&&(0,c.et)(a,f)||(u.current=f,m()),!h&&e&&e({offsetId:p})}),[t,i,e,m]);return n?[t]:[u.current,g]}},6202:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(4050),r=n(6137),c=n(647),s=n(5326);const a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.IU.BlobUrl,a=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0;const i=e?c.UV(e):void 0,d=(0,s.Z)();return(0,o.d4)((()=>{if(!t&&e&&!i){const t=Date.now();c.he(e,n).then((()=>{const e=Date.now()-t;!l||e>=l?d():setTimeout(d,l-e)}))}}),[t,e,i,n,a,d,l]),i}},4319:(e,t,n)=>{n.d(t,{yl:()=>r,TE:()=>s,VP:()=>a});var o=n(3716);const r=navigator.clipboard&&window.ClipboardItem,c=document.createElement("textarea");c.setAttribute("readonly",""),c.tabIndex=-1,c.className="visually-hidden";const s=e=>{c.value=e,document.body.appendChild(c);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);c.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(c)},a=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),o=new Image;o.onload=e=>{if(n&&e.currentTarget){const o=e.currentTarget;t.width=o.width,t.height=o.height,n.drawImage(o,0,0,o.width,o.height),t.toBlob(l,"image/png",1)}},o.src=e};async function l(e){if(e&&r)try{var t,n;await(null===(t=(n=navigator.clipboard).write)||void 0===t?void 0:t.call(n,[new ClipboardItem({[e.type]:e})]))}catch(e){o.eM&&console.error(e)}}},2972:(e,t,n)=>{function o(e){e.offsetWidth}n.d(t,{Z:()=>o})},7675:(e,t,n)=>{n.d(t,{z:()=>c,Z:()=>s});var o=n(7361),r=n(2972);function c(e){e.style.display="none",(0,r.Z)(e),e.style.display=""}const s=(e,t)=>{o.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),o.cj&&(e.style.overflow="")}},4753:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(3716);const r=e=>{e.play().catch((t=>{o.eM&&console.warn(t,e)}))}},1879:(e,t,n)=>{e.exports=n.p+"Cumshot.7a17984a6b80787dab34..tgs"},5435:(e,t,n)=>{e.exports=n.p+"Eggplant.7693d877087b802d04be..tgs"},3677:(e,t,n)=>{e.exports=n.p+"Peach.a289b2c54c563f11208f..tgs"},5665:(e,t,n)=>{e.exports=n.p+"CameraFlip.1a9fe44cf01fcb22347d..tgs"},2456:(e,t,n)=>{e.exports=n.p+"HandFilled.f87939d160f1dc288586..tgs"},5667:(e,t,n)=>{e.exports=n.p+"HandOutline.f9831751ba60df30c484..tgs"},8763:(e,t,n)=>{e.exports=n.p+"Speaker.04bb3743412b41ff83c5..tgs"},401:(e,t,n)=>{e.exports=n.p+"VoiceAllowTalk.a9cc7c39ec438973ddc9..tgs"},5106:(e,t,n)=>{e.exports=n.p+"VoiceMini.bf00ffdf69625c579569..tgs"},487:(e,t,n)=>{e.exports=n.p+"VoiceMuted.a4b4ec6bfd7c6c5fb275..tgs"},5740:(e,t,n)=>{e.exports=n.p+"VoiceOutlined.91b394ab3562cdfad6bc..tgs"},7879:(e,t,n)=>{e.exports=n.p+"Invite.4502ec3aa4249d6e6723..tgs"},5095:(e,t,n)=>{e.exports=n.p+"Requests.af9f19772695a8898810..tgs"},6257:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3e..tgs"},8760:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab..tgs"},7785:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e..tgs"},6917:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12..tgs"},6978:(e,t,n)=>{e.exports=n.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a..tgs"},9356:(e,t,n)=>{e.exports=n.p+"FoldersAll.3f9f9e243d19f0fbf9aa..tgs"},5485:(e,t,n)=>{e.exports=n.p+"FoldersNew.9a40d71c0c8be70f5bd1..tgs"}}]); -//# sourceMappingURL=830.3dad49e3bca3c0b28df2.js.map \ No newline at end of file +//# sourceMappingURL=830.743a3bc23208a5ae5b3b.js.map \ No newline at end of file diff --git a/dist/830.3dad49e3bca3c0b28df2.js.map b/dist/830.743a3bc23208a5ae5b3b.js.map similarity index 99% rename from dist/830.3dad49e3bca3c0b28df2.js.map rename to dist/830.743a3bc23208a5ae5b3b.js.map index b31b4820..f56eb877 100644 --- a/dist/830.3dad49e3bca3c0b28df2.js.map +++ b/dist/830.743a3bc23208a5ae5b3b.js.map @@ -1 +1 @@ -{"version":3,"file":"830.3dad49e3bca3c0b28df2.js","mappings":"8KA4BA,IAAIA,EACAC,EAKJC,eAAeC,IAMb,OALKH,IACHA,EAAgB,8BAChBC,SAAiBD,GAAsBI,SAGlCJ,EAGTK,WAAWF,EAXe,KAa1B,MAyLA,GAAeG,EAAAA,EAAAA,KAzLuB,IAehC,IAfiC,UACrCC,EADqC,GAErCC,EAFqC,cAGrCC,EAHqC,KAIrCC,EAJqC,YAKrCC,EALqC,MAMrCC,EANqC,OAOrCC,EAPqC,KAQrCC,EARqC,QASrCC,EATqC,cAUrCC,EAVqC,MAWrCC,EAXqC,sBAYrCC,EAZqC,OAarCC,EAbqC,QAcrCC,GACI,EACJ,MAAOC,EAAWC,IAAgBC,EAAAA,EAAAA,MAE5BC,GAAYC,EAAAA,EAAAA,IAAuB,MACnCC,GAAaD,EAAAA,EAAAA,KAAO,GACpBE,GAAWF,EAAAA,EAAAA,KAAO,GAClBG,GAAgBH,EAAAA,EAAAA,KAAO,GAEvBI,GAAUJ,EAAAA,EAAAA,MAChBI,EAAQC,QAAUpB,EAClB,MAAMqB,GAAiBN,EAAAA,EAAAA,MACvBM,EAAeD,QAAUnB,GAEzBqB,EAAAA,EAAAA,KAAU,KACR,GAAIX,IAAcZ,EAChB,OAGF,MAAMwB,EAAO,KACX,IAAKT,EAAUM,QACb,OAGF,MAAMI,EAAe,IAAIjC,EACvBO,EACAgB,EAAUM,QACVrB,EACA,CACEI,OAAAA,EACAC,KAAAA,EACAC,QAAAA,EACAC,cAAAA,GAEFG,EACAF,EACAG,GAGER,GACFsB,EAAaC,SAASvB,GAGxBU,EAAaY,IAGXjC,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,EAAUgK,UAAYA,GAGpBwJ,EAAAA,KACFxT,EAAU+B,MAAM0R,SAAW,M,8CCX/B,MASA,EATkBC,IAChBA,EAAQxU,OAAOyU,OAAOC,IAChBV,EAAAA,IAEFC,QAAQU,KAAKD,EAAKF,Q","sources":["webpack://telegram-t/./src/components/common/AnimatedSticker.tsx","webpack://telegram-t/./src/components/common/Avatar.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/components/ui/ConfirmDialog.tsx","webpack://telegram-t/./src/components/ui/InfiniteScroll.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Portal.ts","webpack://telegram-t/./src/hooks/useBackgroundMode.ts","webpack://telegram-t/./src/hooks/useCurrentOrPrev.ts","webpack://telegram-t/./src/hooks/useInfiniteScroll.ts","webpack://telegram-t/./src/hooks/useMedia.ts","webpack://telegram-t/./src/util/clipboard.ts","webpack://telegram-t/./src/util/forceReflow.ts","webpack://telegram-t/./src/util/resetScroll.ts","webpack://telegram-t/./src/util/safePlay.ts"],"sourcesContent":["import React, {\n FC, useEffect, useRef, memo, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\n\ntype OwnProps = {\n className?: string;\n id: string;\n animationData?: string;\n play?: boolean | string;\n playSegment?: [number, number];\n speed?: number;\n noLoop?: boolean;\n size: number;\n quality?: number;\n isLowPriority?: boolean;\n onLoad?: NoneToVoidFunction;\n forceOnHeavyAnimation?: boolean;\n color?: [number, number, number];\n onEnded?: NoneToVoidFunction;\n};\n\ntype RLottieClass = typeof import('../../lib/rlottie/RLottie').default;\ntype RLottieInstance = import('../../lib/rlottie/RLottie').default;\nlet lottiePromise: Promise;\nlet RLottie: RLottieClass;\n\n// Time for the main interface to completely load\nconst LOTTIE_LOAD_DELAY = 3000;\n\nasync function ensureLottie() {\n if (!lottiePromise) {\n lottiePromise = import('../../lib/rlottie/RLottie') as unknown as Promise;\n RLottie = (await lottiePromise as any).default;\n }\n\n return lottiePromise;\n}\n\nsetTimeout(ensureLottie, LOTTIE_LOAD_DELAY);\n\nconst AnimatedSticker: FC = ({\n className,\n id,\n animationData,\n play,\n playSegment,\n speed,\n noLoop,\n size,\n quality,\n isLowPriority,\n color,\n forceOnHeavyAnimation,\n onLoad,\n onEnded,\n}) => {\n const [animation, setAnimation] = useState();\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n const isFirstRender = useRef(true);\n\n const playRef = useRef();\n playRef.current = play;\n const playSegmentRef = useRef<[number, number]>();\n playSegmentRef.current = playSegment;\n\n useEffect(() => {\n if (animation || !animationData) {\n return;\n }\n\n const exec = () => {\n if (!container.current) {\n return;\n }\n\n const newAnimation = new RLottie(\n id,\n container.current,\n animationData,\n {\n noLoop,\n size,\n quality,\n isLowPriority,\n },\n onLoad,\n color,\n onEnded,\n );\n\n if (speed) {\n newAnimation.setSpeed(speed);\n }\n\n setAnimation(newAnimation);\n };\n\n if (RLottie) {\n exec();\n } else {\n ensureLottie().then(() => {\n fastRaf(() => {\n if (container.current) {\n exec();\n }\n });\n });\n }\n }, [color, animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed, onEnded]);\n\n useEffect(() => {\n if (!animation) return;\n\n animation.setColor(color);\n }, [color, animation]);\n\n useEffect(() => {\n return () => {\n if (animation) {\n animation.destroy();\n }\n };\n }, [animation]);\n\n const playAnimation = useCallback((shouldRestart = false) => {\n if (animation && (playRef.current || playSegmentRef.current)) {\n if (playSegmentRef.current) {\n animation.playSegment(playSegmentRef.current);\n } else if (shouldRestart) {\n animation.goToAndPlay(0);\n } else {\n animation.play();\n }\n }\n }, [animation]);\n\n const pauseAnimation = useCallback(() => {\n if (!animation) {\n return;\n }\n\n animation.pause();\n }, [animation]);\n\n const freezeAnimation = useCallback(() => {\n isFrozen.current = true;\n\n if (!animation) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = animation.isPlaying();\n }\n\n pauseAnimation();\n }, [animation, pauseAnimation]);\n\n const unfreezeAnimation = useCallback(() => {\n if (wasPlaying.current) {\n playAnimation();\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [playAnimation]);\n\n const unfreezeAnimationOnRaf = useCallback(() => {\n fastRaf(unfreezeAnimation);\n }, [unfreezeAnimation]);\n\n useEffect(() => {\n if (!animation) {\n return;\n }\n\n if (play || playSegment) {\n if (isFrozen.current) {\n wasPlaying.current = true;\n } else {\n playAnimation(noLoop);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isFrozen.current) {\n wasPlaying.current = false;\n } else {\n pauseAnimation();\n }\n }\n }, [animation, play, playSegment, noLoop, playAnimation, pauseAnimation]);\n\n useEffect(() => {\n if (animation) {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else if (animationData) {\n animation.changeData(animationData);\n playAnimation();\n }\n }\n }, [playAnimation, animation, animationData]);\n\n useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation, forceOnHeavyAnimation);\n // Pausing frame may not happen in background\n // so we need to make sure it happens right after focusing,\n // then we can play again.\n useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf);\n\n const fullClassName = buildClassName('AnimatedSticker', className);\n\n const style = size ? `width: ${size}px; height: ${size}px;` : undefined;\n\n return (\n \n );\n};\n\nexport default memo(AnimatedSticker);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser, ApiUserStatus,\n} from '../../api/types';\n\nimport { IS_TEST } from '../../config';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getUserColorKey,\n getUserFullName,\n isUserId,\n isChatWithRepliesBot,\n isDeletedUser,\n isUserOnline,\n} from '../../modules/helpers';\nimport { getFirstLetters } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport useMedia from '../../hooks/useMedia';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport './Avatar.scss';\n\ntype OwnProps = {\n className?: string;\n size?: 'micro' | 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n chat?: ApiChat;\n user?: ApiUser;\n photo?: ApiPhoto;\n userStatus?: ApiUserStatus;\n text?: string;\n isSavedMessages?: boolean;\n lastSyncTime?: number;\n onClick?: (e: ReactMouseEvent, hasPhoto: boolean) => void;\n};\n\nconst Avatar: FC = ({\n className,\n size = 'large',\n chat,\n user,\n photo,\n userStatus,\n text,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const isDeleted = user && isDeletedUser(user);\n const isReplies = user && isChatWithRepliesBot(user.id);\n let imageHash: string | undefined;\n\n if (!isSavedMessages && !isDeleted) {\n if (user) {\n imageHash = getChatAvatarHash(user);\n } else if (chat) {\n imageHash = getChatAvatarHash(chat);\n } else if (photo) {\n imageHash = `photo${photo.id}?size=m`;\n }\n }\n\n const blobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const hasBlobUrl = Boolean(blobUrl);\n const { transitionClassNames } = useShowTransition(hasBlobUrl, undefined, hasBlobUrl, 'slow');\n\n const lang = useLang();\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (isReplies) {\n content = ;\n } else if (blobUrl) {\n content = (\n \"\"\n );\n } else if (user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isUserId(chat.id) ? 2 : 1);\n } else if (text) {\n content = getFirstLetters(text, 2);\n }\n\n const isOnline = !isSavedMessages && user && userStatus && isUserOnline(user, userStatus);\n const fullClassName = buildClassName(\n `Avatar size-${size}`,\n className,\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n isReplies && 'replies-bot-account',\n isOnline && 'online',\n onClick && 'interactive',\n (!isSavedMessages && !blobUrl) && 'no-photo',\n );\n\n const hasImage = Boolean(isSavedMessages || blobUrl);\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (onClick) {\n onClick(e, hasImage);\n }\n }, [onClick, hasImage]);\n\n const senderId = (user || chat) && (user || chat)!.id;\n\n return (\n
\n {typeof content === 'string' ? renderText(content, [size === 'jumbo' ? 'hq_emoji' : 'emoji']) : content}\n
\n );\n};\n\nexport default memo(Avatar);\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nimport MonkeyIdle from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyIdle.tgs';\nimport MonkeyTracking from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyTracking.tgs';\nimport MonkeyClose from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyClose.tgs';\nimport MonkeyPeek from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyPeek.tgs';\n\nimport FoldersAll from '../../../assets/tgs/settings/FoldersAll.tgs';\nimport FoldersNew from '../../../assets/tgs/settings/FoldersNew.tgs';\nimport DiscussionGroups from '../../../assets/tgs/settings/DiscussionGroupsDucks.tgs';\n\nimport CameraFlip from '../../../assets/tgs/calls/CameraFlip.tgs';\nimport HandFilled from '../../../assets/tgs/calls/HandFilled.tgs';\nimport HandOutline from '../../../assets/tgs/calls/HandOutline.tgs';\nimport Speaker from '../../../assets/tgs/calls/Speaker.tgs';\nimport VoiceAllowTalk from '../../../assets/tgs/calls/VoiceAllowTalk.tgs';\nimport VoiceMini from '../../../assets/tgs/calls/VoiceMini.tgs';\nimport VoiceMuted from '../../../assets/tgs/calls/VoiceMuted.tgs';\nimport VoiceOutlined from '../../../assets/tgs/calls/VoiceOutlined.tgs';\n\nimport Peach from '../../../assets/tgs/animatedEmojis/Peach.tgs';\nimport Eggplant from '../../../assets/tgs/animatedEmojis/Eggplant.tgs';\nimport Cumshot from '../../../assets/tgs/animatedEmojis/Cumshot.tgs';\n\nimport JoinRequest from '../../../assets/tgs/invites/Requests.tgs';\nimport Invite from '../../../assets/tgs/invites/Invite.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n CameraFlip,\n HandFilled,\n HandOutline,\n Speaker,\n VoiceAllowTalk,\n VoiceMini,\n VoiceMuted,\n VoiceOutlined,\n Peach,\n Eggplant,\n Cumshot,\n JoinRequest,\n Invite,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","import React, { FC, memo, useCallback, useRef } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\n\nimport Modal from './Modal';\nimport Button from './Button';\n\ntype OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n title?: string;\n header?: FC;\n textParts?: TextPart[];\n text?: string;\n confirmLabel?: string;\n confirmHandler: () => void;\n confirmIsDestructive?: boolean;\n isButtonsInOneRow?: boolean;\n children?: React.ReactNode;\n};\n\nconst ConfirmDialog: FC = ({\n isOpen,\n onClose,\n onCloseAnimationEnd,\n title,\n header,\n text,\n textParts,\n confirmLabel = 'Confirm',\n confirmHandler,\n confirmIsDestructive,\n isButtonsInOneRow,\n children,\n}) => {\n const lang = useLang();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const handleSelectWithEnter = useCallback((index: number) => {\n if (index === -1) confirmHandler();\n }, [confirmHandler]);\n\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, handleSelectWithEnter, '.Button');\n\n return (\n \n {text && text.split('\\\\n').map((textPart) => (\n

{textPart}

\n ))}\n {textParts || children}\n
\n \n {confirmLabel}\n \n \n
\n \n );\n};\n\nexport default memo(ConfirmDialog);\n","import { RefObject, UIEvent } from 'react';\nimport { LoadMoreDirection } from '../../types';\n\nimport React, {\n FC, useCallback, useEffect, useLayoutEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport resetScroll from '../../util/resetScroll';\nimport { IS_ANDROID } from '../../util/environment';\n\ntype OwnProps = {\n ref?: RefObject;\n className?: string;\n onLoadMore?: ({ direction }: { direction: LoadMoreDirection; noScroll?: boolean }) => void;\n onScroll?: (e: UIEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n items?: any[];\n itemSelector?: string;\n preloadBackwards?: number;\n sensitiveArea?: number;\n withAbsolutePositioning?: boolean;\n maxHeight?: number;\n noScrollRestore?: boolean;\n noScrollRestoreOnTop?: boolean;\n noFastList?: boolean;\n cacheBuster?: any;\n children: React.ReactNode;\n};\n\nconst DEFAULT_LIST_SELECTOR = '.ListItem';\nconst DEFAULT_PRELOAD_BACKWARDS = 20;\nconst DEFAULT_SENSITIVE_AREA = 800;\n\nconst InfiniteScroll: FC = ({\n ref,\n className,\n onLoadMore,\n onScroll,\n onKeyDown,\n items,\n itemSelector = DEFAULT_LIST_SELECTOR,\n preloadBackwards = DEFAULT_PRELOAD_BACKWARDS,\n sensitiveArea = DEFAULT_SENSITIVE_AREA,\n withAbsolutePositioning,\n maxHeight,\n // Used to turn off restoring scroll position (e.g. for frequently re-ordered chat or user lists)\n noScrollRestore = false,\n noScrollRestoreOnTop = false,\n noFastList,\n // Used to re-query `listItemElements` if rendering is delayed by transition\n cacheBuster,\n children,\n}: OwnProps) => {\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const stateRef = useRef<{\n listItemElements?: NodeListOf;\n isScrollTopJustUpdated?: boolean;\n currentAnchor?: HTMLDivElement | undefined;\n currentAnchorTop?: number;\n }>({});\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(() => {\n if (!onLoadMore) {\n return [];\n }\n\n return [\n debounce((noScroll = false) => {\n onLoadMore({ direction: LoadMoreDirection.Backwards, noScroll });\n }, 1000, true, false),\n debounce(() => {\n onLoadMore({ direction: LoadMoreDirection.Forwards });\n }, 1000, true, false),\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [onLoadMore, items]);\n\n // Initial preload\n useEffect(() => {\n if (!loadMoreBackwards) {\n return;\n }\n\n if (preloadBackwards > 0 && (!items || items.length < preloadBackwards)) {\n loadMoreBackwards(true);\n return;\n }\n\n const { scrollHeight, clientHeight } = containerRef.current!;\n if (clientHeight && scrollHeight <= clientHeight) {\n loadMoreBackwards();\n }\n }, [items, loadMoreBackwards, preloadBackwards]);\n\n // Restore `scrollTop` after adding items\n useLayoutEffect(() => {\n const container = containerRef.current!;\n const state = stateRef.current;\n\n state.listItemElements = container.querySelectorAll(itemSelector);\n\n let newScrollTop;\n\n if (state.currentAnchor && Array.from(state.listItemElements).includes(state.currentAnchor)) {\n const { scrollTop } = container;\n const newAnchorTop = state.currentAnchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - state.currentAnchorTop!);\n } else {\n const nextAnchor = state.listItemElements[0];\n if (nextAnchor) {\n state.currentAnchor = nextAnchor;\n state.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n\n if (withAbsolutePositioning || noScrollRestore) {\n return;\n }\n\n if (noScrollRestoreOnTop && container.scrollTop === 0) {\n return;\n }\n\n resetScroll(container, newScrollTop);\n\n state.isScrollTopJustUpdated = true;\n }, [items, itemSelector, noScrollRestore, noScrollRestoreOnTop, cacheBuster, withAbsolutePositioning]);\n\n const handleScroll = useCallback((e: UIEvent) => {\n if (loadMoreForwards && loadMoreBackwards) {\n const {\n isScrollTopJustUpdated, currentAnchor, currentAnchorTop,\n } = stateRef.current;\n const listItemElements = stateRef.current.listItemElements!;\n\n if (isScrollTopJustUpdated) {\n stateRef.current.isScrollTopJustUpdated = false;\n return;\n }\n\n const listLength = listItemElements.length;\n const container = containerRef.current!;\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const top = listLength ? listItemElements[0].offsetTop : 0;\n const isNearTop = scrollTop <= top + sensitiveArea;\n const bottom = listLength\n ? listItemElements[listLength - 1].offsetTop + listItemElements[listLength - 1].offsetHeight\n : scrollHeight;\n const isNearBottom = bottom - (scrollTop + offsetHeight) <= sensitiveArea;\n let isUpdated = false;\n\n if (isNearTop) {\n const nextAnchor = listItemElements[0];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingUp = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop > currentAnchorTop\n );\n\n if (isMovingUp) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n loadMoreForwards();\n }\n }\n }\n\n if (isNearBottom) {\n const nextAnchor = listItemElements[listLength - 1];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingDown = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop < currentAnchorTop\n );\n\n if (isMovingDown) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n loadMoreBackwards();\n }\n }\n }\n\n if (!isUpdated) {\n if (currentAnchor?.offsetParent) {\n stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;\n } else {\n const nextAnchor = listItemElements[0];\n\n if (nextAnchor) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n }\n }\n\n if (onScroll) {\n onScroll(e);\n }\n }, [loadMoreBackwards, loadMoreForwards, onScroll, sensitiveArea]);\n\n return (\n \n {withAbsolutePositioning && items?.length ? (\n \n {children}\n
\n ) : children}\n
\n );\n};\n\nexport default InfiniteScroll;\n","import { RefObject } from 'react';\nimport React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: React.ReactNode;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n dialogRef?: RefObject;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\n dialogRef,\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n
\n {hasCloseButton && (\n \n \n \n )}\n
{title}
\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n \n \n
\n
\n
\n {renderHeader()}\n
\n {children}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import { FC, useRef, useLayoutEffect, VirtualElement } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: React.ReactNode;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children as VirtualElement, elementRef.current);\n};\n\nexport default Portal;\n","import { useEffect } from '../lib/teact/teact';\n\nexport default function useBackgroundMode(\n onBlur?: AnyToVoidFunction,\n onFocus?: AnyToVoidFunction,\n) {\n useEffect(() => {\n if (onBlur && !document.hasFocus()) {\n onBlur();\n }\n\n if (onBlur) {\n window.addEventListener('blur', onBlur);\n }\n\n if (onFocus) {\n window.addEventListener('focus', onFocus);\n }\n\n return () => {\n if (onFocus) {\n window.removeEventListener('focus', onFocus);\n }\n\n if (onBlur) {\n window.removeEventListener('blur', onBlur);\n }\n };\n }, [onBlur, onFocus]);\n}\n","import usePrevious from './usePrevious';\n\nexport default function useCurrentOrPrev(\n current: T, shouldSkipUndefined = false, shouldForceCurrent = false,\n): T | undefined {\n const prev = usePrevious(current, shouldSkipUndefined);\n\n // eslint-disable-next-line no-null/no-null\n return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;\n}\n","import { useCallback, useRef } from '../lib/teact/teact';\nimport { LoadMoreDirection } from '../types';\n\nimport { areSortedArraysEqual } from '../util/iteratees';\nimport useForceUpdate from './useForceUpdate';\nimport usePrevious from './usePrevious';\n\ntype GetMore = (args: { direction: LoadMoreDirection }) => void;\ntype LoadMoreBackwards = (args: { offsetId?: string | number }) => void;\n\nconst DEFAULT_LIST_SLICE = 30;\n\nconst useInfiniteScroll = (\n loadMoreBackwards?: LoadMoreBackwards,\n listIds?: ListId[],\n isDisabled = false,\n listSlice = DEFAULT_LIST_SLICE,\n): [ListId[]?, GetMore?] => {\n const lastParamsRef = useRef<{\n direction?: LoadMoreDirection;\n offsetId?: ListId;\n }>();\n\n const viewportIdsRef = useRef((() => {\n // Only run once to initialize\n if (!listIds || lastParamsRef.current) {\n return undefined;\n }\n\n const { newViewportIds } = getViewportSlice(listIds, LoadMoreDirection.Forwards, listSlice, listIds[0]);\n return newViewportIds;\n })());\n\n const forceUpdate = useForceUpdate();\n\n if (isDisabled) {\n lastParamsRef.current = {};\n }\n\n const prevListIds = usePrevious(listIds);\n const prevIsDisabled = usePrevious(isDisabled);\n if (listIds && !isDisabled && (listIds !== prevListIds || isDisabled !== prevIsDisabled)) {\n const { offsetId = listIds[0], direction = LoadMoreDirection.Forwards } = lastParamsRef.current || {};\n const { newViewportIds } = getViewportSlice(listIds, direction, listSlice, offsetId);\n\n if (!viewportIdsRef.current || !areSortedArraysEqual(viewportIdsRef.current, newViewportIds)) {\n viewportIdsRef.current = newViewportIds;\n }\n }\n\n const getMore: GetMore = useCallback(({\n direction,\n noScroll,\n }: { direction: LoadMoreDirection; noScroll?: boolean }) => {\n const viewportIds = viewportIdsRef.current;\n\n const offsetId = viewportIds\n ? direction === LoadMoreDirection.Backwards ? viewportIds[viewportIds.length - 1] : viewportIds[0]\n : undefined;\n\n if (!listIds) {\n if (loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n\n return;\n }\n\n if (!noScroll) {\n lastParamsRef.current = { ...lastParamsRef.current, direction, offsetId };\n }\n\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(listIds, direction, listSlice, offsetId);\n\n if (areSomeLocal && !(viewportIds && areSortedArraysEqual(viewportIds, newViewportIds))) {\n viewportIdsRef.current = newViewportIds;\n forceUpdate();\n }\n\n if (!areAllLocal && loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n }, [listIds, listSlice, loadMoreBackwards, forceUpdate]);\n\n return isDisabled ? [listIds] : [viewportIdsRef.current, getMore];\n};\n\nfunction getViewportSlice(\n sourceIds: ListId[],\n direction: LoadMoreDirection,\n listSlice: number,\n offsetId?: ListId,\n) {\n const { length } = sourceIds;\n const index = offsetId ? sourceIds.indexOf(offsetId) : 0;\n const isForwards = direction === LoadMoreDirection.Forwards;\n const indexForDirection = isForwards ? index : (index + 1) || length;\n const from = Math.max(0, indexForDirection - listSlice);\n const to = indexForDirection + listSlice - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n\nexport default useInfiniteScroll;\n","import { useEffect } from '../lib/teact/teact';\n\nimport { ApiMediaFormat } from '../api/types';\n\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nconst useMedia = (\n mediaHash: string | false | undefined,\n noLoad = false,\n mediaFormat = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n) => {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!noLoad && mediaHash && !mediaData) {\n const startedAt = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat).then(() => {\n const spentTime = Date.now() - startedAt;\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n }\n }, [noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, delay]);\n\n return mediaData;\n};\n\nexport default useMedia;\n","import { DEBUG } from '../config';\n\nexport const CLIPBOARD_ITEM_SUPPORTED = navigator.clipboard && window.ClipboardItem;\n\nconst textCopyEl = document.createElement('textarea');\ntextCopyEl.setAttribute('readonly', '');\ntextCopyEl.tabIndex = -1;\ntextCopyEl.className = 'visually-hidden';\n\nexport const copyTextToClipboard = (str: string): void => {\n textCopyEl.value = str;\n document.body.appendChild(textCopyEl);\n const selection = document.getSelection();\n\n if (selection) {\n // Store previous selection\n const rangeToRestore = selection.rangeCount > 0 && selection.getRangeAt(0);\n textCopyEl.select();\n document.execCommand('copy');\n // Restore the original selection\n if (rangeToRestore) {\n selection.removeAllRanges();\n selection.addRange(rangeToRestore);\n }\n }\n\n document.body.removeChild(textCopyEl);\n};\n\nexport const copyImageToClipboard = (imageUrl?: string) => {\n if (!imageUrl) return;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const imageEl = new Image();\n imageEl.onload = (e: Event) => {\n if (ctx && e.currentTarget) {\n const img = e.currentTarget as HTMLImageElement;\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.width, img.height);\n canvas.toBlob(copyBlobToClipboard, 'image/png', 1);\n }\n };\n\n imageEl.src = imageUrl;\n};\n\nasync function copyBlobToClipboard(pngBlob: Blob | null) {\n if (!pngBlob || !CLIPBOARD_ITEM_SUPPORTED) {\n return;\n }\n\n try {\n await navigator.clipboard.write?.([\n new ClipboardItem({\n [pngBlob.type]: pngBlob,\n }),\n ]);\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n}\n","// Used before applying CSS transition\nexport default function forceReflow(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n element.offsetWidth;\n}\n","import { IS_IOS } from './environment';\nimport forceReflow from './forceReflow';\n\nconst resetScroll = (container: HTMLDivElement, scrollTop?: number) => {\n if (IS_IOS) {\n container.style.overflow = 'hidden';\n }\n\n if (scrollTop !== undefined) {\n container.scrollTop = scrollTop;\n }\n\n if (IS_IOS) {\n container.style.overflow = '';\n }\n};\n\n// Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=1264266\nexport function patchChromiumScroll(element: HTMLElement) {\n element.style.display = 'none';\n forceReflow(element);\n element.style.display = '';\n}\n\nexport default resetScroll;\n","import { DEBUG } from '../config';\n\nconst safePlay = (mediaEl: HTMLMediaElement) => {\n mediaEl.play().catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err, mediaEl);\n }\n });\n};\n\nexport default safePlay;\n"],"names":["lottiePromise","RLottie","async","ensureLottie","default","setTimeout","memo","className","id","animationData","play","playSegment","speed","noLoop","size","quality","isLowPriority","color","forceOnHeavyAnimation","onLoad","onEnded","animation","setAnimation","useState","container","useRef","wasPlaying","isFrozen","isFirstRender","playRef","current","playSegmentRef","useEffect","exec","newAnimation","setSpeed","then","fastRaf","setColor","destroy","playAnimation","useCallback","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","changeData","useHeavyAnimationCheck","useBackgroundMode","fullClassName","buildClassName","style","undefined","ref","chat","user","photo","userStatus","text","isSavedMessages","lastSyncTime","onClick","isDeleted","isDeletedUser","isReplies","isChatWithRepliesBot","imageHash","getChatAvatarHash","blobUrl","useMedia","ApiMediaFormat","hasBlobUrl","Boolean","transitionClassNames","useShowTransition","lang","useLang","content","src","alt","decoding","userFullName","getUserFullName","getFirstLetters","title","getChatTitle","isUserId","isOnline","isUserOnline","getUserColorKey","hasImage","handleClick","e","senderId","IS_TEST","renderText","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","CameraFlip","HandFilled","HandOutline","Speaker","VoiceAllowTalk","VoiceMini","VoiceMuted","VoiceOutlined","Peach","Eggplant","Cumshot","JoinRequest","Invite","getAnimationData","name","path","replace","window","location","origin","mediaLoader","isOpen","onClose","onCloseAnimationEnd","header","textParts","confirmLabel","confirmHandler","confirmIsDestructive","isButtonsInOneRow","children","containerRef","handleSelectWithEnter","index","handleKeyDown","useKeyboardListNavigation","split","map","textPart","onKeyDown","isText","DEFAULT_LIST_SELECTOR","DEFAULT_PRELOAD_BACKWARDS","DEFAULT_SENSITIVE_AREA","onLoadMore","onScroll","items","itemSelector","preloadBackwards","sensitiveArea","withAbsolutePositioning","maxHeight","noScrollRestore","noScrollRestoreOnTop","noFastList","cacheBuster","stateRef","loadMoreBackwards","loadMoreForwards","useMemo","debounce","noScroll","direction","LoadMoreDirection","length","scrollHeight","clientHeight","useLayoutEffect","state","newScrollTop","listItemElements","querySelectorAll","currentAnchor","Array","from","includes","scrollTop","getBoundingClientRect","top","currentAnchorTop","nextAnchor","resetScroll","isScrollTopJustUpdated","handleScroll","listLength","offsetHeight","isNearTop","offsetTop","isNearBottom","isUpdated","nextAnchorTop","newAnchorTop","offsetParent","teactFastList","IS_ANDROID","dialogRef","hasCloseButton","noBackdrop","onEnter","shouldSkipHistoryAnimations","shouldRender","modalRef","captureKeyboardListeners","onEsc","element","key","preventDefault","stopPropagation","focusableElements","currentFocusedIndex","findIndex","em","isSameNode","document","activeElement","newFocusedIndex","shiftKey","focus","addEventListener","removeEventListener","trapFocus","forceClose","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","Portal","tabIndex","role","Button","round","ariaLabel","containerId","elementRef","createElement","querySelector","add","appendChild","TeactDOM","removeChild","onBlur","onFocus","hasFocus","useCurrentOrPrev","shouldSkipUndefined","shouldForceCurrent","prev","usePrevious","getViewportSlice","sourceIds","listSlice","offsetId","indexOf","indexForDirection","Math","max","to","newViewportIds","slice","areSomeLocal","areAllLocal","listIds","isDisabled","lastParamsRef","viewportIdsRef","forceUpdate","useForceUpdate","prevListIds","prevIsDisabled","areSortedArraysEqual","getMore","viewportIds","mediaHash","noLoad","mediaFormat","delay","mediaData","startedAt","Date","now","spentTime","CLIPBOARD_ITEM_SUPPORTED","navigator","clipboard","ClipboardItem","textCopyEl","setAttribute","copyTextToClipboard","str","value","selection","getSelection","rangeToRestore","rangeCount","getRangeAt","select","execCommand","removeAllRanges","addRange","copyImageToClipboard","imageUrl","canvas","ctx","getContext","imageEl","Image","onload","currentTarget","img","width","height","drawImage","toBlob","copyBlobToClipboard","pngBlob","write","type","error","DEBUG","console","forceReflow","offsetWidth","patchChromiumScroll","display","IS_IOS","overflow","mediaEl","catch","err","warn"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"830.743a3bc23208a5ae5b3b.js","mappings":"8KA4BA,IAAIA,EACAC,EAKJC,eAAeC,IAMb,OALKH,IACHA,EAAgB,8BAChBC,SAAiBD,GAAsBI,SAGlCJ,EAGTK,WAAWF,EAXe,KAa1B,MAyLA,GAAeG,EAAAA,EAAAA,KAzLuB,IAehC,IAfiC,UACrCC,EADqC,GAErCC,EAFqC,cAGrCC,EAHqC,KAIrCC,EAJqC,YAKrCC,EALqC,MAMrCC,EANqC,OAOrCC,EAPqC,KAQrCC,EARqC,QASrCC,EATqC,cAUrCC,EAVqC,MAWrCC,EAXqC,sBAYrCC,EAZqC,OAarCC,EAbqC,QAcrCC,GACI,EACJ,MAAOC,EAAWC,IAAgBC,EAAAA,EAAAA,MAE5BC,GAAYC,EAAAA,EAAAA,IAAuB,MACnCC,GAAaD,EAAAA,EAAAA,KAAO,GACpBE,GAAWF,EAAAA,EAAAA,KAAO,GAClBG,GAAgBH,EAAAA,EAAAA,KAAO,GAEvBI,GAAUJ,EAAAA,EAAAA,MAChBI,EAAQC,QAAUpB,EAClB,MAAMqB,GAAiBN,EAAAA,EAAAA,MACvBM,EAAeD,Q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ACHC,EAAAA,IAEFC,QAAQF,MAAMA,M,eC5DL,SAASG,EAAYxH,GAElCA,EAAQyH,Y,kFCeH,SAASC,EAAoB1H,GAClCA,EAAQ7J,MAAMwR,QAAU,QACxBH,EAAAA,EAAAA,GAAYxH,GACZA,EAAQ7J,MAAMwR,QAAU,GAG1B,QArBoB,CAACvT,EAA2BgK,KAC1CwJ,EAAAA,KACFxT,EAAU+B,MAAM0R,SAAW,eAGXzR,IAAdgI,IACFhK,EAAUgK,UAAYA,GAGpBwJ,EAAAA,KACFxT,EAAU+B,MAAM0R,SAAW,M,8CCX/B,MASA,EATkBC,IAChBA,EAAQxU,OAAOyU,OAAOC,IAChBV,EAAAA,IAEFC,QAAQU,KAAKD,EAAKF,Q","sources":["webpack://telegram-t/./src/components/common/AnimatedSticker.tsx","webpack://telegram-t/./src/components/common/Avatar.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/components/ui/ConfirmDialog.tsx","webpack://telegram-t/./src/components/ui/InfiniteScroll.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Portal.ts","webpack://telegram-t/./src/hooks/useBackgroundMode.ts","webpack://telegram-t/./src/hooks/useCurrentOrPrev.ts","webpack://telegram-t/./src/hooks/useInfiniteScroll.ts","webpack://telegram-t/./src/hooks/useMedia.ts","webpack://telegram-t/./src/util/clipboard.ts","webpack://telegram-t/./src/util/forceReflow.ts","webpack://telegram-t/./src/util/resetScroll.ts","webpack://telegram-t/./src/util/safePlay.ts"],"sourcesContent":["import React, {\n FC, useEffect, useRef, memo, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\n\ntype OwnProps = {\n className?: string;\n id: string;\n animationData?: string;\n play?: boolean | string;\n playSegment?: [number, number];\n speed?: number;\n noLoop?: boolean;\n size: number;\n quality?: number;\n isLowPriority?: boolean;\n onLoad?: NoneToVoidFunction;\n forceOnHeavyAnimation?: boolean;\n color?: [number, number, number];\n onEnded?: NoneToVoidFunction;\n};\n\ntype RLottieClass = typeof import('../../lib/rlottie/RLottie').default;\ntype RLottieInstance = import('../../lib/rlottie/RLottie').default;\nlet lottiePromise: Promise;\nlet RLottie: RLottieClass;\n\n// Time for the main interface to completely load\nconst LOTTIE_LOAD_DELAY = 3000;\n\nasync function ensureLottie() {\n if (!lottiePromise) {\n lottiePromise = import('../../lib/rlottie/RLottie') as unknown as Promise;\n RLottie = (await lottiePromise as any).default;\n }\n\n return lottiePromise;\n}\n\nsetTimeout(ensureLottie, LOTTIE_LOAD_DELAY);\n\nconst AnimatedSticker: FC = ({\n className,\n id,\n animationData,\n play,\n playSegment,\n speed,\n noLoop,\n size,\n quality,\n isLowPriority,\n color,\n forceOnHeavyAnimation,\n onLoad,\n onEnded,\n}) => {\n const [animation, setAnimation] = useState();\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n const isFirstRender = useRef(true);\n\n const playRef = useRef();\n playRef.current = play;\n const playSegmentRef = useRef<[number, number]>();\n playSegmentRef.current = playSegment;\n\n useEffect(() => {\n if (animation || !animationData) {\n return;\n }\n\n const exec = () => {\n if (!container.current) {\n return;\n }\n\n const newAnimation = new RLottie(\n id,\n container.current,\n animationData,\n {\n noLoop,\n size,\n quality,\n isLowPriority,\n },\n onLoad,\n color,\n onEnded,\n );\n\n if (speed) {\n newAnimation.setSpeed(speed);\n }\n\n setAnimation(newAnimation);\n };\n\n if (RLottie) {\n exec();\n } else {\n ensureLottie().then(() => {\n fastRaf(() => {\n if (container.current) {\n exec();\n }\n });\n });\n }\n }, [color, animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed, onEnded]);\n\n useEffect(() => {\n if (!animation) return;\n\n animation.setColor(color);\n }, [color, animation]);\n\n useEffect(() => {\n return () => {\n if (animation) {\n animation.destroy();\n }\n };\n }, [animation]);\n\n const playAnimation = useCallback((shouldRestart = false) => {\n if (animation && (playRef.current || playSegmentRef.current)) {\n if (playSegmentRef.current) {\n animation.playSegment(playSegmentRef.current);\n } else if (shouldRestart) {\n animation.goToAndPlay(0);\n } else {\n animation.play();\n }\n }\n }, [animation]);\n\n const pauseAnimation = useCallback(() => {\n if (!animation) {\n return;\n }\n\n animation.pause();\n }, [animation]);\n\n const freezeAnimation = useCallback(() => {\n isFrozen.current = true;\n\n if (!animation) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = animation.isPlaying();\n }\n\n pauseAnimation();\n }, [animation, pauseAnimation]);\n\n const unfreezeAnimation = useCallback(() => {\n if (wasPlaying.current) {\n playAnimation();\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [playAnimation]);\n\n const unfreezeAnimationOnRaf = useCallback(() => {\n fastRaf(unfreezeAnimation);\n }, [unfreezeAnimation]);\n\n useEffect(() => {\n if (!animation) {\n return;\n }\n\n if (play || playSegment) {\n if (isFrozen.current) {\n wasPlaying.current = true;\n } else {\n playAnimation(noLoop);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isFrozen.current) {\n wasPlaying.current = false;\n } else {\n pauseAnimation();\n }\n }\n }, [animation, play, playSegment, noLoop, playAnimation, pauseAnimation]);\n\n useEffect(() => {\n if (animation) {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else if (animationData) {\n animation.changeData(animationData);\n playAnimation();\n }\n }\n }, [playAnimation, animation, animationData]);\n\n useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation, forceOnHeavyAnimation);\n // Pausing frame may not happen in background\n // so we need to make sure it happens right after focusing,\n // then we can play again.\n useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf);\n\n const fullClassName = buildClassName('AnimatedSticker', className);\n\n const style = size ? `width: ${size}px; height: ${size}px;` : undefined;\n\n return (\n \n );\n};\n\nexport default memo(AnimatedSticker);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser, ApiUserStatus,\n} from '../../api/types';\n\nimport { IS_TEST } from '../../config';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getUserColorKey,\n getUserFullName,\n isUserId,\n isChatWithRepliesBot,\n isDeletedUser,\n isUserOnline,\n} from '../../modules/helpers';\nimport { getFirstLetters } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport useMedia from '../../hooks/useMedia';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport './Avatar.scss';\n\ntype OwnProps = {\n className?: string;\n size?: 'micro' | 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n chat?: ApiChat;\n user?: ApiUser;\n photo?: ApiPhoto;\n userStatus?: ApiUserStatus;\n text?: string;\n isSavedMessages?: boolean;\n lastSyncTime?: number;\n onClick?: (e: ReactMouseEvent, hasPhoto: boolean) => void;\n};\n\nconst Avatar: FC = ({\n className,\n size = 'large',\n chat,\n user,\n photo,\n userStatus,\n text,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const isDeleted = user && isDeletedUser(user);\n const isReplies = user && isChatWithRepliesBot(user.id);\n let imageHash: string | undefined;\n\n if (!isSavedMessages && !isDeleted) {\n if (user) {\n imageHash = getChatAvatarHash(user);\n } else if (chat) {\n imageHash = getChatAvatarHash(chat);\n } else if (photo) {\n imageHash = `photo${photo.id}?size=m`;\n }\n }\n\n const blobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const hasBlobUrl = Boolean(blobUrl);\n const { transitionClassNames } = useShowTransition(hasBlobUrl, undefined, hasBlobUrl, 'slow');\n\n const lang = useLang();\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (isReplies) {\n content = ;\n } else if (blobUrl) {\n content = (\n \"\"\n );\n } else if (user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isUserId(chat.id) ? 2 : 1);\n } else if (text) {\n content = getFirstLetters(text, 2);\n }\n\n const isOnline = !isSavedMessages && user && userStatus && isUserOnline(user, userStatus);\n const fullClassName = buildClassName(\n `Avatar size-${size}`,\n className,\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n isReplies && 'replies-bot-account',\n isOnline && 'online',\n onClick && 'interactive',\n (!isSavedMessages && !blobUrl) && 'no-photo',\n );\n\n const hasImage = Boolean(isSavedMessages || blobUrl);\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (onClick) {\n onClick(e, hasImage);\n }\n }, [onClick, hasImage]);\n\n const senderId = (user || chat) && (user || chat)!.id;\n\n return (\n
\n {typeof content === 'string' ? renderText(content, [size === 'jumbo' ? 'hq_emoji' : 'emoji']) : content}\n
\n );\n};\n\nexport default memo(Avatar);\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nimport MonkeyIdle from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyIdle.tgs';\nimport MonkeyTracking from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyTracking.tgs';\nimport MonkeyClose from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyClose.tgs';\nimport MonkeyPeek from '../../../assets/tgs/monkeys/TwoFactorSetupMonkeyPeek.tgs';\n\nimport FoldersAll from '../../../assets/tgs/settings/FoldersAll.tgs';\nimport FoldersNew from '../../../assets/tgs/settings/FoldersNew.tgs';\nimport DiscussionGroups from '../../../assets/tgs/settings/DiscussionGroupsDucks.tgs';\n\nimport CameraFlip from '../../../assets/tgs/calls/CameraFlip.tgs';\nimport HandFilled from '../../../assets/tgs/calls/HandFilled.tgs';\nimport HandOutline from '../../../assets/tgs/calls/HandOutline.tgs';\nimport Speaker from '../../../assets/tgs/calls/Speaker.tgs';\nimport VoiceAllowTalk from '../../../assets/tgs/calls/VoiceAllowTalk.tgs';\nimport VoiceMini from '../../../assets/tgs/calls/VoiceMini.tgs';\nimport VoiceMuted from '../../../assets/tgs/calls/VoiceMuted.tgs';\nimport VoiceOutlined from '../../../assets/tgs/calls/VoiceOutlined.tgs';\n\nimport Peach from '../../../assets/tgs/animatedEmojis/Peach.tgs';\nimport Eggplant from '../../../assets/tgs/animatedEmojis/Eggplant.tgs';\nimport Cumshot from '../../../assets/tgs/animatedEmojis/Cumshot.tgs';\n\nimport JoinRequest from '../../../assets/tgs/invites/Requests.tgs';\nimport Invite from '../../../assets/tgs/invites/Invite.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n CameraFlip,\n HandFilled,\n HandOutline,\n Speaker,\n VoiceAllowTalk,\n VoiceMini,\n VoiceMuted,\n VoiceOutlined,\n Peach,\n Eggplant,\n Cumshot,\n JoinRequest,\n Invite,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","import React, { FC, memo, useCallback, useRef } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\n\nimport Modal from './Modal';\nimport Button from './Button';\n\ntype OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n title?: string;\n header?: FC;\n textParts?: TextPart[];\n text?: string;\n confirmLabel?: string;\n confirmHandler: () => void;\n confirmIsDestructive?: boolean;\n isButtonsInOneRow?: boolean;\n children?: React.ReactNode;\n};\n\nconst ConfirmDialog: FC = ({\n isOpen,\n onClose,\n onCloseAnimationEnd,\n title,\n header,\n text,\n textParts,\n confirmLabel = 'Confirm',\n confirmHandler,\n confirmIsDestructive,\n isButtonsInOneRow,\n children,\n}) => {\n const lang = useLang();\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const handleSelectWithEnter = useCallback((index: number) => {\n if (index === -1) confirmHandler();\n }, [confirmHandler]);\n\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, handleSelectWithEnter, '.Button');\n\n return (\n \n {text && text.split('\\\\n').map((textPart) => (\n

{textPart}

\n ))}\n {textParts || children}\n
\n \n {confirmLabel}\n \n \n
\n \n );\n};\n\nexport default memo(ConfirmDialog);\n","import { RefObject, UIEvent } from 'react';\nimport { LoadMoreDirection } from '../../types';\n\nimport React, {\n FC, useCallback, useEffect, useLayoutEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport resetScroll from '../../util/resetScroll';\nimport { IS_ANDROID } from '../../util/environment';\n\ntype OwnProps = {\n ref?: RefObject;\n className?: string;\n onLoadMore?: ({ direction }: { direction: LoadMoreDirection; noScroll?: boolean }) => void;\n onScroll?: (e: UIEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n items?: any[];\n itemSelector?: string;\n preloadBackwards?: number;\n sensitiveArea?: number;\n withAbsolutePositioning?: boolean;\n maxHeight?: number;\n noScrollRestore?: boolean;\n noScrollRestoreOnTop?: boolean;\n noFastList?: boolean;\n cacheBuster?: any;\n children: React.ReactNode;\n};\n\nconst DEFAULT_LIST_SELECTOR = '.ListItem';\nconst DEFAULT_PRELOAD_BACKWARDS = 20;\nconst DEFAULT_SENSITIVE_AREA = 800;\n\nconst InfiniteScroll: FC = ({\n ref,\n className,\n onLoadMore,\n onScroll,\n onKeyDown,\n items,\n itemSelector = DEFAULT_LIST_SELECTOR,\n preloadBackwards = DEFAULT_PRELOAD_BACKWARDS,\n sensitiveArea = DEFAULT_SENSITIVE_AREA,\n withAbsolutePositioning,\n maxHeight,\n // Used to turn off restoring scroll position (e.g. for frequently re-ordered chat or user lists)\n noScrollRestore = false,\n noScrollRestoreOnTop = false,\n noFastList,\n // Used to re-query `listItemElements` if rendering is delayed by transition\n cacheBuster,\n children,\n}: OwnProps) => {\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const stateRef = useRef<{\n listItemElements?: NodeListOf;\n isScrollTopJustUpdated?: boolean;\n currentAnchor?: HTMLDivElement | undefined;\n currentAnchorTop?: number;\n }>({});\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(() => {\n if (!onLoadMore) {\n return [];\n }\n\n return [\n debounce((noScroll = false) => {\n onLoadMore({ direction: LoadMoreDirection.Backwards, noScroll });\n }, 1000, true, false),\n debounce(() => {\n onLoadMore({ direction: LoadMoreDirection.Forwards });\n }, 1000, true, false),\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [onLoadMore, items]);\n\n // Initial preload\n useEffect(() => {\n if (!loadMoreBackwards) {\n return;\n }\n\n if (preloadBackwards > 0 && (!items || items.length < preloadBackwards)) {\n loadMoreBackwards(true);\n return;\n }\n\n const { scrollHeight, clientHeight } = containerRef.current!;\n if (clientHeight && scrollHeight <= clientHeight) {\n loadMoreBackwards();\n }\n }, [items, loadMoreBackwards, preloadBackwards]);\n\n // Restore `scrollTop` after adding items\n useLayoutEffect(() => {\n const container = containerRef.current!;\n const state = stateRef.current;\n\n state.listItemElements = container.querySelectorAll(itemSelector);\n\n let newScrollTop;\n\n if (state.currentAnchor && Array.from(state.listItemElements).includes(state.currentAnchor)) {\n const { scrollTop } = container;\n const newAnchorTop = state.currentAnchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - state.currentAnchorTop!);\n } else {\n const nextAnchor = state.listItemElements[0];\n if (nextAnchor) {\n state.currentAnchor = nextAnchor;\n state.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n\n if (withAbsolutePositioning || noScrollRestore) {\n return;\n }\n\n if (noScrollRestoreOnTop && container.scrollTop === 0) {\n return;\n }\n\n resetScroll(container, newScrollTop);\n\n state.isScrollTopJustUpdated = true;\n }, [items, itemSelector, noScrollRestore, noScrollRestoreOnTop, cacheBuster, withAbsolutePositioning]);\n\n const handleScroll = useCallback((e: UIEvent) => {\n if (loadMoreForwards && loadMoreBackwards) {\n const {\n isScrollTopJustUpdated, currentAnchor, currentAnchorTop,\n } = stateRef.current;\n const listItemElements = stateRef.current.listItemElements!;\n\n if (isScrollTopJustUpdated) {\n stateRef.current.isScrollTopJustUpdated = false;\n return;\n }\n\n const listLength = listItemElements.length;\n const container = containerRef.current!;\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const top = listLength ? listItemElements[0].offsetTop : 0;\n const isNearTop = scrollTop <= top + sensitiveArea;\n const bottom = listLength\n ? listItemElements[listLength - 1].offsetTop + listItemElements[listLength - 1].offsetHeight\n : scrollHeight;\n const isNearBottom = bottom - (scrollTop + offsetHeight) <= sensitiveArea;\n let isUpdated = false;\n\n if (isNearTop) {\n const nextAnchor = listItemElements[0];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingUp = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop > currentAnchorTop\n );\n\n if (isMovingUp) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n loadMoreForwards();\n }\n }\n }\n\n if (isNearBottom) {\n const nextAnchor = listItemElements[listLength - 1];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingDown = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop < currentAnchorTop\n );\n\n if (isMovingDown) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n loadMoreBackwards();\n }\n }\n }\n\n if (!isUpdated) {\n if (currentAnchor?.offsetParent) {\n stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;\n } else {\n const nextAnchor = listItemElements[0];\n\n if (nextAnchor) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n }\n }\n\n if (onScroll) {\n onScroll(e);\n }\n }, [loadMoreBackwards, loadMoreForwards, onScroll, sensitiveArea]);\n\n return (\n \n {withAbsolutePositioning && items?.length ? (\n \n {children}\n \n ) : children}\n \n );\n};\n\nexport default InfiniteScroll;\n","import { RefObject } from 'react';\nimport React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: React.ReactNode;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n dialogRef?: RefObject;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\n dialogRef,\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n
\n {hasCloseButton && (\n \n \n \n )}\n
{title}
\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n \n \n
\n
\n
\n {renderHeader()}\n
\n {children}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import { FC, useRef, useLayoutEffect, VirtualElement } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: React.ReactNode;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children as VirtualElement, elementRef.current);\n};\n\nexport default Portal;\n","import { useEffect } from '../lib/teact/teact';\n\nexport default function useBackgroundMode(\n onBlur?: AnyToVoidFunction,\n onFocus?: AnyToVoidFunction,\n) {\n useEffect(() => {\n if (onBlur && !document.hasFocus()) {\n onBlur();\n }\n\n if (onBlur) {\n window.addEventListener('blur', onBlur);\n }\n\n if (onFocus) {\n window.addEventListener('focus', onFocus);\n }\n\n return () => {\n if (onFocus) {\n window.removeEventListener('focus', onFocus);\n }\n\n if (onBlur) {\n window.removeEventListener('blur', onBlur);\n }\n };\n }, [onBlur, onFocus]);\n}\n","import usePrevious from './usePrevious';\n\nexport default function useCurrentOrPrev(\n current: T, shouldSkipUndefined = false, shouldForceCurrent = false,\n): T | undefined {\n const prev = usePrevious(current, shouldSkipUndefined);\n\n // eslint-disable-next-line no-null/no-null\n return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;\n}\n","import { useCallback, useRef } from '../lib/teact/teact';\nimport { LoadMoreDirection } from '../types';\n\nimport { areSortedArraysEqual } from '../util/iteratees';\nimport useForceUpdate from './useForceUpdate';\nimport usePrevious from './usePrevious';\n\ntype GetMore = (args: { direction: LoadMoreDirection }) => void;\ntype LoadMoreBackwards = (args: { offsetId?: string | number }) => void;\n\nconst DEFAULT_LIST_SLICE = 30;\n\nconst useInfiniteScroll = (\n loadMoreBackwards?: LoadMoreBackwards,\n listIds?: ListId[],\n isDisabled = false,\n listSlice = DEFAULT_LIST_SLICE,\n): [ListId[]?, GetMore?] => {\n const lastParamsRef = useRef<{\n direction?: LoadMoreDirection;\n offsetId?: ListId;\n }>();\n\n const viewportIdsRef = useRef((() => {\n // Only run once to initialize\n if (!listIds || lastParamsRef.current) {\n return undefined;\n }\n\n const { newViewportIds } = getViewportSlice(listIds, LoadMoreDirection.Forwards, listSlice, listIds[0]);\n return newViewportIds;\n })());\n\n const forceUpdate = useForceUpdate();\n\n if (isDisabled) {\n lastParamsRef.current = {};\n }\n\n const prevListIds = usePrevious(listIds);\n const prevIsDisabled = usePrevious(isDisabled);\n if (listIds && !isDisabled && (listIds !== prevListIds || isDisabled !== prevIsDisabled)) {\n const { offsetId = listIds[0], direction = LoadMoreDirection.Forwards } = lastParamsRef.current || {};\n const { newViewportIds } = getViewportSlice(listIds, direction, listSlice, offsetId);\n\n if (!viewportIdsRef.current || !areSortedArraysEqual(viewportIdsRef.current, newViewportIds)) {\n viewportIdsRef.current = newViewportIds;\n }\n }\n\n const getMore: GetMore = useCallback(({\n direction,\n noScroll,\n }: { direction: LoadMoreDirection; noScroll?: boolean }) => {\n const viewportIds = viewportIdsRef.current;\n\n const offsetId = viewportIds\n ? direction === LoadMoreDirection.Backwards ? viewportIds[viewportIds.length - 1] : viewportIds[0]\n : undefined;\n\n if (!listIds) {\n if (loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n\n return;\n }\n\n if (!noScroll) {\n lastParamsRef.current = { ...lastParamsRef.current, direction, offsetId };\n }\n\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(listIds, direction, listSlice, offsetId);\n\n if (areSomeLocal && !(viewportIds && areSortedArraysEqual(viewportIds, newViewportIds))) {\n viewportIdsRef.current = newViewportIds;\n forceUpdate();\n }\n\n if (!areAllLocal && loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n }, [listIds, listSlice, loadMoreBackwards, forceUpdate]);\n\n return isDisabled ? [listIds] : [viewportIdsRef.current, getMore];\n};\n\nfunction getViewportSlice(\n sourceIds: ListId[],\n direction: LoadMoreDirection,\n listSlice: number,\n offsetId?: ListId,\n) {\n const { length } = sourceIds;\n const index = offsetId ? sourceIds.indexOf(offsetId) : 0;\n const isForwards = direction === LoadMoreDirection.Forwards;\n const indexForDirection = isForwards ? index : (index + 1) || length;\n const from = Math.max(0, indexForDirection - listSlice);\n const to = indexForDirection + listSlice - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n\nexport default useInfiniteScroll;\n","import { useEffect } from '../lib/teact/teact';\n\nimport { ApiMediaFormat } from '../api/types';\n\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nconst useMedia = (\n mediaHash: string | false | undefined,\n noLoad = false,\n mediaFormat = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n) => {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!noLoad && mediaHash && !mediaData) {\n const startedAt = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat).then(() => {\n const spentTime = Date.now() - startedAt;\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n }\n }, [noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, delay]);\n\n return mediaData;\n};\n\nexport default useMedia;\n","import { DEBUG } from '../config';\n\nexport const CLIPBOARD_ITEM_SUPPORTED = navigator.clipboard && window.ClipboardItem;\n\nconst textCopyEl = document.createElement('textarea');\ntextCopyEl.setAttribute('readonly', '');\ntextCopyEl.tabIndex = -1;\ntextCopyEl.className = 'visually-hidden';\n\nexport const copyTextToClipboard = (str: string): void => {\n textCopyEl.value = str;\n document.body.appendChild(textCopyEl);\n const selection = document.getSelection();\n\n if (selection) {\n // Store previous selection\n const rangeToRestore = selection.rangeCount > 0 && selection.getRangeAt(0);\n textCopyEl.select();\n document.execCommand('copy');\n // Restore the original selection\n if (rangeToRestore) {\n selection.removeAllRanges();\n selection.addRange(rangeToRestore);\n }\n }\n\n document.body.removeChild(textCopyEl);\n};\n\nexport const copyImageToClipboard = (imageUrl?: string) => {\n if (!imageUrl) return;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const imageEl = new Image();\n imageEl.onload = (e: Event) => {\n if (ctx && e.currentTarget) {\n const img = e.currentTarget as HTMLImageElement;\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.width, img.height);\n canvas.toBlob(copyBlobToClipboard, 'image/png', 1);\n }\n };\n\n imageEl.src = imageUrl;\n};\n\nasync function copyBlobToClipboard(pngBlob: Blob | null) {\n if (!pngBlob || !CLIPBOARD_ITEM_SUPPORTED) {\n return;\n }\n\n try {\n await navigator.clipboard.write?.([\n new ClipboardItem({\n [pngBlob.type]: pngBlob,\n }),\n ]);\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n}\n","// Used before applying CSS transition\nexport default function forceReflow(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n element.offsetWidth;\n}\n","import { IS_IOS } from './environment';\nimport forceReflow from './forceReflow';\n\nconst resetScroll = (container: HTMLDivElement, scrollTop?: number) => {\n if (IS_IOS) {\n container.style.overflow = 'hidden';\n }\n\n if (scrollTop !== undefined) {\n container.scrollTop = scrollTop;\n }\n\n if (IS_IOS) {\n container.style.overflow = '';\n }\n};\n\n// Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=1264266\nexport function patchChromiumScroll(element: HTMLElement) {\n element.style.display = 'none';\n forceReflow(element);\n element.style.display = '';\n}\n\nexport default resetScroll;\n","import { DEBUG } from '../config';\n\nconst safePlay = (mediaEl: HTMLMediaElement) => {\n mediaEl.play().catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err, mediaEl);\n }\n });\n};\n\nexport default safePlay;\n"],"names":["lottiePromise","RLottie","async","ensureLottie","default","setTimeout","memo","className","id","animationData","play","playSegment","speed","noLoop","size","quality","isLowPriority","color","forceOnHeavyAnimation","onLoad","onEnded","animation","setAnimation","useState","container","useRef","wasPlaying","isFrozen","isFirstRender","playRef","current","playSegmentRef","useEffect","exec","newAnimation","setSpeed","then","fastRaf","setColor","destroy","playAnimation","useCallback","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","changeData","useHeavyAnimationCheck","useBackgroundMode","fullClassName","buildClassName","style","undefined","ref","chat","user","photo","userStatus","text","isSavedMessages","lastSyncTime","onClick","isDeleted","isDeletedUser","isReplies","isChatWithRepliesBot","imageHash","getChatAvatarHash","blobUrl","useMedia","ApiMediaFormat","hasBlobUrl","Boolean","transitionClassNames","useShowTransition","lang","useLang","content","src","alt","decoding","userFullName","getUserFullName","getFirstLetters","title","getChatTitle","isUserId","isOnline","isUserOnline","getUserColorKey","hasImage","handleClick","e","senderId","IS_TEST","renderText","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","CameraFlip","HandFilled","HandOutline","Speaker","VoiceAllowTalk","VoiceMini","VoiceMuted","VoiceOutlined","Peach","Eggplant","Cumshot","JoinRequest","Invite","getAnimationData","name","path","replace","window","location","origin","mediaLoader","isOpen","onClose","onCloseAnimationEnd","header","textParts","confirmLabel","confirmHandler","confirmIsDestructive","isButtonsInOneRow","children","containerRef","handleSelectWithEnter","index","handleKeyDown","useKeyboardListNavigation","split","map","textPart","onKeyDown","isText","DEFAULT_LIST_SELECTOR","DEFAULT_PRELOAD_BACKWARDS","DEFAULT_SENSITIVE_AREA","onLoadMore","onScroll","items","itemSelector","preloadBackwards","sensitiveArea","withAbsolutePositioning","maxHeight","noScrollRestore","noScrollRestoreOnTop","noFastList","cacheBuster","stateRef","loadMoreBackwards","loadMoreForwards","useMemo","debounce","noScroll","direction","LoadMoreDirection","length","scrollHeight","clientHeight","useLayoutEffect","state","newScrollTop","listItemElements","querySelectorAll","currentAnchor","Array","from","includes","scrollTop","getBoundingClientRect","top","currentAnchorTop","nextAnchor","resetScroll","isScrollTopJustUpdated","handleScroll","listLength","offsetHeight","isNearTop","offsetTop","isNearBottom","isUpdated","nextAnchorTop","newAnchorTop","offsetParent","teactFastList","IS_ANDROID","dialogRef","hasCloseButton","noBackdrop","onEnter","shouldSkipHistoryAnimations","shouldRender","modalRef","captureKeyboardListeners","onEsc","element","key","preventDefault","stopPropagation","focusableElements","currentFocusedIndex","findIndex","em","isSameNode","document","activeElement","newFocusedIndex","shiftKey","focus","addEventListener","removeEventListener","trapFocus","forceClose","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","Portal","tabIndex","role","Button","round","ariaLabel","containerId","elementRef","createElement","querySelector","add","appendChild","TeactDOM","removeChild","onBlur","onFocus","hasFocus","useCurrentOrPrev","shouldSkipUndefined","shouldForceCurrent","prev","usePrevious","getViewportSlice","sourceIds","listSlice","offsetId","indexOf","indexForDirection","Math","max","to","newViewportIds","slice","areSomeLocal","areAllLocal","listIds","isDisabled","lastParamsRef","viewportIdsRef","forceUpdate","useForceUpdate","prevListIds","prevIsDisabled","areSortedArraysEqual","getMore","viewportIds","mediaHash","noLoad","mediaFormat","delay","mediaData","startedAt","Date","now","spentTime","CLIPBOARD_ITEM_SUPPORTED","navigator","clipboard","ClipboardItem","textCopyEl","setAttribute","copyTextToClipboard","str","value","selection","getSelection","rangeToRestore","rangeCount","getRangeAt","select","execCommand","removeAllRanges","addRange","copyImageToClipboard","imageUrl","canvas","ctx","getContext","imageEl","Image","onload","currentTarget","img","width","height","drawImage","toBlob","copyBlobToClipboard","pngBlob","write","type","error","DEBUG","console","forceReflow","offsetWidth","patchChromiumScroll","display","IS_IOS","overflow","mediaEl","catch","err","warn"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/941.24c93ec02ada9e8159a1.js b/dist/941.4aa7cedc56885a7f52cb.js similarity index 99% rename from dist/941.24c93ec02ada9e8159a1.js rename to dist/941.4aa7cedc56885a7f52cb.js index 72b69cc8..44fcf79d 100644 --- a/dist/941.24c93ec02ada9e8159a1.js +++ b/dist/941.4aa7cedc56885a7f52cb.js @@ -1,2 +1,2 @@ "use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[941],{7941:(t,i,e)=>{e.r(i),e.d(i,{default:()=>p});var s=e(7361),n=e(6926);function a(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class h{constructor(t){this.worker=t,a(this,"requestStates",new Map),a(this,"requestStatesByCallback",new Map),this.subscribe()}request(t){const{worker:i,requestStates:e,requestStatesByCallback:s}=this,a=(0,n.Z)(e),h={type:"callMethod",messageId:a,...t},r={messageId:a},o=new Promise(((t,i)=>{Object.assign(r,{resolve:t,reject:i})}));if("function"==typeof h.args[h.args.length-1]){const t=h.args.pop();r.callback=t,s.set(t,r)}return e.set(a,r),o.catch((()=>{})).finally((()=>{e.delete(a),r.callback&&s.delete(r.callback)})),i.postMessage(h),o}cancelCallback(t){t.isCanceled=!0;const{messageId:i}=this.requestStatesByCallback.get(t)||{};i&&this.worker.postMessage({type:"cancelProgress",messageId:i})}subscribe(){const{worker:t,requestStates:i}=this;t.addEventListener("message",(t=>{let{data:e}=t;if("methodResponse"===e.type){const t=i.get(e.messageId);t&&(e.error?t.reject(e.error):t.resolve(e.response))}else if("methodCallback"===e.type){var s;const t=i.get(e.messageId);null==t||null===(s=t.callback)||void 0===s||s.call(t,...e.callbackArgs)}else if("unhandledError"===e.type){var n;throw new Error(null===(n=e.error)||void 0===n?void 0:n.message)}}))}}var r=e(9933),o=e(3570);function d(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}const c=s.wB?.75:1,u=s.wZ?.5:.75,l=s.s$?2:4,m=new Array(4).fill(void 0).map((()=>new h(new Worker(new URL(e.p+e.u(354),e.b)))));let g=-1;const p=class{constructor(t,i,e,s={},n,a,h){this.id=t,this.container=i,this.animationData=e,this.params=s,this.onLoad=n,this.customColor=a,this.onEnded=h,d(this,"imgSize",void 0),d(this,"key",void 0),d(this,"msPerFrame",1e3/60),d(this,"reduceFactor",1),d(this,"cacheModulo",void 0),d(this,"chunkSize",void 0),d(this,"workerIndex",void 0),d(this,"chunks",[]),d(this,"framesCount",void 0),d(this,"chunksCount",void 0),d(this,"canvas",document.createElement("canvas")),d(this,"ctx",this.canvas.getContext("2d")),d(this,"isAnimating",!1),d(this,"isWaiting",!0),d(this,"isOnLoadFired",!1),d(this,"isDestroyed",!1),d(this,"approxFrameIndex",0),d(this,"prevFrameIndex",-1),d(this,"stopFrameIndex",0),d(this,"speed",1),d(this,"direction",1),d(this,"lastRenderAt",void 0),this.initContainer(),this.initConfig(),this.initRenderer()}isPlaying(){return this.isAnimating||this.isWaiting}play(){this.stopFrameIndex=void 0,this.direction=1,this.doPlay()}pause(){this.isWaiting?this.stopFrameIndex=this.approxFrameIndex:this.isAnimating=!1;const t=this.getChunkIndex(this.approxFrameIndex);this.chunks=this.chunks.map(((i,e)=>e===t?i:void 0))}goToAndPlay(t){this.approxFrameIndex=Math.floor(t/this.reduceFactor),this.stopFrameIndex=void 0,this.direction=1,this.doPlay()}goToAndStop(t){this.approxFrameIndex=Math.floor(t/this.reduceFactor),this.stopFrameIndex=Math.floor(t/this.reduceFactor),this.direction=1,this.doPlay()}playSegment(t){let[i,e]=t;this.approxFrameIndex=Math.floor(i/this.reduceFactor),this.stopFrameIndex=Math.floor(e/this.reduceFactor),this.direction=i{if(this.isDestroyed)return!1;if(!this.isAnimating&&this.isOnLoadFired)return!1;const t=Math.round(this.approxFrameIndex),i=this.getChunkIndex(t),e=this.chunks[i];if(!e||0===e.length)return this.requestChunk(i),this.isAnimating=!1,this.isWaiting=!0,!1;if(this.cacheModulo&&i%this.cacheModulo==0&&this.cleanupPrevChunk(i),t!==this.prevFrameIndex){const i=this.getFrame(t);if(!i)return this.isAnimating=!1,this.isWaiting=!0,!1;const e=new Uint8ClampedArray(i);if(this.customColor)for(let t=0;t0&&(t===this.framesCount-1||h>this.framesCount-1)){var r;if(this.params.noLoop)return this.isAnimating=!1,null===(r=this.onEnded)||void 0===r||r.call(this),!1;this.approxFrameIndex=0}else if(a<0&&(0===t||h<0)){var o;if(this.params.noLoop)return this.isAnimating=!1,null===(o=this.onEnded)||void 0===o||o.call(this),!1;this.approxFrameIndex=this.framesCount-1}else{if(void 0!==this.stopFrameIndex&&(t===this.stopFrameIndex||a>0&&h>this.stopFrameIndex||a<0&&h{function s(t,i){return i-Math.floor(i/t)*t}e.d(i,{Z:()=>s})}}]); -//# sourceMappingURL=941.24c93ec02ada9e8159a1.js.map \ No newline at end of file +//# sourceMappingURL=941.4aa7cedc56885a7f52cb.js.map \ No newline at end of file diff --git a/dist/941.24c93ec02ada9e8159a1.js.map b/dist/941.4aa7cedc56885a7f52cb.js.map similarity index 99% rename from dist/941.24c93ec02ada9e8159a1.js.map rename to dist/941.4aa7cedc56885a7f52cb.js.map index 3c471b6d..754674ea 100644 --- a/dist/941.24c93ec02ada9e8159a1.js.map +++ b/dist/941.4aa7cedc56885a7f52cb.js.map @@ -1 +1 @@ -{"version":3,"file":"941.24c93ec02ada9e8159a1.js","mappings":"qRAqDe,MAAMA,EAKnBC,YAAoBC,GAAgB,KAAhBA,OAAAA,EAAgB,uBAJZ,IAAIC,KAIQ,iCAFF,IAAIA,KAGpCC,KAAKC,YAGPC,QAAQC,GACN,MAAM,OAAEL,EAAF,cAAUM,EAAV,wBAAyBC,GAA4BL,KAErDM,GAAYC,EAAAA,EAAAA,GAAcH,GAC1BI,EAA0B,CAC9BC,KAAM,aACNH,UAAAA,KACGH,GAGCO,EAAe,CAAEJ,UAAAA,GAGjBK,EAAwB,IAAIC,SAAQ,CAACC,EAASC,KAClDC,OAAOC,OAAON,EAAc,CAAEG,QAAAA,EAASC,OAAAA,OAGzC,GAAqD,mBAA1CN,EAAQS,KAAKT,EAAQS,KAAKC,OAAS,GAAmB,CAC/D,MAAMC,EAAWX,EAAQS,KAAKG,MAC9BV,EAAaS,SAAWA,EACxBd,EAAwBgB,IAAIF,EAAUT,GAgBxC,OAbAN,EAAciB,IAAIf,EAAWI,GAC7BC,EACGW,OAAM,SACNC,SAAQ,KACPnB,EAAcoB,OAAOlB,GAEjBI,EAAaS,UACfd,EAAwBmB,OAAOd,EAAaS,aAIlDrB,EAAO2B,YAAYjB,GAEZG,EAGTe,eAAeC,GACbA,EAAiBC,YAAa,EAE9B,MAAM,U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nH,QACtD,OAGFlB,KAAK4E,OAAOyD,GAAc,GAE1B,MAAMkB,EAAYlB,EAAarI,KAAK8G,UAC9B0C,EAAUvE,KAAKgE,IAAIM,EAAYvJ,KAAK8G,UAAY,EAAG9G,KAAK6H,YAAe,GAE7ElF,EAAQ3C,KAAKuH,aAAarH,QAAQ,CAChCuH,KAAM,eACNxG,KAAM,CAACjB,KAAK4G,IAAK2C,EAAWC,EAASxJ,KAAKyJ,YAAY9B,KAAK3H,SAIvDuI,iBAAiBF,GACvB,GAAIrI,KAAK8H,YAAe,EACtB,OAGF,MAAM4B,GAAiBlC,EAAAA,EAAAA,GAAcxH,KAAK8H,YAAcO,EAAa,GACrErI,KAAK4E,OAAO8E,QAAkB5G,EAGxB6G,iBAAiBtB,GACvB,GAAyB,IAArBrI,KAAK8H,YACP,OAGF,MAAM8B,GAAiBpC,EAAAA,EAAAA,GAAcxH,KAAK8H,YAAcO,EAAa,GAEhErI,KAAK4E,OAAOgF,IACf5J,KAAKsI,aAAasB,GAIdH,YAAYzE,EAAoB6E,GACtC,MAAMxB,EAAarI,KAAK2E,cAAcK,GAChCH,EAAQ7E,KAAK4E,OAAOyD,GAErBxD,IAILA,EAAM7E,KAAKsJ,qBAAqBtE,IAAe6E,EAE3C7J,KAAKmE,WACPnE,KAAKuE,a,eC5dI,SAASiD,EAActG,EAAgB4I,GACpD,OAAOA,EAAQ7E,KAAKC,MAAM4E,EAAQ5I,GAAUA,E","sources":["webpack://telegram-t/./src/util/WorkerConnector.ts","webpack://telegram-t/./src/lib/rlottie/RLottie.ts","webpack://telegram-t/./src/util/cycleRestrict.ts"],"sourcesContent":["import generateIdFor from './generateIdFor';\n\nexport interface CancellableCallback {\n (\n ...args: any[]\n ): void;\n\n isCanceled?: boolean;\n acceptsBuffer?: boolean;\n}\n\ntype CallMethodData = {\n type: 'callMethod';\n messageId?: string;\n name: string;\n args: any;\n};\n\ntype OriginMessageData = CallMethodData | {\n type: 'cancelProgress';\n messageId: string;\n};\n\nexport interface OriginMessageEvent {\n data: OriginMessageData;\n}\n\nexport type WorkerMessageData = {\n type: 'methodResponse';\n messageId: string;\n response?: any;\n error?: { message: string };\n} | {\n type: 'methodCallback';\n messageId: string;\n callbackArgs: any[];\n} | {\n type: 'unhandledError';\n error?: { message: string };\n};\n\nexport interface WorkerMessageEvent {\n data: WorkerMessageData;\n}\n\ninterface RequestStates {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback: AnyToVoidFunction;\n}\n\n// TODO Replace `any` with proper generics\nexport default class WorkerConnector {\n private requestStates = new Map();\n\n private requestStatesByCallback = new Map();\n\n constructor(private worker: Worker) {\n this.subscribe();\n }\n\n request(messageData: { name: string; args: any }) {\n const { worker, requestStates, requestStatesByCallback } = this;\n\n const messageId = generateIdFor(requestStates);\n const payload: CallMethodData = {\n type: 'callMethod',\n messageId,\n ...messageData,\n };\n\n const requestState = { messageId } as RequestStates;\n\n // Re-wrap type because of `postMessage`\n const promise: Promise = new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n });\n\n if (typeof payload.args[payload.args.length - 1] === 'function') {\n const callback = payload.args.pop() as AnyToVoidFunction;\n requestState.callback = callback;\n requestStatesByCallback.set(callback, requestState);\n }\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n\n if (requestState.callback) {\n requestStatesByCallback.delete(requestState.callback);\n }\n });\n\n worker.postMessage(payload);\n\n return promise;\n }\n\n cancelCallback(progressCallback: CancellableCallback) {\n progressCallback.isCanceled = true;\n\n const { messageId } = this.requestStatesByCallback.get(progressCallback) || {};\n if (!messageId) {\n return;\n }\n\n this.worker.postMessage({\n type: 'cancelProgress',\n messageId,\n });\n }\n\n private subscribe() {\n const { worker, requestStates } = this;\n\n worker.addEventListener('message', ({ data }: WorkerMessageEvent) => {\n if (data.type === 'methodResponse') {\n const requestState = requestStates.get(data.messageId);\n if (requestState) {\n if (data.error) {\n requestState.reject(data.error);\n } else {\n requestState.resolve(data.response);\n }\n }\n } else if (data.type === 'methodCallback') {\n const requestState = requestStates.get(data.messageId);\n requestState?.callback?.(...data.callbackArgs);\n } else if (data.type === 'unhandledError') {\n throw new Error(data.error?.message);\n }\n });\n }\n}\n","import {\n DPR,\n IS_SINGLE_COLUMN_LAYOUT,\n IS_SAFARI,\n IS_ANDROID,\n} from '../../util/environment';\nimport WorkerConnector from '../../util/WorkerConnector';\nimport { animate } from '../../util/animation';\nimport cycleRestrict from '../../util/cycleRestrict';\n\ninterface Params {\n noLoop?: boolean;\n size?: number;\n quality?: number;\n isLowPriority?: boolean;\n}\n\ntype Frames = ArrayBuffer[];\ntype Chunks = (Frames | undefined)[];\n\n// TODO Consider removing chunks\nconst CHUNK_SIZE = 1;\nconst MAX_WORKERS = 4;\nconst HIGH_PRIORITY_QUALITY = IS_SINGLE_COLUMN_LAYOUT ? 0.75 : 1;\nconst LOW_PRIORITY_QUALITY = IS_ANDROID ? 0.5 : 0.75;\nconst HIGH_PRIORITY_CACHE_MODULO = IS_SAFARI ? 2 : 4;\nconst LOW_PRIORITY_CACHE_MODULO = 0;\n\nconst workers = new Array(MAX_WORKERS).fill(undefined).map(\n () => new WorkerConnector(new Worker(new URL('./rlottie.worker.ts', import.meta.url))),\n);\nlet lastWorkerIndex = -1;\n\nclass RLottie {\n // Config\n\n private imgSize!: number;\n\n private key!: string;\n\n private msPerFrame = 1000 / 60;\n\n private reduceFactor = 1;\n\n private cacheModulo!: number;\n\n private chunkSize!: number;\n\n private workerIndex!: number;\n\n private chunks: Chunks = [];\n\n private framesCount?: number;\n\n private chunksCount?: number;\n\n // Container\n\n private canvas = document.createElement('canvas');\n\n private ctx = this.canvas.getContext('2d')!;\n\n // State\n\n private isAnimating = false;\n\n private isWaiting = true;\n\n private isOnLoadFired = false;\n\n private isDestroyed = false;\n\n private approxFrameIndex = 0;\n\n private prevFrameIndex = -1;\n\n private stopFrameIndex? = 0;\n\n private speed = 1;\n\n private direction: 1 | -1 = 1;\n\n private lastRenderAt?: number;\n\n constructor(\n private id: string,\n private container: HTMLDivElement,\n private animationData: string,\n private params: Params = {},\n private onLoad?: () => void,\n private customColor?: [number, number, number],\n private onEnded?: (isDestroyed?: boolean) => void,\n ) {\n this.initContainer();\n this.initConfig();\n this.initRenderer();\n }\n\n isPlaying() {\n return this.isAnimating || this.isWaiting;\n }\n\n play() {\n this.stopFrameIndex = undefined;\n this.direction = 1;\n this.doPlay();\n }\n\n pause() {\n if (this.isWaiting) {\n this.stopFrameIndex = this.approxFrameIndex;\n } else {\n this.isAnimating = false;\n }\n\n const currentChunkIndex = this.getChunkIndex(this.approxFrameIndex);\n this.chunks = this.chunks.map((chunk, i) => (i === currentChunkIndex ? chunk : undefined));\n }\n\n goToAndPlay(frameIndex: number) {\n this.approxFrameIndex = Math.floor(frameIndex / this.reduceFactor);\n this.stopFrameIndex = undefined;\n this.direction = 1;\n this.doPlay();\n }\n\n goToAndStop(frameIndex: number) {\n this.approxFrameIndex = Math.floor(frameIndex / this.reduceFactor);\n this.stopFrameIndex = Math.floor(frameIndex / this.reduceFactor);\n this.direction = 1;\n this.doPlay();\n }\n\n playSegment([startFrameIndex, stopFrameIndex]: [number, number]) {\n this.approxFrameIndex = Math.floor(startFrameIndex / this.reduceFactor);\n this.stopFrameIndex = Math.floor(stopFrameIndex / this.reduceFactor);\n this.direction = startFrameIndex < stopFrameIndex ? 1 : -1;\n this.doPlay();\n }\n\n setSpeed(speed: number) {\n this.speed = speed;\n }\n\n destroy() {\n this.isDestroyed = true;\n this.pause();\n this.destroyRenderer();\n this.destroyContainer();\n }\n\n private initContainer() {\n if (!(this.container.parentNode instanceof HTMLElement)) {\n throw new Error('[RLottie] Container is not mounted');\n }\n\n let { size } = this.params;\n\n if (!size) {\n size = (\n this.container.offsetWidth\n || parseInt(this.container.style.width, 10)\n || this.container.parentNode.offsetWidth\n );\n\n if (!size) {\n throw new Error('[RLottie] Failed to detect width from container');\n }\n }\n\n this.canvas.style.width = `${size}px`;\n this.canvas.style.height = `${size}px`;\n\n const { isLowPriority, quality = isLowPriority ? LOW_PRIORITY_QUALITY : HIGH_PRIORITY_QUALITY } = this.params;\n // Reduced quality only looks acceptable on high DPR screens\n const imgSize = Math.round(size * Math.max(DPR * quality, 1));\n\n this.canvas.width = imgSize;\n this.canvas.height = imgSize;\n\n this.container.appendChild(this.canvas);\n\n this.imgSize = imgSize;\n }\n\n private initConfig() {\n this.key = `${this.id}_${this.imgSize}`;\n\n const { isLowPriority } = this.params;\n\n this.cacheModulo = isLowPriority ? LOW_PRIORITY_CACHE_MODULO : HIGH_PRIORITY_CACHE_MODULO;\n this.chunkSize = CHUNK_SIZE;\n }\n\n private destroyContainer() {\n this.canvas.remove();\n }\n\n setColor(newColor: [number, number, number] | undefined) {\n this.customColor = newColor;\n\n // TODO Remove?\n if (this.customColor) {\n const imageData = this.ctx.getImageData(0, 0, this.imgSize, this.imgSize);\n const arr = imageData.data;\n for (let i = 0; i < arr.length; i += 4) {\n /* eslint-disable prefer-destructuring */\n arr[i] = this.customColor[0];\n arr[i + 1] = this.customColor[1];\n arr[i + 2] = this.customColor[2];\n /* eslint-enable prefer-destructuring */\n }\n this.ctx.putImageData(imageData, 0, 0);\n }\n }\n\n private initRenderer() {\n this.workerIndex = cycleRestrict(MAX_WORKERS, ++lastWorkerIndex);\n\n workers[this.workerIndex].request({\n name: 'init',\n args: [\n this.key,\n this.animationData,\n this.imgSize,\n this.params.isLowPriority,\n this.onRendererInit.bind(this),\n ],\n });\n }\n\n private destroyRenderer() {\n workers[this.workerIndex].request({\n name: 'destroy',\n args: [this.key],\n });\n }\n\n private onRendererInit(reduceFactor: number, msPerFrame: number, framesCount: number) {\n this.reduceFactor = reduceFactor;\n this.msPerFrame = msPerFrame;\n this.framesCount = framesCount;\n this.chunksCount = Math.ceil(framesCount / this.chunkSize);\n\n if (this.isWaiting) {\n this.doPlay();\n }\n }\n\n changeData(animationData: string) {\n this.pause();\n this.animationData = animationData;\n this.initConfig();\n\n workers[this.workerIndex].request({\n name: 'changeData',\n args: [\n this.key,\n this.animationData,\n this.params.isLowPriority,\n this.onChangeData.bind(this),\n ],\n });\n }\n\n private onChangeData(reduceFactor: number, msPerFrame: number, framesCount: number) {\n this.reduceFactor = reduceFactor;\n this.msPerFrame = msPerFrame;\n this.framesCount = framesCount;\n this.chunksCount = Math.ceil(framesCount / this.chunkSize);\n this.isWaiting = false;\n this.isAnimating = false;\n\n this.doPlay();\n }\n\n private doPlay() {\n if (!this.framesCount) {\n return;\n }\n\n if (this.isDestroyed) {\n return;\n }\n\n if (this.isAnimating) {\n return;\n }\n\n if (!this.isWaiting) {\n this.lastRenderAt = undefined;\n }\n\n this.isAnimating = true;\n this.isWaiting = false;\n\n animate(() => {\n if (this.isDestroyed) {\n return false;\n }\n\n // Paused from outside\n if (!this.isAnimating && this.isOnLoadFired) {\n return false;\n }\n\n const frameIndex = Math.round(this.approxFrameIndex);\n const chunkIndex = this.getChunkIndex(frameIndex);\n const chunk = this.chunks[chunkIndex];\n\n if (!chunk || chunk.length === 0) {\n this.requestChunk(chunkIndex);\n this.isAnimating = false;\n this.isWaiting = true;\n return false;\n }\n\n if (this.cacheModulo && chunkIndex % this.cacheModulo === 0) {\n this.cleanupPrevChunk(chunkIndex);\n }\n\n if (frameIndex !== this.prevFrameIndex) {\n const frame = this.getFrame(frameIndex);\n if (!frame) {\n this.isAnimating = false;\n this.isWaiting = true;\n return false;\n }\n\n const arr = new Uint8ClampedArray(frame);\n if (this.customColor) {\n for (let i = 0; i < arr.length; i += 4) {\n /* eslint-disable prefer-destructuring */\n arr[i] = this.customColor[0];\n arr[i + 1] = this.customColor[1];\n arr[i + 2] = this.customColor[2];\n /* eslint-enable prefer-destructuring */\n }\n }\n const imageData = new ImageData(arr, this.imgSize, this.imgSize);\n this.ctx.putImageData(imageData, 0, 0);\n\n if (this.onLoad && !this.isOnLoadFired) {\n this.isOnLoadFired = true;\n this.onLoad();\n }\n\n this.prevFrameIndex = frameIndex;\n }\n\n const now = Date.now();\n const currentSpeed = this.lastRenderAt ? this.msPerFrame / (now - this.lastRenderAt) : 1;\n const delta = Math.min(1, (this.direction * this.speed) / currentSpeed);\n const expectedNextFrameIndex = Math.round(this.approxFrameIndex + delta);\n\n this.lastRenderAt = now;\n\n // Forward animation finished\n if (delta > 0 && (frameIndex === this.framesCount! - 1 || expectedNextFrameIndex > this.framesCount! - 1)) {\n if (this.params.noLoop) {\n this.isAnimating = false;\n this.onEnded?.();\n return false;\n }\n\n this.approxFrameIndex = 0;\n\n // Backward animation finished\n } else if (delta < 0 && (frameIndex === 0 || expectedNextFrameIndex < 0)) {\n if (this.params.noLoop) {\n this.isAnimating = false;\n this.onEnded?.();\n return false;\n }\n\n this.approxFrameIndex = this.framesCount! - 1;\n\n // Stop frame reached\n } else if (\n this.stopFrameIndex !== undefined\n && (frameIndex === this.stopFrameIndex\n || (\n (delta > 0 && expectedNextFrameIndex > this.stopFrameIndex)\n || (delta < 0 && expectedNextFrameIndex < this.stopFrameIndex)\n ))\n ) {\n this.stopFrameIndex = undefined;\n this.isAnimating = false;\n return false;\n\n // Preparing next frame\n } else {\n this.approxFrameIndex += delta;\n }\n\n const nextFrameIndex = Math.round(this.approxFrameIndex);\n\n if (!this.getFrame(nextFrameIndex)) {\n this.requestChunk(this.getChunkIndex(nextFrameIndex));\n this.isWaiting = true;\n this.isAnimating = false;\n return false;\n }\n\n return true;\n });\n }\n\n private getFrame(frameIndex: number) {\n const chunkIndex = this.getChunkIndex(frameIndex);\n const indexInChunk = this.getFrameIndexInChunk(frameIndex);\n const chunk = this.chunks[chunkIndex];\n if (!chunk) {\n return undefined;\n }\n\n return chunk[indexInChunk];\n }\n\n private getFrameIndexInChunk(frameIndex: number) {\n const chunkIndex = this.getChunkIndex(frameIndex);\n return frameIndex - chunkIndex * this.chunkSize;\n }\n\n private getChunkIndex(frameIndex: number) {\n return Math.floor(frameIndex / this.chunkSize);\n }\n\n private requestChunk(chunkIndex: number) {\n if (this.chunks[chunkIndex] && this.chunks[chunkIndex]?.length !== 0) {\n return;\n }\n\n this.chunks[chunkIndex] = [];\n\n const fromIndex = chunkIndex * this.chunkSize;\n const toIndex = Math.min(fromIndex + this.chunkSize - 1, this.framesCount! - 1);\n\n workers[this.workerIndex].request({\n name: 'renderFrames',\n args: [this.key, fromIndex, toIndex, this.onFrameLoad.bind(this)],\n });\n }\n\n private cleanupPrevChunk(chunkIndex: number) {\n if (this.chunksCount! < 3) {\n return;\n }\n\n const prevChunkIndex = cycleRestrict(this.chunksCount!, chunkIndex - 1);\n this.chunks[prevChunkIndex] = undefined;\n }\n\n private requestNextChunk(chunkIndex: number) {\n if (this.chunksCount === 1) {\n return;\n }\n\n const nextChunkIndex = cycleRestrict(this.chunksCount!, chunkIndex + 1);\n\n if (!this.chunks[nextChunkIndex]) {\n this.requestChunk(nextChunkIndex);\n }\n }\n\n private onFrameLoad(frameIndex: number, arrayBuffer: ArrayBuffer) {\n const chunkIndex = this.getChunkIndex(frameIndex);\n const chunk = this.chunks[chunkIndex];\n // Frame can be skipped and chunk can be already cleaned up\n if (!chunk) {\n return;\n }\n\n chunk[this.getFrameIndexInChunk(frameIndex)] = arrayBuffer;\n\n if (this.isWaiting) {\n this.doPlay();\n }\n }\n}\n\nexport default RLottie;\n","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n"],"names":["WorkerConnector","constructor","worker","Map","this","subscribe","request","messageData","requestStates","requestStatesByCallback","messageId","generateIdFor","payload","type","requestState","promise","Promise","resolve","reject","Object","assign","args","length","callback","pop","set","catch","finally","delete","postMessage","cancelCallback","progressCallback","isCanceled","get","addEventListener","data","error","response","callbackArgs","Error","message","HIGH_PRIORITY_QUALITY","IS_SINGLE_COLUMN_LAYOUT","LOW_PRIORITY_QUALITY","IS_ANDROID","HIGH_PRIORITY_CACHE_MODULO","IS_SAFARI","workers","Array","fill","undefined","map","Worker","URL","lastWorkerIndex","id","container","animationData","params","onLoad","customColor","onEnded","document","createElement","canvas","getContext","initContainer","initConfig","initRenderer","isPlaying","isAnimating","isWaiting","play","stopFrameIndex","direction","doPlay","pause","approxFrameIndex","currentChunkIndex","getChunkIndex","chunks","chunk","i","goToAndPlay","frameIndex","Math","floor","reduceFactor","goToAndStop","playSegment","startFrameIndex","setSpeed","speed","destroy","isDestroyed","destroyRenderer","destroyContainer","parentNode","HTMLElement","size","offsetWidth","parseInt","style","width","height","isLowPriority","quality","imgSize","round","max","DPR","appendChild","key","cacheModulo","chunkSize","remove","setColor","newColor","imageData","ctx","getImageData","arr","putImageData","workerIndex","cycleRestrict","name","onRendererInit","bind","msPerFrame","framesCount","chunksCount","ceil","changeData","onChangeData","lastRenderAt","animate","isOnLoadFired","chunkIndex","requestChunk","cleanupPrevChunk","prevFrameIndex","frame","getFrame","Uint8ClampedArray","ImageData","now","Date","currentSpeed","delta","min","expectedNextFrameIndex","noLoop","nextFrameIndex","indexInChunk","getFrameIndexInChunk","fromIndex","toIndex","onFrameLoad","prevChunkIndex","requestNextChunk","nextChunkIndex","arrayBuffer","index"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"941.4aa7cedc56885a7f52cb.js","mappings":"qRAqDe,MAAMA,EAKnBC,YAAoBC,GAAgB,KAAhBA,OAAAA,EAAgB,uBAJZ,IAAIC,KAIQ,iCAFF,IAAIA,KAGpCC,KAAKC,YAGPC,QAAQC,GACN,MAAM,OAAEL,EAAF,cAAUM,EAAV,wBAAyBC,GAA4BL,KAErDM,GAAYC,EAAAA,EAAAA,GAAcH,GAC1BI,EAA0B,CAC9BC,KAAM,aACNH,UAAAA,KACGH,GAGCO,EAAe,CAAEJ,UAAAA,GAGjBK,EAAwB,IAAIC,SAAQ,CAACC,EAASC,KAClDC,OAAOC,OAAON,EAAc,CAAEG,QAAAA,EAASC,OAAAA,OAGzC,GAAqD,mBAA1CN,EAAQS,KAAKT,EAAQS,KAAKC,OAAS,GAAmB,CAC/D,MAAMC,EAAWX,EAAQS,KAAKG,MAC9BV,EAAaS,SAAWA,EACxBd,EAAwBgB,I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GAGPC,qBAAqBtE,GAE3B,OAAOA,EADYhF,KAAK2E,cAAcK,GACLhF,KAAK8G,UAGhCnC,cAAcK,GACpB,OAAOC,KAAKC,MAAMF,EAAahF,KAAK8G,WAG9BwB,aAAaD,GAAoB,MACvC,GAAIrI,KAAK4E,OAAOyD,IAAmD,KAApC,UAAArI,KAAK4E,OAAOyD,UAAZ,eAAyBnH,QACtD,OAGFlB,KAAK4E,OAAOyD,GAAc,GAE1B,MAAMkB,EAAYlB,EAAarI,KAAK8G,UAC9B0C,EAAUvE,KAAKgE,IAAIM,EAAYvJ,KAAK8G,UAAY,EAAG9G,KAAK6H,YAAe,GAE7ElF,EAAQ3C,KAAKuH,aAAarH,QAAQ,CAChCuH,KAAM,eACNxG,KAAM,CAACjB,KAAK4G,IAAK2C,EAAWC,EAASxJ,KAAKyJ,YAAY9B,KAAK3H,SAIvDuI,iBAAiBF,GACvB,GAAIrI,KAAK8H,YAAe,EACtB,OAGF,MAAM4B,GAAiBlC,EAAAA,EAAAA,GAAcxH,KAAK8H,YAAcO,EAAa,GACrErI,KAAK4E,OAAO8E,QAAkB5G,EAGxB6G,iBAAiBtB,GACvB,GAAyB,IAArBrI,KAAK8H,YACP,OAGF,MAAM8B,GAAiBpC,EAAAA,EAAAA,GAAcxH,KAAK8H,YAAcO,EAAa,GAEhErI,KAAK4E,OAAOgF,IACf5J,KAAKsI,aAAasB,GAIdH,YAAYzE,EAAoB6E,GACtC,MAAMxB,EAAarI,KAAK2E,cAAcK,GAChCH,EAAQ7E,KAAK4E,OAAOyD,GAErBxD,IAILA,EAAM7E,KAAKsJ,qBAAqBtE,IAAe6E,EAE3C7J,KAAKmE,WACPnE,KAAKuE,a,eC5dI,SAASiD,EAActG,EAAgB4I,GACpD,OAAOA,EAAQ7E,KAAKC,MAAM4E,EAAQ5I,GAAUA,E","sources":["webpack://telegram-t/./src/util/WorkerConnector.ts","webpack://telegram-t/./src/lib/rlottie/RLottie.ts","webpack://telegram-t/./src/util/cycleRestrict.ts"],"sourcesContent":["import generateIdFor from './generateIdFor';\n\nexport interface CancellableCallback {\n (\n ...args: any[]\n ): void;\n\n isCanceled?: boolean;\n acceptsBuffer?: boolean;\n}\n\ntype CallMethodData = {\n type: 'callMethod';\n messageId?: string;\n name: string;\n args: any;\n};\n\ntype OriginMessageData = CallMethodData | {\n type: 'cancelProgress';\n messageId: string;\n};\n\nexport interface OriginMessageEvent {\n data: OriginMessageData;\n}\n\nexport type WorkerMessageData = {\n type: 'methodResponse';\n messageId: string;\n response?: any;\n error?: { message: string };\n} | {\n type: 'methodCallback';\n messageId: string;\n callbackArgs: any[];\n} | {\n type: 'unhandledError';\n error?: { message: string };\n};\n\nexport interface WorkerMessageEvent {\n data: WorkerMessageData;\n}\n\ninterface RequestStates {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback: AnyToVoidFunction;\n}\n\n// TODO Replace `any` with proper generics\nexport default class WorkerConnector {\n private requestStates = new Map();\n\n private requestStatesByCallback = new Map();\n\n constructor(private worker: Worker) {\n this.subscribe();\n }\n\n request(messageData: { name: string; args: any }) {\n const { worker, requestStates, requestStatesByCallback } = this;\n\n const messageId = generateIdFor(requestStates);\n const payload: CallMethodData = {\n type: 'callMethod',\n messageId,\n ...messageData,\n };\n\n const requestState = { messageId } as RequestStates;\n\n // Re-wrap type because of `postMessage`\n const promise: Promise = new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n });\n\n if (typeof payload.args[payload.args.length - 1] === 'function') {\n const callback = payload.args.pop() as AnyToVoidFunction;\n requestState.callback = callback;\n requestStatesByCallback.set(callback, requestState);\n }\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n\n if (requestState.callback) {\n requestStatesByCallback.delete(requestState.callback);\n }\n });\n\n worker.postMessage(payload);\n\n return promise;\n }\n\n cancelCallback(progressCallback: CancellableCallback) {\n progressCallback.isCanceled = true;\n\n const { messageId } = this.requestStatesByCallback.get(progressCallback) || {};\n if (!messageId) {\n return;\n }\n\n this.worker.postMessage({\n type: 'cancelProgress',\n messageId,\n });\n }\n\n private subscribe() {\n const { worker, requestStates } = this;\n\n worker.addEventListener('message', ({ data }: WorkerMessageEvent) => {\n if (data.type === 'methodResponse') {\n const requestState = requestStates.get(data.messageId);\n if (requestState) {\n if (data.error) {\n requestState.reject(data.error);\n } else {\n requestState.resolve(data.response);\n }\n }\n } else if (data.type === 'methodCallback') {\n const requestState = requestStates.get(data.messageId);\n requestState?.callback?.(...data.callbackArgs);\n } else if (data.type === 'unhandledError') {\n throw new Error(data.error?.message);\n }\n });\n }\n}\n","import {\n DPR,\n IS_SINGLE_COLUMN_LAYOUT,\n IS_SAFARI,\n IS_ANDROID,\n} from '../../util/environment';\nimport WorkerConnector from '../../util/WorkerConnector';\nimport { animate } from '../../util/animation';\nimport cycleRestrict from '../../util/cycleRestrict';\n\ninterface Params {\n noLoop?: boolean;\n size?: number;\n quality?: number;\n isLowPriority?: boolean;\n}\n\ntype Frames = ArrayBuffer[];\ntype Chunks = (Frames | undefined)[];\n\n// TODO Consider removing chunks\nconst CHUNK_SIZE = 1;\nconst MAX_WORKERS = 4;\nconst HIGH_PRIORITY_QUALITY = IS_SINGLE_COLUMN_LAYOUT ? 0.75 : 1;\nconst LOW_PRIORITY_QUALITY = IS_ANDROID ? 0.5 : 0.75;\nconst HIGH_PRIORITY_CACHE_MODULO = IS_SAFARI ? 2 : 4;\nconst LOW_PRIORITY_CACHE_MODULO = 0;\n\nconst workers = new Array(MAX_WORKERS).fill(undefined).map(\n () => new WorkerConnector(new Worker(new URL('./rlottie.worker.ts', import.meta.url))),\n);\nlet lastWorkerIndex = -1;\n\nclass RLottie {\n // Config\n\n private imgSize!: number;\n\n private key!: string;\n\n private msPerFrame = 1000 / 60;\n\n private reduceFactor = 1;\n\n private cacheModulo!: number;\n\n private chunkSize!: number;\n\n private workerIndex!: number;\n\n private chunks: Chunks = [];\n\n private framesCount?: number;\n\n private chunksCount?: number;\n\n // Container\n\n private canvas = document.createElement('canvas');\n\n private ctx = this.canvas.getContext('2d')!;\n\n // State\n\n private isAnimating = false;\n\n private isWaiting = true;\n\n private isOnLoadFired = false;\n\n private isDestroyed = false;\n\n private approxFrameIndex = 0;\n\n private prevFrameIndex = -1;\n\n private stopFrameIndex? = 0;\n\n private speed = 1;\n\n private direction: 1 | -1 = 1;\n\n private lastRenderAt?: number;\n\n constructor(\n private id: string,\n private container: HTMLDivElement,\n private animationData: string,\n private params: Params = {},\n private onLoad?: () => void,\n private customColor?: [number, number, number],\n private onEnded?: (isDestroyed?: boolean) => void,\n ) {\n this.initContainer();\n this.initConfig();\n this.initRenderer();\n }\n\n isPlaying() {\n return this.isAnimating || this.isWaiting;\n }\n\n play() {\n this.stopFrameIndex = undefined;\n this.direction = 1;\n this.doPlay();\n }\n\n pause() {\n if (this.isWaiting) {\n this.stopFrameIndex = this.approxFrameIndex;\n } else {\n this.isAnimating = false;\n }\n\n const currentChunkIndex = this.getChunkIndex(this.approxFrameIndex);\n this.chunks = this.chunks.map((chunk, i) => (i === currentChunkIndex ? chunk : undefined));\n }\n\n goToAndPlay(frameIndex: number) {\n this.approxFrameIndex = Math.floor(frameIndex / this.reduceFactor);\n this.stopFrameIndex = undefined;\n this.direction = 1;\n this.doPlay();\n }\n\n goToAndStop(frameIndex: number) {\n this.approxFrameIndex = Math.floor(frameIndex / this.reduceFactor);\n this.stopFrameIndex = Math.floor(frameIndex / this.reduceFactor);\n this.direction = 1;\n this.doPlay();\n }\n\n playSegment([startFrameIndex, stopFrameIndex]: [number, number]) {\n this.approxFrameIndex = Math.floor(startFrameIndex / this.reduceFactor);\n this.stopFrameIndex = Math.floor(stopFrameIndex / this.reduceFactor);\n this.direction = startFrameIndex < stopFrameIndex ? 1 : -1;\n this.doPlay();\n }\n\n setSpeed(speed: number) {\n this.speed = speed;\n }\n\n destroy() {\n this.isDestroyed = true;\n this.pause();\n this.destroyRenderer();\n this.destroyContainer();\n }\n\n private initContainer() {\n if (!(this.container.parentNode instanceof HTMLElement)) {\n throw new Error('[RLottie] Container is not mounted');\n }\n\n let { size } = this.params;\n\n if (!size) {\n size = (\n this.container.offsetWidth\n || parseInt(this.container.style.width, 10)\n || this.container.parentNode.offsetWidth\n );\n\n if (!size) {\n throw new Error('[RLottie] Failed to detect width from container');\n }\n }\n\n this.canvas.style.width = `${size}px`;\n this.canvas.style.height = `${size}px`;\n\n const { isLowPriority, quality = isLowPriority ? LOW_PRIORITY_QUALITY : HIGH_PRIORITY_QUALITY } = this.params;\n // Reduced quality only looks acceptable on high DPR screens\n const imgSize = Math.round(size * Math.max(DPR * quality, 1));\n\n this.canvas.width = imgSize;\n this.canvas.height = imgSize;\n\n this.container.appendChild(this.canvas);\n\n this.imgSize = imgSize;\n }\n\n private initConfig() {\n this.key = `${this.id}_${this.imgSize}`;\n\n const { isLowPriority } = this.params;\n\n this.cacheModulo = isLowPriority ? LOW_PRIORITY_CACHE_MODULO : HIGH_PRIORITY_CACHE_MODULO;\n this.chunkSize = CHUNK_SIZE;\n }\n\n private destroyContainer() {\n this.canvas.remove();\n }\n\n setColor(newColor: [number, number, number] | undefined) {\n this.customColor = newColor;\n\n // TODO Remove?\n if (this.customColor) {\n const imageData = this.ctx.getImageData(0, 0, this.imgSize, this.imgSize);\n const arr = imageData.data;\n for (let i = 0; i < arr.length; i += 4) {\n /* eslint-disable prefer-destructuring */\n arr[i] = this.customColor[0];\n arr[i + 1] = this.customColor[1];\n arr[i + 2] = this.customColor[2];\n /* eslint-enable prefer-destructuring */\n }\n this.ctx.putImageData(imageData, 0, 0);\n }\n }\n\n private initRenderer() {\n this.workerIndex = cycleRestrict(MAX_WORKERS, ++lastWorkerIndex);\n\n workers[this.workerIndex].request({\n name: 'init',\n args: [\n this.key,\n this.animationData,\n this.imgSize,\n this.params.isLowPriority,\n this.onRendererInit.bind(this),\n ],\n });\n }\n\n private destroyRenderer() {\n workers[this.workerIndex].request({\n name: 'destroy',\n args: [this.key],\n });\n }\n\n private onRendererInit(reduceFactor: number, msPerFrame: number, framesCount: number) {\n this.reduceFactor = reduceFactor;\n this.msPerFrame = msPerFrame;\n this.framesCount = framesCount;\n this.chunksCount = Math.ceil(framesCount / this.chunkSize);\n\n if (this.isWaiting) {\n this.doPlay();\n }\n }\n\n changeData(animationData: string) {\n this.pause();\n this.animationData = animationData;\n this.initConfig();\n\n workers[this.workerIndex].request({\n name: 'changeData',\n args: [\n this.key,\n this.animationData,\n this.params.isLowPriority,\n this.onChangeData.bind(this),\n ],\n });\n }\n\n private onChangeData(reduceFactor: number, msPerFrame: number, framesCount: number) {\n this.reduceFactor = reduceFactor;\n this.msPerFrame = msPerFrame;\n this.framesCount = framesCount;\n this.chunksCount = Math.ceil(framesCount / this.chunkSize);\n this.isWaiting = false;\n this.isAnimating = false;\n\n this.doPlay();\n }\n\n private doPlay() {\n if (!this.framesCount) {\n return;\n }\n\n if (this.isDestroyed) {\n return;\n }\n\n if (this.isAnimating) {\n return;\n }\n\n if (!this.isWaiting) {\n this.lastRenderAt = undefined;\n }\n\n this.isAnimating = true;\n this.isWaiting = false;\n\n animate(() => {\n if (this.isDestroyed) {\n return false;\n }\n\n // Paused from outside\n if (!this.isAnimating && this.isOnLoadFired) {\n return false;\n }\n\n const frameIndex = Math.round(this.approxFrameIndex);\n const chunkIndex = this.getChunkIndex(frameIndex);\n const chunk = this.chunks[chunkIndex];\n\n if (!chunk || chunk.length === 0) {\n this.requestChunk(chunkIndex);\n this.isAnimating = false;\n this.isWaiting = true;\n return false;\n }\n\n if (this.cacheModulo && chunkIndex % this.cacheModulo === 0) {\n this.cleanupPrevChunk(chunkIndex);\n }\n\n if (frameIndex !== this.prevFrameIndex) {\n const frame = this.getFrame(frameIndex);\n if (!frame) {\n this.isAnimating = false;\n this.isWaiting = true;\n return false;\n }\n\n const arr = new Uint8ClampedArray(frame);\n if (this.customColor) {\n for (let i = 0; i < arr.length; i += 4) {\n /* eslint-disable prefer-destructuring */\n arr[i] = this.customColor[0];\n arr[i + 1] = this.customColor[1];\n arr[i + 2] = this.customColor[2];\n /* eslint-enable prefer-destructuring */\n }\n }\n const imageData = new ImageData(arr, this.imgSize, this.imgSize);\n this.ctx.putImageData(imageData, 0, 0);\n\n if (this.onLoad && !this.isOnLoadFired) {\n this.isOnLoadFired = true;\n this.onLoad();\n }\n\n this.prevFrameIndex = frameIndex;\n }\n\n const now = Date.now();\n const currentSpeed = this.lastRenderAt ? this.msPerFrame / (now - this.lastRenderAt) : 1;\n const delta = Math.min(1, (this.direction * this.speed) / currentSpeed);\n const expectedNextFrameIndex = Math.round(this.approxFrameIndex + delta);\n\n this.lastRenderAt = now;\n\n // Forward animation finished\n if (delta > 0 && (frameIndex === this.framesCount! - 1 || expectedNextFrameIndex > this.framesCount! - 1)) {\n if (this.params.noLoop) {\n this.isAnimating = false;\n this.onEnded?.();\n return false;\n }\n\n this.approxFrameIndex = 0;\n\n // Backward animation finished\n } else if (delta < 0 && (frameIndex === 0 || expectedNextFrameIndex < 0)) {\n if (this.params.noLoop) {\n this.isAnimating = false;\n this.onEnded?.();\n return false;\n }\n\n this.approxFrameIndex = this.framesCount! - 1;\n\n // Stop frame reached\n } else if (\n this.stopFrameIndex !== undefined\n && (frameIndex === this.stopFrameIndex\n || (\n (delta > 0 && expectedNextFrameIndex > this.stopFrameIndex)\n || (delta < 0 && expectedNextFrameIndex < this.stopFrameIndex)\n ))\n ) {\n this.stopFrameIndex = undefined;\n this.isAnimating = false;\n return false;\n\n // Preparing next frame\n } else {\n this.approxFrameIndex += delta;\n }\n\n const nextFrameIndex = Math.round(this.approxFrameIndex);\n\n if (!this.getFrame(nextFrameIndex)) {\n this.requestChunk(this.getChunkIndex(nextFrameIndex));\n this.isWaiting = true;\n this.isAnimating = false;\n return false;\n }\n\n return true;\n });\n }\n\n private getFrame(frameIndex: number) {\n const chunkIndex = this.getChunkIndex(frameIndex);\n const indexInChunk = this.getFrameIndexInChunk(frameIndex);\n const chunk = this.chunks[chunkIndex];\n if (!chunk) {\n return undefined;\n }\n\n return chunk[indexInChunk];\n }\n\n private getFrameIndexInChunk(frameIndex: number) {\n const chunkIndex = this.getChunkIndex(frameIndex);\n return frameIndex - chunkIndex * this.chunkSize;\n }\n\n private getChunkIndex(frameIndex: number) {\n return Math.floor(frameIndex / this.chunkSize);\n }\n\n private requestChunk(chunkIndex: number) {\n if (this.chunks[chunkIndex] && this.chunks[chunkIndex]?.length !== 0) {\n return;\n }\n\n this.chunks[chunkIndex] = [];\n\n const fromIndex = chunkIndex * this.chunkSize;\n const toIndex = Math.min(fromIndex + this.chunkSize - 1, this.framesCount! - 1);\n\n workers[this.workerIndex].request({\n name: 'renderFrames',\n args: [this.key, fromIndex, toIndex, this.onFrameLoad.bind(this)],\n });\n }\n\n private cleanupPrevChunk(chunkIndex: number) {\n if (this.chunksCount! < 3) {\n return;\n }\n\n const prevChunkIndex = cycleRestrict(this.chunksCount!, chunkIndex - 1);\n this.chunks[prevChunkIndex] = undefined;\n }\n\n private requestNextChunk(chunkIndex: number) {\n if (this.chunksCount === 1) {\n return;\n }\n\n const nextChunkIndex = cycleRestrict(this.chunksCount!, chunkIndex + 1);\n\n if (!this.chunks[nextChunkIndex]) {\n this.requestChunk(nextChunkIndex);\n }\n }\n\n private onFrameLoad(frameIndex: number, arrayBuffer: ArrayBuffer) {\n const chunkIndex = this.getChunkIndex(frameIndex);\n const chunk = this.chunks[chunkIndex];\n // Frame can be skipped and chunk can be already cleaned up\n if (!chunk) {\n return;\n }\n\n chunk[this.getFrameIndexInChunk(frameIndex)] = arrayBuffer;\n\n if (this.isWaiting) {\n this.doPlay();\n }\n }\n}\n\nexport default RLottie;\n","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n"],"names":["WorkerConnector","constructor","worker","Map","this","subscribe","request","messageData","requestStates","requestStatesByCallback","messageId","generateIdFor","payload","type","requestState","promise","Promise","resolve","reject","Object","assign","args","length","callback","pop","set","catch","finally","delete","postMessage","cancelCallback","progressCallback","isCanceled","get","addEventListener","data","error","response","callbackArgs","Error","message","HIGH_PRIORITY_QUALITY","IS_SINGLE_COLUMN_LAYOUT","LOW_PRIORITY_QUALITY","IS_ANDROID","HIGH_PRIORITY_CACHE_MODULO","IS_SAFARI","workers","Array","fill","undefined","map","Worker","URL","lastWorkerIndex","id","container","animationData","params","onLoad","customColor","onEnded","document","createElement","canvas","getContext","initContainer","initConfig","initRenderer","isPlaying","isAnimating","isWaiting","play","stopFrameIndex","direction","doPlay","pause","approxFrameIndex","currentChunkIndex","getChunkIndex","chunks","chunk","i","goToAndPlay","frameIndex","Math","floor","reduceFactor","goToAndStop","playSegment","startFrameIndex","setSpeed","speed","destroy","isDestroyed","destroyRenderer","destroyContainer","parentNode","HTMLElement","size","offsetWidth","parseInt","style","width","height","isLowPriority","quality","imgSize","round","max","DPR","appendChild","key","cacheModulo","chunkSize","remove","setColor","newColor","imageData","ctx","getImageData","arr","putImageData","workerIndex","cycleRestrict","name","onRendererInit","bind","msPerFrame","framesCount","chunksCount","ceil","changeData","onChangeData","lastRenderAt","animate","isOnLoadFired","chunkIndex","requestChunk","cleanupPrevChunk","prevFrameIndex","frame","getFrame","Uint8ClampedArray","ImageData","now","Date","currentSpeed","delta","min","expectedNextFrameIndex","noLoop","nextFrameIndex","indexInChunk","getFrameIndexInChunk","fromIndex","toIndex","onFrameLoad","prevChunkIndex","requestNextChunk","nextChunkIndex","arrayBuffer","index"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 52c05a14..a327bc51 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -Telegram
\ No newline at end of file +Telegram
\ No newline at end of file diff --git a/dist/main.1a136550b3ba581f7752.js b/dist/main.1a136550b3ba581f7752.js new file mode 100644 index 00000000..301d41d9 --- /dev/null +++ b/dist/main.1a136550b3ba581f7752.js @@ -0,0 +1,2 @@ +(()=>{"use strict";var e,t,n,r,o,d,a={1226:(e,t,n)=>{n.d(t,{t9:()=>c,u3:()=>l,g8:()=>i});var r=n(3716),o=n(6926),d=n(9118);let a;const u=new Map,s=new Map;function i(e,t){return a||(r.eM&&console.log(">>> START LOAD WORKER"),a=new Worker(new URL(n.p+n.u(626),n.b)),function(e){a.addEventListener("message",(t=>{let{data:n}=t;if("update"===n.type)e(n.update);else if("methodResponse"===n.type){const e=u.get(n.messageId);e&&(n.error?e.reject(n.error):e.resolve(n.response))}else if("methodCallback"===n.type){var r,o;null===(r=u.get(n.messageId))||void 0===r||null===(o=r.callback)||void 0===o||o.call(r,...n.callbackArgs)}else if("unhandledError"===n.type){var d;throw new Error(null===(d=n.error)||void 0===d?void 0:d.message)}}))}(e),"iOS"===t.platform&&window.addEventListener("focus",(()=>{m(),setTimeout((()=>m()),1e3)}))),f({type:"initApi",args:[t]})}function c(e){if(!a)return void(r.eM&&console.warn("API is not initialized"));for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{try{await d}catch(e){}})(),d}function l(e){e.isCanceled=!0;const{messageId:t}=s.get(e)||{};t&&a.postMessage({type:"cancelProgress",messageId:t})}function f(e){const t=(0,o.Z)(u),n={messageId:t,...e},r={messageId:t},d=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("args"in n&&"function"==typeof n.args[1]){const e=n.args.pop();r.callback=e,s.set(e,r)}return u.set(t,r),d.catch((()=>{})).finally((()=>{u.delete(t),r.callback&&s.delete(r.callback)})),a.postMessage(n),d}const h=Date.now();async function m(){try{await Promise.race([f({type:"ping"}),(0,d.wO)(150).then((()=>Promise.reject(new Error("HEALTH_CHECK_TIMEOUT"))))])}catch(e){console.error(e),Date.now()-h>=5e3&&window.location.reload()}}},6137:(e,t,n)=>{n.d(t,{Vv:()=>r.Vv,_f:()=>r._f,_Q:()=>r._Q,IU:()=>o.I});var r=n(4746),o=n(9077)},9077:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e[e.BlobUrl=0]="BlobUrl",e[e.Lottie=1]="Lottie",e[e.Progressive=2]="Progressive",e[e.Stream=3]="Stream"}(r||(r={}))},4746:(e,t,n)=>{let r;n.d(t,{Vv:()=>r,_f:()=>o,_Q:()=>d}),function(e){e.Bold="MessageEntityBold",e.Blockquote="MessageEntityBlockquote",e.BotCommand="MessageEntityBotCommand",e.Cashtag="MessageEntityCashtag",e.Code="MessageEntityCode",e.Email="MessageEntityEmail",e.Hashtag="MessageEntityHashtag",e.Italic="MessageEntityItalic",e.MentionName="MessageEntityMentionName",e.Mention="MessageEntityMention",e.Phone="MessageEntityPhone",e.Pre="MessageEntityPre",e.Strike="MessageEntityStrike",e.TextUrl="MessageEntityTextUrl",e.Url="MessageEntityUrl",e.Underline="MessageEntityUnderline",e.Spoiler="MessageEntitySpoiler",e.Unknown="MessageEntityUnknown"}(r||(r={}));const o=-1,d="MESSAGE_DELETED"},88:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),o=n(5116);const d=36,a=2147483647;function u(e,t,n){let r;for(e=n?Math.floor(e/700):e>>1,e+=Math.floor(e/t),r=0;e>455;r+=d)e=Math.floor(e/35);return Math.floor(r+36*e/(e+38))}function s(e,t){const n=[],r=[],o=e.length;let s,i,c,l,f,h,m,p,g,v,y,b,I;for(s=128,c=0,l=72,f=e.lastIndexOf("-"),f<0&&(f=0),h=0;h=128)throw new RangeError("Illegal input >= 0x80");n.push(e.charCodeAt(h))}for(m=f>0?f+1:0;m=o)throw RangeError("punycode_bad_input(1)");if(y=(w=e.charCodeAt(m++))-48<10?w-22:w-65<26?w-65:w-97<26?w-97:d,y>=d)throw RangeError("punycode_bad_input(2)");if(y>Math.floor((a-c)/g))throw RangeError("punycode_overflow(1)");if(c+=y*g,b=v<=l?1:v>=l+26?26:v-l,yMath.floor(a/(d-b)))throw RangeError("punycode_overflow(2)");g*=d-b}if(i=n.length+1,l=u(c-p,i,0===p),Math.floor(c/i)>a-s)throw RangeError("punycode_overflow(3)");s+=Math.floor(c/i),c%=i,t&&r.splice(c,0,e.charCodeAt(m-1)-65<26),n.splice(c,0,s),c++}var w;if(t)for(c=0,I=n.length;c{const t=[];let n=0;const r=e.length;let o;for(;n65535&&(o-=65536,t.push(String.fromCharCode(o>>>10&1023|55296)),o=56320|1023&o),t.push(String.fromCharCode(o))}return t.join("")})(n)}var i=n(3716),c=n(6752),l=n(1396);function f(e){if(!e)return;const t=(0,l.X)(e);if(t)try{let e=decodeURI(t);const n=e.match(/^https?:\/\/([^/:?#]+)(?:[/:?#]|$)/i);if(!n)return;const r=n[1];return e=e.replace(r,function(e){const t=e.split("."),n=[];for(let e=0;e{let{url:t,text:n,className:d,children:a,isRtl:u}=e;const{toggleSafeLinkModal:s,openTelegramLink:h}=(0,o.uC)(),m=a||n,p=t!==m,g=(0,r.I4)((e=>e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||!t||!t.match(i.FS)&&!t.match(i.g$)?!p||(s({url:t}),e.preventDefault(),!1):(e.preventDefault(),h({url:t}),!1)),[p,h,s,t]);if(!t)return;const v=(0,c.Z)(d||"text-entity-link",n.length>50&&"long-word-break-all");return r.ZP.createElement("a",{href:(0,l.X)(t),title:f(t),target:"_blank",rel:"noopener noreferrer",className:v,onClick:g,dir:u?"rtl":"auto"},m)}))},5376:(e,t,n)=>{n.d(t,{yW:()=>r,K2:()=>o,mD:()=>d,Oh:()=>a,v6:()=>u});function r(e){return e>536870912?`${(e/1073741824).toFixed(1)} GB`:e>524288?`${(e/1048576).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function o(e){const{fileName:t,mimeType:n}=e;return d(t,n)}function d(e,t){return e&&-1!==e.indexOf(".")?e.split(".").pop():t.split("/").pop()}function a(e){switch(e){case"apk":case"xls":case"xlsx":return"green";case"zip":case"rar":case"7z":case"tar":case"gz":case"ppt":case"pptx":return"orange";case"pdf":case"xps":return"red";default:return"default"}}function u(e){return Boolean(e.previewBlobUrl||e.thumbnail)}},4784:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(3681);const o=new RegExp(`^(?:${r.Z.source})+$`,""),d=e=>{if(e.length>24)return!1;if(!Boolean(e.match(o)))return!1;let t=0;for(;r.Z.exec(e);)if(t++,t>3)return r.Z.lastIndex=0,!1;return t}},8005:(e,t,n)=>{n.d(t,{D:()=>y});var r=n(4050),o=n(8415),d=n(8035),a=n(9937),u=n(996),s=n(2340),i=n(6752),c=n(8033),l=n(5116);const f=e=>{let{className:t,sender:n,children:o}=e;const{openChat:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({id:n.id})}),[n,d]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("UserLink",t),onClick:a},o):o},h=e=>{let{className:t,message:n,children:o}=e;const{focusMessage:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({chatId:n.chatId,messageId:n.id})}),[d,n]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("MessageLink",t),onClick:a},o):o},m=e=>{let{className:t,chatId:n,children:o}=e;const{openChat:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({id:n})}),[n,d]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("ChatLink",t),onClick:a},o):o},p=e=>{let{className:t,groupCall:n,children:o}=e;const{joinGroupCall:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({id:n.id,accessHash:n.accessHash})}),[n,d]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("GroupCallLink",t),onClick:a},o):o},g=32,v=" ";function y(e,t,n,r,o,d,u){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};if(!t.content.action)return[];const{text:i,translationValues:c,amount:l,currency:f,call:h}=t.content.action,m=[],p=s.asPlainText||s.asTextWithSpoilers,g="Chat.Service.Group.UpdatedPinnedMessage1"!==i||d?i:"Message.PinnedGenericMessage";let y,M=e(g,null!=c&&c.length?c:void 0);return M.includes("%payment_amount%")&&(y=P(M,"%payment_amount%",(0,a.x)(l,f,e.code)),M=y.pop(),m.push(...y)),y=P(M,"%action_origin%",n?C(n,p)||v:r?S(e,r,p)||v:"User"),M=y.pop(),m.push(...y),y=P(M,"%target_user%",o?o.map((e=>C(e,p))).filter(Boolean):"User"),M=y.pop(),m.push(...y),y=P(M,"%message%",d?I(e,d,s):"a message"),M=y.pop(),m.push(...y),y=P(M,"%product%",d?b(d):"a product"),M=y.pop(),m.push(...y),y=P(M,"%target_chat%",u?E(u,p):"another chat"),m.push(...y),s.asPlainText?m.join("").trim():h?w(h,m):m}function b(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{asPlainText:d,asTextWithSpoilers:a}=n;if(d)return(0,o.MK)(e,t,void 0,g);const s=(0,u.e)(e,t,void 0,void 0,g);return a?r.ZP.createElement("span",null,s):r.ZP.createElement(h,{className:"action-link",message:t},s)}function w(e,t){return r.ZP.createElement(p,{groupCall:e},t)}function C(e,t){const n=(0,d.Z)((0,o.Js)(e),g);return t?n:r.ZP.createElement(f,{className:"action-link",sender:e},e&&(0,s.Z)(n))}function S(e,t,n){const a=(0,d.Z)((0,o.U)(e,t),g);return n?a:r.ZP.createElement(m,{className:"action-link",chatId:t.id},t&&(0,s.Z)(a))}function E(e,t){const n="another chat";return t?n:r.ZP.createElement(m,{className:"action-link",chatId:e},n)}function P(e,t,n){const r=e.indexOf(t);if(r<0||!n)return[e];const o=[];return o.push(e.substring(0,r)),Array.isArray(n)?n.forEach(((e,t)=>{o.push(e),t+1{n.d(t,{X:()=>s,e:()=>i});var r=n(6137),o=n(8415),d=n(2340),a=n(8974),u=n(8035);function s(e,t,n,r,d){const{text:s,entities:i}=e.content.text||{};if(!s){const t=(0,o.UD)(e);return t?[(0,u.Z)(t,d)]:void 0}return(0,a.H)((0,u.Z)(s,d),i,t,n,void 0,e.id,r)}function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.lN,{entities:c}=t.content.text||{};const l=null==c?void 0:c.some((e=>e.type===r.Vv.Spoiler));if(!l){const r=(0,u.Z)((0,o.MK)(e,t,n),i);return a?(0,d.Z)(r,["emoji","highlight"],{highlight:a}):(0,d.Z)(r)}const f=!n&&(0,o.Eb)(t),h=f?`${f} `:"",m=s(t,a,void 0,!0,i),p=(0,o.Kk)(e,t,m);return[h,...Array.isArray(p)?p:[p]].filter(Boolean)}},2340:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),o=n(3681),d=n(3716),a=n(7361),u=n(4284),s=n(6752),i=n(782),c=n(7373),l=n(88);const f=/^[\d\wа-яё]$/i,h=/(\*\*|__).+?\1/g;function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["emoji"],n=arguments.length>2?arguments[2]:void 0;return"string"!=typeof e?[e]:(0,i.oA)(t.reduce(((e,t)=>{switch(t){case"escape_html":return p(e);case"hq_emoji":return o.Z.lastIndex=0,g(e,"big","jsx");case"emoji":return o.Z.lastIndex=0,g(e,"small","jsx");case"emoji_html":return o.Z.lastIndex=0,g(e,"small","html");case"br":return v(e,"jsx");case"br_html":return v(e,"html");case"highlight":return y(e,n.highlight);case"links":return I(e);case"simple_markdown":return w(e,"jsx");case"simple_markdown_html":return w(e,"html")}return e}),[e]))}function p(e){const t=document.createElement("div");return e.reduce(((e,n)=>"string"!=typeof n?(e.push(n),e):(t.innerText=n,e.push(t.innerHTML),e)),[])}function g(e,t,n){return a.op?e:e.reduce(((e,d)=>{if("string"!=typeof d)return e.push(d),e;const a=(d=(0,u.g6)(d)).split(o.Z),i=d.match(o.Z)||[];return e.push(a[0]),i.reduce(((e,d,i)=>{const c=(0,u.U_)((0,o.l)(d));if(!c)return e;const l=(0,s.Z)("emoji","small"===t&&"emoji-small");"jsx"===n&&e.push(r.ZP.createElement("img",{className:l,src:`./img-apple-${"big"===t?"160":"64"}/${c}.png`,alt:d})),"html"===n&&e.push(`${d}`);const f=2*i+2;return a[f]&&e.push(a[f]),e}),e)}),[])}function v(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n)return e.push(n),e;const o=n.split(/\r\n|\r|\n/g).reduce(((e,n,o,d)=>{const a=n.trimLeft(),u=n.length-a.length;return e.push(String.fromCharCode(160).repeat(u)+a),o!==d.length-1&&e.push("jsx"===t?r.ZP.createElement("br",null):"
"),e}),[]);return[...e,...o]}),[])}function y(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n||!t)return e.push(n),e;const o=n.toLowerCase(),d=o.indexOf(t.toLowerCase()),a=o[d+t.length];if(d<0||a&&a.match(f))return e.push(n),e;const u=[];return u.push(n.substring(0,d)),u.push(r.ZP.createElement("span",{className:"matching-text-highlight"},n.substring(d,d+t.length))),u.push(n.substring(d+t.length)),[...e,...u]}),[])}const b=new RegExp(`${d.FM}|${d.uW}`,"ig");function I(e){return e.reduce(((e,t)=>{if("string"!=typeof t)return e.push(t),e;const n=t.match(b);if(!n||!n.length)return e.push(t),e;const o=[];let d=n.shift(),a=0;for(;d;){const e=t.indexOf(d,a);o.push(t.substring(a,e)),d.startsWith("@")?o.push(r.ZP.createElement(c.Z,{username:d},d)):(d.endsWith("?")&&(d=d.slice(0,d.length-1)),o.push(r.ZP.createElement(l.Z,{text:d,url:d}))),a=e+d.length,d=n.shift()}return o.push(t.substring(a)),[...e,...o]}),[])}function w(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n)return e.push(n),e;const o=n.split(h),d=n.match(h)||[];return e.push(o[0]),d.reduce(((e,n,d)=>{"jsx"===t?e.push(n.startsWith("**")?r.ZP.createElement("b",null,n.replace(/\*\*/g,"")):r.ZP.createElement("i",null,n.replace(/__/g,""))):e.push(n.startsWith("**")?`${n.replace(/\*\*/g,"")}`:`${n.replace(/__/g,"")}`);const a=2*d+2;return o[a]&&e.push(o[a]),e}),e)}),[])}},8974:(e,t,n)=>{n.d(t,{z:()=>p,H:()=>m});var r=n(4050),o=n(5116),d=n(6137),a=n(2340),u=n(7373),s=n(88),i=n(6752),c=n(706);const l=new Map,f=(0,i.y)("Spoiler"),h=(0,r.X$)((e=>{let{children:t,messageId:n}=e;const o=(0,r.sO)(null),[d,a,u]=(0,c.Z)(),s=(0,r.I4)((e=>{var t;e.preventDefault(),e.stopPropagation(),null===(t=l.get(n))||void 0===t||t.forEach((e=>e.reveal()));const r=o.current.innerText.length,d=1e3*Math.round(r/23),a=Math.max(5e3,Math.min(d,6e4));setTimeout((()=>{var e;null===(e=l.get(n))||void 0===e||e.forEach((e=>e.conceal())),u()}),a)}),[u,n]);return(0,r.d4)((()=>{if(n)return l.has(n)?l.get(n).push({reveal:a,conceal:u}):l.set(n,[{reveal:a,conceal:u}]),()=>{l.delete(n)}}),[u,s,d,n,a]),r.ZP.createElement("span",{className:f("&",!d&&"concealed",!d&&Boolean(n)&&"animated"),onClick:n&&!d?s:void 0},r.ZP.createElement("span",{className:f("content"),ref:o},t))}));function m(e,t,n,o,i,c,l){if(!t||!t.length)return g(e,n,o,i,l);const f=[];let m=!1;const p=function(e){const t=new Set,n=[];return e.forEach(((r,o)=>{if(t.has(o))return;const d=v(r,o,e,t);d&&(d.organizedIndexes.forEach((e=>{t.add(e)})),n.push(d))})),n}(t);function w(t,f,p,v){const C=[],{entity:S,nestedEntities:E}=p,{offset:P,length:M,type:A}=S;let k=e.substring(t,P);const T=k.length;k&&(m&&k.length>0&&"\n"===k[0]&&(k=k.substr(1),m=!1),k&&C.push(...g(k,n,o,i,l)));const N=t+T,L=N+M;let R=e.substring(P,P+M);const F=[];if(m&&R.length>0&&"\n"===R[0]&&(R=R.substr(1),m=!1),A===d.Vv.Pre&&(m=!0),E.length){let e=N;E.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:o}=w(e,L,t,n===E.length-1);F.push(...r),e=o}))}const x=i?function(e,t,n){const r="string"==typeof t&&t,o=n.length?n.join(""):(0,a.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!r)return o;switch(e.type){case d.Vv.Bold:return`${o}`;case d.Vv.Italic:return`${o}`;case d.Vv.Underline:return`${o}`;case d.Vv.Code:return`${o}`;case d.Vv.Pre:return`\`\`\`
${o}
\`\`\``;case d.Vv.Strike:return`${o}`;case d.Vv.MentionName:return`${o}`;case d.Vv.Url:case d.Vv.TextUrl:return`${o}`;case d.Vv.Spoiler:return`${o}
`;default:return o}}(S,R,F):function(e,t,n,o,a,i){const c="string"==typeof t&&t,l=n.length?n:t;function f(){return g(l,o,void 0,void 0,i)}if(!c)return f();if(i){const t=f();return e.type===d.Vv.Spoiler?r.ZP.createElement(h,null,t):t}switch(e.type){case d.Vv.Bold:return r.ZP.createElement("strong",null,f());case d.Vv.Blockquote:return r.ZP.createElement("blockquote",null,f());case d.Vv.BotCommand:return r.ZP.createElement("a",{onClick:b,className:"text-entity-link",dir:"auto"},f());case d.Vv.Hashtag:case d.Vv.Cashtag:return r.ZP.createElement("a",{onClick:I,className:"text-entity-link",dir:"auto"},f());case d.Vv.Code:return r.ZP.createElement("code",{className:"text-entity-code"},f());case d.Vv.Email:return r.ZP.createElement("a",{href:`mailto:${c}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f());case d.Vv.Italic:return r.ZP.createElement("em",null,f());case d.Vv.MentionName:return r.ZP.createElement(u.Z,{userId:e.userId},f());case d.Vv.Mention:return r.ZP.createElement(u.Z,{username:c},f());case d.Vv.Phone:return r.ZP.createElement("a",{href:`tel:${c}`,className:"text-entity-link",dir:"auto"},f());case d.Vv.Pre:return r.ZP.createElement("pre",{className:"text-entity-pre"},f());case d.Vv.Strike:return r.ZP.createElement("del",null,f());case d.Vv.TextUrl:case d.Vv.Url:return r.ZP.createElement(s.Z,{url:y(c,e),text:c},f());case d.Vv.Underline:return r.ZP.createElement("ins",null,f());case d.Vv.Spoiler:return r.ZP.createElement(h,{messageId:a},f());default:return f()}}(S,R,F,n,c,l);if(Array.isArray(x)?C.push(...x):C.push(x),v&&L0&&"\n"===t[0]&&(t=t.substring(1)),t&&C.push(...g(t,n,o,i,l))}return{renderResult:C,entityEndIndex:L}}let C=0;return p.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:o}=w(C,e.length,t,n===p.length-1);f.push(...r),C=o})),f}function p(e){const{text:t,entities:n}=e||{};if(!t)return"";const r=m(t,n,void 0,void 0,!0);return Array.isArray(r)?r.join(""):r}function g(e,t,n,r,o){if(Array.isArray(e)){const d=[];return e.forEach((e=>{d.push(...g(e,t,n,r,o))})),d}if(r)return(0,a.Z)(e,["escape_html","emoji_html","br_html"]);const d=[n?"hq_emoji":"emoji"];return o||d.push("br"),t?(0,a.Z)(e,d.concat("highlight"),{highlight:t}):(0,a.Z)(e,d)}function v(e,t,n,r){const{offset:o,length:d}=e,a=new Set([t]);if(r.has(t))return;const u=[];return n.filter(((e,n)=>n>t&&e.offset>=o&&e.offsetv(e,n.indexOf(e),n,r))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||a.has(e)||(t=!0),a.add(e)})),t&&u.push(e)})),{entity:e,organizedIndexes:a,nestedEntities:u}}function y(e,t){const{type:n,url:r}=t;return n===d.Vv.TextUrl&&r?r:e}function b(e){(0,o.uC)().sendBotCommand({command:e.currentTarget.innerText})}function I(e){(0,o.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,o.uC)().searchTextMessagesLocal()}},386:(e,t,n)=>{n.d(t,{q:()=>d,b:()=>a});var r=n(3716),o=n(7361);function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.cj||!document.activeElement||document.activeElement.id!==r.R2||!t&&e.target!==e.currentTarget||e.preventDefault()}function a(e){d(e,!0)}},7373:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(5116),d=n(9066);const a=(0,o.c$)(((e,t)=>{let{userId:n}=t;return{userOrChat:n?(0,d.dy)(e,n):void 0}}))((e=>{let{username:t,userOrChat:n,children:d}=e;const{openChat:a,openChatByUsername:u}=(0,o.uC)();return r.ZP.createElement("a",{onClick:()=>{n?a({id:n.id}):t&&u({username:t.substring(1)})},className:"text-entity-link",dir:"auto"},d)}))},231:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9204),a=n(8512);const u=e=>{let{ref:t,type:n="button",onClick:u,onContextMenu:s,onMouseDown:i,onMouseEnter:c,onMouseLeave:l,onFocus:f,children:h,size:m="default",color:p="primary",backgroundImage:g,className:v,round:y,pill:b,fluid:I,isText:w,isLoading:C,ariaLabel:S,href:E,download:P,disabled:M,ripple:A,faded:k,tabIndex:T,isRtl:N,withClickPropagation:L}=e,R=(0,r.sO)(null);t&&(R=t);const[F,x]=(0,r.eJ)(!1),B=(0,o.Z)("Button",v,m,p,y&&"round",b&&"pill",I&&"fluid",M&&"disabled",w&&"text",C&&"loading",A&&"has-ripple",k&&"faded",F&&"clicked",g&&"with-image"),O=(0,r.I4)((e=>{!M&&u&&u(e),x(!0),setTimeout((()=>{x(!1)}),400)}),[M,u]),Z=(0,r.I4)((e=>{L||e.preventDefault(),!M&&i&&i(e)}),[i,M,L]);return E?r.ZP.createElement("a",{ref:R,className:B,href:E,title:S,download:P,tabIndex:T,dir:N?"rtl":void 0},h,!M&&A&&r.ZP.createElement(a.Z,null)):r.ZP.createElement("button",{ref:R,type:n,className:B,onClick:O,onContextMenu:s,onMouseDown:Z,onMouseEnter:c&&!M?c:void 0,onMouseLeave:l&&!M?l:void 0,onFocus:f&&!M?f:void 0,"aria-label":S,title:S,tabIndex:T,dir:N?"rtl":void 0,style:g?`background-image: url(${g})`:void 0},C?r.ZP.createElement("div",null,r.ZP.createElement("span",{dir:N?"auto":void 0},"Please wait..."),r.ZP.createElement(d.Z,{color:w?"blue":"white"})):h,!M&&A&&r.ZP.createElement(a.Z,null))}},4605:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),o=n(6752),d=n(9107),a=n(2340),u=n(9204);const s=(0,r.X$)((e=>{let{id:t,name:n,value:s,label:i,subLabel:c,checked:l,disabled:f,round:h,blocking:m,isLoading:p,onChange:g,onCheck:v}=e;const y=(0,d.Z)(),b=(0,r.I4)((e=>{g&&g(e),v&&v(e.currentTarget.checked)}),[g,v]),I=(0,o.Z)("Checkbox",f&&"disabled",h&&"round",p&&"loading",m&&"blocking");return r.ZP.createElement("label",{className:I,dir:y.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"checkbox",id:t,name:n,value:s,checked:l,disabled:f,onChange:b}),r.ZP.createElement("div",{className:"Checkbox-main"},r.ZP.createElement("span",{className:"label",dir:"auto"},(0,a.Z)(i)),c&&r.ZP.createElement("span",{className:"subLabel",dir:"auto"},(0,a.Z)(c))),p&&r.ZP.createElement(u.Z,null))}))},3106:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(2328);const d=e=>{let{trigger:t,className:n,children:d,positionX:a="left",positionY:u="top",footer:s,forceOpen:i,onOpen:c,onClose:l}=e;const f=(0,r.sO)(null),h=(0,r.sO)(null),[m,p]=(0,r.eJ)(!1);return r.ZP.createElement("div",{ref:h,className:`DropdownMenu ${n||""}`,onKeyDown:e=>{const t=f.current;if(!m||40!==e.keyCode||!t)return;const n=document.activeElement,r=Array.from(t.children);n&&-1!==r.indexOf(n)||r[0].focus()}},t({onTrigger:()=>{p(!m),m?l&&l():c&&c()},isOpen:m}),r.ZP.createElement(o.Z,{ref:f,containerRef:h,isOpen:m||Boolean(i),className:n||"",positionX:a,positionY:u,footer:s,autoClose:!0,onClose:()=>{p(!1),l&&l()},shouldSkipTransition:i},d))}},7687:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6752),d=n(9107);const a=(0,r.X$)((e=>{let{ref:t,id:n,className:a,value:u,label:s,error:i,success:c,disabled:l,readOnly:f,placeholder:h,autoComplete:m,inputMode:p,maxLength:g,onChange:v,onInput:y,onKeyPress:b,onKeyDown:I,onBlur:w,onPaste:C}=e;const S=(0,d.Z)(),E=i||c||s,P=(0,o.Z)("input-group",u&&"touched",i?"error":c&&"success",l&&"disabled",f&&"disabled",E&&"with-label",a);return r.ZP.createElement("div",{className:P,dir:S.isRtl?"rtl":void 0},r.ZP.createElement("input",{ref:t,className:"form-control",type:"text",id:n,dir:"auto",value:u||"",placeholder:h,maxLength:g,autoComplete:m,inputMode:p,disabled:l,readOnly:f,onChange:v,onInput:y,onKeyPress:b,onKeyDown:I,onBlur:w,onPaste:C}),E&&r.ZP.createElement("label",{htmlFor:n},E))}))},8033:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=e=>{let{children:t,className:n,isRtl:d,onClick:a}=e;const u=(0,r.I4)((e=>{e.preventDefault(),a(e)}),[a]);return r.ZP.createElement("a",{href:"#",className:(0,o.Z)("Link",n),dir:d?"rtl":"auto",onClick:a?u:void 0},t)}},4288:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(9204),d=n(6752);const a=(0,r.X$)((e=>{let{color:t="blue",backgroundColor:n,onClick:a}=e;return r.ZP.createElement("div",{className:(0,d.Z)("Loading",a&&"interactive"),onClick:a},r.ZP.createElement(o.Z,{color:t,backgroundColor:n}))}))},2328:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),o=n(1212),d=n(2313),a=n(8758),u=n(274),s=n(3989),i=n(6752),c=n(8674),l=n(6590),f=n(386),h=n(7361);const m=e=>{let{ref:t,containerRef:n,isOpen:m,className:p,style:g,bubbleStyle:v,children:y,transformOriginX:b,transformOriginY:I,positionX:w="left",positionY:C="top",autoClose:S=!1,footer:E,noCloseOnBackdrop:P=!1,noCompact:M,onCloseAnimationEnd:A,onClose:k,onMouseEnter:T,onMouseLeave:N,shouldSkipTransition:L}=e,R=(0,r.sO)(null);t&&(R=t);const F=n||R,{transitionClassNames:x}=(0,o.Z)(m,A,L,void 0,L);(0,r.d4)((()=>m&&k?(0,s.Z)(k):void 0),[m,k]),(0,l.ZP)(m,k,void 0,void 0,S),(0,u.Z)((e=>{let[t]=e;(m||!m&&!0===t)&&(0,c.YW)(200)}),[m]);const B=(0,d.Z)(R,m,S?k:void 0,void 0,!0);(0,a.Z)(m,F,P?void 0:k);const O=(0,i.Z)("bubble menu-container custom-scroll",C,w,E&&"with-footer",x),Z=void 0!==I?`${I}px`:void 0,D=void 0!==b?`${b}px`:void 0;return r.ZP.createElement("div",{className:(0,i.Z)("Menu no-selection",!M&&h.FW&&"compact",!h.gk&&"no-blur",p),onKeyDown:m?B:void 0,onMouseEnter:T,onMouseLeave:m?N:void 0,style:g},m&&r.ZP.createElement("div",{className:"backdrop",onMouseDown:f.b}),r.ZP.createElement("div",{ref:R,className:O,style:`transform-origin: ${D||w} ${Z||C};${v||""}`,onClick:S?k:void 0},y,E&&r.ZP.createElement("div",{className:"footer"},E)))}},8964:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9107),a=n(7361);const u=e=>{const{icon:t,className:n,children:u,onClick:s,href:i,download:c,disabled:l,destructive:f,ariaLabel:h}=e,m=(0,d.Z)(),p=(0,r.I4)((e=>{if(l||!s)return e.stopPropagation(),void e.preventDefault();s(e)}),[l,s]),g=(0,r.I4)((e=>{if(13===e.keyCode||32===e.keyCode)return l||!s?(e.stopPropagation(),void e.preventDefault()):void s(e)}),[l,s]),v=(0,o.Z)("MenuItem",n,l&&"disabled",f&&"destructive",a.FW&&"compact"),y=r.ZP.createElement(r.ZP.Fragment,null,t&&r.ZP.createElement("i",{className:`icon-${t}`,"data-char":t.startsWith("char-")?t.replace("char-",""):void 0}),u);return i?r.ZP.createElement("a",{tabIndex:0,className:v,href:i,download:c,"aria-label":h,title:h,target:i.startsWith(window.location.origin)?"_self":"_blank",rel:"noopener noreferrer",dir:m.isRtl?"rtl":void 0,onClick:s},y):r.ZP.createElement("div",{role:"button",tabIndex:0,className:v,onClick:p,onKeyDown:g,"aria-label":h,title:h,dir:m.isRtl?"rtl":void 0},y)}},8512:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(9118);const d=(0,r.X$)((()=>{const[e,t]=(0,r.eJ)([]),n=(0,r.Ye)((()=>(0,o.Ds)((()=>{t([])}),700,!1)),[]),d=(0,r.I4)((r=>{if(0!==r.button)return;const o=r.currentTarget,d=o.getBoundingClientRect(),a=o.offsetWidth/2;t([...e,{x:r.clientX-d.x-a/2,y:r.clientY-d.y-a/2,size:a}]),requestAnimationFrame((()=>{n()}))}),[e,n]);return r.ZP.createElement("div",{className:"ripple-container",onMouseDown:d},e.map((e=>{let{x:t,y:n,size:o}=e;return r.ZP.createElement("span",{style:`left: ${t}px; top: ${n}px; width: ${o}px; height: ${o}px;`})})))}))},9204:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=e=>{let{color:t="blue",backgroundColor:n}=e;return r.ZP.createElement("div",{className:(0,o.Z)("Spinner",t,n&&"with-background",`bg-${n}`)},r.ZP.createElement("div",null))}},3716:(e,t,n)=>{n.d(t,{iC:()=>r,Ji:()=>o,eM:()=>d,ZT:()=>a,Cg:()=>u,S:()=>s,Ti:()=>i,ou:()=>c,eA:()=>l,b_:()=>f,Vx:()=>h,sd:()=>m,Uh:()=>p,lO:()=>g,gJ:()=>v,Rk:()=>y,Cy:()=>b,lW:()=>I,SG:()=>w,lF:()=>C,fo:()=>S,ee:()=>E,by:()=>P,lo:()=>A,hT:()=>k,YQ:()=>T,rS:()=>N,t_:()=>L,Ov:()=>R,EN:()=>F,pn:()=>x,Hk:()=>B,Vk:()=>O,mo:()=>Z,qU:()=>D,ul:()=>_,Qx:()=>$,mw:()=>U,oB:()=>j,zy:()=>W,CX:()=>V,xS:()=>G,b6:()=>H,AR:()=>z,r_:()=>Q,o_:()=>K,R2:()=>J,nY:()=>q,QU:()=>Y,jT:()=>X,_m:()=>ee,ks:()=>te,l3:()=>ne,u_:()=>re,rO:()=>oe,AE:()=>de,AJ:()=>ae,fK:()=>ue,V$:()=>se,bK:()=>ie,ck:()=>ce,xn:()=>le,K7:()=>fe,w7:()=>he,z7:()=>me,qp:()=>pe,Q:()=>ge,Mw:()=>ve,DC:()=>ye,Y7:()=>be,yK:()=>Ie,K2:()=>we,bM:()=>Ce,ku:()=>Se,zq:()=>Ee,PM:()=>Pe,jV:()=>Me,$E:()=>Ae,pR:()=>ke,kU:()=>Te,Y:()=>Ne,Ng:()=>Le,oG:()=>Re,wG:()=>Fe,dI:()=>xe,VC:()=>Be,FM:()=>Oe,uW:()=>Ze,g$:()=>De,FS:()=>_e,FD:()=>$e,aw:()=>Ue,FV:()=>je,Nf:()=>We,WS:()=>Ve,DU:()=>Ge,EG:()=>He,t4:()=>ze,sR:()=>Qe,$O:()=>Ke,Bg:()=>Je,vi:()=>qe,Db:()=>Ye,mU:()=>Xe,p3:()=>et,It:()=>tt,Vv:()=>nt,g:()=>rt,Ro:()=>ot,aC:()=>dt,LH:()=>at});const r="Telegram WebZ",o="1.35.2",d=!1,a=!1,u=!1,s="Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.",i="Telegram",c=" [Inactive]",l=!1,f="user_auth",h="GramJs:sessionId",m=!1,p="tt-global-state",g=500,v=200,y=30,b=!1,I="tt-media",w="tt-media-avatars",C="tt-media-progressive",S="tt-custom-bg",E="tt-lang-packs-v7",P=[1,5,10,50,100,500],M="undefined"!=typeof window&&window.innerHeight>=900,A=1,k=M?60:40,T=2*k,N=72,L=M?30:25,R=100,F=42,x=42,B=20,O=30,Z=200,D=500,_=20,$=1,U=1,j=0,W=2,V=W,G=16,H=17,z=15,Q=1e4,K=3e3,J="editable-message-text",q="editable-message-text-modal",Y=1440,X=1150,ee=1275,te=925,ne=600,re=950,oe=450,de=1e9,ae="0",ue=100,se=1500,ie=250,ce=600,le=500,fe=(Math.round((ie+ce)/2),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),13),he=11,me=160,pe=120,ge=64,ve=48,ye=32,be=64,Ie=64,we=160,Ce=140,Se=100,Ee=100,Pe=140,Me=140,Ae="NO_STICKER_SET",ke="en",Te=200,Ne=450,Le="video/quicktime",Re=new Set(["image/png","image/gif","image/jpeg"]),Fe=new Set(["video/mp4"]),xe=new Set([...Re,...Fe]),Be="The message is not supported on this version of Telegram.",Oe="((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)",Ze="(@[\\w\\d_-]+)",De=/^tg:(\/\/)?([?=&\d\w_-]+)?/gm,_e=/^(?:https?:\/\/)?(?:t\.me\/)/gm,$e=new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),Ue="777000",je="1271266957",We=0,Ve=1,Ge=10,He=5,ze=2147483646,Qe="en",Ke="android",Je=["android","ios","tdesktop","macos"],qe="TelegramTips",Ye=["ar","pt-br","id","it","ko","ms","pl","es","tr"],Xe="https://bugs.telegram.org/?tag_ids=41&sort=time",et="#A2AF8E",tt="#0F0F0F",nt="#0a0a0a8c",rt="rgba(90, 110, 70, 0.6)",ot=100,dt=100*ot,at=!1},274:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(7204);const d=(e,t,n)=>{const d=(0,o.Z)(t);return(0,r.d4)((()=>e(d||[])),t,n)}},706:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[t,n]=(0,r.eJ)(e),o=(0,r.I4)((()=>{n(!0)}),[]),d=(0,r.I4)((()=>{n(!1)}),[]);return[t,o,d]}},5326:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=()=>{const[,e]=(0,r.eJ)(!1);return(0,r.I4)((()=>{e((e=>!e))}),[])}},8674:(e,t,n)=>{n.d(t,{zG:()=>s,YW:()=>i,ZP:()=>c});var r=n(4050);const o="tt-event-heavy-animation-start",d="tt-event-heavy-animation-end";let a,u=!1;function s(){return u}function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;function t(){a&&(clearTimeout(a),a=void 0),u=!1,document.dispatchEvent(new Event(d))}return u||(u=!0,document.dispatchEvent(new Event(o))),a&&(clearTimeout(a),a=void 0),a=window.setTimeout(t,e),t}const c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.d4)((()=>{if(!n)return u&&e(),document.addEventListener(o,e),document.addEventListener(d,t),()=>{document.removeEventListener(d,t),document.removeEventListener(o,e)}}),[n,t,e])}},6590:(e,t,n)=>{n.d(t,{Oy:()=>s,Wv:()=>l,ZP:()=>h});var r=n(4050),o=n(7361),d=n(7204),a=n(5116),u=n(782);const s=window.location.hash,i=`${window.location.pathname}${window.location.search}`,c={currentIndex:0,nextStateIndexToReplace:-1,isHistoryAltered:!1,isDisabled:!1,isEdge:!1,currentIndexes:[]},l=()=>{c.isDisabled=!0},f=()=>{c.isEdge&&setTimeout((()=>{c.isEdge=!1}),350)};function h(e,t,n,o){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5?arguments[5]:void 0;const f=(0,r.sO)(-1),h=(0,r.sO)(!1),m=(0,d.Z)(e),p=(0,r.sO)(!0),g=(0,r.sO)([]),v=(0,d.Z)(l),y=(0,r.sO)(!1),b=(0,r.I4)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(l){const e=v||[];if(e.length{const e=++c.currentIndex;c.currentIndexes.push(e),window.history.pushState({index:e,state:o},"",`#${l[l.length-1]}`),g.current.push({index:e,hash:l[l.length-1]})}),0);else{const t=e.length-l.length;if(y.current)y.current=!1;else{if(l.length!==g.current.length&&t>0){const e=g.current[g.current.length-t-1];let n=t;if(e){const t=c.currentIndexes.findIndex((t=>t===e.index));n=c.currentIndexes.length-t-1}c.isHistoryAltered=!0,window.history.go(-n),g.current.splice(g.current.length-t-1,t).forEach((e=>{let{index:t}=e;c.currentIndexes.splice(c.currentIndexes.indexOf(t),1)}))}l.length>0&&setTimeout((()=>{const e=++c.currentIndex;c.currentIndexes[c.currentIndexes.length-1]=e,window.history.replaceState({index:e,state:o},"",`${i}#${l[l.length-1]}`),g.current[g.current.length-1]={index:e,hash:l[l.length-1]}}),0)}}}else e&&!t&&(p.current=!1,h.current?(h.current=!1,c.currentIndexes.push(f.current)):setTimeout((()=>{const e=++c.currentIndex;c.currentIndexes.push(e),window.history[c.currentIndexes.includes(c.nextStateIndexToReplace-1)&&0!==window.history.state.index&&c.nextStateIndexToReplace===e&&!s?"replaceState":"pushState"]({index:e,state:o},""),f.current=e,s&&(c.nextStateIndexToReplace=c.currentIndex+1)}),0)),!t&&e||p.current||(f.current!==c.currentIndex&&s||(c.isHistoryAltered=!0,window.history.back(),setTimeout((()=>{c.nextStateIndexToReplace=-1}),400)),c.currentIndexes.splice(c.currentIndexes.indexOf(f.current),1),p.current=!0)}),[o,l,e,v,s]);return(0,r.d4)((()=>{const r=e=>{if(c.isHistoryAltered)return void setTimeout((()=>{c.isHistoryAltered=!1}),0);const{index:r}=e.state,o=r||0;try{const r=l?g.current[g.current.length-1].index:f.current,d=c.currentIndexes[c.currentIndexes.indexOf(r)-1];if(c.isDisabled)return;!p.current&&(0===o||o===d)||l&&(0===o||o===d)?(l&&(y.current=!0,g.current.pop()),c.currentIndexes.splice(c.currentIndexes.indexOf(r),1),t&&(c.isEdge&&(0,a.uC)().disableHistoryAnimations(),t(!c.isEdge),p.current=!0)):o===r&&p.current&&n&&!l&&(h.current=!0,c.isEdge&&(0,a.uC)().disableHistoryAnimations(),n(e.state.state))}catch(e){}},o=l?!v||!(0,u.et)(v,l):m!==e;return!c.isDisabled&&o&&b(),window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)}),[o,b,l,e,t,n,v,m,s]),{forceClose:()=>b(!0)}}o.cj&&(window.addEventListener("touchstart",(e=>{const t=e.touches[0].pageX;(t<=300||t>=window.innerWidth-300)&&(c.isEdge=!0)})),window.addEventListener("touchend",f),window.addEventListener("popstate",f)),window.history.replaceState({index:c.currentIndex},"",i)},2313:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=(e,t,n,o,d)=>{const[a,u]=(0,r.eJ)(-1);return(0,r.d4)((()=>{u(-1);const n=e.current;t&&n&&!d&&(n.tabIndex=-1,n.focus())}),[e,t,d]),(0,r.I4)((t=>{const r=e.current;if(!r)return;if(13===t.keyCode&&n)return void n(a);if(38!==t.keyCode&&40!==t.keyCode)return;const d=document.activeElement,s=Array.from(o?r.querySelectorAll(o):r.children);let i=d&&s.indexOf(d)||a;if(38===t.keyCode&&i>0)i--;else if(40===t.keyCode&&i{n.d(t,{Z:()=>a});var r=n(711),o=n(5326),d=n(9290);const a=()=>{const e=(0,o.Z)();return(0,d.Z)((()=>r.ll(e)),[e]),r.i0}},8778:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(9203),d=n(5326);const a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const u=(0,o.o5)(e,t),s=(0,d.Z)();return(0,r.d4)((()=>{if(a)return(0,o.Qt)(s)}),[a,s]),(0,r.d4)((()=>{n||u||(0,o.$y)(e,t).then(s)}),[e,s,u,t,n]),u}},9290:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7204);const o=(e,t)=>{const n=(0,r.Z)(t);n&&!t.some(((e,t)=>e!==n[t]))||e(n||[])}},7204:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=function(e,t){const n=(0,r.sO)(),{current:o}=n;return t&&void 0===e||(n.current=e),o}},1212:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"fast",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const[u,s]=(0,r.eJ)(!e),i=(0,r.sO)(),[c,l]=(0,r.eJ)(e&&n);if(e)s(!1),l(!0),i.current&&(window.clearTimeout(i.current),i.current=void 0);else if(l(!1),!u&&!i.current){const e=()=>{s(!0),t&&t(),i.current=void 0};a?e():i.current=window.setTimeout(e,350)}const f=c&&!(a&&!e),h=Boolean(i.current),m=e||h,p=(0,o.Z)(d&&"opacity-transition",d,f&&"open",m&&"shown",h&&"closing");return{shouldRender:m,transitionClassNames:p}}},8758:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);function o(e,t,n){(0,r.d4)((()=>{const r=e=>{const r=t.current,o=e.target;r&&o&&(r.contains(e.target)&&!o.classList.contains("backdrop")||(e.preventDefault(),e.stopPropagation(),n&&n()))};return e&&n&&document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}}),[e,t,n])}},5247:(e,t,n)=>{n.d(t,{Oo:()=>s,xg:()=>i,lQ:()=>m});var r=n(3716);const o=new Set(["scroll","mouseenter","mouseleave"]),d={},a={},u=new Map;function s(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=c(t,e);l(o,e,r)?f(o,e,n):e.addEventListener(o,n,r)}function i(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=c(t,e);l(o,e,r)?h(o,e):e.removeEventListener(o,n,r)}function c(e,t){const n=e.replace(/^on/,"").replace(/Capture$/,"").toLowerCase();return"change"===n&&"SELECT"!==t.tagName?"input":"doubleclick"===n?"dblclick":"focus"===n?"focusin":"blur"===n?"focusout":n}function l(e,t,n){return!n&&!o.has(e)&&"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName}function f(e,t,n){d[e]||(d[e]=0,document.addEventListener(e,p)),function(e){return a[e]||(a[e]=new Map),a[e]}(e).set(t,n),function(e){const t=u.get(e);if(t)return t;const n=new Set;return u.set(e,n),n}(t).add(e),d[e]++}function h(e,t){d[e]--,d[e]||document.removeEventListener(e,p),a[e].delete(t),u.get(t).delete(e)}function m(e){const t=u.get(e);t&&(t.forEach((t=>h(t,e))),u.delete(e))}function p(e){const t=a[e.type];if(t){let n=!1,r=e.target;const o=()=>{n=!0},d=()=>{e.preventDefault()},a=new Proxy(e,{get:(e,t)=>"currentTarget"===t?r:"stopPropagation"===t||"stopImmediatePropagation"===t?o:"preventDefault"===t?d:Reflect.get(e,t)});for(;r&&r!==document.body;){const e=t.get(r);if(e&&(e(a),n))return;r=r.parentNode}}}r.eM&&document.addEventListener("dblclick",(()=>{const e=Object.keys(d).length,t=Object.values(d).reduce(((e,t)=>e+t),0),n=Object.keys(a).length,r=Object.values(a).reduce(((e,t)=>e+t.size),0),o=u.size,s=Array.from(u.values()).reduce(((e,t)=>e+t.size),0);console.warn("DELEGATED EVENTS STATS",{delegatedHandlersCount1:t,delegatedHandlersCount2:r,delegatedEventTypesCount:s,delegationRegistriesCount:n,delegationElementsCount:o,documentListenersCount:e})}))},2916:(e,t,n)=>{n.d(t,{Z:()=>I});var r=n(4050),o=n(6926),d=n(3716),a=n(5247);const u=new Set(["key","ref","teactFastList","teactOrderKey"]),s=new Set(["dir","role"]),i={autoPlay:"autoplay",autoComplete:"autocomplete"},c={};function l(e,t,n,o,d){let{skipComponentUpdate:a=!1,forceIndex:u=!1,fragment:s,moveDirection:i}=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const c=t&&(0,r.op)(t),l=n&&(0,r.op)(n);if(!a&&c&&l&&!(0,r.k)(t,n)&&(n=h(t,n)),!a&&l&&n.componentInstance.isMounted&&m(n,o,d,e),t===n)return n;if(!t&&n){l&&(n=f(n,o,d,e));const t=p(n);(0,r.CD)(n,t),u&&e.childNodes[d]?e.insertBefore(t,e.childNodes[d]):(s||e).appendChild(t)}else if(t&&!n)e.removeChild((0,r.U9)(t)),(0,r.Zb)(t);else if(t&&n)if((0,r.k)(t,n)){l&&(n=f(n,o,d,e));const a=p(n);(0,r.CD)(n,a),e.replaceChild(a,(0,r.U9)(t)),(0,r.Zb)(t)}else{const o=c&&l,a=(0,r.U9)(t);if(o||((0,r.CD)(n,a),(0,r.CD)(t,void 0),"props"in t&&"props"in n&&(n.props.ref=t.props.ref)),(0,r.O_)(n)){if(i){const t=a,n=e.childNodes["up"===i?d:d+1];n?e.insertBefore(t,n):(s||e).appendChild(t)}o||y(t,n,a),n.children=g(t,n,o?e:a)}}return n}function f(e,t,n,o){if(!(0,r.op)(e))return e;const{componentInstance:d}=e;if(!d.isMounted){m(e=(0,r.Hb)(d),t,n,o);const a=e.children[0];(0,r.op)(a)&&(e.children=[f(a,e,0,o)]),d.isMounted=!0}return e}function h(e,t){return e.componentInstance.props=t.componentInstance.props,(0,r.SO)(e.componentInstance)}function m(e,t,n,r){const{componentInstance:o}=e;o.onUpdate=()=>{t.children[n]=l(r,t.children[n],o.$element,t,n,{skipComponentUpdate:!0})}}function p(e){if((0,r.V2)(e))return document.createTextNode("");if((0,r.iB)(e))return document.createTextNode(e.value);if((0,r.op)(e))return p(e.children[0]);const{tag:t,props:n,children:o=[]}=e,d=document.createElement(t);return"object"==typeof n.ref&&(n.ref.current=d),Object.entries(n).forEach((e=>{let[t,r]=e;void 0!==n[t]&&b(d,t,r)})),e.children=o.map(((t,n)=>l(d,void 0,t,e,n))),d}function g(e,t,n){if(t.props.teactFastList)return function(e,t,n){const o=new Set(t.children.map((e=>{const t="props"in e&&e.props.key;return d.eM&&(0,r.O_)(e)&&null==t&&console.warn("Missing `key` in `teactFastList`"),t})));let a=0;const u=e.children.reduce(((e,r,d)=>{let u="props"in r?r.props.key:void 0;const s=null!=u;if(s&&!o.has(u))return l(n,r,void 0,t,-1),e;if(!s){const o=t.children[d],a=o&&"props"in o?o.props.key:void 0;if(!o||a)return l(n,r,void 0,t,-1),e;u=`__indexKey#${d}`}return e[u]={$element:r,index:a++,order:"props"in r?r.props.teactOrderKey:void 0},e}),{});let s,i,c=[],f=0;return t.children.forEach(((e,r)=>{const o="props"in e?e.props.key:`__indexKey#${r}`,d=u[o];if(!d)return s||(s=[],i=r),void s.push(e);s&&(c=c.concat(v(s,i,n,t)),i=void 0,s=void 0);const a="props"in e?e.props.teactOrderKey:void 0,h=d.index!==f&&d.order!==a,m=h&&f>d.index;h&&!m||f++,c.push(l(n,d.$element,e,t,r,{forceIndex:!0,moveDirection:h?m?"down":"up":void 0}))})),s&&(c=c.concat(v(s,i,n,t))),c}(e,t,n);const o=e.children.length,a=t.children.length,u=Math.max(o,a),s=[],i=a>o+1?document.createDocumentFragment():void 0;for(let r=0;r=o?{fragment:i}:void 0);d&&s.push(d)}return i&&n.appendChild(i),s}function v(e,t,n,r){if(1===e.length)return[l(n,void 0,e[0],r,t,{forceIndex:!0})];if(e.length>1){const o=document.createDocumentFragment(),d=e.map((e=>l(n,void 0,e,r,t,{fragment:o})));return n.childNodes[t]?n.insertBefore(o,n.childNodes[t]):n.appendChild(o),d}throw new Error("Unexpected input")}function y(e,t,n){const r=Object.entries(e.props),o=Object.entries(t.props);r.forEach((e=>{let[r,o]=e;const d=t.props[r];void 0!==o&&(void 0===d||o!==d&&r.startsWith("on"))&&function(e,t,n){"className"===t?e.className="":"value"===t?e.value="":"style"===t?e.style.cssText="":"dangerouslySetInnerHTML"===t?e.innerHTML="":t.startsWith("on")?(0,a.xg)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||t.startsWith("aria-")||s.has(t)?e.removeAttribute(t):u.has(t)||delete e[i[t]||t]}(n,r,o)})),o.forEach((t=>{let[r,o]=t;const d=e.props[r];void 0!==o&&o!==d&&b(n,r,o)}))}function b(e,t,n){"className"===t?e.className=n:"value"===t?e.value!==n&&(e.value=n):"style"===t?e.style.cssText=n:"dangerouslySetInnerHTML"===t?e.innerHTML=n.__html:t.startsWith("on")?(0,a.Oo)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||t.startsWith("aria-")||s.has(t)?e.setAttribute(t,n):u.has(t)||(e[i[t]||t]=n)}const I={render:function(e,t){if(!t)return;let n=t.getAttribute("data-teact-head-id");n||(n=(0,o.Z)(c),c[n]={children:[]},t.setAttribute("data-teact-head-id",n));const r=c[n];r.children=[l(t,r.children[0],e,r,0)]}}},4050:(e,t,n)=>{n.d(t,{V2:()=>h,iB:()=>m,op:()=>g,O_:()=>v,SO:()=>M,k:()=>A,Zb:()=>k,Hb:()=>T,U9:()=>R,CD:()=>F,eJ:()=>x,d4:()=>O,bt:()=>Z,Ye:()=>D,I4:()=>_,sO:()=>$,X$:()=>U,ZP:()=>j});var r=n(3716),o=n(9118),d=n(782),a=n(275),u=n(3592),s=n(5247);let i;!function(e){e[e.Empty=0]="Empty",e[e.Text=1]="Text",e[e.Tag=2]="Tag",e[e.Component=3]="Component"}(i||(i={}));const c=Symbol("Fragment"),l=new Set(["TeactMemoWrapper","TeactNContainer","Button","ListItem","MenuItem"]);let f;function h(e){return e.type===i.Empty}function m(e){return e.type===i.Text}function p(e){return e.type===i.Tag}function g(e){return e.type===i.Component}function v(e){return p(e)||g(e)}function y(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:[];const{props:n}=e;return{componentInstance:e,type:i.Component,props:n,children:t}}function w(e,t,n){return{type:i.Tag,tag:e,props:t,children:C(n).map(E)}}function C(e){let t=e.length-1;for(;t>=0&&S(e[t]);t--);return t+17&&console.warn(`[Teact] Slow component render: ${n}, ${Math.round(t)} ms`),P[n].renderTimes.push(t),P[n].renderCount++}}catch(t){(0,u.S)(t),o=e.renderedValue}if(e.isMounted&&o===e.renderedValue)return e.$element;e.renderedValue=o;const d=E(o);return e.$element=I(e,[d]),e.$element}function A(e,t){return typeof e!=typeof t||e.type!==t.type||(m(e)&&m(t)?e.value!==t.value:p(e)&&p(t)?e.tag!==t.tag||e.props.key!==t.props.key:!(!g(e)||!g(t)||e.componentInstance.Component===t.componentInstance.Component&&e.props.key===t.props.key))}function k(e){if(g(e))(t=e.componentInstance).isMounted&&(t.hooks.memos.byCursor.forEach((e=>{e.current=void 0})),t.hooks.effects.byCursor.forEach((e=>{let{cleanup:t}=e;if("function"==typeof t)try{t()}catch(e){(0,u.S)(e)}})),t.isMounted=!1,function(e){e.hooks.effects.byCursor.forEach((e=>{e.cleanup=void 0,e.effect=void 0,e.dependencies=void 0})),e.hooks.state.byCursor.forEach((e=>{e.value=void 0,e.nextValue=void 0,e.setter=void 0})),e.hooks.memos.byCursor.forEach((e=>{e.dependencies=void 0})),e.hooks=void 0,e.$element=void 0,e.renderedValue=void 0,e.Component=void 0,e.props=void 0,e.forceUpdate=void 0,e.onUpdate=void 0}(t));else if(p(e)&&(e.target&&(0,s.lQ)(e.target),e.props.ref&&(e.props.ref.current=void 0)),e.target&&(e.target=void 0),!v(e))return;var t;e.children.forEach(k)}function T(e){return M(e),e.isMounted=!0,e.$element}function N(e){e.isMounted&&(e.hooks.state.byCursor.forEach((e=>{e.value=e.nextValue})),e.prepareForFrame=(0,o.wT)((()=>N(e))),e.forceUpdate=(0,o.mS)((()=>L(e))))}function L(e){if(!e.isMounted||!e.onUpdate)return;const t=e.$element;M(e),e.$element!==t&&e.onUpdate()}function R(e){return g(e)?R(e.children[0]):e.target}function F(e,t){g(e)?F(e.children[0],t):e.target=t}function x(e){const{cursor:t,byCursor:n}=f.hooks.state;var d;return void 0===n[t]&&(n[t]={value:e,nextValue:e,setter:(d=f,e=>{n[t].nextValue!==e&&(n[t].nextValue="function"==typeof e?e(n[t].value):e,d.prepareForFrame&&d.forceUpdate||(d.prepareForFrame=(0,o.wT)((()=>N(d))),d.forceUpdate=(0,o.mS)((()=>L(d)))),d.prepareForFrame(),d.forceUpdate(),r.ZT&&"TeactNContainer"!==d.name&&console.log("[Teact.useState]",d.name,d.Component&&d.Component.DEBUG_contentComponentName?`> ${d.Component.DEBUG_contentComponentName}`:"",`Forced update at cursor #${t}, next value: `,n[t].nextValue))})}),f.hooks.state.cursor++,[n[t].value,n[t].setter]}function B(e,t,n,o,d){const{cursor:a,byCursor:s}=f.hooks.effects,i=f;function c(){if(!i.isMounted)return;const{cleanup:e}=s[a];if("function"==typeof e)try{let t;if(r.eM&&(t=performance.now()),e(),r.eM){const e=performance.now()-t,n=i.name;e>7&&console.warn(`[Teact] Slow cleanup at effect cursor #${a}: ${n}, ${Math.round(e)} ms`)}}catch(e){(0,u.S)(e)}}function l(){if(!i.isMounted)return;let e;if(r.eM&&(e=performance.now()),s[a].cleanup=n(),r.eM){const t=performance.now()-e,n=i.name;t>7&&console.warn(`[Teact] Slow effect at cursor #${a}: ${n}, ${Math.round(t)} ms`)}}if(void 0!==s[a]&&o&&s[a].dependencies){if(o.some(((e,t)=>e!==s[a].dependencies[t]))){if(d){const e=o.reduce(((e,t,n)=>{const r=s[a].dependencies[n];return t!==r&&e.push(`${n}: ${r} => ${t}`),e}),[]);console.log(`[Teact] Effect "${d}" caused by dependencies.`,e.join(", "))}t(c),e(l)}}else d&&console.log(`[Teact] Effect "${d}" caused by missing dependencies.`),t(c),e(l);s[a]={effect:n,dependencies:o,cleanup:s[a]?s[a].cleanup:void 0},f.hooks.effects.cursor++}function O(e,t,n){return B(o.T2,o.D0,e,t,n)}function Z(e,t,n){return B(o.R3,o.zD,e,t,n)}function D(e,t,n){const{cursor:o,byCursor:d}=f.hooks.memos;let{current:u}=d[o]||{};return(void 0===d[o]||t.some(((e,t)=>e!==d[o].dependencies[t])))&&(r.eM&&n&&console.log(`[Teact.useMemo] ${f.name} (${n}): Update is caused by:`,d[o]?(0,a.c)(t,d[o].dependencies).join(", "):"[first render]"),u=e()),d[o]={current:u,dependencies:t},f.hooks.memos.cursor++,u}function _(e,t,n){return D((()=>e),t,n)}function $(e){return D((()=>({current:e})),[])}function U(e,t){return function(n){return D((()=>y(e,n)),Object.values(n),t)}}document.addEventListener("dblclick",(()=>{console.warn("COMPONENTS",(0,d.Xo)(Object.values(P),"renderCount","desc"))}));const j={createElement:y,Fragment:c}},5116:(e,t,n)=>{n.d(t,{ZP:()=>h,R3:()=>w,Rd:()=>C,uC:()=>S,Q6:()=>E,ll:()=>P,Iq:()=>M,c$:()=>A});var r=n(4050),o=n(3716),d=n(5326),a=n(6926),u=n(9118),s=n(275),i=n(782),c=n(3592),l=n(8674);function f(){return f=Object.assign||function(e){for(var t=1;t7&&console.warn(`[TeactN] Slow containers update: ${Math.round(t)} ms`)}}],v={},y=new Map,b=(0,u.$6)(I);function I(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||!(0,l.zG)()?g.forEach((e=>e(m))):(0,u.T2)(b)}function w(e,t){"object"==typeof e&&e!==m&&(m=e,null!=t&&t.forceSyncOnIOs?I(!0):b(null==t?void 0:t.forceOnHeavyAnimation))}function C(){return m}function S(){return v}function E(e,t){p[e]||(p[e]=[],v[e]=(t,n)=>{!function(e,t,n){p[e]&&p[e].forEach((e=>{const r=e(m,v,t);r&&w(r,n)}))}(e,t,n)}),p[e].push(t)}function P(e){g.push(e)}function M(e){const t=g.indexOf(e);-1!==t&&g.splice(t,1)}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>({});return t=>function n(o){n.DEBUG_contentComponentName=t.name;const[u]=(0,r.eJ)((0,a.Z)(y)),i=(0,d.Z)();(0,r.d4)((()=>()=>{y.delete(u)}),[u]);let l=y.get(u);if(l||(l={mapStateToProps:e,ownProps:o,areMappedPropsChanged:!1,forceUpdate:i,DEBUG_updates:0,DEBUG_componentName:t.name},y.set(u,l)),l.areMappedPropsChanged&&(l.areMappedPropsChanged=!1),!l.mappedProps||!(0,s.Z)(l.ownProps,o)){l.ownProps=o;try{l.mappedProps=e(m,o)}catch(e){(0,c.S)(e)}}return r.ZP.createElement(t,f({},l.mappedProps,o))}}o.eM&&(window.getGlobal=C,document.addEventListener("dblclick",(()=>{console.warn("GLOBAL CONTAINERS",(0,i.Xo)(Array.from(y.values()).map((e=>{let{DEBUG_componentName:t,DEBUG_updates:n}=e;return{DEBUG_componentName:t,DEBUG_updates:n}})),"DEBUG_updates","desc"))})))},3681:(e,t,n)=>{n.d(t,{l:()=>d,Z:()=>a});const r=/\uFE0F/g,o=String.fromCharCode(8205);function d(e){return e.indexOf(o)<0?e.replace(r,""):e}const a=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g},1363:(e,t,n)=>{var r=n(5116),o=n(1226),d=n(3716),a=n(7361),u=n(8406),s=n(9524),i=n(7358),c=n(3100),l=n(1622);(0,r.Q6)("initApi",((e,t)=>{(async()=>{d.Cg||(await(0,c.Qw)(),(0,c.f3)()),(0,o.g8)(t.apiUpdate,{userAgent:navigator.userAgent,platform:a.Lt,sessionData:(0,c.K8)(),isTest:window.location.search.includes("test"),isMovSupported:a.pA,isWebmSupported:a.Hh})})()})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return(0,o.t9)("provideAuthPhoneNumber",r.replace(/[^\d]/g,"")),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthCode",((e,t,n)=>{const{code:r}=n;return(0,o.t9)("provideAuthCode",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthPassword",((e,t,n)=>{const{password:r}=n;return(0,o.t9)("provideAuthPassword",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("uploadProfilePhoto",((e,t,n)=>{const{file:r}=n;(0,o.t9)("uploadProfilePhoto",r)})),(0,r.Q6)("signUp",((e,t,n)=>{const{firstName:r,lastName:d}=n;return(0,o.t9)("provideAuthRegistration",{firstName:r,lastName:d}),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("returnToAuthPhoneNumber",(e=>((0,o.t9)("restartAuth"),{...e,authError:void 0}))),(0,r.Q6)("goToAuthQrCode",(e=>((0,o.t9)("restartAuthWithQr"),{...e,authIsLoadingQrCode:!0,authError:void 0}))),(0,r.Q6)("saveSession",((e,t,n)=>{const{sessionData:r}=n;r?(0,c.wX)(n.sessionData,e.currentUserId):(0,c.jv)()})),(0,r.Q6)("signOut",(()=>{(async()=>{try{await(0,u.r1)(),await(0,o.t9)("destroy"),await(0,l.IT)(!1)}catch(e){}(0,r.uC)().reset()})()})),(0,r.Q6)("reset",(()=>{(0,c.jv)(),s.clear(d.lW),s.clear(d.SG),s.clear(d.lF),s.clear(d.fo);const e=d.ee.replace(/\d+$/,""),t=(d.ee.match(/\d+$/)||[0])[0];for(let n=0;n{(async()=>{await(0,o.t9)("disconnect")})()})),(0,r.Q6)("loadNearestCountry",(e=>{"connectionStateReady"===e.connectionState&&(async()=>{const e=await(0,o.t9)("fetchNearestCountry");(0,r.R3)({...(0,r.Rd)(),authNearestCountry:e})})()})),(0,r.Q6)("setDeviceToken",((e,t,n)=>{(0,r.R3)({...e,push:{deviceToken:n,subscribedAt:Date.now()}})})),(0,r.Q6)("deleteDeviceToken",(e=>{const t={...e};delete t.push,(0,r.R3)(t)}))},9667:(e,t,n)=>{var r=n(5116),o=n(1713),d=n(3716),a=n(1226),u=n(782),s=n(8406),i=n(711),c=n(9066),l=n(9959),f=n(8415);function h(e,t){let{visibility:n,allowedIds:r,deniedIds:o}=t;const{users:{byId:d},chats:{byId:a}}=e,u={visibility:n};let s,i;const c=e=>{if(!(0,f.YC)(e))return;const{id:t,accessHash:n}=d[e]||{};return t?{id:t,accessHash:n}:void 0},l=e=>{if((0,f.YC)(e))return;const t=a[e];return t?{id:t.id}:void 0};return"contacts"!==n&&"nobody"!==n||(s=r.map(c).filter(Boolean),i=r.map(l).filter(Boolean),s.length>0&&(u.allowedUsers=s),i.length>0&&(u.allowedChats=i)),"everybody"!==n&&"contacts"!==n||(s=o.map(c).filter(Boolean),i=o.map(l).filter(Boolean),s.length>0&&(u.blockedUsers=s),i.length>0&&(u.blockedChats=i)),u}(0,r.Q6)("updateProfile",((e,t,n)=>{const{photo:d,firstName:u,lastName:s,bio:i,username:f}=n;(async()=>{const{currentUserId:t}=e;if(t){if((0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.InProgress}}),d&&await(0,a.t9)("updateProfilePhoto",d),(u||s||i)&&await(0,a.t9)("updateProfile",{firstName:u,lastName:s,about:i})){e=(0,r.Rd)();const n=t&&(0,c.dy)(e,t);n&&(0,r.R3)((0,l.Nq)(e,n.id,{firstName:u,lastName:s,fullInfo:{...n.fullInfo,bio:i}}))}f&&await(0,a.t9)("updateUsername",f)&&t&&(0,r.R3)((0,l.Nq)((0,r.Rd)(),t,{username:f})),(0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.Complete}})}})()})),(0,r.Q6)("checkUsername",((e,t,n)=>{const{username:d}=n;(async()=>{if(e.profileEdit&&e.profileEdit.progress===o.rN.InProgress)return;(0,r.R3)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:o.rN.Idle,isUsernameAvailable:void 0}});const t=await(0,a.t9)("checkUsername",d);e=(0,r.Rd)(),(0,r.R3)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()})),(0,r.Q6)("loadWallpapers",(()=>{(async()=>{const e=await(0,a.t9)("fetchWallpapers");if(!e)return;const t=(0,r.Rd)();(0,r.R3)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()})),(0,r.Q6)("uploadWallpaper",((e,t,n)=>{const d=n,u=URL.createObjectURL(d);(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[{slug:o.mp,document:{fileName:"",size:d.size,mimeType:d.type,previewBlobUrl:u}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await(0,a.t9)("uploadWallpaper",d);if(!t)return;const{wallpaper:n}=t;if(!(e=(0,r.Rd)()).settings.loadedWallpapers)return;const s=e.settings.loadedWallpapers[0];if(!s||s.slug!==o.mp)return;const i={...n,document:{...n.document,previewBlobUrl:u}};(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[i,...e.settings.loadedWallpapers.slice(1)]}})})()})),(0,r.Q6)("loadBlockedContacts",(()=>{(async()=>{var e,t;const n=await(0,a.t9)("fetchBlockedContacts");if(!n)return;let o=(0,r.Rd)();null!==(e=n.users)&&void 0!==e&&e.length&&(o=(0,l.Sh)(o,(0,u.ee)(n.users,"id"))),null!==(t=n.chats)&&void 0!==t&&t.length&&(o=(0,l.GL)(o,(0,u.ee)(n.chats,"id"))),o={...o,blocked:{...o.blocked,ids:[...o.blocked.ids||[],...n.blockedIds],totalCount:n.totalCount}},(0,r.R3)(o)})()})),(0,r.Q6)("blockContact",((e,t,n)=>{const{contactId:o,accessHash:d}=n;(async()=>{if(!await(0,a.t9)("blockContact",o,d))return;const e=(0,r.Rd)();(0,r.R3)((0,l.O4)(e,o))})()})),(0,r.Q6)("unblockContact",((e,t,n)=>{const{contactId:o}=n;let d;if((0,f.YC)(o)){const t=(0,c.dy)(e,o);if(!t)return;d=t.accessHash}(async()=>{if(!await(0,a.t9)("unblockContact",o,d))return;const e=(0,r.Rd)();(0,r.R3)((0,l.rB)(e,o))})()})),(0,r.Q6)("loadAuthorizations",(()=>{(async()=>{const e=await(0,a.t9)("fetchAuthorizations");e&&(0,r.R3)({...(0,r.Rd)(),activeSessions:e})})()})),(0,r.Q6)("terminateAuthorization",((e,t,n)=>{const{hash:o}=n;(async()=>{if(!await(0,a.t9)("terminateAuthorization",o))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.hash!==o))})})()})),(0,r.Q6)("terminateAllAuthorizations",(()=>{(async()=>{if(!await(0,a.t9)("terminateAllAuthorizations"))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.isCurrent))})})()})),(0,r.Q6)("loadNotificationExceptions",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,a.t9)("fetchNotificationExceptions",{serverTimeOffset:t});e&&(0,r.R3)((0,l.aJ)((0,r.Rd)(),e))})()})),(0,r.Q6)("loadNotificationSettings",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,a.t9)("fetchNotificationSettings",{serverTimeOffset:t});e&&(0,r.R3)((0,l.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateNotificationSettings",((e,t,n)=>{const{peerType:o,isSilent:d,shouldShowPreviews:u}=n;(async()=>{await(0,a.t9)("updateNotificationSettings",o,{isSilent:d,shouldShowPreviews:u})&&(0,r.R3)((0,l.HN)((0,r.Rd)(),o,d,u))})()})),(0,r.Q6)("updateWebNotificationSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,l.BI)((0,r.Rd)(),n));const e=(0,r.Rd)(),{hasPushNotifications:t,hasWebNotifications:o}=e.settings.byKey;o&&t?await(0,s.Ld)():await(0,s.r1)()})()})),(0,r.Q6)("updateContactSignUpNotification",((e,t,n)=>{const{isSilent:o}=n;(async()=>{await(0,a.t9)("updateContactSignUpNotification",o)&&(0,r.R3)((0,l.BI)((0,r.Rd)(),{hasContactJoinedNotifications:!o}))})()})),(0,r.Q6)("loadLanguages",(()=>{(async()=>{const e=await(0,a.t9)("fetchLanguages");e&&(0,r.R3)((0,l.BI)((0,r.Rd)(),{languages:e}))})()})),(0,r.Q6)("loadPrivacySettings",(()=>{(async()=>{const[e,t,n,o,d]=await Promise.all([(0,a.t9)("fetchPrivacySettings","phoneNumber"),(0,a.t9)("fetchPrivacySettings","lastSeen"),(0,a.t9)("fetchPrivacySettings","profilePhoto"),(0,a.t9)("fetchPrivacySettings","forwards"),(0,a.t9)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&n&&o&&d))return;const u=(0,r.Rd)();u.settings.privacy.phoneNumber=e,u.settings.privacy.lastSeen=t,u.settings.privacy.profilePhoto=n,u.settings.privacy.forwards=o,u.settings.privacy.chatInvite=d,(0,r.R3)(u)})()})),(0,r.Q6)("setPrivacyVisibility",((e,t,n)=>{const{privacyKey:o,visibility:d}=n,{privacy:{[o]:u}}=e.settings;if(!u)return;const s=h(e,{visibility:d,allowedIds:[...u.allowUserIds,...u.allowChatIds],deniedIds:[...u.blockUserIds,...u.blockChatIds]});(async()=>{const e=await(0,a.t9)("setPrivacySettings",o,s);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("setPrivacySettings",((e,t,n)=>{const{privacyKey:o,isAllowList:d,contactsIds:u}=n,{privacy:{[o]:s}}=e.settings;if(!s)return;const i=h(e,{visibility:s.visibility,allowedIds:d?u:[...s.allowUserIds,...s.allowChatIds],deniedIds:d?[...s.blockUserIds,...s.blockChatIds]:u});(async()=>{const e=await(0,a.t9)("setPrivacySettings",o,i);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("updateIsOnline",((e,t,n)=>{(0,a.t9)("updateIsOnline",n)})),(0,r.Q6)("loadContentSettings",(()=>{(async()=>{const e=await(0,a.t9)("fetchContentSettings");e&&(0,r.R3)((0,l.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateContentSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,l.BI)((0,r.Rd)(),{isSensitiveEnabled:n})),await(0,a.t9)("updateContentSettings",n)||(0,r.R3)((0,l.BI)((0,r.Rd)(),{isSensitiveEnabled:!n}))})()})),(0,r.Q6)("loadCountryList",(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{langCode:o}=n;o||(o=e.settings.byKey.language),(async()=>{const e=await(0,a.t9)("fetchCountryList",{langCode:o});e&&(0,r.R3)({...(0,r.Rd)(),countryList:e})})()})),(0,r.Q6)("ensureTimeFormat",((e,t)=>{if(e.authNearestCountry){const n=d.FD.has(e.authNearestCountry.toUpperCase())?"12h":"24h";t.setSettingOption({timeFormat:n}),(0,i.qf)(n)}(async()=>{if((0,r.Rd)().settings.byKey.wasTimeFormatSetManually)return;const e=await(0,a.t9)("fetchNearestCountry");if(e){const n=d.FD.has(e.toUpperCase())?"12h":"24h";t.setSettingOption({timeFormat:n}),(0,i.qf)(n)}})()})),(0,r.Q6)("loadAppConfig",(()=>{(async()=>{const e=await(0,a.t9)("fetchAppConfig");e&&(0,r.R3)({...(0,r.Rd)(),appConfig:e})})()}))},4907:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(8406),a=n(9959),u=n(711),s=n(9066),i=n(1622),c=n(1947);(0,r.Q6)("apiUpdate",((e,t,n)=>{switch(o.eM&&"updateUserStatus"!==n["@type"]&&"updateServerTimeOffset"!==n["@type"]&&console.log("[GramJs] UPDATE",n["@type"],{update:n}),n["@type"]){case"updateApiReady":!function(e){const{hasWebNotifications:t,hasPushNotifications:n}=(0,s.dZ)(e);t&&n&&(0,d.Ld)(),(0,u.m0)(e.settings.byKey.language)}(e);break;case"updateAuthorizationState":!function(e){let t=(0,r.Rd)();const n="authorizationStateReady"===t.authState,o=e.authorizationState;switch((0,r.R3)({...t,authState:o,authIsLoading:!1}),t=(0,r.Rd)(),o){case"authorizationStateLoggingOut":(0,i.IT)(!1),(0,r.R3)({...t,isLoggingOut:!0});break;case"authorizationStateWaitCode":(0,r.R3)({...t,authIsCodeViaApp:e.isCodeViaApp});break;case"authorizationStateWaitPassword":(0,r.R3)({...t,authHint:e.hint});break;case"authorizationStateWaitQrCode":(0,r.R3)({...t,authIsLoadingQrCode:!1,authQrCode:e.qrCode});break;case"authorizationStateReady":if(n)break;(0,i.IT)(!0),(0,r.R3)({...t,isLoggingOut:!1})}}(n);break;case"updateAuthorizationError":!function(e){(0,r.R3)({...(0,r.Rd)(),authError:e.message})}(n);break;case"updateConnectionState":!function(e){const{connectionState:t}=e,n=(0,r.Rd)();t!==n.connectionState&&((0,r.R3)({...n,connectionState:t}),"connectionStateBroken"===t&&(0,r.uC)().signOut())}(n);break;case"updateSession":!function(e){const{sessionData:t}=e,{authRememberMe:n,authState:o}=(0,r.Rd)(),d=!t||!t.mainDcId;n&&"authorizationStateReady"===o&&!d&&(0,r.uC)().saveSession({sessionData:t})}(n);break;case"updateServerTimeOffset":!function(e){const t=(0,r.Rd)();t.serverTimeOffset!==e.serverTimeOffset&&(0,r.R3)({...t,serverTimeOffset:e.serverTimeOffset})}(n);break;case"updateCurrentUser":!function(e){const{currentUser:t}=e;(0,r.R3)({...(0,a.Nq)((0,r.Rd)(),t.id,t),currentUserId:t.id}),function(e){const t=localStorage.getItem(o.b_);if(!t)return;const n=JSON.parse(t);n.id=e,localStorage.setItem(o.b_,JSON.stringify(n))}(t.id)}(n);break;case"error":{"SESSION_REVOKED"===n.error.message&&t.signOut();const e=(0,c.J_)(n.error);e?t.addPaymentError({error:e}):t.showDialog&&t.showDialog({data:n.error});break}}}))},7895:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(7361),a=n(711),u=n(7370),s=n(9066),i=n(1622),c=n(7926);!function(){function e(){const e=document.documentElement.className.match(/theme-(\w+)/),t=e?e[1]:"light",n=(0,r.Rd)(),d=(0,s.Pu)(n),{animationLevel:a}=n.settings.byKey;d!==t&&((0,u.Z)(d,a===o.zy),(0,r.R3)({...n}))}const t=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e)}(),(0,r.Q6)("init",(e=>{const{animationLevel:t,messageTextSize:n,language:r}=e.settings.byKey,l=(0,s.Pu)(e);(0,a.m0)(r,void 0,!0),document.documentElement.style.setProperty("--composer-text-size",`${Math.max(n,d.cj?16:15)}px`),document.documentElement.style.setProperty("--message-meta-height",`${Math.floor(1.3125*n)}px`),document.documentElement.style.setProperty("--message-text-size",`${n}px`),document.documentElement.setAttribute("data-message-text-size",n.toString()),document.body.classList.add("initial"),document.body.classList.add(`animation-level-${t}`),document.body.classList.add(d.$b?"is-touch-env":"is-pointer-env"),(0,u.Z)(l,t===o.zy),(0,c.$)(),(0,i.px)(),d.cj?document.body.classList.add("is-ios"):d.wZ?document.body.classList.add("is-android"):d.jm&&document.body.classList.add("is-macos"),d.s$&&document.body.classList.add("is-safari")})),(0,r.Q6)("setIsUiReady",((e,t,n)=>{const{uiReadyState:r}=n;return 2===r&&document.body.classList.remove("initial"),{...e,uiReadyState:r}})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return{...e,authPhoneNumber:r}})),(0,r.Q6)("setAuthRememberMe",((e,t,n)=>({...e,authRememberMe:Boolean(n)}))),(0,r.Q6)("clearAuthError",(e=>({...e,authError:void 0}))),(0,r.Q6)("disableHistoryAnimations",(()=>{setTimeout((()=>{(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!1}),document.body.classList.remove("no-animate")}),450),(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!0},{forceSyncOnIOs:!0})}))},3781:(e,t,n)=>{var r=n(5116),o=n(9959);(0,r.Q6)("setSettingOption",((e,t,n)=>(0,o.BI)(e,n))),(0,r.Q6)("setThemeSettings",((e,t,n)=>{const{theme:r,...d}=n;return(0,o.lr)(e,r,d)}))},8332:(e,t,n)=>{n.d(t,{YC:()=>f,Bf:()=>h,G9:()=>m,ZV:()=>p,eA:()=>g,Ru:()=>v,pK:()=>y,l6:()=>b,zX:()=>I,U:()=>w,GM:()=>C,hu:()=>S,RT:()=>E,Hp:()=>P,Nl:()=>M,VE:()=>A,Mg:()=>k,Qm:()=>T,H5:()=>N,q8:()=>L,Hd:()=>R,pE:()=>F,i4:()=>x,Sm:()=>B,cc:()=>O,SB:()=>Z,zF:()=>D,ih:()=>_,$l:()=>$});var r=n(6137),o=n(3716),d=n(782),a=n(5527),u=n(790),s=n(5765);const i=Date.now()/1e3+31622400,c=3e9,l=3e8;function f(e){return"number"==typeof e?e>0:!e.startsWith("-")}function h(e){return m(e)||p(e)}function m(e){return"chatTypeBasicGroup"===e.type}function p(e){return"chatTypeSuperGroup"===e.type}function g(e){return"chatTypeChannel"===e.type}function v(e){return"chatTypePrivate"===e.type||"chatTypeBasicGroup"===e.type}function y(e){return e===o.FV}function b(e){switch(e.type){case"chatTypePrivate":return"PrivateChat";case"chatTypeBasicGroup":case"chatTypeSuperGroup":return"AccDescrGroup";case"chatTypeChannel":return"AccDescrChannel";default:return"Chat"}}function I(e){if("chatTypePrivate"===e.type||"chatTypeSecret"===e.type)return e.id}function w(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return r||n&&t.id===n.id&&n.isSelf?e("SavedMessages"):t.title||e("HiddenName")}function C(e){if(e.fullInfo)return e.fullInfo.about}function S(e){const{username:t}=e;if(t)return`https://t.me/${t}`;const{inviteLink:n}=e.fullInfo||{};return n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";if(e.avatarHash)return"big"===t?`profile${e.id}?${e.avatarHash}`:`avatar${e.id}?${e.avatarHash}`}function P(e){return!e.lastMessage}function M(e){return Boolean(e.adminRights)}function A(e,t){return!!e.adminRights&&e.adminRights[t]}function k(e,t){var n,r;return Boolean((null===(n=e.currentUserBannedRights)||void 0===n?void 0:n[t])||(null===(r=e.defaultBannedRights)||void 0===r?void 0:r[t]))}function T(e,t){return t!==r._f||!(e.isRestricted||e.migratedTo||e.isNotJoined||y(e.id))&&(!!e.isCreator||!!f(e.id)||(g(e)?A(e,"postMessages"):M(e)||!k(e,"sendMessages")))}function N(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return{canAttachMedia:!1,canAttachPolls:!1,canSendStickers:!1,canSendGifs:!1,canAttachEmbedLinks:!1};const n=M(e);return{canAttachMedia:n||!k(e,"sendMedia"),canAttachPolls:(n||!k(e,"sendPolls"))&&(!f(e.id)||t),canSendStickers:n||!k(e,"sendStickers"),canSendGifs:n||!k(e,"sendGifs"),canAttachEmbedLinks:n||!k(e,"embedLinks")}}function L(e,t,n){if(null!=t&&t.sendMessages){const{untilDate:n}=t;return n&&n2&&void 0!==arguments[2]?arguments[2]:{};return n[e.id]&&void 0!==n[e.id].isMuted?n[e.id].isMuted:e.isMuted||f(e.id)&&!t.hasPrivateChatsNotifications||g(e)&&!t.hasBroadcastNotifications||h(e)&&!t.hasGroupNotifications}function B(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{hasPrivateChatsMessagePreview:r=!0,hasBroadcastMessagePreview:o=!0,hasGroupMessagePreview:d=!0}=t;return n[e.id]&&void 0!==n[e.id].shouldShowPreviews?n[e.id].shouldShowPreviews:f(e.id)&&r||g(e)&&o||h(e)&&d}function O(e){return m(e)||(p(e)||g(e))&&e.isCreator}function Z(e,t,n){const{id:r,title:o,emoticon:d,description:a,pinnedChatIds:u,excludedChatIds:s,includedChatIds:i,excludeArchived:c,excludeMuted:l,excludeRead:f,...h}=t;return void 0!==n&&(Object.values(h).filter(Boolean).length>1||null!=s&&s.length||null!=i&&i.length)?e("Chats",n):h.bots?e("FilterBots"):h.groups?e("FilterGroups"):h.channels?e("FilterChannels"):h.contacts?e("FilterContacts"):h.nonContacts?e("FilterNonContacts"):void 0}function D(e,t,n){if(n&&!f(t))return n.isSelf?e("FromYou"):(0,a.Vl)(n)}function _(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return(0,d.Xo)(e,(e=>{const o=t[e];if(!o)return 0;let d=0;return o.lastMessage&&(d+=o.lastMessage.date),n&&o.isVerified&&(d+=c),r&&r.includes(e)&&(d=Date.now()+l+(r.length-r.indexOf(e))),d}),"desc")}function $(e,t,n,r,o){if(!r)return t;const d=(0,s.W)(r);return t.filter((t=>{const r=n[t];return!!r&&d(w(e,r,void 0,t===o))}))}},8415:(e,t,n)=>{n.d(t,{lN:()=>R,JE:()=>k,uw:()=>ve,$l:()=>o.$l,kK:()=>r.kK,H5:()=>o.H5,MR:()=>de,kw:()=>r.kw,cc:()=>o.cc,Qm:()=>o.Qm,RT:()=>o.RT,GM:()=>o.GM,hu:()=>o.hu,N0:()=>ce,Hd:()=>o.Hd,U:()=>o.U,l6:()=>o.l6,T7:()=>g,SB:()=>o.SB,VE:()=>o.VE,XV:()=>ge,Sc:()=>me,N5:()=>V,oP:()=>G,qp:()=>_,w6:()=>A,R5:()=>pe,$D:()=>m,aE:()=>Q,ep:()=>ue,c0:()=>se,eO:()=>Y,Tp:()=>c,kG:()=>ae,Ti:()=>re,DH:()=>ne,KK:()=>f,O$:()=>U,t9:()=>q,dT:()=>N.d,Y5:()=>W,zF:()=>o.zF,q8:()=>o.q8,_O:()=>p,bf:()=>z,Kk:()=>O,Eb:()=>B,MK:()=>F,UD:()=>h,EU:()=>x,b7:()=>j,kd:()=>H,s1:()=>X,F$:()=>ee,Cg:()=>te,bV:()=>le,HV:()=>fe,zX:()=>o.zX,OU:()=>S,RI:()=>E,Ow:()=>be,Rs:()=>r.Rs,Vl:()=>r.Vl,Js:()=>r.Js,db:()=>r.db,Tq:()=>r.Tq,jC:()=>he,BM:()=>ie,u8:()=>$,Lo:()=>I,Ul:()=>C,Nl:()=>o.Nl,pE:()=>o.pE,G9:()=>o.G9,eA:()=>o.eA,Bf:()=>o.Bf,Hp:()=>o.Hp,ZV:()=>o.ZV,pK:()=>o.pK,Ru:()=>o.Ru,NB:()=>r.NB,MF:()=>b,CD:()=>M,rl:()=>K,hC:()=>J,CI:()=>P,B4:()=>v,ss:()=>y,jM:()=>w,cS:()=>r.cS,YC:()=>o.YC,kM:()=>r.kM,Mg:()=>o.Mg,Ak:()=>l,i4:()=>o.i4,Sm:()=>o.Sm,ih:()=>o.ih,Z0:()=>r.Z0});var r=n(5527),o=n(8332),d=n(6137),a=n(3716),u=n(7361),s=n(4784);const i=new RegExp(a.FM,"i");function c(e){const{chatId:t,id:n}=e;return function(e,t){return`msg${e}-${t}`}(t,n)}function l(e){const t=e.match(/^msg(-?\d+)-(\d+)/);return{chatId:t[1],messageId:Number(t[2])}}function f(e){return e.previousLocalId||e.id}function h(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:u,document:s,poll:i,webPage:c,contact:l,invoice:f}=e.content;return t?t.text:n||r||o||d||u||s||l||i||c||f?void 0:a.VC}function m(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:a,document:u,poll:i,webPage:c,contact:l}=e.content;return!!(n||null!=o&&o.isRound)||!(!t||r||o||d||a||u||i||c||l)&&((0,s.Z)(t.text)||!1)}function p(e){const{text:t}=e.content;if(t&&t.text.length<=6&&1===m(e))return t.text}function g(e){const{text:t}=e.content;let n;if(null!=t&&t.entities){let e=t.entities.find((e=>e.type===d.Vv.TextUrl));if(e&&(n=e.url.match(i)),!n&&(e=t.entities.find((e=>e.type===d.Vv.Url)),e)){const{offset:r,length:o}=e;n=t.text.substring(r,r+o).match(i)}}if(!n&&t&&(n=t.text.match(i)),n)return{url:n[0],domain:n[3]}}function v(e){return e.isOutgoing}function y(e){return Boolean(e.replyToMessageId)}function b(e){return Boolean(e.forwardInfo)}function I(e){return Boolean(e.content.action)}function w(e){return e.chatId===a.aw&&Math.round(e.id)!==e.id}function C(e){return Boolean(e.senderId)&&!(0,o.YC)(e.senderId)&&v(e)}function S(e,t){return(0,o.YC)(t.id)?(0,r.Js)(t):(0,o.U)(e,t)}function E(e){return e.sendingState?"messageSendingStateFailed"===e.sendingState?"failed":"pending":"succeeded"}function P(e){return e.id>=a.AE}function M(e){return e.content.action&&"historyClear"===e.content.action.type}function A(e){const{content:t}=e,n=t.webPage?t.webPage.video:t.video,r=t.webPage?t.webPage.photo:t.photo,o=t.webPage?t.webPage.document:t.document;if(o)return o.fileName;if(n)return n.fileName;if(t.sticker){const e=t.sticker.isLottie?"tgs":t.sticker.isGif?"webm":(0,u.on)()?"webp":"png";return`${t.sticker.id}.${e}`}if(t.audio)return t.audio.fileName;const d=c(e);return r?`${d}.jpg`:t.voice?u.m5?`${d}.ogg`:`${d}.wav`:d}function k(e){return!e.results.some((e=>e.count>0))}var T=n(8035),N=n(3995);const L=["⠺","⠵","⠞","⠟"],R=80;function F(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:R,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],d=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const a=!n&&B(t,o),u=a?`${a} `:"",s=(0,T.Z)(x(t),r),i=O(e,t,s,o,d);return`${u}${i}`}function x(e){const t=h(e);if(!t)return;const{entities:n}=e.content.text||{};return null!=n&&n.length?n.reduce(((e,t)=>{let{type:n,offset:r,length:o}=t;if(n!==d.Vv.Spoiler)return e;const a=function(e){return new Array(e).fill(void 0).map((()=>L[Math.floor(Math.random()*L.length)])).join("")}(o);return`${e.substr(0,r)}${a}${e.substr(r+o,e.length)}`}),t):t}function B(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{photo:n,video:r,audio:o,voice:d,document:a,sticker:u,poll:s}=e.content;if(e.groupedId||n)return"🖼";if(r)return"📹";if(u)return u.emoji;if(o)return"🎧";if(d)return"🎤";if(a)return"📎";if(s)return"📊";const i=!t&&(0,N.d)(e);return i?i.reaction:void 0}function O(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{text:d,photo:u,video:s,audio:i,voice:c,document:l,sticker:f,contact:h,poll:m,invoice:p}=t.content;let g;t.groupedId&&(g=n||e("lng_in_dlg_album")),u&&(g=n||e("AttachPhoto")),s&&(g=n||e(s.isGif?"AttachGif":"AttachVideo")),f&&(g=e("AttachSticker").trim()),i&&(g=Z(t)||e("AttachMusic")),c&&(g=n||e("AttachAudio")),l&&(g=o?l.fileName:n||l.fileName),h&&(g=e("AttachContact")),m&&(g=m.summary.question),p&&(g=e("PaymentInvoice")+": "+p.text),d&&(o&&g?g+="\n"+n:g=n);const v=!r&&(0,N.d)(t);return g&&v&&(g=`to your "${g}"`),g||a.VC}function Z(e){const{audio:t,text:n}=e.content;return t&&[t.title,t.performer].filter(Boolean).join(" — ")||(null==n?void 0:n.text)}var D=n(5376);function _(e){return e.content}function $(e){return Boolean(U(e)||j(e)||Q(e)||z(e)||function(e){return e.content.contact}(e)||q(e)||V(e)||G(e)||H(e))}function U(e){return e.content.photo}function j(e){return e.content.video}function W(e){const{video:t}=e.content;return null!=t&&t.isRound?t:void 0}function V(e){return e.content.action}function G(e){return e.content.audio}function H(e){return e.content.voice}function z(e){return e.content.sticker}function Q(e){return e.content.document}function K(e){const t=Q(e);return t?"photo"===t.mediaType:void 0}function J(e){const t=Q(e);return t?"video"===t.mediaType:void 0}function q(e){return e.content.poll}function Y(e){return e.content.invoice}function X(e){return e.content.webPage}function ee(e){var t;return null===(t=X(e))||void 0===t?void 0:t.photo}function te(e){var t;return null===(t=X(e))||void 0===t?void 0:t.video}function ne(e){var t;return null===(t=function(e){const t=U(e)||j(e)||Q(e)||z(e)||ee(e)||te(e);if(t)return t.thumbnail}(e))||void 0===t?void 0:t.dataUri}function re(e,t){const{photo:n,video:r,sticker:o,audio:d,voice:a,document:u}=e.content,s=ee(e),i=te(e),l=r||i,f=n||s;if(!(f||l||o||d||a||u))return;const h=(f||l||o||d||a||u).id,m=`${c(e)}${h?`:${h}`:""}`;if(l)switch(t){case"micro":case"pictogram":case"viewerPreview":return`${m}?size=m`;case"inline":return ie(e)?void 0:oe(l,m);case"viewerFull":return oe(l,m);case"download":return`${m}?download`}if(f)switch(t){case"micro":case"pictogram":return`${m}?size=m`;case"inline":return ie(e)?void 0:`${m}?size=x`;case"viewerPreview":return`${m}?size=x`;case"viewerFull":case"download":return`${m}?size=z`}if(u)switch(t){case"micro":case"pictogram":case"inline":case"viewerPreview":if(!(0,D.v6)(u)||ie(e))return;return`${m}?size=m`;case"viewerFull":case"download":return m}if(o)switch(t){case"micro":return;case"pictogram":return`${m}?size=m`;case"inline":return m;case"download":return`${m}?download`}if(d)switch(t){case"micro":case"pictogram":return de(d)?`${m}?size=m`:void 0;case"inline":return oe(d,m);case"download":return`${m}?download`}if(a)switch(t){case"micro":case"pictogram":return;case"inline":return m;case"download":return`${m}?download`}}function oe(e,t){return u.I_&&u.s$?`${t}?fileSize=${e.size}&mimeType=${e.mimeType}`:t}function de(e){return e.thumbnailSizes&&e.thumbnailSizes.length>0}function ae(e,t){const{sticker:n,video:r,audio:o,voice:a}=e.content,s=r||te(e);return n&&"inline"===t&&n.isLottie?d.IU.Lottie:s&&u.I_&&("viewerFull"===t||"inline"===t)?d.IU.Progressive:o||a?a&&!u.m5?d.IU.BlobUrl:d.IU.Progressive:d.IU.BlobUrl}function ue(e){const{photo:t,video:n,document:r}=e.content,o=ee(e),d=te(e);if(t||o)return`photo${e.date}.jpeg`;const{fileName:a}=n||d||r||{};return a}function se(e){const{video:t,document:n}=e.content,r=te(e),{size:o}=t||r||n||{};return o}function ie(e){const{photo:t,video:n,document:r}=e.content;return(null==t?void 0:t.blobUrl)||(null==n?void 0:n.blobUrl)||(null==r?void 0:r.previewBlobUrl)}function ce(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return pe(e,t,n?"media":"inlineMedia")}function le(e){return e.sizes.find((e=>"z"===e.type))||e.sizes.find((e=>"y"===e.type))||fe(e)}function fe(e){return e.sizes.find((e=>"x"===e.type))||e.sizes.find((e=>"m"===e.type))||e.sizes.find((e=>"s"===e.type))||e.thumbnail}function he(e){if(e.width&&e.height)return e}function me(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=P(e),o=r||n,d=Number(t);return{isUploading:r,isTransferring:o,transferProgress:d}}function pe(e,t,n){let r;switch(n){case"media":r=e=>{const t=j(e);return U(e)||t&&!t.isRound&&!t.isGif};break;case"documents":r=Q;break;case"links":r=e=>X(e)||function(e){const{text:t}=e.content,n=t&&t.text.match(i);if(n)return{url:n[0],domain:n[3]}}(e);break;case"audio":r=G;break;case"voice":r=e=>{const t=j(e);return H(e)||t&&t.isRound};break;case"inlineMedia":r=e=>{const t=j(e);return U(e)||t&&!t.isRound&&!t.isGif||K(e)||J(e)};break;default:return[]}return t.reduce(((t,n)=>(e[n]&&r(e[n])&&t.push(n),t)),[])}function ge(e){const{audio:t,voice:n,video:r}=_(e),o=t||n||r||te(e);if(o)return o.duration}function ve(e,t){return`${e}_${t}`}const ye={missing_payment_information:{field:"cardNumber",message:"Incorrect card number"},invalid_number:{field:"cardNumber",message:"Incorrect card number"},number:{field:"cardNumber",message:"Incorrect card number"},exp_year:{field:"expiry",message:"Incorrect year"},exp_month:{field:"expiry",message:"Incorrect month"},invalid_expiry_year:{field:"expiry",message:"Incorrect year"},invalid_expiry_month:{field:"expiry",message:"Incorrect month"},cvc:{field:"cvv",message:"Incorrect CVV"},invalid_cvc:{field:"cvv",message:"Incorrect CVV"}};function be(e){const{message:t,code:n,param:r}=e,{field:o,message:d}=r?ye[r]:ye[n];return{field:o,message:d,description:t}}},3995:(e,t,n)=>{function r(e){var t,n;return e.isOutgoing?null===(t=e.reactions)||void 0===t||null===(n=t.recentReactions)||void 0===n?void 0:n[0]:void 0}function o(e,t){if(!e||!e.recentReactions)return!0;if(!t||!t.recentReactions)return!1;const n=e.results.reduce(((e,t)=>(e[t.reaction]=t.count,e)),{});return t.results.some((e=>!n[e.reaction]||n[e.reaction]r,l:()=>o})},5527:(e,t,n)=>{n.d(t,{Vl:()=>i,Js:()=>c,Tq:()=>l,kM:()=>f,NB:()=>h,cS:()=>m,kw:()=>p,Z0:()=>g,kK:()=>v,db:()=>y,Rs:()=>b});var r=n(3716),o=n(790),d=n(782),a=n(2267),u=n(5765);const s=[1,8,5,2,7,4,6];function i(e){if(e)switch(e.type){case"userTypeBot":case"userTypeRegular":return e.firstName||e.lastName;case"userTypeDeleted":case"userTypeUnknown":return"Deleted";default:return}}function c(e){if(e){if(h(e))return"Deleted account";switch(e.type){case"userTypeBot":case"userTypeRegular":if(e.firstName&&e.lastName)return`${e.firstName} ${e.lastName}`;if(e.firstName)return e.firstName;if(e.lastName)return e.lastName;break;case"userTypeDeleted":case"userTypeUnknown":return"Deleted account"}}}function l(e,t,n,d){if(t.id===r.aw)return e("ServiceNotifications").toLowerCase();if(t.type&&"userTypeBot"===t.type)return e("Bot");if(!n)return"";switch(n.type){case"userStatusEmpty":return e("ALongTimeAgo");case"userStatusLastMonth":return e("WithinAMonth");case"userStatusLastWeek":return e("WithinAWeek");case"userStatusOffline":{const{wasOnline:t}=n;if(!t)return e("LastSeen.Offline");const r=new Date((new Date).getTime()+1e3*d),a=new Date(1e3*t);if(a>=r)return e("LastSeen.JustNow");const u=new Date(r.getTime()-a.getTime());if(u.getTime()/1e3<60)return e("LastSeen.JustNow");if(u.getTime()/1e3<3600)return e("LastSeen.MinutesAgo",Math.floor(u.getTime()/1e3/60));const s=new Date;if(s.setHours(0,0,0,0),a>new Date(s.getTime()+1e3*d))return u.getTime()/1e3<21600?e("LastSeen.HoursAgo",Math.floor(u.getTime()/1e3/60/60)):e("LastSeen.TodayAt",(0,o.mr)(e,a));const i=new Date;return i.setDate(r.getDate()-1),i.setHours(0,0,0,0),a>new Date(i.getTime()+1e3*d)?e("LastSeen.YesterdayAt",(0,o.mr)(e,a)):e("LastSeen.AtDate",(0,o.Tu)(e,a))}case"userStatusOnline":return e("Online");case"userStatusRecently":return e("Lately");default:return}}function f(e,t){const{id:n,type:o}=e;return!!t&&n!==r.aw&&"userStatusOnline"===t.type&&"userTypeBot"!==o}function h(e){return!e.noStatus&&"userTypeBot"!==e.type&&e.id!==r.aw&&("userTypeDeleted"===e.type||"userTypeUnknown"===e.type)}function m(e){return"userTypeBot"===e.type}function p(e){return!e.isContact&&!m(e)}function g(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return(0,d.Xo)(e,(e=>{const d=(0,a.b)(o);if(r&&r.includes(e))return d+172800-(r.length-r.indexOf(e));const u=t[e],s=n[e];if(!u||!s)return 0;if("userStatusOnline"===s.type)return s.expires;if("userStatusOffline"===s.type&&s.wasOnline)return s.wasOnline;switch(s.type){case"userStatusRecently":return d-86400;case"userStatusLastWeek":return d-604800;case"userStatusLastMonth":return d-18144e3;default:return 0}}),"desc")}function v(e,t,n,r,o){if(!n)return e;const d=(0,u.W)(n);return e.filter((e=>{const n=t[e];if(!n)return!1;const a=e===r?o:c(n);return a&&d(a)||d(n.username)}))}function y(e){return"number"==typeof e?Math.abs(e):Math.abs(Number(e))}function b(e){const t=e?y(e.id)%7:0;return s[t]}},6788:(e,t,n)=>{n.d(t,{Mg:()=>a,B1:()=>u,SL:()=>s,a4:()=>i,GL:()=>c,fZ:()=>l,Pi:()=>h,vv:()=>m,Dd:()=>p});var r=n(3716),o=n(782),d=n(9066);function a(e,t,n){return{...e,chats:{...e.chats,listIds:{...e.chats.listIds,[t]:n}}}}function u(e,t,n){const{[t]:r}=e.chats.listIds,o=null!=r&&r.length?n.filter((e=>!r.includes(e))):n;return r&&!o.length?e:a(e,t,[...r||[],...o])}function s(e,t){return{...e,chats:{...e.chats,byId:t}}}function i(e,t,n,r){const{byId:o}=e.chats,d=f(e,t,n,r);return d?s(e,{...o,[t]:d}):e}function c(e,t){const n=Object.keys(t).reduce(((n,r)=>{const o=f(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=s(e,{...e.chats.byId,...n})}function l(e,t){const{byId:n}=e.chats;let r=!1;const o=Object.keys(t).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=f(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r?e=s(e,{...n,...o}):e}function f(e,t,n,r){const{byId:d}=e.chats,a=d[t],u=n.isMin&&a&&!a.isMin,s={...a,...u?(0,o.CE)(n,["isMin","accessHash"]):n,...r&&{photos:[r,...a.photos||[]]}};if(s.id&&s.type)return s}function h(e,t,n){const o=n===r.WS?"archived":"active";let d=e.chats.listIds;return Object.keys(d).forEach((e=>{const n=d[e]||[];e!==o||n.includes(t)?e!==o&&n.includes(t)&&(d={...d,[e]:n.filter((e=>e!==t))}):d={...d,[e]:[...n,t]}})),i(e={...e,chats:{...e.chats,listIds:d}},t,{folderId:n||void 0})}function m(e,t,n){const r="active"===t?"all":"archived";return{...e,chats:{...e.chats,...n.orderedPinnedIds&&{orderedPinnedIds:{...e.chats.orderedPinnedIds,[t]:n.orderedPinnedIds}},totalCount:{...e.chats.totalCount,[r]:n.totalChatCount},isFullyLoaded:{...e.chats.isFullyLoaded,[t]:!1}}}}function p(e,t){const n=(0,d.Ek)(e,t);if(!n)return e;const{[n]:r}=e.chats.listIds;return r&&(e=a(e,n,r.filter((e=>e!==t)))),i(e,t,{isNotJoined:!0})}},9959:(e,t,n)=>{n.d(t,{O4:()=>z,c_:()=>o.c_,fZ:()=>r.fZ,m6:()=>o.m6,aK:()=>G,aJ:()=>V,zn:()=>P,Sh:()=>y,$S:()=>o.$S,bp:()=>de,WY:()=>ae,K4:()=>o.K4,bV:()=>o.bV,GK:()=>I,M6:()=>o.M6,i9:()=>o.i9,Dd:()=>r.Dd,vy:()=>f,rB:()=>Q,g_:()=>c,Mg:()=>r.Mg,SL:()=>r.SL,Pb:()=>x,w3:()=>o.w3,BI:()=>j,lr:()=>W,pf:()=>o.pf,ps:()=>E,s5:()=>m,y9:()=>o.y9,fS:()=>re,nA:()=>X,_7:()=>ne,Q$:()=>Y,Dq:()=>oe,vT:()=>q,QD:()=>te,QH:()=>ee,Ob:()=>o.Ob,a4:()=>r.a4,B1:()=>r.B1,vv:()=>r.vv,Pi:()=>r.Pi,cY:()=>o.cY,GL:()=>r.GL,Wy:()=>o.Wy,wV:()=>o.wV,cq:()=>o.cq,rq:()=>i,No:()=>A,Og:()=>k,xv:()=>N,px:()=>T,xj:()=>o.xj,c1:()=>D,z5:()=>Z,qr:()=>F,dx:()=>B,fw:()=>U,H9:()=>$,HN:()=>H,ff:()=>o.ff,P4:()=>o.P4,TM:()=>J,Fn:()=>o.Fn,Rg:()=>s,z3:()=>u,IM:()=>l,Xg:()=>o.Xg,j6:()=>o.j6,lG:()=>o.lG,IE:()=>K,Nq:()=>g,Lm:()=>w,Q3:()=>C,eD:()=>v});var r=n(6788),o=n(3495),d=n(782),a=n(9066);function u(e,t,n,r,o){const a=r.map((t=>{const n=e.stickers.setsById[t.id];return n?{...n,...t}:t}));return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,...(0,d.ee)(a,"id")},[t]:{...e.stickers[t],hash:n,..."search"===t?{resultIds:o}:{setIds:r.map((e=>{let{id:t}=e;return t}))}}}}}function s(e,t,n){const r=e.stickers.setsById[t]||{},o=e.stickers.added.setIds||[];let d=o;return n.installedDate&&o&&!o.includes(t)&&(d=[t,...d]),!n.installedDate&&null!=o&&o.includes(t)&&(d=d.filter((e=>e!==t))),{...e,stickers:{...e.stickers,added:{...e.stickers.added,setIds:d},setsById:{...e.stickers.setsById,[t]:{...r,...n}}}}}function i(e,t,n,r){const{results:o}=e.gifs.search;let d;if(t||!o)d=n;else{const e=new Set(o.map((e=>e.id)));d=[...o,...n.filter((t=>!e.has(t.id)))]}return{...e,gifs:{...e.gifs,search:{...e.gifs.search,offset:r,results:d}}}}function c(e,t){return{...e,animatedEmojis:t}}function l(e,t,n,r){const o=[...(0,a.Pk)(e,t),...n||[]],u=(0,d.Tw)(o.map((e=>{let{id:t}=e;return t}))),s=(0,d.ee)(o,"id"),i=u.map((e=>s[e]));return{...e,stickers:{...e.stickers,forEmoji:{emoji:t,stickers:i,hash:r}}}}function f(e){const{emoji:t,stickers:n,hash:r}=e.stickers.forEmoji||{};return t?l(e,t,n,r):e}var h=n(735);function m(e,t){return{...e,users:{...e.users,byId:t}}}function p(e,t){const{userIds:n}=e.contactList||{};if(!n)return e;const r=t.filter((e=>(null==e?void 0:e.isContact)&&!n.includes(e.id))).map((e=>e.id));return 0===r.length?e:{...e,contactList:{userIds:[...r,...n]}}}function g(e,t,n){const{byId:r}=e.users,o=b(e,t,n);return o?m(e=p(e,[o]),{...r,[t]:o}):e}function v(e,t){const n=Object.keys(t).reduce(((n,r)=>{const o=b(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=p(e=m(e,{...e.users.byId,...n}),Object.values(n))}function y(e,t){const{byId:n}=e.users;let r=!1;const o=Object.keys(t).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=b(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r?e=p(e=m(e,{...n,...o}),Object.values(o)):e}function b(e,t,n){const{byId:r}=e.users,o=r[t],a=n.isMin&&o&&!o.isMin,u={...o,...a?(0,d.CE)(n,["isMin","accessHash"]):n};if(u.id&&u.type)return u}function I(e,t){const{byId:n}=e.users,{userIds:r}=e.contactList||{};return m(e={...e,contactList:{userIds:r?r.filter((e=>e!==t)):h.D}},{...n,[t]:{...n[t],isContact:void 0}})}function w(e,t){return{...e,userSearch:{...e.userSearch,...t}}}function C(e,t){return w(e,{fetchingStatus:t})}function S(e,t,n){const{byId:r}=e.users,o=r[t];return o&&o.fullInfo?g(e,t,{...o,fullInfo:{...o.fullInfo,isBlocked:n}}):e}function E(e,t){return{...e,users:{...e.users,statusesById:t}}}function P(e,t){const{statusesById:n}=e.users,r=Object.keys(t).filter((e=>!n[e]));return r.length?e=E(e,{...n,...(0,d.ei)(t,r)}):e}const M=e=>`${e.chatId}_${e.id}`;function A(e,t){return{...e,globalSearch:{...e.globalSearch,...t}}}function k(e,t){return A(e,{currentContent:t})}function T(e,t,n,r,o){var a;const{resultsByType:u}=e.globalSearch||{},s=t.reduce(((e,t)=>(e[M(t)]=t,e)),{}),i=null==u||null===(a=u[r])||void 0===a?void 0:a.foundIds;if(void 0!==i&&Object.keys(s).every((e=>i.includes(M(s[e])))))return N(e,{messages:!1});const c=i||[],l=t.map((e=>M(e))),f=Array.prototype.concat(c,l),h=(0,d.et)(c,f)?c:f;return A(e=N(e,{messages:!1}),{resultsByType:{...(e.globalSearch||{}).resultsByType,[r]:{totalCount:n,nextOffsetId:o,foundIds:h}}})}function N(e,t){return A(e,{fetchingStatus:{...e.globalSearch.fetchingStatus,...t}})}var L=n(8415);function R(e,t,n){return{...e,localTextSearch:{byChatThreadKey:{...e.localTextSearch.byChatThreadKey,[t]:n}}}}function F(e,t,n,r,o){const d=(0,L.uw)(t,n);return R(e,d,{...e.localTextSearch.byChatThreadKey[d],isActive:r,query:o})}function x(e,t,n,r,o,d){const a=(0,L.uw)(t,n);return R(e,a,{...e.localTextSearch.byChatThreadKey[a],results:{foundIds:r,totalCount:o,nextOffsetId:d}})}function B(e,t,n,r,o,a){const u=(0,L.uw)(t,n),{results:s}=e.localTextSearch.byChatThreadKey[u]||{},i=(null==s?void 0:s.foundIds)||[],c=_((0,d.Tw)(Array.prototype.concat(i,r)));return x(e,t,n,(0,d.et)(i,c)?i:c,o,a)}function O(e,t,n){return{...e,localMediaSearch:{byChatId:{...e.localMediaSearch.byChatId,[t]:n}}}}function Z(e,t,n){return O(e,t,{...e.localMediaSearch.byChatId[t],currentType:n})}function D(e,t,n,r,o,a){const{resultsByType:u}=e.localMediaSearch.byChatId[t]||{},s=null!=u&&u[n]?u[n].foundIds:[],i=_((0,d.Tw)(Array.prototype.concat(s,r)));return function(e,t,n,r,o,d){return O(e,t,{...e.localMediaSearch.byChatId[t],resultsByType:{...(e.localMediaSearch.byChatId[t]||{}).resultsByType,[n]:{foundIds:r,totalCount:o,nextOffsetId:d}}})}(e,t,n,(0,d.et)(s,i)?s:i,o,a)}function _(e){return e.sort(((e,t)=>t-e))}function $(e,t){return{...e,management:{...e.management,progress:t}}}function U(e,t,n){return{...e,management:{...e.management,byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t]||{},...n}}}}}function j(e,t){return{...e,settings:{...e.settings,byKey:{...e.settings.byKey,...t}}}}function W(e,t,n){return{...e,settings:{...e.settings,themes:{...e.settings.themes,[t]:{...e.settings.themes[t]||{},...n}}}}}function V(e,t){return t.forEach((t=>{const{chatId:n,...r}=t;e=G(e,n,r)})),e}function G(e,t,n){return{...e,settings:{...e.settings,notifyExceptions:{...e.settings.notifyExceptions,[t]:n}}}}function H(e,t,n,r){switch(t){case"contact":return j(e,{...void 0!==n&&{hasPrivateChatsNotifications:!n},...void 0!==r&&{hasPrivateChatsMessagePreview:r}});case"group":return j(e,{...void 0!==n&&{hasGroupNotifications:!n},...void 0!==r&&{hasGroupMessagePreview:r}});case"broadcast":return j(e,{...void 0!==n&&{hasBroadcastNotifications:!n},...void 0!==r&&{hasBroadcastMessagePreview:r}});default:return}}function z(e,t){return e=S(e,t,!0),{...e,blocked:{...e.blocked,ids:[t,...e.blocked.ids],totalCount:e.blocked.totalCount+1}}}function Q(e,t){return e=S(e,t,!1),{...e,blocked:{...e.blocked,ids:e.blocked.ids.filter((e=>e!==t)),totalCount:e.blocked.totalCount-1}}}function K(e,t){return{...e,twoFaSettings:{...e.twoFaSettings,...t}}}function J(e,t){return{...e,payment:{...e.payment,shippingOptions:t}}}function q(e,t){return{...e,payment:{...e.payment,requestId:t}}}function Y(e,t){return{...e,payment:{...e.payment,step:t}}}function X(e,t){if(!t.content||!t.content.invoice)return e;const{title:n,text:r,amount:o,currency:d,isTest:a,photoUrl:u}=t.content.invoice;return{...e,payment:{...e.payment,invoiceContent:{title:n,text:r,photoUrl:u,amount:o,currency:d,isTest:a}}}}function ee(e,t){return{...e,payment:{...e.payment,stripeCredentials:{...t}}}}function te(e,t){return{...e,payment:{...e.payment,smartGlocalCredentials:{...t}}}}function ne(e,t){return{...e,payment:{...e.payment,...t}}}function re(e,t){return{...e,payment:{...e.payment,confirmPaymentUrl:t}}}function oe(e,t,n){if(!t||!n)return{...e,payment:{...e.payment,receipt:void 0}};const{invoice:r}=n.content,{photoUrl:o,text:d,title:a}=r||{};return{...e,payment:{...e.payment,receipt:{...t,photoUrl:o,text:d,title:a}}}}function de(e){return{...e,payment:{}}}function ae(e){return{...e,payment:{...e.payment,isPaymentModalOpen:!1}}}},3495:(e,t,n)=>{n.d(t,{Wy:()=>u,pf:()=>c,m6:()=>l,c_:()=>f,cY:()=>h,P4:()=>m,K4:()=>p,bV:()=>g,xj:()=>v,ff:()=>y,$S:()=>I,y9:()=>w,Xg:()=>C,j6:()=>S,w3:()=>E,cq:()=>P,Fn:()=>M,wV:()=>A,M6:()=>k,Ob:()=>T,i9:()=>N,lG:()=>L});var r=n(6137),o=n(3716),d=n(9066),a=n(782);function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r._f,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"thread",a=arguments.length>4?arguments[4]:void 0;const{messageLists:u}=e.messages;let s=u;if(a||o.Cg)s=t?[{chatId:t,threadId:n,type:d}]:[];else if(t){const e=u[u.length-1];e&&e.chatId===t&&e.threadId===n&&e.type===d||(s=e&&e.chatId===o.AJ?[...u.slice(0,-1),{chatId:t,threadId:n,type:d}]:[...u,{chatId:t,threadId:n,type:d}])}else s=u.slice(0,-1);return{...e,messages:{...e.messages,messageLists:s}}}function s(e,t,n){return i(e,t,{byId:n})}function i(e,t,n){const r=e.messages.byChatId[t]||{byId:{},threadsById:{}};return{...e,messages:{...e.messages,byChatId:{...e.messages.byChatId,[t]:{...r,...n}}}}}function c(e,t,n,r,o){return function(e,t,n,r){const o=e.messages.byChatId[t];return i(e,t,{threadsById:{...null==o?void 0:o.threadsById,[n]:{...null==o?void 0:o.threadsById[n],...r}}})}(e,t,n,{[r]:o})}function l(e,t){const n=t.reduce(((e,t)=>(e[t.chatId]||(e[t.chatId]={}),e[t.chatId][t.id]=t,e)),{});return Object.keys(n).forEach((t=>{e=f(e,t,n[t])})),e}function f(e,t,n){const r=(0,d.Zw)(e,t);return r&&Object.keys(n).every((e=>Boolean(r[Number(e)])))?e:s(e,t,{...n,...r})}function h(e,t,n,r){const o=(0,d.Zw)(e,t)||{},a={...o[n],...r};return a.id?s(e,t,{...o,[n]:a}):e}function m(e,t,n,r){const o=(0,d.Fn)(e,t)||{},a={...o[n],...r};return a.id?E(e,t,{...o,[n]:a}):e}function p(e,t,n){const r=(0,d.Zw)(e,t);if(!r)return e;const o=(0,a.CE)(r,n),i=Object.values((0,a.q0)(r,n)).filter((e=>{let{forwardInfo:t}=e;return null==t?void 0:t.isLinkedChannelPost}));if(Object.keys(e.messages.byChatId[t].threadsById).map(Number).forEach((r=>{const o=(0,d.tZ)(e,t,r);let a=(0,d.gb)(e,t,r),u=(0,d.qC)(e,t,r),s=(0,d.Cb)(e,t,r),i=(0,d.KB)(e,t),l=null==o?void 0:o.messagesCount;n.forEach((e=>{a&&a.includes(e)&&(a=a.filter((t=>t!==e)),void 0!==l&&(l-=1)),u&&u.includes(e)&&(u=u.filter((t=>t!==e))),s&&s.includes(e)&&(s=s.filter((t=>t!==e))),i&&i.includes(e)&&(i=i.filter((t=>t!==e)))})),e=c(e,t,r,"listedIds",a),e=c(e,t,r,"outlyingIds",u),e=c(e,t,r,"viewportIds",s),e=c(e,t,r,"pinnedIds",i),o&&void 0!==l&&(e=c(e,t,r,"threadInfo",{...o,messagesCount:l}))})),i.length){const n=(0,d.Bt)(e),r=n&&n.chatId===t&&"thread"===n.type,o=null==n?void 0:n.threadId;i.forEach((n=>{const{fromChatId:a,fromMessageId:s}=n.forwardInfo,i=(0,d.hj)(e,a,s);r&&o===s&&(e=u(e,t)),i&&(e=h(e,a,s,{threadInfo:void 0}))}))}return e=s(e,t,o)}function g(e,t,n){const o=(0,d.Fn)(e,t);if(!o)return e;const u=(0,a.CE)(o,n);let s=(0,d.qy)(e,t);return s&&(n.forEach((e=>{s.includes(e)&&(s=s.filter((t=>t!==e)))})),e=c(e,t,r._f,"scheduledIds",s)),E(e,t,u)}function v(e,t,n,r){const o=(0,d.gb)(e,t,n),a=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!a.length?e:c(e,t,n,"listedIds",b([...o||[],...a]))}function y(e,t,n,r){const o=(0,d.qC)(e,t,n),a=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!a.length?e:c(e,t,n,"outlyingIds",b([...o||[],...a]))}function b(e){return e.sort(((e,t)=>e-t))}function I(e,t,n,r){const a=(0,d.Cb)(e,t,n)||[];return a.includes(r)?e:c(e,t,n,"viewportIds",b([...a.length{e=C(e,t.chatId,t.threadId,t)})),e}function E(e,t,n){return function(e,t,n){const r=e.scheduledMessages.byChatId[t]||{byId:{},hash:0};return{...e,scheduledMessages:{byChatId:{...e.scheduledMessages.byChatId,[t]:{...r,...n}}}}}(e,t,{byId:n})}function P(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{...e,focusedMessage:{...e.focusedMessage,chatId:t,messageId:n,noHighlight:r,isResizingContainer:o}}}function M(e,t,n){return{...e,messages:{...e.messages,sponsoredByChatId:{...e.messages.sponsoredByChatId,[t]:n}}}}function A(e,t){return{...e,focusedMessage:{...e.focusedMessage,direction:t}}}function k(e,t,n){return{...e,selectedMessages:{chatId:t,messageIds:n?Array.prototype.concat([],n):[]}}}function T(e,t,n,r,o,u,s){let i=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const{selectedMessages:c}=e;u&&(s=(0,d.xH)(e,t,u));const l=s||[o];if(!c)return k(e,t,l);const{messageIds:f}=c;let h;const m=l.filter((e=>!f.includes(e)));if(m&&!m.length)h=f.filter((e=>!l.includes(e)));else if(i&&f.length){const u=(0,d.$W)(e,t,n,r),s=u.indexOf(f[f.length-1]),i=u.indexOf(o),c=Math.min(s,i),l=Math.max(s,i),m=u.slice(c,l+1);h=(0,a.Tw)([...f,...m])}else h=[...f,...m];return h.length?{...e,selectedMessages:{...c,messageIds:h}}:N(e)}function N(e){return{...e,selectedMessages:void 0}}function L(e,t,n,r,o){const{channelPostId:a,fromChatId:u}=t.forwardInfo||{};if(a&&u){const t=(0,d.tZ)(e,n,a);t&&(e=c(e,n,a,"threadInfo",{...t,lastMessageId:r,messagesCount:t.messagesCount+(o?-1:1)}))}return e}},8857:(e,t,n)=>{n.d(t,{Z1:()=>u,Dg:()=>s,FM:()=>i,xo:()=>c,P_:()=>l,YK:()=>f,IK:()=>h,pk:()=>m,g4:()=>p,N:()=>g,Ek:()=>v,Mw:()=>y,ep:()=>b,DI:()=>I,UW:()=>w,_5:()=>C});var r=n(6137),o=n(8415),d=n(6376),a=n(3716);function u(e,t){return e.chats.byId[t]}function s(e,t){const n=(0,o.zX)(t);return!!n&&(0,d.dy)(e,n)}function i(e,t){return t===e.currentUserId}function c(e,t){const n=s(e,t);return n&&(0,o.cS)(n)}function l(e){return Object.values(e.chats.byId).find((e=>{let{isSupport:t}=e;return t}))}function f(e,t){if(!(0,o.YC)(t.id)&&!(0,o.eA)(t)&&t.fullInfo)return t.fullInfo.members&&t.fullInfo.members.length!==a.mo?t.fullInfo.members.reduce(((t,n)=>{let{userId:r}=n;return r!==e.currentUserId&&e.users.byId[r]&&(0,o.kM)(e.users.byId[r],e.users.statusesById[r])?t+1:t}),0):t.fullInfo.onlineCount}function h(e,t){const n=u(e,t),r=n&&(0,o.zX)(n),a=r&&(0,d.dy)(e,r);if(a&&(0,o.cS)(a))return a}function m(e,t){const n=u(e,t),d=h(e,t);if(!n||!d)return!1;if(n.lastMessage&&(0,o.CD)(n.lastMessage))return!0;const a=e.messages.byChatId[t];if(!a)return!1;const{listedIds:s}=a.threadsById[r._f]||{};return s&&!s.length}function p(e){return Boolean(e.chats.listIds.active)}function g(e,t,n){const{listIds:r}=e.chats;if(n){const e=r[n];return Boolean(e&&e.includes(t))}return Object.values(r).some((e=>e&&e.includes(t)))}function v(e,t){const n=u(e,t);if(n&&g(e,t))return n.folderId===a.WS?"archived":"active"}function y(e,t){return e.chatFolders.byId[t]}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.Nf;const{active:r,archived:o}=e.chats.orderedPinnedIds;if(n===a.Nf)return Boolean(null==r?void 0:r.includes(t));if(n===a.WS)return Boolean(null==o?void 0:o.includes(t));const{byId:d}=e.chatFolders,{pinnedChatIds:u}=d[n]||{};return Boolean(null==u?void 0:u.includes(t))}function I(e,t){const n=t.toLowerCase();return Object.values(e.chats.byId).find((e=>e.username&&e.username.toLowerCase()===n))}function w(e){return Boolean(u(e,a.aw))}function C(e,t){var n;const r=u(e,t);if(!r)return;const o=null==r||null===(n=r.fullInfo)||void 0===n?void 0:n.sendAsId;return o?(0,d.dy)(e,o)||u(e,o):void 0}},9066:(e,t,n)=>{n.d(t,{hg:()=>Q,xs:()=>le,_k:()=>ae,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n(6376),i=n(8415),c=n(782);function l(e){return e.stickers.search}function f(e){return e.gifs.search}function h(e,t){return e.stickers.setsById[t]}function m(e,t){return Object.values(e.stickers.setsById).find((e=>e.shortName.toLowerCase()===t.toLowerCase()))}function p(e,t){const n=Object.values(e.stickers.setsById);let r=[];return e.stickers.favorite.stickers.forEach((e=>{e.emoji===t&&r.push(e)})),n.forEach((e=>{let{packs:n}=e;n&&(r=r.concat(n[t]||[],n[g(t)]||[]))})),r}function g(e){return e.replace("️","")}function v(e,t){const{animatedEmojis:n}=e;if(!n||!n.stickers)return;const r=g(t);return n.stickers.find((e=>e.emoji===t||e.emoji===r))}function y(e,t){const{animatedEmojiEffects:n}=e;if(!n||!n.stickers)return;const r=g(t);return n.stickers.find((e=>e.emoji===t||e.emoji===r))}function b(e,t){var n;return null==e||null===(n=e.appConfig)||void 0===n?void 0:n.emojiSounds[g(t)]}function I(e,t){const n=g(t);return"🍑"===n?"Peach":"🍆"===n?"Eggplant":void 0}function w(e){return"Eggplant"===e?"Cumshot":void 0}function C(e){return"Cumshot"===e?"🍆":void 0}var S=n(2267),E=n(735);function P(e){const{messageLists:t}=e.messages;if(t.length)return t[t.length-1]}function M(e){const{chatId:t}=P(e)||{};return t?(0,u.Z1)(e,t):void 0}function A(e,t){var n;return null===(n=e.messages.byChatId[t])||void 0===n?void 0:n.byId}function k(e,t){var n;return null===(n=e.scheduledMessages.byChatId[t])||void 0===n?void 0:n.byId}function T(e,t,n,r){const o=e.messages.byChatId[t];if(!o)return;const d=o.threadsById[n];return d?d[r]:void 0}function N(e,t,n){return T(e,t,n,"listedIds")}function L(e,t,n){return T(e,t,n,"outlyingIds")}function R(e,t,n,r){switch(r){case"thread":return F(e,t,n);case"pinned":return x(e,t);case"scheduled":return B(e,t)}}function F(e,t,n){return T(e,t,n,"viewportIds")}function x(e,t){return T(e,t,d._f,"pinnedIds")}function B(e,t){return T(e,t,d._f,"scheduledIds")}function O(e,t,n){return T(e,t,n,"scrollOffset")}function Z(e,t,n){return T(e,t,n,"replyingToId")}function D(e,t,n){return T(e,t,n,"editingId")}function _(e,t){return T(e,t,d._f,"editingScheduledId")}function $(e,t,n){return T(e,t,n,"draft")}function U(e,t,n){return T(e,t,n,"noWebPage")}function j(e,t,n){return T(e,t,n,"threadInfo")}function W(e,t,n){return T(e,t,n,"firstMessageId")}function V(e,t,n){return T(e,t,n,"replyStack")}function G(e,t,n){if(n===d._f)return(0,u.Z1)(e,t);const r=j(e,t,n);return r?(0,u.Z1)(e,r.originChannelId||t):void 0}function H(e,t,n){if(n===d._f)return;const r=j(e,t,n);return r?r.topMessageId:void 0}function z(e,t,n){const r=e.messages.byChatId[t];if(!r)return;const{replyToMessageId:o,replyToTopMessageId:d}=n;return o||d?Object.values(r.threadsById).find((e=>e.threadInfo&&(o&&o===e.threadInfo.topMessageId||d&&d===e.threadInfo.topMessageId))):void 0}function Q(e,t,n){const r=P(e);if(!r)return!1;const{threadInfo:o}=z(e,t,n)||{};return t===r.chatId&&(r.threadId===d._f||o&&r.threadId===o.threadId)}function K(e,t,n){const r=F(e,t,n);if(!r||!r.length)return!0;let o;if(n===d._f){const n=(0,u.Z1)(e,t);if(!n||!n.lastMessage)return!0;o=n.lastMessage.id}else{const r=j(e,t,n);if(!r||!r.lastMessageId)return;o=r.lastMessageId}return o>=a.AE&&!J(e,t,o)||r[r.length-1]>=o}function J(e,t,n){const r=A(e,t);return r?r[n]:void 0}function q(e,t,n){const r=k(e,t);return r?r[n]:void 0}function Y(e,t,n,r){if("scheduled"===r){const n=_(e,t);return n?q(e,t,n):void 0}{const r=D(e,t,n);return r?J(e,t,r):void 0}}function X(e,t){let n;for(const r of Object.values(e.messages.byChatId)){const{byId:e}=r;if(n=Object.values(e).find((e=>e.content.poll&&e.content.poll.id===t)),n)break}return n}function ee(e,t){const{chatId:n,messageId:r}=e.focusedMessage||{};return n===t?r:void 0}function te(e,t){const n=ee(e,t.chatId);return!!n&&(n===t.id||n===t.previousLocalId)}function ne(e,t){const{lastReadOutboxMessageId:n}=(0,u.Z1)(e,t.chatId)||{};return(0,i.CI)(t)||!n||n2&&void 0!==arguments[2]&&arguments[2];return ne(e,t)||n?(0,i.RI)(t):"read"}function oe(e,t){const{senderId:n}=t;if(n)return(0,i.YC)(n)?(0,s.dy)(e,n):(0,u.Z1)(e,n)}function de(e,t){const{forwardInfo:n}=t;if(n)return n.isChannelPost&&n.fromChatId?(0,u.Z1)(e,n.fromChatId):n.senderUserId?(0,s.dy)(e,n.senderUserId)||(0,u.Z1)(e,n.senderUserId):void 0}function ae(e,t,n){var r,o,d,a;const s=(0,u.Z1)(e,t.chatId);if(!s||s.isRestricted)return{};const c=(0,i.YC)(s.id),l=(0,u.FM)(e,t.chatId),f=(0,i.G9)(s),h=(0,i.ZV)(s),m=(0,i.eA)(s),p=(0,i.CI)(t),g=(0,i.jM)(t),v=(0,i.B4)(t),y=(0,i.Lo)(t),{content:b}=t,I=(l||h&&(0,i.VE)(s,"pinMessages")||m&&(0,i.VE)(s,"editMessages")||(0,S.b)(e.serverTimeOffset)-t.date<172800)&&!(b.sticker||b.contact||b.poll||b.action||b.audio||null!==(r=b.video)&&void 0!==r&&r.isRound)&&!(0,i.MF)(t)&&!t.viaBotId,w=!p&&!g&&(0,i.Qm)(s,n),C=c||s.isCreator||!m&&!(0,i.Mg)(s,"pinMessages")||(0,i.VE)(s,"pinMessages");let E=!p&&!g&&!y&&C,P=!1;const M=x(e,s.id);E&&(P=Boolean(M&&M.includes(t.id)),E=!P);const A=!p&&!g&&(c||v||f||s.isCreator||(0,i.VE)(s,"deleteMessages")),k=!c&&!v,T=A&&(c&&!l||f&&(v||(0,i.VE)(s,"deleteMessages")||s.isCreator)),N=!p&&!y&&I&&(v||m&&(s.isCreator||(0,i.VE)(s,"editMessages"))),L=!p&&!y,R=Boolean(t.content.sticker),F=R&&function(e,t){const{stickers:n}=e.stickers.favorite;return n&&n.some((e=>{let{id:n}=e;return n===t.id}))}(e,t.content.sticker),B=!y&&R&&!F,O=!y&&F,Z=!y,D=!y&&(m||h),_=!y,$=Boolean((null===(o=b.webPage)||void 0===o?void 0:o.document)||(null===(d=b.webPage)||void 0===d?void 0:d.video)||(null===(a=b.webPage)||void 0===a?void 0:a.photo)||b.audio||b.voice||b.photo||b.video||b.document||b.sticker);return{noOptions:[w,N,E,P,k,A,T,L,B,O,Z,D,_,$].every((e=>!e)),canReply:w,canEdit:N,canPin:E,canUnpin:P,canReport:k,canDelete:A,canDeleteForAll:T,canForward:L,canFaveSticker:B,canUnfaveSticker:O,canCopy:Z,canCopyLink:D,canSelect:_,canDownload:$}}function ue(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=P(e)||{},o=n&&A(e,n);if(!o||!t||!r)return{};const d=t.map((t=>o[t]&&ae(e,o[t],r))).filter(Boolean);return{canDelete:d.every((e=>e.canDelete)),canDeleteForAll:d.every((e=>e.canDeleteForAll))}}function se(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=P(e)||{},o=n&&A(e,n);return!!(o&&t&&r)&&t.map((t=>o[t]&&ae(e,o[t],r))).filter(Boolean).every((e=>e.canReport))}function ie(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=P(e)||{},o=n&&A(e,n);return!!(o&&t&&r)&&t.map((t=>o[t]&&ae(e,o[t],r))).filter(Boolean).some((e=>e.canDownload))}function ce(e,t){const n=e.activeDownloads.byChatId[t.chatId];return!!n&&n.includes(t.id)}function le(e,t){return e.activeDownloads.byChatId[t]||E.D}function fe(e,t){var n;return null===(n=e.fileUploads.byMessageLocalId[t.previousLocalId||t.id])||void 0===n?void 0:n.progress}function he(e,t,n){if(n===d._f){const n=(0,u.Z1)(e,t);if(!n)return;if(!n.lastReadInboxMessageId)return;return n.lastMessage?(0,i.CI)(n.lastMessage)?n.lastMessage.id:Math.min(n.lastMessage.id,n.lastReadInboxMessageId):n.lastReadInboxMessageId}{const r=j(e,t,n);if(!r)return;return r.lastReadInboxMessageId?Math.min(r.lastReadInboxMessageId,r.lastMessageId||1/0):r.topMessageId}}function me(e,t,n){const r=(0,u.Z1)(e,t);if(n===d._f){if(!r)return}else{const r=j(e,t,n);if(!r||void 0!==r.lastMessageId&&r.lastMessageId===r.lastReadInboxMessageId)return}const o=L(e,t,n),s=N(e,t,n),i=A(e,t);if(!i||!o&&!s)return;const c=he(e,t,n);if(!c&&r&&r.isNotJoined)return;const l=t===a.aw?e.serviceNotifications.reduce(((e,t)=>!t.isUnread&&t.id>e?t.id:e),-1):-1;function f(e){return e.find((e=>(!c||e>c)&&i[e]&&(!i[e].isOutgoing||i[e].isFromScheduled)&&e>l))}if(o){const e=f(o);if(e)return e}if(s){const e=f(s);if(e)return e}}function pe(e){const{forwardMessages:t}=e;return Boolean(t.isModalShown)}function ge(e,t){const n=Object.values(e.chats.byId).find((e=>(0,i.Ru)(e)&&e.lastMessage&&e.lastMessage.id===t));if(n)return n.id;const{byChatId:r}=e.messages;return Object.keys(r).find((n=>{const o=(0,u.Z1)(e,n);return o&&(0,i.Ru)(o)&&r[o.id].byId[t]}))}function ve(e){const{selectedMessages:t}=e;return Boolean(t)}function ye(e,t){const{messageIds:n}=e.selectedMessages||{};return!!n&&n.includes(t)}function be(e,t,n){const r=A(e,t);if(r)return Object.values(r).filter((e=>e.groupedId===n&&e.forwardInfo)).map((e=>{let{forwardInfo:t}=e;return t.fromMessageId}))}function Ie(e,t,n){const r=A(e,t);if(r)return Object.keys(r).map(Number).filter((e=>r[e].groupedId===n))}function we(e,t,n){const{messageIds:r}=e.selectedMessages||{};if(!r)return!1;const o=Ie(e,t,n);return o&&o.every((e=>r.includes(e)))}function Ce(e){const{messageIds:t}=e.selectedMessages||{};return t?t.length:0}function Se(e,t){const n=(0,u.Z1)(e,t);if(!n)return;if(!(0,u.xo)(e,n))return;const r=A(e,t),o=F(e,t,d._f);if(!r||!o)return;const a=(0,c.dF)(o,(e=>!r[e].isOutgoing&&Boolean(r[e].keyboardButtons))),s=(0,c.dF)(o,(e=>Boolean(r[e].shouldHideKeyboardButtons)));return a&&s&&s>a?void 0:a?r[a]:void 0}function Ee(e,t){const n=(0,u.Z1)(e,t.chatId);if(!n)return;const r=oe(e,t),o=Boolean((0,i.O$)(t)||(0,i.F$)(t)),d=Boolean((0,i.b7)(t)||(0,i.Cg)(t)),a=Boolean((0,i.oP)(t)||(0,i.kd)(t)||(0,i.aE)(t)),{canAutoLoadPhotoFromContacts:s,canAutoLoadPhotoInPrivateChats:c,canAutoLoadPhotoInGroups:l,canAutoLoadPhotoInChannels:f,canAutoLoadVideoFromContacts:h,canAutoLoadVideoInPrivateChats:m,canAutoLoadVideoInGroups:p,canAutoLoadVideoInChannels:g,canAutoLoadFileFromContacts:v,canAutoLoadFileInPrivateChats:y,canAutoLoadFileInGroups:b,canAutoLoadFileInChannels:I}=e.settings.byKey;return o?Pe({global:e,chat:n,sender:r,canAutoLoadMediaFromContacts:s,canAutoLoadMediaInPrivateChats:c,canAutoLoadMediaInGroups:l,canAutoLoadMediaInChannels:f}):d?Pe({global:e,chat:n,sender:r,canAutoLoadMediaFromContacts:h,canAutoLoadMediaInPrivateChats:m,canAutoLoadMediaInGroups:p,canAutoLoadMediaInChannels:g}):!a||Pe({global:e,chat:n,sender:r,canAutoLoadMediaFromContacts:v,canAutoLoadMediaInPrivateChats:y,canAutoLoadMediaInGroups:b,canAutoLoadMediaInChannels:I})}function Pe(e){let{global:t,chat:n,sender:r,canAutoLoadMediaFromContacts:o,canAutoLoadMediaInPrivateChats:d,canAutoLoadMediaInGroups:a,canAutoLoadMediaInChannels:u}=e;const c=Boolean(r&&(r.id===t.currentUserId||(0,s.nM)(t,r)));return Boolean(c&&o||!c&&d&&(0,i.YC)(n.id)||a&&(0,i.Bf)(n)||u&&(0,i.eA)(n))}function Me(e,t){const n=(0,i.b7)(t)||(0,i.Cg)(t);if(!n)return;const{canAutoPlayVideos:r,canAutoPlayGifs:o}=e.settings.byKey,d=n.isGif||n.isRound;return r&&!d||o&&d}function Ae(e){return e.settings.byKey.shouldLoopStickers}function ke(e){const{serviceNotifications:t}=e,n=Math.max(...t.map((e=>{let{id:t}=e;return t})));return t.find((e=>{let{id:t}=e;return t===n}))}function Te(e,t){var n;return!!t&&(t.isProtected||(null===(n=(0,u.Z1)(e,t.chatId))||void 0===n?void 0:n.isProtected))}function Ne(e,t,n){var r;if(null!==(r=(0,u.Z1)(e,t))&&void 0!==r&&r.isProtected)return!0;if(!n)return!1;const o=A(e,t);return n.some((e=>{var t;return null===(t=o[e])||void 0===t?void 0:t.isProtected}))}function Le(e,t){const n=(0,u.Z1)(e,t),r=n&&(0,i.eA)(n)?e.messages.sponsoredByChatId[t]:void 0;return r&&r.expiresAt>=Math.round(Date.now()/1e3)?r:void 0}function Re(e,t){var n,r,o;if(t===a.aw)return;const d=(0,i.YC)(t),s=null===(n=e.appConfig)||void 0===n?void 0:n.defaultReaction,{availableReactions:c}=e;if(!s||null==c||!c.some((e=>e.reaction===s&&!e.isInactive)))return;if(d)return s;const l=null===(r=(0,u.Z1)(e,t))||void 0===r||null===(o=r.fullInfo)||void 0===o?void 0:o.enabledReactions;return null!=l&&l.includes(s)?s:void 0}function Fe(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;const r=T(e,t,n,"viewportIds");return r?r.map((n=>{const{senderId:r}=J(e,t,n)||{};return r?(0,s.dy)(e,r):void 0})).filter(Boolean):void 0}function xe(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;const r=(0,i.uw)(t,n),o=e.localTextSearch.byChatThreadKey[r];return o&&o.isActive?o:void 0}function Be(e){const{chatId:t}=P(e)||{};if(t)return e.localMediaSearch.byChatId[t]}function Oe(e,t){return e.management.byChatId[t]}function Ze(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;if((0,i.YC)(t))return"user";const r=(0,u.Z1)(e,t);return r?(0,i.Bf)(r)?"group":"channel":void 0}function De(e){const{mediaViewer:t}=e;return Boolean(t.messageId||t.avatarOwnerId)}function _e(e){return function(e){const{pollResults:t}=e;return Boolean(t.messageId)}(e)?r.qt.PollResults:!o.wB&&xe(e)?r.qt.Search:function(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;const r=e.management.byChatId[t];return r&&r.isActive?r:void 0}(e)?r.qt.Management:void 0!==l(e).query?r.qt.StickerSearch:void 0!==f(e).query?r.qt.GifSearch:e.newChatMembersProgress!==r.WB.Closed?r.qt.AddingMembers:e.isChatInfoShown&&P(e)?r.qt.ChatInfo:void 0}function $e(e){return void 0!==_e(e)}function Ue(e){const{theme:t,shouldUseSystemTheme:n}=e.settings.byKey;return n?(0,o.vn)():t}function je(e){return e.globalSearch.query}function We(e){return e.payment.chatId}function Ve(e){return e.payment.messageId}function Ge(e){return e.payment.formId}function He(e){return e.payment.requestId}function ze(e){var t;return null===(t=e.payment.nativeParams)||void 0===t?void 0:t.publishableKey}function Qe(e){var t;return null===(t=e.payment.nativeParams)||void 0===t?void 0:t.publicToken}function Ke(e){return e.payment.stripeCredentials}function Je(e){return e.payment.smartGlocalCredentials}function qe(e){return e.settings.byKey}function Ye(e){return e.settings.notifyExceptions}},6376:(e,t,n)=>{function r(e,t){return e.users.byId[t]}function o(e,t){return e.users.statusesById[t]}function d(e,t){var n;const o=r(e,t);return null==o||null===(n=o.fullInfo)||void 0===n?void 0:n.isBlocked}function a(e,t){return e.contactList&&e.contactList.userIds.includes(t.id)}n.d(t,{dy:()=>r,ss:()=>o,s4:()=>d,nM:()=>a})},1713:(e,t,n)=>{let r,o,d,a,u,s,i,c,l,f,h,m,p,g;n.d(t,{Uq:()=>r,fo:()=>o,MT:()=>d,du:()=>a,nJ:()=>u,qt:()=>s,bZ:()=>i,Cr:()=>c,Nh:()=>l,rN:()=>f,wv:()=>h,WB:()=>m,vi:()=>p,KB:()=>g,mp:()=>v,u1:()=>y}),function(e){e[e.Backwards=0]="Backwards",e[e.Forwards=1]="Forwards",e[e.Around=2]="Around"}(r||(r={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Static=2]="Static"}(o||(o={})),function(e){e[e.Main=0]="Main",e[e.EditProfile=1]="EditProfile",e[e.Notifications=2]="Notifications",e[e.DataStorage=3]="DataStorage",e[e.Language=4]="Language",e[e.General=5]="General",e[e.GeneralChatBackground=6]="GeneralChatBackground",e[e.GeneralChatBackgroundColor=7]="GeneralChatBackgroundColor",e[e.Privacy=8]="Privacy",e[e.PrivacyPhoneNumber=9]="PrivacyPhoneNumber",e[e.PrivacyLastSeen=10]="PrivacyLastSeen",e[e.PrivacyProfilePhoto=11]="PrivacyProfilePhoto",e[e.PrivacyForwarding=12]="PrivacyForwarding",e[e.PrivacyGroupChats=13]="PrivacyGroupChats",e[e.PrivacyPhoneNumberAllowedContacts=14]="PrivacyPhoneNumberAllowedContacts",e[e.PrivacyPhoneNumberDeniedContacts=15]="PrivacyPhoneNumberDeniedContacts",e[e.PrivacyLastSeenAllowedContacts=16]="PrivacyLastSeenAllowedContacts",e[e.PrivacyLastSeenDeniedContacts=17]="PrivacyLastSeenDeniedContacts",e[e.PrivacyProfilePhotoAllowedContacts=18]="PrivacyProfilePhotoAllowedContacts",e[e.PrivacyProfilePhotoDeniedContacts=19]="PrivacyProfilePhotoDeniedContacts",e[e.PrivacyForwardingAllowedContacts=20]="PrivacyForwardingAllowedContacts",e[e.PrivacyForwardingDeniedContacts=21]="PrivacyForwardingDeniedContacts",e[e.PrivacyGroupChatsAllowedContacts=22]="PrivacyGroupChatsAllowedContacts",e[e.PrivacyGroupChatsDeniedContacts=23]="PrivacyGroupChatsDeniedContacts",e[e.PrivacyActiveSessions=24]="PrivacyActiveSessions",e[e.PrivacyBlockedUsers=25]="PrivacyBlockedUsers",e[e.Folders=26]="Folders",e[e.FoldersCreateFolder=27]="FoldersCreateFolder",e[e.FoldersEditFolder=28]="FoldersEditFolder",e[e.FoldersEditFolderFromChatList=29]="FoldersEditFolderFromChatList",e[e.FoldersIncludedChats=30]="FoldersIncludedChats",e[e.FoldersIncludedChatsFromChatList=31]="FoldersIncludedChatsFromChatList",e[e.FoldersExcludedChats=32]="FoldersExcludedChats",e[e.FoldersExcludedChatsFromChatList=33]="FoldersExcludedChatsFromChatList",e[e.TwoFaDisabled=34]="TwoFaDisabled",e[e.TwoFaNewPassword=35]="TwoFaNewPassword",e[e.TwoFaNewPasswordConfirm=36]="TwoFaNewPasswordConfirm",e[e.TwoFaNewPasswordHint=37]="TwoFaNewPasswordHint",e[e.TwoFaNewPasswordEmail=38]="TwoFaNewPasswordEmail",e[e.TwoFaNewPasswordEmailCode=39]="TwoFaNewPasswordEmailCode",e[e.TwoFaEnabled=40]="TwoFaEnabled",e[e.TwoFaChangePasswordCurrent=41]="TwoFaChangePasswordCurrent",e[e.TwoFaChangePasswordNew=42]="TwoFaChangePasswordNew",e[e.TwoFaChangePasswordConfirm=43]="TwoFaChangePasswordConfirm",e[e.TwoFaChangePasswordHint=44]="TwoFaChangePasswordHint",e[e.TwoFaTurnOff=45]="TwoFaTurnOff",e[e.TwoFaRecoveryEmailCurrentPassword=46]="TwoFaRecoveryEmailCurrentPassword",e[e.TwoFaRecoveryEmail=47]="TwoFaRecoveryEmail",e[e.TwoFaRecoveryEmailCode=48]="TwoFaRecoveryEmailCode",e[e.TwoFaCongratulations=49]="TwoFaCongratulations",e[e.QuickReaction=50]="QuickReaction"}(d||(d={})),function(e){e[e.ChatList=0]="ChatList",e[e.GlobalSearch=1]="GlobalSearch",e[e.Settings=2]="Settings",e[e.Contacts=3]="Contacts",e[e.Archived=4]="Archived",e[e.NewChannelStep1=5]="NewChannelStep1",e[e.NewChannelStep2=6]="NewChannelStep2",e[e.NewGroupStep1=7]="NewGroupStep1",e[e.NewGroupStep2=8]="NewGroupStep2"}(a||(a={})),function(e){e[e.ChatList=0]="ChatList",e[e.Media=1]="Media",e[e.Links=2]="Links",e[e.Files=3]="Files",e[e.Music=4]="Music",e[e.Voice=5]="Voice"}(u||(u={})),function(e){e[e.ChatInfo=0]="ChatInfo",e[e.Search=1]="Search",e[e.Management=2]="Management",e[e.StickerSearch=3]="StickerSearch",e[e.GifSearch=4]="GifSearch",e[e.PollResults=5]="PollResults",e[e.AddingMembers=6]="AddingMembers"}(s||(s={})),function(e){e[e.Inline=0]="Inline",e[e.ScheduledInline=1]="ScheduledInline",e[e.SharedMedia=2]="SharedMedia",e[e.ProfileAvatar=3]="ProfileAvatar",e[e.SettingsAvatar=4]="SettingsAvatar",e[e.MiddleHeaderAvatar=5]="MiddleHeaderAvatar",e[e.Album=6]="Album",e[e.ScheduledAlbum=7]="ScheduledAlbum",e[e.SearchResult=8]="SearchResult"}(i||(i={})),function(e){e[e.Inline=0]="Inline",e[e.SharedMedia=1]="SharedMedia",e[e.Search=2]="Search"}(c||(c={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(l||(l={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(f||(f={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(h||(h={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Loading=2]="Loading"}(m||(m={})),function(e){e[e.Profile=0]="Profile",e[e.SharedMedia=1]="SharedMedia",e[e.MemberList=2]="MemberList"}(p||(p={})),function(e){e[e.ShippingInfo=0]="ShippingInfo",e[e.Shipping=1]="Shipping",e[e.PaymentInfo=2]="PaymentInfo",e[e.Checkout=3]="Checkout",e[e.ConfirmPayment=4]="ConfirmPayment"}(g||(g={}));const v="UPLOADING_WALLPAPER_SLUG";let y;!function(e){e[e.Initial=0]="Initial",e[e.ChatPrivacyType=1]="ChatPrivacyType",e[e.Discussion=2]="Discussion",e[e.ChannelSubscribers=3]="ChannelSubscribers",e[e.GroupType=4]="GroupType",e[e.GroupPermissions=5]="GroupPermissions",e[e.GroupRemovedUsers=6]="GroupRemovedUsers",e[e.ChannelRemovedUsers=7]="ChannelRemovedUsers",e[e.GroupUserPermissionsCreate=8]="GroupUserPermissionsCreate",e[e.GroupUserPermissions=9]="GroupUserPermissions",e[e.ChatAdministrators=10]="ChatAdministrators",e[e.GroupRecentActions=11]="GroupRecentActions",e[e.ChatAdminRights=12]="ChatAdminRights",e[e.ChatNewAdminRights=13]="ChatNewAdminRights",e[e.GroupMembers=14]="GroupMembers",e[e.GroupAddAdmins=15]="GroupAddAdmins",e[e.Invites=16]="Invites",e[e.EditInvite=17]="EditInvite",e[e.Reactions=18]="Reactions",e[e.InviteInfo=19]="InviteInfo",e[e.JoinRequests=20]="JoinRequests"}(y||(y={}))},9933:(e,t,n)=>{n.d(t,{cK:()=>d,jt:()=>a,M8:()=>u,vr:()=>s});var r=n(9118);let o;function d(e,t){t||(o&&!o.isCancelled&&(o.isCancelled=!0),o=t={isCancelled:!1}),!t.isCancelled&&e()&&(0,r.T2)((()=>{d(e,t)}))}function a(e){e()&&(0,r.T2)((()=>{a(e)}))}const u={linear:e=>e,easeIn:e=>e**1.675,easeOut:e=>1-(1-e**1.675),easeInOut:e=>.5*(Math.sin((e-.5)*Math.PI)+1),easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};function s(e){let{timing:t=u.linear,onUpdate:n,duration:r,onEnd:o,from:d,to:s}=e;const i=Date.now();let c=!1;return a((()=>{if(c)return!1;let e=(Date.now()-i)/r;e>1&&(e=1);const a=t(e);if("number"==typeof d&&"number"==typeof s)n(d+(s-d)*a);else if(Array.isArray(d)&&Array.isArray(s)){const e=d.map(((e,t)=>e+(s[t]-e)*a));n(e)}return 1===e&&o&&o(),e<1})),()=>{c=!0,o&&o()}}},7358:(e,t,n)=>{n.d(t,{w:()=>o});var r=n(3716);function o(e){"function"==typeof window.navigator.setAppBadge&&window.navigator.setAppBadge(e).catch((e=>{r.eM&&console.error(e)}))}},275:(e,t,n)=>{function r(e,t){if(e===t)return!0;const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;if(0===r)return!0;for(let o=0;o(e[r]!==t[r]&&n.push(`${r}: ${e[r]} => ${t[r]}`),n)),[])}n.d(t,{Z:()=>r,c:()=>o})},6752:(e,t,n)=>{function r(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),d=1;d(t&&(Array.isArray(t)?e.push(...t):e.push(`${n}--${t}`)),e)),[n]).join(" ")}}n.d(t,{Z:()=>r,y:()=>o})},9524:(e,t,n)=>{n.d(t,{Type:()=>o,fetch:()=>d,save:()=>a,clear:()=>u});const r=self.caches;let o;async function d(e,t,n){let d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(r)try{const a=new Request(t.replace(/:/g,"_")),u=await r.open(e),s=await u.match(a);if(!s)return;const i=s.headers.get("Content-Type");switch(n){case o.Text:return await s.text();case o.Blob:{if(t.startsWith("avatar")&&i&&i.startsWith("text"))return;const e=await s.blob(),n=!e.type||!d&&e.type.includes("html");let r=e.type||i;return n&&r?(d||(r=r.replace(/html/gi,"")),new Blob([e],{type:r})):e}case o.Json:return await s.json();default:return}}catch(e){return void console.warn(e)}}async function a(e,t,n){if(r)try{const o="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),d=new Request(t.replace(/:/g,"_")),a=new Response(o),u=await r.open(e);return await u.put(d,a)}catch(e){return void console.warn(e)}}async function u(e){try{if(!r)return;return await r.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json"}(o||(o={}))},6063:(e,t,n)=>{function r(){const e=[];function t(t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}return{runCallbacks:function(){for(var t=arguments.length,n=new Array(t),r=0;r{e(...n)}))},addCallback:function(n){return e.push(n),()=>{t(n)}},removeCallback:t,hasCallbacks:function(){return Boolean(e.length)}}}n.d(t,{_:()=>r})},3989:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(517);function o(e){return(0,r.Z)({onEsc:e})}},517:(e,t,n)=>{n.d(t,{Z:()=>d});const r={Enter:"onEnter",Backspace:"onBackspace",Delete:"onDelete",Esc:"onEsc",Escape:"onEsc",ArrowUp:"onUp",ArrowDown:"onDown",ArrowLeft:"onLeft",ArrowRight:"onRight",Tab:"onTab"},o={onEnter:[],onDelete:[],onBackspace:[],onEsc:[],onUp:[],onDown:[],onLeft:[],onRight:[],onTab:[]};function d(e){return a()||document.addEventListener("keydown",u,!0),Object.keys(e).forEach((t=>{const n=e[t];if(!n)return;const r=o[t];r&&r.push(n)})),()=>{!function(e){Object.keys(e).forEach((t=>{const n=e[t],r=o[t];if(r){const e=r.findIndex((e=>e===n));-1!==e&&r.splice(e,1)}})),a()||document.removeEventListener("keydown",u,!1)}(e)}}function a(){return Object.values(o).some((e=>Boolean(e.length)))}function u(e){const t=r[e.key];if(!t)return;const{length:n}=o[t];n&&(e.stopPropagation(),(0,o[t][n-1])(e))}},790:(e,t,n)=>{n.d(t,{xR:()=>a,zk:()=>u,$Y:()=>s,_F:()=>i,kj:()=>c,mr:()=>f,VX:()=>h,Tu:()=>m,np:()=>p,D:()=>g,j1:()=>v,ZK:()=>b,k9:()=>I,rM:()=>w,xH:()=>C,SA:()=>S,xk:()=>P,IS:()=>M});const r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],d=o.map((e=>e.toLowerCase())),a=864e5;function u(e){return s(new Date)===s(e)}function s(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function i(e){return s(e).getTime()}function c(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${t.getMonth()}`}function l(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function f(e,t){const n="number"==typeof t?new Date(t):t,r=e.timeFormat||"24h";let o=n.getHours(),d="";return"12h"===r&&(d=o>=12?" PM":" AM",o=o>12?o%12:o),`${String(o).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}${d}`}function h(e,t){const n="number"==typeof t?new Date(t):t,o=s(new Date);if(n>=o)return f(e,n);const d=new Date(o);if(d.setDate(o.getDate()-7),n>=d)return e(`Weekday.Short${r[n.getDay()]}`);const a=n.getFullYear()!==o.getFullYear(),u=e(a?"formatDateScheduleYear":"formatDateSchedule")||(a?"d MMM yyyy":"d MMM");return y(e,n,u)}function m(e,t){const n="number"==typeof t?new Date(t):t,r=e("formatterYearMax")||"dd.MM.yyyy";return y(e,n,r)}function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e(n?"formatterMonthYear2":"formatterMonthYear")||"MMM yyyy";return y(e,t,r)}function g(e,t){const n=Math.floor(t/a);return t<0?0:n<1?I(t/1e3):n<7?e("Days",n):n<30?e("Weeks",Math.floor(n/7)):n<365?e("Months",Math.floor(n/30)):e("Years",Math.floor(n/365))}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=arguments.length>4?arguments[4]:void 0;const a="number"==typeof t?new Date(t):t,u=s(new Date);if(!o){if(l(a)===l(u))return(d||!n?k:A)(e("Weekday.Today"));const t=new Date(u);if(t.setDate(u.getDate()-1),l(a)===l(t))return(d||!n?k:A)(e("Weekday.Yesterday"));const o=new Date(u),s=new Date(u);if(o.setDate(u.getDate()-7),s.setDate(u.getDate()+7),a>=o&&a<=s){const t=r[a.getDay()];return(d||!n?k:A)(e(n?`Weekday.Short${t}`:`Weekday.${t}`))}}const i=a.getFullYear()!==u.getFullYear(),c=n?i?"formatDateScheduleYear":"formatDateSchedule":i?"chatFullDate":"chatDate",f=e(c)||"d MMMM yyyy";return(d||!n?k:A)(y(e,a,f))}function y(e,t,n){const r=t.getDate(),d=t.getMonth();return n.replace("LLLL",e(o[d])).replace("MMMM",e(`Month.Gen${o[d]}`)).replace("MMM",e(`Month.Short${o[d]}`)).replace("MM",String(d+1).padStart(2,"0")).replace("dd",String(r).padStart(2,"0")).replace("d",String(r)).replace("yyyy",String(t.getFullYear())).replace(/'de'/g,"de")}function b(e,t,n){const r="number"==typeof t?new Date(t):t;return`${v(e,r,!0,void 0,n)}, ${f(e,r)}`}function I(e,t){const n=Math.floor(e/3600),r=Math.floor(e%3600/60),o=Math.floor(e%3600%60),d=t?Math.floor(t/3600):0,a=t?Math.floor(t%3600/60):0;let u="";return n>0||d>0?(u+=`${String(n).padStart(2,"0")}:`,u+=`${String(r).padStart(2,"0")}:`):u+=a>=10?`${String(r).padStart(2,"0")}:`:`${String(r)}:`,u+=String(o).padStart(2,"0"),u}function w(e){const t=[];let n=e%1e3;e-=n,n=Math.floor(n/10);const r=(e=Math.floor(e/1e3))%60;e-=r;const o=(e=Math.floor(e/60))%60;e-=o;const d=(e=Math.floor(e/60))%60;return d>0&&t.push(String(d).padStart(2,"0")),t.push(String(o).padStart(d>0?2:1,"0")),t.push(String(r).padStart(2,"0")),`${t.join(":")},${String(n).padStart(2,"0")}`}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";const n="number"==typeof e?new Date(e):e;return n.toLocaleString(t,{year:"numeric",month:"short",day:"numeric"})}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";const n="number"==typeof e?new Date(e):e;return n.toLocaleString(t,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}function E(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2021;if(t>11||e>31)return!1;const r=new Date(n,t,e);return!Number.isNaN(r.getTime())&&r.getDate()===e}function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=e.match(/\d{1,2}\s[a-zA-Z]{3,}/),n=e.match(/[a-zA-Z]{3,}\s\d{1,2}/),r=e.match(/\d{1,2}[./-]\d{1,2}([./-]\d{2,4})?/);if(!t&&!r&&!n)return;if(r){const[t,n,r]=e.split(/[./-]/).map(Number);return r&&r<2015||!E(t,n-1,r||void 0)?void 0:`${r?`${r}-`:""}${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}`}const o=e.split(" "),a=t?o[0]:o[1],u=(t?o[1]:o[0]).toLowerCase(),s=d.findIndex((e=>e.startsWith(u)));return-1!==s&&E(Number(a),s)?`${String(s+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`:void 0}function M(e){return e+a/1e3}function A(e){return`${e[0].toLowerCase()}${e.slice(1)}`}function k(e){return`${e[0].toUpperCase()}${e.slice(1)}`}},4284:(e,t,n)=>{n.d(t,{g6:()=>u,U_:()=>s,NM:()=>i,Wg:()=>c});var r=n(3681);const o=["female_sign","male_sign","medical_symbol"],d=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️‍🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f/gu,"🏳️‍⚧️"],[/\u{1f937}\u200d\u2642[^\ufe0f]/gu,"🤷‍♂️"]];function a(e){const t=e.split("-").map((e=>parseInt(e,16)));return String.fromCodePoint(...t)}function u(e){if(!e.match(r.Z))return e;for(const[t,n]of d)e=e.replace(t,n);return e}function s(e){let t;if(1===e.length)t=e.charCodeAt(0).toString(16).padStart(4,"0");else{const n=[];for(let t=0;t=55296&&e.charCodeAt(t)<=56319?e.charCodeAt(t+1)>=56320&&e.charCodeAt(t+1)<=57343&&n.push(1024*(e.charCodeAt(t)-55296)+(e.charCodeAt(t+1)-56320)+65536):(e.charCodeAt(t)<55296||e.charCodeAt(t)>57343)&&n.push(e.charCodeAt(t));t=n.map((e=>e.toString(16).padStart(4,"0"))).join("-")}return t}function i(e){const t={categories:[],emojis:{}};for(let n=0;ne.codePointAt(0)+127397));return String.fromCodePoint(...n)}},1396:(e,t,n)=>{function r(e){if(e)return e.includes("://")?e:`http://${e}`}n.d(t,{X:()=>r})},7361:(e,t,n)=>{n.d(t,{Bi:()=>k,cL:()=>F,wZ:()=>p,gk:()=>B,vX:()=>M,FW:()=>O,op:()=>C,cj:()=>m,jm:()=>h,pA:()=>L,m5:()=>P,I_:()=>E,fl:()=>v,t0:()=>A,s$:()=>g,i4:()=>Z,Mc:()=>S,wB:()=>b,p7:()=>I,$b:()=>y,mh:()=>w,Hh:()=>R,s0:()=>T,aZ:()=>x,gZ:()=>D,Lt:()=>f,vn:()=>i,on:()=>d});var r=n(3716);let o;function d(){return Boolean(o)}var a,u;new Promise((e=>{const t=new Image;t.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA";const n=()=>{e(2===t.height)};t.onload=n,t.onerror=n})).then((e=>{o=e}));let s=null!==(a=(u=window).matchMedia)&&void 0!==a&&a.call(u,"(prefers-color-scheme: dark)").matches?"dark":"light";function i(){return s}function c(e){s=e.matches?"dark":"light"}const l=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof l.addEventListener?l.addEventListener("change",c):"function"==typeof l.addListener&&l.addListener(c);const f=function(){const{userAgent:e,platform:t}=window.navigator;let n;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?n="macOS":-1!==["iPhone","iPad","iPod"].indexOf(t)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?n="Windows":/Android/.test(e)?n="Android":/Linux/.test(t)&&(n="Linux"),n}(),h="macOS"===f,m="iOS"===f,p="Android"===f,g=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),v=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"),y=window.matchMedia("(pointer: coarse)").matches,b=window.innerWidth<=r.l3||window.innerWidth<=r.u_&&window.innerHeight<=r.rO,I=!b&&window.innerWidth<=r.ks,w=Boolean(navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&(window.AudioContext||window.webkitAudioContext)),C=(document.documentElement.style,f&&(h||m)),S="serviceWorker"in navigator,E=S,P=(window,Boolean((new Audio).canPlayType("audio/ogg; codecs=opus"))),M=!r.Cg&&"filter"in(document.createElement("canvas").getContext("2d")||{}),A="requestFullscreen"in document.createElement("div"),k=!navigator.userAgent.includes("Firefox"),T=p?"slide-fade":m?"slide-layers":"push-slide",N=document.createElement("video"),L=!0;L&&r.wG.add(r.Ng);const R=Boolean(N.canPlayType('video/webm; codecs="vp9"').replace("no",""))&&!(h&&g),F=window.devicePixelRatio||1,x=!0,B=CSS.supports("backdrop-filter: blur()")||CSS.supports("-webkit-backdrop-filter: blur()"),O=!y,Z=!h&&!m&&!p,D=Z?300:750},1394:(e,t,n)=>{n.d(t,{A9:()=>d,YJ:()=>a,hl:()=>u,pt:()=>s,jj:()=>i,ud:()=>c,gm:()=>l,dc:()=>f,ao:()=>h});var r=n(9118);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let o=r.length;const d=new Uint8Array(o);for(;o--;)d[o]=r.charCodeAt(o);return new Blob([d],{type:n})}function a(e){return new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{const{result:r}=e.target||{};"string"==typeof r&&t(r),n(new Error("Failed to read blob"))},r.onerror=n,r.readAsDataURL(e)}))}function u(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}function s(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=n,r.src=e}))}function i(e){return new Promise(((t,n)=>{const r=document.createElement("video");r.volume=0,r.onloadedmetadata=()=>t(r),r.onerror=n,r.src=e}))}async function c(e){const t=await i(e);return Promise.race([(0,r.wO)(2e3),new Promise(((e,n)=>{t.onseeked=()=>{t.videoWidth&&t.videoHeight||e(void 0);const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0),e(n.toDataURL("image/jpeg"))},t.onerror=n,t.currentTime=Math.min(t.duration,1)}))])}async function l(e){return(await fetch(e)).blob()}async function f(e,t){return u(await l(e),t)}function h(e){const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...r}=n;super(e,{type:t}),o(this,"name",void 0),Object.assign(this,r)}else super(e),o(this,"name",void 0);this.name=t}})},6974:(e,t,n)=>{n.d(t,{S1:()=>y,gO:()=>b,aE:()=>I,Yz:()=>w,wC:()=>C,xW:()=>S,M2:()=>E,r_:()=>P,O6:()=>M});var r=n(5116),o=n(3716),d=n(9066),a=n(8415),u=n(9118),s=n(782),i=n(275),c=n(6063);const l=L();let f=l.prevGlobal,h=l.prepared,m=l.results,p=l.callbacks;const g=(0,u.P2)((()=>{(0,u.Q8)((()=>{A((0,r.Rd)())}))}),500);let v=!1;function y(){v=!0,(0,r.ll)(g),(0,r.Q6)("reset",R),A((0,r.Rd)())}function b(e){return v||y(),m.orderedIdsByFolderId[e]}function I(e){return v||y(),m.pinnedCountByFolderId[e]||0}function w(){return v||y(),m.chatsCountByFolderId}function C(){return v||y(),m.unreadCountersByFolderId}function S(){var e;return(null===(e=C()[o.Nf])||void 0===e?void 0:e.notificationsCount)||0}function E(e,t){return p.orderedIdsByFolderId[e]||(p.orderedIdsByFolderId[e]=(0,c._)()),p.orderedIdsByFolderId[e].addCallback(t)}function P(e){return p.chatsCountByFolderId.addCallback(e)}function M(e){return p.unreadCountersByFolderId.addCallback(e)}function A(e){let t;o.eM&&(t=performance.now());const n=Boolean(e.chats.listIds.active&&k(o.Nf,e.chats.listIds.active,e.chats.orderedPinnedIds.active)),r=Boolean(e.chats.listIds.archived&&k(o.WS,e.chats.listIds.archived,e.chats.orderedPinnedIds.archived)),u=e.chats.isFullyLoaded.active!==f.isAllFolderFullyLoaded,c=e.chats.isFullyLoaded.archived!==f.isArchivedFolderFullyLoaded,l=e.chatFolders.byId!==f.foldersById,p=e.chats.byId!==f.chatsById,g=e.users.byId!==f.usersById,v=(0,d.dZ)(e)!==f.notifySettings,y=(0,d.NJ)(e)!==f.notifyExceptions;let b=[];if((u||c)&&(b=b.concat(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];t&&n.push(o.WS);const r=e.chats.isFullyLoaded.active,d=e.chats.isFullyLoaded.archived;if(r&&d){const e=Object.keys(h.folderSummariesById).filter((e=>!m.orderedIdsByFolderId[e])).map(Number);n=n.concat(e)}return f.isAllFolderFullyLoaded=r,f.isArchivedFolderFullyLoaded=d,n}(e,c))),!(n||r||l||p||g||v||y))return void(b.length&&N(b));const I=f.allFolderListIds,w=f.archivedFolderListIds;if(function(e,t,n,r){const d=[];if(t){const t=e.chats.listIds.active,n=e.chats.orderedPinnedIds.active;h.folderSummariesById[o.Nf]=T(o.Nf,t,n),f.allFolderListIds=t,f.allFolderPinnedIds=n,d.push(o.Nf)}if(n){const t=e.chats.listIds.archived,n=e.chats.orderedPinnedIds.archived;h.folderSummariesById[o.WS]=T(o.WS,t,n),f.archivedFolderListIds=t,f.archivedFolderPinnedIds=n,d.push(o.WS)}if(r){const t=e.chatFolders.byId;Object.values(t).forEach((e=>{e!==f.foldersById[e.id]&&(h.folderSummariesById[e.id]=function(e){return{...e,orderedPinnedIds:e.pinnedChatIds,excludedChatIds:e.excludedChatIds?new Set(e.excludedChatIds):void 0,includedChatIds:e.excludedChatIds?new Set(e.includedChatIds):void 0,pinnedChatIds:e.excludedChatIds?new Set(e.pinnedChatIds):void 0}}(e),d.push(e.id))})),f.foldersById=t}}(e,n,r,l),b=b.concat(function(e,t,n,r,u,c){const l=e.chats.byId,p=e.users.byId,g=(0,d.dZ)(e),v=(0,d.NJ)(e),y=Object.values(h.folderSummariesById),b=new Set,I=e.chats.listIds.active,w=e.chats.listIds.archived;let C=[...I||[],...w||[]];return I===u&&w===c||(C=(0,s.Tw)(C.concat(u||[],c||[]))),C.forEach((e=>{const d=l[e];if(!t&&!n&&!r&&d===f.chatsById[e]&&p[e]===f.usersById[e])return;let u;if(d){const n=h.chatSummariesById.get(e),r=function(e,t,n,r){const{id:d,type:u,lastMessage:s,isRestricted:i,isNotJoined:c,folderId:l,unreadCount:f,unreadMentionsCount:h,hasUnreadMark:m,joinDate:p,draftDate:g}=e,v="chatTypePrivate"===u&&r;return{id:d,type:u,isListed:Boolean(s&&!i&&!c),isArchived:l===o.WS,isMuted:(0,a.i4)(e,t,n),isUnread:Boolean(f||h||m),unreadCount:f,unreadMentionsCount:h,order:Math.max(p||0,g||0,(null==s?void 0:s.date)||0),isUserBot:v?"userTypeBot"===v.type:void 0,isUserContact:v?v.isContact:void 0}}(d,g,v,p[e]);if(!t&&n&&(0,i.Z)(r,n))return;h.chatSummariesById.set(e,r),u=function(e,t){return t.reduce(((t,n)=>(function(e,t){var n,r,d;if(!e.isListed)return!1;const{id:a,type:u}=e;if(t.listIds)return!(e.isArchived&&t.id===o.Nf||!e.isArchived&&t.id===o.WS)&&t.listIds.has(a);if(null!==(n=t.excludedChatIds)&&void 0!==n&&n.has(a))return!1;if(null!==(r=t.includedChatIds)&&void 0!==r&&r.has(a))return!0;if(null!==(d=t.pinnedChatIds)&&void 0!==d&&d.has(a))return!0;if(t.excludeArchived&&e.isArchived)return!1;if(t.excludeRead&&!e.isUnread)return!1;if(t.excludeMuted&&e.isMuted&&!e.unreadMentionsCount)return!1;if("chatTypePrivate"===u)if(e.isUserBot){if(t.bots)return!0}else{if(t.contacts&&e.isUserContact)return!0;if(t.nonContacts&&!e.isUserContact)return!0}else{if("chatTypeChannel"===u)return Boolean(t.channels);if("chatTypeBasicGroup"===u||"chatTypeSuperGroup"===u)return Boolean(t.groups)}return!1}(e,n)&&t.push(n.id),t)),[]).sort()}(r,y),u.forEach((e=>{b.add(e)}))}else h.chatSummariesById.delete(e),u=[];const c=h.folderIdsByChatId[e]||[];if((0,s.et)(u,c))return;const I=function(e,t,n){const r=new Set(t),o=new Set(n),d=[];return(0,s.Tw)([...t,...n]).forEach((t=>{let n=m.orderedIdsByFolderId[t];r.has(t)&&!o.has(t)?(h.chatIdsByFolderId[t].delete(e),d.push(t),n&&(n=n.filter((t=>t!==e)),h.isOrderedListJustPatched[t]=!0)):!r.has(t)&&o.has(t)&&(h.chatIdsByFolderId[t]||(h.chatIdsByFolderId[t]=new Set),h.chatIdsByFolderId[t].add(e),n&&(n.push(e),h.isOrderedListJustPatched[t]=!0)),m.orderedIdsByFolderId[t]=n})),h.folderIdsByChatId[e]=n,d}(e,c,u);I.forEach((e=>{b.add(e)}))})),f.chatsById=l,f.usersById=p,f.notifySettings=g,f.notifyExceptions=v,Array.from(b)}(e,l||n||r,v,y,I,w)),N((0,s.Tw)(b)),o.eM){const e=performance.now()-t;e>6&&console.warn(`Slow \`updateFolderManager\`: ${Math.round(e)} ms`)}}function k(e,t,n){const r=e===o.Nf?f.allFolderListIds:f.archivedFolderListIds,d=e===o.Nf?f.allFolderPinnedIds:f.archivedFolderPinnedIds;return r!==t||d!==n}function T(e,t,n){return{id:e,listIds:new Set(t),orderedPinnedIds:n,pinnedChatIds:new Set(n)}}function N(e){let t=!1,n=!1;if(Array.from(e).forEach((e=>{const{pinnedCount:r,orderedIds:o}=function(e){const t=h.folderSummariesById[e];if(!t)return{};const{orderedPinnedIds:n,pinnedChatIds:r}=t,{chatSummariesById:o,chatIdsByFolderId:{[e]:d}}=h,{orderedIdsByFolderId:{[e]:a}}=m,u=d?null==n?void 0:n.filter((e=>d.has(e))):n,s=a||d&&Array.from(d)||[],i=(r?s.filter((e=>!r.has(e))):s).sort(((e,t)=>o.get(t).order-o.get(e).order));return{pinnedCount:(null==u?void 0:u.length)||0,orderedIds:[...u||[],...i]}}(e);if(!o)return;const d=m.orderedIdsByFolderId[e],a=m.pinnedCountByFolderId[e];var u;d&&void 0!==a&&a===r&&!h.isOrderedListJustPatched[e]&&(0,s.et)(o,d)||(h.isOrderedListJustPatched[e]=!1,m.orderedIdsByFolderId[e]=o,m.pinnedCountByFolderId[e]=r,null===(u=p.orderedIdsByFolderId[e])||void 0===u||u.runCallbacks(o));const c=m.chatsCountByFolderId[e],l=o.length;n||(n=c!==l),m.chatsCountByFolderId[e]=l;const f=m.unreadCountersByFolderId[e],g=function(e){const{chatSummariesById:t}=h,{orderedIdsByFolderId:{[e]:n}}=m;return n.reduce(((e,n)=>{const r=t.get(n);return r?(r.isUnread&&(e.chatsCount++,r.unreadMentionsCount&&(e.notificationsCount+=r.unreadMentionsCount),r.isMuted||(r.unreadCount?e.notificationsCount+=r.unreadCount:r.unreadMentionsCount||(e.notificationsCount+=1))),e):e}),{chatsCount:0,notificationsCount:0})}(e);t||(t=!f||!(0,i.Z)(g,f)),m.unreadCountersByFolderId[e]=g})),n){const e={...m.chatsCountByFolderId};m.chatsCountByFolderId=e,p.chatsCountByFolderId.runCallbacks(e)}if(t){const e={...m.unreadCountersByFolderId};m.unreadCountersByFolderId=e,p.unreadCountersByFolderId.runCallbacks(e)}}function L(){return{prevGlobal:{foldersById:{},chatsById:{},usersById:{},notifySettings:{},notifyExceptions:{}},prepared:{folderSummariesById:{},chatSummariesById:new Map,folderIdsByChatId:{},chatIdsByFolderId:{},isOrderedListJustPatched:{}},results:{orderedIdsByFolderId:{},pinnedCountByFolderId:{},chatsCountByFolderId:{},unreadCountersByFolderId:{}},callbacks:{orderedIdsByFolderId:{},chatsCountByFolderId:(0,c._)(),unreadCountersByFolderId:(0,c._)()}}}function R(){const e=L();f=e.prevGlobal,h=e.prepared,m=e.results,p=e.callbacks}},9937:(e,t,n)=>{function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";return new Intl.NumberFormat(n,{style:"currency",currency:t}).format("JPY"===t?e:e/100)}n.d(t,{x:()=>r})},6926:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t}},1947:(e,t,n)=>{n.d(t,{ZP:()=>d,J_:()=>a});const r={CHAT_RESTRICTED:"You can't send messages in this chat, you were restricted",CHAT_WRITE_FORBIDDEN:"You can't write in this chat",CHAT_SEND_POLL_FORBIDDEN:"You can't create polls in this chat",CHAT_SEND_STICKERS_FORBIDDEN:"You can't send stickers in this chat",CHAT_SEND_GIFS_FORBIDDEN:"You can't send gifs in this chat",CHAT_SEND_MEDIA_FORBIDDEN:"You can't send media in this chat",CHAT_LINK_EXISTS:"The chat is public, you can't hide the history to new users",SLOWMODE_WAIT_X:"Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.",USER_BANNED_IN_CHANNEL:"You're banned from sending messages in supergroups / channels",USER_IS_BLOCKED:"You were blocked by this user",YOU_BLOCKED_USER:"You blocked this user",IMAGE_PROCESS_FAILED:"Failure while processing image",MEDIA_EMPTY:"The provided media object is invalid",MEDIA_INVALID:"Media invalid",PHOTO_EXT_INVALID:"The extension of the photo is invalid",PHOTO_INVALID_DIMENSIONS:"The photo dimensions are invalid",PHOTO_SAVE_FILE_INVALID:"Internal issues, try again later",MESSAGE_DELETE_FORBIDDEN:"You can't delete one of the messages you tried to delete, most likely because it is a service message.",MESSAGE_POLL_CLOSED:"Poll closed",MESSAGE_EDIT_TIME_EXPIRED:"You can't edit this message anymore.",CHAT_ADMIN_REQUIRED:"You must be an admin in this chat to do this",PINNED_DIALOGS_TOO_MUCH:"Sorry, you can only pin 5 chats to the top",DIALOG_FILTERS_TOO_MUCH:"Sorry, you can't have more than 10 folders",CHANNEL_PRIVATE:"This channel is private",MEDIA_CAPTION_TOO_LONG:"The provided caption is too long",ADDRESS_STREET_LINE1_INVALID:"The address you provided is not valid",ADDRESS_STREET_LINE2_INVALID:"The address you provided is not valid",ADDRESS_CITY_INVALID:"The city you provided is not valid",ADDRESS_COUNTRY_INVALID:"The country you provided is not valid",ADDRESS_POSTCODE_INVALID:"The postcode you provided is not valid",ADDRESS_STATE_INVALID:"The state you provided is not valid",REQ_INFO_NAME_INVALID:"The name you provided is not valid",REQ_INFO_PHONE_INVALID:"The phone you provided is not valid",REQ_INFO_EMAIL_INVALID:"The email you provided is not valid",LINK_NOT_MODIFIED:"This discussion is already linked to the channel",MESSAGE_TOO_LONG:"Message is too long",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Streaming media may not be supported. Try reloading the page without holding key",MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.",FRESH_RESET_AUTHORISATION_FORBIDDEN:"You can’t logout other sessions if less than 24 hours have passed since you logged on the current session",BOTS_TOO_MUCH:"There are too many bots in this chat/channel",BOT_GROUPS_BLOCKED:"This bot can't be added to groups",USERS_TOO_MUCH:"The maximum number of users has been exceeded",USER_CHANNELS_TOO_MUCH:"One of the users you tried to add is already in too many channels/supergroups",USER_KICKED:"This user was kicked from this supergroup/channel",USER_NOT_MUTUAL_CONTACT:"The provided user is not a mutual contact",USER_PRIVACY_RESTRICTED:"The user's privacy settings do not allow you to do this",INVITE_HASH_EMPTY:"The invite hash is empty",INVITE_HASH_EXPIRED:"The invite link has expired",INVITE_HASH_INVALID:"The invite hash is invalid",CHANNELS_TOO_MUCH:"You have joined too many channels/supergroups",USER_ALREADY_PARTICIPANT:"You already in the group",SCHEDULE_DATE_INVALID:"Invalid schedule date provided",WALLPAPER_DIMENSIONS_INVALID:"The wallpaper dimensions are invalid, please select another file",ADMINS_TOO_MUCH:"There are too many admins",ADMIN_RANK_EMOJI_NOT_ALLOWED:"An admin rank cannot contain emojis",ADMIN_RANK_INVALID:"The specified admin rank is invalid",FRESH_CHANGE_ADMINS_FORBIDDEN:"You were just elected admin, you can't add or modify other admins yet",INPUT_USER_DEACTIVATED:"The specified user was deleted",BOT_PRECHECKOUT_TIMEOUT:"The request for payment has expired"},o={ADDRESS_STREET_LINE1_INVALID:{field:"streetLine1",message:"Incorrect street address"},ADDRESS_STREET_LINE2_INVALID:{field:"streetLine2",message:"Incorrect street address"},ADDRESS_CITY_INVALID:{field:"city",message:"Incorrect city"},ADDRESS_COUNTRY_INVALID:{field:"countryIso2",message:"Incorrect country"},ADDRESS_POSTCODE_INVALID:{field:"postCode",message:"Incorrect post code"},ADDRESS_STATE_INVALID:{field:"state",message:"Incorrect state"},REQ_INFO_NAME_INVALID:{field:"fullName",message:"Incorrect name"},REQ_INFO_PHONE_INVALID:{field:"phone",message:"Incorrect phone"},REQ_INFO_EMAIL_INVALID:{field:"email",message:"Incorrect email"}};function d(e){const{message:t,isSlowMode:n,textParams:o}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let d=r[t];return d&&o&&(d=Object.keys(o).reduce(((e,t)=>e.replace(t,o[t])),d)),d}function a(e){return o[e.message]}},3592:(e,t,n)=>{n.d(t,{S:()=>d}),n(3716);var r=n(9118);function o(e){e instanceof ErrorEvent&&"ResizeObserver loop limit exceeded"===e.message||(e.preventDefault(),d(e instanceof ErrorEvent?e.error||e.message:e.reason))}function d(e){console.error(e)}window.addEventListener("error",o),window.addEventListener("unhandledrejection",o),(0,r.P2)(window.alert,1e3)},782:(e,t,n)=>{function r(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function o(e,t){return Object.keys(e).reduce(((n,r,o)=>(n[r]=t(e[r],r,o,e),n)),{})}function d(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function a(e,t){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}function u(e,t){const n=new Set(t.map(String));return d(e,Object.keys(e).filter((e=>!n.has(e))))}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";function r(e,t,n,r){const o=("function"==typeof n?n(e):e[n])||0,d=("function"==typeof n?n(t):t[n])||0;return r?o-d:d-o}if(Array.isArray(t)){const[o,d]=Array.isArray(n)?n:[n,n],[a,u]=t,s="asc"===o,i="asc"===d;return e.sort(((e,t)=>r(e,t,a,s)||r(e,t,u,i)))}const o="asc"===n;return e.sort(((e,n)=>r(e,n,t,o)))}function i(e){return e.reduce(((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e)),[])}function c(e){return Array.from(new Set(e))}function l(e){return e.filter(Boolean)}function f(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function h(e,t){return e[0]<=t[t.length-1]&&e[e.length-1]>=t[0]}function m(e,t){return e.filter((e=>t.has(e)))}function p(e,t){const n=[];for(let r=0;r(t[n]=g(e[n]),t)),{})}function v(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return e[n]}n.d(t,{ee:()=>r,Q8:()=>o,ei:()=>d,q0:()=>a,CE:()=>u,Xo:()=>s,xH:()=>i,Tw:()=>c,oA:()=>l,et:()=>f,YE:()=>h,eL:()=>m,Vl:()=>p,Xh:()=>g,dF:()=>v})},711:(e,t,n)=>{n.d(t,{ll:()=>p,i0:()=>I,Pn:()=>w,m0:()=>C,qf:()=>S});var r=n(5116),o=n(3716),d=n(9524),a=n(1226),u=n(6063),s=n(2155);const i=/%\d?\$?[sdf@]/g,c=["value","zeroValue","oneValue","twoValue","fewValue","manyValue","otherValue"],l={en:e=>1!==e?6:2,ar:e=>0===e?1:1===e?2:2===e?3:e%100>=3&&e%100<=10?4:e%100>=11?5:6,ca:e=>1!==e?6:2,de:e=>1!==e?6:2,es:e=>1!==e?6:2,fa:e=>e>1?6:2,fr:e=>e>1?6:2,id:()=>0,it:e=>1!==e?6:2,ko:()=>0,ms:()=>0,nl:e=>1!==e?6:2,pl:e=>1===e?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,pt_BR:e=>e>1?6:2,ru:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,tr:e=>e>1?6:2,uk:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,uz:e=>e>1?6:2},f=new Map;let h,m;const{addCallback:p,removeCallback:g,runCallbacks:v}=(0,u._)();let y,b;const I=(e,t,n)=>{var r,o;if(void 0!==t){const r=Array.isArray(t)?JSON.stringify(t):t,o=f.get(`${e}_${r}_${n}`);if(o)return o}if(!h&&!m)return e;const d=(null===(r=h)||void 0===r?void 0:r[e])||(null===(o=m)||void 0===o?void 0:o[e]);return d?M(d,e,t,n):(m||E(),e)};async function w(e,t){let n=await d.fetch(o.ee,`${o.$O}_${e}_${t}`,d.Type.Json);return n||(n=await async function(e,t,n){const r=await(0,a.t9)("fetchLangStrings",{langPack:e,langCode:t,keys:[n]});if(null!=r&&r.length)return await d.save(o.ee,`${e}_${t}_${n}`,r[0]),r[0]}(o.$O,e,t)),M(n,t)}async function C(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(h&&e===y)return void(t&&t());let a=await d.fetch(o.ee,e,d.Type.Json);if(!a&&(n&&await E(),a=await P(e),!a))return;f.clear(),y=e,h=a,document.documentElement.lang=e;const{languages:u,timeFormat:s}=(0,r.Rd)().settings.byKey,i=null==u?void 0:u.find((t=>t.langCode===e));I.isRtl=Boolean(null==i?void 0:i.rtl),I.code=e,I.timeFormat=s,t&&t(),v()}function S(e){e&&e===b||(b=e,I.timeFormat=e,v())}async function E(){m||(m=(await n.e(915).then(n.bind(n,1915))).default,v())}async function P(e){const t=await(0,a.t9)("fetchLangPack",{sourceLangPacks:o.Bg,langCode:e});if(t)return await d.save(o.ee,e,t.langPack),t.langPack}function M(e,t,n,r){const d=e?e["number"==typeof n?function(e){const t=y||o.sR,n=l[t]?l[t](e):0;return c[n]}(n):"value"]:void 0;if(!d||!d.trim()){const e=t.split(".");return e[e.length-1]}if(void 0!==n){const e=function(e,t){t=Array.isArray(t)?t:[t];const n=e.split(i),r=n.shift();return n.reduce(((e,n,r)=>`${e}${String(t[r]||"")}${n}`),r||"")}(d,"i"===r?(0,s.kh)(n):n),o=Array.isArray(n)?JSON.stringify(n):n;return f.set(`${t}_${o}_${r}`,e),e}return d}},647:(e,t,n)=>{n.d(t,{cC:()=>b,he:()=>v,UV:()=>y,Iq:()=>I});var r=n(6137),o=n(3716),d=n(1226),a=n(9524),u=n(1394),s=n(7361);const i=48e3;async function c(e){const t=await new Response(e).arrayBuffer();return new Promise((e=>{const r=new Uint8Array(t);let o=new Worker(new URL(n.p+n.u(745),n.b)),d=new Worker(new URL(n.p+n.u(993),n.b));o.onmessage=e=>{null===e.data?d.postMessage({command:"done"}):d.postMessage({command:"encode",buffers:e.data},e.data.map((e=>{let{buffer:t}=e;return t})))},d.onmessage=t=>{"page"===t.data.message&&(e(new Blob([t.data.page],{type:"audio/wav"})),o.terminate(),o=void 0,d.terminate(),d=void 0)},d.postMessage({command:"init",wavBitDepth:16,wavSampleRate:i}),o.postMessage({command:"init",decoderSampleRate:i,outputBufferSampleRate:i}),o.postMessage({command:"decode",pages:r},[r.buffer])}))}var l=n(862);const f={[r.IU.BlobUrl]:a.Type.Blob,[r.IU.Lottie]:a.Type.Blob,[r.IU.Progressive]:void 0,[r.IU.Stream]:void 0},h=new Map,m=new Map,p=new Map,g=new Map;function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(t===r.IU.Progressive)return s.I_?w(e):v(e,r.IU.BlobUrl,n,d,a);if(!m.has(e)){const r=C(e,t,n).catch((e=>{o.eM&&console.warn(e)})).finally((()=>{m.delete(e),p.delete(e),g.delete(e)}));m.set(e,r)}if(d&&a){let t=p.get(e);t||(t=new Map,p.set(e,t)),t.set(a,d)}return m.get(e)}function y(e){return h.get(e)}function b(e){p.forEach(((t,n)=>{t.forEach((t=>{if(t===e){const e=g.get(n);if(!e)return;(0,d.u3)(e),g.delete(n),p.delete(n)}}))}))}function I(e,t){const n=p.get(e);n&&n.delete(t)}function w(e){const t=`./progressive/${e}`;return h.set(e,t),Promise.resolve(t)}async function C(e,t,n){if(!o.Cy){const r=e.startsWith("avatar")?o.SG:o.lW,d=await a.fetch(r,e,f[t],n);if(d){let t=d;if("audio/ogg"!==d.type||s.m5||(t=await c(t)),"image/webp"===d.type&&!(0,s.on)()&&t){const n=await(0,l._y)(e,t);n&&(t=n)}const n=E(t);return h.set(e,n),n}}if(t===r.IU.Stream){const n=new MediaSource,r=URL.createObjectURL(n);let o=!1;return n.addEventListener("sourceopen",(()=>{if(o)return;o=!0;const r=n.addSourceBuffer("audio/mpeg"),a=S(e,n,r);g.set(e,a),(0,d.t9)("downloadMedia",{url:e,mediaFormat:t},a)})),h.set(e,r),r}const i=S(e);g.set(e,i);const m=await(0,d.t9)("downloadMedia",{url:e,mediaFormat:t,isHtmlAllowed:n},i);if(!m)throw new Error(`Failed to fetch media ${e}`);let{prepared:p,mimeType:v}=m;if("audio/ogg"===v&&!s.m5){const e=await(0,u.gm)(p);URL.revokeObjectURL(p);const t=await c(e);p=E(t),v=t.type}if("image/webp"===v&&!(0,s.on)()){const t=await(0,u.gm)(p);URL.revokeObjectURL(p);const n=await(0,l._y)(e,t);n&&(p=E(n))}return h.set(e,p),p}function S(e,t,n){const r=(o,d)=>{var a;null===(a=p.get(e))||void 0===a||a.forEach((e=>{e(o),e.isCanceled&&(r.isCanceled=!0)})),1===o&&(null==t||t.endOfStream()),d&&(null==n||n.appendBuffer(d))};return r}function E(e){return e instanceof Blob?URL.createObjectURL(e):e}s.I_&&navigator.serviceWorker.addEventListener("message",(async e=>{const{type:t,messageId:n,params:o}=e.data;if("requestPart"!==t)return;const a=await(0,d.t9)("downloadMedia",{mediaFormat:r.IU.Progressive,...o});if(!a)return;const{arrayBuffer:u,mimeType:s,fullSize:i}=a;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:n,result:{arrayBuffer:u,mimeType:s,fullSize:i}},[u])}))},735:(e,t,n)=>{n.d(t,{D:()=>r});const r=[]},9203:(e,t,n)=>{n.d(t,{gl:()=>d,$y:()=>c,o5:()=>l,Qt:()=>f});var r=n(3716),o=n(6063);let d;!function(e){e[e.Auth=0]="Auth",e[e.Main=1]="Main",e[e.Extra=2]="Extra",e[e.Calls=3]="Calls"}(d||(d={}));const a={},u={},{addCallback:s,runCallbacks:i}=(0,o._)();async function c(e,t){if(!a[e]){switch(e){case d.Auth:a[d.Auth]=n.e(133).then(n.bind(n,1133));break;case d.Main:r.eM&&console.log(">>> START LOAD MAIN BUNDLE"),a[d.Main]=Promise.all([n.e(830),n.e(347),n.e(302),n.e(176)]).then(n.bind(n,3176));break;case d.Extra:a[d.Extra]=Promise.all([n.e(830),n.e(347),n.e(687)]).then(n.bind(n,687));break;case d.Calls:a[d.Calls]=Promise.all([n.e(830),n.e(302),n.e(47)]).then(n.bind(n,6628))}a[e].then(i)}const o=await a[e];return u[e]||(u[e]=o),l(e,t)}function l(e,t){const n=u[e];if(n)return n[t]}const f=s},8406:(e,t,n)=>{n.d(t,{q3:()=>y,Nz:()=>b,r1:()=>C,Ld:()=>E,rh:()=>P,Vr:()=>M,KC:()=>A});var r=n(1226),o=n(6137),d=n(8005),a=n(3716),u=n(5116),s=n(8415),i=n(9959),c=n(9066),l=n(7361),f=n(711),h=n(647),m=n(9118);function p(e){const t=e.toJSON();return JSON.stringify({endpoint:t.endpoint,keys:t.keys})}function g(){return!!l.Mc&&("showNotification"in ServiceWorkerRegistration.prototype?"denied"===Notification.permission?(a.eM&&console.warn("[PUSH] The user has blocked push notifications."),!1):"PushManager"in window||(a.eM&&console.warn("[PUSH] Push messaging isn't supported."),!1):(a.eM&&console.warn("[PUSH] Push notifications aren't supported."),!1))}const v=new Set;async function y(e,t){if(void 0!==e&&v.has(e))return;const{notificationSoundVolume:n}=(0,c.dZ)((0,u.Rd)()),r=t?t/10:n/10;if(0===r)return;const o=new Audio("./notification.mp3");o.volume=r,o.setAttribute("mozaudiochannel","notification"),void 0!==e&&(o.addEventListener("ended",(()=>{v.add(e)}),{once:!0}),setTimeout((()=>{v.delete(e)}),3e3));try{await o.play()}catch(e){a.eM&&console.warn("[PUSH] Unable to play notification sound")}}const b=(0,m.Ds)(y,1e3,!0,!1);async function I(){"Notification"in window&&(["granted","denied"].includes(Notification.permission)||await Notification.requestPermission())}async function w(e){const t=(0,u.Rd)(),n=(0,u.uC)();if(e)try{const t=p(e);return await(0,r.t9)("unregisterDevice",t),await e.unsubscribe(),void n.deleteDeviceToken()}catch(e){a.eM&&console.log("[PUSH] Unable to unsubscribe from push.",e)}t.push&&(await(0,r.t9)("unregisterDevice",t.push.deviceToken),n.deleteDeviceToken())}async function C(){if(!g())return;const e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();await w(t)}let S=!1;async function E(){if(!g())return void await I();const e=await navigator.serviceWorker.ready;let t=await e.pushManager.getSubscription();if(function(e){const t=(0,u.Rd)();return!t.push||!e||p(e)!==t.push.deviceToken||Date.now()-t.push.subscribedAt>432e5}(t)){await w(t);try{t=await e.pushManager.subscribe({userVisibleOnly:!0});const n=p(t);a.eM&&console.log("[PUSH] Received push subscription: ",n),await(0,r.t9)("registerDevice",n),(0,u.uC)().setDeviceToken(n)}catch(e){"denied"===Notification.permission?a.eM&&console.warn("[PUSH] The user has blocked push notifications."):a.eM&&(console.log("[PUSH] Unable to subscribe to push.",e),e.code===DOMException.ABORT_ERR&&await I())}}}async function P(e){let{chat:t,message:n}=e;const{hasWebNotifications:m}=await async function(){if(S)return(0,c.dZ)((0,u.Rd)());const[e,t]=await Promise.all([(0,r.t9)("fetchNotificationSettings",{serverTimeOffset:(0,u.Rd)().serverTimeOffset}),(0,r.t9)("fetchNotificationExceptions",{serverTimeOffset:(0,u.Rd)().serverTimeOffset})]);if(!e)return(0,c.dZ)((0,u.Rd)());let n=(0,i.BI)((0,u.Rd)(),e);return t&&(n=(0,i.aJ)(n,t)),(0,u.R3)(n),S=!0,(0,c.dZ)(n)}();if(!function(e){if(!S)return!1;const t=(0,u.Rd)();if((0,s.i4)(e,(0,c.dZ)(t),(0,c.NJ)(t))||e.isNotJoined||!e.isListed)return!1;if(l.$b){const{chatId:n,type:r}=(0,c.Bt)(t)||{};return!(n===e.id&&"thread"===r)}return!document.hasFocus()}(t))return;const p="Notification"in window?"denied"!==Notification.permission||(a.eM&&console.warn("[PUSH] The user has blocked push notifications."),!1):(a.eM&&console.warn("[PUSH] This browser does not support desktop notification"),!1);if(!m||!p)return void b(String(n.id)||t.id);if(!p)return;if(!n.id)return;const v=(0,s.dT)(n),y=await async function(e){const t=(0,s.RT)(e);if(!t)return;let n=h.UV(t);return n||(await h.he(t,o.IU.BlobUrl),n=h.UV(t)),n}(t),{title:I,body:w}=function(e,t,n){const r=(0,u.Rd)();let{senderId:o,replyToMessageId:a}=t;n&&(o=n.userId);const i=o?(0,c.dy)(r,o):void 0,l=(0,s.N5)(t),h=l&&a?(0,c.hj)(r,e.id,a):void 0,{targetUserIds:m,targetChatId:p}=l||{},g=m?m.map((e=>(0,c.dy)(r,e))).filter(Boolean):void 0,v=(0,s.zX)(e),y=v?(0,c.dy)(r,v):void 0;let b;if((0,s.Sm)(e,(0,c.dZ)(r),(0,c.NJ)(r)))if((0,s.Lo)(t)){const n=e&&((0,s.eA)(e)||t.senderId===t.chatId);b=(0,d.D)(f.i0,t,n?void 0:i,n?e:void 0,g,h,p,{asPlainText:!0})}else{const n=(0,s.zF)(f.i0,e.id,i),r=(0,s.MK)(f.i0,t,!1,60,!1);b=n?`${n}: ${r}`:r}else b="New message";return{title:(0,s.U)(f.i0,e,y),body:b}}(t,n,v);if(g()){var C;null!==(C=navigator.serviceWorker)&&void 0!==C&&C.controller&&navigator.serviceWorker.controller.postMessage({type:"showMessageNotification",payload:{title:I,body:w,icon:y,chatId:t.id,messageId:n.id,reaction:v?v.reaction:void 0}})}else{const e=(0,u.uC)(),r={body:w,icon:y,badge:y,tag:String(n.id)};"vibrate"in navigator&&(r.vibrate=[200,100,200]);const o=new Notification(I,r);o.onclick=()=>{o.close(),e.focusMessage({chatId:t.id,messageId:n.id}),v&&e.startActiveReaction({messageId:n.id,reaction:v.reaction}),window.focus&&window.focus()},o.onshow=()=>{b(String(n.id)||t.id)}}}function M(e){var t;!a.Cg&&null!==(t=navigator.serviceWorker)&&void 0!==t&&t.controller&&navigator.serviceWorker.controller.postMessage({type:"closeMessageNotifications",payload:e})}function A(){var e;null!==(e=navigator.serviceWorker)&&void 0!==e&&e.controller&&navigator.serviceWorker.controller.postMessage({type:"clientReady"})}},7926:(e,t,n)=>{n.d(t,{L:()=>d,$:()=>a});const r="kz_version",o=["Z","K"];function d(e){localStorage.setItem(r,JSON.stringify(e))}function a(){(function(){const e=localStorage.getItem(r);if(!e)return!1;try{const t=JSON.parse(e);return o.includes(t)}catch(e){return!1}})()||d("Z")}},6272:(e,t,n)=>{n.d(t,{U9:()=>a,g3:()=>u,un:()=>s,WZ:()=>i});var r=n(782);const o="X",d="XXX XXX XXX XXX";function a(e,t){return e.filter((e=>e.iso2===t))}function u(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=n.replace(/[^\d+]+/g,"");o.startsWith("+")&&(o=o.substr(1));const d=e.filter((e=>o.startsWith(e.countryCode))),a=(0,r.xH)(d.map((e=>(e.prefixes||[""]).map((t=>({code:`${e.countryCode}${t}`,country:e})))))),u=a.filter((e=>{let{code:t}=e;return o.startsWith(t)})).sort(((e,t)=>e.code.length-t.code.length));return null===(t=u[u.length-1])||void 0===t?void 0:t.country}function s(e,t){let n=e.replace(/[^\d]+/g,"");if(t)n=n.substr(t.countryCode.length);else if(e.startsWith("+"))return e;const r=function(e,t){if(!t||0===t.length)return d;if(1===t.length)return t[0];const n=t.find((e=>e.startsWith(o)))||d,r=t.filter((t=>{const n=t.replace(/[^\dX]+/g,"");if(n.startsWith(o))return!1;for(let t=0;tn.length-1||n[t]!==o&&n[t]!==e[t])return!1;return!0}));return 1===r.length?r[0]:n}(n,null==t?void 0:t.patterns),a=[];let u=0;for(let e=0;e{n.d(t,{q:()=>d,V:()=>a});var r=n(6137),o=n(6590);function d(e){const t="thread"!==e.type?`_${e.type}`:-1!==e.threadId?`_${e.threadId}`:"";return`${e.chatId}${t}`}function a(){if(!o.Oy)return;const[e,t]=o.Oy.replace(/^#/,"").split("_");if(null==e||!e.match(/^-?\d+$/))return;const n=["thread","pinned","scheduled"].includes(t);return{chatId:e,type:Boolean(t)&&n?t:"thread",threadId:Boolean(t)&&!n?Number(t):r._f}}},9118:(e,t,n)=>{function r(e,t){let n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(){for(var d=arguments.length,a=new Array(d),u=0;u{o&&e(...a),n=void 0}),t)}}function o(e,t){let n,r,o,d=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(){r=!0;for(var a=arguments.length,u=new Array(a),s=0;s{if(!r)return self.clearInterval(n),void(n=void 0);r=!1,e(...o)}),t))}}function d(e){return s(v,e)}function a(e){return s(y,e)}function u(e){return s(b,e)}function s(e,t){let n,r=!1;return function(){for(var o=arguments.length,d=new Array(o),a=0;a{r=!1,t(...n)})))}}function i(e,t){self.requestIdleCallback?self.requestIdleCallback(e,{timeout:t}):b(e)}n.d(t,{Ds:()=>r,P2:()=>o,mS:()=>d,wT:()=>a,$6:()=>u,Q8:()=>i,wO:()=>c,Pn:()=>l,T2:()=>v,D0:()=>y,R3:()=>b,zD:()=>I,Gq:()=>w});const c=e=>new Promise((t=>{setTimeout((()=>t()),e)}));function l(){return new Promise((e=>{v(e)}))}let f,h,m,p,g;function v(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];f?t?h.push(e):f.push(e):(f=t?[]:[e],h=t?[e]:[],requestAnimationFrame((()=>{const e=f,t=h;f=void 0,h=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}function y(e){v(e,!0)}function b(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m?t?p.push(e):m.push(e):(m=t?[]:[e],p=t?[e]:[],Promise.resolve().then((()=>{const e=m,t=p;m=void 0,p=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}function I(e){b(e,!0)}function w(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return g||(g=[],self.addEventListener("beforeunload",(()=>{g.forEach((e=>e()))}))),t?g.push(e):g.unshift(e),()=>{g=g.filter((t=>t!==e))}}},5765:(e,t,n)=>{let r;n.d(t,{Z:()=>o,W:()=>d});try{r=new RegExp("[^\\p{L}\\p{M}]+","ui")}catch(e){r=new RegExp("[^\\wа-яё]+","i")}function o(e,t){if(!e||!t)return!1;const n="string"==typeof t?t.toLowerCase().split(r):t,o=e.toLowerCase();if(1===n.length&&!o.includes(n[0]))return!1;let d;return n.every((e=>!!o.includes(e)&&(d||(d=o.split(r)),d.some((t=>t.startsWith(e))))))}function d(e){const t=e.toLowerCase().split(r);return e=>o(e,t)}},2267:(e,t,n)=>{n.d(t,{b:()=>r});const r=e=>Math.floor(Date.now()/1e3)+e},3100:(e,t,n)=>{n.d(t,{f3:()=>m,jv:()=>l,ti:()=>i,Qw:()=>h,K8:()=>f,wX:()=>c});function r(e){return new Promise(((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)}))}let o;function d(){return o||(o=function(e,t){const n=(!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){var t=function(){return indexedDB.databases().finally(e)};o=setInterval(t,100),t()})).finally((function(){return clearInterval(o)})):Promise.resolve()).then((()=>{const e=indexedDB.open("keyval-store");return e.onupgradeneeded=()=>e.result.createObjectStore(t),r(e)}));var o;return(e,r)=>n.then((n=>r(n.transaction(t,e).objectStore(t))))}(0,"keyval")),o}var a=n(3716),u=n(9524);const s=[1,2,3,4,5];function i(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&localStorage.getItem(a.Vx))return!0;const t=localStorage.getItem(a.b_);if(!t)return!1;try{const e=JSON.parse(t);return Boolean(e&&e.id&&e.dcID)}catch(e){return!1}}function c(e,t){const{mainDcId:n,keys:r,hashes:o}=e;localStorage.setItem(a.b_,JSON.stringify({dcID:n,id:t})),localStorage.setItem("dc",String(n)),Object.keys(r).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_auth_key`,JSON.stringify(r[e]))})),o&&Object.keys(o).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_hash`,JSON.stringify(o[e]))}))}function l(){[a.b_,"dc",...s.map((e=>`dc${e}_auth_key`)),...s.map((e=>`dc${e}_hash`))].forEach((e=>{localStorage.removeItem(e)}))}function f(){if(!i())return;const e=JSON.parse(localStorage.getItem(a.b_)),t=Number(e.dcID),n={},r={};return s.forEach((e=>{try{const t=localStorage.getItem(`dc${e}_auth_key`);t&&(n[e]=JSON.parse(t));const o=localStorage.getItem(`dc${e}_hash`);o&&(r[e]=JSON.parse(o))}catch(e){a.eM&&console.warn("Failed to load stored session",e)}})),Object.keys(n).length?{mainDcId:t,keys:n,hashes:r}:void 0}async function h(){const e=localStorage.getItem(a.Vx);if(!e)return;const t=await function(e,t=d()){return t("readonly",(t=>r(t.get(e))))}(`GramJs:${e}`);try{c(JSON.parse(t))}catch(e){a.eM&&console.warn("Failed to load legacy session",e)}}async function m(){localStorage.removeItem(a.Vx);const e=await function(e=d()){return e("readonly",(e=>{if(e.getAllKeys)return r(e.getAllKeys());const t=[];return function(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},r(e.transaction)}(e,(e=>t.push(e.key))).then((()=>t))}))}();await Promise.all([u.clear("GramJs"),...e.filter((e=>"string"==typeof e&&e.startsWith("GramJs:GramJs-session-"))).map((e=>function(e,t=d()){return t("readwrite",(t=>(t.delete(e),r(t.transaction))))}(e)))])}},7370:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(9933),o=n(9118);const d=JSON.parse('{"--color-primary":["#3390EC","#8774E1"],"--color-primary-opacity":["#50A2E980","#8378DB80"],"--color-primary-shade":["#4a95d6","#7b71c6"],"--color-background":["#FFFFFF","#212121"],"--color-background-compact-menu":["#FFFFFFBB","#212121DD"],"--color-background-compact-menu-reactions":["#FFFFFFEB","#212121DD"],"--color-background-compact-menu-hover":["#00000011","#00000066"],"--color-background-secondary":["#f4f4f5","#0F0F0F"],"--color-background-secondary-accent":["#E4E4E5","#100f10"],"--color-background-own":["#EEFFDE","#8774E1"],"--color-background-own-apple":["#DCF8C5","#8774E1"],"--color-background-selected":["#F4F4F5","#2C2C2C"],"--color-background-own-selected":["#d0ffac","#6549d4"],"--color-chat-hover":["#F4F4F5","#2C2C2C"],"--color-chat-active":["#3390EC","#8774E1"],"--color-item-active":["#ededed","#292929"],"--color-text":["#000000","#FFFFFF"],"--color-text-secondary":["#707579","#AAAAAA"],"--color-text-secondary-apple":["#8E8E92","#AAAAAA"],"--color-borders":["#DADCE0","#303030"],"--color-borders-input":["#DADCE0","#5B5B5A"],"--color-dividers":["#C8C6CC","#404040"],"--color-links":["#3390EC","#8774E1"],"--color-gray":["#C4C9CC","#717579"],"--color-pinned":["#C4C9CC","#707579"],"--color-default-shadow":["#72727240","#1010109c"],"--color-light-shadow":["#7272722B","#00000040"],"--color-green":["#00C73E","#8774E1"],"--color-text-meta-colored":["#4DCD5E","#8378DB"],"--color-reply-hover":["#F4F4F4","#272727"],"--color-reply-active":["#E8E9E9","#2E2F2F"],"--color-reply-own-hover":["#D9F5CE","#7d6bca"],"--color-reply-own-hover-apple":["#cbefb7","#7d6bca"],"--color-reply-own-active":["#C5ECBE","#7264b6"],"--color-reply-own-active-apple":["#bae6a8","#7264b6"],"--color-accent-own":["#45AF54","#FFFFFF"],"--color-message-meta-own":["#4FAE4EFF","#FFFFFF88"],"--color-own-links":["#3390EC","#FFFFFF"],"--color-code":["#4a729a","#8774E1"],"--color-code-own":["#3c7940","#FFFFFF"],"--color-code-bg":["#70757914","#ffffff26"],"--color-code-own-bg":["#70757914","#ffffff26"],"--color-composer-button":["#707579CC","#AAAAAACC"],"--color-message-reaction":["#ebf3fd","#2b2a35"],"--color-message-reaction-hover":["#c5def9","#343147"],"--color-message-reaction-own":["#cef0ba","#7a68ca"],"--color-message-reaction-hover-own":["#b5e0a4","#7567bc"]}');let a=!1;const u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,s=new Set(["--color-primary-shade","--color-text-secondary"]),i=(e,t,n)=>(1-n)*e+n*t,c=Object.keys(d).map((e=>({property:e,colors:[l(d[e][0]),l(d[e][1])]})));function l(e){const t=u.exec(e);return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:void 0!==t[4]?parseInt(t[4],16):void 0}}function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;c.forEach((r=>{let{property:o,colors:d}=r;const a=Math.round(i(d[e].r,d[t].r,n)),u=Math.round(i(d[e].g,d[t].g,n)),c=Math.round(i(d[e].b,d[t].b,n)),l=void 0!==d[e].a?Math.round(i(d[e].a,d[t].a,n)):void 0;document.documentElement.style.setProperty(o,void 0!==l?`rgba(${a},${u},${c},${l/255})`:`rgb(${a},${u},${c})`),s.has(o)&&document.documentElement.style.setProperty(`${o}-rgb`,`${a},${u},${c}`)}))}const h=(e,t)=>{const n="dark"===e,d=a&&t,u=n?0:1,s=n?1:0,i=Date.now(),c=document.querySelector('meta[name="theme-color"]');document.documentElement.classList.remove("theme-"+(n?"light":"dark")),a&&document.documentElement.classList.add("no-animations"),document.documentElement.classList.add(`theme-${e}`),c&&c.setAttribute("content",n?"#212121":"#fff"),setTimeout((()=>{document.documentElement.classList.remove("no-animations")}),500),a=!0,d?(0,o.T2)((()=>{(0,r.cK)((()=>{const e=Math.min((Date.now()-i)/200,1);return f(u,s,function(e){return 1-(1-e)**3.5}(e)),e<1}))})):f(u,s)}},2155:(e,t,n)=>{n.d(t,{kh:()=>d,bi:()=>u,Xv:()=>s});var r=n(3681),o=n(4284);function d(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function a(e){return".0"===String(e.toFixed(1)).substr(-2)?Math.round(e):e.toFixed(1).replace(".",",")}function u(e){return e<1e3?e:e<1e6?`${a(e/1e3)}K`:`${a(e/1e6)}M`}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map((e=>{if(!e.length)return"";const t=(e=(0,o.g6)(e)).match(r.Z);return t&&e.startsWith(t[0])?t[0]:e.match(/./u)[0].toUpperCase()})).join("")}},8035:(e,t,n)=>{function r(e,t){return!e||!t||e.length<=t?e:`${e.substring(0,t)}...`}n.d(t,{Z:()=>r})},862:(e,t,n)=>{n.d(t,{Hu:()=>s,_y:()=>i,p6:()=>c});var r=n(7361),o=n(1394),d=n(9118);let a,u;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";async function i(e,t){for(l();!u.wasmReady;)await(0,d.wO)(2e3);const{result:n,width:r,height:o}=await function(e,t){return new Promise((n=>{u.requests||(u.requests=new Map),u.requests.set(e,n),u.postMessage({id:e,blob:t})}))}(e,t);if(r&&o)return function(e){let{result:t,width:n,height:r}=e;return a||(a=document.createElement("canvas")),new Promise((e=>{const o=new ImageData(t,n,r);a.width=n,a.height=r,a.getContext("2d").putImageData(o,0,0),a.toBlob((t=>{e(null!=t?t:void 0)}),"image/png",1)}))}({result:n,width:r,height:o})}async function c(e,t){if((0,r.on)()||"data:image/webp"!==t.substr(0,15))return t;l();const n=await i(e,(0,o.A9)(t));if(!n)throw new Error(`Can't convert webp to png. Url: ${t}`);return(0,o.YJ)(n)}function l(){u||(u=new Worker(new URL(n.p+n.u(536),n.b)),u.wasmReady=!1,u.onmessage=f)}function f(e){const{id:t}=e.data;switch(e.data.type){case"initialized":u.wasmReady=!0;break;case"result":if(u.requests.has(t)){const n=u.requests.get(t);u.requests.delete(t),n(e.data)}}}},1622:(e,t,n)=>{n.d(t,{IT:()=>l,px:()=>f,W8:()=>h});var r=n(3716),o=n(5116),d=n(3100);const a=["t.me","telegram.me"].map((e=>`//${e}/_websync_?`)),u=`${r.Ji} Z`,s="tgme_sync",i=()=>Math.floor(Number(new Date)/1e3);let c;const l=e=>{const t=i(),{canRedirect:n,ts:r}=JSON.parse(localStorage.getItem(s)||"{}");return n!==e||r+86400<=t?Promise.all(a.map((t=>new Promise(((n,r)=>{const o=document.createElement("script"),d=()=>Boolean(document.body.removeChild(o));o.src=t+new URLSearchParams({authed:Number(e).toString(),version:u}),document.body.appendChild(o),o.onload=()=>{(e=>{const t=i();localStorage.setItem(s,JSON.stringify({canRedirect:e,ts:t}))})(e),d(),c&&(clearTimeout(c),c=void 0),f(),n()},o.onerror=()=>{d(),r()}}))))):Promise.resolve()};function f(){if(r.eM)return;if(void 0!==c)return;const e=i(),{ts:t}=JSON.parse(localStorage.getItem(s)||"{}"),n=86400-(e-t);c=setTimeout((()=>{const{authState:e}=(0,o.Rd)(),t="authorizationStateReady"===e||(0,d.ti)(!0);l(t)}),Math.max(0,1e3*n))}function h(){localStorage.removeItem(s)}},3858:(e,t,n)=>{n.d(t,{z:()=>l,Z:()=>h});var r=n(9118),o=n(3716),d=n(7361);const a=d.wB&&f(),u=window.innerHeight;let s=l(),i=!1;const c=(0,r.P2)((()=>{s=l(),!i&&((s.width<=o.l3||s.width<=o.u_&&s.height<=o.rO)!==d.wB||d.wB&&a!==f())&&window.location.reload()}),250,!0);function l(){let e;e=d.cj?window.visualViewport.height+window.visualViewport.pageTop:window.innerHeight;const t=.01*e;return document.documentElement.style.setProperty("--vh",`${t}px`),{width:window.innerWidth,height:window.innerHeight}}function f(){return d.cj?window.matchMedia("(orientation: landscape)").matches:window.matchMedia("screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)").matches}window.addEventListener("orientationchange",c),d.cj?window.visualViewport.addEventListener("resize",c):window.addEventListener("resize",c);const h={get:()=>s,getIsKeyboardVisible:()=>u>s.height,disableRefresh:function(){i=!0},enableRefresh:function(){i=!1}}},5359:(e,t,n)=>{e.exports=n.p+"app-inactive.bc7953c2dfebcabce2c4..png"},2162:(e,t,n)=>{e.exports=n.p+"monkey.a3d5fcdc50b18dc55695..svg"},5523:(e,t,n)=>{e.exports=n.p+"reaction-thumbs.4007ef2a82a070efb3ce..png"},4128:(e,t,n)=>{e.exports=n.p+"telegram-logo.1b2bb5b107f046ea9325..svg"}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return a[e].call(n.exports,n,n.exports,s),n.exports}s.m=a,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);s.r(o);var d={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>d[e]=()=>n[e]));return d.default=()=>n,s.d(o,d),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+"."+{47:"9ea2a6fe11cbf65b8511",99:"4acb17d13e1a5b87b131",133:"0e8e598a95d89fe36bff",161:"4fade15904bfe66b4f71",176:"c9baace07c5f15a8c611",302:"cf81ea852f516bfc252f",347:"b7e411d2828cadec556d",354:"472e40d0f6d6067cc288",472:"65a66b6c1fb1be8db986",501:"3c8f4d2d9fb141fac95f",524:"aa9aa632b1ede321653d",536:"ab2a889dae72ec88f68c",626:"80b1f20c070778cd2c89",687:"2509fbfe3b3556358b45",745:"cc53f6e29328dbd2c9ff",830:"743a3bc23208a5ae5b3b",915:"af01666698d37aea6ce6",941:"4aa7cedc56885a7f52cb",993:"5065d2f591c9fc4f83b4"}[e]+".js",s.miniCssF=e=>e+"."+{47:"9ea2a6fe11cbf65b8511",133:"0e8e598a95d89fe36bff",176:"c9baace07c5f15a8c611",347:"b7e411d2828cadec556d",472:"65a66b6c1fb1be8db986",687:"2509fbfe3b3556358b45"}[e]+".css",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="telegram-t:",s.l=(e,t,o,d)=>{if(n[e])n[e].push(t);else{var a,u;if(void 0!==o)for(var i=document.getElementsByTagName("script"),c=0;c{a.onerror=a.onload=null,clearTimeout(h);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),o=e=>new Promise(((t,n)=>{var r=s.miniCssF(e),o=s.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=d=>{if(o.onerror=o.onload=null,"load"===d.type)n();else{var a=d&&("load"===d.type?"missing":d.type),u=d&&d.target&&d.target.href||t,s=new Error("Loading CSS chunk "+e+" failed.\n("+u+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=a,s.request=u,o.parentNode.removeChild(o),r(s)}},o.href=t,document.head.appendChild(o)})(e,o,t,n)})),d={179:0},s.f.miniCss=(e,t)=>{d[e]?t.push(d[e]):0!==d[e]&&{47:1,133:1,176:1,347:1,472:1,687:1}[e]&&t.push(d[e]=o(e).then((()=>{d[e]=0}),(t=>{throw delete d[e],t})))},(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var d=s.p+s.u(t),a=new Error;s.l(d,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+d+")",a.name="ChunkLoadError",a.type=o,a.request=d,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[d,a,u]=n,i=0;if(d.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);u&&u(s)}for(t&&t(n);i{s(3592);var e=s(3716),t=s(5116),n=s(7361),r=s(8406);function o(n){const o=n.data;if(e.ZT&&console.log("[SW] Message from worker",o),!o.type)return;const d=(0,t.uC)(),a=o.payload;switch(o.type){case"focusMessage":d.focusMessage&&d.focusMessage(a),d.startActiveReaction&&a.reaction&&d.startActiveReaction({messageId:a.messageId,reaction:a.reaction});break;case"playNotificationSound":(0,r.Nz)(o.payload.id)}}function d(){navigator.serviceWorker.removeEventListener("message",o),navigator.serviceWorker.addEventListener("message",o),(0,r.KC)()}n.Mc&&(window.addEventListener("load",(async()=>{try{if(!navigator.serviceWorker.controller){const t=await navigator.serviceWorker.getRegistrations();t.length&&(e.eM&&console.log("[SW] Hard reload detected, re-enabling Service Worker"),await Promise.all(t.map((e=>e.unregister()))))}await navigator.serviceWorker.register(new URL(s.p+s.u(524),s.b)),e.eM&&console.log("[SW] ServiceWorker registered"),await navigator.serviceWorker.ready,navigator.serviceWorker.controller?(e.eM&&console.log("[SW] ServiceWorker ready"),d()):(e.eM&&console.error("[SW] ServiceWorker not available"),n.cj||n.wZ||(0,t.uC)().showDialog({data:{message:"SERVICE_WORKER_DISABLED",hasErrorKey:!0}}))}catch(t){e.eM&&console.error("[SW] ServiceWorker registration failed: ",t)}})),window.addEventListener("focus",(async()=>{await navigator.serviceWorker.ready,d()})));var a=s(2916);const u={isLeftColumnShown:!0,isChatInfoShown:!1,newChatMembersProgress:s(1713).WB.Closed,uiReadyState:0,serverTimeOffset:0,authRememberMe:!0,countryList:{phoneCodes:[],general:[]},blocked:{ids:[],totalCount:0},users:{byId:{},statusesById:{}},chats:{listIds:{},isFullyLoaded:{},orderedPinnedIds:{},totalCount:{},byId:{}},messages:{byChatId:{},messageLists:[],sponsoredByChatId:{}},groupCalls:{byId:{}},scheduledMessages:{byChatId:{}},chatFolders:{byId:{},activeChatFolder:0},fileUploads:{byMessageLocalId:{}},recentEmojis:["grinning","kissing_heart","christmas_tree","brain","trophy"],stickers:{setsById:{},added:{},recent:{stickers:[]},favorite:{stickers:[]},greeting:{stickers:[]},featured:{setIds:[]},search:{},forEmoji:{}},emojiKeywords:{},gifs:{saved:{},search:{}},inlineBots:{isLoading:!1,byUsername:{}},globalSearch:{},userSearch:{},localTextSearch:{byChatThreadKey:{}},localMediaSearch:{byChatId:{}},management:{byChatId:{}},topPeers:{},topInlineBots:{},mediaViewer:{},audioPlayer:{volume:e.Qx,playbackRate:e.mw,isMuted:!1},forwardMessages:{},pollResults:{},payment:{},notifications:[],dialogs:[],activeSessions:[],settings:{byKey:{theme:"light",shouldUseSystemTheme:!0,messageTextSize:n.cj?e.b6:n.jm?e.AR:e.xS,animationLevel:e.CX,messageSendKeyCombo:"enter",canAutoLoadPhotoFromContacts:!0,canAutoLoadPhotoInPrivateChats:!0,canAutoLoadPhotoInGroups:!0,canAutoLoadPhotoInChannels:!0,canAutoLoadVideoFromContacts:!0,canAutoLoadVideoInPrivateChats:!0,canAutoLoadVideoInGroups:!0,canAutoLoadVideoInChannels:!0,canAutoLoadFileFromContacts:!1,canAutoLoadFileInPrivateChats:!1,canAutoLoadFileInGroups:!1,canAutoLoadFileInChannels:!1,autoLoadFileMaxSizeMb:10,hasWebNotifications:!0,hasPushNotifications:!0,notificationSoundVolume:5,canAutoPlayGifs:!0,canAutoPlayVideos:!0,shouldSuggestStickers:!0,shouldLoopStickers:!0,language:"en",timeFormat:"24h",wasTimeFormatSetManually:!1,isConnectionStatusMinimized:!0},themes:{light:{isBlurred:!0,patternColor:e.g},dark:{isBlurred:!0,patternColor:e.Vv}},privacy:{},notifyExceptions:{}},twoFaSettings:{},activeReactions:{},shouldShowContextMenuHint:!0,activeDownloads:{byChatId:{}},serviceNotifications:[]};var i=s(6137),c=s(9118),l=s(8674),f=s(782),h=s(9066),m=s(3100),p=s(5780),g=s(8415),v=s(6974);const y=(0,c.P2)((()=>(0,c.Q8)(S)),5e3,!1);let b,I=!1;function w(){I=!0,b=(0,c.Gq)(S,!0),window.addEventListener("blur",S),(0,t.ll)(y)}function C(){I=!1,(0,t.Iq)(y),window.removeEventListener("blur",S),b&&b()}function S(){if(!I||(0,l.zG)())return;const n=(0,t.Rd)();if(n.isLoggingOut)return;const r={...u,...(0,f.ei)(n,["authState","authPhoneNumber","authRememberMe","authNearestCountry","currentUserId","contactList","topPeers","topInlineBots","recentEmojis","push","shouldShowContextMenuHint","leftColumnWidth","serviceNotifications"]),audioPlayer:{volume:n.audioPlayer.volume,playbackRate:n.audioPlayer.playbackRate,isMuted:n.audioPlayer.isMuted},isChatInfoShown:E(n),users:P(n),chats:M(n),messages:A(n),globalSearch:{recentlyFoundChatIds:n.globalSearch.recentlyFoundChatIds},settings:k(n),chatFolders:T(n),groupCalls:N(n),availableReactions:L(n)},o=JSON.stringify(r);localStorage.setItem(e.Uh,o)}function E(t){return window.innerWidth>e._m&&t.isChatInfoShown}function P(t){var n,r,o,d,a;const{users:{byId:u,statusesById:s},currentUserId:i}=t,{chatId:c}=(0,h.Bt)(t)||{},l=null===(n=(0,h.P2)(t))||void 0===n?void 0:n.map((e=>{let{id:t}=e;return t})),m=(0,f.Tw)([...i?[i]:[],...c&&(0,g.YC)(c)?[c]:[],...l||[],...t.topPeers.userIds||[],...(null===(r=(0,v.gO)(e.Nf))||void 0===r?void 0:r.filter(g.YC))||[],...(null===(o=(0,v.gO)(e.WS))||void 0===o?void 0:o.filter(g.YC))||[],...(null===(d=t.contactList)||void 0===d?void 0:d.userIds)||[],...(null===(a=t.globalSearch.recentlyFoundChatIds)||void 0===a?void 0:a.filter(g.YC))||[],...Object.keys(u)]).slice(0,e.lO);return{byId:(0,f.ei)(u,m),statusesById:(0,f.ei)(s,m)}}function M(t){const{chats:{byId:n},currentUserId:r}=t,o=(0,h.jr)(t),d=(0,f.Tw)([...r?[r]:[],...o?[o.id]:[],...(0,v.gO)(e.Nf)||[],...(0,v.gO)(e.WS)||[],...t.globalSearch.recentlyFoundChatIds||[],...Object.keys(n)]).slice(0,e.gJ);return{...t.chats,isFullyLoaded:{},byId:(0,f.ei)(t.chats.byId,d)}}function A(t){var n;const{currentUserId:r}=t,o={},{chatId:d}=(0,h.Bt)(t)||{};return[...d?[d]:[],...r?[r]:[],...(null===(n=(0,v.gO)(e.Nf))||void 0===n?void 0:n.slice(0,e.Rk))||[]].forEach((e=>{const n=t.messages.byChatId[e];if(!n)return;const r=n.threadsById[i._f];r&&r.viewportIds&&(o[e]={byId:(0,f.ei)(n.byId,r.viewportIds),threadsById:{[i._f]:r}})})),{byChatId:o,messageLists:[],sponsoredByChatId:{}}}function k(e){const{byKey:t,themes:n}=e.settings;return{byKey:t,themes:n,privacy:{},notifyExceptions:{}}}function T(e){return{...e.chatFolders,activeChatFolder:0}}function N(e){return{...e.groupCalls,byId:{},activeGroupCallId:void 0,isGroupCallPanelHidden:void 0,isFallbackConfirmOpen:void 0}}function L(e){var t;return null===(t=e.availableReactions)||void 0===t?void 0:t.map((e=>(0,f.ei)(e,["reaction","staticIcon","title","isInactive"])))}e.sd||((0,t.Q6)("saveSession",(()=>{I||w()})),(0,t.Q6)("reset",(()=>{localStorage.removeItem(e.Uh),I&&C()}))),(0,t.Q6)("init",(()=>{const t=(0,f.Xh)(u);return function(t){if(!e.sd)return(0,m.ti)(!0)?(w(),function(t){e.eM&&console.time("global-state-cache-read");const r=localStorage.getItem(e.Uh),o=r?JSON.parse(r):void 0;e.eM&&console.timeEnd("global-state-cache-read"),o&&function(t,n){if("shouldAutoDownloadMediaFromContacts"in t.settings.byKey){const{shouldAutoDownloadMediaFromContacts:e,shouldAutoDownloadMediaInPrivateChats:n,shouldAutoDownloadMediaInGroups:r,shouldAutoDownloadMediaInChannels:o,shouldAutoPlayVideos:d,shouldAutoPlayGifs:a,...u}=t.settings.byKey;t.settings.byKey={...u,canAutoLoadPhotoFromContacts:e,canAutoLoadVideoFromContacts:e,canAutoLoadPhotoInPrivateChats:n,canAutoLoadVideoInPrivateChats:n,canAutoLoadPhotoInGroups:r,canAutoLoadVideoInGroups:r,canAutoLoadPhotoInChannels:o,canAutoLoadVideoInChannels:o,canAutoPlayVideos:d,canAutoPlayGifs:a}}t.settings.byKey={...n.settings.byKey,...t.settings.byKey},t.settings.themes={...n.settings.themes,...t.settings.themes},t.chatFolders={...n.chatFolders,...t.chatFolders},t.stickers.greeting||(t.stickers.greeting=n.stickers.greeting),t.activeDownloads||(t.activeDownloads={byChatId:{}}),t.serviceNotifications||(t.serviceNotifications=[]),void 0===t.audioPlayer.volume&&(t.audioPlayer.volume=e.Qx),void 0===t.audioPlayer.playbackRate&&(t.audioPlayer.playbackRate=e.mw),t.groupCalls||(t.groupCalls=n.groupCalls),t.users.statusesById||(t.users.statusesById={}),t.messages.sponsoredByChatId||(t.messages.sponsoredByChatId={}),t.activeReactions||(t.activeReactions={})}(o,t);const d={...t,...o},a=n.wB?void 0:(0,p.V)();return{...d,messages:{...d.messages,messageLists:a?[a]:[]}}}(t)):void C()}(t)||t}));var R=s(4050),F=s(3858);const x="tt-active-tab",B=String(Date.now()+Math.random());let O;localStorage.setItem(x,B);const Z=window.setInterval((()=>{O&&localStorage.getItem(x)!==B&&(O(),clearInterval(Z))}),2e3);var D=s(706),_=(s(7895),s(3781),s(1363),s(9667),s(4907),s(6590)),$=s(8332),U=s(1212),j=s(1394);const W=["400 1em Roboto","500 1em Roboto"];function V(){if("fonts"in document)return Promise.all(W.map((e=>document.fonts.load(e))))}var G=s(647),H=s(9203),z=s(6752),Q=s(4128),K=s(5523),J=s(2162);function q(){const{listIds:e,byId:n}=(0,t.Rd)().chats;if(e.active)return Promise.all(e.active.slice(0,10).map((e=>{const t=n[e];if(!t)return;const r=(0,$.RT)(t);return r?G.he(r,i.IU.BlobUrl):void 0})))}const Y={main:()=>Promise.all([(0,H.$y)(H.gl.Main,"Main").then(V),q(),(0,j.pt)(K)]),authPhoneNumber:()=>Promise.all([V(),(0,j.pt)(Q)]),authCode:()=>(0,j.pt)(J),authPassword:()=>(0,j.pt)(J),authQrCode:V},X=(0,t.c$)((e=>{const t=(0,h.Pu)(e),{background:n,backgroundColor:r}=e.settings.themes[t]||{};return{shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,uiReadyState:e.uiReadyState,hasCustomBackground:Boolean(n),hasCustomBackgroundColor:Boolean(r),isRightColumnShown:(0,h.Jf)(e),leftColumnWidth:e.leftColumnWidth}}))((e=>{let{page:n,children:r,hasCustomBackground:o,hasCustomBackgroundColor:d,isRightColumnShown:a,shouldSkipHistoryAnimations:u,leftColumnWidth:s}=e;const{setIsUiReady:i}=(0,t.uC)(),[l,f]=(0,D.Z)(),{shouldRender:h,transitionClassNames:m}=(0,U.Z)(!l,void 0,!0);return(0,R.d4)((()=>{let e;return Promise.race([(0,c.wO)(700),(async()=>{try{await Y[n]()}catch(e){}})()]).then((()=>{f(),i({uiReadyState:1}),e=window.setTimeout((()=>{i({uiReadyState:2})}),1e3)})),()=>{e&&(clearTimeout(e),e=void 0),i({uiReadyState:0})}}),[]),R.ZP.createElement("div",{id:"UiLoader"},r,h&&!u&&R.ZP.createElement("div",{className:(0,z.Z)("mask",m)},"main"===n?R.ZP.createElement(R.ZP.Fragment,null,R.ZP.createElement("div",{className:"left",style:s?`width: ${s}px`:void 0}),R.ZP.createElement("div",{className:(0,z.Z)("middle",o&&"custom-bg-image",d&&"custom-bg-color",a&&"with-right-column")}),a&&R.ZP.createElement("div",{className:"right"})):R.ZP.createElement("div",{className:"blank"})))}));var ee=s(6272),te=s(711),ne=s(9107);const re=(e,t)=>{const[n,r]=(0,R.eJ)();return e&&te.Pn(e,t).then(r),n};function oe(){let e=navigator.language;return e&&"pt-br"!==e&&(e=e.substr(0,2)),e}var de=s(231),ae=s(4605),ue=s(7687),se=s(4288),ie=s(5765),ce=s(2340),le=s(4284),fe=s(9290),he=s(3106),me=s(8964),pe=s(9204);const ge=200+e.fK,ve=(0,R.X$)((0,t.c$)((e=>{const{countryList:{phoneCodes:t}}=e;return{phoneCodeList:t}}))((e=>{let{id:t,value:n,isLoading:r,onChange:o,phoneCodeList:d}=e;const a=(0,ne.Z)(),u=(0,R.sO)(null),[s,i]=(0,R.eJ)(),[c,l]=(0,R.eJ)([]),f=(0,R.I4)((e=>{i(e),l(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t.length)return e;const n=(0,ie.W)(t);return e.filter((e=>n(e.defaultName)||e.name&&n(e.name)))}(d,e))}),[d]);(0,fe.Z)((e=>{let[t]=e;0===(null==t?void 0:t.length)&&d.length>0&&f(s)}),[d,f]);const h=(0,R.I4)((e=>{o(e),setTimeout((()=>f(void 0)),ge)}),[o,f]),m=(0,R.I4)((e=>{f(e.currentTarget.value)}),[f]),p=(0,R.I4)((e=>{if(8!==e.keyCode)return;const t=e.currentTarget;n&&void 0===s&&(t.value=""),f(t.value)}),[s,f,n]);return R.ZP.createElement(he.Z,{className:"CountryCodeInput",trigger:e=>{let{onTrigger:o,isOpen:d}=e;const i=()=>{if(d)return;setTimeout((()=>{u.current.select()}),50),o();const e=document.getElementById("auth-phone-number-form");e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},c=null!=s?s:(null==n?void 0:n.name)||(null==n?void 0:n.defaultName)||"";return R.ZP.createElement("div",{className:(0,z.Z)("input-group",n&&"touched")},R.ZP.createElement("input",{ref:u,className:(0,z.Z)("form-control",d&&"focus"),type:"text",id:t,value:c,autoComplete:"off",onClick:i,onFocus:i,onInput:e=>{m(e),i()},onKeyDown:p}),R.ZP.createElement("label",null,a("Login.SelectCountry.Title")),r?R.ZP.createElement(pe.Z,{color:"black"}):R.ZP.createElement("i",{onClick:i,className:(0,z.Z)("css-icon-down",d&&"open")}))}},c.map((e=>R.ZP.createElement(me.Z,{key:e.iso2,className:n&&e.iso2===n.iso2?"selected":"",onClick:()=>h(e)},R.ZP.createElement("span",{className:"country-flag"},(0,ce.Z)((0,le.Wg)(e.iso2),["hq_emoji"])),R.ZP.createElement("span",{className:"country-name"},e.name||e.defaultName),R.ZP.createElement("span",{className:"country-code"},e.countryCode)))),!c.length&&R.ZP.createElement(me.Z,{key:"no-results",className:"no-results",disabled:!0},R.ZP.createElement("span",null,a("lng_country_none"))))})));let ye=!1;const be=(0,R.X$)((0,t.c$)((e=>{const{settings:{byKey:{language:t}},countryList:{phoneCodes:n}}=e;return{...(0,f.ei)(e,["connectionState","authState","authPhoneNumber","authIsLoading","authIsLoadingQrCode","authError","authRememberMe","authNearestCountry"]),language:t,phoneCodeList:n}}))((e=>{let{connectionState:r,authState:o,authPhoneNumber:d,authIsLoading:a,authIsLoadingQrCode:u,authError:s,authRememberMe:i,authNearestCountry:c,phoneCodeList:l,language:f}=e;const{setAuthPhoneNumber:h,setAuthRememberMe:m,loadNearestCountry:p,loadCountryList:g,clearAuthError:v,goToAuthQrCode:y,setSettingOption:b}=(0,t.uC)(),I=(0,ne.Z)(),w=(0,R.sO)(null),C=oe(),S=re(C,"ContinueOnThisLanguage"),[E,P]=(0,R.eJ)(),[M,A]=(0,R.eJ)(),[k,T]=(0,R.eJ)(!1),[N,L]=(0,R.eJ)(),[F,x,B]=(0,D.Z)(),O=E?`+${E.countryCode} ${M||""}`:M,Z=O&&O.replace(/[^\d]+/g,"").length>=7;(0,R.d4)((()=>{n.$b||w.current.focus()}),[E]),(0,R.d4)((()=>{"connectionStateReady"!==r||c||p()}),[r,c,p]),(0,R.d4)((()=>{"connectionStateReady"===r&&g({langCode:f})}),[r,f,g]),(0,R.d4)((()=>{c&&l&&!E&&!k&&P((0,ee.U9)(l,c)[0])}),[E,c,k,l]);const _=(0,R.I4)((e=>{e.length||A("");const t=l&&(0,ee.g3)(l,e),n=!E||t&&t.iso2!==E.iso2||!t&&e.length?t:E;(!E||!n||n&&n.iso2!==E.iso2)&&P(n),A((0,ee.un)(e,n))}),[l,E]),$=(0,R.I4)((()=>{x(),(0,te.m0)(C,(()=>{B(),b({language:C})}))}),[x,b,C,B]);(0,R.d4)((()=>{void 0===M&&d&&_(d)}),[d,M,_]),(0,R.bt)((()=>{w.current&&N&&w.current.setSelectionRange(...N)}),[N]);const U=(0,R.sO)(!1),W=(0,R.I4)((()=>{U.current=!0,requestAnimationFrame((()=>{U.current=!1}))}),[]),G=(0,R.I4)((e=>{P(e),A("")}),[]),H=(0,R.I4)((e=>{s&&v(),ye||(ye=!0,V(),(0,j.pt)(J));const{value:t,selectionStart:r,selectionEnd:o}=e.target;L(r&&o&&o1&&!U.current;_(d?`${E.countryCode} ${t}`:t)}),[s,v,E,O,_]),z=(0,R.I4)((e=>{m(e.target.checked)}),[m]),Q="authorizationStateWaitPhoneNumber"===o;return R.ZP.createElement("div",{id:"auth-phone-number-form",className:"custom-scroll"},R.ZP.createElement("div",{className:"auth-form"},R.ZP.createElement("div",{id:"logo"}),R.ZP.createElement("h2",null,"Telegram"),R.ZP.createElement("p",{className:"note"},I("StartText")),R.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),a||Z&&h({phoneNumber:O})}},R.ZP.createElement(ve,{id:"sign-in-phone-code",value:E,isLoading:!c&&!E,onChange:G}),R.ZP.createElement(ue.Z,{ref:w,id:"sign-in-phone-number",label:I("Login.PhonePlaceholder"),value:O,error:s&&I(s),inputMode:"tel",onChange:H,onPaste:n.s$?W:void 0}),R.ZP.createElement(ae.Z,{id:"sign-in-keep-session",label:"Keep me signed in",checked:Boolean(i),onChange:z}),Z&&(Q?R.ZP.createElement(de.Z,{type:"submit",ripple:!0,isLoading:a},I("Login.Next")):R.ZP.createElement(se.Z,null)),Q&&R.ZP.createElement(de.Z,{isText:!0,ripple:!0,isLoading:u,onClick:y},I("Login.QR.Login")),C&&C!==f&&S&&R.ZP.createElement(de.Z,{isText:!0,isLoading:F,onClick:$},S))))})));var Ie=s(8778);const we=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Auth,"AuthCode");return e?R.ZP.createElement(e,null):R.ZP.createElement(se.Z,null)})),Ce=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Auth,"AuthPassword");return e?R.ZP.createElement(e,null):R.ZP.createElement(se.Z,null)})),Se=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Auth,"AuthRegister");return e?R.ZP.createElement(e,null):R.ZP.createElement(se.Z,null)}));let Ee=null;class Pe{}Pe.render=function(e,t){Ee(e,t)},self.QrCreator=Pe,function(e){function t(t,n,r,o){var d={},a=e(r,n);a.u(t),a.J(),o=o||0;var u=a.h(),s=a.h()+2*o;return d.text=t,d.level=n,d.version=r,d.O=s,d.a=function(e,t){return t-=o,!(0>(e-=o)||e>=u||0>t||t>=u)&&a.a(e,t)},d}function n(e,t,n,r,o,d,a,u,s,i){function c(t,n,r,o,a,u,s){t?(e.lineTo(n+u,r+s),e.arcTo(n,r,o,a,d)):e.lineTo(n,r)}a?e.moveTo(t+d,n):e.moveTo(t,n),c(u,r,n,r,o,-d,0),c(s,r,o,t,o,0,-d),c(i,t,o,t,n,d,0),c(a,t,n,r,n,0,d)}function r(e,t,n,r,o,d,a,u,s,i){function c(t,n,r,o){e.moveTo(t+r,n),e.lineTo(t,n),e.lineTo(t,n+o),e.arcTo(t,n,t+r,n,d)}a&&c(t,n,d,d),u&&c(r,n,-d,d),s&&c(r,o,-d,-d),i&&c(t,o,d,-d)}function o(e,o){e:{var d=o.text,a=o.v,u=o.N,s=o.K,i=o.P;for(u=Math.max(1,u||1),s=Math.min(40,s||40);u<=s;u+=1)try{var c=t(d,a,u,i);break e}catch(e){}c=void 0}if(!c)return null;for(d=e.getContext("2d"),o.background&&(d.fillStyle=o.background,d.fillRect(o.left,o.top,o.size,o.size)),a=c.O,s=o.size/a,d.beginPath(),i=0;iMath.round(e*t.size))),"linear-gradient"===r)var d=e.createLinearGradient.apply(e,n);else{if("radial-gradient"!==r)throw Error("Unsupported fill");d=e.createRadialGradient.apply(e,n)}o.forEach((([e,t])=>{d.addColorStop(e,t)})),e.fillStyle=d}}(d,o),d.fill(),e}var d={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};Ee=function(e,t){var n={};Object.assign(n,d,e),n.N=n.minVersion,n.K=n.maxVersion,n.v=n.ecLevel,n.left=n.left,n.top=n.top,n.size=n.size,n.fill=n.fill,n.background=n.background,n.text=n.text,n.R=n.radius,n.P=n.quiet,t instanceof HTMLCanvasElement?(t.width===n.size&&t.height===n.size||(t.width=n.size,t.height=n.size),t.getContext("2d").clearRect(0,0,t.width,t.height),o(t,n)):((e=document.createElement("canvas")).width=n.size,e.height=n.size,n=o(e,n),t.appendChild(n))}}(function(){function e(o,a){function u(e,t){for(var n=-1;7>=n;n+=1)if(!(-1>=e+n||l<=e+n))for(var r=-1;7>=r;r+=1)-1>=t+r||l<=t+r||(c[e+n][t+r]=0<=n&&6>=n&&(0==r||6==r)||0<=r&&6>=r&&(0==n||6==n)||2<=n&&4>=n&&2<=r&&4>=r)}function s(e,n){for(var a=l=4*o+17,s=Array(a),m=0;m=v;v+=1)for(var y=-2;2>=y;y+=1)c[p+v][g+y]=-2==v||2==v||-2==y||2==y||0==v&&0==y}for(a=8;as;s+=1)m=!e&&1==(a>>s&1),c[6>s?s:8>s?s+1:l-15+s][8]=m,c[8][8>s?l-s-1:9>s?15-s:14-s]=m;if(c[l-8][8]=!e,7<=o){for(a=r.A(o),s=0;18>s;s+=1)m=!e&&1==(a>>s&1),c[Math.floor(s/3)][s%3+l-8-3]=m;for(s=0;18>s;s+=1)m=!e&&1==(a>>s&1),c[s%3+l-8-3][Math.floor(s/3)]=m}if(null==f){for(e=d.I(o,i),a=function(){var e=[],t=0,n={B:function(){return e},c:function(t){return 1==(e[Math.floor(t/8)]>>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},f:function(){return t},m:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n}(),s=0;s8*m)throw Error("code length overflow. ("+a.f()+">"+8*m+")");for(a.f()+4<=8*m&&a.put(0,4);0!=a.f()%8;)a.m(!1);for(;!(a.f()>=8*m||(a.put(236,8),a.f()>=8*m));)a.put(17,8);var b=0;for(m=s=0,p=Array(e.length),g=Array(e.length),v=0;vv;v+=1)null==c[s][g-v]&&(y=!1,p>>m&1)),n(s,g-v)&&(y=!y),c[s][g-v]=y,-1==--m&&(p+=1,m=7));if(0>(s+=a)||l<=s){s-=a,a=-a;break}}}var i=n[a],c=null,l=0,f=null,h=[],m={u:function(t){t=function(t){var n=e.s(t);return{S:function(){return 4},b:function(){return n.length},write:function(e){for(var t=0;te||l<=e||0>t||l<=t)throw Error(e+","+t);return c[e][t]},h:function(){return l},J:function(){for(var e=0,t=0,n=0;8>n;n+=1){s(!0,n);var o=r.D(m);(0==n||e>o)&&(e=o,t=n)}s(!1,t)}};return m}function t(e,n){if(void 0===e.length)throw Error(e.length+"/"+n);var r=function(){for(var t=0;td.b()-e.b())return d;for(var n=o.g(d.c(0))-o.g(e.c(0)),r=Array(d.b()),a=0;ar?t.push(r):2048>r?t.push(192|r>>6,128|63&r):55296>r||57344<=r?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t};var n={L:1,M:0,Q:3,H:2},r=function(){function e(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t}var n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r={w:function(t){for(var n=t<<10;0<=e(n)-e(1335);)n^=1335<t||40t?8:16},D:function(e){for(var t=e.h(),n=0,r=0;r=u;u+=1)if(!(0>r+u||t<=r+u))for(var s=-1;1>=s;s+=1)0>o+s||t<=o+s||(0!=u||0!=s)&&a==e.a(r+u,o+s)&&(d+=1);5n;n+=1)e[n]=1<n;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;255>n;n+=1)t[e[n]]=n;return{g:function(e){if(1>e)throw Error("glog("+e+")");return t[e]},i:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return e[t]}}}(),d=function(){function e(e,r){switch(r){case n.L:return t[4*(e-1)];case n.M:return t[4*(e-1)+1];case n.Q:return t[4*(e-1)+2];case n.H:return t[4*(e-1)+3]}}var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r={I:function(t,n){var r=e(t,n);if(void 0===r)throw Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+n);t=r.length/3,n=[];for(var o=0;o{const{connectionState:t,authState:n,authQrCode:r,settings:{byKey:{language:o}}}=e;return{connectionState:t,authState:n,authQrCode:r,language:o}}))((n=>{let{connectionState:r,authState:o,authQrCode:d,language:a}=n;const{returnToAuthPhoneNumber:u,setSettingOption:s}=(0,t.uC)(),i=oe(),c=(0,ne.Z)(),l=(0,R.sO)(null),f=re(i,"ContinueOnThisLanguage"),[h,m,p]=(0,D.Z)();(0,R.d4)((()=>{if(!d||"connectionStateReady"!==r)return;const e=l.current;e.innerHTML="",e.classList.remove("pre-animate"),Me.render({text:`tg://login?token=${d.token}`,radius:.5,ecLevel:"M",fill:"#4E96D4",size:280},e)}),[r,d]),(0,R.d4)((()=>{"connectionStateReady"===r&&(0,te.m0)(e.sR)}),[r]);const g=(0,R.I4)((()=>{m(),(0,te.m0)(i,(()=>{p(),s({language:i})}))}),[m,s,i,p]),v="authorizationStateWaitQrCode"===o;return R.ZP.createElement("div",{id:"auth-qr-form",className:"custom-scroll"},R.ZP.createElement("div",{className:"auth-form qr"},d?R.ZP.createElement("div",{key:"qr-container",className:"qr-container pre-animate",ref:l}):R.ZP.createElement("div",{key:"qr-loading",className:"qr-loading"},R.ZP.createElement(se.Z,null)),R.ZP.createElement("h3",null,c("Login.QR.Title")),R.ZP.createElement("ol",null,R.ZP.createElement("li",null,R.ZP.createElement("span",null,c("Login.QR.Help1"))),R.ZP.createElement("li",null,R.ZP.createElement("span",null,(0,ce.Z)(c("Login.QR.Help2"),["simple_markdown"]))),R.ZP.createElement("li",null,R.ZP.createElement("span",null,c("Login.QR.Help3")))),v&&R.ZP.createElement(de.Z,{isText:!0,onClick:u},c("Login.QR.Cancel")),i&&i!==a&&f&&R.ZP.createElement(de.Z,{isText:!0,isLoading:h,onClick:g},f)))}))),ke=(0,R.X$)((0,t.c$)((e=>(0,f.ei)(e,["authState"])))((e=>{let{authState:r}=e;const{reset:o,initApi:d,returnToAuthPhoneNumber:a,goToAuthQrCode:u}=(0,t.uC)();(0,R.d4)((()=>{o(),d()}),[o,d]);const s="iOS"===n.Lt||"Android"===n.Lt;switch((0,_.ZP)(!s&&"authorizationStateWaitPhoneNumber"===r||s&&"authorizationStateWaitQrCode"===r,(()=>{s?a():u()})),(0,R.d4)((()=>(F.Z.disableRefresh(),()=>{F.Z.enableRefresh()})),[]),r){case"authorizationStateWaitCode":return R.ZP.createElement(X,{page:"authCode",key:"authCode"},R.ZP.createElement(we,null));case"authorizationStateWaitPassword":return R.ZP.createElement(X,{page:"authPassword",key:"authPassword"},R.ZP.createElement(Ce,null));case"authorizationStateWaitRegistration":return R.ZP.createElement(Se,null);case"authorizationStateWaitPhoneNumber":return R.ZP.createElement(X,{page:"authPhoneNumber",key:"authPhoneNumber"},R.ZP.createElement(be,null));case"authorizationStateWaitQrCode":return R.ZP.createElement(X,{page:"authQrCode",key:"authQrCode"},R.ZP.createElement(Ae,null));default:return s?R.ZP.createElement(X,{page:"authPhoneNumber",key:"authPhoneNumber"},R.ZP.createElement(be,null)):R.ZP.createElement(X,{page:"authQrCode",key:"authQrCode"},R.ZP.createElement(Ae,null))}}))),Te=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Main,"Main");return e?R.ZP.createElement(e,null):void 0}));var Ne=s(5359);const Le=()=>R.ZP.createElement("div",{id:"AppInactive"},R.ZP.createElement("div",{className:"content"},R.ZP.createElement("img",{src:Ne,alt:""}),R.ZP.createElement("h3",{className:"title"},"Such error, many tabs"),R.ZP.createElement("div",{className:"description"},"Telegram supports only one active tab with the app.",R.ZP.createElement("br",null),"Please reload this page to continue using this tab or close it."),R.ZP.createElement("div",{className:"actions"},R.ZP.createElement(de.Z,{isText:!0,ripple:!0,onClick:()=>{window.location.reload()}},"Reload app"))));function Re(){return t.ZP.createElement(X,{page:"main",key:"main"},t.ZP.createElement(Te,null))}const Fe=(0,t.c$)((e=>(0,f.ei)(e,["authState"])))((n=>{let{authState:r}=n;const{disconnect:o}=(0,t.uC)(),[d,a]=(0,D.Z)(!1);if((0,R.d4)((()=>{(0,F.z)(),O=()=>{o(),document.title=`${e.Ti}${e.ou}`,a()}}),[o,a]),d)return t.ZP.createElement(Le,null);if(r)switch(r){case"authorizationStateWaitPhoneNumber":case"authorizationStateWaitCode":case"authorizationStateWaitPassword":case"authorizationStateWaitRegistration":case"authorizationStateWaitQrCode":return t.ZP.createElement(ke,null);case"authorizationStateClosed":case"authorizationStateClosing":case"authorizationStateLoggingOut":case"authorizationStateReady":return Re()}return(0,m.ti)(!0)?Re():t.ZP.createElement(ke,null)}));e.eM&&console.log(">>> INIT"),(0,t.uC)().init(),e.eM&&console.log(">>> START INITIAL RENDER"),a.Z.render(t.ZP.createElement(Fe,null),document.getElementById("root")),e.eM&&console.log(">>> FINISH INITIAL RENDER"),document.addEventListener("dblclick",(()=>{console.warn("GLOBAL STATE",(0,t.Rd)())}))})()})(); +//# sourceMappingURL=main.1a136550b3ba581f7752.js.map \ No newline at end of file diff --git a/dist/main.1a136550b3ba581f7752.js.map b/dist/main.1a136550b3ba581f7752.js.map new file mode 100644 index 00000000..e8904c86 --- /dev/null +++ b/dist/main.1a136550b3ba581f7752.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.1a136550b3ba581f7752.js","mappings":"uBACIA,EADAC,ECAAC,EACAC,ECwCAC,EASAC,E,wFC/BJ,IAAIC,EACJ,MAAMC,EAAgB,IAAIC,IACpBC,EAA0B,IAAID,IAI7B,SAASE,EAAQC,EAAuBC,GAe7C,OAdKN,IACCO,EAAAA,IAEFC,QAAQC,IAAI,yBAGdT,EAAS,IAAIU,OAAO,IAAIC,IAAI,mBAsEhC,SAA2BN,GACzBL,EAAOY,iBAAiB,WAAW,IAAkC,IAAjC,KAAEC,GAA+B,EACnE,GAAkB,WAAdA,EAAKC,KACPT,EAASQ,EAAKE,aACT,GAAkB,mBAAdF,EAAKC,KAA2B,CACzC,MAAME,EAAef,EAAcgB,IAAIJ,EAAKK,WACxCF,IACEH,EAAKM,MACPH,EAAaI,OAAOP,EAAKM,OAEzBH,EAAaK,QAAQR,EAAKS,gBAGzB,GAAkB,mBAAdT,EAAKC,KAA2B,SACzC,UAAAb,EAAc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ACA1wF,SAASX,MAAS,GAAEgX,EAAAA,KAAaC,EAAAA,KAEjCq6E,OAED,CAACD,EAAYC,IAIZ9mC,EACF,OAAO,mBAAC,GAAD,MAGT,GAAInwB,EACF,OAAQA,GACN,IAAK,oCACL,IAAK,6BACL,IAAK,iCACL,IAAK,qCACL,IAAK,+BACH,OAAO,mBAAC,GAAD,MACT,IAAK,2BACL,IAAK,4BACL,IAAK,+BACL,IAAK,0BACH,OAAO+2D,KAIb,OAAO9W,EAAAA,EAAAA,KAAiB,GAAQ8W,KAAe,mBAAC,GAAD,SC3C7C55F,EAAAA,IAEFC,QAAQC,IAAI,aAGduH,EAAAA,EAAAA,MAAci1B,OAEV18B,EAAAA,IAEFC,QAAQC,IAAI,4BAGd65F,EAAAA,EAAAA,OACE,mBAAC,GAAD,MACA5wF,SAASiqF,eAAe,SAGtBpzF,EAAAA,IAEFC,QAAQC,IAAI,6BAGdiJ,SAAS9I,iBAAiB,YAAY,KAEpCJ,QAAQ4B,KAAK,gBAAgBo4B,EAAAA,EAAAA,W","sources":["webpack://telegram-t/webpack/runtime/create fake namespace object","webpack://telegram-t/webpack/runtime/load script","webpack://telegram-t/webpack/runtime/css loading","webpack://telegram-t/./src/api/gramjs/worker/provider.ts","webpack://telegram-t/./src/api/types/media.ts","webpack://telegram-t/./src/api/types/messages.ts","webpack://telegram-t/./src/lib/punycode.js","webpack://telegram-t/./src/components/common/SafeLink.tsx","webpack://telegram-t/./src/components/common/helpers/documentInfo.ts","webpack://telegram-t/./src/components/common/helpers/parseEmojiOnlyString.ts","webpack://telegram-t/./src/components/common/UserLink.tsx","webpack://telegram-t/./src/components/common/MessageLink.tsx","webpack://telegram-t/./src/components/common/ChatLink.tsx","webpack://telegram-t/./src/components/common/GroupCallLink.tsx","webpack://telegram-t/./src/components/common/helpers/renderActionMessageText.tsx","webpack://telegram-t/./src/components/common/helpers/renderMessageText.ts","webpack://telegram-t/./src/components/common/helpers/renderText.tsx","webpack://telegram-t/./src/components/common/spoiler/Spoiler.tsx","webpack://telegram-t/./src/components/common/helpers/renderTextWithEntities.tsx","webpack://telegram-t/./src/components/middle/helpers/preventMessageInputBlur.ts","webpack://telegram-t/./src/components/middle/message/MentionLink.tsx","webpack://telegram-t/./src/components/ui/Button.tsx","webpack://telegram-t/./src/components/ui/Checkbox.tsx","webpack://telegram-t/./src/components/ui/DropdownMenu.tsx","webpack://telegram-t/./src/components/ui/InputText.tsx","webpack://telegram-t/./src/components/ui/Link.tsx","webpack://telegram-t/./src/components/ui/Loading.tsx","webpack://telegram-t/./src/components/ui/Menu.tsx","webpack://telegram-t/./src/components/ui/MenuItem.tsx","webpack://telegram-t/./src/components/ui/RippleEffect.tsx","webpack://telegram-t/./src/components/ui/Spinner.tsx","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/hooks/useEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useFlag.ts","webpack://telegram-t/./src/hooks/useForceUpdate.ts","webpack://telegram-t/./src/hooks/useHeavyAnimationCheck.ts","webpack://telegram-t/./src/hooks/useHistoryBack.ts","webpack://telegram-t/./src/hooks/useKeyboardListNavigation.ts","webpack://telegram-t/./src/hooks/useLang.ts","webpack://telegram-t/./src/hooks/useModuleLoader.ts","webpack://telegram-t/./src/hooks/useOnChange.ts","webpack://telegram-t/./src/hooks/usePrevious.ts","webpack://telegram-t/./src/hooks/useShowTransition.ts","webpack://telegram-t/./src/hooks/useVirtualBackdrop.ts","webpack://telegram-t/./src/lib/teact/dom-events.ts","webpack://telegram-t/./src/lib/teact/teact-dom.ts","webpack://telegram-t/./src/lib/teact/teact.ts","webpack://telegram-t/./src/lib/teact/teactn.tsx","webpack://telegram-t/./src/lib/twemojiRegex.js","webpack://telegram-t/./src/modules/actions/api/initial.ts","webpack://telegram-t/./src/modules/actions/api/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/initial.ts","webpack://telegram-t/./src/modules/actions/ui/initial.ts","webpack://telegram-t/./src/modules/actions/ui/settings.ts","webpack://telegram-t/./src/modules/helpers/chats.ts","webpack://telegram-t/./src/modules/helpers/messages.ts","webpack://telegram-t/./src/modules/helpers/messageSummary.ts","webpack://telegram-t/./src/modules/helpers/messageMedia.ts","webpack://telegram-t/./src/modules/helpers/localSearch.ts","webpack://telegram-t/./src/modules/helpers/payments.ts","webpack://telegram-t/./src/modules/helpers/reactions.ts","webpack://telegram-t/./src/modules/helpers/users.ts","webpack://telegram-t/./src/modules/reducers/chats.ts","webpack://telegram-t/./src/modules/reducers/symbols.ts","webpack://telegram-t/./src/modules/reducers/users.ts","webpack://telegram-t/./src/modules/reducers/globalSearch.ts","webpack://telegram-t/./src/modules/reducers/localSearch.ts","webpack://telegram-t/./src/modules/reducers/management.ts","webpack://telegram-t/./src/modules/reducers/settings.ts","webpack://telegram-t/./src/modules/reducers/twoFaSettings.ts","webpack://telegram-t/./src/modules/reducers/payments.ts","webpack://telegram-t/./src/modules/reducers/messages.ts","webpack://telegram-t/./src/modules/selectors/chats.ts","webpack://telegram-t/./src/modules/selectors/symbols.ts","webpack://telegram-t/./src/modules/selectors/messages.ts","webpack://telegram-t/./src/modules/selectors/localSearch.ts","webpack://telegram-t/./src/modules/selectors/management.ts","webpack://telegram-t/./src/modules/selectors/ui.ts","webpack://telegram-t/./src/modules/selectors/globalSearch.ts","webpack://telegram-t/./src/modules/selectors/payments.ts","webpack://telegram-t/./src/modules/selectors/settings.ts","webpack://telegram-t/./src/modules/selectors/users.ts","webpack://telegram-t/./src/types/index.ts","webpack://telegram-t/./src/util/animation.ts","webpack://telegram-t/./src/util/appBadge.ts","webpack://telegram-t/./src/util/arePropsShallowEqual.ts","webpack://telegram-t/./src/util/buildClassName.ts","webpack://telegram-t/./src/util/cacheApi.ts","webpack://telegram-t/./src/util/callbacks.ts","webpack://telegram-t/./src/util/captureEscKeyListener.ts","webpack://telegram-t/./src/util/captureKeyboardListeners.ts","webpack://telegram-t/./src/util/dateFormat.ts","webpack://telegram-t/./src/util/emoji.ts","webpack://telegram-t/./src/util/ensureProtocol.ts","webpack://telegram-t/./src/util/environmentWebp.ts","webpack://telegram-t/./src/util/environmentSystemTheme.ts","webpack://telegram-t/./src/util/environment.ts","webpack://telegram-t/./src/util/files.ts","webpack://telegram-t/./src/util/folderManager.ts","webpack://telegram-t/./src/util/formatCurrency.ts","webpack://telegram-t/./src/util/generateIdFor.ts","webpack://telegram-t/./src/util/getReadableErrorText.ts","webpack://telegram-t/./src/util/handleError.ts","webpack://telegram-t/./src/util/iteratees.ts","webpack://telegram-t/./src/util/langProvider.ts","webpack://telegram-t/./src/util/oggToWav.ts","webpack://telegram-t/./src/util/mediaLoader.ts","webpack://telegram-t/./src/util/memo.ts","webpack://telegram-t/./src/util/moduleLoader.ts","webpack://telegram-t/./src/util/notifications.ts","webpack://telegram-t/./src/util/permanentWebVersion.ts","webpack://telegram-t/./src/util/phoneNumber.ts","webpack://telegram-t/./src/util/routing.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/util/searchWords.ts","webpack://telegram-t/./src/util/serverTime.ts","webpack://telegram-t/./node_modules/idb-keyval/dist/index.js","webpack://telegram-t/./node_modules/safari-14-idb-fix/dist/index.js","webpack://telegram-t/./src/util/sessions.ts","webpack://telegram-t/./src/util/switchTheme.ts","webpack://telegram-t/./src/util/textFormat.ts","webpack://telegram-t/./src/util/trimText.ts","webpack://telegram-t/./src/util/webpToPng.ts","webpack://telegram-t/./src/util/websync.ts","webpack://telegram-t/./src/util/windowSize.ts","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/compat get default export","webpack://telegram-t/webpack/runtime/define property getters","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/make namespace object","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/jsonp chunk loading","webpack://telegram-t/./src/util/setupServiceWorker.ts","webpack://telegram-t/./src/global/initial.ts","webpack://telegram-t/./src/global/cache.ts","webpack://telegram-t/./src/global/index.ts","webpack://telegram-t/./src/util/activeTabMonitor.ts","webpack://telegram-t/./src/util/fonts.ts","webpack://telegram-t/./src/components/common/UiLoader.tsx","webpack://telegram-t/./src/hooks/useLangString.ts","webpack://telegram-t/./src/components/auth/helpers/getSuggestedLanguage.ts","webpack://telegram-t/./src/components/auth/CountryCodeInput.tsx","webpack://telegram-t/./src/components/auth/AuthPhoneNumber.tsx","webpack://telegram-t/./src/components/auth/AuthCode.async.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.async.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.async.tsx","webpack://telegram-t/./node_modules/qr-creator/dist/qr-creator.es6.min.js","webpack://telegram-t/./src/components/auth/AuthQrCode.tsx","webpack://telegram-t/./src/components/auth/Auth.tsx","webpack://telegram-t/./src/components/main/Main.async.tsx","webpack://telegram-t/./src/components/main/AppInactive.tsx","webpack://telegram-t/./src/App.tsx","webpack://telegram-t/./src/index.tsx"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"telegram-t:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var createStylesheet = (chunkId, fullhref, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"47\":1,\"133\":1,\"176\":1,\"347\":1,\"472\":1,\"687\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","import { Api } from '../../../lib/gramjs';\nimport { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';\nimport { Methods, MethodArgs, MethodResponse } from '../methods/types';\nimport { WorkerMessageEvent, OriginRequest } from './types';\n\nimport { DEBUG } from '../../../config';\nimport generateIdFor from '../../../util/generateIdFor';\nimport { pause } from '../../../util/schedulers';\n\ntype RequestStates = {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback?: AnyToVoidFunction;\n};\n\nconst HEALTH_CHECK_TIMEOUT = 150;\nconst HEALTH_CHECK_MIN_DELAY = 5 * 1000; // 5 sec\n\nlet worker: Worker;\nconst requestStates = new Map();\nconst requestStatesByCallback = new Map();\n\n// TODO Re-use `util/WorkerConnector.ts`\n\nexport function initApi(onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD WORKER');\n }\n\n worker = new Worker(new URL('./worker.ts', import.meta.url));\n subscribeToWorker(onUpdate);\n\n if (initialArgs.platform === 'iOS') {\n setupIosHealthCheck();\n }\n }\n\n return makeRequest({\n type: 'initApi',\n args: [initialArgs],\n });\n}\n\nexport function callApi(fnName: T, ...args: MethodArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('API is not initialized');\n }\n\n return undefined;\n }\n\n const promise = makeRequest({\n type: 'callMethod',\n name: fnName,\n args,\n });\n\n // Some TypeScript magic to make sure `VirtualClass` is never returned from any method\n if (DEBUG) {\n (async () => {\n try {\n type ForbiddenTypes =\n Api.VirtualClass\n | (Api.VirtualClass | undefined)[];\n type ForbiddenResponses =\n ForbiddenTypes\n | (AnyLiteral & { [k: string]: ForbiddenTypes });\n\n // Unwrap all chained promises\n const response = await promise;\n // Make sure responses do not include `VirtualClass` instances\n const allowedResponse: Exclude = response;\n // Suppress \"unused variable\" constraint\n void allowedResponse;\n } catch (err) {\n // Do noting\n }\n })();\n }\n\n return promise as MethodResponse;\n}\n\nexport function cancelApiProgress(progressCallback: ApiOnProgress) {\n progressCallback.isCanceled = true;\n\n const { messageId } = requestStatesByCallback.get(progressCallback) || {};\n if (!messageId) {\n return;\n }\n\n worker.postMessage({\n type: 'cancelProgress',\n messageId,\n });\n}\n\nfunction subscribeToWorker(onUpdate: OnApiUpdate) {\n worker.addEventListener('message', ({ data }: WorkerMessageEvent) => {\n if (data.type === 'update') {\n onUpdate(data.update);\n } else if (data.type === 'methodResponse') {\n const requestState = requestStates.get(data.messageId);\n if (requestState) {\n if (data.error) {\n requestState.reject(data.error);\n } else {\n requestState.resolve(data.response);\n }\n }\n } else if (data.type === 'methodCallback') {\n requestStates.get(data.messageId)?.callback?.(...data.callbackArgs);\n } else if (data.type === 'unhandledError') {\n throw new Error(data.error?.message);\n }\n });\n}\n\nfunction makeRequest(message: OriginRequest) {\n const messageId = generateIdFor(requestStates);\n const payload: OriginRequest = {\n messageId,\n ...message,\n };\n\n const requestState = { messageId } as RequestStates;\n\n // Re-wrap type because of `postMessage`\n const promise: Promise> = new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n });\n\n if (('args' in payload) && typeof payload.args[1] === 'function') {\n const callback = payload.args.pop() as AnyToVoidFunction;\n requestState.callback = callback;\n requestStatesByCallback.set(callback, requestState);\n }\n\n requestStates.set(messageId, requestState);\n\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n\n if (requestState.callback) {\n requestStatesByCallback.delete(requestState.callback);\n }\n });\n\n worker.postMessage(payload);\n\n return promise;\n}\n\nconst startedAt = Date.now();\n\n// Workaround for iOS sometimes stops interacting with worker\nfunction setupIosHealthCheck() {\n window.addEventListener('focus', () => {\n void ensureWorkerPing();\n // Sometimes a single check is not enough\n setTimeout(() => ensureWorkerPing(), 1000);\n });\n}\n\nasync function ensureWorkerPing() {\n try {\n await Promise.race([\n makeRequest({ type: 'ping' }),\n pause(HEALTH_CHECK_TIMEOUT).then(() => Promise.reject(new Error('HEALTH_CHECK_TIMEOUT'))),\n ]);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (Date.now() - startedAt >= HEALTH_CHECK_MIN_DELAY) {\n window.location.reload();\n }\n }\n}\n","// We cache avatars as Data URI for faster initial load\n// and messages media as Blob for smaller size.\n\nexport enum ApiMediaFormat {\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | ArrayBuffer;\nexport type ApiPreparedMedia = string;\n","import { ApiGroupCall } from './calls';\n\nexport interface ApiDimensions {\n width: number;\n height: number;\n}\n\nexport interface ApiPhotoSize extends ApiDimensions {\n type: 's' | 'm' | 'x' | 'y' | 'z';\n}\n\nexport interface ApiThumbnail extends ApiDimensions {\n dataUri: string;\n}\n\nexport interface ApiPhoto {\n id: string;\n thumbnail?: ApiThumbnail;\n sizes: ApiPhotoSize[];\n blobUrl?: string;\n}\n\nexport interface ApiSticker {\n id: string;\n stickerSetId: string;\n stickerSetAccessHash?: string;\n emoji?: string;\n isLottie: boolean;\n isGif: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isLottie?: true;\n isGifs?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\n shortName: string;\n}\n\nexport interface ApiVideo {\n id: string;\n mimeType: string;\n duration: number;\n fileName: string;\n width?: number;\n height?: number;\n supportsStreaming?: boolean;\n isRound?: boolean;\n isGif?: boolean;\n thumbnail?: ApiThumbnail;\n blobUrl?: string;\n size: number;\n}\n\nexport interface ApiAudio {\n id: string;\n size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n thumbnailSizes?: ApiPhotoSize[];\n}\n\nexport interface ApiVoice {\n id: string;\n duration: number;\n waveform?: number[];\n}\n\nexport interface ApiDocument {\n id?: string;\n fileName: string;\n size: number;\n timestamp?: number;\n mimeType: string;\n thumbnail?: ApiThumbnail;\n previewBlobUrl?: string;\n mediaType?: 'photo' | 'video';\n mediaSize?: ApiDimensions;\n}\n\nexport interface ApiContact {\n firstName: string;\n lastName: string;\n phoneNumber: string;\n userId: string;\n}\n\nexport interface ApiPollAnswer {\n text: string;\n option: string;\n}\n\nexport interface ApiPollResult {\n isChosen?: true;\n isCorrect?: true;\n option: string;\n votersCount: number;\n}\n\nexport interface ApiPoll {\n id: string;\n summary: {\n closed?: true;\n isPublic?: true;\n multipleChoice?: true;\n quiz?: true;\n question: string;\n answers: ApiPollAnswer[];\n closePeriod?: number;\n closeDate?: number;\n };\n results: {\n results?: ApiPollResult[];\n totalVoters?: number;\n recentVoterIds?: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n amount: number;\n currency: string;\n receiptMsgId?: number;\n isTest?: boolean;\n}\n\nexport type ApiNewPoll = {\n summary: ApiPoll['summary'];\n quiz?: {\n correctAnswers: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n};\n\nexport interface ApiAction {\n text: string;\n targetUserIds?: string[];\n targetChatId?: string;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n amount?: number;\n currency?: string;\n translationValues: string[];\n call?: Partial;\n}\n\nexport interface ApiWebPage {\n id: number;\n url: string;\n displayUrl: string;\n type?: string;\n siteName?: string;\n title?: string;\n description?: string;\n photo?: ApiPhoto;\n duration?: number;\n document?: ApiDocument;\n video?: ApiVideo;\n}\n\nexport interface ApiMessageForwardInfo {\n date: number;\n isChannelPost: boolean;\n channelPostId?: number;\n isLinkedChannelPost?: boolean;\n fromChatId?: string;\n senderUserId?: string;\n fromMessageId?: number;\n hiddenUserName?: string;\n adminTitle?: string;\n}\n\nexport interface ApiMessageEntity {\n type: string;\n offset: number;\n length: number;\n userId?: string;\n url?: string;\n}\n\nexport enum ApiMessageEntityTypes {\n Bold = 'MessageEntityBold',\n Blockquote = 'MessageEntityBlockquote',\n BotCommand = 'MessageEntityBotCommand',\n Cashtag = 'MessageEntityCashtag',\n Code = 'MessageEntityCode',\n Email = 'MessageEntityEmail',\n Hashtag = 'MessageEntityHashtag',\n Italic = 'MessageEntityItalic',\n MentionName = 'MessageEntityMentionName',\n Mention = 'MessageEntityMention',\n Phone = 'MessageEntityPhone',\n Pre = 'MessageEntityPre',\n Strike = 'MessageEntityStrike',\n TextUrl = 'MessageEntityTextUrl',\n Url = 'MessageEntityUrl',\n Underline = 'MessageEntityUnderline',\n Spoiler = 'MessageEntitySpoiler',\n Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: string;\n content: {\n text?: ApiFormattedText;\n photo?: ApiPhoto;\n video?: ApiVideo;\n document?: ApiDocument;\n sticker?: ApiSticker;\n contact?: ApiContact;\n poll?: ApiPoll;\n action?: ApiAction;\n webPage?: ApiWebPage;\n audio?: ApiAudio;\n voice?: ApiVoice;\n invoice?: ApiInvoice;\n };\n date: number;\n isOutgoing: boolean;\n senderId?: string;\n replyToChatId?: string;\n replyToMessageId?: number;\n replyToTopMessageId?: number;\n sendingState?: 'messageSendingStatePending' | 'messageSendingStateFailed';\n forwardInfo?: ApiMessageForwardInfo;\n isDeleting?: boolean;\n previousLocalId?: number;\n views?: number;\n isEdited?: boolean;\n editDate?: number;\n isMentioned?: boolean;\n isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n viaBotId?: string;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n seenByUserIds?: string[];\n isProtected?: boolean;\n reactors?: {\n nextOffset?: string;\n count: number;\n reactions: ApiUserReaction[];\n };\n reactions?: ApiReactions;\n}\n\nexport interface ApiReactions {\n canSeeList?: boolean;\n results: ApiReactionCount[];\n recentReactions?: ApiUserReaction[];\n}\n\nexport interface ApiUserReaction {\n userId: string;\n reaction: string;\n}\n\nexport interface ApiReactionCount {\n isChosen?: boolean;\n count: number;\n reaction: string;\n}\n\nexport interface ApiAvailableReaction {\n selectAnimation?: ApiDocument;\n staticIcon?: ApiDocument;\n centerIcon?: ApiDocument;\n aroundAnimation?: ApiDocument;\n reaction: string;\n title: string;\n isInactive?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: string;\n topMessageId?: number;\n originChannelId?: string;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: string[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport type ApiSponsoredMessage = {\n chatId?: string;\n randomId: string;\n isBot?: boolean;\n channelPostId?: number;\n startParam?: string;\n chatInviteHash?: string;\n chatInviteTitle?: string;\n text: ApiFormattedText;\n expiresAt: number;\n};\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'requestSelfContact' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\nexport type ApiReplyKeyboard = {\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n} & {\n [K in 'inlineButtons' | 'keyboardButtons']?: ApiKeyboardButtons;\n};\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice' | 'profilePhoto';\nexport type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\n\nexport type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'\n| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';\n\nexport type ApiSendMessageAction = {\n type: 'cancel' | 'typing' | 'recordAudio' | 'chooseSticker';\n};\n\nexport const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n\nconst utf16 = {\n // The utf16-class is necessary to convert from javascripts internal character representation to unicode and back.\n decode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n let extra;\n\n while (i < len) {\n value = input.charCodeAt(i++);\n if ((value & 0xf800) === 0xd800) {\n extra = input.charCodeAt(i++);\n if ((value & 0xfc00) !== 0xd800 || (extra & 0xfc00) !== 0xdc00) {\n throw new RangeError('UTF-16(decode): Illegal UTF-16 sequence');\n }\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n output.push(value);\n }\n return output;\n },\n encode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n\n while (i < len) {\n value = input[i++];\n if ((value & 0xf800) === 0xd800) {\n throw new RangeError('UTF-16(encode): Illegal UTF-16 value');\n }\n if (value > 0xffff) {\n value -= 0x10000;\n output.push(String.fromCharCode(((value >>> 10) & 0x3ff) | 0xd800));\n value = 0xdc00 | (value & 0x3ff);\n }\n output.push(String.fromCharCode(value));\n }\n return output.join('');\n },\n};\n\n// Default parameters\nconst initial_n = 0x80;\nconst initial_bias = 72;\nconst delimiter = '\\x2D';\nconst base = 36;\nconst damp = 700;\nconst tmin = 1;\nconst tmax = 26;\nconst skew = 38;\nconst maxint = 0x7fffffff;\n\n// decode_digit(cp) returns the numeric value of a basic code\n// point (for use in representing integers) in the range 0 to\n// base-1, or base if cp is does not represent a value.\n\nfunction decode_digit(cp) {\n return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base;\n}\n\n// ** Bias adaptation function **\nfunction adapt(delta, numpoints, firsttime) {\n let k;\n delta = firsttime ? Math.floor(delta / damp) : delta >> 1;\n delta += Math.floor(delta / numpoints);\n\n for (k = 0; delta > ((base - tmin) * tmax) >> 1; k += base) {\n delta = Math.floor(delta / (base - tmin));\n }\n return Math.floor(k + ((base - tmin + 1) * delta) / (delta + skew));\n}\n\n// Main decode\nfunction decode(input, preserveCase) {\n // Dont use utf16\n const output = [];\n const case_flags = [];\n const input_length = input.length;\n\n let n; let out; let i; let bias; let basic; let j; let ic; let oldi; let w; let k; let digit; let t; let len;\n\n // Initialize the state:\n\n n = initial_n;\n i = 0;\n bias = initial_bias;\n\n // Handle the basic code points: Let basic be the number of input code\n // points before the last delimiter, or 0 if there is none, then\n // copy the first basic code points to the output.\n\n basic = input.lastIndexOf(delimiter);\n if (basic < 0) basic = 0;\n\n for (j = 0; j < basic; ++j) {\n if (preserveCase) case_flags[output.length] = input.charCodeAt(j) - 65 < 26;\n if (input.charCodeAt(j) >= 0x80) {\n throw new RangeError('Illegal input >= 0x80');\n }\n output.push(input.charCodeAt(j));\n }\n\n // Main decoding loop: Start just after the last delimiter if any\n // basic code points were copied; start at the beginning otherwise.\n\n for (ic = basic > 0 ? basic + 1 : 0; ic < input_length;) {\n // ic is the index of the next character to be consumed,\n\n // Decode a generalized variable-length integer into delta,\n // which gets added to i. The overflow checking is easier\n // if we increase i as we go, then subtract off its starting\n // value at the end to obtain delta.\n for (oldi = i, w = 1, k = base; ; k += base) {\n if (ic >= input_length) {\n throw RangeError('punycode_bad_input(1)');\n }\n digit = decode_digit(input.charCodeAt(ic++));\n\n if (digit >= base) {\n throw RangeError('punycode_bad_input(2)');\n }\n if (digit > Math.floor((maxint - i) / w)) {\n throw RangeError('punycode_overflow(1)');\n }\n i += digit * w;\n t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;\n if (digit < t) {\n break;\n }\n if (w > Math.floor(maxint / (base - t))) {\n throw RangeError('punycode_overflow(2)');\n }\n w *= base - t;\n }\n\n out = output.length + 1;\n bias = adapt(i - oldi, out, oldi === 0);\n\n // i was supposed to wrap around from out to 0,\n // incrementing n each time, so we'll fix that now:\n if (Math.floor(i / out) > maxint - n) {\n throw RangeError('punycode_overflow(3)');\n }\n n += Math.floor(i / out);\n i %= out;\n\n // Insert n at position i of the output:\n // Case of last character determines uppercase flag:\n if (preserveCase) {\n case_flags.splice(i, 0, input.charCodeAt(ic - 1) - 65 < 26);\n }\n\n output.splice(i, 0, n);\n i++;\n }\n if (preserveCase) {\n for (i = 0, len = output.length; i < len; i++) {\n if (case_flags[i]) {\n output[i] = String.fromCharCode(output[i])\n .toUpperCase()\n .charCodeAt(0);\n }\n }\n }\n return utf16.encode(output);\n}\n\nfunction toUnicode(domain) {\n const domain_array = domain.split('.');\n const out = [];\n for (let i = 0; i < domain_array.length; ++i) {\n const s = domain_array[i];\n out.push(s.match(/^xn--/) ? decode(s.slice(4)) : s);\n }\n return out.join('.');\n}\n\nexport default toUnicode;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\nimport convertPunycode from '../../lib/punycode';\n\nimport {\n DEBUG, RE_TG_LINK, RE_TME_LINK,\n} from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport { ensureProtocol } from '../../util/ensureProtocol';\n\ntype OwnProps = {\n url?: string;\n text: string;\n className?: string;\n children?: React.ReactNode;\n isRtl?: boolean;\n};\n\nconst SafeLink: FC = ({\n url,\n text,\n className,\n children,\n isRtl,\n}) => {\n const { toggleSafeLinkModal, openTelegramLink } = getDispatch();\n\n const content = children || text;\n const isNotSafe = url !== content;\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (\n e.ctrlKey || e.altKey || e.shiftKey || e.metaKey\n || !url || (!url.match(RE_TME_LINK) && !url.match(RE_TG_LINK))\n ) {\n if (isNotSafe) {\n toggleSafeLinkModal({ url });\n\n e.preventDefault();\n return false;\n }\n\n return true;\n }\n\n e.preventDefault();\n openTelegramLink({ url });\n\n return false;\n }, [isNotSafe, openTelegramLink, toggleSafeLinkModal, url]);\n\n if (!url) {\n return undefined;\n }\n\n const classNames = buildClassName(\n className || 'text-entity-link',\n text.length > 50 && 'long-word-break-all',\n );\n\n return (\n \n {content}\n \n );\n};\n\nfunction getDomain(url?: string) {\n if (!url) {\n return undefined;\n }\n\n const href = ensureProtocol(url);\n if (!href) {\n return undefined;\n }\n\n try {\n let decodedHref = decodeURI(href);\n\n const match = decodedHref.match(/^https?:\\/\\/([^/:?#]+)(?:[/:?#]|$)/i);\n if (!match) {\n return undefined;\n }\n const domain = match[1];\n decodedHref = decodedHref.replace(domain, convertPunycode(domain));\n\n return decodedHref;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('SafeLink.getDecodedUrl error ', url, error);\n }\n }\n\n return undefined;\n}\n\nexport default memo(SafeLink);\n","import { ApiDocument } from '../../../api/types';\n\nconst ONE_GIGABYTE = 1024 * 1024 * 1024;\nconst ONE_MEGABYTE = 1024 * 1024;\n\nexport function getFileSizeString(bytes: number) {\n if (bytes > (ONE_GIGABYTE / 2)) {\n return `${(bytes / ONE_GIGABYTE).toFixed(1)} GB`;\n }\n if (bytes > (ONE_MEGABYTE / 2)) {\n return `${(bytes / ONE_MEGABYTE).toFixed(1)} MB`;\n }\n return `${(bytes / (1024)).toFixed(1)} KB`;\n}\n\nexport function getDocumentExtension(document: ApiDocument) {\n const { fileName, mimeType } = document;\n\n return getFileExtension(fileName, mimeType);\n}\n\nexport function getFileExtension(fileName: string, mimeType: string) {\n if (fileName && fileName.indexOf('.') !== -1) {\n return fileName.split('.').pop();\n } else {\n return mimeType.split('/').pop();\n }\n}\n\nexport function getColorFromExtension(extension: string) {\n switch (extension) {\n case 'apk':\n case 'xls':\n case 'xlsx':\n return 'green';\n case 'zip':\n case 'rar':\n case '7z':\n case 'tar':\n case 'gz':\n case 'ppt':\n case 'pptx':\n return 'orange';\n case 'pdf':\n case 'xps':\n return 'red';\n default:\n return 'default';\n }\n}\n\nexport function getDocumentHasPreview(document: ApiDocument) {\n return Boolean(document.previewBlobUrl || document.thumbnail);\n}\n","import twemojiRegex from '../../../lib/twemojiRegex';\n\nconst DETECT_UP_TO = 3;\nconst MAX_LENGTH = DETECT_UP_TO * 8; // Maximum 8 per one emoji.\nconst RE_EMOJI_ONLY = new RegExp(`^(?:${twemojiRegex.source})+$`, '');\n\nconst parseEmojiOnlyString = (text: string): number | false => {\n if (text.length > MAX_LENGTH) {\n return false;\n }\n\n const isEmojiOnly = Boolean(text.match(RE_EMOJI_ONLY));\n if (!isEmojiOnly) {\n return false;\n }\n\n let emojiCount = 0;\n while (twemojiRegex.exec(text)) {\n emojiCount++;\n\n if (emojiCount > DETECT_UP_TO) {\n twemojiRegex.lastIndex = 0;\n return false;\n }\n }\n\n return emojiCount;\n};\n\nexport default parseEmojiOnlyString;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\nimport { getDispatch } from '../../lib/teact/teactn';\n\ntype OwnProps = {\n className?: string;\n sender?: ApiUser | ApiChat;\n children: React.ReactNode;\n};\n\nconst UserLink: FC = ({\n className, sender, children,\n}) => {\n const { openChat } = getDispatch();\n\n const handleClick = useCallback(() => {\n if (sender) {\n openChat({ id: sender.id });\n }\n }, [sender, openChat]);\n\n if (!sender) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default UserLink;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n message?: ApiMessage;\n children: React.ReactNode;\n};\n\nconst MessageLink: FC = ({\n className, message, children,\n}) => {\n const { focusMessage } = getDispatch();\n\n const handleMessageClick = useCallback((): void => {\n if (message) {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }\n }, [focusMessage, message]);\n\n if (!message) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default MessageLink;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n chatId?: string;\n children: React.ReactNode;\n};\n\nconst ChatLink: FC = ({\n className, chatId, children,\n}) => {\n const { openChat } = getDispatch();\n\n const handleClick = useCallback(() => {\n if (chatId) {\n openChat({ id: chatId });\n }\n }, [chatId, openChat]);\n\n if (!chatId) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default ChatLink;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport { ApiGroupCall } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\nimport { getDispatch } from '../../lib/teact/teactn';\n\ntype OwnProps = {\n className?: string;\n groupCall?: Partial;\n children: React.ReactNode;\n};\n\nconst GroupCallLink: FC = ({\n className, groupCall, children,\n}) => {\n const { joinGroupCall } = getDispatch();\n\n const handleClick = useCallback(() => {\n if (groupCall) {\n joinGroupCall({ id: groupCall.id, accessHash: groupCall.accessHash });\n }\n }, [groupCall, joinGroupCall]);\n\n if (!groupCall) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default GroupCallLink;\n","import React from '../../../lib/teact/teact';\n\nimport {\n ApiChat, ApiMessage, ApiUser, ApiGroupCall,\n} from '../../../api/types';\nimport { LangFn } from '../../../hooks/useLang';\nimport {\n getChatTitle,\n getMessageSummaryText,\n getUserFullName,\n} from '../../../modules/helpers';\nimport trimText from '../../../util/trimText';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport { TextPart, renderMessageSummary } from './renderMessageText';\nimport renderText from './renderText';\n\nimport UserLink from '../UserLink';\nimport MessageLink from '../MessageLink';\nimport ChatLink from '../ChatLink';\nimport GroupCallLink from '../GroupCallLink';\n\ninterface RenderOptions {\n asPlainText?: boolean;\n asTextWithSpoilers?: boolean;\n}\n\nconst MAX_LENGTH = 32;\nconst NBSP = '\\u00A0';\n\nexport function renderActionMessageText(\n lang: LangFn,\n message: ApiMessage,\n actionOriginUser?: ApiUser,\n actionOriginChat?: ApiChat,\n targetUsers?: ApiUser[],\n targetMessage?: ApiMessage,\n targetChatId?: string,\n options: RenderOptions = {},\n) {\n if (!message.content.action) {\n return [];\n }\n\n const {\n text, translationValues, amount, currency, call,\n } = message.content.action;\n const content: TextPart[] = [];\n const noLinks = options.asPlainText || options.asTextWithSpoilers;\n const translationKey = text === 'Chat.Service.Group.UpdatedPinnedMessage1' && !targetMessage\n ? 'Message.PinnedGenericMessage'\n : text;\n\n let unprocessed = lang(translationKey, translationValues?.length ? translationValues : undefined);\n let processed: TextPart[];\n\n if (unprocessed.includes('%payment_amount%')) {\n processed = processPlaceholder(\n unprocessed,\n '%payment_amount%',\n formatCurrency(amount!, currency, lang.code),\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n }\n\n processed = processPlaceholder(\n unprocessed,\n '%action_origin%',\n actionOriginUser ? (\n renderUserContent(actionOriginUser, noLinks) || NBSP\n ) : actionOriginChat ? (\n renderChatContent(lang, actionOriginChat, noLinks) || NBSP\n ) : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_user%',\n targetUsers\n ? targetUsers.map((user) => renderUserContent(user, noLinks)).filter(Boolean as any)\n : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%message%',\n targetMessage\n ? renderMessageContent(lang, targetMessage, options)\n : 'a message',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%product%',\n targetMessage\n ? renderProductContent(targetMessage)\n : 'a product',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_chat%',\n targetChatId\n ? renderMigratedContent(targetChatId, noLinks)\n : 'another chat',\n );\n content.push(...processed);\n\n if (options.asPlainText) {\n return content.join('').trim();\n }\n\n if (call) {\n return renderGroupCallContent(call, content);\n }\n\n return content;\n}\n\nfunction renderProductContent(message: ApiMessage) {\n return message.content && message.content.invoice\n ? message.content.invoice.title\n : 'a product';\n}\n\nfunction renderMessageContent(lang: LangFn, message: ApiMessage, options: RenderOptions = {}) {\n const { asPlainText, asTextWithSpoilers } = options;\n\n if (asPlainText) {\n return getMessageSummaryText(lang, message, undefined, MAX_LENGTH);\n }\n\n const messageSummary = renderMessageSummary(lang, message, undefined, undefined, MAX_LENGTH);\n\n if (asTextWithSpoilers) {\n return (\n {messageSummary}\n );\n }\n\n return (\n {messageSummary}\n );\n}\n\nfunction renderGroupCallContent(groupCall: Partial, text: TextPart[]): string | TextPart | undefined {\n return (\n \n {text}\n \n );\n}\n\nfunction renderUserContent(sender: ApiUser, noLinks?: boolean): string | TextPart | undefined {\n const text = trimText(getUserFullName(sender), MAX_LENGTH);\n\n if (noLinks) {\n return text;\n }\n\n return {sender && renderText(text!)};\n}\n\nfunction renderChatContent(lang: LangFn, chat: ApiChat, noLinks?: boolean): string | TextPart | undefined {\n const text = trimText(getChatTitle(lang, chat), MAX_LENGTH);\n\n if (noLinks) {\n return text;\n }\n\n return {chat && renderText(text!)};\n}\n\nfunction renderMigratedContent(chatId: string, noLinks?: boolean): string | TextPart | undefined {\n const text = 'another chat';\n\n if (noLinks) {\n return text;\n }\n\n return {text};\n}\n\nfunction processPlaceholder(text: string, placeholder: string, replaceValue?: TextPart | TextPart[]): TextPart[] {\n const placeholderPosition = text.indexOf(placeholder);\n if (placeholderPosition < 0 || !replaceValue) {\n return [text];\n }\n\n const content: TextPart[] = [];\n content.push(text.substring(0, placeholderPosition));\n if (Array.isArray(replaceValue)) {\n replaceValue.forEach((value, index) => {\n content.push(value);\n if (index + 1 < replaceValue.length) {\n content.push(', ');\n }\n });\n } else {\n content.push(replaceValue);\n }\n content.push(text.substring(placeholderPosition + placeholder.length));\n\n return content;\n}\n","import { ApiMessage, ApiMessageEntityTypes } from '../../../api/types';\nimport {\n getMessageSummaryDescription,\n getMessageSummaryEmoji,\n getMessageSummaryText,\n getMessageText,\n TRUNCATED_SUMMARY_LENGTH,\n} from '../../../modules/helpers';\nimport { LangFn } from '../../../hooks/useLang';\nimport renderText from './renderText';\nimport { renderTextWithEntities, TextPart } from './renderTextWithEntities';\nimport trimText from '../../../util/trimText';\n\nexport type { TextPart };\n\nexport function renderMessageText(\n message: ApiMessage,\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n isSimple?: boolean,\n truncateLength?: number,\n) {\n const { text, entities } = message.content.text || {};\n\n if (!text) {\n const contentNotSupportedText = getMessageText(message);\n return contentNotSupportedText ? [trimText(contentNotSupportedText, truncateLength)] : undefined;\n }\n\n return renderTextWithEntities(\n trimText(text, truncateLength),\n entities,\n highlight,\n shouldRenderHqEmoji,\n undefined,\n message.id,\n isSimple,\n );\n}\n\nexport function renderMessageSummary(\n lang: LangFn,\n message: ApiMessage,\n noEmoji = false,\n highlight?: string,\n truncateLength = TRUNCATED_SUMMARY_LENGTH,\n): TextPart[] {\n let { entities } = message.content.text || {};\n\n const hasSpoilers = entities?.some((e) => e.type === ApiMessageEntityTypes.Spoiler);\n if (!hasSpoilers) {\n const text = trimText(getMessageSummaryText(lang, message, noEmoji), truncateLength);\n\n if (highlight) {\n return renderText(text, ['emoji', 'highlight'], { highlight });\n } else {\n return renderText(text);\n }\n }\n\n const emoji = !noEmoji && getMessageSummaryEmoji(message);\n const emojiWithSpace = emoji ? `${emoji} ` : '';\n\n const text = renderMessageText(message, highlight, undefined, true, truncateLength);\n const description = getMessageSummaryDescription(lang, message, text);\n\n return [\n emojiWithSpace,\n ...(Array.isArray(description) ? description : [description]),\n ].filter(Boolean);\n}\n","import React from '../../../lib/teact/teact';\nimport EMOJI_REGEX, { removeVS16s } from '../../../lib/twemojiRegex';\n\nimport { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config';\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\nimport { fixNonStandardEmoji, nativeToUnified } from '../../../util/emoji';\nimport buildClassName from '../../../util/buildClassName';\nimport { compact } from '../../../util/iteratees';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\ntype TextPart = string | Element;\nexport type TextFilter = (\n 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |\n 'simple_markdown' | 'simple_markdown_html'\n);\n\nconst RE_LETTER_OR_DIGIT = /^[\\d\\wа-яё]$/i;\nconst SIMPLE_MARKDOWN_REGEX = /(\\*\\*|__).+?\\1/g;\n\nexport default function renderText(\n part: TextPart,\n filters: Array = ['emoji'],\n params?: { highlight: string | undefined },\n): TextPart[] {\n if (typeof part !== 'string') {\n return [part];\n }\n\n return compact(filters.reduce((text, filter) => {\n switch (filter) {\n case 'escape_html':\n return escapeHtml(text);\n\n case 'hq_emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'big', 'jsx');\n\n case 'emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'jsx');\n\n case 'emoji_html':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'html');\n\n case 'br':\n return addLineBreaks(text, 'jsx');\n\n case 'br_html':\n return addLineBreaks(text, 'html');\n\n case 'highlight':\n return addHighlight(text, params!.highlight);\n\n case 'links':\n return addLinks(text);\n\n case 'simple_markdown':\n return replaceSimpleMarkdown(text, 'jsx');\n\n case 'simple_markdown_html':\n return replaceSimpleMarkdown(text, 'html');\n }\n\n return text;\n }, [part] as TextPart[]));\n}\n\nfunction escapeHtml(textParts: TextPart[]): TextPart[] {\n const divEl = document.createElement('div');\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n divEl.innerText = part;\n result.push(divEl.innerHTML);\n\n return result;\n }, [] as TextPart[]);\n}\n\nfunction replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx' | 'html'): TextPart[] {\n if (IS_EMOJI_SUPPORTED) {\n return textParts;\n }\n\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n part = fixNonStandardEmoji(part);\n const parts = part.split(EMOJI_REGEX);\n const emojis = part.match(EMOJI_REGEX) || [];\n result.push(parts[0]);\n\n return emojis.reduce((emojiResult: TextPart[], emoji, i) => {\n const code = nativeToUnified(removeVS16s(emoji));\n if (!code) return emojiResult;\n const className = buildClassName(\n 'emoji',\n size === 'small' && 'emoji-small',\n );\n if (type === 'jsx') {\n emojiResult.push(\n ,\n );\n }\n if (type === 'html') {\n emojiResult.push(\n // For preventing extra spaces in html\n // eslint-disable-next-line max-len\n `\"${emoji}\"`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n emojiResult.push(parts[index]);\n }\n\n return emojiResult;\n }, result);\n }, [] as TextPart[]);\n}\n\nfunction addLineBreaks(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result: TextPart[], part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n const splittenParts = part\n .split(/\\r\\n|\\r|\\n/g)\n .reduce((parts: TextPart[], line: string, i, source) => {\n // This adds non-breaking space if line was indented with spaces, to preserve the indentation\n const trimmedLine = line.trimLeft();\n const indentLength = line.length - trimmedLine.length;\n parts.push(String.fromCharCode(160).repeat(indentLength) + trimmedLine);\n\n if (i !== source.length - 1) {\n parts.push(\n type === 'jsx' ?
: '
',\n );\n }\n\n return parts;\n }, []);\n\n return [...result, ...splittenParts];\n }, []);\n}\n\nfunction addHighlight(textParts: TextPart[], highlight: string | undefined): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string' || !highlight) {\n result.push(part);\n return result;\n }\n\n const lowerCaseText = part.toLowerCase();\n const queryPosition = lowerCaseText.indexOf(highlight.toLowerCase());\n const nextSymbol = lowerCaseText[queryPosition + highlight.length];\n if (queryPosition < 0 || (nextSymbol && nextSymbol.match(RE_LETTER_OR_DIGIT))) {\n result.push(part);\n return result;\n }\n\n const newParts: TextPart[] = [];\n newParts.push(part.substring(0, queryPosition));\n newParts.push(\n \n {part.substring(queryPosition, queryPosition + highlight.length)}\n ,\n );\n newParts.push(part.substring(queryPosition + highlight.length));\n\n return [...result, ...newParts];\n }, [] as TextPart[]);\n}\n\nconst RE_LINK = new RegExp(`${RE_LINK_TEMPLATE}|${RE_MENTION_TEMPLATE}`, 'ig');\n\nfunction addLinks(textParts: TextPart[]): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n const links = part.match(RE_LINK);\n if (!links || !links.length) {\n result.push(part);\n return result;\n }\n\n const content: TextPart[] = [];\n\n let nextLink = links.shift();\n let lastIndex = 0;\n while (nextLink) {\n const index = part.indexOf(nextLink, lastIndex);\n content.push(part.substring(lastIndex, index));\n if (nextLink.startsWith('@')) {\n content.push(\n \n {nextLink}\n ,\n );\n } else {\n if (nextLink.endsWith('?')) {\n nextLink = nextLink.slice(0, nextLink.length - 1);\n }\n\n content.push(\n ,\n );\n }\n lastIndex = index + nextLink.length;\n nextLink = links.shift();\n }\n content.push(part.substring(lastIndex));\n\n return [...result, ...content];\n }, [] as TextPart[]);\n}\n\nfunction replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n const parts = part.split(SIMPLE_MARKDOWN_REGEX);\n const entities = part.match(SIMPLE_MARKDOWN_REGEX) || [];\n result.push(parts[0]);\n\n return entities.reduce((entityResult: TextPart[], entity, i) => {\n if (type === 'jsx') {\n entityResult.push(\n entity.startsWith('**')\n ? {entity.replace(/\\*\\*/g, '')}\n : {entity.replace(/__/g, '')},\n );\n } else {\n entityResult.push(\n entity.startsWith('**')\n ? `${entity.replace(/\\*\\*/g, '')}`\n : `${entity.replace(/__/g, '')}`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n entityResult.push(parts[index]);\n }\n\n return entityResult;\n }, result);\n }, [] as TextPart[]);\n}\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { createClassNameBuilder } from '../../../util/buildClassName';\nimport useFlag from '../../../hooks/useFlag';\n\nimport './Spoiler.scss';\n\ntype OwnProps = {\n children?: React.ReactNode;\n messageId?: number;\n};\n\nconst READING_SYMBOLS_PER_SECOND = 23; // Heuristics\nconst MIN_HIDE_TIMEOUT = 5000; // 5s\nconst MAX_HIDE_TIMEOUT = 60000; // 1m\n\nconst actionsByMessageId: Map = new Map();\n\nconst buildClassName = createClassNameBuilder('Spoiler');\n\nconst Spoiler: FC = ({\n children,\n messageId,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const contentRef = useRef(null);\n\n const [isRevealed, reveal, conceal] = useFlag();\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n actionsByMessageId.get(messageId!)?.forEach((actions) => actions.reveal());\n\n const contentLength = contentRef.current!.innerText.length;\n const readingMs = Math.round(contentLength / READING_SYMBOLS_PER_SECOND) * 1000;\n const timeoutMs = Math.max(MIN_HIDE_TIMEOUT, Math.min(readingMs, MAX_HIDE_TIMEOUT));\n\n setTimeout(() => {\n actionsByMessageId.get(messageId!)?.forEach((actions) => actions.conceal());\n conceal();\n }, timeoutMs);\n }, [conceal, messageId]);\n\n useEffect(() => {\n if (!messageId) {\n return undefined;\n }\n\n if (actionsByMessageId.has(messageId)) {\n actionsByMessageId.get(messageId)!.push({ reveal, conceal });\n } else {\n actionsByMessageId.set(messageId, [{ reveal, conceal }]);\n }\n\n return () => {\n actionsByMessageId.delete(messageId);\n };\n }, [conceal, handleClick, isRevealed, messageId, reveal]);\n\n return (\n \n \n {children}\n \n
\n );\n};\n\nexport default memo(Spoiler);\n","import { MouseEvent } from 'react';\nimport React from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types';\nimport renderText, { TextFilter } from './renderText';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\nimport Spoiler from '../spoiler/Spoiler';\n\nexport type TextPart =\n string\n | Element;\n\ninterface IOrganizedEntity {\n entity: ApiMessageEntity;\n organizedIndexes: Set;\n nestedEntities: IOrganizedEntity[];\n}\n\nexport function renderTextWithEntities(\n text: string,\n entities?: ApiMessageEntity[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n messageId?: number,\n isSimple?: boolean,\n) {\n if (!entities || !entities.length) {\n return renderMessagePart(text, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple);\n }\n\n const result: TextPart[] = [];\n let deleteLineBreakAfterPre = false;\n\n const organizedEntities = organizeEntities(entities);\n\n // Recursive function to render regular and nested entities\n function renderEntity(\n textPartStart: number,\n textPartEnd: number,\n organizedEntity: IOrganizedEntity,\n isLastEntity: boolean,\n ) {\n const renderResult: TextPart[] = [];\n const { entity, nestedEntities } = organizedEntity;\n const { offset, length, type } = entity;\n\n // Render text before the entity\n let textBefore = text.substring(textPartStart, offset);\n const textBeforeLength = textBefore.length;\n if (textBefore) {\n if (deleteLineBreakAfterPre && textBefore.length > 0 && textBefore[0] === '\\n') {\n textBefore = textBefore.substr(1);\n deleteLineBreakAfterPre = false;\n }\n if (textBefore) {\n renderResult.push(...renderMessagePart(\n textBefore, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple,\n ) as TextPart[]);\n }\n }\n\n const entityStartIndex = textPartStart + textBeforeLength;\n const entityEndIndex = entityStartIndex + length;\n\n let entityContent: TextPart = text.substring(offset, offset + length);\n const nestedEntityContent: TextPart[] = [];\n\n if (deleteLineBreakAfterPre && entityContent.length > 0 && entityContent[0] === '\\n') {\n entityContent = entityContent.substr(1);\n deleteLineBreakAfterPre = false;\n }\n\n if (type === ApiMessageEntityTypes.Pre) {\n deleteLineBreakAfterPre = true;\n }\n\n // Render nested entities, if any\n if (nestedEntities.length) {\n let nestedIndex = entityStartIndex;\n\n nestedEntities.forEach((nestedEntity, nestedEntityIndex) => {\n const {\n renderResult: nestedResult,\n entityEndIndex: nestedEntityEndIndex,\n } = renderEntity(\n nestedIndex,\n entityEndIndex,\n nestedEntity,\n nestedEntityIndex === nestedEntities.length - 1,\n );\n\n nestedEntityContent.push(...nestedResult);\n nestedIndex = nestedEntityEndIndex;\n });\n }\n\n // Render the entity itself\n const newEntity = shouldRenderAsHtml\n ? processEntityAsHtml(entity, entityContent, nestedEntityContent)\n : processEntity(entity, entityContent, nestedEntityContent, highlight, messageId, isSimple);\n\n if (Array.isArray(newEntity)) {\n renderResult.push(...newEntity);\n } else {\n renderResult.push(newEntity);\n }\n\n // Render text after the entity, if it is the last entity in the text,\n // or the last nested entity inside of another entity\n if (isLastEntity && entityEndIndex < textPartEnd) {\n let textAfter = text.substring(entityEndIndex, textPartEnd);\n if (deleteLineBreakAfterPre && textAfter.length > 0 && textAfter[0] === '\\n') {\n textAfter = textAfter.substring(1);\n }\n if (textAfter) {\n renderResult.push(...renderMessagePart(\n textAfter, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple,\n ) as TextPart[]);\n }\n }\n\n return {\n renderResult,\n entityEndIndex,\n };\n }\n\n // Process highest-level entities\n let index = 0;\n\n organizedEntities.forEach((entity, arrayIndex) => {\n const { renderResult, entityEndIndex } = renderEntity(\n index,\n text.length,\n entity,\n arrayIndex === organizedEntities.length - 1,\n );\n\n result.push(...renderResult);\n index = entityEndIndex;\n });\n\n return result;\n}\n\nexport function getTextWithEntitiesAsHtml(formattedText?: ApiFormattedText) {\n const { text, entities } = formattedText || {};\n if (!text) {\n return '';\n }\n\n const result = renderTextWithEntities(\n text,\n entities,\n undefined,\n undefined,\n true,\n );\n\n if (Array.isArray(result)) {\n return result.join('');\n }\n\n return result;\n}\n\nfunction renderMessagePart(\n content: TextPart | TextPart[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n isSimple?: boolean,\n) {\n if (Array.isArray(content)) {\n const result: TextPart[] = [];\n\n content.forEach((c) => {\n result.push(...renderMessagePart(c, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple));\n });\n\n return result;\n }\n\n if (shouldRenderAsHtml) {\n return renderText(content, ['escape_html', 'emoji_html', 'br_html']);\n }\n\n const emojiFilter = shouldRenderHqEmoji ? 'hq_emoji' : 'emoji';\n\n const filters: TextFilter[] = [emojiFilter];\n if (!isSimple) {\n filters.push('br');\n }\n\n if (highlight) {\n return renderText(content, filters.concat('highlight'), { highlight });\n } else {\n return renderText(content, filters);\n }\n}\n\n// Organize entities in a tree-like structure to better represent how the text will be displayed\nfunction organizeEntities(entities: ApiMessageEntity[]) {\n const organizedEntityIndexes: Set = new Set();\n const organizedEntities: IOrganizedEntity[] = [];\n\n entities.forEach((entity, index) => {\n if (organizedEntityIndexes.has(index)) {\n return;\n }\n\n const organizedEntity = organizeEntity(entity, index, entities, organizedEntityIndexes);\n if (organizedEntity) {\n organizedEntity.organizedIndexes.forEach((organizedIndex) => {\n organizedEntityIndexes.add(organizedIndex);\n });\n\n organizedEntities.push(organizedEntity);\n }\n });\n\n return organizedEntities;\n}\n\nfunction organizeEntity(\n entity: ApiMessageEntity,\n index: number,\n entities: ApiMessageEntity[],\n organizedEntityIndexes: Set,\n): IOrganizedEntity | undefined {\n const { offset, length } = entity;\n const organizedIndexes = new Set([index]);\n\n if (organizedEntityIndexes.has(index)) {\n return undefined;\n }\n\n // Determine any nested entities inside current entity\n const nestedEntities: IOrganizedEntity[] = [];\n const parsedNestedEntities = entities\n .filter((e, i) => i > index && e.offset >= offset && e.offset < offset + length)\n .map((e) => organizeEntity(e, entities.indexOf(e), entities, organizedEntityIndexes))\n .filter(Boolean as any);\n\n parsedNestedEntities.forEach((parsedEntity) => {\n let isChanged = false;\n\n parsedEntity.organizedIndexes.forEach((organizedIndex) => {\n if (!isChanged && !organizedIndexes.has(organizedIndex)) {\n isChanged = true;\n }\n\n organizedIndexes.add(organizedIndex);\n });\n\n if (isChanged) {\n nestedEntities.push(parsedEntity);\n }\n });\n\n return {\n entity,\n organizedIndexes,\n nestedEntities,\n };\n}\n\nfunction processEntity(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n highlight?: string,\n messageId?: number,\n isSimple?: boolean,\n) {\n const entityText = typeof entityContent === 'string' && entityContent;\n const renderedContent = nestedEntityContent.length ? nestedEntityContent : entityContent;\n\n function renderNestedMessagePart() {\n return renderMessagePart(\n renderedContent, highlight, undefined, undefined, isSimple,\n );\n }\n\n if (!entityText) {\n return renderNestedMessagePart();\n }\n\n if (isSimple) {\n const text = renderNestedMessagePart();\n if (entity.type === ApiMessageEntityTypes.Spoiler) {\n return {text};\n }\n return text;\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.Blockquote:\n return
{renderNestedMessagePart()}
;\n case ApiMessageEntityTypes.BotCommand:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Hashtag:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Cashtag:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Code:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.Email:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Italic:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.MentionName:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Mention:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Phone:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Pre:\n return
{renderNestedMessagePart()}
;\n case ApiMessageEntityTypes.Strike:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.TextUrl:\n case ApiMessageEntityTypes.Url:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Underline:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.Spoiler:\n return {renderNestedMessagePart()};\n default:\n return renderNestedMessagePart();\n }\n}\n\nfunction processEntityAsHtml(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const rawEntityText = typeof entityContent === 'string' && entityContent;\n\n const renderedContent = nestedEntityContent.length\n ? nestedEntityContent.join('')\n : renderText(entityContent, ['escape_html', 'emoji_html', 'br_html']).join('');\n\n if (!rawEntityText) {\n return renderedContent;\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Italic:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Underline:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Code:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Pre:\n return `\\`\\`\\`
${renderedContent}
\\`\\`\\``;\n case ApiMessageEntityTypes.Strike:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.MentionName:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Url:\n case ApiMessageEntityTypes.TextUrl:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Spoiler:\n return `${renderedContent}
`;\n default:\n return renderedContent;\n }\n}\n\nfunction getLinkUrl(entityContent: string, entity: ApiMessageEntity) {\n const { type, url } = entity;\n return type === ApiMessageEntityTypes.TextUrl && url ? url : entityContent;\n}\n\nfunction handleBotCommandClick(e: MouseEvent) {\n getDispatch().sendBotCommand({ command: e.currentTarget.innerText });\n}\n\nfunction handleHashtagClick(e: MouseEvent) {\n getDispatch().setLocalTextSearchQuery({ query: e.currentTarget.innerText });\n getDispatch().searchTextMessagesLocal();\n}\n","import React from '../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { IS_IOS } from '../../../util/environment';\n\nexport function preventMessageInputBlur(e: React.MouseEvent, withBubbling = false) {\n if (\n IS_IOS\n || !document.activeElement\n || document.activeElement.id !== EDITABLE_INPUT_ID\n || (!withBubbling && e.target !== e.currentTarget)\n ) {\n return;\n }\n\n e.preventDefault();\n}\n\nexport function preventMessageInputBlurWithBubbling(e: React.MouseEvent) {\n preventMessageInputBlur(e, true);\n}\n","import React, { FC } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\n\ntype OwnProps = {\n userId?: string;\n username?: string;\n children: React.ReactNode;\n};\n\ntype StateProps = {\n userOrChat?: ApiUser | ApiChat;\n};\n\nconst MentionLink: FC = ({\n username,\n userOrChat,\n children,\n}) => {\n const {\n openChat,\n openChatByUsername,\n } = getDispatch();\n\n const handleClick = () => {\n if (userOrChat) {\n openChat({ id: userOrChat.id });\n } else if (username) {\n openChatByUsername({ username: username.substring(1) });\n }\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport default withGlobal(\n (global, { userId }): StateProps => {\n return {\n userOrChat: userId ? selectUser(global, userId) : undefined,\n };\n },\n)(MentionLink);\n","import { MouseEvent as ReactMouseEvent, RefObject } from 'react';\n\nimport React, {\n FC, useRef, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Spinner from './Spinner';\nimport RippleEffect from './RippleEffect';\n\nimport './Button.scss';\n\nexport type OwnProps = {\n ref?: RefObject;\n type?: 'button' | 'submit' | 'reset';\n children: React.ReactNode;\n size?: 'default' | 'smaller' | 'tiny';\n color?: (\n 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'translucent-black' | 'dark'\n );\n backgroundImage?: string;\n className?: string;\n round?: boolean;\n pill?: boolean;\n fluid?: boolean;\n isText?: boolean;\n isLoading?: boolean;\n ariaLabel?: string;\n href?: string;\n download?: string;\n disabled?: boolean;\n ripple?: boolean;\n faded?: boolean;\n tabIndex?: number;\n isRtl?: boolean;\n withClickPropagation?: boolean;\n onClick?: (e: ReactMouseEvent) => void;\n onContextMenu?: (e: ReactMouseEvent) => void;\n onMouseDown?: (e: ReactMouseEvent) => void;\n onMouseEnter?: NoneToVoidFunction;\n onMouseLeave?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n};\n\n// Longest animation duration;\nconst CLICKED_TIMEOUT = 400;\n\nconst Button: FC = ({\n ref,\n type = 'button',\n onClick,\n onContextMenu,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n children,\n size = 'default',\n color = 'primary',\n backgroundImage,\n className,\n round,\n pill,\n fluid,\n isText,\n isLoading,\n ariaLabel,\n href,\n download,\n disabled,\n ripple,\n faded,\n tabIndex,\n isRtl,\n withClickPropagation,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const [isClicked, setIsClicked] = useState(false);\n\n const fullClassName = buildClassName(\n 'Button',\n className,\n size,\n color,\n round && 'round',\n pill && 'pill',\n fluid && 'fluid',\n disabled && 'disabled',\n isText && 'text',\n isLoading && 'loading',\n ripple && 'has-ripple',\n faded && 'faded',\n isClicked && 'clicked',\n backgroundImage && 'with-image',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (!disabled && onClick) {\n onClick(e);\n }\n\n setIsClicked(true);\n setTimeout(() => {\n setIsClicked(false);\n }, CLICKED_TIMEOUT);\n }, [disabled, onClick]);\n\n const handleMouseDown = useCallback((e: ReactMouseEvent) => {\n if (!withClickPropagation) e.preventDefault();\n if (!disabled && onMouseDown) {\n onMouseDown(e);\n }\n }, [onMouseDown, disabled, withClickPropagation]);\n\n if (href) {\n return (\n }\n className={fullClassName}\n href={href}\n title={ariaLabel}\n download={download}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n >\n {children}\n {!disabled && ripple && (\n \n )}\n \n );\n }\n\n return (\n // eslint-disable-next-line react/button-has-type\n }\n type={type}\n className={fullClassName}\n onClick={handleClick}\n onContextMenu={onContextMenu}\n onMouseDown={handleMouseDown}\n onMouseEnter={onMouseEnter && !disabled ? onMouseEnter : undefined}\n onMouseLeave={onMouseLeave && !disabled ? onMouseLeave : undefined}\n onFocus={onFocus && !disabled ? onFocus : undefined}\n aria-label={ariaLabel}\n title={ariaLabel}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n style={backgroundImage ? `background-image: url(${backgroundImage})` : undefined}\n >\n {isLoading ? (\n
\n Please wait...\n \n
\n ) : children}\n {!disabled && ripple && (\n \n )}\n \n );\n};\n\nexport default Button;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport renderText from '../common/helpers/renderText';\n\nimport Spinner from './Spinner';\n\nimport './Checkbox.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n subLabel?: string;\n checked: boolean;\n disabled?: boolean;\n round?: boolean;\n blocking?: boolean;\n isLoading?: boolean;\n withCheckedCallback?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Checkbox: FC = ({\n id,\n name,\n value,\n label,\n subLabel,\n checked,\n disabled,\n round,\n blocking,\n isLoading,\n onChange,\n onCheck,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n if (onChange) {\n onChange(event);\n }\n\n if (onCheck) {\n onCheck(event.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Checkbox',\n disabled && 'disabled',\n round && 'round',\n isLoading && 'loading',\n blocking && 'blocking',\n );\n\n return (\n \n );\n};\n\nexport default memo(Checkbox);\n","import React, { FC, useState, useRef } from '../../lib/teact/teact';\n\nimport Menu from './Menu';\n\nimport './DropdownMenu.scss';\n\ntype OwnProps = {\n className?: string;\n trigger: FC<{ onTrigger: () => void; isOpen?: boolean }>;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n footer?: string;\n forceOpen?: boolean;\n onOpen?: NoneToVoidFunction;\n onClose?: NoneToVoidFunction;\n children: React.ReactNode;\n};\n\nconst DropdownMenu: FC = ({\n trigger,\n className,\n children,\n positionX = 'left',\n positionY = 'top',\n footer,\n forceOpen,\n onOpen,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const dropdownRef = useRef(null);\n const [isOpen, setIsOpen] = useState(false);\n\n const toggleIsOpen = () => {\n setIsOpen(!isOpen);\n if (isOpen) {\n if (onClose) onClose();\n } else if (onOpen) onOpen();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const menu = menuRef.current;\n\n if (!isOpen || e.keyCode !== 40 || !menu) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(menu.children);\n\n if (!focusedElement || elementChildren.indexOf(focusedElement) === -1) {\n (elementChildren[0] as HTMLElement).focus();\n }\n };\n\n const handleClose = () => {\n setIsOpen(false);\n if (onClose) onClose();\n };\n\n return (\n \n {trigger({ onTrigger: toggleIsOpen, isOpen })}\n\n \n {children}\n \n \n );\n};\n\nexport default DropdownMenu;\n","import {\n ChangeEvent, FormEvent, RefObject,\n} from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\ntype OwnProps = {\n ref?: RefObject;\n id?: string;\n className?: string;\n value?: string;\n label?: string;\n error?: string;\n success?: string;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n autoComplete?: string;\n maxLength?: number;\n inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n onChange?: (e: ChangeEvent) => void;\n onInput?: (e: FormEvent) => void;\n onKeyPress?: (e: React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onPaste?: (e: React.ClipboardEvent) => void;\n};\n\nconst InputText: FC = ({\n ref,\n id,\n className,\n value,\n label,\n error,\n success,\n disabled,\n readOnly,\n placeholder,\n autoComplete,\n inputMode,\n maxLength,\n onChange,\n onInput,\n onKeyPress,\n onKeyDown,\n onBlur,\n onPaste,\n}) => {\n const lang = useLang();\n const labelText = error || success || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error ? 'error' : success && 'success',\n disabled && 'disabled',\n readOnly && 'disabled',\n labelText && 'with-label',\n className,\n );\n\n return (\n
\n \n {labelText && (\n \n )}\n
\n );\n};\n\nexport default memo(InputText);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Link.scss';\n\ntype OwnProps = {\n children: React.ReactNode;\n className?: string;\n isRtl?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n};\n\nconst Link: FC = ({\n children, className, isRtl, onClick,\n}) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n onClick!(e);\n }, [onClick]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default Link;\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport Spinner from './Spinner';\nimport buildClassName from '../../util/buildClassName';\n\nimport './Loading.scss';\n\ntype OwnProps = {\n color?: 'blue' | 'white' | 'black' | 'yellow';\n backgroundColor?: 'light' | 'dark';\n onClick?: NoneToVoidFunction;\n};\n\nconst Loading: FC = ({ color = 'blue', backgroundColor, onClick }) => {\n return (\n
\n \n
\n );\n};\n\nexport default memo(Loading);\n","import { RefObject } from 'react';\nimport React, { FC, useEffect, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useVirtualBackdrop from '../../hooks/useVirtualBackdrop';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\nimport { IS_BACKDROP_BLUR_SUPPORTED, IS_COMPACT_MENU } from '../../util/environment';\n\nimport './Menu.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n containerRef?: RefObject;\n isOpen: boolean;\n className?: string;\n style?: string;\n bubbleStyle?: string;\n transformOriginX?: number;\n transformOriginY?: number;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n autoClose?: boolean;\n shouldSkipTransition?: boolean;\n footer?: string;\n noCloseOnBackdrop?: boolean;\n noCompact?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onCloseAnimationEnd?: () => void;\n onClose?: () => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n children: React.ReactNode;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Menu: FC = ({\n ref,\n containerRef,\n isOpen,\n className,\n style,\n bubbleStyle,\n children,\n transformOriginX,\n transformOriginY,\n positionX = 'left',\n positionY = 'top',\n autoClose = false,\n footer,\n noCloseOnBackdrop = false,\n noCompact,\n onCloseAnimationEnd,\n onClose,\n onMouseEnter,\n onMouseLeave,\n shouldSkipTransition,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let menuRef = useRef(null);\n if (ref) {\n menuRef = ref;\n }\n const backdropContainerRef = containerRef || menuRef;\n\n const {\n transitionClassNames,\n } = useShowTransition(\n isOpen,\n onCloseAnimationEnd,\n shouldSkipTransition,\n undefined,\n shouldSkipTransition,\n );\n\n useEffect(\n () => (isOpen && onClose ? captureEscKeyListener(onClose) : undefined),\n [isOpen, onClose],\n );\n\n useHistoryBack(isOpen, onClose, undefined, undefined, autoClose);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n if (isOpen || (!isOpen && prevIsOpen === true)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n }, [isOpen]);\n\n const handleKeyDown = useKeyboardListNavigation(menuRef, isOpen, autoClose ? onClose : undefined, undefined, true);\n\n useVirtualBackdrop(\n isOpen,\n backdropContainerRef,\n noCloseOnBackdrop ? undefined : onClose,\n );\n\n const bubbleClassName = buildClassName(\n 'bubble menu-container custom-scroll',\n positionY,\n positionX,\n footer && 'with-footer',\n transitionClassNames,\n );\n\n const transformOriginYStyle = transformOriginY !== undefined ? `${transformOriginY}px` : undefined;\n const transformOriginXStyle = transformOriginX !== undefined ? `${transformOriginX}px` : undefined;\n\n return (\n \n {isOpen && (\n // This only prevents click events triggering on underlying elements\n
\n )}\n \n {children}\n {footer &&
{footer}
}\n
\n \n );\n};\n\nexport default Menu;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport { IS_COMPACT_MENU } from '../../util/environment';\n\nimport './MenuItem.scss';\n\ntype OnClickHandler = (e: React.SyntheticEvent) => void;\n\ntype OwnProps = {\n icon?: string;\n className?: string;\n children: React.ReactNode;\n onClick?: OnClickHandler;\n href?: string;\n download?: string;\n disabled?: boolean;\n destructive?: boolean;\n ariaLabel?: string;\n};\n\nconst MenuItem: FC = (props) => {\n const {\n icon,\n className,\n children,\n onClick,\n href,\n download,\n disabled,\n destructive,\n ariaLabel,\n } = props;\n\n const lang = useLang();\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 13 && e.keyCode !== 32) {\n return;\n }\n\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const fullClassName = buildClassName(\n 'MenuItem',\n className,\n disabled && 'disabled',\n destructive && 'destructive',\n IS_COMPACT_MENU && 'compact',\n );\n\n const content = (\n <>\n {icon && (\n \n )}\n {children}\n \n );\n\n if (href) {\n return (\n \n {content}\n \n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default MenuItem;\n","import React, {\n FC, useCallback, useMemo, useState, memo,\n} from '../../lib/teact/teact';\nimport { debounce } from '../../util/schedulers';\n\nimport './RippleEffect.scss';\n\ninterface Ripple {\n x: number;\n y: number;\n size: number;\n}\n\nconst ANIMATION_DURATION_MS = 700;\n\nconst RippleEffect: FC = () => {\n const [ripples, setRipples] = useState([]);\n\n const cleanUpDebounced = useMemo(() => {\n return debounce(() => {\n setRipples([]);\n }, ANIMATION_DURATION_MS, false);\n }, []);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (e.button !== 0) {\n return;\n }\n\n const container = e.currentTarget as HTMLDivElement;\n const position = container.getBoundingClientRect() as DOMRect;\n\n const rippleSize = container.offsetWidth / 2;\n\n setRipples([\n ...ripples,\n {\n x: e.clientX - position.x - (rippleSize / 2),\n y: e.clientY - position.y - (rippleSize / 2),\n size: rippleSize,\n },\n ]);\n\n requestAnimationFrame(() => {\n cleanUpDebounced();\n });\n }, [ripples, cleanUpDebounced]);\n\n return (\n
\n {ripples.map(({ x, y, size }) => (\n \n ))}\n
\n );\n};\n\nexport default memo(RippleEffect);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Spinner.scss';\n\nconst Spinner: FC<{\n color?: 'blue' | 'white' | 'black' | 'green' | 'gray' | 'yellow';\n backgroundColor?: 'light' | 'dark';\n}> = ({\n color = 'blue',\n backgroundColor,\n}) => {\n return (\n
\n
\n
\n );\n};\n\nexport default Spinner;\n","export const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION!;\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const DEBUG_PAYMENT_SMART_GLOCAL = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 500;\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 200;\nexport const GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT = 30;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v7';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const AUTODOWNLOAD_FILESIZE_MB_LIMITS = [1, 5, 10, 50, 100, 500];\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\nexport const COMMON_CHATS_LIMIT = 100;\nexport const GROUP_CALL_PARTICIPANTS_LIMIT = 100;\nexport const REACTION_LIST_LIMIT = 100;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\n\nexport const SPONSORED_MESSAGE_CACHE_MS = 300000; // 5 min\n\nexport const DEFAULT_VOLUME = 1;\nexport const DEFAULT_PLAYBACK_RATE = 1;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\nexport const SEND_MESSAGE_ACTION_INTERVAL = 3000; // 3s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\nexport const TMP_CHAT_ID = '0';\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 100;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const STICKER_SIZE_JOIN_REQUESTS = 140;\nexport const STICKER_SIZE_INVITES = 140;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const NO_STICKER_SET_ID = 'NO_STICKER_SET';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const VIDEO_MOV_TYPE = 'video/quicktime';\nexport const VIDEO_WEBM_TYPE = 'video/webm';\n\nexport const SUPPORTED_IMAGE_CONTENT_TYPES = new Set([\n 'image/png', 'image/gif', 'image/jpeg',\n]);\n\nexport const SUPPORTED_VIDEO_CONTENT_TYPES = new Set([\n 'video/mp4', // video/quicktime added dynamically in environment.ts\n]);\n\nexport const CONTENT_TYPES_WITH_PREVIEW = new Set([\n ...SUPPORTED_IMAGE_CONTENT_TYPES,\n ...SUPPORTED_VIDEO_CONTENT_TYPES,\n]);\n\nexport const CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram.';\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TG_LINK = /^tg:(\\/\\/)?([?=&\\d\\w_-]+)?/gm;\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)/gm;\n\n// eslint-disable-next-line max-len\nexport const COUNTRIES_WITH_12H_TIME_FORMAT = new Set(['AU', 'BD', 'CA', 'CO', 'EG', 'HN', 'IE', 'IN', 'JO', 'MX', 'MY', 'NI', 'NZ', 'PH', 'PK', 'SA', 'SV', 'US']);\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = '777000';\nexport const REPLIES_USER_ID = '1271266957'; // TODO For Test connection ID must be equal to 708513\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = '-777';\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n\n// Group calls\nexport const GROUP_CALL_VOLUME_MULTIPLIER = 100;\nexport const GROUP_CALL_DEFAULT_VOLUME = 100 * GROUP_CALL_VOLUME_MULTIPLIER;\nexport const ENABLE_THUMBNAIL_VIDEO = false;\n","import { useEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nconst useEffectWithPrevDeps = (cb: (args: T | []) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useEffect(() => {\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n\nexport default useEffectWithPrevDeps;\n","import { useCallback, useState } from '../lib/teact/teact';\n\nconst useFlag = (initial = false): [boolean, AnyToVoidFunction, AnyToVoidFunction] => {\n const [value, setValue] = useState(initial);\n\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n\n return [value, setTrue, setFalse];\n};\n\nexport default useFlag;\n","import { useCallback, useState } from '../lib/teact/teact';\n\nconst useForceUpdate = () => {\n const [, setTrigger] = useState(false);\n\n return useCallback(() => {\n setTrigger((trigger) => !trigger);\n }, []);\n};\n\nexport default useForceUpdate;\n","import { useEffect } from '../lib/teact/teact';\n\nconst ANIMATION_START_EVENT = 'tt-event-heavy-animation-start';\nconst ANIMATION_END_EVENT = 'tt-event-heavy-animation-end';\n\nlet timeout: number | undefined;\nlet isAnimating = false;\n\n// Make sure to end even if end callback was not called (which was some hardly-reproducible bug)\nconst AUTO_END_TIMEOUT = 1000;\n\nconst useHeavyAnimationCheck = (\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n isDisabled = false,\n) => {\n useEffect(() => {\n if (isDisabled) {\n return undefined;\n }\n\n if (isAnimating) {\n handleAnimationStart();\n }\n\n document.addEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n document.addEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n\n return () => {\n document.removeEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n document.removeEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n };\n }, [isDisabled, handleAnimationEnd, handleAnimationStart]);\n};\n\nexport function isHeavyAnimating() {\n return isAnimating;\n}\n\nexport function dispatchHeavyAnimationEvent(duration = AUTO_END_TIMEOUT) {\n if (!isAnimating) {\n isAnimating = true;\n document.dispatchEvent(new Event(ANIMATION_START_EVENT));\n }\n\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n // Race condition may happen if another `dispatchHeavyAnimationEvent` is called before `onEnd`\n function onEnd() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n }\n\n timeout = window.setTimeout(onEnd, duration);\n\n return onEnd;\n}\n\nexport default useHeavyAnimationCheck;\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_IOS } from '../util/environment';\nimport usePrevious from './usePrevious';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { areSortedArraysEqual } from '../util/iteratees';\n\ntype HistoryState = {\n currentIndex: number;\n nextStateIndexToReplace: number;\n isHistoryAltered: boolean;\n isDisabled: boolean;\n isEdge: boolean;\n currentIndexes: number[];\n};\n\n// Carefully selected by swiping and observing visual changes\n// TODO: may be different on other devices such as iPad, maybe take dpi into account?\nconst SAFARI_EDGE_BACK_GESTURE_LIMIT = 300;\nconst SAFARI_EDGE_BACK_GESTURE_DURATION = 350;\nexport const LOCATION_HASH = window.location.hash;\nconst PATH_BASE = `${window.location.pathname}${window.location.search}`;\n\nconst historyState: HistoryState = {\n currentIndex: 0,\n nextStateIndexToReplace: -1,\n isHistoryAltered: false,\n isDisabled: false,\n isEdge: false,\n currentIndexes: [],\n};\n\nexport const disableHistoryBack = () => {\n historyState.isDisabled = true;\n};\n\nconst handleTouchStart = (event: TouchEvent) => {\n const x = event.touches[0].pageX;\n\n if (x <= SAFARI_EDGE_BACK_GESTURE_LIMIT || x >= window.innerWidth - SAFARI_EDGE_BACK_GESTURE_LIMIT) {\n historyState.isEdge = true;\n }\n};\n\nconst handleTouchEnd = () => {\n if (historyState.isEdge) {\n setTimeout(() => {\n historyState.isEdge = false;\n }, SAFARI_EDGE_BACK_GESTURE_DURATION);\n }\n};\n\nif (IS_IOS) {\n window.addEventListener('touchstart', handleTouchStart);\n window.addEventListener('touchend', handleTouchEnd);\n window.addEventListener('popstate', handleTouchEnd);\n}\n\nwindow.history.replaceState({ index: historyState.currentIndex }, '', PATH_BASE);\n\nexport default function useHistoryBack(\n isActive: boolean | undefined,\n onBack: ((noDisableAnimation: boolean) => void) | undefined,\n onForward?: (state: any) => void,\n currentState?: any,\n shouldReplaceNext = false,\n hashes?: string[],\n) {\n const indexRef = useRef(-1);\n const isForward = useRef(false);\n const prevIsActive = usePrevious(isActive);\n const isClosed = useRef(true);\n const indexHashRef = useRef<{ index: number; hash: string }[]>([]);\n const prevHashes = usePrevious(hashes);\n const isHashChangedFromEvent = useRef(false);\n\n const handleChange = useCallback((isForceClose = false) => {\n if (!hashes) {\n if (isActive && !isForceClose) {\n isClosed.current = false;\n\n if (isForward.current) {\n isForward.current = false;\n historyState.currentIndexes.push(indexRef.current);\n } else {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n\n historyState.currentIndexes.push(index);\n\n window.history[(\n (\n historyState.currentIndexes.includes(historyState.nextStateIndexToReplace - 1)\n && window.history.state.index !== 0\n && historyState.nextStateIndexToReplace === index\n && !shouldReplaceNext\n )\n ? 'replaceState'\n : 'pushState'\n )]({\n index,\n state: currentState,\n }, '');\n\n indexRef.current = index;\n\n if (shouldReplaceNext) {\n historyState.nextStateIndexToReplace = historyState.currentIndex + 1;\n }\n }, 0);\n }\n }\n\n if ((isForceClose || !isActive) && !isClosed.current) {\n if ((indexRef.current === historyState.currentIndex || !shouldReplaceNext)) {\n historyState.isHistoryAltered = true;\n window.history.back();\n\n setTimeout(() => {\n historyState.nextStateIndexToReplace = -1;\n }, 400);\n }\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(indexRef.current), 1);\n\n isClosed.current = true;\n }\n } else {\n const prev = prevHashes || [];\n if (prev.length < hashes.length) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes.push(index);\n\n window.history.pushState({\n index,\n state: currentState,\n }, '', `#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current.push({\n index,\n hash: hashes[hashes.length - 1],\n });\n }, 0);\n } else {\n const delta = prev.length - hashes.length;\n if (isHashChangedFromEvent.current) {\n isHashChangedFromEvent.current = false;\n } else {\n if (hashes.length !== indexHashRef.current.length) {\n if (delta > 0) {\n const last = indexHashRef.current[indexHashRef.current.length - delta - 1];\n let realDelta = delta;\n if (last) {\n const indexLast = historyState.currentIndexes.findIndex(\n (l) => l === last.index,\n );\n realDelta = historyState.currentIndexes.length - indexLast - 1;\n }\n historyState.isHistoryAltered = true;\n window.history.go(-realDelta);\n const removed = indexHashRef.current.splice(indexHashRef.current.length - delta - 1, delta);\n removed.forEach(({ index }) => {\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(index), 1);\n });\n }\n }\n\n if (hashes.length > 0) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes[historyState.currentIndexes.length - 1] = index;\n\n window.history.replaceState({\n index,\n state: currentState,\n }, '', `${PATH_BASE}#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current[indexHashRef.current.length - 1] = {\n index,\n hash: hashes[hashes.length - 1],\n };\n }, 0);\n }\n }\n }\n }\n }, [currentState, hashes, isActive, prevHashes, shouldReplaceNext]);\n\n useEffect(() => {\n const handlePopState = (event: PopStateEvent) => {\n if (historyState.isHistoryAltered) {\n setTimeout(() => {\n historyState.isHistoryAltered = false;\n }, 0);\n return;\n }\n const { index: i } = event.state;\n const index = i || 0;\n try {\n const currIndex = hashes ? indexHashRef.current[indexHashRef.current.length - 1].index : indexRef.current;\n\n const prev = historyState.currentIndexes[historyState.currentIndexes.indexOf(currIndex) - 1];\n\n if (historyState.isDisabled) return;\n\n if ((!isClosed.current && (index === 0 || index === prev)) || (hashes && (index === 0 || index === prev))) {\n if (hashes) {\n isHashChangedFromEvent.current = true;\n indexHashRef.current.pop();\n }\n\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(currIndex), 1);\n\n if (onBack) {\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onBack(!historyState.isEdge);\n isClosed.current = true;\n }\n } else if (index === currIndex && isClosed.current && onForward && !hashes) {\n isForward.current = true;\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onForward(event.state.state);\n }\n } catch (e) {\n // Forward navigation for hashed is not supported\n }\n };\n\n const hasChanged = hashes\n ? (!prevHashes || !areSortedArraysEqual(prevHashes, hashes))\n : prevIsActive !== isActive;\n\n if (!historyState.isDisabled && hasChanged) {\n handleChange();\n }\n\n window.addEventListener('popstate', handlePopState);\n return () => window.removeEventListener('popstate', handlePopState);\n }, [\n currentState, handleChange, hashes, isActive, onBack, onForward, prevHashes, prevIsActive, shouldReplaceNext,\n ]);\n\n return {\n forceClose: () => handleChange(true),\n };\n}\n","import { RefObject } from 'react';\nimport { useState, useCallback, useEffect } from '../lib/teact/teact';\n\nconst useKeyboardListNavigation = (\n elementRef: RefObject,\n isOpen: boolean,\n onSelectWithEnter?: (index: number) => void,\n itemSelector?: string,\n noCaptureFocus?: boolean,\n) => {\n const [focusedIndex, setFocusedIndex] = useState(-1);\n\n useEffect(() => {\n setFocusedIndex(-1);\n\n const element = elementRef.current;\n if (isOpen && element && !noCaptureFocus) {\n element.tabIndex = -1;\n element.focus();\n }\n }, [elementRef, isOpen, noCaptureFocus]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n if (e.keyCode === 13 && onSelectWithEnter) {\n onSelectWithEnter(focusedIndex);\n return;\n }\n\n if (e.keyCode !== 38 && e.keyCode !== 40) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(itemSelector ? element.querySelectorAll(itemSelector) : element.children);\n\n let newIndex = (focusedElement && elementChildren.indexOf(focusedElement)) || focusedIndex;\n\n if (e.keyCode === 38 && newIndex > 0) {\n newIndex--;\n } else if (e.keyCode === 40 && newIndex < elementChildren.length - 1) {\n newIndex++;\n } else if (elementChildren.length === 1) {\n newIndex = 0;\n } else {\n return;\n }\n\n const item = elementChildren[newIndex] as HTMLElement;\n if (item) {\n setFocusedIndex(newIndex);\n item.focus();\n }\n }, [elementRef, onSelectWithEnter, itemSelector, focusedIndex]);\n\n return handleKeyDown;\n};\n\nexport default useKeyboardListNavigation;\n","import * as langProvider from '../util/langProvider';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport type LangFn = typeof langProvider.getTranslation;\n\nconst useLang = (): LangFn => {\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n return langProvider.addCallback(forceUpdate);\n }, [forceUpdate]);\n\n return langProvider.getTranslation;\n};\n\nexport default useLang;\n","import { useEffect } from '../lib/teact/teact';\n\nimport {\n BundleModules, Bundles, getModuleFromMemory, loadModule, addLoadListener,\n} from '../util/moduleLoader';\n\nimport useForceUpdate from './useForceUpdate';\n\nconst useModuleLoader = >(\n bundleName: B, moduleName: M, noLoad = false, autoUpdate = false,\n) => {\n const module = getModuleFromMemory(bundleName, moduleName);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!autoUpdate) {\n return undefined;\n }\n\n return addLoadListener(forceUpdate);\n }, [autoUpdate, forceUpdate]);\n\n useEffect(() => {\n if (!noLoad && !module) {\n loadModule(bundleName, moduleName).then(forceUpdate);\n }\n }, [bundleName, forceUpdate, module, moduleName, noLoad]);\n\n return module;\n};\n\nexport default useModuleLoader;\n","import usePrevious from './usePrevious';\n\nconst useOnChange = (cb: (args: T | []) => void, dependencies: T) => {\n const prevDeps = usePrevious(dependencies);\n if (!prevDeps || dependencies.some((d, i) => d !== prevDeps[i])) {\n cb(prevDeps || []);\n }\n};\n\nexport default useOnChange;\n","import { useRef } from '../lib/teact/teact';\n\nfunction usePrevious(next: T): T | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined: true): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean) {\n const ref = useRef();\n const { current } = ref;\n if (!shouldSkipUndefined || next !== undefined) {\n ref.current = next;\n }\n\n return current;\n}\n\nexport default usePrevious;\n","import { useRef, useState } from '../lib/teact/teact';\nimport buildClassName from '../util/buildClassName';\n\nconst CLOSE_DURATION = 350;\n\nconst useShowTransition = (\n isOpen = false,\n onCloseTransitionEnd?: () => void,\n noOpenTransition = false,\n className: string | false = 'fast',\n noCloseTransition = false,\n) => {\n const [isClosed, setIsClosed] = useState(!isOpen);\n const closeTimeoutRef = useRef();\n // СSS class should be added in a separate tick to turn on CSS transition.\n const [hasOpenClassName, setHasOpenClassName] = useState(isOpen && noOpenTransition);\n\n if (isOpen) {\n setIsClosed(false);\n setHasOpenClassName(true);\n\n if (closeTimeoutRef.current) {\n window.clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = undefined;\n }\n } else {\n setHasOpenClassName(false);\n\n if (!isClosed && !closeTimeoutRef.current) {\n const exec = () => {\n setIsClosed(true);\n\n if (onCloseTransitionEnd) {\n onCloseTransitionEnd();\n }\n\n closeTimeoutRef.current = undefined;\n };\n\n if (noCloseTransition) {\n exec();\n } else {\n closeTimeoutRef.current = window.setTimeout(exec, CLOSE_DURATION);\n }\n }\n }\n\n // `noCloseTransition`, when set to true, should remove the open class immediately\n const shouldHaveOpenClassName = hasOpenClassName && !(noCloseTransition && !isOpen);\n const isClosing = Boolean(closeTimeoutRef.current);\n const shouldRender = isOpen || isClosing;\n const transitionClassNames = buildClassName(\n className && 'opacity-transition',\n className,\n shouldHaveOpenClassName && 'open',\n shouldRender && 'shown',\n isClosing && 'closing',\n );\n\n return {\n shouldRender,\n transitionClassNames,\n };\n};\n\nexport default useShowTransition;\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\n\nconst BACKDROP_CLASSNAME = 'backdrop';\n\n// This effect implements closing menus by clicking outside of them\n// without adding extra elements to the DOM\nexport default function useVirtualBackdrop(\n isOpen: boolean,\n menuRef: RefObject,\n onClose?: () => void | undefined,\n) {\n useEffect(() => {\n const handleEvent = (e: Event) => {\n const menu = menuRef.current;\n const target = e.target as HTMLElement | null;\n if (!menu || !target) {\n return;\n }\n\n if (\n !menu.contains(e.target as Node | null)\n || target.classList.contains(BACKDROP_CLASSNAME)\n ) {\n e.preventDefault();\n e.stopPropagation();\n if (onClose) {\n onClose();\n }\n }\n };\n\n if (isOpen && onClose) {\n document.addEventListener('mousedown', handleEvent);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleEvent);\n };\n }, [isOpen, menuRef, onClose]);\n}\n","import { DEBUG } from '../../config';\n\ntype Handler = (e: Event) => void;\ntype DelegationRegistry = Map;\n\nconst NON_BUBBLEABLE_EVENTS = new Set(['scroll', 'mouseenter', 'mouseleave']);\n\nconst documentEventCounters: Record = {};\nconst delegationRegistryByEventType: Record = {};\nconst delegatedEventTypesByElement = new Map>();\n\nexport function addEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventType = resolveEventType(propName, element);\n if (canUseEventDelegation(eventType, element, asCapture)) {\n addDelegatedListener(eventType, element, handler);\n } else {\n element.addEventListener(eventType, handler, asCapture);\n }\n}\n\nexport function removeEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventType = resolveEventType(propName, element);\n if (canUseEventDelegation(eventType, element, asCapture)) {\n removeDelegatedListener(eventType, element);\n } else {\n element.removeEventListener(eventType, handler, asCapture);\n }\n}\n\nfunction resolveEventType(propName: string, element: HTMLElement) {\n const eventType = propName\n .replace(/^on/, '')\n .replace(/Capture$/, '').toLowerCase();\n\n if (eventType === 'change' && element.tagName !== 'SELECT') {\n // React behavior repeated here.\n // https://stackoverflow.com/questions/38256332/in-react-whats-the-difference-between-onchange-and-oninput\n return 'input';\n }\n\n if (eventType === 'doubleclick') {\n return 'dblclick';\n }\n\n // Replace focus/blur by their \"bubbleable\" versions\n if (eventType === 'focus') {\n return 'focusin';\n }\n\n if (eventType === 'blur') {\n return 'focusout';\n }\n\n return eventType;\n}\n\nfunction canUseEventDelegation(realEventType: string, element: HTMLElement, asCapture: boolean) {\n return (\n !asCapture\n && !NON_BUBBLEABLE_EVENTS.has(realEventType)\n && element.tagName !== 'VIDEO'\n && element.tagName !== 'IFRAME'\n );\n}\n\nfunction addDelegatedListener(eventType: string, element: HTMLElement, handler: Handler) {\n if (!documentEventCounters[eventType]) {\n documentEventCounters[eventType] = 0;\n document.addEventListener(eventType, handleEvent);\n }\n\n resolveDelegationRegistry(eventType).set(element, handler);\n resolveDelegatedEventTypes(element).add(eventType);\n documentEventCounters[eventType]++;\n}\n\nfunction removeDelegatedListener(eventType: string, element: HTMLElement) {\n documentEventCounters[eventType]--;\n if (!documentEventCounters[eventType]) {\n // Synchronous deletion on 0 will cause perf degradation in the case of 1 element\n // which is not a real case, so it's ok to do it this way\n document.removeEventListener(eventType, handleEvent);\n }\n\n delegationRegistryByEventType[eventType].delete(element);\n delegatedEventTypesByElement.get(element)!.delete(eventType);\n}\n\nexport function removeAllDelegatedListeners(element: HTMLElement) {\n const eventTypes = delegatedEventTypesByElement.get(element);\n if (!eventTypes) {\n return;\n }\n\n eventTypes.forEach((eventType) => removeDelegatedListener(eventType, element));\n delegatedEventTypesByElement.delete(element);\n}\n\nfunction handleEvent(realEvent: Event) {\n const events = delegationRegistryByEventType[realEvent.type];\n\n if (events) {\n let furtherCallsPrevented = false;\n let current: HTMLElement = realEvent.target as HTMLElement;\n\n const stopPropagation = () => {\n furtherCallsPrevented = true;\n };\n\n const preventDefault = () => {\n realEvent.preventDefault();\n };\n\n // Proxy is a simplest way to provide an access to the event property\n const event = new Proxy(realEvent, {\n get(target, p) {\n if (p === 'currentTarget') {\n return current;\n }\n if (p === 'stopPropagation' || p === 'stopImmediatePropagation') {\n return stopPropagation;\n }\n if (p === 'preventDefault') {\n // \"this\" is changed to proxy and one can't call methods via it\n return preventDefault;\n }\n return Reflect.get(target, p);\n },\n });\n\n // This can also be limited by teact root\n while (current && current !== document.body) {\n const handler = events.get(current);\n if (handler) {\n handler(event);\n if (furtherCallsPrevented) {\n return;\n }\n }\n\n current = current.parentNode as HTMLElement;\n }\n }\n}\n\nfunction resolveDelegationRegistry(eventType: string) {\n if (!delegationRegistryByEventType[eventType]) {\n delegationRegistryByEventType[eventType] = new Map();\n }\n\n return delegationRegistryByEventType[eventType];\n}\n\nfunction resolveDelegatedEventTypes(element: HTMLElement) {\n const existing = delegatedEventTypesByElement.get(element);\n if (existing) {\n return existing;\n }\n\n const newSet = new Set();\n delegatedEventTypesByElement.set(element, newSet);\n\n return newSet;\n}\n\nif (DEBUG) {\n document.addEventListener('dblclick', () => {\n const documentListenersCount = Object.keys(documentEventCounters).length;\n const delegatedHandlersCount1 = Object.values(documentEventCounters)\n .reduce((acc, counter) => acc + counter, 0);\n const delegationRegistriesCount = Object.keys(delegationRegistryByEventType).length;\n const delegatedHandlersCount2 = Object.values(delegationRegistryByEventType)\n .reduce((acc, delegationRegistry) => acc + delegationRegistry.size, 0);\n const delegationElementsCount = delegatedEventTypesByElement.size;\n const delegatedEventTypesCount = Array.from(delegatedEventTypesByElement.values())\n .reduce((acc, eventTypes) => acc + eventTypes.size, 0);\n\n // eslint-disable-next-line no-console\n console.warn('DELEGATED EVENTS STATS', {\n delegatedHandlersCount1,\n delegatedHandlersCount2,\n delegatedEventTypesCount,\n delegationRegistriesCount,\n delegationElementsCount,\n documentListenersCount,\n });\n });\n}\n","import {\n hasElementChanged,\n isComponentElement,\n isEmptyElement,\n isRealElement,\n isTextElement,\n mountComponent,\n renderComponent,\n unmountTree,\n getTarget,\n setTarget,\n VirtualElement,\n VirtualElementComponent,\n VirtualRealElement,\n} from './teact';\nimport generateIdFor from '../../util/generateIdFor';\nimport { DEBUG } from '../../config';\nimport { addEventListener, removeEventListener } from './dom-events';\n\ntype VirtualDomHead = {\n children: [VirtualElement] | [];\n};\n\nconst FILTERED_ATTRIBUTES = new Set(['key', 'ref', 'teactFastList', 'teactOrderKey']);\nconst HTML_ATTRIBUTES = new Set(['dir', 'role']);\nconst MAPPED_ATTRIBUTES: { [k: string]: string } = {\n autoPlay: 'autoplay',\n autoComplete: 'autocomplete',\n};\nconst INDEX_KEY_PREFIX = '__indexKey#';\n\nconst headsByElement: Record = {};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_virtualTreeSize = 1;\n\nfunction render($element?: VirtualElement, parentEl?: HTMLElement | null) {\n if (!parentEl) {\n return undefined;\n }\n\n let headId = parentEl.getAttribute('data-teact-head-id');\n if (!headId) {\n headId = generateIdFor(headsByElement);\n headsByElement[headId] = { children: [] };\n parentEl.setAttribute('data-teact-head-id', headId);\n }\n\n const $head = headsByElement[headId];\n $head.children = [renderWithVirtual(parentEl, $head.children[0], $element, $head, 0) as VirtualElement];\n\n if (process.env.APP_ENV === 'perf') {\n DEBUG_virtualTreeSize = 0;\n DEBUG_addToVirtualTreeSize($head);\n\n return DEBUG_virtualTreeSize;\n }\n\n return undefined;\n}\n\nfunction renderWithVirtual(\n parentEl: HTMLElement,\n $current: VirtualElement | undefined,\n $new: VirtualElement | undefined,\n $parent: VirtualRealElement | VirtualDomHead,\n index: number,\n {\n skipComponentUpdate = false,\n forceIndex = false,\n fragment,\n moveDirection,\n }: {\n skipComponentUpdate?: boolean;\n forceIndex?: boolean;\n fragment?: DocumentFragment;\n moveDirection?: 'up' | 'down';\n } = {},\n) {\n const isCurrentComponent = $current && isComponentElement($current);\n const isNewComponent = $new && isComponentElement($new);\n\n if (\n !skipComponentUpdate\n && isCurrentComponent && isNewComponent\n && !hasElementChanged($current!, $new!)\n ) {\n $new = updateComponent($current as VirtualElementComponent, $new as VirtualElementComponent);\n }\n\n // Parent element may have changed, so we need to update the listener closure.\n if (!skipComponentUpdate && isNewComponent && ($new as VirtualElementComponent).componentInstance.isMounted) {\n setupComponentUpdateListener($new as VirtualElementComponent, $parent, index, parentEl);\n }\n\n if ($current === $new) {\n return $new;\n }\n\n if (!$current && $new) {\n if (isNewComponent) {\n $new = initComponent($new as VirtualElementComponent, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n\n if (forceIndex && parentEl.childNodes[index]) {\n parentEl.insertBefore(node, parentEl.childNodes[index]);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n } else if ($current && !$new) {\n parentEl.removeChild(getTarget($current)!);\n unmountTree($current);\n } else if ($current && $new) {\n if (hasElementChanged($current, $new)) {\n if (isNewComponent) {\n $new = initComponent($new as VirtualElementComponent, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n parentEl.replaceChild(node, getTarget($current)!);\n unmountTree($current);\n } else {\n const areComponents = isCurrentComponent && isNewComponent;\n const currentTarget = getTarget($current);\n\n if (!areComponents) {\n setTarget($new, currentTarget!);\n setTarget($current, undefined as any); // Help GC\n\n if ('props' in $current && 'props' in $new) {\n $new.props.ref = $current.props.ref;\n }\n }\n\n if (isRealElement($new)) {\n if (moveDirection) {\n const node = currentTarget!;\n const nextSibling = parentEl.childNodes[moveDirection === 'up' ? index : index + 1];\n\n if (nextSibling) {\n parentEl.insertBefore(node, nextSibling);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n }\n\n if (!areComponents) {\n updateAttributes(($current as VirtualRealElement), $new, currentTarget as HTMLElement);\n }\n\n $new.children = renderChildren(\n ($current as VirtualRealElement),\n $new,\n areComponents ? parentEl : currentTarget as HTMLElement,\n );\n }\n }\n }\n\n return $new;\n}\n\nfunction initComponent(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n if (!isComponentElement($element)) {\n return $element;\n }\n\n const { componentInstance } = $element;\n\n if (!componentInstance.isMounted) {\n $element = mountComponent(componentInstance);\n setupComponentUpdateListener($element, $parent, index, parentEl);\n\n const $firstChild = $element.children[0];\n if (isComponentElement($firstChild)) {\n $element.children = [initComponent($firstChild, $element, 0, parentEl)];\n }\n\n componentInstance.isMounted = true;\n }\n\n return $element;\n}\n\nfunction updateComponent($current: VirtualElementComponent, $new: VirtualElementComponent) {\n $current.componentInstance.props = $new.componentInstance.props;\n\n return renderComponent($current.componentInstance);\n}\n\nfunction setupComponentUpdateListener(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n const { componentInstance } = $element;\n\n componentInstance.onUpdate = () => {\n $parent.children[index] = renderWithVirtual(\n parentEl,\n $parent.children[index],\n componentInstance.$element,\n $parent,\n index,\n { skipComponentUpdate: true },\n ) as VirtualElementComponent;\n };\n}\n\nfunction createNode($element: VirtualElement): Node {\n if (isEmptyElement($element)) {\n return document.createTextNode('');\n }\n\n if (isTextElement($element)) {\n return document.createTextNode($element.value);\n }\n\n if (isComponentElement($element)) {\n return createNode($element.children[0] as VirtualElement);\n }\n\n const { tag, props, children = [] } = $element;\n const element = document.createElement(tag);\n\n if (typeof props.ref === 'object') {\n props.ref.current = element;\n }\n\n Object.entries(props).forEach(([key, value]) => {\n if (props[key] !== undefined) {\n setAttribute(element, key, value);\n }\n });\n\n $element.children = children.map(($child, i) => (\n renderWithVirtual(element, undefined, $child, $element, i) as VirtualElement\n ));\n\n return element;\n}\n\nfunction renderChildren(\n $current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement,\n) {\n if ($new.props.teactFastList) {\n return renderFastListChildren($current, $new, currentEl);\n }\n\n const currentChildrenLength = $current.children.length;\n const newChildrenLength = $new.children.length;\n const maxLength = Math.max(currentChildrenLength, newChildrenLength);\n const newChildren = [];\n const fragment = newChildrenLength > currentChildrenLength + 1 ? document.createDocumentFragment() : undefined;\n\n for (let i = 0; i < maxLength; i++) {\n const $newChild = renderWithVirtual(\n currentEl,\n $current.children[i],\n $new.children[i],\n $new,\n i,\n i >= currentChildrenLength ? { fragment } : undefined,\n );\n\n if ($newChild) {\n newChildren.push($newChild);\n }\n }\n\n if (fragment) {\n currentEl.appendChild(fragment);\n }\n\n return newChildren;\n}\n\nfunction renderFastListChildren($current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement) {\n const newKeys = new Set(\n $new.children.map(($newChild) => {\n const key = 'props' in $newChild && $newChild.props.key;\n\n // eslint-disable-next-line no-null/no-null\n if (DEBUG && isRealElement($newChild) && (key === undefined || key === null)) {\n // eslint-disable-next-line no-console\n console.warn('Missing `key` in `teactFastList`');\n }\n\n return key;\n }),\n );\n\n let currentRemainingIndex = 0;\n const remainingByKey = $current.children\n .reduce((acc, $currentChild, i) => {\n let key = 'props' in $currentChild ? $currentChild.props.key : undefined;\n // eslint-disable-next-line no-null/no-null\n const isKeyPresent = key !== undefined && key !== null;\n\n // First we handle removed children\n if (isKeyPresent && !newKeys.has(key)) {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n } else if (!isKeyPresent) {\n const $newChild = $new.children[i];\n const newChildKey = ($newChild && 'props' in $newChild) ? $newChild.props.key : undefined;\n // If a non-key element remains at the same index we preserve it with a virtual `key`\n if ($newChild && !newChildKey) {\n key = `${INDEX_KEY_PREFIX}${i}`;\n } else {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n }\n }\n\n // Then we build up info about remaining children\n acc[key] = {\n $element: $currentChild,\n index: currentRemainingIndex++,\n order: 'props' in $currentChild ? $currentChild.props.teactOrderKey : undefined,\n };\n return acc;\n }, {} as Record);\n\n let newChildren: VirtualElement[] = [];\n\n let fragmentQueue: VirtualElement[] | undefined;\n let fragmentIndex: number | undefined;\n\n let currentPreservedIndex = 0;\n\n $new.children.forEach(($newChild, i) => {\n const key = 'props' in $newChild ? $newChild.props.key : `${INDEX_KEY_PREFIX}${i}`;\n const currentChildInfo = remainingByKey[key];\n\n if (!currentChildInfo) {\n // All new nodes are queued to be inserted with fragments if possible.\n if (!fragmentQueue) {\n fragmentQueue = [];\n fragmentIndex = i;\n }\n\n fragmentQueue.push($newChild);\n return;\n }\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n fragmentIndex = undefined;\n fragmentQueue = undefined;\n }\n\n // This is a \"magic\" `teactOrderKey` property that tells us the element is updated\n const order = 'props' in $newChild ? $newChild.props.teactOrderKey : undefined;\n const shouldMoveNode = currentChildInfo.index !== currentPreservedIndex && currentChildInfo.order !== order;\n const isMovingDown = shouldMoveNode && currentPreservedIndex > currentChildInfo.index;\n\n // When the node goes down, preserved indexing actually breaks, so the \"magic\" should help.\n if (!shouldMoveNode || isMovingDown) {\n currentPreservedIndex++;\n }\n\n newChildren.push(\n renderWithVirtual(currentEl, currentChildInfo.$element, $newChild, $new, i, {\n forceIndex: true,\n moveDirection: shouldMoveNode ? (isMovingDown ? 'down' : 'up') : undefined,\n })!,\n );\n });\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n }\n\n return newChildren;\n}\n\nfunction flushFragmentQueue(\n fragmentQueue: VirtualElement[], fragmentIndex: number, parentEl: HTMLElement, $parent: VirtualRealElement,\n) {\n if (fragmentQueue.length === 1) {\n return [renderWithVirtual(parentEl, undefined, fragmentQueue[0], $parent, fragmentIndex, { forceIndex: true })!];\n } else if (fragmentQueue.length > 1) {\n const fragment = document.createDocumentFragment();\n const newChildren = fragmentQueue.map(($fragmentChild) => (\n renderWithVirtual(parentEl, undefined, $fragmentChild, $parent, fragmentIndex!, { fragment })!\n ));\n\n if (parentEl.childNodes[fragmentIndex]) {\n parentEl.insertBefore(fragment, parentEl.childNodes[fragmentIndex]);\n } else {\n parentEl.appendChild(fragment);\n }\n\n return newChildren;\n }\n\n throw new Error('Unexpected input');\n}\n\nfunction updateAttributes($current: VirtualRealElement, $new: VirtualRealElement, element: HTMLElement) {\n const currentEntries = Object.entries($current.props);\n const newEntries = Object.entries($new.props);\n\n currentEntries.forEach(([key, currentValue]) => {\n const newValue = $new.props[key];\n\n if (\n currentValue !== undefined\n && (\n newValue === undefined\n || (currentValue !== newValue && key.startsWith('on'))\n )\n ) {\n removeAttribute(element, key, currentValue);\n }\n });\n\n newEntries.forEach(([key, newValue]) => {\n const currentValue = $current.props[key];\n\n if (newValue !== undefined && newValue !== currentValue) {\n setAttribute(element, key, newValue);\n }\n });\n}\n\nfunction setAttribute(element: HTMLElement, key: string, value: any) {\n // An optimization attempt\n if (key === 'className') {\n element.className = value;\n // An optimization attempt\n } else if (key === 'value') {\n if ((element as HTMLInputElement).value !== value) {\n (element as HTMLInputElement).value = value;\n }\n } else if (key === 'style') {\n element.style.cssText = value;\n } else if (key === 'dangerouslySetInnerHTML') {\n // eslint-disable-next-line no-underscore-dangle\n element.innerHTML = value.__html;\n } else if (key.startsWith('on')) {\n addEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || key.startsWith('aria-') || HTML_ATTRIBUTES.has(key)) {\n element.setAttribute(key, value);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n (element as any)[MAPPED_ATTRIBUTES[key] || key] = value;\n }\n}\n\nfunction removeAttribute(element: HTMLElement, key: string, value: any) {\n if (key === 'className') {\n element.className = '';\n } else if (key === 'value') {\n (element as HTMLInputElement).value = '';\n } else if (key === 'style') {\n element.style.cssText = '';\n } else if (key === 'dangerouslySetInnerHTML') {\n element.innerHTML = '';\n } else if (key.startsWith('on')) {\n removeEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || key.startsWith('aria-') || HTML_ATTRIBUTES.has(key)) {\n element.removeAttribute(key);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n delete (element as any)[MAPPED_ATTRIBUTES[key] || key];\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction DEBUG_addToVirtualTreeSize($current: VirtualRealElement | VirtualDomHead) {\n DEBUG_virtualTreeSize += $current.children.length;\n\n $current.children.forEach(($child) => {\n if (isRealElement($child)) {\n DEBUG_addToVirtualTreeSize($child);\n }\n });\n}\n\nconst TeactDOM = { render };\nexport default TeactDOM;\n","import { DEBUG, DEBUG_MORE } from '../../config';\nimport {\n fastRaf, fastRafPrimary, onTickEnd, onTickEndPrimary, throttleWithPrimaryRaf, throttleWithRaf,\n} from '../../util/schedulers';\nimport { flatten, orderBy } from '../../util/iteratees';\nimport { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { handleError } from '../../util/handleError';\nimport { removeAllDelegatedListeners } from './dom-events';\n\nexport type Props = AnyLiteral;\nexport type FC

= (props: P) => any;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type FC_withDebug = FC & {\n DEBUG_contentComponentName?: string;\n};\n\nexport enum VirtualElementTypesEnum {\n Empty,\n Text,\n Tag,\n Component,\n}\n\ninterface VirtualElementEmpty {\n type: VirtualElementTypesEnum.Empty;\n target?: Node;\n}\n\ninterface VirtualElementText {\n type: VirtualElementTypesEnum.Text;\n target?: Node;\n value: string;\n}\n\nexport interface VirtualElementTag {\n type: VirtualElementTypesEnum.Tag;\n target?: Node;\n tag: string;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport interface VirtualElementComponent {\n type: VirtualElementTypesEnum.Component;\n componentInstance: ComponentInstance;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport type StateHookSetter = (newValue: ((current: T) => T) | T) => void;\n\ninterface ComponentInstance {\n $element: VirtualElementComponent;\n Component: FC;\n name: string;\n props: Props;\n renderedValue?: any;\n isMounted: boolean;\n hooks: {\n state: {\n cursor: number;\n byCursor: {\n value: any;\n nextValue: any;\n setter: StateHookSetter;\n }[];\n };\n effects: {\n cursor: number;\n byCursor: {\n effect: () => void;\n dependencies?: readonly any[];\n cleanup?: Function;\n }[];\n };\n memos: {\n cursor: number;\n byCursor: {\n current: any;\n dependencies: any[];\n }[];\n };\n };\n prepareForFrame?: () => void;\n forceUpdate?: () => void;\n onUpdate?: () => void;\n}\n\nexport type VirtualElement =\n VirtualElementEmpty\n | VirtualElementText\n | VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualRealElement =\n VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualElementChildren = VirtualElement[];\n\nconst Fragment = Symbol('Fragment');\n\nconst DEBUG_RENDER_THRESHOLD = 7;\nconst DEBUG_EFFECT_THRESHOLD = 7;\nconst DEBUG_SILENT_RENDERS_FOR = new Set(['TeactMemoWrapper', 'TeactNContainer', 'Button', 'ListItem', 'MenuItem']);\n\nlet renderingInstance: ComponentInstance;\n\nexport function isEmptyElement($element: VirtualElement): $element is VirtualElementEmpty {\n return $element.type === VirtualElementTypesEnum.Empty;\n}\n\nexport function isTextElement($element: VirtualElement): $element is VirtualElementText {\n return $element.type === VirtualElementTypesEnum.Text;\n}\n\nexport function isTagElement($element: VirtualElement): $element is VirtualElementTag {\n return $element.type === VirtualElementTypesEnum.Tag;\n}\n\nexport function isComponentElement($element: VirtualElement): $element is VirtualElementComponent {\n return $element.type === VirtualElementTypesEnum.Component;\n}\n\nexport function isRealElement($element: VirtualElement): $element is VirtualRealElement {\n return isTagElement($element) || isComponentElement($element);\n}\n\nfunction createElement(\n source: string | FC | typeof Fragment,\n props: Props,\n ...children: any[]\n): VirtualRealElement | VirtualElementChildren {\n if (!props) {\n props = {};\n }\n\n children = flatten(children);\n\n if (source === Fragment) {\n return children;\n } else if (typeof source === 'function') {\n return createComponentInstance(source, props, children);\n } else {\n return buildTagElement(source, props, children);\n }\n}\n\nfunction createComponentInstance(Component: FC, props: Props, children: any[]): VirtualElementComponent {\n let parsedChildren: any | any[] | undefined;\n if (children.length === 0) {\n parsedChildren = undefined;\n } else if (children.length === 1) {\n [parsedChildren] = children;\n } else {\n parsedChildren = children;\n }\n\n const componentInstance: ComponentInstance = {\n $element: {} as VirtualElementComponent,\n Component,\n name: Component.name,\n props: {\n ...props,\n ...(parsedChildren && { children: parsedChildren }),\n },\n isMounted: false,\n hooks: {\n state: {\n cursor: 0,\n byCursor: [],\n },\n effects: {\n cursor: 0,\n byCursor: [],\n },\n memos: {\n cursor: 0,\n byCursor: [],\n },\n },\n };\n\n componentInstance.$element = buildComponentElement(componentInstance);\n\n return componentInstance.$element;\n}\n\nfunction buildComponentElement(\n componentInstance: ComponentInstance,\n children: VirtualElementChildren = [],\n): VirtualElementComponent {\n const { props } = componentInstance;\n\n return {\n componentInstance,\n type: VirtualElementTypesEnum.Component,\n props,\n children,\n };\n}\n\nfunction buildTagElement(tag: string, props: Props, children: any[]): VirtualElementTag {\n return {\n type: VirtualElementTypesEnum.Tag,\n tag,\n props,\n children: dropEmptyTail(children).map(buildChildElement),\n };\n}\n\n// We only need placeholders in the middle of collection (to ensure other elements order).\nfunction dropEmptyTail(children: any[]) {\n let i = children.length - 1;\n\n for (; i >= 0; i--) {\n if (!isEmptyPlaceholder(children[i])) {\n break;\n }\n }\n\n return i + 1 < children.length ? children.slice(0, i + 1) : children;\n}\n\nfunction isEmptyPlaceholder(child: any) {\n // eslint-disable-next-line no-null/no-null\n return child === false || child === null || child === undefined;\n}\n\nfunction buildChildElement(child: any): VirtualElement {\n if (isEmptyPlaceholder(child)) {\n return buildEmptyElement();\n } else if (isRealElement(child)) {\n return child;\n } else {\n return buildTextElement(child);\n }\n}\n\nfunction buildTextElement(value: any): VirtualElementText {\n return {\n type: VirtualElementTypesEnum.Text,\n value: String(value),\n };\n}\n\nfunction buildEmptyElement(): VirtualElementEmpty {\n return { type: VirtualElementTypesEnum.Empty };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst DEBUG_components: AnyLiteral = {};\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.warn('COMPONENTS', orderBy(Object.values(DEBUG_components), 'renderCount', 'desc'));\n});\n\nexport function renderComponent(componentInstance: ComponentInstance) {\n renderingInstance = componentInstance;\n componentInstance.hooks.state.cursor = 0;\n componentInstance.hooks.effects.cursor = 0;\n componentInstance.hooks.memos.cursor = 0;\n\n const { Component, props } = componentInstance;\n let newRenderedValue;\n\n try {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n const componentName = componentInstance.name;\n if (!DEBUG_components[componentName]) {\n DEBUG_components[componentName] = {\n componentName,\n renderCount: 0,\n renderTimes: [],\n };\n }\n\n if (DEBUG_MORE) {\n if (!DEBUG_SILENT_RENDERS_FOR.has(componentName)) {\n // eslint-disable-next-line no-console\n console.log(`[Teact] Render ${componentName}`);\n }\n }\n\n DEBUG_startAt = performance.now();\n }\n\n newRenderedValue = Component(props);\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (duration > DEBUG_RENDER_THRESHOLD) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow component render: ${componentName}, ${Math.round(duration)} ms`);\n }\n DEBUG_components[componentName].renderTimes.push(duration);\n DEBUG_components[componentName].renderCount++;\n }\n } catch (err: any) {\n handleError(err);\n\n newRenderedValue = componentInstance.renderedValue;\n }\n\n if (componentInstance.isMounted && newRenderedValue === componentInstance.renderedValue) {\n return componentInstance.$element;\n }\n\n componentInstance.renderedValue = newRenderedValue;\n\n const newChild = buildChildElement(newRenderedValue);\n componentInstance.$element = buildComponentElement(componentInstance, [newChild]);\n\n return componentInstance.$element;\n}\n\nexport function hasElementChanged($old: VirtualElement, $new: VirtualElement) {\n if (typeof $old !== typeof $new) {\n return true;\n } else if ($old.type !== $new.type) {\n return true;\n } else if (isTextElement($old) && isTextElement($new)) {\n return $old.value !== $new.value;\n } else if (isTagElement($old) && isTagElement($new)) {\n return ($old.tag !== $new.tag) || ($old.props.key !== $new.props.key);\n } else if (isComponentElement($old) && isComponentElement($new)) {\n return (\n $old.componentInstance.Component !== $new.componentInstance.Component\n ) || (\n $old.props.key !== $new.props.key\n );\n }\n\n return false;\n}\n\nexport function unmountTree($element: VirtualElement) {\n if (isComponentElement($element)) {\n unmountComponent($element.componentInstance);\n } else {\n if (isTagElement($element)) {\n if ($element.target) {\n removeAllDelegatedListeners($element.target as HTMLElement);\n }\n\n if ($element.props.ref) {\n $element.props.ref.current = undefined; // Help GC\n }\n }\n\n if ($element.target) {\n $element.target = undefined; // Help GC\n }\n\n if (!isRealElement($element)) {\n return;\n }\n }\n\n $element.children.forEach(unmountTree);\n}\n\nexport function mountComponent(componentInstance: ComponentInstance) {\n renderComponent(componentInstance);\n componentInstance.isMounted = true;\n return componentInstance.$element;\n}\n\nfunction unmountComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n // We need to clean refs before running effect cleanups\n componentInstance.hooks.memos.byCursor.forEach((memoContainer) => {\n memoContainer.current = undefined;\n });\n\n componentInstance.hooks.effects.byCursor.forEach(({ cleanup }) => {\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err: any) {\n handleError(err);\n }\n }\n });\n\n componentInstance.isMounted = false;\n\n helpGc(componentInstance);\n}\n\n// We need to remove all references to DOM objects. We also clean all other references, just in case\nfunction helpGc(componentInstance: ComponentInstance) {\n componentInstance.hooks.effects.byCursor.forEach((hook) => {\n hook.cleanup = undefined;\n hook.effect = undefined as any;\n hook.dependencies = undefined;\n });\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = undefined;\n hook.nextValue = undefined;\n hook.setter = undefined as any;\n });\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n hook.dependencies = undefined as any;\n });\n\n componentInstance.hooks = undefined as any;\n componentInstance.$element = undefined as any;\n componentInstance.renderedValue = undefined;\n componentInstance.Component = undefined as any;\n componentInstance.props = undefined as any;\n componentInstance.forceUpdate = undefined;\n componentInstance.onUpdate = undefined;\n}\n\nfunction prepareComponentForFrame(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = hook.nextValue;\n });\n\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(() => prepareComponentForFrame(componentInstance));\n componentInstance.forceUpdate = throttleWithRaf(() => forceUpdateComponent(componentInstance));\n}\n\nfunction forceUpdateComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted || !componentInstance.onUpdate) {\n return;\n }\n\n const currentElement = componentInstance.$element;\n\n renderComponent(componentInstance);\n\n if (componentInstance.$element !== currentElement) {\n componentInstance.onUpdate();\n }\n}\n\nexport function getTarget($element: VirtualElement): Node | undefined {\n if (isComponentElement($element)) {\n return getTarget($element.children[0]);\n } else {\n return $element.target;\n }\n}\n\nexport function setTarget($element: VirtualElement, target: Node) {\n if (isComponentElement($element)) {\n setTarget($element.children[0], target);\n } else {\n $element.target = target;\n }\n}\n\nexport function useState(): [T, StateHookSetter];\nexport function useState(initial: T): [T, StateHookSetter];\nexport function useState(initial?: T): [T, StateHookSetter] {\n const { cursor, byCursor } = renderingInstance.hooks.state;\n\n if (byCursor[cursor] === undefined) {\n byCursor[cursor] = {\n value: initial,\n nextValue: initial,\n setter: ((componentInstance) => (newValue: ((current: T) => T) | T) => {\n if (byCursor[cursor].nextValue !== newValue) {\n byCursor[cursor].nextValue = typeof newValue === 'function'\n ? (newValue as (current: T) => T)(byCursor[cursor].value)\n : newValue;\n\n if (!componentInstance.prepareForFrame || !componentInstance.forceUpdate) {\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(\n () => prepareComponentForFrame(componentInstance),\n );\n componentInstance.forceUpdate = throttleWithRaf(\n () => forceUpdateComponent(componentInstance),\n );\n }\n\n componentInstance.prepareForFrame();\n componentInstance.forceUpdate();\n\n if (DEBUG_MORE) {\n if (componentInstance.name !== 'TeactNContainer') {\n // eslint-disable-next-line no-console\n console.log(\n '[Teact.useState]',\n componentInstance.name,\n // `componentInstance.Component` may be set to `null` by GC helper\n componentInstance.Component && (componentInstance.Component as FC_withDebug).DEBUG_contentComponentName\n ? `> ${(componentInstance.Component as FC_withDebug).DEBUG_contentComponentName}`\n : '',\n `Forced update at cursor #${cursor}, next value: `,\n byCursor[cursor].nextValue,\n );\n }\n }\n }\n })(renderingInstance),\n };\n }\n\n renderingInstance.hooks.state.cursor++;\n\n return [\n byCursor[cursor].value,\n byCursor[cursor].setter,\n ];\n}\n\nfunction useLayoutEffectBase(\n schedulerFn: typeof onTickEnd | typeof requestAnimationFrame,\n primarySchedulerFn: typeof onTickEnd | typeof requestAnimationFrame,\n effect: () => Function | void,\n dependencies?: readonly any[],\n debugKey?: string,\n) {\n const { cursor, byCursor } = renderingInstance.hooks.effects;\n const componentInstance = renderingInstance;\n\n function execCleanup() {\n if (!componentInstance.isMounted) {\n return;\n }\n\n const { cleanup } = byCursor[cursor];\n if (typeof cleanup === 'function') {\n try {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n cleanup();\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (duration > DEBUG_EFFECT_THRESHOLD) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Teact] Slow cleanup at effect cursor #${cursor}: ${componentName}, ${Math.round(duration)} ms`,\n );\n }\n }\n } catch (err: any) {\n handleError(err);\n }\n }\n }\n\n function exec() {\n if (!componentInstance.isMounted) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n byCursor[cursor].cleanup = effect() as Function;\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (duration > DEBUG_EFFECT_THRESHOLD) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow effect at cursor #${cursor}: ${componentName}, ${Math.round(duration)} ms`);\n }\n }\n }\n\n if (byCursor[cursor] !== undefined && dependencies && byCursor[cursor].dependencies) {\n if (dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies![i])) {\n if (debugKey) {\n const causedBy = dependencies.reduce((res, newValue, i) => {\n const prevValue = byCursor[cursor].dependencies![i];\n if (newValue !== prevValue) {\n res.push(`${i}: ${prevValue} => ${newValue}`);\n }\n\n return res;\n }, []);\n\n // eslint-disable-next-line no-console\n console.log(`[Teact] Effect \"${debugKey}\" caused by dependencies.`, causedBy.join(', '));\n }\n\n primarySchedulerFn(execCleanup);\n schedulerFn(exec);\n }\n } else {\n if (debugKey) {\n // eslint-disable-next-line no-console\n console.log(`[Teact] Effect \"${debugKey}\" caused by missing dependencies.`);\n }\n\n primarySchedulerFn(execCleanup);\n schedulerFn(exec);\n }\n\n byCursor[cursor] = {\n effect,\n dependencies,\n cleanup: byCursor[cursor] ? byCursor[cursor].cleanup : undefined,\n };\n\n renderingInstance.hooks.effects.cursor++;\n}\n\nexport function useEffect(effect: () => Function | void, dependencies?: readonly any[], debugKey?: string) {\n return useLayoutEffectBase(fastRaf, fastRafPrimary, effect, dependencies, debugKey);\n}\n\nexport function useLayoutEffect(effect: () => Function | void, dependencies?: readonly any[], debugKey?: string) {\n return useLayoutEffectBase(onTickEnd, onTickEndPrimary, effect, dependencies, debugKey);\n}\n\nexport function useMemo(resolver: () => T, dependencies: any[], debugKey?: string): T {\n const { cursor, byCursor } = renderingInstance.hooks.memos;\n let { current } = byCursor[cursor] || {};\n\n if (\n byCursor[cursor] === undefined\n || dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies[i])\n ) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.useMemo] ${renderingInstance.name} (${debugKey}): Update is caused by:`,\n byCursor[cursor]\n ? getUnequalProps(dependencies, byCursor[cursor].dependencies).join(', ')\n : '[first render]',\n );\n }\n\n current = resolver();\n }\n\n byCursor[cursor] = {\n current,\n dependencies,\n };\n\n renderingInstance.hooks.memos.cursor++;\n\n return current;\n}\n\nexport function useCallback(newCallback: F, dependencies: any[], debugKey?: string): F {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => newCallback, dependencies, debugKey);\n}\n\nexport function useRef(initial: T): { current: T };\nexport function useRef(): { current: T | undefined }; // TT way (empty is `undefined`)\nexport function useRef(initial: null): { current: T | null }; // React way (empty is `null`)\n// eslint-disable-next-line no-null/no-null\nexport function useRef(initial?: T | null) {\n return useMemo(() => ({\n current: initial,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), []);\n}\n\nexport function memo(Component: T, debugKey?: string) {\n return function TeactMemoWrapper(props: Props) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => createElement(Component, props), Object.values(props), debugKey);\n } as T;\n}\n\n// We need to keep it here for JSX.\nconst Teact = {\n createElement,\n Fragment,\n};\n\nexport default Teact;\n","import React, {\n FC, FC_withDebug, Props, useEffect, useState,\n} from './teact';\n\nimport { DEBUG, DEBUG_MORE } from '../../config';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport generateIdFor from '../../util/generateIdFor';\nimport { fastRaf, throttleWithTickEnd } from '../../util/schedulers';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { orderBy } from '../../util/iteratees';\nimport {\n GlobalState, GlobalActions, ActionTypes, DispatchOptions,\n} from '../../global/types';\nimport { handleError } from '../../util/handleError';\nimport { isHeavyAnimating } from '../../hooks/useHeavyAnimationCheck';\n\nexport default React;\n\ntype ActionPayload = AnyLiteral;\n\ntype Reducer = (\n global: GlobalState,\n actions: GlobalActions,\n payload: any,\n) => GlobalState | void;\n\ntype MapStateToProps = ((global: GlobalState, ownProps: OwnProps) => AnyLiteral);\n\nlet currentGlobal = {} as GlobalState;\n\nconst reducers: Record = {};\nconst callbacks: Function[] = [updateContainers];\nconst actions = {} as GlobalActions;\nconst containers = new Map;\n ownProps: Props;\n mappedProps?: Props;\n forceUpdate: Function;\n areMappedPropsChanged: boolean;\n DEBUG_updates: number;\n DEBUG_componentName: string;\n}>();\n\nconst runCallbacksThrottled = throttleWithTickEnd(runCallbacks);\n\nfunction runCallbacks(forceOnHeavyAnimation = false) {\n if (!forceOnHeavyAnimation && isHeavyAnimating()) {\n fastRaf(runCallbacksThrottled);\n return;\n }\n\n callbacks.forEach((cb) => cb(currentGlobal));\n}\n\nexport function setGlobal(newGlobal?: GlobalState, options?: DispatchOptions) {\n if (typeof newGlobal === 'object' && newGlobal !== currentGlobal) {\n currentGlobal = newGlobal;\n if (options?.forceSyncOnIOs) {\n runCallbacks(true);\n } else {\n runCallbacksThrottled(options?.forceOnHeavyAnimation);\n }\n }\n}\n\nexport function getGlobal() {\n return currentGlobal;\n}\n\nexport function getDispatch() {\n return actions;\n}\n\nfunction onDispatch(name: string, payload?: ActionPayload, options?: DispatchOptions) {\n if (reducers[name]) {\n reducers[name].forEach((reducer) => {\n const newGlobal = reducer(currentGlobal, actions, payload);\n if (newGlobal) {\n setGlobal(newGlobal, options);\n }\n });\n }\n}\n\nfunction updateContainers() {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const container of containers.values()) {\n const {\n mapStateToProps, ownProps, mappedProps, forceUpdate,\n } = container;\n\n let newMappedProps;\n\n try {\n newMappedProps = mapStateToProps(currentGlobal, ownProps);\n } catch (err: any) {\n handleError(err);\n\n return;\n }\n\n if (DEBUG) {\n if (Object.values(newMappedProps).some(Number.isNaN)) {\n // eslint-disable-next-line no-console\n console.warn(\n // eslint-disable-next-line max-len\n `[TeactN] Some of \\`${container.DEBUG_componentName}\\` mappers contain NaN values. This may cause redundant updates because of incorrect equality check.`,\n );\n }\n }\n\n if (Object.keys(newMappedProps).length && !arePropsShallowEqual(mappedProps!, newMappedProps)) {\n if (DEBUG_MORE) {\n // eslint-disable-next-line no-console\n console.log(\n '[TeactN] Will update',\n container.DEBUG_componentName,\n 'caused by',\n getUnequalProps(mappedProps!, newMappedProps).join(', '),\n );\n }\n\n container.mappedProps = newMappedProps;\n container.areMappedPropsChanged = true;\n container.DEBUG_updates++;\n\n forceUpdate();\n }\n }\n\n if (DEBUG) {\n const updateTime = performance.now() - DEBUG_startAt!;\n if (updateTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[TeactN] Slow containers update: ${Math.round(updateTime)} ms`);\n }\n }\n}\n\nexport function addReducer(name: ActionTypes, reducer: Reducer) {\n if (!reducers[name]) {\n reducers[name] = [];\n\n actions[name] = (payload?: ActionPayload, options?: DispatchOptions) => {\n onDispatch(name, payload, options);\n };\n }\n\n reducers[name].push(reducer);\n}\n\nexport function addCallback(cb: Function) {\n callbacks.push(cb);\n}\n\nexport function removeCallback(cb: Function) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n}\n\nexport function withGlobal(\n mapStateToProps: MapStateToProps = () => ({}),\n) {\n return (Component: FC) => {\n return function TeactNContainer(props: OwnProps) {\n (TeactNContainer as FC_withDebug).DEBUG_contentComponentName = Component.name;\n\n const [id] = useState(generateIdFor(containers));\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n return () => {\n containers.delete(id);\n };\n }, [id]);\n\n let container = containers.get(id);\n if (!container) {\n container = {\n mapStateToProps,\n ownProps: props,\n areMappedPropsChanged: false,\n forceUpdate,\n DEBUG_updates: 0,\n DEBUG_componentName: Component.name,\n };\n\n containers.set(id, container);\n }\n\n if (container.areMappedPropsChanged) {\n container.areMappedPropsChanged = false;\n }\n\n if (!container.mappedProps || !arePropsShallowEqual(container.ownProps, props)) {\n container.ownProps = props;\n\n try {\n container.mappedProps = mapStateToProps(currentGlobal, props);\n } catch (err: any) {\n handleError(err);\n }\n }\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ;\n };\n };\n}\n\nif (DEBUG) {\n (window as any).getGlobal = getGlobal;\n\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.warn(\n 'GLOBAL CONTAINERS',\n orderBy(\n Array.from(containers.values())\n .map(({ DEBUG_componentName, DEBUG_updates }) => ({ DEBUG_componentName, DEBUG_updates })),\n 'DEBUG_updates',\n 'desc',\n ),\n );\n });\n}\n","// Copyright Twitter Inc. Licensed under MIT\n// https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md\n// Version 2c193ce 28.05.2021\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nexport function removeVS16s(rawEmoji) {\n return rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji;\n}\n\n// This file is generated by source/emoji/scripts/generate.sh\n// eslint-disable-next-line max-len\nexport default /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91])|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd1d\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78\\udd7a-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcb\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7a\\ude80-\\ude86\\ude90-\\udea8\\udeb0-\\udeb6\\udec0-\\udec2\\uded0-\\uded6]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g;\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { initApi, callApi } from '../../../api/gramjs';\nimport { GlobalState } from '../../../global/types';\n\nimport {\n LANG_CACHE_NAME,\n CUSTOM_BG_CACHE_NAME,\n MEDIA_CACHE_NAME,\n MEDIA_CACHE_NAME_AVATARS,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n IS_TEST,\n} from '../../../config';\nimport { IS_MOV_SUPPORTED, IS_WEBM_SUPPORTED, PLATFORM_ENV } from '../../../util/environment';\nimport { unsubscribe } from '../../../util/notifications';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n storeSession,\n loadStoredSession,\n clearStoredSession,\n importLegacySession,\n clearLegacySessions,\n} from '../../../util/sessions';\nimport { forceWebsync } from '../../../util/websync';\n\naddReducer('initApi', (global: GlobalState, actions) => {\n (async () => {\n if (!IS_TEST) {\n await importLegacySession();\n void clearLegacySessions();\n }\n\n void initApi(actions.apiUpdate, {\n userAgent: navigator.userAgent,\n platform: PLATFORM_ENV,\n sessionData: loadStoredSession(),\n isTest: window.location.search.includes('test'),\n isMovSupported: IS_MOV_SUPPORTED,\n isWebmSupported: IS_WEBM_SUPPORTED,\n });\n })();\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n void callApi('provideAuthPhoneNumber', phoneNumber.replace(/[^\\d]/g, ''));\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthCode', (global, actions, payload) => {\n const { code } = payload!;\n\n void callApi('provideAuthCode', code);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthPassword', (global, actions, payload) => {\n const { password } = payload!;\n\n void callApi('provideAuthPassword', password);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('uploadProfilePhoto', (global, actions, payload) => {\n const { file } = payload!;\n\n void callApi('uploadProfilePhoto', file);\n});\n\naddReducer('signUp', (global, actions, payload) => {\n const { firstName, lastName } = payload!;\n\n void callApi('provideAuthRegistration', { firstName, lastName });\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('returnToAuthPhoneNumber', (global) => {\n void callApi('restartAuth');\n\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('goToAuthQrCode', (global) => {\n void callApi('restartAuthWithQr');\n\n return {\n ...global,\n authIsLoadingQrCode: true,\n authError: undefined,\n };\n});\n\naddReducer('saveSession', (global, actions, payload) => {\n const { sessionData } = payload;\n\n if (sessionData) {\n storeSession(payload.sessionData, global.currentUserId);\n } else {\n clearStoredSession();\n }\n});\n\naddReducer('signOut', () => {\n (async () => {\n try {\n await unsubscribe();\n await callApi('destroy');\n await forceWebsync(false);\n } catch (err) {\n // Do nothing\n }\n\n getDispatch().reset();\n })();\n});\n\naddReducer('reset', () => {\n clearStoredSession();\n\n void cacheApi.clear(MEDIA_CACHE_NAME);\n void cacheApi.clear(MEDIA_CACHE_NAME_AVATARS);\n void cacheApi.clear(MEDIA_PROGRESSIVE_CACHE_NAME);\n void cacheApi.clear(CUSTOM_BG_CACHE_NAME);\n\n const langCachePrefix = LANG_CACHE_NAME.replace(/\\d+$/, '');\n const langCacheVersion = (LANG_CACHE_NAME.match(/\\d+$/) || [0])[0];\n for (let i = 0; i < langCacheVersion; i++) {\n void cacheApi.clear(`${langCachePrefix}${i === 0 ? '' : i}`);\n }\n\n void clearLegacySessions();\n\n updateAppBadge(0);\n\n getDispatch().init();\n});\n\naddReducer('disconnect', () => {\n (async () => {\n await callApi('disconnect');\n })();\n});\n\naddReducer('loadNearestCountry', (global) => {\n if (global.connectionState !== 'connectionStateReady') {\n return;\n }\n\n (async () => {\n const authNearestCountry = await callApi('fetchNearestCountry');\n\n setGlobal({\n ...getGlobal(),\n authNearestCountry,\n });\n })();\n});\n\naddReducer('setDeviceToken', (global, actions, deviceToken) => {\n setGlobal({\n ...global,\n push: {\n deviceToken,\n subscribedAt: Date.now(),\n },\n });\n});\n\naddReducer('deleteDeviceToken', (global) => {\n const newGlobal = { ...global };\n delete newGlobal.push;\n setGlobal(newGlobal);\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport {\n ApiPrivacyKey, PrivacyVisibility, ProfileEditProgress, InputPrivacyRules, InputPrivacyContact,\n UPLOADING_WALLPAPER_SLUG,\n} from '../../../types';\n\nimport { COUNTRIES_WITH_12H_TIME_FORMAT } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { subscribe, unsubscribe } from '../../../util/notifications';\nimport { setTimeFormat } from '../../../util/langProvider';\nimport { selectUser } from '../../selectors';\nimport {\n addUsers, addBlockedContact, updateChats, updateUser, removeBlockedContact, replaceSettings, updateNotifySettings,\n addNotifyExceptions,\n} from '../../reducers';\nimport { isUserId } from '../../helpers';\n\naddReducer('updateProfile', (global, actions, payload) => {\n const {\n photo, firstName, lastName, bio: about, username,\n } = payload!;\n\n (async () => {\n const { currentUserId } = global;\n if (!currentUserId) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.InProgress,\n },\n });\n\n if (photo) {\n await callApi('updateProfilePhoto', photo);\n }\n\n if (firstName || lastName || about) {\n const result = await callApi('updateProfile', { firstName, lastName, about });\n if (result) {\n global = getGlobal();\n const currentUser = currentUserId && selectUser(global, currentUserId);\n\n if (currentUser) {\n setGlobal(updateUser(\n global,\n currentUser.id,\n {\n firstName,\n lastName,\n fullInfo: {\n ...currentUser.fullInfo,\n bio: about,\n },\n },\n ));\n }\n }\n }\n\n if (username) {\n const result = await callApi('updateUsername', username);\n if (result && currentUserId) {\n setGlobal(updateUser(getGlobal(), currentUserId, { username }));\n }\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.Complete,\n },\n });\n })();\n});\n\naddReducer('checkUsername', (global, actions, payload) => {\n const { username } = payload!;\n\n (async () => {\n // No need to check the username if profile update is already in progress\n if (global.profileEdit && global.profileEdit.progress === ProfileEditProgress.InProgress) {\n return;\n }\n\n setGlobal({\n ...global,\n profileEdit: {\n progress: global.profileEdit ? global.profileEdit.progress : ProfileEditProgress.Idle,\n isUsernameAvailable: undefined,\n },\n });\n\n const isUsernameAvailable = await callApi('checkUsername', username);\n\n global = getGlobal();\n setGlobal({\n ...global,\n profileEdit: {\n ...global.profileEdit!,\n isUsernameAvailable,\n },\n });\n })();\n});\n\naddReducer('loadWallpapers', () => {\n (async () => {\n const result = await callApi('fetchWallpapers');\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: result.wallpapers,\n },\n });\n })();\n});\n\naddReducer('uploadWallpaper', (global, actions, payload) => {\n const file = payload;\n const previewBlobUrl = URL.createObjectURL(file);\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n {\n slug: UPLOADING_WALLPAPER_SLUG,\n document: {\n fileName: '',\n size: file.size,\n mimeType: file.type,\n previewBlobUrl,\n },\n },\n ...(global.settings.loadedWallpapers || []),\n ],\n },\n });\n\n (async () => {\n const result = await callApi('uploadWallpaper', file);\n if (!result) {\n return;\n }\n\n const { wallpaper } = result;\n\n global = getGlobal();\n if (!global.settings.loadedWallpapers) {\n return;\n }\n\n const firstWallpaper = global.settings.loadedWallpapers[0];\n if (!firstWallpaper || firstWallpaper.slug !== UPLOADING_WALLPAPER_SLUG) {\n return;\n }\n\n const withLocalMedia = {\n ...wallpaper,\n document: {\n ...wallpaper.document,\n previewBlobUrl,\n },\n };\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n withLocalMedia,\n ...global.settings.loadedWallpapers.slice(1),\n ],\n },\n });\n })();\n});\n\naddReducer('loadBlockedContacts', () => {\n (async () => {\n const result = await callApi('fetchBlockedContacts');\n\n if (!result) {\n return;\n }\n\n let newGlobal = getGlobal();\n\n if (result.users?.length) {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n }\n if (result.chats?.length) {\n newGlobal = updateChats(newGlobal, buildCollectionByKey(result.chats, 'id'));\n }\n\n newGlobal = {\n ...newGlobal,\n blocked: {\n ...newGlobal.blocked,\n ids: [...(newGlobal.blocked.ids || []), ...result.blockedIds],\n totalCount: result.totalCount,\n },\n };\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('blockContact', (global, actions, payload) => {\n const { contactId, accessHash } = payload!;\n\n (async () => {\n const result = await callApi('blockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(addBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('unblockContact', (global, actions, payload) => {\n const { contactId } = payload!;\n let accessHash: string | undefined;\n const isPrivate = isUserId(contactId);\n\n if (isPrivate) {\n const user = selectUser(global, contactId);\n if (!user) {\n return;\n }\n\n accessHash = user.accessHash;\n }\n\n (async () => {\n const result = await callApi('unblockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(removeBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('loadAuthorizations', () => {\n (async () => {\n const result = await callApi('fetchAuthorizations');\n if (!result) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n activeSessions: result,\n });\n })();\n});\n\naddReducer('terminateAuthorization', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('terminateAuthorization', hash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n activeSessions: newGlobal.activeSessions.filter((session) => session.hash !== hash),\n });\n })();\n});\n\naddReducer('terminateAllAuthorizations', () => {\n (async () => {\n const result = await callApi('terminateAllAuthorizations');\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n activeSessions: global.activeSessions.filter((session) => session.isCurrent),\n });\n })();\n});\n\naddReducer('loadNotificationExceptions', (global) => {\n const { serverTimeOffset } = global;\n\n (async () => {\n const result = await callApi('fetchNotificationExceptions', { serverTimeOffset });\n if (!result) {\n return;\n }\n\n setGlobal(addNotifyExceptions(getGlobal(), result));\n })();\n});\n\naddReducer('loadNotificationSettings', (global) => {\n const { serverTimeOffset } = global;\n (async () => {\n const result = await callApi('fetchNotificationSettings', {\n serverTimeOffset,\n });\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateNotificationSettings', (global, actions, payload) => {\n const { peerType, isSilent, shouldShowPreviews } = payload!;\n\n (async () => {\n const result = await callApi('updateNotificationSettings', peerType, { isSilent, shouldShowPreviews });\n\n if (!result) {\n return;\n }\n\n setGlobal(updateNotifySettings(getGlobal(), peerType, isSilent, shouldShowPreviews));\n })();\n});\n\naddReducer('updateWebNotificationSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), payload));\n const newGlobal = getGlobal();\n const { hasPushNotifications, hasWebNotifications } = newGlobal.settings.byKey;\n if (hasWebNotifications && hasPushNotifications) {\n await subscribe();\n } else {\n await unsubscribe();\n }\n })();\n});\n\naddReducer('updateContactSignUpNotification', (global, actions, payload) => {\n const { isSilent } = payload!;\n\n (async () => {\n const result = await callApi('updateContactSignUpNotification', isSilent);\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { hasContactJoinedNotifications: !isSilent }));\n })();\n});\n\naddReducer('loadLanguages', () => {\n (async () => {\n const result = await callApi('fetchLanguages');\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { languages: result }));\n })();\n});\n\naddReducer('loadPrivacySettings', () => {\n (async () => {\n const [\n phoneNumberSettings, lastSeenSettings, profilePhotoSettings, forwardsSettings, chatInviteSettings,\n ] = await Promise.all([\n callApi('fetchPrivacySettings', 'phoneNumber'),\n callApi('fetchPrivacySettings', 'lastSeen'),\n callApi('fetchPrivacySettings', 'profilePhoto'),\n callApi('fetchPrivacySettings', 'forwards'),\n callApi('fetchPrivacySettings', 'chatInvite'),\n ]);\n\n if (\n !phoneNumberSettings || !lastSeenSettings || !profilePhotoSettings || !forwardsSettings || !chatInviteSettings\n ) {\n return;\n }\n\n const global = getGlobal();\n\n global.settings.privacy.phoneNumber = phoneNumberSettings;\n global.settings.privacy.lastSeen = lastSeenSettings;\n global.settings.privacy.profilePhoto = profilePhotoSettings;\n global.settings.privacy.forwards = forwardsSettings;\n global.settings.privacy.chatInvite = chatInviteSettings;\n\n setGlobal(global);\n })();\n});\n\naddReducer('setPrivacyVisibility', (global, actions, payload) => {\n const { privacyKey, visibility } = payload!;\n\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility,\n allowedIds: [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\naddReducer('setPrivacySettings', (global, actions, payload) => {\n const { privacyKey, isAllowList, contactsIds } = payload!;\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility: settings.visibility,\n allowedIds: isAllowList ? contactsIds : [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: !isAllowList ? contactsIds : [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\nfunction buildInputPrivacyRules(global: GlobalState, {\n visibility,\n allowedIds,\n deniedIds,\n}: {\n visibility: PrivacyVisibility;\n allowedIds: string[];\n deniedIds: string[];\n}): InputPrivacyRules {\n const {\n users: { byId: usersById },\n chats: { byId: chatsById },\n } = global;\n\n const rules: InputPrivacyRules = {\n visibility,\n };\n let users: InputPrivacyContact[];\n let chats: InputPrivacyContact[];\n\n const collectUsers = (userId: string) => {\n if (!isUserId(userId)) {\n return undefined;\n }\n const { id, accessHash } = usersById[userId] || {};\n if (!id) {\n return undefined;\n }\n\n return { id, accessHash };\n };\n\n const collectChats = (userId: string) => {\n if (isUserId(userId)) {\n return undefined;\n }\n const chat = chatsById[userId];\n\n return chat ? { id: chat.id } : undefined;\n };\n\n if (visibility === 'contacts' || visibility === 'nobody') {\n users = allowedIds.map(collectUsers).filter(Boolean) as InputPrivacyContact[];\n chats = allowedIds.map(collectChats).filter(Boolean) as InputPrivacyContact[];\n\n if (users.length > 0) {\n rules.allowedUsers = users;\n }\n if (chats.length > 0) {\n rules.allowedChats = chats;\n }\n }\n\n if (visibility === 'everybody' || visibility === 'contacts') {\n users = deniedIds.map(collectUsers).filter(Boolean) as InputPrivacyContact[];\n chats = deniedIds.map(collectChats).filter(Boolean) as InputPrivacyContact[];\n\n if (users.length > 0) {\n rules.blockedUsers = users;\n }\n if (chats.length > 0) {\n rules.blockedChats = chats;\n }\n }\n\n return rules;\n}\n\naddReducer('updateIsOnline', (global, actions, payload) => {\n callApi('updateIsOnline', payload);\n});\n\naddReducer('loadContentSettings', () => {\n (async () => {\n const result = await callApi('fetchContentSettings');\n if (!result) return;\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateContentSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: payload }));\n\n const result = await callApi('updateContentSettings', payload);\n if (!result) {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: !payload }));\n }\n })();\n});\n\naddReducer('loadCountryList', (global, actions, payload = {}) => {\n let { langCode } = payload;\n if (!langCode) langCode = global.settings.byKey.language;\n\n (async () => {\n const countryList = await callApi('fetchCountryList', { langCode });\n if (!countryList) return;\n\n setGlobal({\n ...getGlobal(),\n countryList,\n });\n })();\n});\n\naddReducer('ensureTimeFormat', (global, actions) => {\n if (global.authNearestCountry) {\n const timeFormat = COUNTRIES_WITH_12H_TIME_FORMAT.has(global.authNearestCountry.toUpperCase()) ? '12h' : '24h';\n actions.setSettingOption({ timeFormat });\n setTimeFormat(timeFormat);\n }\n\n (async () => {\n if (getGlobal().settings.byKey.wasTimeFormatSetManually) {\n return;\n }\n\n const nearestCountryCode = await callApi('fetchNearestCountry');\n if (nearestCountryCode) {\n const timeFormat = COUNTRIES_WITH_12H_TIME_FORMAT.has(nearestCountryCode.toUpperCase()) ? '12h' : '24h';\n actions.setSettingOption({ timeFormat });\n setTimeFormat(timeFormat);\n }\n })();\n});\n\naddReducer('loadAppConfig', () => {\n (async () => {\n const appConfig = await callApi('fetchAppConfig');\n\n if (!appConfig) return;\n\n setGlobal({\n ...getGlobal(),\n appConfig,\n });\n })();\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport {\n ApiUpdate,\n ApiUpdateAuthorizationState,\n ApiUpdateAuthorizationError,\n ApiUpdateConnectionState,\n ApiUpdateSession,\n ApiUpdateCurrentUser, ApiUpdateServerTimeOffset,\n} from '../../../api/types';\nimport { DEBUG, SESSION_USER_KEY } from '../../../config';\nimport { subscribe } from '../../../util/notifications';\nimport { updateUser } from '../../reducers';\nimport { setLanguage } from '../../../util/langProvider';\nimport { selectNotifySettings } from '../../selectors';\nimport { forceWebsync } from '../../../util/websync';\nimport { getShippingError } from '../../../util/getReadableErrorText';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n if (DEBUG) {\n if (update['@type'] !== 'updateUserStatus' && update['@type'] !== 'updateServerTimeOffset') {\n // eslint-disable-next-line no-console\n console.log('[GramJs] UPDATE', update['@type'], { update });\n }\n }\n\n switch (update['@type']) {\n case 'updateApiReady':\n onUpdateApiReady(global);\n break;\n\n case 'updateAuthorizationState':\n onUpdateAuthorizationState(update);\n break;\n\n case 'updateAuthorizationError':\n onUpdateAuthorizationError(update);\n break;\n\n case 'updateConnectionState':\n onUpdateConnectionState(update);\n break;\n\n case 'updateSession':\n onUpdateSession(update);\n break;\n\n case 'updateServerTimeOffset':\n onUpdateServerTimeOffset(update);\n break;\n\n case 'updateCurrentUser':\n onUpdateCurrentUser(update);\n break;\n\n case 'error': {\n if (update.error.message === 'SESSION_REVOKED') {\n actions.signOut();\n }\n\n const paymentShippingError = getShippingError(update.error);\n if (paymentShippingError) {\n actions.addPaymentError({ error: paymentShippingError });\n } else if (actions.showDialog) {\n actions.showDialog({ data: update.error });\n }\n\n break;\n }\n }\n});\n\nfunction onUpdateApiReady(global: GlobalState) {\n const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);\n if (hasWebNotifications && hasPushNotifications) {\n void subscribe();\n }\n void setLanguage(global.settings.byKey.language);\n}\n\nfunction onUpdateAuthorizationState(update: ApiUpdateAuthorizationState) {\n let global = getGlobal();\n\n const wasAuthReady = global.authState === 'authorizationStateReady';\n const authState = update.authorizationState;\n\n setGlobal({\n ...global,\n authState,\n authIsLoading: false,\n });\n\n global = getGlobal();\n\n switch (authState) {\n case 'authorizationStateLoggingOut':\n void forceWebsync(false);\n\n setGlobal({\n ...global,\n isLoggingOut: true,\n });\n break;\n case 'authorizationStateWaitCode':\n setGlobal({\n ...global,\n authIsCodeViaApp: update.isCodeViaApp,\n });\n break;\n case 'authorizationStateWaitPassword':\n setGlobal({\n ...global,\n authHint: update.hint,\n });\n break;\n case 'authorizationStateWaitQrCode':\n setGlobal({\n ...global,\n authIsLoadingQrCode: false,\n authQrCode: update.qrCode,\n });\n break;\n case 'authorizationStateReady': {\n if (wasAuthReady) {\n break;\n }\n\n void forceWebsync(true);\n\n setGlobal({\n ...global,\n isLoggingOut: false,\n });\n\n break;\n }\n }\n}\n\nfunction onUpdateAuthorizationError(update: ApiUpdateAuthorizationError) {\n setGlobal({\n ...getGlobal(),\n authError: update.message,\n });\n}\n\nfunction onUpdateConnectionState(update: ApiUpdateConnectionState) {\n const { connectionState } = update;\n const global = getGlobal();\n\n if (connectionState === global.connectionState) {\n return;\n }\n\n setGlobal({\n ...global,\n connectionState,\n });\n\n if (connectionState === 'connectionStateBroken') {\n getDispatch().signOut();\n }\n}\n\nfunction onUpdateSession(update: ApiUpdateSession) {\n const { sessionData } = update;\n const { authRememberMe, authState } = getGlobal();\n const isEmpty = !sessionData || !sessionData.mainDcId;\n\n if (!authRememberMe || authState !== 'authorizationStateReady' || isEmpty) {\n return;\n }\n\n getDispatch().saveSession({ sessionData });\n}\n\nfunction onUpdateServerTimeOffset(update: ApiUpdateServerTimeOffset) {\n const global = getGlobal();\n\n if (global.serverTimeOffset === update.serverTimeOffset) {\n return;\n }\n\n setGlobal({\n ...global,\n serverTimeOffset: update.serverTimeOffset,\n });\n}\n\nfunction onUpdateCurrentUser(update: ApiUpdateCurrentUser) {\n const { currentUser } = update;\n\n setGlobal({\n ...updateUser(getGlobal(), currentUser.id, currentUser),\n currentUserId: currentUser.id,\n });\n\n updateSessionUserId(currentUser.id);\n}\n\nfunction updateSessionUserId(currentUserId: string) {\n const sessionUserAuth = localStorage.getItem(SESSION_USER_KEY);\n if (!sessionUserAuth) return;\n\n const userAuth = JSON.parse(sessionUserAuth);\n userAuth.id = currentUserId;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify(userAuth));\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MAX } from '../../../config';\nimport {\n IS_ANDROID, IS_IOS, IS_MAC_OS, IS_SAFARI, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport { setLanguage } from '../../../util/langProvider';\nimport switchTheme from '../../../util/switchTheme';\nimport { selectTheme } from '../../selectors';\nimport { startWebsync } from '../../../util/websync';\nimport { ensurePermanentWebVersion } from '../../../util/permanentWebVersion';\n\nconst HISTORY_ANIMATION_DURATION = 450;\n\nsubscribeToSystemThemeChange();\n\naddReducer('init', (global) => {\n const { animationLevel, messageTextSize, language } = global.settings.byKey;\n const theme = selectTheme(global);\n\n void setLanguage(language, undefined, true);\n\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(messageTextSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(messageTextSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${messageTextSize}px`);\n document.documentElement.setAttribute('data-message-text-size', messageTextSize.toString());\n document.body.classList.add('initial');\n document.body.classList.add(`animation-level-${animationLevel}`);\n document.body.classList.add(IS_TOUCH_ENV ? 'is-touch-env' : 'is-pointer-env');\n\n switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX);\n\n ensurePermanentWebVersion();\n startWebsync();\n\n if (IS_IOS) {\n document.body.classList.add('is-ios');\n } else if (IS_ANDROID) {\n document.body.classList.add('is-android');\n } else if (IS_MAC_OS) {\n document.body.classList.add('is-macos');\n }\n if (IS_SAFARI) {\n document.body.classList.add('is-safari');\n }\n});\n\naddReducer('setIsUiReady', (global, actions, payload) => {\n const { uiReadyState } = payload!;\n\n if (uiReadyState === 2) {\n document.body.classList.remove('initial');\n }\n\n return {\n ...global,\n uiReadyState,\n };\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n return {\n ...global,\n authPhoneNumber: phoneNumber,\n };\n});\n\naddReducer('setAuthRememberMe', (global, actions, payload) => {\n return {\n ...global,\n authRememberMe: Boolean(payload),\n };\n});\n\naddReducer('clearAuthError', (global) => {\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('disableHistoryAnimations', () => {\n setTimeout(() => {\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: false,\n });\n document.body.classList.remove('no-animate');\n }, HISTORY_ANIMATION_DURATION);\n\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: true,\n }, { forceSyncOnIOs: true });\n});\n\nfunction subscribeToSystemThemeChange() {\n function handleSystemThemeChange() {\n const currentThemeMatch = document.documentElement.className.match(/theme-(\\w+)/);\n const currentTheme = currentThemeMatch ? currentThemeMatch[1] : 'light';\n const global = getGlobal();\n const nextTheme = selectTheme(global);\n const { animationLevel } = global.settings.byKey;\n\n if (nextTheme !== currentTheme) {\n switchTheme(nextTheme, animationLevel === ANIMATION_LEVEL_MAX);\n // Force-update component containers\n setGlobal({ ...global });\n }\n }\n\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n }\n}\n","import { addReducer } from '../../../lib/teact/teactn';\nimport { ISettings, IThemeSettings, ThemeKey } from '../../../types';\nimport { replaceSettings, replaceThemeSettings } from '../../reducers';\n\naddReducer('setSettingOption', (global, actions, payload?: Partial) => {\n return replaceSettings(global, payload);\n});\n\naddReducer('setThemeSettings', (global, actions, payload: { theme: ThemeKey } & Partial) => {\n const { theme, ...settings } = payload;\n\n return replaceThemeSettings(global, theme, settings);\n});\n","import {\n ApiChat,\n ApiUser,\n ApiChatBannedRights,\n ApiChatAdminRights,\n ApiChatFolder,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { NotifyException, NotifySettings } from '../../types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { ARCHIVED_FOLDER_ID, REPLIES_USER_ID } from '../../config';\nimport { orderBy } from '../../util/iteratees';\nimport { getUserFirstOrLastName } from './users';\nimport { formatDateToString, formatTime } from '../../util/dateFormat';\nimport { prepareSearchWordsForNeedle } from '../../util/searchWords';\n\nconst FOREVER_BANNED_DATE = Date.now() / 1000 + 31622400; // 366 days\n\nconst VERIFIED_PRIORITY_BASE = 3e9;\nconst PINNED_PRIORITY_BASE = 3e8;\n\nexport function isUserId(entityId: string) {\n // Workaround for old-fashioned IDs stored locally\n if (typeof entityId === 'number') {\n return entityId > 0;\n }\n\n return !entityId.startsWith('-');\n}\n\nexport function isChatGroup(chat: ApiChat) {\n return isChatBasicGroup(chat) || isChatSuperGroup(chat);\n}\n\nexport function isChatBasicGroup(chat: ApiChat) {\n return chat.type === 'chatTypeBasicGroup';\n}\n\nexport function isChatSuperGroup(chat: ApiChat) {\n return chat.type === 'chatTypeSuperGroup';\n}\n\nexport function isChatChannel(chat: ApiChat) {\n return chat.type === 'chatTypeChannel';\n}\n\nexport function isCommonBoxChat(chat: ApiChat) {\n return chat.type === 'chatTypePrivate' || chat.type === 'chatTypeBasicGroup';\n}\n\nexport function isChatWithRepliesBot(chatId: string) {\n return chatId === REPLIES_USER_ID;\n}\n\nexport function getChatTypeString(chat: ApiChat) {\n switch (chat.type) {\n case 'chatTypePrivate':\n return 'PrivateChat';\n case 'chatTypeBasicGroup':\n case 'chatTypeSuperGroup':\n return 'AccDescrGroup';\n case 'chatTypeChannel':\n return 'AccDescrChannel';\n default:\n return 'Chat';\n }\n}\n\nexport function getPrivateChatUserId(chat: ApiChat) {\n if (chat.type !== 'chatTypePrivate' && chat.type !== 'chatTypeSecret') {\n return undefined;\n }\n return chat.id;\n}\n\n// TODO Get rid of `user`\nexport function getChatTitle(lang: LangFn, chat: ApiChat, user?: ApiUser, isSelf = false) {\n if (isSelf || (user && chat.id === user.id && user.isSelf)) {\n return lang('SavedMessages');\n }\n return chat.title || lang('HiddenName');\n}\n\nexport function getChatDescription(chat: ApiChat) {\n if (!chat.fullInfo) {\n return undefined;\n }\n return chat.fullInfo.about;\n}\n\nexport function getChatLink(chat: ApiChat) {\n const { username } = chat;\n if (username) {\n return `https://t.me/${username}`;\n }\n\n const { inviteLink } = chat.fullInfo || {};\n\n return inviteLink;\n}\n\nexport function getChatAvatarHash(\n owner: ApiChat | ApiUser,\n size: 'normal' | 'big' = 'normal',\n) {\n if (!owner.avatarHash) {\n return undefined;\n }\n\n switch (size) {\n case 'big':\n return `profile${owner.id}?${owner.avatarHash}`;\n default:\n return `avatar${owner.id}?${owner.avatarHash}`;\n }\n}\n\nexport function isChatSummaryOnly(chat: ApiChat) {\n return !chat.lastMessage;\n}\n\nexport function isChatAdmin(chat: ApiChat) {\n return Boolean(chat.adminRights);\n}\n\nexport function getHasAdminRight(chat: ApiChat, key: keyof ApiChatAdminRights) {\n return chat.adminRights ? chat.adminRights[key] : false;\n}\n\nexport function isUserRightBanned(chat: ApiChat, key: keyof ApiChatBannedRights) {\n return Boolean(\n (chat.currentUserBannedRights?.[key])\n || (chat.defaultBannedRights?.[key]),\n );\n}\n\nexport function getCanPostInChat(chat: ApiChat, threadId: number) {\n if (threadId !== MAIN_THREAD_ID) {\n return true;\n }\n\n if (chat.isRestricted || chat.migratedTo || chat.isNotJoined || isChatWithRepliesBot(chat.id)) {\n return false;\n }\n\n if (chat.isCreator) {\n return true;\n }\n\n if (isUserId(chat.id)) {\n return true;\n }\n\n if (isChatChannel(chat)) {\n return getHasAdminRight(chat, 'postMessages');\n }\n\n return isChatAdmin(chat) || !isUserRightBanned(chat, 'sendMessages');\n}\n\nexport interface IAllowedAttachmentOptions {\n canAttachMedia: boolean;\n canAttachPolls: boolean;\n canSendStickers: boolean;\n canSendGifs: boolean;\n canAttachEmbedLinks: boolean;\n}\n\nexport function getAllowedAttachmentOptions(chat?: ApiChat, isChatWithBot = false): IAllowedAttachmentOptions {\n if (!chat) {\n return {\n canAttachMedia: false,\n canAttachPolls: false,\n canSendStickers: false,\n canSendGifs: false,\n canAttachEmbedLinks: false,\n };\n }\n\n const isAdmin = isChatAdmin(chat);\n\n return {\n canAttachMedia: isAdmin || !isUserRightBanned(chat, 'sendMedia'),\n canAttachPolls: (isAdmin || !isUserRightBanned(chat, 'sendPolls')) && (!isUserId(chat.id) || isChatWithBot),\n canSendStickers: isAdmin || !isUserRightBanned(chat, 'sendStickers'),\n canSendGifs: isAdmin || !isUserRightBanned(chat, 'sendGifs'),\n canAttachEmbedLinks: isAdmin || !isUserRightBanned(chat, 'embedLinks'),\n };\n}\n\nexport function getMessageSendingRestrictionReason(\n lang: LangFn,\n currentUserBannedRights?: ApiChatBannedRights,\n defaultBannedRights?: ApiChatBannedRights,\n) {\n if (currentUserBannedRights?.sendMessages) {\n const { untilDate } = currentUserBannedRights;\n return untilDate && untilDate < FOREVER_BANNED_DATE\n ? lang(\n 'Channel.Persmission.Denied.SendMessages.Until',\n lang(\n 'formatDateAtTime',\n [formatDateToString(new Date(untilDate * 1000), lang.code), formatTime(lang, untilDate * 1000)],\n ),\n )\n : lang('Channel.Persmission.Denied.SendMessages.Forever');\n }\n\n if (defaultBannedRights?.sendMessages) {\n return lang('Channel.Persmission.Denied.SendMessages.DefaultRestrictedText');\n }\n\n return undefined;\n}\n\nexport function getChatSlowModeOptions(chat?: ApiChat) {\n if (!chat || !chat.fullInfo) {\n return undefined;\n }\n\n return chat.fullInfo.slowMode;\n}\n\nexport function getChatOrder(chat: ApiChat) {\n return Math.max(chat.joinDate || 0, chat.draftDate || 0, chat.lastMessage?.date || 0);\n}\n\nexport function isChatArchived(chat: ApiChat) {\n return chat.folderId === ARCHIVED_FOLDER_ID;\n}\n\nexport function selectIsChatMuted(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = {},\n) {\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].isMuted !== undefined) {\n return notifyExceptions[chat.id].isMuted;\n }\n\n return (\n chat.isMuted\n || (isUserId(chat.id) && !notifySettings.hasPrivateChatsNotifications)\n || (isChatChannel(chat) && !notifySettings.hasBroadcastNotifications)\n || (isChatGroup(chat) && !notifySettings.hasGroupNotifications)\n );\n}\n\nexport function selectShouldShowMessagePreview(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = {},\n) {\n const {\n hasPrivateChatsMessagePreview = true,\n hasBroadcastMessagePreview = true,\n hasGroupMessagePreview = true,\n } = notifySettings;\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].shouldShowPreviews !== undefined) {\n return notifyExceptions[chat.id].shouldShowPreviews;\n }\n\n return (isUserId(chat.id) && hasPrivateChatsMessagePreview)\n || (isChatChannel(chat) && hasBroadcastMessagePreview)\n || (isChatGroup(chat) && hasGroupMessagePreview);\n}\n\nexport function getCanDeleteChat(chat: ApiChat) {\n return isChatBasicGroup(chat) || ((isChatSuperGroup(chat) || isChatChannel(chat)) && chat.isCreator);\n}\n\nexport function getFolderDescriptionText(lang: LangFn, folder: ApiChatFolder, chatsCount?: number) {\n const {\n id, title, emoticon, description, pinnedChatIds,\n excludedChatIds, includedChatIds,\n excludeArchived, excludeMuted, excludeRead,\n ...filters\n } = folder;\n\n // If folder has multiple additive filters or uses include/exclude lists,\n // we display folder chats count\n if (\n chatsCount !== undefined && (\n Object.values(filters).filter(Boolean).length > 1\n || (excludedChatIds?.length)\n || (includedChatIds?.length)\n )) {\n return lang('Chats', chatsCount);\n }\n\n // Otherwise, we return a short description of a single filter\n if (filters.bots) {\n return lang('FilterBots');\n } else if (filters.groups) {\n return lang('FilterGroups');\n } else if (filters.channels) {\n return lang('FilterChannels');\n } else if (filters.contacts) {\n return lang('FilterContacts');\n } else if (filters.nonContacts) {\n return lang('FilterNonContacts');\n } else {\n return undefined;\n }\n}\n\nexport function getMessageSenderName(lang: LangFn, chatId: string, sender?: ApiUser) {\n if (!sender || isUserId(chatId)) {\n return undefined;\n }\n\n if (sender.isSelf) {\n return lang('FromYou');\n }\n\n return getUserFirstOrLastName(sender);\n}\n\nexport function sortChatIds(\n chatIds: string[],\n chatsById: Record,\n shouldPrioritizeVerified = false,\n priorityIds?: string[],\n) {\n return orderBy(chatIds, (id) => {\n const chat = chatsById[id];\n if (!chat) {\n return 0;\n }\n\n let priority = 0;\n\n if (chat.lastMessage) {\n priority += chat.lastMessage.date;\n }\n\n if (shouldPrioritizeVerified && chat.isVerified) {\n priority += VERIFIED_PRIORITY_BASE; // ~100 years in seconds\n }\n\n if (priorityIds && priorityIds.includes(id)) {\n priority = Date.now() + PINNED_PRIORITY_BASE + (priorityIds.length - priorityIds.indexOf(id));\n }\n\n return priority;\n }, 'desc');\n}\n\nexport function filterChatsByName(\n lang: LangFn,\n chatIds: string[],\n chatsById: Record,\n query?: string,\n currentUserId?: string,\n) {\n if (!query) {\n return chatIds;\n }\n\n const searchWords = prepareSearchWordsForNeedle(query);\n\n return chatIds.filter((id) => {\n const chat = chatsById[id];\n if (!chat) {\n return false;\n }\n\n return searchWords(getChatTitle(lang, chat, undefined, id === currentUserId));\n });\n}\n","import {\n ApiChat, ApiMessage, ApiMessageEntityTypes, ApiReactions, ApiUser,\n} from '../../api/types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport {\n CONTENT_NOT_SUPPORTED,\n LOCAL_MESSAGE_ID_BASE,\n RE_LINK_TEMPLATE,\n SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../config';\nimport { getUserFullName } from './users';\nimport { IS_OPUS_SUPPORTED, isWebpSupported } from '../../util/environment';\nimport { getChatTitle, isUserId } from './chats';\nimport parseEmojiOnlyString from '../../components/common/helpers/parseEmojiOnlyString';\n\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\n\nexport type MessageKey = `msg${string}-${number}`;\n\nexport function getMessageKey(message: ApiMessage): MessageKey {\n const { chatId, id } = message;\n\n return buildMessageKey(chatId, id);\n}\n\nexport function buildMessageKey(chatId: string, msgId: number): MessageKey {\n return `msg${chatId}-${msgId}`;\n}\n\nexport function parseMessageKey(key: MessageKey) {\n const match = key.match(/^msg(-?\\d+)-(\\d+)/)!;\n\n return { chatId: match[1], messageId: Number(match[2]) };\n}\n\nexport function getMessageOriginalId(message: ApiMessage) {\n return message.previousLocalId || message.id;\n}\n\nexport function getMessageText(message: ApiMessage) {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact, invoice,\n } = message.content;\n\n if (text) {\n return text.text;\n }\n\n if (sticker || photo || video || audio || voice || document || contact || poll || webPage || invoice) {\n return undefined;\n }\n\n return CONTENT_NOT_SUPPORTED;\n}\n\nexport function getMessageCustomShape(message: ApiMessage): boolean | number {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact,\n } = message.content;\n\n if (sticker || (video?.isRound)) {\n return true;\n }\n\n if (!text || photo || video || audio || voice || document || poll || webPage || contact) {\n return false;\n }\n\n // This is a \"dual-intent\" method used to limit calls of `parseEmojiOnlyString`.\n return parseEmojiOnlyString(text.text) || false;\n}\n\nexport function getMessageSingleEmoji(message: ApiMessage) {\n const { text } = message.content;\n if (!(text && text.text.length <= 6)) {\n return undefined;\n }\n\n if (getMessageCustomShape(message) !== 1) {\n return undefined;\n }\n\n return text.text;\n}\n\nexport function getFirstLinkInMessage(message: ApiMessage) {\n const { text } = message.content;\n\n let match: RegExpMatchArray | null | undefined;\n if (text?.entities) {\n let link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.TextUrl);\n if (link) {\n match = link.url!.match(RE_LINK);\n }\n\n if (!match) {\n link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.Url);\n if (link) {\n const { offset, length } = link;\n match = text.text.substring(offset, offset + length).match(RE_LINK);\n }\n }\n }\n\n if (!match && text) {\n match = text.text.match(RE_LINK);\n }\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function matchLinkInMessageText(message: ApiMessage) {\n const { text } = message.content;\n const match = text && text.text.match(RE_LINK);\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function isOwnMessage(message: ApiMessage) {\n return message.isOutgoing;\n}\n\nexport function isReplyMessage(message: ApiMessage) {\n return Boolean(message.replyToMessageId);\n}\n\nexport function isForwardedMessage(message: ApiMessage) {\n return Boolean(message.forwardInfo);\n}\n\nexport function isActionMessage(message: ApiMessage) {\n return Boolean(message.content.action);\n}\n\nexport function isServiceNotificationMessage(message: ApiMessage) {\n return message.chatId === SERVICE_NOTIFICATIONS_USER_ID && Math.round(message.id) !== message.id;\n}\n\nexport function isAnonymousOwnMessage(message: ApiMessage) {\n return Boolean(message.senderId) && !isUserId(message.senderId!) && isOwnMessage(message);\n}\n\nexport function getSenderTitle(lang: LangFn, sender: ApiUser | ApiChat) {\n return isUserId(sender.id) ? getUserFullName(sender as ApiUser) : getChatTitle(lang, sender as ApiChat);\n}\n\nexport function getSendingState(message: ApiMessage) {\n if (!message.sendingState) {\n return 'succeeded';\n }\n\n return message.sendingState === 'messageSendingStateFailed' ? 'failed' : 'pending';\n}\n\nexport function isMessageLocal(message: ApiMessage) {\n return message.id >= LOCAL_MESSAGE_ID_BASE;\n}\n\nexport function isHistoryClearMessage(message: ApiMessage) {\n return message.content.action && message.content.action.type === 'historyClear';\n}\n\nexport function getMessageContentFilename(message: ApiMessage) {\n const { content } = message;\n\n const video = content.webPage ? content.webPage.video : content.video;\n const photo = content.webPage ? content.webPage.photo : content.photo;\n const document = content.webPage ? content.webPage.document : content.document;\n if (document) {\n return document.fileName;\n }\n\n if (video) {\n return video.fileName;\n }\n\n if (content.sticker) {\n const extension = content.sticker.isLottie ? 'tgs' : content.sticker.isGif\n ? 'webm' : isWebpSupported() ? 'webp' : 'png';\n return `${content.sticker.id}.${extension}`;\n }\n\n if (content.audio) {\n return content.audio.fileName;\n }\n\n const baseFilename = getMessageKey(message);\n\n if (photo) {\n return `${baseFilename}.jpg`;\n }\n\n if (content.voice) {\n return IS_OPUS_SUPPORTED ? `${baseFilename}.ogg` : `${baseFilename}.wav`;\n }\n\n return baseFilename;\n}\n\nexport function areReactionsEmpty(reactions: ApiReactions) {\n return !reactions.results.some((l) => l.count > 0);\n}\n","import { ApiMessage, ApiMessageEntityTypes } from '../../api/types';\nimport type { TextPart } from '../../components/common/helpers/renderTextWithEntities';\nimport { CONTENT_NOT_SUPPORTED } from '../../config';\n\nimport { LangFn } from '../../hooks/useLang';\nimport trimText from '../../util/trimText';\nimport { getMessageText } from './messages';\nimport { getMessageRecentReaction } from './reactions';\n\nconst SPOILER_CHARS = ['⠺', '⠵', '⠞', '⠟'];\nexport const TRUNCATED_SUMMARY_LENGTH = 80;\n\nexport function getMessageSummaryText(\n lang: LangFn,\n message: ApiMessage,\n noEmoji = false,\n truncateLength = TRUNCATED_SUMMARY_LENGTH,\n noReactions = true,\n isExtended = false,\n) {\n const emoji = !noEmoji && getMessageSummaryEmoji(message, noReactions);\n const emojiWithSpace = emoji ? `${emoji} ` : '';\n const text = trimText(getMessageTextWithSpoilers(message), truncateLength);\n const description = getMessageSummaryDescription(lang, message, text, noReactions, isExtended);\n\n return `${emojiWithSpace}${description}`;\n}\n\nexport function getMessageTextWithSpoilers(message: ApiMessage) {\n const text = getMessageText(message);\n if (!text) {\n return undefined;\n }\n\n const { entities } = message.content.text || {};\n if (!entities?.length) {\n return text;\n }\n\n return entities.reduce((accText, {\n type,\n offset,\n length,\n }) => {\n if (type !== ApiMessageEntityTypes.Spoiler) {\n return accText;\n }\n\n const spoiler = generateBrailleSpoiler(length);\n\n\n return `${accText.substr(0, offset)}${spoiler}${accText.substr(offset + length, accText.length)}`;\n }, text);\n}\n\nexport function getMessageSummaryEmoji(message: ApiMessage, noReactions = true) {\n const {\n photo,\n video,\n audio,\n voice,\n document,\n sticker,\n poll,\n } = message.content;\n\n if (message.groupedId || photo) {\n return '🖼';\n }\n\n if (video) {\n return '📹';\n }\n\n if (sticker) {\n return sticker.emoji;\n }\n\n if (audio) {\n return '🎧';\n }\n\n if (voice) {\n return '🎤';\n }\n\n if (document) {\n return '📎';\n }\n\n if (poll) {\n return '📊';\n }\n\n const reaction = !noReactions && getMessageRecentReaction(message);\n if (reaction) {\n return reaction.reaction;\n }\n\n return undefined;\n}\n\nexport function getMessageSummaryDescription(\n lang: LangFn,\n message: ApiMessage,\n truncatedText?: string | TextPart[],\n noReactions = true,\n isExtended = false,\n) {\n const {\n text,\n photo,\n video,\n audio,\n voice,\n document,\n sticker,\n contact,\n poll,\n invoice,\n } = message.content;\n\n let summary: string | TextPart[] | undefined;\n\n if (message.groupedId) {\n summary = truncatedText || lang('lng_in_dlg_album');\n }\n\n if (photo) {\n summary = truncatedText || lang('AttachPhoto');\n }\n\n if (video) {\n summary = truncatedText || lang(video.isGif ? 'AttachGif' : 'AttachVideo');\n }\n\n if (sticker) {\n summary = lang('AttachSticker').trim();\n }\n\n if (audio) {\n summary = getMessageAudioCaption(message) || lang('AttachMusic');\n }\n\n if (voice) {\n summary = truncatedText || lang('AttachAudio');\n }\n\n if (document) {\n summary = isExtended ? document.fileName : (truncatedText || document.fileName);\n }\n\n if (contact) {\n summary = lang('AttachContact');\n }\n\n if (poll) {\n summary = poll.summary.question;\n }\n\n if (invoice) {\n summary = lang('PaymentInvoice') + ': ' + invoice.text;\n }\n\n if (text) {\n if (isExtended && summary) {\n summary += '\\n' + truncatedText;\n } else {\n summary = truncatedText;\n }\n }\n\n const reaction = !noReactions && getMessageRecentReaction(message);\n if (summary && reaction) {\n summary = `to your \"${summary}\"`;\n }\n\n return summary || CONTENT_NOT_SUPPORTED;\n}\n\nexport function generateBrailleSpoiler(length: number) {\n return new Array(length)\n .fill(undefined)\n .map(() => SPOILER_CHARS[Math.floor(Math.random() * SPOILER_CHARS.length)])\n .join('');\n}\n\nfunction getMessageAudioCaption(message: ApiMessage) {\n const {\n audio,\n text,\n } = message.content;\n\n return (audio && [audio.title, audio.performer].filter(Boolean)\n .join(' — ')) || (text?.text);\n}\n","import {\n ApiAudio, ApiMediaFormat, ApiMessage, ApiMessageSearchType, ApiPhoto, ApiVideo, ApiDimensions,\n} from '../../api/types';\n\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, IS_SAFARI } from '../../util/environment';\nimport { getMessageKey, isMessageLocal, matchLinkInMessageText } from './messages';\nimport { getDocumentHasPreview } from '../../components/common/helpers/documentInfo';\n\ntype Target =\n 'micro'\n | 'pictogram'\n | 'inline'\n | 'viewerPreview'\n | 'viewerFull'\n | 'download';\n\nexport function getMessageContent(message: ApiMessage) {\n return message.content;\n}\n\nexport function hasMessageMedia(message: ApiMessage) {\n return Boolean((\n getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageContact(message)\n || getMessagePoll(message)\n || getMessageAction(message)\n || getMessageAudio(message)\n || getMessageVoice(message)\n ));\n}\n\nexport function getMessagePhoto(message: ApiMessage) {\n return message.content.photo;\n}\n\nexport function getMessageVideo(message: ApiMessage) {\n return message.content.video;\n}\n\nexport function getMessageRoundVideo(message: ApiMessage) {\n const { video } = message.content;\n\n return video?.isRound ? video : undefined;\n}\n\nexport function getMessageAction(message: ApiMessage) {\n return message.content.action;\n}\n\nexport function getMessageAudio(message: ApiMessage) {\n return message.content.audio;\n}\n\nexport function getMessageVoice(message: ApiMessage) {\n return message.content.voice;\n}\n\nexport function getMessageSticker(message: ApiMessage) {\n return message.content.sticker;\n}\n\nexport function getMessageDocument(message: ApiMessage) {\n return message.content.document;\n}\n\nexport function isMessageDocumentPhoto(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'photo' : undefined;\n}\n\nexport function isMessageDocumentVideo(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'video' : undefined;\n}\n\nexport function getMessageContact(message: ApiMessage) {\n return message.content.contact;\n}\n\nexport function getMessagePoll(message: ApiMessage) {\n return message.content.poll;\n}\n\nexport function getMessageInvoice(message: ApiMessage) {\n return message.content.invoice;\n}\n\nexport function getMessageWebPage(message: ApiMessage) {\n return message.content.webPage;\n}\n\nexport function getMessageWebPagePhoto(message: ApiMessage) {\n return getMessageWebPage(message)?.photo;\n}\n\nexport function getMessageWebPageDocument(message: ApiMessage) {\n return getMessageWebPage(message)?.document;\n}\n\nexport function getMessageWebPageVideo(message: ApiMessage): ApiVideo | undefined {\n return getMessageWebPage(message)?.video;\n}\n\nexport function getMessageMediaThumbnail(message: ApiMessage) {\n const media = getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageWebPagePhoto(message)\n || getMessageWebPageVideo(message);\n\n if (!media) {\n return undefined;\n }\n\n return media.thumbnail;\n}\n\nexport function getMessageMediaThumbDataUri(message: ApiMessage) {\n return getMessageMediaThumbnail(message)?.dataUri;\n}\n\nexport function getMessageMediaHash(\n message: ApiMessage,\n target: Target,\n) {\n const {\n photo, video, sticker, audio, voice, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n const messageVideo = video || webPageVideo;\n const messagePhoto = photo || webPagePhoto;\n\n if (!(messagePhoto || messageVideo || sticker || audio || voice || document)) {\n return undefined;\n }\n\n const mediaId = (messagePhoto || messageVideo || sticker || audio || voice || document)!.id;\n const base = `${getMessageKey(message)}${mediaId ? `:${mediaId}` : ''}`;\n\n if (messageVideo) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? getVideoOrAudioBaseHash(messageVideo, base) : undefined;\n case 'viewerPreview':\n return `${base}?size=m`;\n case 'viewerFull':\n return getVideoOrAudioBaseHash(messageVideo, base);\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (messagePhoto) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? `${base}?size=x` : undefined;\n case 'viewerPreview':\n return `${base}?size=x`;\n case 'viewerFull':\n case 'download':\n return `${base}?size=z`;\n }\n }\n\n if (document) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n case 'inline':\n case 'viewerPreview':\n if (!getDocumentHasPreview(document) || hasMessageLocalBlobUrl(message)) {\n return undefined;\n }\n\n return `${base}?size=m`;\n case 'viewerFull':\n case 'download':\n return base;\n }\n }\n\n if (sticker) {\n switch (target) {\n case 'micro':\n return undefined;\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return base;\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (audio) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return getAudioHasCover(audio) ? `${base}?size=m` : undefined;\n case 'inline':\n return getVideoOrAudioBaseHash(audio, base);\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (voice) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n case 'inline':\n return base;\n case 'download':\n return `${base}?download`;\n }\n }\n\n return undefined;\n}\n\nfunction getVideoOrAudioBaseHash(media: ApiAudio | ApiVideo, base: string) {\n if (IS_PROGRESSIVE_SUPPORTED && IS_SAFARI) {\n return `${base}?fileSize=${media.size}&mimeType=${media.mimeType}`;\n }\n\n return base;\n}\n\nexport function getAudioHasCover(media: ApiAudio) {\n return media.thumbnailSizes && media.thumbnailSizes.length > 0;\n}\n\nexport function getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): ApiMediaFormat {\n const {\n sticker, video, audio, voice,\n } = message.content;\n\n const fullVideo = video || getMessageWebPageVideo(message);\n\n if (sticker && target === 'inline' && sticker.isLottie) {\n return ApiMediaFormat.Lottie;\n } else if (fullVideo && IS_PROGRESSIVE_SUPPORTED && (\n target === 'viewerFull' || target === 'inline'\n )) {\n return ApiMediaFormat.Progressive;\n } else if (audio || voice) {\n // Safari\n if (voice && !IS_OPUS_SUPPORTED) {\n return ApiMediaFormat.BlobUrl;\n }\n\n return ApiMediaFormat.Progressive;\n }\n\n return ApiMediaFormat.BlobUrl;\n}\n\nexport function getMessageFileName(message: ApiMessage) {\n const {\n photo, video, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n if (photo || webPagePhoto) {\n return `photo${message.date}.jpeg`;\n }\n\n const { fileName } = video || webPageVideo || document || {};\n\n return fileName;\n}\n\nexport function getMessageFileSize(message: ApiMessage) {\n const { video, document } = message.content;\n const webPageVideo = getMessageWebPageVideo(message);\n const { size } = video || webPageVideo || document || {};\n\n return size;\n}\n\nexport function hasMessageLocalBlobUrl(message: ApiMessage) {\n const { photo, video, document } = message.content;\n\n return (photo?.blobUrl) || (video?.blobUrl) || (document?.previewBlobUrl);\n}\n\nexport function getChatMediaMessageIds(\n messages: Record, listedIds: number[], isFromSharedMedia = false,\n) {\n return getMessageContentIds(messages, listedIds, isFromSharedMedia ? 'media' : 'inlineMedia');\n}\n\nexport function getPhotoFullDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'z')\n || photo.sizes.find((size) => size.type === 'y')\n || getPhotoInlineDimensions(photo)\n );\n}\n\nexport function getPhotoInlineDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'x')\n || photo.sizes.find((size) => size.type === 'm')\n || photo.sizes.find((size) => size.type === 's')\n || photo.thumbnail\n );\n}\n\nexport function getVideoDimensions(video: ApiVideo): ApiDimensions | undefined {\n if (video.width && video.height) {\n return video as ApiDimensions;\n }\n\n return undefined;\n}\n\nexport function getMediaTransferState(message: ApiMessage, progress?: number, isLoadNeeded = false) {\n const isUploading = isMessageLocal(message);\n const isTransferring = isUploading || isLoadNeeded;\n const transferProgress = Number(progress);\n\n return {\n isUploading, isTransferring, transferProgress,\n };\n}\n\nexport function getMessageContentIds(\n messages: Record, messageIds: number[], contentType: ApiMessageSearchType | 'inlineMedia',\n) {\n let validator: Function;\n\n switch (contentType) {\n case 'media':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return getMessagePhoto(message) || (video && !video.isRound && !video.isGif);\n };\n break;\n\n case 'documents':\n validator = getMessageDocument;\n break;\n\n case 'links':\n validator = (message: ApiMessage) => getMessageWebPage(message) || matchLinkInMessageText(message);\n break;\n\n case 'audio':\n validator = getMessageAudio;\n break;\n\n case 'voice':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return getMessageVoice(message) || (video && video.isRound);\n };\n break;\n\n case 'inlineMedia':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return (\n getMessagePhoto(message)\n || (video && !video.isRound && !video.isGif)\n || isMessageDocumentPhoto(message)\n || isMessageDocumentVideo(message)\n );\n };\n break;\n\n default:\n return [] as Array;\n }\n\n return messageIds.reduce((result, messageId) => {\n if (messages[messageId] && validator(messages[messageId])) {\n result.push(messageId);\n }\n\n return result;\n }, [] as Array);\n}\n\nexport function getMediaDuration(message: ApiMessage) {\n const { audio, voice, video } = getMessageContent(message);\n const media = audio || voice || video || getMessageWebPageVideo(message);\n if (!media) {\n return undefined;\n }\n\n return media.duration;\n}\n","export function buildChatThreadKey(chatId: string, threadId: number) {\n return `${chatId}_${threadId}`;\n}\n","import { ApiFieldError } from '../../api/types';\n\nconst STRIPE_ERRORS: Record = {\n missing_payment_information: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n invalid_number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n exp_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n exp_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n invalid_expiry_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n invalid_expiry_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n invalid_cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n};\n\nexport function getStripeError(error: {\n code: string;\n message: string;\n param?: string;\n}) {\n const { message: description, code, param } = error;\n const { field, message } = param ? STRIPE_ERRORS[param] : STRIPE_ERRORS[code];\n\n return { field, message, description };\n}\n","import { ApiMessage, ApiReactions } from '../../api/types';\n\nexport function getMessageRecentReaction(message: Partial) {\n return message.isOutgoing ? message.reactions?.recentReactions?.[0] : undefined;\n}\n\nexport function checkIfReactionAdded(oldReactions?: ApiReactions, newReactions?: ApiReactions) {\n if (!oldReactions || !oldReactions.recentReactions) return true;\n if (!newReactions || !newReactions.recentReactions) return false;\n const oldReactionsMap = oldReactions.results.reduce>((acc, reaction) => {\n acc[reaction.reaction] = reaction.count;\n return acc;\n }, {});\n return newReactions.results.some(r => !oldReactionsMap[r.reaction] || oldReactionsMap[r.reaction] < r.count);\n}\n","import { ApiChat, ApiUser, ApiUserStatus } from '../../api/types';\n\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../../config';\nimport { formatFullDate, formatTime } from '../../util/dateFormat';\nimport { orderBy } from '../../util/iteratees';\nimport { LangFn } from '../../hooks/useLang';\nimport { getServerTime } from '../../util/serverTime';\nimport { prepareSearchWordsForNeedle } from '../../util/searchWords';\n\nconst USER_COLOR_KEYS = [1, 8, 5, 2, 7, 4, 6];\n\nexport function getUserFirstOrLastName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n return user.firstName || user.lastName;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted';\n }\n\n default:\n return undefined;\n }\n}\n\nexport function getUserFullName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n if (isDeletedUser(user)) {\n return 'Deleted account';\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n if (user.firstName && user.lastName) {\n return `${user.firstName} ${user.lastName}`;\n }\n\n if (user.firstName) {\n return user.firstName;\n }\n\n if (user.lastName) {\n return user.lastName;\n }\n\n break;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted account';\n }\n }\n\n return undefined;\n}\n\nexport function getUserStatus(\n lang: LangFn, user: ApiUser, userStatus: ApiUserStatus | undefined, serverTimeOffset: number,\n) {\n if (user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return lang('ServiceNotifications').toLowerCase();\n }\n\n if (user.type && user.type === 'userTypeBot') {\n return lang('Bot');\n }\n\n if (!userStatus) {\n return '';\n }\n\n switch (userStatus.type) {\n case 'userStatusEmpty': {\n return lang('ALongTimeAgo');\n }\n\n case 'userStatusLastMonth': {\n return lang('WithinAMonth');\n }\n\n case 'userStatusLastWeek': {\n return lang('WithinAWeek');\n }\n\n case 'userStatusOffline': {\n const { wasOnline } = userStatus;\n\n if (!wasOnline) return lang('LastSeen.Offline');\n\n const now = new Date(new Date().getTime() + serverTimeOffset * 1000);\n const wasOnlineDate = new Date(wasOnline * 1000);\n\n if (wasOnlineDate >= now) {\n return lang('LastSeen.JustNow');\n }\n\n const diff = new Date(now.getTime() - wasOnlineDate.getTime());\n\n // within a minute\n if (diff.getTime() / 1000 < 60) {\n return lang('LastSeen.JustNow');\n }\n\n // within an hour\n if (diff.getTime() / 1000 < 60 * 60) {\n const minutes = Math.floor(diff.getTime() / 1000 / 60);\n return lang('LastSeen.MinutesAgo', minutes);\n }\n\n // today\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const serverToday = new Date(today.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverToday) {\n // up to 6 hours ago\n if (diff.getTime() / 1000 < 6 * 60 * 60) {\n const hours = Math.floor(diff.getTime() / 1000 / 60 / 60);\n return lang('LastSeen.HoursAgo', hours);\n }\n\n // other\n return lang('LastSeen.TodayAt', formatTime(lang, wasOnlineDate));\n }\n\n // yesterday\n const yesterday = new Date();\n yesterday.setDate(now.getDate() - 1);\n yesterday.setHours(0, 0, 0, 0);\n const serverYesterday = new Date(yesterday.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverYesterday) {\n return lang('LastSeen.YesterdayAt', formatTime(lang, wasOnlineDate));\n }\n\n return lang('LastSeen.AtDate', formatFullDate(lang, wasOnlineDate));\n }\n\n case 'userStatusOnline': {\n return lang('Online');\n }\n\n case 'userStatusRecently': {\n return lang('Lately');\n }\n\n default:\n return undefined;\n }\n}\n\nexport function isUserOnline(user: ApiUser, userStatus?: ApiUserStatus) {\n const { id, type } = user;\n\n if (!userStatus) {\n return false;\n }\n\n if (id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return userStatus.type === 'userStatusOnline' && type !== 'userTypeBot';\n}\n\nexport function isDeletedUser(user: ApiUser) {\n if (user.noStatus || user.type === 'userTypeBot' || user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return user.type === 'userTypeDeleted'\n || user.type === 'userTypeUnknown';\n}\n\nexport function isUserBot(user: ApiUser) {\n return user.type === 'userTypeBot';\n}\n\nexport function getCanAddContact(user: ApiUser) {\n return !user.isContact && !isUserBot(user);\n}\n\nexport function sortUserIds(\n userIds: string[],\n usersById: Record,\n userStatusesById: Record,\n priorityIds?: string[],\n serverTimeOffset = 0,\n) {\n return orderBy(userIds, (id) => {\n const now = getServerTime(serverTimeOffset);\n\n if (priorityIds && priorityIds.includes(id)) {\n // Assuming that online status expiration date can't be as far as two days from now,\n // this should place prioritized on top of the list.\n // Then we subtract index of `id` in `priorityIds` to preserve selected order\n return now + (48 * 60 * 60) - (priorityIds.length - priorityIds.indexOf(id));\n }\n\n const user = usersById[id];\n const userStatus = userStatusesById[id];\n if (!user || !userStatus) {\n return 0;\n }\n\n if (userStatus.type === 'userStatusOnline') {\n return userStatus.expires;\n } else if (userStatus.type === 'userStatusOffline' && userStatus.wasOnline) {\n return userStatus.wasOnline;\n }\n\n switch (userStatus.type) {\n case 'userStatusRecently':\n return now - 60 * 60 * 24;\n case 'userStatusLastWeek':\n return now - 60 * 60 * 24 * 7;\n case 'userStatusLastMonth':\n return now - 60 * 60 * 24 * 7 * 30;\n default:\n return 0;\n }\n }, 'desc');\n}\n\nexport function filterUsersByName(\n userIds: string[],\n usersById: Record,\n query?: string,\n currentUserId?: string,\n savedMessagesLang?: string,\n) {\n if (!query) {\n return userIds;\n }\n\n const searchWords = prepareSearchWordsForNeedle(query);\n\n return userIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n\n const name = id === currentUserId ? savedMessagesLang : getUserFullName(user);\n return (name && searchWords(name)) || searchWords(user.username);\n });\n}\n\nexport function getUserIdDividend(userId: string) {\n // Workaround for old-fashioned IDs stored locally\n if (typeof userId === 'number') {\n return Math.abs(userId);\n }\n\n return Math.abs(Number(userId));\n}\n\n// eslint-disable-next-line max-len\n// https://github.com/telegramdesktop/tdesktop/blob/371510cfe23b0bd226de8c076bc49248fbe40c26/Telegram/SourceFiles/data/data_peer.cpp#L53\nexport function getUserColorKey(peer: ApiUser | ApiChat | undefined) {\n const index = peer ? getUserIdDividend(peer.id) % 7 : 0;\n\n return USER_COLOR_KEYS[index];\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiPhoto } from '../../api/types';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { omit } from '../../util/iteratees';\nimport { selectChatListType } from '../selectors';\n\nexport function replaceChatListIds(\n global: GlobalState,\n type: 'active' | 'archived',\n newIds: string[] | undefined,\n): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n listIds: {\n ...global.chats.listIds,\n [type]: newIds,\n },\n },\n };\n}\n\nexport function updateChatListIds(global: GlobalState, type: 'active' | 'archived', idsUpdate: string[]): GlobalState {\n const { [type]: listIds } = global.chats.listIds;\n const newIds = listIds?.length\n ? idsUpdate.filter((id) => !listIds.includes(id))\n : idsUpdate;\n\n if (listIds && !newIds.length) {\n return global;\n }\n\n return replaceChatListIds(global, type, [\n ...(listIds || []),\n ...newIds,\n ]);\n}\n\nexport function replaceChats(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n byId: newById,\n },\n };\n}\n\nexport function updateChat(\n global: GlobalState, chatId: string, chatUpdate: Partial, photo?: ApiPhoto,\n): GlobalState {\n const { byId } = global.chats;\n\n const updatedChat = getUpdatedChat(global, chatId, chatUpdate, photo);\n if (!updatedChat) {\n return global;\n }\n\n return replaceChats(global, {\n ...byId,\n [chatId]: updatedChat,\n });\n}\n\nexport function updateChats(global: GlobalState, newById: Record): GlobalState {\n const updatedById = Object.keys(newById).reduce((acc: Record, id) => {\n const updatedChat = getUpdatedChat(global, id, newById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n }\n\n return acc;\n }, {});\n\n global = replaceChats(global, {\n ...global.chats.byId,\n ...updatedById,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addChats(global: GlobalState, newById: Record): GlobalState {\n const { byId } = global.chats;\n let isUpdated = false;\n\n const addedById = Object.keys(newById).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !newById[id].isMin)) {\n const updatedChat = getUpdatedChat(global, id, newById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n if (!isUpdated) {\n isUpdated = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (!isUpdated) {\n return global;\n }\n\n global = replaceChats(global, {\n ...byId,\n ...addedById,\n });\n\n return global;\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedChat(\n global: GlobalState, chatId: string, chatUpdate: Partial, photo?: ApiPhoto,\n) {\n const { byId } = global.chats;\n const chat = byId[chatId];\n const shouldOmitMinInfo = chatUpdate.isMin && chat && !chat.isMin;\n const updatedChat: ApiChat = {\n ...chat,\n ...(shouldOmitMinInfo ? omit(chatUpdate, ['isMin', 'accessHash']) : chatUpdate),\n ...(photo && { photos: [photo, ...(chat.photos || [])] }),\n };\n\n if (!updatedChat.id || !updatedChat.type) {\n return undefined;\n }\n\n return updatedChat;\n}\n\nexport function updateChatListType(\n global: GlobalState,\n chatId: string,\n folderId?: number,\n): GlobalState {\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n let currentListIds = global.chats.listIds;\n (Object.keys(currentListIds) as Array).forEach((listTypeKey) => {\n const currentFolderList = currentListIds[listTypeKey] || [];\n if (listTypeKey === listType && !currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: [...currentFolderList, chatId],\n };\n } else if (listTypeKey !== listType && currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: currentFolderList.filter((id) => id !== chatId),\n };\n }\n });\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n listIds: currentListIds,\n },\n };\n\n global = updateChat(global, chatId, { folderId: folderId || undefined });\n\n return global;\n}\n\nexport function updateChatListSecondaryInfo(\n global: GlobalState,\n type: 'active' | 'archived',\n info: {\n orderedPinnedIds?: string[];\n totalChatCount: number;\n },\n): GlobalState {\n const totalCountKey = type === 'active' ? 'all' : 'archived';\n\n return {\n ...global,\n chats: {\n ...global.chats,\n ...(info.orderedPinnedIds && {\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [type]: info.orderedPinnedIds,\n },\n }),\n totalCount: {\n ...global.chats.totalCount,\n [totalCountKey]: info.totalChatCount,\n },\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [type]: false,\n },\n },\n };\n}\n\nexport function leaveChat(global: GlobalState, leftChatId: string): GlobalState {\n const listType = selectChatListType(global, leftChatId);\n if (!listType) {\n return global;\n }\n\n const { [listType]: listIds } = global.chats.listIds;\n\n if (listIds) {\n global = replaceChatListIds(global, listType, listIds.filter((listId) => listId !== leftChatId));\n }\n\n global = updateChat(global, leftChatId, { isNotJoined: true });\n\n return global;\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types';\nimport { buildCollectionByKey, unique } from '../../util/iteratees';\nimport { selectStickersForEmoji } from '../selectors';\n\nexport function updateStickerSets(\n global: GlobalState,\n category: 'added' | 'featured' | 'search',\n hash: string,\n sets: ApiStickerSet[],\n resultIds?: string[],\n): GlobalState {\n const updatedSets = sets.map((stickerSet) => {\n const existing = global.stickers.setsById[stickerSet.id];\n if (!existing) {\n return stickerSet;\n }\n\n return {\n ...existing,\n ...stickerSet,\n };\n });\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n setsById: {\n ...global.stickers.setsById,\n ...buildCollectionByKey(updatedSets, 'id'),\n },\n [category]: {\n ...global.stickers[category],\n hash,\n ...(\n category === 'search'\n ? { resultIds }\n : { setIds: sets.map(({ id }) => id) }\n ),\n },\n },\n };\n}\n\nexport function updateStickerSet(\n global: GlobalState, stickerSetId: string, update: Partial,\n): GlobalState {\n const currentStickerSet = global.stickers.setsById[stickerSetId] || {};\n const addedSets = global.stickers.added.setIds || [];\n let setIds: string[] = addedSets;\n if (update.installedDate && addedSets && !addedSets.includes(stickerSetId)) {\n setIds = [stickerSetId, ...setIds];\n }\n\n if (!update.installedDate && addedSets?.includes(stickerSetId)) {\n setIds = setIds.filter((id) => id !== stickerSetId);\n }\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n added: {\n ...global.stickers.added,\n setIds,\n },\n setsById: {\n ...global.stickers.setsById,\n [stickerSetId]: {\n ...currentStickerSet,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateGifSearch(\n global: GlobalState, isNew: boolean, results: ApiVideo[], nextOffset?: string,\n): GlobalState {\n const { results: currentResults } = global.gifs.search;\n\n let newResults!: ApiVideo[];\n if (isNew || !currentResults) {\n newResults = results;\n } else {\n const currentIds = new Set(currentResults.map((gif) => gif.id));\n newResults = [\n ...currentResults,\n ...results.filter((gif) => !currentIds.has(gif.id)),\n ];\n }\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n ...global.gifs.search,\n offset: nextOffset,\n results: newResults,\n },\n },\n };\n}\n\nexport function replaceAnimatedEmojis(global: GlobalState, stickerSet: ApiStickerSet): GlobalState {\n return {\n ...global,\n animatedEmojis: stickerSet,\n };\n}\n\nexport function updateStickersForEmoji(\n global: GlobalState, emoji: string, remoteStickers?: ApiSticker[], hash?: string,\n): GlobalState {\n const localStickers = selectStickersForEmoji(global, emoji);\n const allStickers = [...localStickers, ...(remoteStickers || [])];\n const uniqueIds = unique(allStickers.map(({ id }) => id));\n const byId = buildCollectionByKey(allStickers, 'id');\n const stickers = uniqueIds.map((id) => byId[id]);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n emoji,\n stickers,\n hash,\n },\n },\n };\n}\n\nexport function rebuildStickersForEmoji(global: GlobalState): GlobalState {\n const { emoji, stickers, hash } = global.stickers.forEmoji || {};\n if (!emoji) {\n return global;\n }\n\n return updateStickersForEmoji(global, emoji, stickers, hash);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiUser, ApiUserStatus } from '../../api/types';\n\nimport { omit, pick } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\n\nexport function replaceUsers(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n users: {\n ...global.users,\n byId: newById,\n },\n };\n}\n\nfunction updateContactList(global: GlobalState, updatedUsers: ApiUser[]): GlobalState {\n const { userIds: contactUserIds } = global.contactList || {};\n\n if (!contactUserIds) return global;\n\n const newContactUserIds = updatedUsers\n .filter((user) => user?.isContact && !contactUserIds.includes(user.id))\n .map((user) => user.id);\n\n if (newContactUserIds.length === 0) return global;\n\n return {\n ...global,\n contactList: {\n userIds: [\n ...newContactUserIds,\n ...contactUserIds,\n ],\n },\n };\n}\n\nexport function updateUser(global: GlobalState, userId: string, userUpdate: Partial): GlobalState {\n const { byId } = global.users;\n\n const updatedUser = getUpdatedUser(global, userId, userUpdate);\n if (!updatedUser) {\n return global;\n }\n\n global = updateContactList(global, [updatedUser]);\n\n return replaceUsers(global, {\n ...byId,\n [userId]: updatedUser,\n });\n}\n\nexport function updateUsers(global: GlobalState, newById: Record): GlobalState {\n const updatedById = Object.keys(newById).reduce((acc: Record, id) => {\n const updatedUser = getUpdatedUser(global, id, newById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n }\n\n return acc;\n }, {});\n\n global = replaceUsers(global, {\n ...global.users.byId,\n ...updatedById,\n });\n\n global = updateContactList(global, Object.values(updatedById));\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUsers(global: GlobalState, newById: Record): GlobalState {\n const { byId } = global.users;\n let isUpdated = false;\n\n const addedById = Object.keys(newById).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !newById[id].isMin)) {\n const updatedUser = getUpdatedUser(global, id, newById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n if (!isUpdated) {\n isUpdated = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (!isUpdated) {\n return global;\n }\n\n global = replaceUsers(global, {\n ...byId,\n ...addedById,\n });\n\n global = updateContactList(global, Object.values(addedById));\n\n return global;\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedUser(global: GlobalState, userId: string, userUpdate: Partial) {\n const { byId } = global.users;\n const user = byId[userId];\n const shouldOmitMinInfo = userUpdate.isMin && user && !user.isMin;\n\n const updatedUser = {\n ...user,\n ...(shouldOmitMinInfo ? omit(userUpdate, ['isMin', 'accessHash']) : userUpdate),\n };\n\n if (!updatedUser.id || !updatedUser.type) {\n return undefined;\n }\n\n return updatedUser;\n}\n\nexport function deleteContact(global: GlobalState, userId: string): GlobalState {\n const { byId } = global.users;\n const { userIds } = global.contactList || {};\n\n global = {\n ...global,\n contactList: {\n userIds: userIds ? userIds.filter((id) => id !== userId) : MEMO_EMPTY_ARRAY,\n },\n };\n\n return replaceUsers(global, {\n ...byId,\n [userId]: {\n ...byId[userId],\n isContact: undefined,\n },\n });\n}\n\nexport function updateUserSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n userSearch: {\n ...global.userSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateUserSearchFetchingStatus(\n global: GlobalState, newState: boolean,\n) {\n return updateUserSearch(global, {\n fetchingStatus: newState,\n });\n}\n\nexport function updateUserBlockedState(global: GlobalState, userId: string, isBlocked: boolean) {\n const { byId } = global.users;\n const user = byId[userId];\n if (!user || !user.fullInfo) {\n return global;\n }\n\n return updateUser(global, userId, {\n ...user,\n fullInfo: {\n ...user.fullInfo,\n isBlocked,\n },\n });\n}\n\nexport function replaceUserStatuses(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n users: {\n ...global.users,\n statusesById: newById,\n },\n };\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUserStatuses(global: GlobalState, newById: Record): GlobalState {\n const { statusesById } = global.users;\n\n const newKeys = Object.keys(newById).filter((id) => !statusesById[id]);\n if (!newKeys.length) {\n return global;\n }\n\n global = replaceUserStatuses(global, {\n ...statusesById,\n ...pick(newById, newKeys),\n });\n\n return global;\n}\n","import { GlobalState } from '../../global/types';\nimport { GlobalSearchContent } from '../../types';\nimport { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types';\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nconst getComplexKey = (message: ApiMessage) => `${message.chatId}_${message.id}`;\n\nexport function updateGlobalSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n globalSearch: {\n ...global.globalSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateGlobalSearchContent(\n global: GlobalState,\n currentContent: GlobalSearchContent | undefined,\n): GlobalState {\n return updateGlobalSearch(global, { currentContent });\n}\n\nexport function updateGlobalSearchResults(\n global: GlobalState,\n newFoundMessages: ApiMessage[],\n totalCount: number,\n type: ApiGlobalMessageSearchType,\n nextRate?: number,\n): GlobalState {\n const { resultsByType } = global.globalSearch || {};\n const newFoundMessagesById = newFoundMessages.reduce((result, message) => {\n result[getComplexKey(message)] = message;\n\n return result;\n }, {} as Record);\n const foundIdsForType = resultsByType?.[type]?.foundIds;\n\n if (foundIdsForType !== undefined\n && Object.keys(newFoundMessagesById).every(\n (newId) => foundIdsForType.includes(getComplexKey(newFoundMessagesById[newId])),\n )\n ) {\n return updateGlobalSearchFetchingStatus(global, { messages: false });\n }\n\n const prevFoundIds = foundIdsForType || [];\n const newFoundIds = newFoundMessages.map((message) => getComplexKey(message));\n const foundIds = Array.prototype.concat(prevFoundIds, newFoundIds);\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n global = updateGlobalSearchFetchingStatus(global, { messages: false });\n\n return updateGlobalSearch(global, {\n resultsByType: {\n ...(global.globalSearch || {}).resultsByType,\n [type]: {\n totalCount,\n nextOffsetId: nextRate,\n foundIds: foundOrPrevFoundIds,\n },\n },\n });\n}\n\nexport function updateGlobalSearchFetchingStatus(\n global: GlobalState, newState: { chats?: boolean; messages?: boolean },\n) {\n return updateGlobalSearch(global, {\n fetchingStatus: {\n ...global.globalSearch.fetchingStatus,\n ...newState,\n },\n });\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiMessageSearchType } from '../../api/types';\n\nimport { areSortedArraysEqual, unique } from '../../util/iteratees';\nimport { SharedMediaType } from '../../types';\nimport { buildChatThreadKey } from '../helpers';\n\ninterface TextSearchParams {\n isActive: boolean;\n query?: string;\n results?: {\n totalCount?: number;\n nextOffsetId?: number;\n foundIds?: number[];\n };\n}\n\ninterface MediaSearchParams {\n currentType?: SharedMediaType;\n resultsByType?: Partial>;\n}\n\nfunction replaceLocalTextSearch(\n global: GlobalState,\n chatThreadKey: string,\n searchParams: TextSearchParams,\n): GlobalState {\n return {\n ...global,\n localTextSearch: {\n byChatThreadKey: {\n ...global.localTextSearch.byChatThreadKey,\n [chatThreadKey]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalTextSearch(\n global: GlobalState,\n chatId: string,\n threadId: number,\n isActive: boolean,\n query?: string,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n isActive,\n query,\n });\n}\n\nexport function replaceLocalTextSearchResults(\n global: GlobalState,\n chatId: string,\n threadId: number,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n results: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n });\n}\n\nexport function updateLocalTextSearchResults(\n global: GlobalState,\n chatId: string,\n threadId: number,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { results } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n const prevFoundIds = (results?.foundIds) || [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalTextSearchResults(global, chatId, threadId, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction replaceLocalMediaSearch(\n global: GlobalState,\n chatId: string,\n searchParams: MediaSearchParams,\n): GlobalState {\n return {\n ...global,\n localMediaSearch: {\n byChatId: {\n ...global.localMediaSearch.byChatId,\n [chatId]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalMediaSearchType(\n global: GlobalState,\n chatId: string,\n currentType: SharedMediaType | undefined,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n currentType,\n });\n}\n\nexport function replaceLocalMediaSearchResults(\n global: GlobalState,\n chatId: string,\n type: ApiMessageSearchType,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n resultsByType: {\n ...(global.localMediaSearch.byChatId[chatId] || {}).resultsByType,\n [type]: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n },\n });\n}\n\nexport function updateLocalMediaSearchResults(\n global: GlobalState,\n chatId: string,\n type: SharedMediaType,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const { resultsByType } = global.localMediaSearch.byChatId[chatId] || {};\n const prevFoundIds = resultsByType?.[type] ? resultsByType[type]!.foundIds : [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalMediaSearchResults(global, chatId, type, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction orderFoundIds(listedIds: number[]) {\n return listedIds.sort((a, b) => b - a);\n}\n","import { GlobalState } from '../../global/types';\nimport { ManagementProgress, ManagementState } from '../../types';\n\nexport function updateManagementProgress(global: GlobalState, progress: ManagementProgress): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n progress,\n },\n };\n}\n\nexport function updateManagement(global: GlobalState, chatId: string, update: Partial): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...(global.management.byChatId[chatId] || {}),\n ...update,\n },\n },\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport {\n ISettings, IThemeSettings, ThemeKey, NotifyException,\n} from '../../types';\nimport { ApiNotifyException } from '../../api/types';\nimport { updateUserBlockedState } from './users';\n\nexport function replaceSettings(global: GlobalState, newSettings?: Partial): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n byKey: {\n ...global.settings.byKey,\n ...newSettings,\n },\n },\n };\n}\n\nexport function replaceThemeSettings(\n global: GlobalState, theme: ThemeKey, newSettings?: Partial,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n themes: {\n ...global.settings.themes,\n [theme]: {\n ...(global.settings.themes[theme] || {}),\n ...newSettings,\n },\n },\n },\n };\n}\n\nexport function addNotifyExceptions(\n global: GlobalState, notifyExceptions: ApiNotifyException[],\n): GlobalState {\n notifyExceptions.forEach((notifyException) => {\n const { chatId, ...exceptionData } = notifyException;\n global = addNotifyException(global, chatId, exceptionData);\n });\n\n return global;\n}\n\nexport function addNotifyException(\n global: GlobalState, id: string, notifyException: NotifyException,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n notifyExceptions: {\n ...global.settings.notifyExceptions,\n [id]: notifyException,\n },\n },\n };\n}\n\nexport function updateNotifySettings(\n global: GlobalState, peerType: 'contact' | 'group' | 'broadcast', isSilent?: boolean, shouldShowPreviews?: boolean,\n) {\n switch (peerType) {\n case 'contact':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasPrivateChatsNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasPrivateChatsMessagePreview: shouldShowPreviews }),\n });\n case 'group':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasGroupNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasGroupMessagePreview: shouldShowPreviews }),\n });\n case 'broadcast':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasBroadcastNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasBroadcastMessagePreview: shouldShowPreviews }),\n });\n\n default:\n return undefined;\n }\n}\n\nexport function addBlockedContact(global: GlobalState, contactId: string): GlobalState {\n global = updateUserBlockedState(global, contactId, true);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: [contactId, ...global.blocked.ids],\n totalCount: global.blocked.totalCount + 1,\n },\n };\n}\n\nexport function removeBlockedContact(global: GlobalState, contactId: string): GlobalState {\n global = updateUserBlockedState(global, contactId, false);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: global.blocked.ids.filter((id) => id !== contactId),\n totalCount: global.blocked.totalCount - 1,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\n\nexport function updateTwoFaSettings(\n global: GlobalState,\n update: GlobalState['twoFaSettings'],\n): GlobalState {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n ...update,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport { ShippingOption, PaymentStep } from '../../types';\nimport { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types';\n\nexport function updateShippingOptions(\n global: GlobalState,\n shippingOptions: ShippingOption[],\n): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n shippingOptions,\n },\n };\n}\n\nexport function setRequestInfoId(global: GlobalState, id: string): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n requestId: id,\n },\n };\n}\n\nexport function setPaymentStep(global: GlobalState, step: PaymentStep): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n step,\n },\n };\n}\n\nexport function setInvoiceMessageInfo(global: GlobalState, message: ApiMessage): GlobalState {\n if (!message.content || !message.content.invoice) {\n return global;\n }\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = message.content.invoice;\n return {\n ...global,\n payment: {\n ...global.payment,\n invoiceContent: {\n title,\n text,\n photoUrl,\n amount,\n currency,\n isTest,\n },\n },\n };\n}\n\nexport function setStripeCardInfo(global: GlobalState, cardInfo: { type: string; id: string }): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n stripeCredentials: {\n ...cardInfo,\n },\n },\n };\n}\n\nexport function setSmartGlocalCardInfo(\n global: GlobalState,\n cardInfo: { type: string; token: string },\n): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n smartGlocalCredentials: {\n ...cardInfo,\n },\n },\n };\n}\n\nexport function setPaymentForm(global: GlobalState, form: ApiPaymentForm): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n ...form,\n },\n };\n}\n\nexport function setConfirmPaymentUrl(global: GlobalState, url?: string): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n confirmPaymentUrl: url,\n },\n };\n}\n\nexport function setReceipt(\n global: GlobalState,\n receipt?: ApiReceipt,\n message?: ApiMessage,\n): GlobalState {\n if (!receipt || !message) {\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n };\n }\n\n const { invoice: messageInvoice } = message.content;\n const { photoUrl, text, title } = (messageInvoice || {});\n\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: {\n ...receipt,\n photoUrl,\n text,\n title,\n },\n },\n };\n}\n\nexport function clearPayment(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {},\n };\n}\n\nexport function closeInvoice(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n isPaymentModalOpen: false,\n },\n };\n}\n","import {\n GlobalState, MessageList, MessageListType, Thread,\n} from '../../global/types';\nimport {\n ApiMessage, ApiSponsoredMessage, ApiThreadInfo, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport {\n IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT, TMP_CHAT_ID,\n} from '../../config';\nimport {\n selectListedIds,\n selectChatMessages,\n selectViewportIds,\n selectOutlyingIds,\n selectPinnedIds,\n selectThreadInfo,\n selectMessageIdsByGroupId,\n selectScheduledMessages,\n selectScheduledIds,\n selectCurrentMessageIds,\n selectChatMessage,\n selectCurrentMessageList,\n} from '../selectors';\nimport {\n areSortedArraysEqual, omit, pickTruthy, unique,\n} from '../../util/iteratees';\n\ntype MessageStoreSections = {\n byId: Record;\n threadsById: Record;\n};\n\nexport function updateCurrentMessageList(\n global: GlobalState,\n chatId: string | undefined,\n threadId: number = MAIN_THREAD_ID,\n type: MessageListType = 'thread',\n shouldReplaceHistory?: boolean,\n): GlobalState {\n const { messageLists } = global.messages;\n let newMessageLists: MessageList[] = messageLists;\n if (shouldReplaceHistory || IS_TEST) {\n newMessageLists = chatId ? [{ chatId, threadId, type }] : [];\n } else if (chatId) {\n const last = messageLists[messageLists.length - 1];\n if (!last || last.chatId !== chatId || last.threadId !== threadId || last.type !== type) {\n if (last && last.chatId === TMP_CHAT_ID) {\n newMessageLists = [...messageLists.slice(0, -1), { chatId, threadId, type }];\n } else {\n newMessageLists = [...messageLists, { chatId, threadId, type }];\n }\n }\n } else {\n newMessageLists = messageLists.slice(0, -1);\n }\n\n return {\n ...global,\n messages: {\n ...global.messages,\n messageLists: newMessageLists,\n },\n };\n}\n\nfunction replaceChatMessages(global: GlobalState, chatId: string, newById: Record): GlobalState {\n return updateMessageStore(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateThread(\n global: GlobalState, chatId: string, threadId: number, threadUpdate: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId];\n\n return updateMessageStore(global, chatId, {\n threadsById: {\n ...(current?.threadsById),\n [threadId]: {\n ...(current?.threadsById[threadId]),\n ...threadUpdate,\n },\n },\n });\n}\n\nfunction updateMessageStore(\n global: GlobalState, chatId: string, update: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId] || { byId: {}, threadsById: {} };\n\n return {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function replaceThreadParam(\n global: GlobalState, chatId: string, threadId: number, paramName: T, newValue: Thread[T] | undefined,\n) {\n return updateThread(global, chatId, threadId, { [paramName]: newValue });\n}\n\nexport function addMessages(\n global: GlobalState, messages: ApiMessage[],\n): GlobalState {\n const addedByChatId = messages.reduce((messagesByChatId, message: ApiMessage) => {\n if (!messagesByChatId[message.chatId]) {\n messagesByChatId[message.chatId] = {};\n }\n messagesByChatId[message.chatId][message.id] = message;\n\n return messagesByChatId;\n }, {} as Record>);\n\n Object.keys(addedByChatId).forEach((chatId) => {\n global = addChatMessagesById(global, chatId, addedByChatId[chatId]);\n });\n\n return global;\n}\n\nexport function addChatMessagesById(\n global: GlobalState, chatId: string, newById: Record,\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n\n if (byId && Object.keys(newById).every((newId) => Boolean(byId[Number(newId)]))) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...newById,\n ...byId,\n });\n}\n\nexport function updateChatMessage(\n global: GlobalState, chatId: string, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectChatMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n });\n}\n\nexport function updateScheduledMessage(\n global: GlobalState, chatId: string, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceScheduledMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n });\n}\n\nexport function deleteChatMessages(\n global: GlobalState,\n chatId: string,\n messageIds: number[],\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n const deletedForwardedPosts = Object.values(pickTruthy(byId, messageIds)).filter(\n ({ forwardInfo }) => forwardInfo?.isLinkedChannelPost,\n );\n\n const threadIds = Object.keys(global.messages.byChatId[chatId].threadsById).map(Number);\n threadIds.forEach((threadId) => {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n let outlyingIds = selectOutlyingIds(global, chatId, threadId);\n let viewportIds = selectViewportIds(global, chatId, threadId);\n let pinnedIds = selectPinnedIds(global, chatId);\n let newMessageCount = threadInfo?.messagesCount;\n\n messageIds.forEach((messageId) => {\n if (listedIds && listedIds.includes(messageId)) {\n listedIds = listedIds.filter((id) => id !== messageId);\n if (newMessageCount !== undefined) newMessageCount -= 1;\n }\n\n if (outlyingIds && outlyingIds.includes(messageId)) {\n outlyingIds = outlyingIds.filter((id) => id !== messageId);\n }\n\n if (viewportIds && viewportIds.includes(messageId)) {\n viewportIds = viewportIds.filter((id) => id !== messageId);\n }\n\n if (pinnedIds && pinnedIds.includes(messageId)) {\n pinnedIds = pinnedIds.filter((id) => id !== messageId);\n }\n });\n\n global = replaceThreadParam(global, chatId, threadId, 'listedIds', listedIds);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', outlyingIds);\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', viewportIds);\n global = replaceThreadParam(global, chatId, threadId, 'pinnedIds', pinnedIds);\n\n if (threadInfo && newMessageCount !== undefined) {\n global = replaceThreadParam(global, chatId, threadId, 'threadInfo', {\n ...threadInfo,\n messagesCount: newMessageCount,\n });\n }\n });\n\n if (deletedForwardedPosts.length) {\n const currentMessageList = selectCurrentMessageList(global);\n const canDeleteCurrentThread = currentMessageList && currentMessageList.chatId === chatId\n && currentMessageList.type === 'thread';\n const currentThreadId = currentMessageList?.threadId;\n\n deletedForwardedPosts.forEach((message) => {\n const { fromChatId, fromMessageId } = message.forwardInfo!;\n const originalPost = selectChatMessage(global, fromChatId!, fromMessageId!);\n\n if (canDeleteCurrentThread && currentThreadId === fromMessageId) {\n global = updateCurrentMessageList(global, chatId);\n }\n if (originalPost) {\n global = updateChatMessage(global, fromChatId!, fromMessageId!, { threadInfo: undefined });\n }\n });\n }\n\n global = replaceChatMessages(global, chatId, newById);\n\n return global;\n}\n\nexport function deleteChatScheduledMessages(\n global: GlobalState,\n chatId: string,\n messageIds: number[],\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n\n let scheduledIds = selectScheduledIds(global, chatId);\n if (scheduledIds) {\n messageIds.forEach((messageId) => {\n if (scheduledIds!.includes(messageId)) {\n scheduledIds = scheduledIds!.filter((id) => id !== messageId);\n }\n });\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', scheduledIds);\n }\n\n global = replaceScheduledMessages(global, chatId, newById);\n\n return global;\n}\n\nexport function updateListedIds(\n global: GlobalState,\n chatId: string,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const listedIds = selectListedIds(global, chatId, threadId);\n const newIds = listedIds?.length\n ? idsUpdate.filter((id) => !listedIds.includes(id))\n : idsUpdate;\n\n if (listedIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'listedIds', orderHistoryIds([\n ...(listedIds || []),\n ...newIds,\n ]));\n}\n\nexport function updateOutlyingIds(\n global: GlobalState,\n chatId: string,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const newIds = outlyingIds?.length\n ? idsUpdate.filter((id) => !outlyingIds.includes(id))\n : idsUpdate;\n\n if (outlyingIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'outlyingIds', orderHistoryIds([\n ...(outlyingIds || []),\n ...newIds,\n ]));\n}\n\nfunction orderHistoryIds(listedIds: number[]) {\n return listedIds.sort((a, b) => a - b);\n}\n\nexport function addViewportId(\n global: GlobalState,\n chatId: string,\n threadId: number,\n newId: number,\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n if (viewportIds.includes(newId)) {\n return global;\n }\n\n const newIds = orderHistoryIds([\n ...(\n viewportIds.length < MESSAGE_LIST_VIEWPORT_LIMIT\n ? viewportIds\n : viewportIds.slice(-(MESSAGE_LIST_SLICE / 2))\n ),\n newId,\n ]);\n\n return replaceThreadParam(global, chatId, threadId, 'viewportIds', newIds);\n}\n\nexport function safeReplaceViewportIds(\n global: GlobalState,\n chatId: string,\n threadId: number,\n newViewportIds: number[],\n): GlobalState {\n const currentIds = selectViewportIds(global, chatId, threadId) || [];\n const newIds = orderHistoryIds(newViewportIds);\n\n return replaceThreadParam(\n global,\n chatId,\n threadId,\n 'viewportIds',\n areSortedArraysEqual(currentIds, newIds) ? currentIds : newIds,\n );\n}\n\nexport function updateThreadInfo(\n global: GlobalState, chatId: string, threadId: number, update: Partial | undefined,\n): GlobalState {\n const newThreadInfo = {\n ...(selectThreadInfo(global, chatId, threadId) as ApiThreadInfo),\n ...update,\n };\n\n if (!newThreadInfo.threadId) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'threadInfo', newThreadInfo);\n}\n\nexport function updateThreadInfos(\n global: GlobalState, chatId: string, updates: Partial[],\n): GlobalState {\n updates.forEach((update) => {\n global = updateThreadInfo(global, update.chatId!, update.threadId!, update);\n });\n\n return global;\n}\n\nexport function replaceScheduledMessages(\n global: GlobalState, chatId: string, newById: Record,\n): GlobalState {\n return updateScheduledMessages(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateScheduledMessages(\n global: GlobalState, chatId: string, update: Partial<{ byId: Record }>,\n): GlobalState {\n const current = global.scheduledMessages.byChatId[chatId] || { byId: {}, hash: 0 };\n\n return {\n ...global,\n scheduledMessages: {\n byChatId: {\n ...global.scheduledMessages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateFocusedMessage(\n global: GlobalState, chatId?: string, messageId?: number, noHighlight = false, isResizingContainer = false,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n chatId,\n messageId,\n noHighlight,\n isResizingContainer,\n },\n };\n}\n\nexport function updateSponsoredMessage(\n global: GlobalState, chatId: string, message: ApiSponsoredMessage,\n): GlobalState {\n return {\n ...global,\n messages: {\n ...global.messages,\n sponsoredByChatId: {\n ...global.messages.sponsoredByChatId,\n [chatId]: message,\n },\n },\n };\n}\n\nexport function updateFocusDirection(\n global: GlobalState, direction?: FocusDirection,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n direction,\n },\n };\n}\n\nexport function enterMessageSelectMode(\n global: GlobalState,\n chatId: string,\n messageId?: number | number[],\n): GlobalState {\n const messageIds = messageId ? Array.prototype.concat([], messageId) : [];\n return {\n ...global,\n selectedMessages: {\n chatId,\n messageIds,\n },\n };\n}\n\nexport function toggleMessageSelection(\n global: GlobalState,\n chatId: string,\n threadId: number,\n messageListType: MessageListType,\n messageId: number,\n groupedId?: string,\n childMessageIds?: number[],\n withShift = false,\n): GlobalState {\n const { selectedMessages: oldSelectedMessages } = global;\n if (groupedId) {\n childMessageIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n }\n const selectedMessageIds = childMessageIds || [messageId];\n if (!oldSelectedMessages) {\n return enterMessageSelectMode(global, chatId, selectedMessageIds);\n }\n\n const { messageIds } = oldSelectedMessages;\n\n let newMessageIds;\n const newSelectedMessageIds = selectedMessageIds.filter((id) => !messageIds.includes(id));\n if (newSelectedMessageIds && !newSelectedMessageIds.length) {\n newMessageIds = messageIds.filter((id) => !selectedMessageIds.includes(id));\n } else if (withShift && messageIds.length) {\n const viewportIds = selectCurrentMessageIds(global, chatId, threadId, messageListType)!;\n const prevIndex = viewportIds.indexOf(messageIds[messageIds.length - 1]);\n const currentIndex = viewportIds.indexOf(messageId);\n const from = Math.min(prevIndex, currentIndex);\n const to = Math.max(prevIndex, currentIndex);\n const slice = viewportIds.slice(from, to + 1);\n newMessageIds = unique([...messageIds, ...slice]);\n } else {\n newMessageIds = [...messageIds, ...newSelectedMessageIds];\n }\n\n if (!newMessageIds.length) {\n return exitMessageSelectMode(global);\n }\n\n return {\n ...global,\n selectedMessages: {\n ...oldSelectedMessages,\n messageIds: newMessageIds,\n },\n };\n}\n\nexport function exitMessageSelectMode(global: GlobalState): GlobalState {\n return {\n ...global,\n selectedMessages: undefined,\n };\n}\n\nexport function updateThreadUnreadFromForwardedMessage(\n global: GlobalState,\n originMessage: ApiMessage,\n chatId: string,\n lastMessageId: number,\n isDeleting?: boolean,\n) {\n const { channelPostId, fromChatId } = originMessage.forwardInfo || {};\n if (channelPostId && fromChatId) {\n const threadInfoOld = selectThreadInfo(global, chatId, channelPostId);\n if (threadInfoOld) {\n global = replaceThreadParam(global, chatId, channelPostId, 'threadInfo', {\n ...threadInfoOld,\n lastMessageId,\n messagesCount: threadInfoOld.messagesCount + (isDeleting ? -1 : 1),\n });\n }\n }\n return global;\n}\n","import { ApiChat, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport {\n getPrivateChatUserId, isChatChannel, isUserId, isHistoryClearMessage, isUserBot, isUserOnline,\n} from '../helpers';\nimport { selectUser } from './users';\nimport {\n ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE, SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../config';\n\nexport function selectChat(global: GlobalState, chatId: string): ApiChat | undefined {\n return global.chats.byId[chatId];\n}\n\nexport function selectChatUser(global: GlobalState, chat: ApiChat) {\n const userId = getPrivateChatUserId(chat);\n if (!userId) {\n return false;\n }\n\n return selectUser(global, userId);\n}\n\nexport function selectIsChatWithSelf(global: GlobalState, chatId: string) {\n return chatId === global.currentUserId;\n}\n\nexport function selectIsChatWithBot(global: GlobalState, chat: ApiChat) {\n const user = selectChatUser(global, chat);\n return user && isUserBot(user);\n}\n\nexport function selectSupportChat(global: GlobalState) {\n return Object.values(global.chats.byId).find(({ isSupport }: ApiChat) => isSupport);\n}\n\nexport function selectChatOnlineCount(global: GlobalState, chat: ApiChat) {\n if (isUserId(chat.id) || isChatChannel(chat) || !chat.fullInfo) {\n return undefined;\n }\n\n if (!chat.fullInfo.members || chat.fullInfo.members.length === MEMBERS_LOAD_SLICE) {\n return chat.fullInfo.onlineCount;\n }\n\n return chat.fullInfo.members.reduce((onlineCount, { userId }) => {\n if (\n userId !== global.currentUserId\n && global.users.byId[userId]\n && isUserOnline(global.users.byId[userId], global.users.statusesById[userId])\n ) {\n return onlineCount + 1;\n }\n\n return onlineCount;\n }, 0);\n}\n\nexport function selectChatBot(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n const userId = chat && getPrivateChatUserId(chat);\n const user = userId && selectUser(global, userId);\n if (!user || !isUserBot(user)) {\n return undefined;\n }\n\n return user;\n}\n\nexport function selectIsChatBotNotStarted(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n const bot = selectChatBot(global, chatId);\n if (!chat || !bot) {\n return false;\n }\n\n if (chat.lastMessage && isHistoryClearMessage(chat.lastMessage)) {\n return true;\n }\n\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return false;\n }\n\n const { listedIds } = messageInfo.threadsById[MAIN_THREAD_ID] || {};\n return listedIds && !listedIds.length;\n}\n\nexport function selectAreActiveChatsLoaded(global: GlobalState): boolean {\n return Boolean(global.chats.listIds.active);\n}\n\nexport function selectIsChatListed(global: GlobalState, chatId: string, type?: 'active' | 'archived'): boolean {\n const { listIds } = global.chats;\n if (type) {\n const targetList = listIds[type];\n return Boolean(targetList && targetList.includes(chatId));\n }\n\n return Object.values(listIds).some((list) => list && list.includes(chatId));\n}\n\nexport function selectChatListType(global: GlobalState, chatId: string): 'active' | 'archived' | undefined {\n const chat = selectChat(global, chatId);\n if (!chat || !selectIsChatListed(global, chatId)) {\n return undefined;\n }\n\n return chat.folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n}\n\nexport function selectChatFolder(global: GlobalState, folderId: number) {\n return global.chatFolders.byId[folderId];\n}\n\nexport function selectTotalChatCount(global: GlobalState, listType: 'active' | 'archived'): number {\n const { totalCount } = global.chats;\n const allChatsCount = totalCount.all;\n const archivedChatsCount = totalCount.archived || 0;\n\n if (listType === 'archived') {\n return archivedChatsCount;\n }\n\n return allChatsCount ? allChatsCount - archivedChatsCount : 0;\n}\n\nexport function selectIsChatPinned(global: GlobalState, chatId: string, folderId = ALL_FOLDER_ID): boolean {\n const { active, archived } = global.chats.orderedPinnedIds;\n\n if (folderId === ALL_FOLDER_ID) {\n return Boolean(active?.includes(chatId));\n }\n\n if (folderId === ARCHIVED_FOLDER_ID) {\n return Boolean(archived?.includes(chatId));\n }\n\n const { byId: chatFoldersById } = global.chatFolders;\n\n const { pinnedChatIds } = chatFoldersById[folderId] || {};\n return Boolean(pinnedChatIds?.includes(chatId));\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectChatByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.chats.byId).find(\n (chat) => chat.username && chat.username.toLowerCase() === usernameLowered,\n );\n}\n\nexport function selectIsServiceChatReady(global: GlobalState) {\n return Boolean(selectChat(global, SERVICE_NOTIFICATIONS_USER_ID));\n}\n\nexport function selectSendAs(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n if (!chat) return undefined;\n\n const id = chat?.fullInfo?.sendAsId;\n if (!id) return undefined;\n\n return selectUser(global, id) || selectChat(global, id);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker } from '../../api/types';\n\nexport function selectIsStickerFavorite(global: GlobalState, sticker: ApiSticker) {\n const { stickers } = global.stickers.favorite;\n return stickers && stickers.some(({ id }) => id === sticker.id);\n}\n\nexport function selectCurrentStickerSearch(global: GlobalState) {\n return global.stickers.search;\n}\n\nexport function selectCurrentGifSearch(global: GlobalState) {\n return global.gifs.search;\n}\n\nexport function selectStickerSet(global: GlobalState, id: string) {\n return global.stickers.setsById[id];\n}\n\nexport function selectStickerSetByShortName(global: GlobalState, shortName: string) {\n return Object.values(global.stickers.setsById).find((l) => l.shortName.toLowerCase() === shortName.toLowerCase());\n}\n\nexport function selectStickersForEmoji(global: GlobalState, emoji: string) {\n const stickerSets = Object.values(global.stickers.setsById);\n let stickersForEmoji: ApiSticker[] = [];\n // Favorites\n global.stickers.favorite.stickers.forEach((sticker) => {\n if (sticker.emoji === emoji) stickersForEmoji.push(sticker);\n });\n\n // Added sets\n stickerSets.forEach(({ packs }) => {\n if (!packs) {\n return;\n }\n\n stickersForEmoji = stickersForEmoji.concat(packs[emoji] || [], packs[cleanEmoji(emoji)] || []);\n });\n return stickersForEmoji;\n}\n\nfunction cleanEmoji(emoji: string) {\n // Some emojis (❤️ for example) with a service symbol 'VARIATION SELECTOR-16' are not recognized as animated\n return emoji.replace('\\ufe0f', '');\n}\n\nexport function selectAnimatedEmoji(global: GlobalState, emoji: string) {\n const { animatedEmojis } = global;\n if (!animatedEmojis || !animatedEmojis.stickers) {\n return undefined;\n }\n\n const cleanedEmoji = cleanEmoji(emoji);\n\n return animatedEmojis.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\n}\n\nexport function selectAnimatedEmojiEffect(global: GlobalState, emoji: string) {\n const { animatedEmojiEffects } = global;\n if (!animatedEmojiEffects || !animatedEmojiEffects.stickers) {\n return undefined;\n }\n\n const cleanedEmoji = cleanEmoji(emoji);\n\n return animatedEmojiEffects.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\n}\n\nexport function selectAnimatedEmojiSound(global: GlobalState, emoji: string) {\n return global?.appConfig?.emojiSounds[cleanEmoji(emoji)];\n}\n\nexport function selectLocalAnimatedEmoji(global: GlobalState, emoji: string) {\n const cleanedEmoji = cleanEmoji(emoji);\n\n return cleanedEmoji === '🍑' ? 'Peach' : (cleanedEmoji === '🍆' ? 'Eggplant' : undefined);\n}\n\nexport function selectLocalAnimatedEmojiEffect(emoji: string) {\n return emoji === 'Eggplant' ? 'Cumshot' : undefined;\n}\n\nexport function selectLocalAnimatedEmojiEffectByName(name: string) {\n return name === 'Cumshot' ? '🍆' : undefined;\n}\n","import { GlobalState, MessageListType, Thread } from '../../global/types';\nimport {\n ApiChat,\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID } from '../../config';\nimport {\n selectChat, selectIsChatWithBot, selectIsChatWithSelf,\n} from './chats';\nimport { selectIsUserOrChatContact, selectUser } from './users';\nimport {\n getSendingState,\n isChatChannel,\n isMessageLocal,\n isUserId,\n isForwardedMessage,\n getCanPostInChat,\n isUserRightBanned,\n getHasAdminRight,\n isChatBasicGroup,\n isCommonBoxChat,\n isServiceNotificationMessage,\n isOwnMessage,\n isActionMessage,\n isChatGroup,\n isChatSuperGroup,\n getMessageVideo,\n getMessageWebPageVideo,\n getMessagePhoto,\n getMessageAudio,\n getMessageVoice,\n getMessageDocument,\n getMessageWebPagePhoto,\n} from '../helpers';\nimport { findLast } from '../../util/iteratees';\nimport { selectIsStickerFavorite } from './symbols';\nimport { getServerTime } from '../../util/serverTime';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\n\nconst MESSAGE_EDIT_ALLOWED_TIME = 172800; // 48 hours\n\nexport function selectCurrentMessageList(global: GlobalState) {\n const { messageLists } = global.messages;\n\n if (messageLists.length) {\n return messageLists[messageLists.length - 1];\n }\n\n return undefined;\n}\n\nexport function selectCurrentChat(global: GlobalState) {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n return chatId ? selectChat(global, chatId) : undefined;\n}\n\nexport function selectChatMessages(global: GlobalState, chatId: string) {\n return global.messages.byChatId[chatId]?.byId;\n}\n\nexport function selectScheduledMessages(global: GlobalState, chatId: string) {\n return global.scheduledMessages.byChatId[chatId]?.byId;\n}\n\nexport function selectThreadParam(\n global: GlobalState,\n chatId: string,\n threadId: number,\n key: K,\n) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const thread = messageInfo.threadsById[threadId];\n if (!thread) {\n return undefined;\n }\n\n return thread[key];\n}\n\nexport function selectListedIds(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'listedIds');\n}\n\nexport function selectOutlyingIds(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'outlyingIds');\n}\n\nexport function selectCurrentMessageIds(\n global: GlobalState, chatId: string, threadId: number, messageListType: MessageListType,\n) {\n switch (messageListType) {\n case 'thread':\n return selectViewportIds(global, chatId, threadId);\n case 'pinned':\n return selectPinnedIds(global, chatId);\n case 'scheduled':\n return selectScheduledIds(global, chatId);\n }\n\n return undefined;\n}\n\nexport function selectViewportIds(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'viewportIds');\n}\n\nexport function selectPinnedIds(global: GlobalState, chatId: string) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds');\n}\n\nexport function selectScheduledIds(global: GlobalState, chatId: string) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds');\n}\n\nexport function selectScrollOffset(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'scrollOffset');\n}\n\nexport function selectReplyingToId(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyingToId');\n}\n\nexport function selectEditingId(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'editingId');\n}\n\nexport function selectEditingScheduledId(global: GlobalState, chatId: string) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'editingScheduledId');\n}\n\nexport function selectDraft(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'draft');\n}\n\nexport function selectNoWebPage(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'noWebPage');\n}\n\nexport function selectThreadInfo(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'threadInfo');\n}\n\nexport function selectFirstMessageId(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'firstMessageId');\n}\n\nexport function selectReplyStack(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyStack');\n}\n\nexport function selectThreadOriginChat(global: GlobalState, chatId: string, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return selectChat(global, chatId);\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return selectChat(global, threadInfo.originChannelId || chatId);\n}\n\nexport function selectThreadTopMessageId(global: GlobalState, chatId: string, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return undefined;\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return threadInfo.topMessageId;\n}\n\nexport function selectThreadByMessage(global: GlobalState, chatId: string, message: ApiMessage) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const { replyToMessageId, replyToTopMessageId } = message;\n if (!replyToMessageId && !replyToTopMessageId) {\n return undefined;\n }\n\n return Object.values(messageInfo.threadsById).find((thread) => {\n return thread.threadInfo && (\n (replyToMessageId && replyToMessageId === thread.threadInfo.topMessageId)\n || (replyToTopMessageId && replyToTopMessageId === thread.threadInfo.topMessageId)\n );\n });\n}\n\nexport function isMessageInCurrentMessageList(global: GlobalState, chatId: string, message: ApiMessage) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return false;\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n return (\n chatId === currentMessageList.chatId\n && (\n (currentMessageList.threadId === MAIN_THREAD_ID)\n || (threadInfo && currentMessageList.threadId === threadInfo.threadId)\n )\n );\n}\n\nexport function selectIsViewportNewest(global: GlobalState, chatId: string, threadId: number) {\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!viewportIds || !viewportIds.length) {\n return true;\n }\n\n let lastMessageId: number;\n\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return true;\n }\n\n lastMessageId = chat.lastMessage.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo || !threadInfo.lastMessageId) {\n return undefined;\n }\n\n lastMessageId = threadInfo.lastMessageId;\n }\n\n // Edge case: outgoing `lastMessage` is updated with a delay to optimize animation\n if (lastMessageId >= LOCAL_MESSAGE_ID_BASE && !selectChatMessage(global, chatId, lastMessageId)) {\n return true;\n }\n\n return viewportIds[viewportIds.length - 1] >= lastMessageId;\n}\n\nexport function selectChatMessage(global: GlobalState, chatId: string, messageId: number) {\n const chatMessages = selectChatMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectScheduledMessage(global: GlobalState, chatId: string, messageId: number) {\n const chatMessages = selectScheduledMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectEditingMessage(\n global: GlobalState, chatId: string, threadId: number, messageListType: MessageListType,\n) {\n if (messageListType === 'scheduled') {\n const messageId = selectEditingScheduledId(global, chatId);\n return messageId ? selectScheduledMessage(global, chatId, messageId) : undefined;\n } else {\n const messageId = selectEditingId(global, chatId, threadId);\n return messageId ? selectChatMessage(global, chatId, messageId) : undefined;\n }\n}\n\nexport function selectChatMessageByPollId(global: GlobalState, pollId: string) {\n let messageWithPoll: ApiMessage | undefined;\n\n // eslint-disable-next-line no-restricted-syntax\n for (const chatMessages of Object.values(global.messages.byChatId)) {\n const { byId } = chatMessages;\n messageWithPoll = Object.values(byId).find((message) => {\n return message.content.poll && message.content.poll.id === pollId;\n });\n if (messageWithPoll) {\n break;\n }\n }\n\n return messageWithPoll;\n}\n\nexport function selectFocusedMessageId(global: GlobalState, chatId: string) {\n const { chatId: focusedChatId, messageId } = global.focusedMessage || {};\n\n return focusedChatId === chatId ? messageId : undefined;\n}\n\nexport function selectIsMessageFocused(global: GlobalState, message: ApiMessage) {\n const focusedId = selectFocusedMessageId(global, message.chatId);\n\n return focusedId ? focusedId === message.id || focusedId === message.previousLocalId : false;\n}\n\nexport function selectIsMessageUnread(global: GlobalState, message: ApiMessage) {\n const { lastReadOutboxMessageId } = selectChat(global, message.chatId) || {};\n return isMessageLocal(message) || !lastReadOutboxMessageId || lastReadOutboxMessageId < message.id;\n}\n\nexport function selectOutgoingStatus(\n global: GlobalState, message: ApiMessage, isScheduledList = false,\n): ApiMessageOutgoingStatus {\n if (!selectIsMessageUnread(global, message) && !isScheduledList) {\n return 'read';\n }\n\n return getSendingState(message);\n}\n\nexport function selectSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n return isUserId(senderId) ? selectUser(global, senderId) : selectChat(global, senderId);\n}\n\nexport function selectForwardedSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { forwardInfo } = message;\n if (!forwardInfo) {\n return undefined;\n }\n\n if (forwardInfo.isChannelPost && forwardInfo.fromChatId) {\n return selectChat(global, forwardInfo.fromChatId);\n } else if (forwardInfo.senderUserId) {\n return selectUser(global, forwardInfo.senderUserId) || selectChat(global, forwardInfo.senderUserId);\n }\n\n return undefined;\n}\n\nexport function selectAllowedMessageActions(global: GlobalState, message: ApiMessage, threadId: number) {\n const chat = selectChat(global, message.chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n const isPrivate = isUserId(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, message.chatId);\n const isBasicGroup = isChatBasicGroup(chat);\n const isSuperGroup = isChatSuperGroup(chat);\n const isChannel = isChatChannel(chat);\n const isLocal = isMessageLocal(message);\n const isServiceNotification = isServiceNotificationMessage(message);\n const isOwn = isOwnMessage(message);\n const isAction = isActionMessage(message);\n const { content } = message;\n\n const canEditMessagesIndefinitely = isChatWithSelf\n || (isSuperGroup && getHasAdminRight(chat, 'pinMessages'))\n || (isChannel && getHasAdminRight(chat, 'editMessages'));\n const isMessageEditable = (\n (\n canEditMessagesIndefinitely\n || getServerTime(global.serverTimeOffset) - message.date < MESSAGE_EDIT_ALLOWED_TIME\n ) && !(\n content.sticker || content.contact || content.poll || content.action || content.audio\n || (content.video?.isRound)\n )\n && !isForwardedMessage(message)\n && !message.viaBotId\n );\n\n const canReply = !isLocal && !isServiceNotification && getCanPostInChat(chat, threadId);\n\n const hasPinPermission = isPrivate || (\n chat.isCreator\n || (!isChannel && !isUserRightBanned(chat, 'pinMessages'))\n || getHasAdminRight(chat, 'pinMessages')\n );\n\n let canPin = !isLocal && !isServiceNotification && !isAction && hasPinPermission;\n let canUnpin = false;\n\n const pinnedMessageIds = selectPinnedIds(global, chat.id);\n\n if (canPin) {\n canUnpin = Boolean(pinnedMessageIds && pinnedMessageIds.includes(message.id));\n canPin = !canUnpin;\n }\n\n const canDelete = !isLocal && !isServiceNotification && (\n isPrivate\n || isOwn\n || isBasicGroup\n || chat.isCreator\n || getHasAdminRight(chat, 'deleteMessages')\n );\n\n const canReport = !isPrivate && !isOwn;\n\n const canDeleteForAll = canDelete && (\n (isPrivate && !isChatWithSelf)\n || (isBasicGroup && (\n isOwn || getHasAdminRight(chat, 'deleteMessages') || chat.isCreator\n ))\n );\n\n const canEdit = !isLocal && !isAction && isMessageEditable && (\n isOwn\n || (isChannel && (chat.isCreator || getHasAdminRight(chat, 'editMessages')))\n );\n\n const canForward = !isLocal && !isAction;\n\n const hasSticker = Boolean(message.content.sticker);\n const hasFavoriteSticker = hasSticker && selectIsStickerFavorite(global, message.content.sticker!);\n const canFaveSticker = !isAction && hasSticker && !hasFavoriteSticker;\n const canUnfaveSticker = !isAction && hasFavoriteSticker;\n const canCopy = !isAction;\n const canCopyLink = !isAction && (isChannel || isSuperGroup);\n const canSelect = !isAction;\n\n const canDownload = Boolean(content.webPage?.document || content.webPage?.video || content.webPage?.photo\n || content.audio || content.voice || content.photo || content.video || content.document || content.sticker);\n\n const noOptions = [\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canReport,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n ].every((ability) => !ability);\n\n return {\n noOptions,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canReport,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n };\n}\n\n// This selector always returns a new object which can not be safely used in shallow-equal checks\nexport function selectCanDeleteSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return {};\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return {\n canDelete: messageActions.every((actions) => actions.canDelete),\n canDeleteForAll: messageActions.every((actions) => actions.canDeleteForAll),\n };\n}\n\nexport function selectCanReportSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return false;\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return messageActions.every((actions) => actions.canReport);\n}\n\nexport function selectCanDownloadSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return false;\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return messageActions.some((actions) => actions.canDownload);\n}\n\nexport function selectIsDownloading(global: GlobalState, message: ApiMessage) {\n const activeInChat = global.activeDownloads.byChatId[message.chatId];\n return activeInChat ? activeInChat.includes(message.id) : false;\n}\n\nexport function selectActiveDownloadIds(global: GlobalState, chatId: string) {\n return global.activeDownloads.byChatId[chatId] || MEMO_EMPTY_ARRAY;\n}\n\nexport function selectUploadProgress(global: GlobalState, message: ApiMessage) {\n return global.fileUploads.byMessageLocalId[message.previousLocalId || message.id]?.progress;\n}\n\nexport function selectRealLastReadId(global: GlobalState, chatId: string, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n // `lastReadInboxMessageId` is empty for new chats\n if (!chat.lastReadInboxMessageId) {\n return undefined;\n }\n\n if (!chat.lastMessage) {\n return chat.lastReadInboxMessageId;\n }\n\n if (isMessageLocal(chat.lastMessage)) {\n return chat.lastMessage.id;\n }\n\n // Some previously read messages may be deleted\n return Math.min(chat.lastMessage.id, chat.lastReadInboxMessageId);\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n if (!threadInfo.lastReadInboxMessageId) {\n return threadInfo.topMessageId;\n }\n\n // Some previously read messages may be deleted\n return Math.min(threadInfo.lastReadInboxMessageId, threadInfo.lastMessageId || Infinity);\n }\n}\n\nexport function selectFirstUnreadId(global: GlobalState, chatId: string, threadId: number) {\n const chat = selectChat(global, chatId);\n\n if (threadId === MAIN_THREAD_ID) {\n if (!chat) {\n return undefined;\n }\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo\n || (threadInfo.lastMessageId !== undefined && threadInfo.lastMessageId === threadInfo.lastReadInboxMessageId)) {\n return undefined;\n }\n }\n\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const byId = selectChatMessages(global, chatId);\n if (!byId || !(outlyingIds || listedIds)) {\n return undefined;\n }\n\n const lastReadId = selectRealLastReadId(global, chatId, threadId);\n if (!lastReadId && chat && chat.isNotJoined) {\n return undefined;\n }\n\n const lastReadServiceNotificationId = chatId === SERVICE_NOTIFICATIONS_USER_ID\n ? global.serviceNotifications.reduce((max, notification) => {\n return !notification.isUnread && notification.id > max ? notification.id : max;\n }, -1)\n : -1;\n\n function findAfterLastReadId(listIds: number[]) {\n return listIds.find((id) => {\n return (\n (!lastReadId || id > lastReadId)\n && byId[id]\n && (!byId[id].isOutgoing || byId[id].isFromScheduled)\n && id > lastReadServiceNotificationId\n );\n });\n }\n\n if (outlyingIds) {\n const found = findAfterLastReadId(outlyingIds);\n if (found) {\n return found;\n }\n }\n\n if (listedIds) {\n const found = findAfterLastReadId(listedIds);\n if (found) {\n return found;\n }\n }\n\n return undefined;\n}\n\nexport function selectIsPollResultsOpen(global: GlobalState) {\n const { pollResults } = global;\n return Boolean(pollResults.messageId);\n}\n\nexport function selectIsForwardModalOpen(global: GlobalState) {\n const { forwardMessages } = global;\n return Boolean(forwardMessages.isModalShown);\n}\n\nexport function selectCommonBoxChatId(global: GlobalState, messageId: number) {\n const fromLastMessage = Object.values(global.chats.byId).find((chat) => (\n isCommonBoxChat(chat) && chat.lastMessage && chat.lastMessage.id === messageId\n ));\n if (fromLastMessage) {\n return fromLastMessage.id;\n }\n\n const { byChatId } = global.messages;\n return Object.keys(byChatId).find((chatId) => {\n const chat = selectChat(global, chatId);\n return chat && isCommonBoxChat(chat) && byChatId[chat.id].byId[messageId];\n });\n}\n\nexport function selectIsInSelectMode(global: GlobalState) {\n const { selectedMessages } = global;\n\n return Boolean(selectedMessages);\n}\n\nexport function selectIsMessageSelected(global: GlobalState, messageId: number) {\n const { messageIds } = global.selectedMessages || {};\n if (!messageIds) {\n return false;\n }\n\n return messageIds.includes(messageId);\n}\n\nexport function selectForwardedMessageIdsByGroupId(global: GlobalState, chatId: string, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.values(chatMessages)\n .filter((message) => message.groupedId === groupedId && message.forwardInfo)\n .map(({ forwardInfo }) => forwardInfo!.fromMessageId);\n}\n\nexport function selectMessageIdsByGroupId(global: GlobalState, chatId: string, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.keys(chatMessages)\n .map(Number)\n .filter((id) => chatMessages[id].groupedId === groupedId);\n}\n\nexport function selectIsDocumentGroupSelected(global: GlobalState, chatId: string, groupedId: string) {\n const { messageIds: selectedIds } = global.selectedMessages || {};\n if (!selectedIds) {\n return false;\n }\n\n const groupIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n return groupIds && groupIds.every((id) => selectedIds.includes(id));\n}\n\nexport function selectSelectedMessagesCount(global: GlobalState) {\n const { messageIds } = global.selectedMessages || {};\n\n return messageIds ? messageIds.length : 0;\n}\n\nexport function selectNewestMessageWithBotKeyboardButtons(\n global: GlobalState, chatId: string,\n): ApiMessage | undefined {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (!selectIsChatWithBot(global, chat)) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, MAIN_THREAD_ID);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const messageId = findLast(viewportIds, (id) => {\n return !chatMessages[id].isOutgoing && Boolean(chatMessages[id].keyboardButtons);\n });\n\n const replyHideMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id].shouldHideKeyboardButtons);\n });\n\n if (messageId && replyHideMessageId && replyHideMessageId > messageId) {\n return undefined;\n }\n\n return messageId ? chatMessages[messageId] : undefined;\n}\n\nexport function selectCanAutoLoadMedia(global: GlobalState, message: ApiMessage) {\n const chat = selectChat(global, message.chatId);\n if (!chat) {\n return undefined;\n }\n\n const sender = selectSender(global, message);\n\n const isPhoto = Boolean(getMessagePhoto(message) || getMessageWebPagePhoto(message));\n const isVideo = Boolean(getMessageVideo(message) || getMessageWebPageVideo(message));\n const isFile = Boolean(getMessageAudio(message) || getMessageVoice(message) || getMessageDocument(message));\n\n const {\n canAutoLoadPhotoFromContacts,\n canAutoLoadPhotoInPrivateChats,\n canAutoLoadPhotoInGroups,\n canAutoLoadPhotoInChannels,\n canAutoLoadVideoFromContacts,\n canAutoLoadVideoInPrivateChats,\n canAutoLoadVideoInGroups,\n canAutoLoadVideoInChannels,\n canAutoLoadFileFromContacts,\n canAutoLoadFileInPrivateChats,\n canAutoLoadFileInGroups,\n canAutoLoadFileInChannels,\n } = global.settings.byKey;\n\n if (isPhoto) {\n return canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts: canAutoLoadPhotoFromContacts,\n canAutoLoadMediaInPrivateChats: canAutoLoadPhotoInPrivateChats,\n canAutoLoadMediaInGroups: canAutoLoadPhotoInGroups,\n canAutoLoadMediaInChannels: canAutoLoadPhotoInChannels,\n });\n }\n\n if (isVideo) {\n return canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts: canAutoLoadVideoFromContacts,\n canAutoLoadMediaInPrivateChats: canAutoLoadVideoInPrivateChats,\n canAutoLoadMediaInGroups: canAutoLoadVideoInGroups,\n canAutoLoadMediaInChannels: canAutoLoadVideoInChannels,\n });\n }\n\n if (isFile) {\n return canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts: canAutoLoadFileFromContacts,\n canAutoLoadMediaInPrivateChats: canAutoLoadFileInPrivateChats,\n canAutoLoadMediaInGroups: canAutoLoadFileInGroups,\n canAutoLoadMediaInChannels: canAutoLoadFileInChannels,\n });\n }\n\n return true;\n}\n\nfunction canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts,\n canAutoLoadMediaInPrivateChats,\n canAutoLoadMediaInGroups,\n canAutoLoadMediaInChannels,\n}: {\n global: GlobalState;\n chat: ApiChat;\n canAutoLoadMediaFromContacts: boolean;\n canAutoLoadMediaInPrivateChats: boolean;\n canAutoLoadMediaInGroups: boolean;\n canAutoLoadMediaInChannels: boolean;\n sender?: ApiChat | ApiUser;\n}) {\n const isMediaFromContact = Boolean(sender && (\n sender.id === global.currentUserId || selectIsUserOrChatContact(global, sender)\n ));\n\n return Boolean(\n (isMediaFromContact && canAutoLoadMediaFromContacts)\n || (!isMediaFromContact && canAutoLoadMediaInPrivateChats && isUserId(chat.id))\n || (canAutoLoadMediaInGroups && isChatGroup(chat))\n || (canAutoLoadMediaInChannels && isChatChannel(chat)),\n );\n}\n\nexport function selectCanAutoPlayMedia(global: GlobalState, message: ApiMessage) {\n const video = getMessageVideo(message) || getMessageWebPageVideo(message);\n if (!video) {\n return undefined;\n }\n\n const {\n canAutoPlayVideos,\n canAutoPlayGifs,\n } = global.settings.byKey;\n\n const asGif = video.isGif || video.isRound;\n\n return (canAutoPlayVideos && !asGif) || (canAutoPlayGifs && asGif);\n}\n\nexport function selectShouldLoopStickers(global: GlobalState) {\n return global.settings.byKey.shouldLoopStickers;\n}\n\nexport function selectLastServiceNotification(global: GlobalState) {\n const { serviceNotifications } = global;\n const maxId = Math.max(...serviceNotifications.map(({ id }) => id));\n\n return serviceNotifications.find(({ id }) => id === maxId);\n}\n\nexport function selectIsMessageProtected(global: GlobalState, message?: ApiMessage) {\n return message ? message.isProtected || selectChat(global, message.chatId)?.isProtected : false;\n}\n\nexport function selectHasProtectedMessage(global: GlobalState, chatId: string, messageIds?: number[]) {\n if (selectChat(global, chatId)?.isProtected) {\n return true;\n }\n\n if (!messageIds) {\n return false;\n }\n\n const messages = selectChatMessages(global, chatId);\n\n return messageIds.some((messageId) => messages[messageId]?.isProtected);\n}\n\nexport function selectSponsoredMessage(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n const message = chat && isChatChannel(chat) ? global.messages.sponsoredByChatId[chatId] : undefined;\n\n return message && message.expiresAt >= Math.round(Date.now() / 1000) ? message : undefined;\n}\n\nexport function selectDefaultReaction(global: GlobalState, chatId: string) {\n if (chatId === SERVICE_NOTIFICATIONS_USER_ID) return undefined;\n\n const isPrivate = isUserId(chatId);\n const defaultReaction = global.appConfig?.defaultReaction;\n const { availableReactions } = global;\n if (!defaultReaction || !availableReactions?.some(\n (l) => l.reaction === defaultReaction && !l.isInactive,\n )) {\n return undefined;\n }\n\n if (isPrivate) {\n return defaultReaction;\n }\n\n const enabledReactions = selectChat(global, chatId)?.fullInfo?.enabledReactions;\n if (!enabledReactions?.includes(defaultReaction)) {\n return undefined;\n }\n\n return defaultReaction;\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectVisibleUsers(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const messageIds = selectThreadParam(global, chatId, threadId, 'viewportIds');\n if (!messageIds) {\n return undefined;\n }\n\n return messageIds.map((messageId) => {\n const { senderId } = selectChatMessage(global, chatId, messageId) || {};\n return senderId ? selectUser(global, senderId) : undefined;\n }).filter(Boolean);\n}\n","import { GlobalState } from '../../global/types';\nimport { selectCurrentMessageList } from './messages';\nimport { buildChatThreadKey } from '../helpers';\n\nexport function selectCurrentTextSearch(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const currentSearch = global.localTextSearch.byChatThreadKey[chatThreadKey];\n if (!currentSearch || !currentSearch.isActive) {\n return undefined;\n }\n\n return currentSearch;\n}\n\nexport function selectCurrentMediaSearch(global: GlobalState) {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return undefined;\n }\n\n return global.localMediaSearch.byChatId[chatId];\n}\n","import { GlobalState } from '../../global/types';\n\nimport { selectCurrentMessageList } from './messages';\nimport { selectChat } from './chats';\nimport { isChatGroup, isUserId } from '../helpers';\n\nexport function selectManagement(global: GlobalState, chatId: string) {\n return global.management.byChatId[chatId];\n}\n\nexport function selectCurrentManagement(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const currentManagement = global.management.byChatId[chatId];\n if (!currentManagement || !currentManagement.isActive) {\n return undefined;\n }\n\n return currentManagement;\n}\n\nexport function selectCurrentManagementType(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n if (isUserId(chatId)) {\n return 'user';\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (isChatGroup(chat)) {\n return 'group';\n }\n\n return 'channel';\n}\n","import { GlobalState } from '../../global/types';\nimport { NewChatMembersProgress, RightColumnContent } from '../../types';\n\nimport { getSystemTheme, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { selectCurrentMessageList, selectIsPollResultsOpen } from './messages';\nimport { selectCurrentTextSearch } from './localSearch';\nimport { selectCurrentGifSearch, selectCurrentStickerSearch } from './symbols';\nimport { selectCurrentManagement } from './management';\n\nexport function selectIsMediaViewerOpen(global: GlobalState) {\n const { mediaViewer } = global;\n return Boolean(mediaViewer.messageId || mediaViewer.avatarOwnerId);\n}\n\nexport function selectRightColumnContentKey(global: GlobalState) {\n return selectIsPollResultsOpen(global) ? (\n RightColumnContent.PollResults\n ) : !IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global) ? (\n RightColumnContent.Search\n ) : selectCurrentManagement(global) ? (\n RightColumnContent.Management\n ) : selectCurrentStickerSearch(global).query !== undefined ? (\n RightColumnContent.StickerSearch\n ) : selectCurrentGifSearch(global).query !== undefined ? (\n RightColumnContent.GifSearch\n ) : global.newChatMembersProgress !== NewChatMembersProgress.Closed ? (\n RightColumnContent.AddingMembers\n ) : global.isChatInfoShown && selectCurrentMessageList(global) ? (\n RightColumnContent.ChatInfo\n ) : undefined;\n}\n\nexport function selectIsRightColumnShown(global: GlobalState) {\n return selectRightColumnContentKey(global) !== undefined;\n}\n\nexport function selectTheme(global: GlobalState) {\n const { theme, shouldUseSystemTheme } = global.settings.byKey;\n\n return shouldUseSystemTheme ? getSystemTheme() : theme;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectCurrentGlobalSearchQuery(global: GlobalState) {\n return global.globalSearch.query;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectPaymentChatId(global: GlobalState) {\n return global.payment.chatId;\n}\n\nexport function selectPaymentMessageId(global: GlobalState) {\n return global.payment.messageId;\n}\n\nexport function selectPaymentFormId(global: GlobalState) {\n return global.payment.formId;\n}\n\nexport function selectPaymentRequestId(global: GlobalState) {\n return global.payment.requestId;\n}\n\nexport function selectProviderPublishableKey(global: GlobalState) {\n return global.payment.nativeParams?.publishableKey;\n}\n\nexport function selectProviderPublicToken(global: GlobalState) {\n return global.payment.nativeParams?.publicToken;\n}\n\nexport function selectStripeCredentials(global: GlobalState) {\n return global.payment.stripeCredentials;\n}\n\nexport function selectSmartGlocalCredentials(global: GlobalState) {\n return global.payment.smartGlocalCredentials;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectNotifySettings(global: GlobalState) {\n return global.settings.byKey;\n}\n\nexport function selectNotifyExceptions(global: GlobalState) {\n return global.settings.notifyExceptions;\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser, ApiUserStatus } from '../../api/types';\n\nexport function selectUser(global: GlobalState, userId: string): ApiUser | undefined {\n return global.users.byId[userId];\n}\n\nexport function selectUserStatus(global: GlobalState, userId: string): ApiUserStatus | undefined {\n return global.users.statusesById[userId];\n}\n\nexport function selectIsUserBlocked(global: GlobalState, userId: string) {\n const user = selectUser(global, userId);\n\n return user?.fullInfo?.isBlocked;\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectUserByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.users.byId).find(\n (user) => user.username.toLowerCase() === usernameLowered,\n );\n}\n\nexport function selectIsUserOrChatContact(global: GlobalState, userOrChat: ApiUser | ApiChat) {\n return global.contactList && global.contactList.userIds.includes(userOrChat.id);\n}\n","import {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm,\n ApiChatInviteImporter,\n ApiExportedInvite,\n ApiLanguage, ApiMessage, ApiShippingAddress, ApiStickerSet,\n} from '../api/types';\n\nexport enum LoadMoreDirection {\n Backwards,\n Forwards,\n Around,\n}\n\nexport enum FocusDirection {\n Up,\n Down,\n Static,\n}\n\nexport interface IAlbum {\n albumId: string;\n messages: ApiMessage[];\n mainMessage: ApiMessage;\n}\n\nexport type ThemeKey = 'light' | 'dark';\n\nexport interface IThemeSettings {\n background?: string;\n backgroundColor?: string;\n patternColor?: string;\n isBlurred?: boolean;\n}\n\nexport type NotifySettings = {\n hasPrivateChatsNotifications?: boolean;\n hasPrivateChatsMessagePreview?: boolean;\n hasGroupNotifications?: boolean;\n hasGroupMessagePreview?: boolean;\n hasBroadcastNotifications?: boolean;\n hasBroadcastMessagePreview?: boolean;\n hasContactJoinedNotifications?: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\nexport type LangCode = (\n 'en' | 'ar' | 'be' | 'ca' | 'nl' | 'fr' | 'de' | 'id' | 'it' | 'ko' | 'ms' | 'fa' | 'pl' | 'pt-br' | 'ru' | 'es'\n | 'tr' | 'uk' | 'uz'\n);\n\nexport type TimeFormat = '24h' | '12h';\n\nexport interface ISettings extends NotifySettings, Record {\n theme: ThemeKey;\n shouldUseSystemTheme: boolean;\n messageTextSize: number;\n animationLevel: 0 | 1 | 2;\n messageSendKeyCombo: 'enter' | 'ctrl-enter';\n canAutoLoadPhotoFromContacts: boolean;\n canAutoLoadPhotoInPrivateChats: boolean;\n canAutoLoadPhotoInGroups: boolean;\n canAutoLoadPhotoInChannels: boolean;\n canAutoLoadVideoFromContacts: boolean;\n canAutoLoadVideoInPrivateChats: boolean;\n canAutoLoadVideoInGroups: boolean;\n canAutoLoadVideoInChannels: boolean;\n canAutoLoadFileFromContacts: boolean;\n canAutoLoadFileInPrivateChats: boolean;\n canAutoLoadFileInGroups: boolean;\n canAutoLoadFileInChannels: boolean;\n autoLoadFileMaxSizeMb: number;\n canAutoPlayGifs: boolean;\n canAutoPlayVideos: boolean;\n shouldSuggestStickers: boolean;\n shouldLoopStickers: boolean;\n hasPassword?: boolean;\n languages?: ApiLanguage[];\n language: LangCode;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n timeFormat: TimeFormat;\n wasTimeFormatSetManually: boolean;\n isConnectionStatusMinimized: boolean;\n}\n\nexport interface ApiPrivacySettings {\n visibility: PrivacyVisibility;\n allowUserIds: string[];\n allowChatIds: string[];\n blockUserIds: string[];\n blockChatIds: string[];\n}\n\nexport interface InputPrivacyContact {\n id: string;\n accessHash?: string;\n}\n\nexport interface InputPrivacyRules {\n visibility: PrivacyVisibility;\n allowedUsers?: InputPrivacyContact[];\n allowedChats?: InputPrivacyContact[];\n blockedUsers?: InputPrivacyContact[];\n blockedChats?: InputPrivacyContact[];\n}\n\nexport type IAnchorPosition = {\n x: number;\n y: number;\n};\n\nexport interface ShippingOption {\n id: string;\n title: string;\n amount: number;\n prices: Price[];\n}\n\nexport interface Price {\n label: string;\n amount: number;\n}\n\nexport interface Invoice {\n currency?: string;\n emailRequested?: boolean;\n emailToProvider?: boolean;\n flexible?: boolean;\n nameRequested?: boolean;\n phoneRequested?: boolean;\n phoneToProvider?: boolean;\n prices?: Price[];\n shippingAddressRequested?: boolean;\n test?: boolean;\n}\n\nexport interface Receipt {\n currency: string;\n prices: Price[];\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n totalAmount: number;\n credentialsTitle: string;\n shippingPrices?: Price[];\n shippingMethod?: string;\n photoUrl?: string;\n text?: string;\n title?: string;\n}\n\nexport enum SettingsScreens {\n Main,\n EditProfile,\n Notifications,\n DataStorage,\n Language,\n General,\n GeneralChatBackground,\n GeneralChatBackgroundColor,\n Privacy,\n PrivacyPhoneNumber,\n PrivacyLastSeen,\n PrivacyProfilePhoto,\n PrivacyForwarding,\n PrivacyGroupChats,\n PrivacyPhoneNumberAllowedContacts,\n PrivacyPhoneNumberDeniedContacts,\n PrivacyLastSeenAllowedContacts,\n PrivacyLastSeenDeniedContacts,\n PrivacyProfilePhotoAllowedContacts,\n PrivacyProfilePhotoDeniedContacts,\n PrivacyForwardingAllowedContacts,\n PrivacyForwardingDeniedContacts,\n PrivacyGroupChatsAllowedContacts,\n PrivacyGroupChatsDeniedContacts,\n PrivacyActiveSessions,\n PrivacyBlockedUsers,\n Folders,\n FoldersCreateFolder,\n FoldersEditFolder,\n FoldersEditFolderFromChatList,\n FoldersIncludedChats,\n FoldersIncludedChatsFromChatList,\n FoldersExcludedChats,\n FoldersExcludedChatsFromChatList,\n TwoFaDisabled,\n TwoFaNewPassword,\n TwoFaNewPasswordConfirm,\n TwoFaNewPasswordHint,\n TwoFaNewPasswordEmail,\n TwoFaNewPasswordEmailCode,\n TwoFaEnabled,\n TwoFaChangePasswordCurrent,\n TwoFaChangePasswordNew,\n TwoFaChangePasswordConfirm,\n TwoFaChangePasswordHint,\n TwoFaTurnOff,\n TwoFaRecoveryEmailCurrentPassword,\n TwoFaRecoveryEmail,\n TwoFaRecoveryEmailCode,\n TwoFaCongratulations,\n QuickReaction,\n}\n\nexport type StickerSetOrRecent = Pick;\n\nexport enum LeftColumnContent {\n ChatList,\n GlobalSearch,\n Settings,\n Contacts,\n Archived,\n NewChannelStep1,\n NewChannelStep2,\n NewGroupStep1,\n NewGroupStep2,\n}\n\nexport enum GlobalSearchContent {\n ChatList,\n Media,\n Links,\n Files,\n Music,\n Voice,\n}\n\nexport enum RightColumnContent {\n ChatInfo,\n Search,\n Management,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nexport enum MediaViewerOrigin {\n Inline,\n ScheduledInline,\n SharedMedia,\n ProfileAvatar,\n SettingsAvatar,\n MiddleHeaderAvatar,\n Album,\n ScheduledAlbum,\n SearchResult,\n}\n\nexport enum AudioOrigin {\n Inline,\n SharedMedia,\n Search,\n}\n\nexport enum ChatCreationProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ProfileEditProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ManagementProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport interface ManagementState {\n isActive: boolean;\n nextScreen?: ManagementScreens;\n isUsernameAvailable?: boolean;\n error?: string;\n invites?: ApiExportedInvite[];\n revokedInvites?: ApiExportedInvite[];\n editingInvite?: ApiExportedInvite;\n inviteInfo?: {\n invite: ApiExportedInvite;\n importers?: ApiChatInviteImporter[];\n requesters?: ApiChatInviteImporter[];\n };\n}\n\nexport enum NewChatMembersProgress {\n Closed,\n InProgress,\n Loading,\n}\n\nexport type ProfileTabType = 'members' | 'commonChats' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\nexport type SharedMediaType = 'media' | 'documents' | 'links' | 'audio' | 'voice';\nexport type ApiPrivacyKey = 'phoneNumber' | 'lastSeen' | 'profilePhoto' | 'forwards' | 'chatInvite';\nexport type PrivacyVisibility = 'everybody' | 'contacts' | 'nonContacts' | 'nobody';\n\nexport enum ProfileState {\n Profile,\n SharedMedia,\n MemberList,\n}\n\nexport enum PaymentStep {\n ShippingInfo,\n Shipping,\n PaymentInfo,\n Checkout,\n ConfirmPayment,\n}\n\nexport const UPLOADING_WALLPAPER_SLUG = 'UPLOADING_WALLPAPER_SLUG';\n\nexport enum ManagementScreens {\n Initial,\n ChatPrivacyType,\n Discussion,\n ChannelSubscribers,\n GroupType,\n GroupPermissions,\n GroupRemovedUsers,\n ChannelRemovedUsers,\n GroupUserPermissionsCreate,\n GroupUserPermissions,\n ChatAdministrators,\n GroupRecentActions,\n ChatAdminRights,\n ChatNewAdminRights,\n GroupMembers,\n GroupAddAdmins,\n Invites,\n EditInvite,\n Reactions,\n InviteInfo,\n JoinRequests,\n}\n\nexport type ManagementType = 'user' | 'group' | 'channel';\n\nexport type NotifyException = {\n isMuted: boolean;\n isSilent?: boolean;\n shouldShowPreviews?: boolean;\n};\n\nexport type EmojiKeywords = {\n isLoading?: boolean;\n version: number;\n keywords: Record;\n};\n\nexport type InlineBotSettings = {\n id: string;\n help?: string;\n query?: string;\n offset?: string;\n canLoadMore?: boolean;\n results?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n isGallery?: boolean;\n switchPm?: ApiBotInlineSwitchPm;\n};\n","import { fastRaf } from './schedulers';\n\ninterface AnimationInstance {\n isCancelled: boolean;\n}\n\nlet currentInstance: AnimationInstance | undefined;\n\nexport function animateSingle(tick: Function, instance?: AnimationInstance) {\n if (!instance) {\n if (currentInstance && !currentInstance.isCancelled) {\n currentInstance.isCancelled = true;\n }\n\n instance = { isCancelled: false };\n currentInstance = instance;\n }\n\n if (!instance!.isCancelled && tick()) {\n fastRaf(() => {\n animateSingle(tick, instance);\n });\n }\n}\n\nexport function animate(tick: Function) {\n if (tick()) {\n fastRaf(() => {\n animate(tick);\n });\n }\n}\n\nexport type TimingFn = (t: number) => number;\n\nexport type AnimateNumberProps = {\n to: number | number[];\n from: number | number[];\n duration: number;\n onUpdate: (value: any) => void;\n timing?: TimingFn;\n onEnd?: () => void;\n};\n\nexport const timingFunctions = {\n linear: (t: number) => t,\n easeIn: (t: number) => t ** 1.675,\n easeOut: (t: number) => 1 - (1 - t ** 1.675),\n easeInOut: (t: number) => 0.5 * (Math.sin((t - 0.5) * Math.PI) + 1),\n easeInQuad: (t: number) => t * t,\n easeOutQuad: (t: number) => t * (2 - t),\n easeInOutQuad: (t: number) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t),\n easeInCubic: (t: number) => t * t * t,\n easeOutCubic: (t: number) => (--t) * t * t + 1,\n easeInOutCubic: (t: number) => (t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),\n easeInQuart: (t: number) => t * t * t * t,\n easeOutQuart: (t: number) => 1 - (--t) * t * t * t,\n easeInOutQuart: (t: number) => (t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t),\n easeInQuint: (t: number) => t * t * t * t * t,\n easeOutQuint: (t: number) => 1 + (--t) * t * t * t * t,\n easeInOutQuint: (t: number) => (t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t),\n};\n\nexport function animateNumber({\n timing = timingFunctions.linear,\n onUpdate,\n duration,\n onEnd,\n from,\n to,\n}: AnimateNumberProps) {\n const t0 = Date.now();\n let canceled = false;\n\n animate(() => {\n if (canceled) return false;\n const t1 = Date.now();\n let t = (t1 - t0) / duration;\n if (t > 1) t = 1;\n const progress = timing(t);\n if (typeof from === 'number' && typeof to === 'number') {\n onUpdate(from + ((to - from) * progress));\n } else if (Array.isArray(from) && Array.isArray(to)) {\n const result = from.map((f, i) => f + ((to[i] - f) * progress));\n onUpdate(result);\n }\n if (t === 1 && onEnd) onEnd();\n return t < 1;\n });\n\n return () => {\n canceled = true;\n if (onEnd) onEnd();\n };\n}\n","import { DEBUG } from '../config';\n\nexport function updateAppBadge(unreadCount: number) {\n if (typeof window.navigator.setAppBadge !== 'function') {\n return;\n }\n\n window.navigator.setAppBadge(unreadCount).catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n}\n","export default function arePropsShallowEqual(currentProps: AnyLiteral, newProps: AnyLiteral) {\n if (currentProps === newProps) {\n return true;\n }\n\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return false;\n }\n\n if (currentKeysLength === 0) {\n return true;\n }\n\n for (let i = 0; i < currentKeysLength; i++) {\n const prop = currentKeys[i];\n if (currentProps[prop] !== newProps[prop]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function getUnequalProps(currentProps: AnyLiteral, newProps: AnyLiteral) {\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return ['%LENGTH%'];\n }\n\n return currentKeys.reduce((res, prop) => {\n if (currentProps[prop] !== newProps[prop]) {\n res.push(`${prop}: ${currentProps[prop]} => ${newProps[prop]}`);\n }\n\n return res;\n }, [] as string[]);\n}\n","type Parts = (string | false | undefined)[];\ntype PartsWithGlobals = (string | false | undefined | string[])[];\n\nexport default function buildClassName(...parts: Parts) {\n return parts.filter(Boolean).join(' ');\n}\n\nexport function createClassNameBuilder(componentName: string) {\n return (elementName: string, ...modifiers: PartsWithGlobals) => {\n const baseName = elementName === '&' ? componentName : `${componentName}__${elementName}`;\n\n return modifiers.reduce((acc, modifier) => {\n if (modifier) {\n // A bit hacky way to pass global class names\n if (Array.isArray(modifier)) {\n acc.push(...modifier);\n } else {\n acc.push(`${baseName}--${modifier}`);\n }\n }\n\n return acc;\n }, [baseName]).join(' ');\n };\n}\n","// eslint-disable-next-line no-restricted-globals\nconst cacheApi = self.caches;\n\nexport enum Type {\n Text,\n Blob,\n Json,\n}\n\nexport async function fetch(\n cacheName: string, key: string, type: Type, isHtmlAllowed = false,\n) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const cache = await cacheApi.open(cacheName);\n const response = await cache.match(request);\n if (!response) {\n return undefined;\n }\n\n const contentType = response.headers.get('Content-Type');\n\n switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n // Ignore deprecated data-uri avatars\n if (key.startsWith('avatar') && contentType && contentType.startsWith('text')) {\n return undefined;\n }\n\n const blob = await response.blob();\n const shouldRecreate = !blob.type || (!isHtmlAllowed && blob.type.includes('html'));\n // iOS Safari fails to preserve `type` in cache\n let resolvedType = blob.type || contentType;\n\n if (!(shouldRecreate && resolvedType)) {\n return blob;\n }\n\n // Prevent HTML-in-video attacks (for files that were cached before fix)\n if (!isHtmlAllowed) {\n resolvedType = resolvedType.replace(/html/gi, '');\n }\n\n return new Blob([blob], { type: resolvedType });\n }\n case Type.Json:\n return await response.json();\n default:\n return undefined;\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function save(cacheName: string, key: string, data: AnyLiteral | Blob | string) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n const cacheData = typeof data === 'string' || data instanceof Blob ? data : JSON.stringify(data);\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const response = new Response(cacheData);\n const cache = await cacheApi.open(cacheName);\n return await cache.put(request, response);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function clear(cacheName: string) {\n try {\n if (!cacheApi) {\n return undefined;\n }\n\n return await cacheApi.delete(cacheName);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n","export function createCallbackManager() {\n const callbacks: AnyToVoidFunction[] = [];\n\n function addCallback(cb: AnyToVoidFunction) {\n callbacks.push(cb);\n\n return () => {\n removeCallback(cb);\n };\n }\n\n function removeCallback(cb: AnyToVoidFunction) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n }\n\n function runCallbacks(...args: any[]) {\n callbacks.forEach((callback) => {\n callback(...args);\n });\n }\n\n function hasCallbacks() {\n return Boolean(callbacks.length);\n }\n\n return {\n runCallbacks,\n addCallback,\n removeCallback,\n hasCallbacks,\n };\n}\n\nexport type CallbackManager = ReturnType;\n","import captureKeyboardListener from './captureKeyboardListeners';\n\ntype IHandlerFunction = () => void;\n\nexport default function captureEscKeyListener(handler: IHandlerFunction) {\n return captureKeyboardListener({ onEsc: handler });\n}\n","type HandlerName = 'onEnter' | 'onBackspace' | 'onDelete' | 'onEsc' | 'onUp' | 'onDown' | 'onLeft' | 'onRight'\n| 'onTab';\ntype Handler = (e: KeyboardEvent) => void;\ntype CaptureOptions = Partial>;\n\nconst keyToHandlerName: Record = {\n Enter: 'onEnter',\n Backspace: 'onBackspace',\n Delete: 'onDelete',\n Esc: 'onEsc',\n Escape: 'onEsc',\n ArrowUp: 'onUp',\n ArrowDown: 'onDown',\n ArrowLeft: 'onLeft',\n ArrowRight: 'onRight',\n Tab: 'onTab',\n};\n\nconst handlers: Record = {\n onEnter: [],\n onDelete: [],\n onBackspace: [],\n onEsc: [],\n onUp: [],\n onDown: [],\n onLeft: [],\n onRight: [],\n onTab: [],\n};\n\nexport default function captureKeyboardListeners(options: CaptureOptions) {\n if (!hasActiveHandlers()) {\n document.addEventListener('keydown', handleKeyDown, true);\n }\n\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n if (!handler) {\n return;\n }\n\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n currentEventHandlers.push(handler);\n }\n });\n\n return () => {\n releaseKeyboardListener(options);\n };\n}\n\nfunction hasActiveHandlers() {\n return Object.values(handlers).some((keyHandlers) => Boolean(keyHandlers.length));\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n const handlerName = keyToHandlerName[e.key];\n if (!handlerName) {\n return;\n }\n\n const { length } = handlers[handlerName];\n if (!length) {\n return;\n }\n e.stopPropagation();\n\n const handler = handlers[handlerName][length - 1];\n handler!(e);\n}\n\nfunction releaseKeyboardListener(options: CaptureOptions) {\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n const index = currentEventHandlers.findIndex((cb) => cb === handler);\n if (index !== -1) {\n currentEventHandlers.splice(index, 1);\n }\n }\n });\n\n if (!hasActiveHandlers()) {\n document.removeEventListener('keydown', handleKeyDown, false);\n }\n}\n","import { LangFn } from '../hooks/useLang';\n\nconst WEEKDAYS_FULL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst MONTHS_FULL = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December',\n];\n\nconst MONTHS_FULL_LOWERCASE = MONTHS_FULL.map((month) => month.toLowerCase());\nconst MIN_SEARCH_YEAR = 2015;\nconst MAX_DAY_IN_MONTH = 31;\nconst MAX_MONTH_IN_YEAR = 12;\nexport const MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\n\nexport function isToday(date: Date) {\n return getDayStart(new Date()) === getDayStart(date);\n}\n\nexport function getDayStart(datetime: number | Date) {\n const date = new Date(datetime);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\nexport function getDayStartAt(datetime: number | Date) {\n return getDayStart(datetime).getTime();\n}\n\nexport function toYearMonth(timestamp: number) {\n const date = new Date(timestamp * 1000);\n return `${date.getFullYear()}-${date.getMonth()}`;\n}\n\nfunction toIsoString(date: Date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}\n\n// @optimization `toLocaleTimeString` is avoided because of bad performance\nexport function formatTime(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const timeFormat = lang.timeFormat || '24h';\n\n let hours = date.getHours();\n let marker = '';\n if (timeFormat === '12h') {\n marker = hours >= 12 ? ' PM' : ' AM';\n hours = hours > 12 ? hours % 12 : hours;\n }\n\n return `${String(hours).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}${marker}`;\n}\n\nexport function formatPastTimeShort(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n if (date >= today) {\n return formatTime(lang, date);\n }\n\n const weekAgo = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n if (date >= weekAgo) {\n return lang(`Weekday.Short${WEEKDAYS_FULL[date.getDay()]}`);\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const format = (\n lang(withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n || (withYear ? 'd MMM yyyy' : 'd MMM')\n );\n\n return formatDate(lang, date, format);\n}\n\nexport function formatFullDate(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const format = lang('formatterYearMax') || 'dd.MM.yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatMonthAndYear(lang: LangFn, date: Date, isShort = false) {\n const format = lang(isShort ? 'formatterMonthYear2' : 'formatterMonthYear') || 'MMM yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatCountdown(\n lang: LangFn,\n msLeft: number,\n) {\n const days = Math.floor(msLeft / MILLISECONDS_IN_DAY);\n if (msLeft < 0) {\n return 0;\n } else if (days < 1) {\n return formatMediaDuration(msLeft / 1000);\n } else if (days < 7) {\n return lang('Days', days);\n } else if (days < 30) {\n return lang('Weeks', Math.floor(days / 7));\n } else if (days < 365) {\n return lang('Months', Math.floor(days / 30));\n } else {\n return lang('Years', Math.floor(days / 365));\n }\n}\n\nexport function formatHumanDate(\n lang: LangFn,\n datetime: number | Date,\n isShort = false,\n noWeekdays = false,\n isUpperFirst?: boolean,\n) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n\n if (!noWeekdays) {\n if (toIsoString(date) === toIsoString(today)) {\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(lang('Weekday.Today'));\n }\n\n const yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n if (toIsoString(date) === toIsoString(yesterday)) {\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(lang('Weekday.Yesterday'));\n }\n\n const weekAgo = new Date(today);\n const weekAhead = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n weekAhead.setDate(today.getDate() + 7);\n if (date >= weekAgo && date <= weekAhead) {\n const weekDay = WEEKDAYS_FULL[date.getDay()];\n const weekDayString = isShort ? lang(`Weekday.Short${weekDay}`) : lang(`Weekday.${weekDay}`);\n\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(weekDayString);\n }\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const formatKey = isShort\n ? (withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n : (withYear ? 'chatFullDate' : 'chatDate');\n const format = lang(formatKey) || 'd MMMM yyyy';\n\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(formatDate(lang, date, format));\n}\n\nfunction formatDate(lang: LangFn, date: Date, format: string) {\n const day = date.getDate();\n const monthIndex = date.getMonth();\n\n return format\n .replace('LLLL', lang(MONTHS_FULL[monthIndex]))\n .replace('MMMM', lang(`Month.Gen${MONTHS_FULL[monthIndex]}`))\n .replace('MMM', lang(`Month.Short${MONTHS_FULL[monthIndex]}`))\n .replace('MM', String(monthIndex + 1).padStart(2, '0'))\n .replace('dd', String(day).padStart(2, '0'))\n .replace('d', String(day))\n .replace('yyyy', String(date.getFullYear()))\n // Workaround for https://bugs.telegram.org/c/5777\n .replace(/'de'/g, 'de');\n}\n\nexport function formatMediaDateTime(\n lang: LangFn,\n datetime: number | Date,\n isUpperFirst?: boolean,\n) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n return `${formatHumanDate(lang, date, true, undefined, isUpperFirst)}, ${formatTime(lang, date)}`;\n}\n\nexport function formatMediaDuration(duration: number, maxValue?: number) {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor((duration % 3600) / 60);\n const seconds = Math.floor(duration % 3600 % 60);\n\n const maxHours = maxValue ? Math.floor(maxValue / 3600) : 0;\n const maxMinutes = maxValue ? Math.floor((maxValue % 3600) / 60) : 0;\n let string = '';\n if (hours > 0 || maxHours > 0) {\n string += `${String(hours).padStart(2, '0')}:`;\n string += `${String(minutes).padStart(2, '0')}:`;\n } else if (maxMinutes >= 10) {\n string += `${String(minutes).padStart(2, '0')}:`;\n } else {\n string += `${String(minutes)}:`;\n }\n string += String(seconds).padStart(2, '0');\n\n return string;\n}\n\nexport function formatVoiceRecordDuration(durationInMs: number) {\n const parts = [];\n\n let milliseconds = durationInMs % 1000;\n durationInMs -= milliseconds;\n milliseconds = Math.floor(milliseconds / 10);\n\n durationInMs = Math.floor(durationInMs / 1000);\n const seconds = durationInMs % 60;\n durationInMs -= seconds;\n\n durationInMs = Math.floor(durationInMs / 60);\n const minutes = durationInMs % 60;\n durationInMs -= minutes;\n\n durationInMs = Math.floor(durationInMs / 60);\n const hours = durationInMs % 60;\n\n if (hours > 0) {\n parts.push(String(hours).padStart(2, '0'));\n }\n parts.push(String(minutes).padStart(hours > 0 ? 2 : 1, '0'));\n parts.push(String(seconds).padStart(2, '0'));\n\n return `${parts.join(':')},${String(milliseconds).padStart(2, '0')}`;\n}\n\nexport function formatDateToString(datetime: Date | number, locale = 'en-US') {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n );\n}\n\nexport function formatDateTimeToString(datetime: Date | number, locale = 'en-US') {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n );\n}\n\nfunction isValidDate(day: number, month: number, year = 2021): boolean {\n if (month > (MAX_MONTH_IN_YEAR - 1) || day > MAX_DAY_IN_MONTH) {\n return false;\n }\n const date = new Date(year, month, day);\n return !Number.isNaN(date.getTime()) && date.getDate() === day;\n}\n\nexport function parseDateString(query = ''): string | undefined {\n const matchStringDate = query.match(/\\d{1,2}\\s[a-zA-Z]{3,}/);\n const matchEuropeStringDate = query.match(/[a-zA-Z]{3,}\\s\\d{1,2}/);\n const matchNumberDate = query.match(/\\d{1,2}[./-]\\d{1,2}([./-]\\d{2,4})?/);\n if (!matchStringDate && !matchNumberDate && !matchEuropeStringDate) {\n return undefined;\n }\n\n if (matchNumberDate) {\n const [date, month, year] = query.split(/[./-]/).map(Number);\n return !(year && year < MIN_SEARCH_YEAR) && isValidDate(date, month - 1, year || undefined)\n ? `${year ? `${year}-` : ''}${String(month).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n }\n\n const dateParts = query.split(' ');\n const date = matchStringDate ? dateParts[0] : dateParts[1];\n const month = (matchStringDate ? dateParts[1] : dateParts[0]).toLowerCase();\n const monthIndex = MONTHS_FULL_LOWERCASE.findIndex((item) => item.startsWith(month));\n\n return monthIndex !== -1 && isValidDate(Number(date), monthIndex)\n ? `${String(monthIndex + 1).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n}\n\nexport function timestampPlusDay(timestamp: number) {\n return timestamp + MILLISECONDS_IN_DAY / 1000;\n}\n\nfunction lowerFirst(str: string) {\n return `${str[0].toLowerCase()}${str.slice(1)}`;\n}\n\nfunction upperFirst(str: string) {\n return `${str[0].toUpperCase()}${str.slice(1)}`;\n}\n","import EMOJI_REGEX from '../lib/twemojiRegex';\n\n// Due to the fact that emoji from Apple do not contain some characters, it is necessary to remove them from emoji-data\n// https://github.com/iamcal/emoji-data/issues/136\nconst EXCLUDE_EMOJIS = ['female_sign', 'male_sign', 'medical_symbol'];\n\nconst ISO_FLAGS_OFFSET = 127397;\n\nexport type EmojiRawData = typeof import('emoji-data-ios/emoji-data.json');\nexport type EmojiModule = { default: EmojiRawData };\n\nexport type EmojiData = {\n categories: Array;\n emojis: Record;\n};\n\n// Non-standard variations of emojis, used on some devices\nconst EMOJI_EXCEPTIONS: [string | RegExp, string][] = [\n [/\\u{1f3f3}\\u200d\\u{1f308}/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u{1f308}'], // 🏳‍🌈\n [/\\u{1f3f3}\\u200d\\u26a7\\ufe0f/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u26a7\\ufe0f'], // 🏳️‍⚧️\n [/\\u{1f937}\\u200d\\u2642[^\\ufe0f]/gu, '\\u{1f937}\\u200d\\u2642\\ufe0f'], // 🤷‍♂️\n];\n\nfunction unifiedToNative(unified: string) {\n const unicodes = unified.split('-');\n const codePoints = unicodes.map((i) => parseInt(i, 16));\n\n return String.fromCodePoint(...codePoints);\n}\n\nexport function fixNonStandardEmoji(text: string) {\n // Non-standard sequences typically parsed as separate emojis, so no need to fix text without any\n if (!text.match(EMOJI_REGEX)) return text;\n // eslint-disable-next-line no-restricted-syntax\n for (const [regex, replacement] of EMOJI_EXCEPTIONS) {\n text = text.replace(regex, replacement);\n }\n\n return text;\n}\n\nexport function nativeToUnified(emoji: string) {\n let code;\n\n if (emoji.length === 1) {\n code = emoji.charCodeAt(0).toString(16).padStart(4, '0');\n } else {\n const pairs = [];\n for (let i = 0; i < emoji.length; i++) {\n if (emoji.charCodeAt(i) >= 0xd800 && emoji.charCodeAt(i) <= 0xdbff) {\n if (emoji.charCodeAt(i + 1) >= 0xdc00 && emoji.charCodeAt(i + 1) <= 0xdfff) {\n pairs.push(\n (emoji.charCodeAt(i) - 0xd800) * 0x400\n + (emoji.charCodeAt(i + 1) - 0xdc00) + 0x10000,\n );\n }\n } else if (emoji.charCodeAt(i) < 0xd800 || emoji.charCodeAt(i) > 0xdfff) {\n pairs.push(emoji.charCodeAt(i));\n }\n }\n\n code = pairs.map((x) => x.toString(16).padStart(4, '0')).join('-');\n }\n\n return code;\n}\n\nexport function uncompressEmoji(data: EmojiRawData): EmojiData {\n const emojiData: EmojiData = { categories: [], emojis: {} };\n\n for (let i = 0; i < data.length; i += 2) {\n const category = {\n id: data[i][0],\n name: data[i][1],\n emojis: [],\n } as EmojiCategory;\n\n for (let j = 0; j < data[i + 1].length; j++) {\n const emojiRaw = data[i + 1][j];\n if (!EXCLUDE_EMOJIS.includes(emojiRaw[1][0])) {\n category.emojis.push(emojiRaw[1][0]);\n emojiData.emojis[emojiRaw[1][0]] = {\n id: emojiRaw[1][0],\n names: emojiRaw[1] as string[],\n native: unifiedToNative(emojiRaw[0] as string),\n image: (emojiRaw[0] as string).toLowerCase(),\n };\n }\n }\n\n emojiData.categories.push(category);\n }\n\n return emojiData;\n}\n\nexport function isoToEmoji(iso: string) {\n const code = iso.toUpperCase();\n\n if (!/^[A-Z]{2}$/.test(code)) return iso;\n const codePoints = [...code].map((c) => c.codePointAt(0)! + ISO_FLAGS_OFFSET);\n return String.fromCodePoint(...codePoints);\n}\n","export function ensureProtocol(url?: string) {\n if (!url) {\n return undefined;\n }\n\n // HTTP was chosen by default as a fix for https://bugs.telegram.org/c/10712.\n // It is also the default protocol in the official TDesktop client.\n return url.includes('://') ? url : `http://${url}`;\n}\n","let isWebpSupportedCache: boolean | undefined;\n\nexport function isWebpSupported() {\n return Boolean(isWebpSupportedCache);\n}\n\nfunction testWebp(): Promise {\n return new Promise((resolve) => {\n const webp = new Image();\n // eslint-disable-next-line max-len\n webp.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA';\n const handleLoadOrError = () => {\n resolve(webp.height === 2);\n };\n webp.onload = handleLoadOrError;\n webp.onerror = handleLoadOrError;\n });\n}\n\ntestWebp().then((hasWebp) => {\n isWebpSupportedCache = hasWebp;\n});\n","import { ThemeKey } from '../types';\n\nlet systemThemeCache: ThemeKey = (\n window.matchMedia?.('(prefers-color-scheme: dark)').matches\n) ? 'dark' : 'light';\n\nexport function getSystemTheme() {\n return systemThemeCache;\n}\n\nfunction handleSystemThemeChange(e: MediaQueryListEventMap['change']) {\n systemThemeCache = e.matches ? 'dark' : 'light';\n}\n\nconst mql = window.matchMedia('(prefers-color-scheme: dark)');\nif (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n} else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n}\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n IS_TEST,\n SUPPORTED_VIDEO_CONTENT_TYPES,\n VIDEO_MOV_TYPE,\n} from '../config';\n\nexport * from './environmentWebp';\n\nexport * from './environmentSystemTheme';\n\nexport function getPlatform() {\n const { userAgent, platform } = window.navigator;\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];\n const iosPlatforms = ['iPhone', 'iPad', 'iPod'];\n let os: 'macOS' | 'iOS' | 'Windows' | 'Android' | 'Linux' | undefined;\n\n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'macOS';\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS';\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } else if (/Android/.test(userAgent)) {\n os = 'Android';\n } else if (/Linux/.test(platform)) {\n os = 'Linux';\n }\n\n return os;\n}\n\nexport const PLATFORM_ENV = getPlatform();\nexport const IS_MAC_OS = PLATFORM_ENV === 'macOS';\nexport const IS_IOS = PLATFORM_ENV === 'iOS';\nexport const IS_ANDROID = PLATFORM_ENV === 'Android';\nexport const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\nexport const IS_PWA = (\n window.matchMedia('(display-mode: standalone)').matches\n || (window.navigator as any).standalone\n || document.referrer.includes('android-app://')\n);\n\nexport const IS_TOUCH_ENV = window.matchMedia('(pointer: coarse)').matches;\n// Keep in mind the landscape orientation\nexport const IS_SINGLE_COLUMN_LAYOUT = window.innerWidth <= MOBILE_SCREEN_MAX_WIDTH || (\n window.innerWidth <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && window.innerHeight <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n);\n// Special layout, 1 column while chat opened, 2 columns while collapsed\nexport const IS_TABLET_COLUMN_LAYOUT = !IS_SINGLE_COLUMN_LAYOUT && (\n window.innerWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n);\nexport const IS_VOICE_RECORDING_SUPPORTED = Boolean(\n navigator.mediaDevices && 'getUserMedia' in navigator.mediaDevices && (\n window.AudioContext || (window as any).webkitAudioContext\n ),\n);\nexport const IS_SMOOTH_SCROLL_SUPPORTED = 'scrollBehavior' in document.documentElement.style;\nexport const IS_EMOJI_SUPPORTED = PLATFORM_ENV && (IS_MAC_OS || IS_IOS);\nexport const IS_SERVICE_WORKER_SUPPORTED = 'serviceWorker' in navigator;\n// TODO Consider failed service worker\nexport const IS_PROGRESSIVE_SUPPORTED = IS_SERVICE_WORKER_SUPPORTED;\nexport const IS_STREAMING_SUPPORTED = 'MediaSource' in window;\nexport const IS_OPUS_SUPPORTED = Boolean((new Audio()).canPlayType('audio/ogg; codecs=opus'));\nexport const IS_CANVAS_FILTER_SUPPORTED = (\n !IS_TEST && 'filter' in (document.createElement('canvas').getContext('2d') || {})\n);\nexport const IS_REQUEST_FULLSCREEN_SUPPORTED = 'requestFullscreen' in document.createElement('div');\nexport const ARE_CALLS_SUPPORTED = !navigator.userAgent.includes('Firefox');\nexport const LAYERS_ANIMATION_NAME = IS_ANDROID ? 'slide-fade' : IS_IOS ? 'slide-layers' : 'push-slide';\n\nconst TEST_VIDEO = document.createElement('video');\n// `canPlayType(VIDEO_MOV_TYPE)` returns false negative at least for macOS Chrome and iOS Safari\nexport const IS_MOV_SUPPORTED = true;\n\nif (IS_MOV_SUPPORTED) SUPPORTED_VIDEO_CONTENT_TYPES.add(VIDEO_MOV_TYPE);\n\nexport const IS_WEBM_SUPPORTED = Boolean(TEST_VIDEO.canPlayType('video/webm; codecs=\"vp9\"').replace('no', ''))\n && !(IS_MAC_OS && IS_SAFARI); // Safari on MacOS has some issues with WebM\n\nexport const DPR = window.devicePixelRatio || 1;\n\nexport const MASK_IMAGE_DISABLED = true;\n\nexport const IS_BACKDROP_BLUR_SUPPORTED = CSS.supports('backdrop-filter: blur()')\n || CSS.supports('-webkit-backdrop-filter: blur()');\nexport const IS_COMPACT_MENU = !IS_TOUCH_ENV;\nexport const IS_SCROLL_PATCH_NEEDED = !IS_MAC_OS && !IS_IOS && !IS_ANDROID;\n\n// Smaller area reduces scroll jumps caused by `patchChromiumScroll`\nexport const MESSAGE_LIST_SENSITIVE_AREA = IS_SCROLL_PATCH_NEEDED ? 300 : 750;\n","import { pause } from './schedulers';\n\n// Polyfill for Safari: `File` is not available in web worker\nif (typeof File === 'undefined') {\n // eslint-disable-next-line no-global-assign, no-restricted-globals, func-names\n self.File = class extends Blob {\n name: string;\n\n constructor(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag) {\n if (options) {\n const { type, ...rest } = options;\n super(fileBits, { type });\n Object.assign(this, rest);\n } else {\n super(fileBits);\n }\n\n this.name = fileName;\n }\n } as typeof File;\n}\n\nexport function dataUriToBlob(dataUri: string) {\n const arr = dataUri.split(',');\n const mime = arr[0].match(/:(.*?);/)![1];\n const bstr = atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n\nexport function blobToDataUri(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent) => {\n const { result } = e.target || {};\n if (typeof result === 'string') {\n resolve(result);\n }\n\n reject(new Error('Failed to read blob'));\n };\n\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\nexport function blobToFile(blob: Blob, fileName: string) {\n return new File([blob], fileName, {\n lastModified: Date.now(),\n type: blob.type,\n });\n}\n\nexport function preloadImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = url;\n });\n}\n\nexport function preloadVideo(url: string): Promise {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.volume = 0;\n video.onloadedmetadata = () => resolve(video);\n video.onerror = reject;\n video.src = url;\n });\n}\n\nexport async function createPosterForVideo(url: string): Promise {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n new Promise((resolve, reject) => {\n video.onseeked = () => {\n if (!video.videoWidth || !video.videoHeight) {\n resolve(undefined);\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(video, 0, 0);\n resolve(canvas.toDataURL('image/jpeg'));\n };\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n }),\n ]);\n}\n\nexport async function fetchBlob(blobUrl: string) {\n const response = await fetch(blobUrl);\n return response.blob();\n}\n\nexport async function fetchFile(blobUrl: string, fileName: string) {\n const blob = await fetchBlob(blobUrl);\n return blobToFile(blob, fileName);\n}\n\nexport function imgToCanvas(img: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(img, 0, 0);\n\n return canvas;\n}\n","import { addCallback, addReducer, getGlobal } from '../lib/teact/teactn';\n\nimport { GlobalState } from '../global/types';\nimport { NotifyException, NotifySettings } from '../types';\nimport { ApiChat, ApiChatFolder, ApiUser } from '../api/types';\n\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, DEBUG } from '../config';\nimport { selectNotifySettings, selectNotifyExceptions } from '../modules/selectors';\nimport { selectIsChatMuted } from '../modules/helpers';\nimport { onIdle, throttle } from './schedulers';\nimport { areSortedArraysEqual, unique } from './iteratees';\nimport arePropsShallowEqual from './arePropsShallowEqual';\nimport { CallbackManager, createCallbackManager } from './callbacks';\n\ninterface FolderSummary {\n id: number;\n listIds?: Set;\n orderedPinnedIds?: string[];\n contacts?: true;\n nonContacts?: true;\n groups?: true;\n channels?: true;\n bots?: true;\n excludeMuted?: true;\n excludeRead?: true;\n excludeArchived?: true;\n excludedChatIds?: Set;\n includedChatIds?: Set;\n pinnedChatIds?: Set;\n}\n\ninterface ChatSummary {\n id: string;\n type: ApiChat['type'];\n isListed: boolean;\n isArchived: boolean;\n isMuted: boolean;\n isUnread: boolean;\n unreadCount?: number;\n unreadMentionsCount?: number;\n order: number;\n isUserBot?: boolean;\n isUserContact?: boolean;\n}\n\nconst UPDATE_THROTTLE = 500;\nconst DEBUG_DURATION_LIMIT = 6;\n\nconst initials = buildInitials();\n\nlet prevGlobal: {\n allFolderListIds?: GlobalState['chats']['listIds']['active'];\n allFolderPinnedIds?: GlobalState['chats']['orderedPinnedIds']['active'];\n archivedFolderListIds?: GlobalState['chats']['listIds']['archived'];\n archivedFolderPinnedIds?: GlobalState['chats']['orderedPinnedIds']['archived'];\n isAllFolderFullyLoaded?: boolean;\n isArchivedFolderFullyLoaded?: boolean;\n chatsById: Record;\n foldersById: Record;\n usersById: Record;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n} = initials.prevGlobal;\n\nlet prepared: {\n folderSummariesById: Record;\n chatSummariesById: Map;\n folderIdsByChatId: Record;\n chatIdsByFolderId: Record | undefined>;\n isOrderedListJustPatched: Record;\n} = initials.prepared;\n\nlet results: {\n orderedIdsByFolderId: Record;\n pinnedCountByFolderId: Record; // Also watched by `callbacks.orderedIdsByFolderId`\n chatsCountByFolderId: Record;\n unreadCountersByFolderId: Record;\n} = initials.results;\n\nlet callbacks: {\n orderedIdsByFolderId: Record;\n chatsCountByFolderId: CallbackManager;\n unreadCountersByFolderId: CallbackManager;\n} = initials.callbacks;\n\nconst updateFolderManagerThrottled = throttle(() => {\n onIdle(() => {\n updateFolderManager(getGlobal());\n });\n}, UPDATE_THROTTLE);\n\nlet inited = false;\n\n/* Getters */\n\nexport function init() {\n inited = true;\n\n addCallback(updateFolderManagerThrottled);\n addReducer('reset', reset);\n\n updateFolderManager(getGlobal());\n}\n\nexport function getOrderedIds(folderId: number) {\n if (!inited) init();\n\n return results.orderedIdsByFolderId[folderId];\n}\n\nexport function getPinnedChatsCount(folderId: number) {\n if (!inited) init();\n\n return results.pinnedCountByFolderId[folderId] || 0;\n}\n\nexport function getChatsCount() {\n if (!inited) init();\n\n return results.chatsCountByFolderId;\n}\n\nexport function getUnreadCounters() {\n if (!inited) init();\n\n return results.unreadCountersByFolderId;\n}\n\nexport function getAllNotificationsCount() {\n return getUnreadCounters()[ALL_FOLDER_ID]?.notificationsCount || 0;\n}\n\n/* Callback managers */\n\nexport function addOrderedIdsCallback(folderId: number, callback: (orderedIds: string[]) => void) {\n if (!callbacks.orderedIdsByFolderId[folderId]) {\n callbacks.orderedIdsByFolderId[folderId] = createCallbackManager();\n }\n\n return callbacks.orderedIdsByFolderId[folderId].addCallback(callback);\n}\n\nexport function addChatsCountCallback(callback: (chatsCount: typeof results.chatsCountByFolderId) => void) {\n return callbacks.chatsCountByFolderId.addCallback(callback);\n}\n\nexport function addUnreadCountersCallback(callback: (unreadCounters: typeof results.unreadCountersByFolderId) => void) {\n return callbacks.unreadCountersByFolderId.addCallback(callback);\n}\n\n/* Global update handlers */\n\nfunction updateFolderManager(global: GlobalState) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startedAt: number;\n if (DEBUG) {\n DEBUG_startedAt = performance.now();\n }\n\n const isAllFolderChanged = Boolean(\n global.chats.listIds.active\n && isMainFolderChanged(ALL_FOLDER_ID, global.chats.listIds.active, global.chats.orderedPinnedIds.active),\n );\n const isArchivedFolderChanged = Boolean(\n global.chats.listIds.archived\n && isMainFolderChanged(ARCHIVED_FOLDER_ID, global.chats.listIds.archived, global.chats.orderedPinnedIds.archived),\n );\n const isAllFullyLoadedChanged = global.chats.isFullyLoaded.active !== prevGlobal.isAllFolderFullyLoaded;\n const isArchivedFullyLoadedChanged = global.chats.isFullyLoaded.archived !== prevGlobal.isArchivedFolderFullyLoaded;\n\n const areFoldersChanged = global.chatFolders.byId !== prevGlobal.foldersById;\n const areChatsChanged = global.chats.byId !== prevGlobal.chatsById;\n const areUsersChanged = global.users.byId !== prevGlobal.usersById;\n const areNotifySettingsChanged = selectNotifySettings(global) !== prevGlobal.notifySettings;\n const areNotifyExceptionsChanged = selectNotifyExceptions(global) !== prevGlobal.notifyExceptions;\n\n let affectedFolderIds: number[] = [];\n\n if (isAllFullyLoadedChanged || isArchivedFullyLoadedChanged) {\n affectedFolderIds = affectedFolderIds.concat(\n updateFullyLoaded(global, isArchivedFullyLoadedChanged),\n );\n }\n\n if (!(\n isAllFolderChanged || isArchivedFolderChanged || areFoldersChanged\n || areChatsChanged || areUsersChanged || areNotifySettingsChanged || areNotifyExceptionsChanged\n )\n ) {\n if (affectedFolderIds.length) {\n updateResults(affectedFolderIds);\n }\n\n return;\n }\n\n const prevAllFolderListIds = prevGlobal.allFolderListIds;\n const prevArchivedFolderListIds = prevGlobal.archivedFolderListIds;\n\n updateFolders(global, isAllFolderChanged, isArchivedFolderChanged, areFoldersChanged);\n\n affectedFolderIds = affectedFolderIds.concat(updateChats(\n global, areFoldersChanged || isAllFolderChanged || isArchivedFolderChanged,\n areNotifySettingsChanged, areNotifyExceptionsChanged,\n prevAllFolderListIds, prevArchivedFolderListIds,\n ));\n\n updateResults(unique(affectedFolderIds));\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startedAt!;\n if (duration > DEBUG_DURATION_LIMIT) {\n // eslint-disable-next-line no-console\n console.warn(`Slow \\`updateFolderManager\\`: ${Math.round(duration)} ms`);\n }\n }\n}\n\nfunction isMainFolderChanged(folderId: number, newListIds?: string[], newPinnedIds?: string[]) {\n const currentListIds = folderId === ALL_FOLDER_ID\n ? prevGlobal.allFolderListIds\n : prevGlobal.archivedFolderListIds;\n const currentPinnedIds = folderId === ALL_FOLDER_ID\n ? prevGlobal.allFolderPinnedIds\n : prevGlobal.archivedFolderPinnedIds;\n\n return currentListIds !== newListIds || currentPinnedIds !== newPinnedIds;\n}\n\nfunction updateFullyLoaded(\n global: GlobalState,\n isArchivedFullyLoadedChanged = false,\n) {\n let affectedFolderIds = [];\n\n if (isArchivedFullyLoadedChanged) {\n affectedFolderIds.push(ARCHIVED_FOLDER_ID);\n }\n\n const isAllFolderFullyLoaded = global.chats.isFullyLoaded.active;\n const isArchivedFolderFullyLoaded = global.chats.isFullyLoaded.archived;\n\n if (isAllFolderFullyLoaded && isArchivedFolderFullyLoaded) {\n const emptyFolderIds = Object.keys(prepared.folderSummariesById)\n .filter((folderId) => !results.orderedIdsByFolderId[folderId])\n .map(Number);\n\n affectedFolderIds = affectedFolderIds.concat(emptyFolderIds);\n }\n\n prevGlobal.isAllFolderFullyLoaded = isAllFolderFullyLoaded;\n prevGlobal.isArchivedFolderFullyLoaded = isArchivedFolderFullyLoaded;\n\n return affectedFolderIds;\n}\n\nfunction updateFolders(\n global: GlobalState, isAllFolderChanged: boolean, isArchivedFolderChanged: boolean, areFoldersChanged: boolean,\n) {\n const changedFolders = [];\n\n if (isAllFolderChanged) {\n const newListIds = global.chats.listIds.active!;\n const newPinnedIds = global.chats.orderedPinnedIds.active;\n\n prepared.folderSummariesById[ALL_FOLDER_ID] = buildFolderSummaryFromMainList(\n ALL_FOLDER_ID, newListIds, newPinnedIds,\n );\n\n prevGlobal.allFolderListIds = newListIds;\n prevGlobal.allFolderPinnedIds = newPinnedIds;\n\n changedFolders.push(ALL_FOLDER_ID);\n }\n\n if (isArchivedFolderChanged) {\n const newListIds = global.chats.listIds.archived!;\n const newPinnedIds = global.chats.orderedPinnedIds.archived;\n\n prepared.folderSummariesById[ARCHIVED_FOLDER_ID] = buildFolderSummaryFromMainList(\n ARCHIVED_FOLDER_ID, newListIds, newPinnedIds,\n );\n\n prevGlobal.archivedFolderListIds = newListIds;\n prevGlobal.archivedFolderPinnedIds = newPinnedIds;\n\n changedFolders.push(ARCHIVED_FOLDER_ID);\n }\n\n if (areFoldersChanged) {\n const newFoldersById = global.chatFolders.byId;\n\n Object.values(newFoldersById).forEach((folder) => {\n if (folder === prevGlobal.foldersById[folder.id]) {\n return;\n }\n\n prepared.folderSummariesById[folder.id] = buildFolderSummary(folder);\n\n changedFolders.push(folder.id);\n });\n\n prevGlobal.foldersById = newFoldersById;\n }\n\n return changedFolders;\n}\n\nfunction buildFolderSummaryFromMainList(\n folderId: number, listIds: string[], orderedPinnedIds?: string[],\n): FolderSummary {\n return {\n id: folderId,\n listIds: new Set(listIds),\n orderedPinnedIds: orderedPinnedIds,\n pinnedChatIds: new Set(orderedPinnedIds),\n };\n}\n\nfunction buildFolderSummary(folder: ApiChatFolder): FolderSummary {\n return {\n ...folder,\n orderedPinnedIds: folder.pinnedChatIds,\n excludedChatIds: folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined,\n includedChatIds: folder.excludedChatIds ? new Set(folder.includedChatIds) : undefined,\n pinnedChatIds: folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined,\n };\n}\n\nfunction updateChats(\n global: GlobalState,\n areFoldersChanged: boolean,\n areNotifySettingsChanged: boolean,\n areNotifyExceptionsChanged: boolean,\n prevAllFolderListIds?: string[],\n prevArchivedFolderListIds?: string[],\n) {\n const newChatsById = global.chats.byId;\n const newUsersById = global.users.byId;\n const newNotifySettings = selectNotifySettings(global);\n const newNotifyExceptions = selectNotifyExceptions(global);\n const folderSummaries = Object.values(prepared.folderSummariesById);\n const affectedFolderIds = new Set();\n\n const newAllFolderListIds = global.chats.listIds.active;\n const newArchivedFolderListIds = global.chats.listIds.archived;\n let allIds = [...newAllFolderListIds || [], ...newArchivedFolderListIds || []];\n if (newAllFolderListIds !== prevAllFolderListIds || newArchivedFolderListIds !== prevArchivedFolderListIds) {\n allIds = unique(allIds.concat(prevAllFolderListIds || [], prevArchivedFolderListIds || []));\n }\n\n allIds.forEach((chatId) => {\n const chat = newChatsById[chatId];\n\n if (\n !areFoldersChanged\n && !areNotifySettingsChanged\n && !areNotifyExceptionsChanged\n && chat === prevGlobal.chatsById[chatId]\n && newUsersById[chatId] === prevGlobal.usersById[chatId]\n ) {\n return;\n }\n\n let newFolderIds: number[];\n if (chat) {\n const currentSummary = prepared.chatSummariesById.get(chatId);\n const newSummary = buildChatSummary(chat, newNotifySettings, newNotifyExceptions, newUsersById[chatId]);\n if (!areFoldersChanged && currentSummary && arePropsShallowEqual(newSummary, currentSummary)) {\n return;\n }\n\n prepared.chatSummariesById.set(chatId, newSummary);\n\n newFolderIds = buildChatFolderIds(newSummary, folderSummaries);\n newFolderIds.forEach((folderId) => {\n affectedFolderIds.add(folderId);\n });\n } else {\n prepared.chatSummariesById.delete(chatId);\n newFolderIds = [];\n }\n\n const currentFolderIds = prepared.folderIdsByChatId[chatId] || [];\n if (areSortedArraysEqual(newFolderIds, currentFolderIds)) {\n return;\n }\n\n const deletedFolderIds = updateListsForChat(chatId, currentFolderIds, newFolderIds);\n deletedFolderIds.forEach((folderId) => {\n affectedFolderIds.add(folderId);\n });\n });\n\n prevGlobal.chatsById = newChatsById;\n prevGlobal.usersById = newUsersById;\n prevGlobal.notifySettings = newNotifySettings;\n prevGlobal.notifyExceptions = newNotifyExceptions;\n\n return Array.from(affectedFolderIds);\n}\n\nfunction buildChatSummary(\n chat: ApiChat,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n user?: ApiUser,\n): ChatSummary {\n const {\n id, type, lastMessage, isRestricted, isNotJoined, folderId,\n unreadCount, unreadMentionsCount, hasUnreadMark,\n joinDate, draftDate,\n } = chat;\n\n const userInfo = type === 'chatTypePrivate' && user;\n\n return {\n id,\n type,\n isListed: Boolean(lastMessage && !isRestricted && !isNotJoined),\n isArchived: folderId === ARCHIVED_FOLDER_ID,\n isMuted: selectIsChatMuted(chat, notifySettings, notifyExceptions),\n isUnread: Boolean(unreadCount || unreadMentionsCount || hasUnreadMark),\n unreadCount,\n unreadMentionsCount,\n order: Math.max(joinDate || 0, draftDate || 0, lastMessage?.date || 0),\n isUserBot: userInfo ? userInfo.type === 'userTypeBot' : undefined,\n isUserContact: userInfo ? userInfo.isContact : undefined,\n };\n}\n\nfunction buildChatFolderIds(chatSummary: ChatSummary, folderSummaries: FolderSummary[]) {\n return folderSummaries.reduce((acc, folderSummary) => {\n if (isChatInFolder(chatSummary, folderSummary)) {\n acc.push(folderSummary.id);\n }\n\n return acc;\n }, []).sort();\n}\n\nfunction isChatInFolder(\n chatSummary: ChatSummary,\n folderSummary: FolderSummary,\n) {\n if (!chatSummary.isListed) {\n return false;\n }\n\n const { id: chatId, type } = chatSummary;\n\n if (folderSummary.listIds) {\n if (\n (chatSummary.isArchived && folderSummary.id === ALL_FOLDER_ID)\n || (!chatSummary.isArchived && folderSummary.id === ARCHIVED_FOLDER_ID)\n ) {\n return false;\n }\n\n return folderSummary.listIds.has(chatId);\n }\n\n if (folderSummary.excludedChatIds?.has(chatId)) {\n return false;\n }\n\n if (folderSummary.includedChatIds?.has(chatId)) {\n return true;\n }\n\n if (folderSummary.pinnedChatIds?.has(chatId)) {\n return true;\n }\n\n if (folderSummary.excludeArchived && chatSummary.isArchived) {\n return false;\n }\n\n if (folderSummary.excludeRead && !chatSummary.isUnread) {\n return false;\n }\n\n if (folderSummary.excludeMuted && chatSummary.isMuted && !chatSummary.unreadMentionsCount) {\n return false;\n }\n\n if (type === 'chatTypePrivate') {\n if (chatSummary.isUserBot) {\n if (folderSummary.bots) {\n return true;\n }\n } else {\n if (folderSummary.contacts && chatSummary.isUserContact) {\n return true;\n }\n\n if (folderSummary.nonContacts && !chatSummary.isUserContact) {\n return true;\n }\n }\n } else if (type === 'chatTypeChannel') {\n return Boolean(folderSummary.channels);\n } else if (type === 'chatTypeBasicGroup' || type === 'chatTypeSuperGroup') {\n return Boolean(folderSummary.groups);\n }\n\n return false;\n}\n\nfunction updateListsForChat(chatId: string, currentFolderIds: number[], newFolderIds: number[]) {\n const currentFolderIdsSet = new Set(currentFolderIds);\n const newFolderIdsSet = new Set(newFolderIds);\n const deletedFolderIds: number[] = [];\n\n unique([...currentFolderIds, ...newFolderIds]).forEach((folderId) => {\n let currentFolderOrderedIds = results.orderedIdsByFolderId[folderId];\n\n if (currentFolderIdsSet.has(folderId) && !newFolderIdsSet.has(folderId)) {\n prepared.chatIdsByFolderId[folderId]!.delete(chatId);\n\n deletedFolderIds.push(folderId);\n\n if (currentFolderOrderedIds) {\n currentFolderOrderedIds = currentFolderOrderedIds.filter((id) => id !== chatId);\n prepared.isOrderedListJustPatched[folderId] = true;\n }\n } else if (!currentFolderIdsSet.has(folderId) && newFolderIdsSet.has(folderId)) {\n if (!prepared.chatIdsByFolderId[folderId]) {\n prepared.chatIdsByFolderId[folderId] = new Set();\n }\n\n prepared.chatIdsByFolderId[folderId]!.add(chatId);\n\n if (currentFolderOrderedIds) {\n currentFolderOrderedIds.push(chatId);\n prepared.isOrderedListJustPatched[folderId] = true;\n }\n }\n\n results.orderedIdsByFolderId[folderId] = currentFolderOrderedIds;\n });\n\n prepared.folderIdsByChatId[chatId] = newFolderIds;\n\n return deletedFolderIds;\n}\n\nfunction updateResults(affectedFolderIds: number[]) {\n let wasUnreadCountersChanged = false;\n let wasChatsCountChanged = false;\n\n Array.from(affectedFolderIds).forEach((folderId) => {\n const { pinnedCount: newPinnedCount, orderedIds: newOrderedIds } = buildFolderOrderedIds(folderId);\n // When signed out\n if (!newOrderedIds) {\n return;\n }\n\n const currentOrderedIds = results.orderedIdsByFolderId[folderId];\n const currentPinnedCount = results.pinnedCountByFolderId[folderId];\n const areOrderedIdsChanged = (\n !currentOrderedIds\n || currentPinnedCount === undefined || currentPinnedCount !== newPinnedCount\n || prepared.isOrderedListJustPatched[folderId]\n || !areSortedArraysEqual(newOrderedIds, currentOrderedIds)\n );\n if (areOrderedIdsChanged) {\n prepared.isOrderedListJustPatched[folderId] = false;\n results.orderedIdsByFolderId[folderId] = newOrderedIds;\n results.pinnedCountByFolderId[folderId] = newPinnedCount;\n callbacks.orderedIdsByFolderId[folderId]?.runCallbacks(newOrderedIds);\n }\n\n const currentChatsCount = results.chatsCountByFolderId[folderId];\n const newChatsCount = newOrderedIds.length;\n if (!wasChatsCountChanged) {\n wasChatsCountChanged = currentChatsCount !== newChatsCount;\n }\n results.chatsCountByFolderId[folderId] = newChatsCount;\n\n const currentUnreadCounters = results.unreadCountersByFolderId[folderId];\n const newUnreadCounters = buildFolderUnreadCounters(folderId);\n if (!wasUnreadCountersChanged) {\n wasUnreadCountersChanged = (\n !currentUnreadCounters || !arePropsShallowEqual(newUnreadCounters, currentUnreadCounters)\n );\n }\n results.unreadCountersByFolderId[folderId] = newUnreadCounters;\n });\n\n if (wasChatsCountChanged) {\n // We need to update the entire object as it will be returned from a hook\n const newValue = { ...results.chatsCountByFolderId };\n results.chatsCountByFolderId = newValue;\n callbacks.chatsCountByFolderId.runCallbacks(newValue);\n }\n\n if (wasUnreadCountersChanged) {\n // We need to update the entire object as it will be returned from a hook\n const newValue = { ...results.unreadCountersByFolderId };\n results.unreadCountersByFolderId = newValue;\n callbacks.unreadCountersByFolderId.runCallbacks(newValue);\n }\n}\n\nfunction buildFolderOrderedIds(folderId: number) {\n const folderSummary = prepared.folderSummariesById[folderId];\n if (!folderSummary) {\n return {};\n }\n\n const { orderedPinnedIds, pinnedChatIds } = folderSummary;\n const {\n chatSummariesById,\n chatIdsByFolderId: { [folderId]: chatIds },\n } = prepared;\n const {\n orderedIdsByFolderId: { [folderId]: prevOrderedIds },\n } = results;\n\n const sortedPinnedIds = chatIds ? orderedPinnedIds?.filter((id) => chatIds.has(id)) : orderedPinnedIds;\n const allListIds = prevOrderedIds || (chatIds && Array.from(chatIds)) || [];\n const notPinnedIds = pinnedChatIds ? allListIds.filter((id) => !pinnedChatIds.has(id)) : allListIds;\n const sortedNotPinnedIds = notPinnedIds.sort((chatId1: string, chatId2: string) => {\n return chatSummariesById.get(chatId2)!.order - chatSummariesById.get(chatId1)!.order;\n });\n\n return {\n pinnedCount: sortedPinnedIds?.length || 0,\n orderedIds: [\n ...(sortedPinnedIds || []),\n ...sortedNotPinnedIds,\n ],\n };\n}\n\nfunction buildFolderUnreadCounters(folderId: number) {\n const {\n chatSummariesById,\n } = prepared;\n const {\n orderedIdsByFolderId: { [folderId]: orderedIds },\n } = results;\n\n return orderedIds!.reduce((newUnreadCounters, chatId) => {\n const chatSummary = chatSummariesById.get(chatId);\n if (!chatSummary) {\n return newUnreadCounters;\n }\n\n if (chatSummary.isUnread) {\n newUnreadCounters.chatsCount++;\n\n if (chatSummary.unreadMentionsCount) {\n newUnreadCounters.notificationsCount += chatSummary.unreadMentionsCount;\n }\n\n if (!chatSummary.isMuted) {\n if (chatSummary.unreadCount) {\n newUnreadCounters.notificationsCount += chatSummary.unreadCount;\n } else if (!chatSummary.unreadMentionsCount) {\n newUnreadCounters.notificationsCount += 1; // Manually marked unread\n }\n }\n }\n\n return newUnreadCounters;\n }, {\n chatsCount: 0,\n notificationsCount: 0,\n });\n}\n\nfunction buildInitials() {\n return {\n prevGlobal: {\n foldersById: {},\n chatsById: {},\n usersById: {},\n notifySettings: {} as NotifySettings,\n notifyExceptions: {},\n },\n\n prepared: {\n folderSummariesById: {},\n chatSummariesById: new Map(),\n folderIdsByChatId: {},\n chatIdsByFolderId: {},\n isOrderedListJustPatched: {},\n },\n\n results: {\n orderedIdsByFolderId: {},\n pinnedCountByFolderId: {},\n chatsCountByFolderId: {},\n unreadCountersByFolderId: {},\n },\n\n callbacks: {\n orderedIdsByFolderId: {},\n chatsCountByFolderId: createCallbackManager(),\n unreadCountersByFolderId: createCallbackManager(),\n },\n };\n}\n\nfunction reset() {\n const newInitials = buildInitials();\n\n prevGlobal = newInitials.prevGlobal;\n prepared = newInitials.prepared;\n results = newInitials.results;\n callbacks = newInitials.callbacks;\n}\n","import { LangCode } from '../types';\n\nexport function formatCurrency(totalPrice: number, currency?: string, locale: LangCode = 'en') {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(currency === 'JPY' ? totalPrice : totalPrice / 100);\n}\n","const generateIdFor = (store: AnyLiteral) => {\n let id;\n\n do {\n id = String(Math.random()).replace('0.', 'id');\n } while (store.hasOwnProperty(id));\n\n return id;\n};\n\nexport default generateIdFor;\n","import { ApiError, ApiFieldError } from '../api/types';\n\nconst READABLE_ERROR_MESSAGES: Record = {\n CHAT_RESTRICTED: 'You can\\'t send messages in this chat, you were restricted',\n CHAT_WRITE_FORBIDDEN: 'You can\\'t write in this chat',\n CHAT_SEND_POLL_FORBIDDEN: 'You can\\'t create polls in this chat',\n CHAT_SEND_STICKERS_FORBIDDEN: 'You can\\'t send stickers in this chat',\n CHAT_SEND_GIFS_FORBIDDEN: 'You can\\'t send gifs in this chat',\n CHAT_SEND_MEDIA_FORBIDDEN: 'You can\\'t send media in this chat',\n CHAT_LINK_EXISTS: 'The chat is public, you can\\'t hide the history to new users',\n // eslint-disable-next-line max-len\n SLOWMODE_WAIT_X: 'Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.',\n USER_BANNED_IN_CHANNEL: 'You\\'re banned from sending messages in supergroups / channels',\n USER_IS_BLOCKED: 'You were blocked by this user',\n YOU_BLOCKED_USER: 'You blocked this user',\n IMAGE_PROCESS_FAILED: 'Failure while processing image',\n MEDIA_EMPTY: 'The provided media object is invalid',\n MEDIA_INVALID: 'Media invalid',\n PHOTO_EXT_INVALID: 'The extension of the photo is invalid',\n PHOTO_INVALID_DIMENSIONS: 'The photo dimensions are invalid',\n PHOTO_SAVE_FILE_INVALID: 'Internal issues, try again later',\n // eslint-disable-next-line max-len\n MESSAGE_DELETE_FORBIDDEN: 'You can\\'t delete one of the messages you tried to delete, most likely because it is a service message.',\n MESSAGE_POLL_CLOSED: 'Poll closed',\n MESSAGE_EDIT_TIME_EXPIRED: 'You can\\'t edit this message anymore.',\n CHAT_ADMIN_REQUIRED: 'You must be an admin in this chat to do this',\n PINNED_DIALOGS_TOO_MUCH: 'Sorry, you can only pin 5 chats to the top',\n DIALOG_FILTERS_TOO_MUCH: 'Sorry, you can\\'t have more than 10 folders',\n CHANNEL_PRIVATE: 'This channel is private',\n MEDIA_CAPTION_TOO_LONG: 'The provided caption is too long',\n ADDRESS_STREET_LINE1_INVALID: 'The address you provided is not valid',\n ADDRESS_STREET_LINE2_INVALID: 'The address you provided is not valid',\n ADDRESS_CITY_INVALID: 'The city you provided is not valid',\n ADDRESS_COUNTRY_INVALID: 'The country you provided is not valid',\n ADDRESS_POSTCODE_INVALID: 'The postcode you provided is not valid',\n ADDRESS_STATE_INVALID: 'The state you provided is not valid',\n REQ_INFO_NAME_INVALID: 'The name you provided is not valid',\n REQ_INFO_PHONE_INVALID: 'The phone you provided is not valid',\n REQ_INFO_EMAIL_INVALID: 'The email you provided is not valid',\n // TODO Bring back after fixing the weird bug\n // CHANNEL_INVALID: 'An error occurred. Please try again later',\n LINK_NOT_MODIFIED: 'This discussion is already linked to the channel',\n MESSAGE_TOO_LONG: 'Message is too long',\n\n // Non-API errors\n // eslint-disable-next-line max-len\n SERVICE_WORKER_DISABLED: 'Service Worker is disabled. Streaming media may not be supported. Try reloading the page without holding key',\n // eslint-disable-next-line max-len\n MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS: 'The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.',\n // eslint-disable-next-line max-len\n FRESH_RESET_AUTHORISATION_FORBIDDEN: 'You can’t logout other sessions if less than 24 hours have passed since you logged on the current session',\n\n BOTS_TOO_MUCH: 'There are too many bots in this chat/channel',\n BOT_GROUPS_BLOCKED: 'This bot can\\'t be added to groups',\n USERS_TOO_MUCH: 'The maximum number of users has been exceeded',\n USER_CHANNELS_TOO_MUCH: 'One of the users you tried to add is already in too many channels/supergroups',\n USER_KICKED: 'This user was kicked from this supergroup/channel',\n USER_NOT_MUTUAL_CONTACT: 'The provided user is not a mutual contact',\n USER_PRIVACY_RESTRICTED: 'The user\\'s privacy settings do not allow you to do this',\n INVITE_HASH_EMPTY: 'The invite hash is empty',\n INVITE_HASH_EXPIRED: 'The invite link has expired',\n INVITE_HASH_INVALID: 'The invite hash is invalid',\n CHANNELS_TOO_MUCH: 'You have joined too many channels/supergroups',\n USER_ALREADY_PARTICIPANT: 'You already in the group',\n SCHEDULE_DATE_INVALID: 'Invalid schedule date provided',\n WALLPAPER_DIMENSIONS_INVALID: 'The wallpaper dimensions are invalid, please select another file',\n ADMINS_TOO_MUCH: 'There are too many admins',\n ADMIN_RANK_EMOJI_NOT_ALLOWED: 'An admin rank cannot contain emojis',\n ADMIN_RANK_INVALID: 'The specified admin rank is invalid',\n FRESH_CHANGE_ADMINS_FORBIDDEN: 'You were just elected admin, you can\\'t add or modify other admins yet',\n INPUT_USER_DEACTIVATED: 'The specified user was deleted',\n BOT_PRECHECKOUT_TIMEOUT: 'The request for payment has expired',\n};\n\nexport const SHIPPING_ERRORS: Record = {\n ADDRESS_STREET_LINE1_INVALID: {\n field: 'streetLine1',\n message: 'Incorrect street address',\n },\n ADDRESS_STREET_LINE2_INVALID: {\n field: 'streetLine2',\n message: 'Incorrect street address',\n },\n ADDRESS_CITY_INVALID: {\n field: 'city',\n message: 'Incorrect city',\n },\n ADDRESS_COUNTRY_INVALID: {\n field: 'countryIso2',\n message: 'Incorrect country',\n },\n ADDRESS_POSTCODE_INVALID: {\n field: 'postCode',\n message: 'Incorrect post code',\n },\n ADDRESS_STATE_INVALID: {\n field: 'state',\n message: 'Incorrect state',\n },\n REQ_INFO_NAME_INVALID: {\n field: 'fullName',\n message: 'Incorrect name',\n },\n REQ_INFO_PHONE_INVALID: {\n field: 'phone',\n message: 'Incorrect phone',\n },\n REQ_INFO_EMAIL_INVALID: {\n field: 'email',\n message: 'Incorrect email',\n },\n};\n\nexport default function getReadableErrorText(error: ApiError) {\n const { message, isSlowMode, textParams } = error;\n // Currently, Telegram API doesn't return `SLOWMODE_WAIT_X` error as described in the docs\n if (isSlowMode) {\n const extraPartIndex = message.indexOf(' (caused by');\n return extraPartIndex > 0 ? message.substring(0, extraPartIndex) : message;\n }\n let errorMessage = READABLE_ERROR_MESSAGES[message];\n if (errorMessage && textParams) {\n errorMessage = Object.keys(textParams).reduce((acc, current) => {\n return acc.replace(current, textParams[current]);\n }, errorMessage as string);\n }\n return errorMessage;\n}\n\nexport function getShippingError(error: ApiError): ApiFieldError | undefined {\n return SHIPPING_ERRORS[error.message];\n}\n","import { DEBUG_ALERT_MSG } from '../config';\nimport { throttle } from './schedulers';\n\nwindow.addEventListener('error', handleErrorEvent);\nwindow.addEventListener('unhandledrejection', handleErrorEvent);\n\n// eslint-disable-next-line prefer-destructuring\nconst APP_ENV = process.env.APP_ENV;\n\nfunction handleErrorEvent(e: ErrorEvent | PromiseRejectionEvent) {\n // https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n if (e instanceof ErrorEvent && e.message === 'ResizeObserver loop limit exceeded') {\n return;\n }\n\n e.preventDefault();\n\n handleError(e instanceof ErrorEvent ? (e.error || e.message) : e.reason);\n}\n\nconst throttledAlert = throttle(window.alert, 1000);\n\nexport function handleError(err: Error) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (APP_ENV === 'development' || APP_ENV === 'staging') {\n throttledAlert(`${DEBUG_ALERT_MSG}\\n\\n${(err?.message) || err}\\n${err?.stack}`);\n }\n}\n","type CollectionByKey = Record;\n\ntype OrderDirection =\n 'asc'\n | 'desc';\n\ninterface OrderCallback {\n (member: T): any;\n}\n\nexport function buildCollectionByKey(collection: T[], key: keyof T) {\n return collection.reduce((byKey: CollectionByKey, member: T) => {\n byKey[member[key]] = member;\n\n return byKey;\n }, {});\n}\n\nexport function mapValues(\n byKey: CollectionByKey,\n callback: (member: M, key: string, index: number, originalByKey: CollectionByKey) => R,\n): CollectionByKey {\n return Object.keys(byKey).reduce((newByKey: CollectionByKey, key, index) => {\n newByKey[key] = callback(byKey[key], key, index, byKey);\n return newByKey;\n }, {});\n}\n\nexport function pick(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n result[key] = object[key];\n return result;\n }, {} as Pick);\n}\n\nexport function pickTruthy(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n if (object[key]) {\n result[key] = object[key];\n }\n\n return result;\n }, {} as Pick);\n}\n\nexport function omit(object: T, keys: K[]) {\n const stringKeys = new Set(keys.map(String));\n const savedKeys = Object.keys(object)\n .filter((key) => !stringKeys.has(key)) as Array>;\n\n return pick(object, savedKeys);\n}\n\nexport function orderBy(\n collection: T[],\n orderRule: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n function compareValues(a: T, b: T, currentOrderRule: (keyof T) | OrderCallback, isAsc: boolean) {\n const aValue = (typeof currentOrderRule === 'function' ? currentOrderRule(a) : a[currentOrderRule]) || 0;\n const bValue = (typeof currentOrderRule === 'function' ? currentOrderRule(b) : b[currentOrderRule]) || 0;\n\n return isAsc ? aValue - bValue : bValue - aValue;\n }\n\n if (Array.isArray(orderRule)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderRule1, orderRule2] = orderRule;\n const isAsc1 = mode1 === 'asc';\n const isAsc2 = mode2 === 'asc';\n\n return collection.sort((a, b) => {\n return compareValues(a, b, orderRule1, isAsc1) || compareValues(a, b, orderRule2, isAsc2);\n });\n }\n\n const isAsc = mode === 'asc';\n return collection.sort((a, b) => {\n return compareValues(a, b, orderRule, isAsc);\n });\n}\n\nexport function flatten(array: any[]) {\n return array.reduce((result, member) => {\n if (Array.isArray(member)) {\n return result.concat(member);\n } else {\n result.push(member);\n return result;\n }\n }, []);\n}\n\nexport function unique(array: T[]): T[] {\n return Array.from(new Set(array));\n}\n\nexport function compact(array: T[]) {\n return array.filter(Boolean);\n}\n\nexport function areSortedArraysEqual(array1: any[], array2: any[]) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((item, i) => item === array2[i]);\n}\n\nexport function areSortedArraysIntersecting(array1: any[], array2: any[]) {\n return array1[0] <= array2[array2.length - 1] && array1[array1.length - 1] >= array2[0];\n}\n\nexport function findIntersectionWithSet(array: T[], set: Set): T[] {\n return array.filter((a) => set.has(a));\n}\n\nexport function split(array: any[], chunkSize: number) {\n const result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n\n return result;\n}\n\nexport function cloneDeep(value: T): T {\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(cloneDeep) as typeof value;\n }\n\n return Object.keys(value).reduce((acc, key) => {\n acc[key as keyof T] = cloneDeep(value[key as keyof T]);\n return acc;\n }, {} as T);\n}\n\nexport function findLast(array: Array, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {\n let cursor = array.length;\n\n while (cursor--) {\n if (predicate(array[cursor], cursor, array)) {\n return array[cursor];\n }\n }\n\n return undefined;\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ApiLangPack, ApiLangString } from '../api/types';\nimport { LangCode, TimeFormat } from '../types';\n\nimport {\n DEFAULT_LANG_CODE, DEFAULT_LANG_PACK, LANG_CACHE_NAME, LANG_PACKS,\n} from '../config';\nimport * as cacheApi from './cacheApi';\nimport { callApi } from '../api/gramjs';\nimport { createCallbackManager } from './callbacks';\nimport { formatInteger } from './textFormat';\n\ninterface LangFn {\n (key: string, value?: any, format?: 'i'): any;\n\n isRtl?: boolean;\n code?: LangCode;\n timeFormat?: TimeFormat;\n}\n\nconst SUBSTITUTION_REGEX = /%\\d?\\$?[sdf@]/g;\nconst PLURAL_OPTIONS = ['value', 'zeroValue', 'oneValue', 'twoValue', 'fewValue', 'manyValue', 'otherValue'] as const;\nconst PLURAL_RULES = {\n /* eslint-disable max-len */\n en: (n: number) => (n !== 1 ? 6 : 2),\n ar: (n: number) => (n === 0 ? 1 : n === 1 ? 2 : n === 2 ? 3 : n % 100 >= 3 && n % 100 <= 10 ? 4 : n % 100 >= 11 ? 5 : 6),\n ca: (n: number) => (n !== 1 ? 6 : 2),\n de: (n: number) => (n !== 1 ? 6 : 2),\n es: (n: number) => (n !== 1 ? 6 : 2),\n fa: (n: number) => (n > 1 ? 6 : 2),\n fr: (n: number) => (n > 1 ? 6 : 2),\n id: () => 0,\n it: (n: number) => (n !== 1 ? 6 : 2),\n ko: () => 0,\n ms: () => 0,\n nl: (n: number) => (n !== 1 ? 6 : 2),\n pl: (n: number) => (n === 1 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n pt_BR: (n: number) => (n > 1 ? 6 : 2),\n ru: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n tr: (n: number) => (n > 1 ? 6 : 2),\n uk: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n uz: (n: number) => (n > 1 ? 6 : 2),\n /* eslint-enable max-len */\n};\n\nconst cache = new Map();\n\nlet langPack: ApiLangPack | undefined;\nlet fallbackLangPack: ApiLangPack | undefined;\n\nconst {\n addCallback,\n removeCallback,\n runCallbacks,\n} = createCallbackManager();\n\nexport { addCallback, removeCallback };\n\nlet currentLangCode: string | undefined;\nlet currentTimeFormat: TimeFormat | undefined;\n\nexport const getTranslation: LangFn = (key: string, value?: any, format?: 'i') => {\n if (value !== undefined) {\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n const cached = cache.get(`${key}_${cacheValue}_${format}`);\n if (cached) {\n return cached;\n }\n }\n\n if (!langPack && !fallbackLangPack) {\n return key;\n }\n\n const langString = (langPack?.[key]) || (fallbackLangPack?.[key]);\n if (!langString) {\n if (!fallbackLangPack) {\n void importFallbackLangPack();\n }\n\n return key;\n }\n\n return processTranslation(langString, key, value, format);\n};\n\nexport async function getTranslationForLangString(langCode: string, key: string) {\n let translateString: ApiLangString | undefined = await cacheApi.fetch(\n LANG_CACHE_NAME,\n `${DEFAULT_LANG_PACK}_${langCode}_${key}`,\n cacheApi.Type.Json,\n );\n\n if (!translateString) {\n translateString = await fetchRemoteString(DEFAULT_LANG_PACK, langCode, key);\n }\n\n return processTranslation(translateString, key);\n}\n\nexport async function setLanguage(langCode: LangCode, callback?: NoneToVoidFunction, withFallback = false) {\n if (langPack && langCode === currentLangCode) {\n if (callback) {\n callback();\n }\n\n return;\n }\n\n let newLangPack = await cacheApi.fetch(LANG_CACHE_NAME, langCode, cacheApi.Type.Json);\n if (!newLangPack) {\n if (withFallback) {\n await importFallbackLangPack();\n }\n\n newLangPack = await fetchRemote(langCode);\n if (!newLangPack) {\n return;\n }\n }\n\n cache.clear();\n\n currentLangCode = langCode;\n langPack = newLangPack;\n document.documentElement.lang = langCode;\n\n const { languages, timeFormat } = getGlobal().settings.byKey;\n const langInfo = languages?.find((l) => l.langCode === langCode);\n getTranslation.isRtl = Boolean(langInfo?.rtl);\n getTranslation.code = langCode;\n getTranslation.timeFormat = timeFormat;\n\n if (callback) {\n callback();\n }\n\n runCallbacks();\n}\n\nexport function setTimeFormat(timeFormat: TimeFormat) {\n if (timeFormat && timeFormat === currentTimeFormat) {\n return;\n }\n\n currentTimeFormat = timeFormat;\n getTranslation.timeFormat = timeFormat;\n\n runCallbacks();\n}\n\nasync function importFallbackLangPack() {\n if (fallbackLangPack) {\n return;\n }\n\n fallbackLangPack = (await import('./fallbackLangPack')).default;\n runCallbacks();\n}\n\nasync function fetchRemote(langCode: string): Promise {\n const remote = await callApi('fetchLangPack', { sourceLangPacks: LANG_PACKS, langCode });\n if (remote) {\n await cacheApi.save(LANG_CACHE_NAME, langCode, remote.langPack);\n return remote.langPack;\n }\n\n return undefined;\n}\n\nasync function fetchRemoteString(\n remoteLangPack: typeof LANG_PACKS[number], langCode: string, key: string,\n): Promise {\n const remote = await callApi('fetchLangStrings', {\n langPack: remoteLangPack,\n langCode,\n keys: [key],\n });\n\n if (remote?.length) {\n await cacheApi.save(LANG_CACHE_NAME, `${remoteLangPack}_${langCode}_${key}`, remote[0]);\n\n return remote[0];\n }\n\n return undefined;\n}\n\nfunction getPluralOption(amount: number) {\n const langCode = currentLangCode || DEFAULT_LANG_CODE;\n const optionIndex = PLURAL_RULES[langCode as keyof typeof PLURAL_RULES]\n ? PLURAL_RULES[langCode as keyof typeof PLURAL_RULES](amount)\n : 0;\n\n return PLURAL_OPTIONS[optionIndex];\n}\n\nfunction processTemplate(template: string, value: any) {\n value = Array.isArray(value) ? value : [value];\n const translationSlices = template.split(SUBSTITUTION_REGEX);\n const initialValue = translationSlices.shift();\n\n return translationSlices.reduce((result, str, index) => {\n return `${result}${String(value[index] || '')}${str}`;\n }, initialValue || '');\n}\n\nfunction processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {\n const template = langString ? langString[typeof value === 'number' ? getPluralOption(value) : 'value'] : undefined;\n if (!template || !template.trim()) {\n const parts = key.split('.');\n\n return parts[parts.length - 1];\n }\n\n if (value !== undefined) {\n const formattedValue = format === 'i' ? formatInteger(value) : value;\n const result = processTemplate(template, formattedValue);\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n cache.set(`${key}_${cacheValue}_${format}`, result);\n return result;\n }\n\n return template;\n}\n","const SAMPLE_RATE = 48000;\nconst BIT_DEPTH = 16;\n\nexport async function oggToWav(opusData: Blob): Promise {\n const arrayBuffer = await new Response(opusData).arrayBuffer();\n\n return new Promise((resolve) => {\n const typedArray = new Uint8Array(arrayBuffer);\n\n let decoderWorker: Worker | undefined = new Worker(\n new URL('opus-recorder/dist/decoderWorker.min.js', import.meta.url),\n );\n let wavWorker: Worker | undefined = new Worker(new URL('opus-recorder/dist/waveWorker.min.js', import.meta.url));\n\n decoderWorker.onmessage = (e) => {\n // eslint-disable-next-line no-null/no-null\n if (e.data === null) {\n // `null` means decoder is finished\n wavWorker!.postMessage({ command: 'done' });\n } else {\n // `e.data` contains decoded buffers as float32 values\n wavWorker!.postMessage(\n {\n command: 'encode',\n buffers: e.data,\n },\n e.data.map(({ buffer }: Float32Array) => buffer),\n );\n }\n };\n\n wavWorker.onmessage = (e) => {\n if (e.data.message === 'page') {\n resolve(new Blob([e.data.page], { type: 'audio/wav' }));\n\n decoderWorker!.terminate();\n decoderWorker = undefined;\n wavWorker!.terminate();\n wavWorker = undefined;\n }\n };\n\n wavWorker.postMessage({\n command: 'init',\n wavBitDepth: BIT_DEPTH,\n wavSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'init',\n decoderSampleRate: SAMPLE_RATE,\n outputBufferSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'decode',\n pages: typedArray,\n }, [typedArray.buffer]);\n });\n}\n","import {\n ApiMediaFormat,\n ApiOnProgress,\n ApiParsedMedia,\n ApiPreparedMedia,\n} from '../api/types';\n\nimport {\n DEBUG, MEDIA_CACHE_DISABLED, MEDIA_CACHE_NAME, MEDIA_CACHE_NAME_AVATARS,\n} from '../config';\nimport { callApi, cancelApiProgress } from '../api/gramjs';\nimport * as cacheApi from './cacheApi';\nimport { fetchBlob } from './files';\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, isWebpSupported } from './environment';\nimport { oggToWav } from './oggToWav';\nimport { webpToPng } from './webpToPng';\n\nconst asCacheApiType = {\n [ApiMediaFormat.BlobUrl]: cacheApi.Type.Blob,\n [ApiMediaFormat.Lottie]: cacheApi.Type.Blob,\n [ApiMediaFormat.Progressive]: undefined,\n [ApiMediaFormat.Stream]: undefined,\n};\n\nconst PROGRESSIVE_URL_PREFIX = './progressive/';\n\nconst memoryCache = new Map();\nconst fetchPromises = new Map>();\nconst progressCallbacks = new Map>();\nconst cancellableCallbacks = new Map();\n\nexport function fetch(\n url: string,\n mediaFormat: T,\n isHtmlAllowed = false,\n onProgress?: ApiOnProgress,\n callbackUniqueId?: string,\n): Promise {\n if (mediaFormat === ApiMediaFormat.Progressive) {\n return (\n IS_PROGRESSIVE_SUPPORTED\n ? getProgressive(url)\n : fetch(url, ApiMediaFormat.BlobUrl, isHtmlAllowed, onProgress, callbackUniqueId)\n ) as Promise;\n }\n\n if (!fetchPromises.has(url)) {\n const promise = fetchFromCacheOrRemote(url, mediaFormat, isHtmlAllowed)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n return undefined;\n })\n .finally(() => {\n fetchPromises.delete(url);\n progressCallbacks.delete(url);\n cancellableCallbacks.delete(url);\n });\n\n fetchPromises.set(url, promise);\n }\n\n if (onProgress && callbackUniqueId) {\n let activeCallbacks = progressCallbacks.get(url);\n if (!activeCallbacks) {\n activeCallbacks = new Map();\n progressCallbacks.set(url, activeCallbacks);\n }\n activeCallbacks.set(callbackUniqueId, onProgress);\n }\n\n return fetchPromises.get(url) as Promise;\n}\n\nexport function getFromMemory(url: string) {\n return memoryCache.get(url) as ApiPreparedMedia;\n}\n\nexport function cancelProgress(progressCallback: ApiOnProgress) {\n progressCallbacks.forEach((map, url) => {\n map.forEach((callback) => {\n if (callback === progressCallback) {\n const parentCallback = cancellableCallbacks.get(url);\n if (!parentCallback) return;\n\n cancelApiProgress(parentCallback);\n cancellableCallbacks.delete(url);\n progressCallbacks.delete(url);\n }\n });\n });\n}\n\nexport function removeCallback(url: string, callbackUniqueId: string) {\n const callbacks = progressCallbacks.get(url);\n if (!callbacks) return;\n callbacks.delete(callbackUniqueId);\n}\n\nfunction getProgressive(url: string) {\n const progressiveUrl = `${PROGRESSIVE_URL_PREFIX}${url}`;\n\n memoryCache.set(url, progressiveUrl);\n\n return Promise.resolve(progressiveUrl);\n}\n\nasync function fetchFromCacheOrRemote(\n url: string, mediaFormat: ApiMediaFormat, isHtmlAllowed: boolean,\n) {\n if (!MEDIA_CACHE_DISABLED) {\n const cacheName = url.startsWith('avatar') ? MEDIA_CACHE_NAME_AVATARS : MEDIA_CACHE_NAME;\n const cached = await cacheApi.fetch(cacheName, url, asCacheApiType[mediaFormat]!, isHtmlAllowed);\n\n if (cached) {\n let media = cached;\n\n if (cached.type === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n media = await oggToWav(media);\n }\n\n if (cached.type === 'image/webp' && !isWebpSupported() && media) {\n const mediaPng = await webpToPng(url, media);\n if (mediaPng) {\n media = mediaPng;\n }\n }\n\n const prepared = prepareMedia(media);\n\n memoryCache.set(url, prepared);\n\n return prepared;\n }\n }\n\n if (mediaFormat === ApiMediaFormat.Stream) {\n const mediaSource = new MediaSource();\n const streamUrl = URL.createObjectURL(mediaSource);\n let isOpen = false;\n\n mediaSource.addEventListener('sourceopen', () => {\n if (isOpen) {\n return;\n }\n isOpen = true;\n\n const sourceBuffer = mediaSource.addSourceBuffer('audio/mpeg');\n\n const onProgress = makeOnProgress(url, mediaSource, sourceBuffer);\n cancellableCallbacks.set(url, onProgress);\n\n void callApi('downloadMedia', { url, mediaFormat }, onProgress);\n });\n\n memoryCache.set(url, streamUrl);\n return streamUrl;\n }\n\n const onProgress = makeOnProgress(url);\n cancellableCallbacks.set(url, onProgress);\n\n const remote = await callApi('downloadMedia', { url, mediaFormat, isHtmlAllowed }, onProgress);\n if (!remote) {\n throw new Error(`Failed to fetch media ${url}`);\n }\n\n let { prepared, mimeType } = remote;\n\n if (mimeType === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await oggToWav(blob);\n prepared = prepareMedia(media);\n mimeType = media.type;\n }\n\n if (mimeType === 'image/webp' && !isWebpSupported()) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await webpToPng(url, blob);\n if (media) {\n prepared = prepareMedia(media);\n }\n }\n\n memoryCache.set(url, prepared);\n\n return prepared;\n}\n\nfunction makeOnProgress(url: string, mediaSource?: MediaSource, sourceBuffer?: SourceBuffer) {\n const onProgress: ApiOnProgress = (progress: number, arrayBuffer: ArrayBuffer) => {\n progressCallbacks.get(url)?.forEach((callback) => {\n callback(progress);\n if (callback.isCanceled) onProgress.isCanceled = true;\n });\n\n if (progress === 1) {\n mediaSource?.endOfStream();\n }\n\n if (!arrayBuffer) {\n return;\n }\n\n sourceBuffer?.appendBuffer(arrayBuffer);\n };\n\n return onProgress;\n}\n\nfunction prepareMedia(mediaData: Exclude): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n return URL.createObjectURL(mediaData);\n }\n\n return mediaData;\n}\n\nif (IS_PROGRESSIVE_SUPPORTED) {\n navigator.serviceWorker.addEventListener('message', async (e) => {\n const { type, messageId, params } = e.data as {\n type: string;\n messageId: string;\n params: { url: string; start: number; end: number };\n };\n\n if (type !== 'requestPart') {\n return;\n }\n\n const result = await callApi('downloadMedia', { mediaFormat: ApiMediaFormat.Progressive, ...params });\n if (!result) {\n return;\n }\n\n const { arrayBuffer, mimeType, fullSize } = result;\n\n navigator.serviceWorker.controller!.postMessage({\n type: 'partResponse',\n messageId,\n result: {\n arrayBuffer,\n mimeType,\n fullSize,\n },\n }, [arrayBuffer!]);\n });\n}\n","export const MEMO_EMPTY_ARRAY = [];\n","import { DEBUG } from '../config';\nimport { createCallbackManager } from './callbacks';\n\nexport enum Bundles {\n Auth,\n Main,\n Extra,\n Calls,\n}\n\ninterface ImportedBundles {\n [Bundles.Auth]: typeof import('../bundles/auth');\n [Bundles.Main]: typeof import('../bundles/main');\n [Bundles.Extra]: typeof import('../bundles/extra');\n [Bundles.Calls]: typeof import('../bundles/calls');\n}\n\ntype BundlePromises = {\n [K in keyof ImportedBundles]: Promise\n};\n\nexport type BundleModules = keyof ImportedBundles[B];\n\nconst LOAD_PROMISES: Partial = {};\nconst MEMORY_CACHE: Partial = {};\n\nconst { addCallback, runCallbacks } = createCallbackManager();\n\nexport async function loadModule>(bundleName: B, moduleName: M) {\n if (!LOAD_PROMISES[bundleName]) {\n switch (bundleName) {\n case Bundles.Auth:\n LOAD_PROMISES[Bundles.Auth] = import('../bundles/auth');\n break;\n case Bundles.Main:\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD MAIN BUNDLE');\n }\n\n LOAD_PROMISES[Bundles.Main] = import('../bundles/main');\n break;\n case Bundles.Extra:\n LOAD_PROMISES[Bundles.Extra] = import('../bundles/extra');\n break;\n case Bundles.Calls:\n LOAD_PROMISES[Bundles.Calls] = import('../bundles/calls');\n break;\n }\n\n (LOAD_PROMISES[bundleName] as Promise).then(runCallbacks);\n }\n\n const bundle = (await LOAD_PROMISES[bundleName]) as unknown as ImportedBundles[B];\n\n if (!MEMORY_CACHE[bundleName]) {\n MEMORY_CACHE[bundleName] = bundle;\n }\n\n return getModuleFromMemory(bundleName, moduleName);\n}\n\nexport function getModuleFromMemory>(bundleName: B, moduleName: M) {\n const bundle = MEMORY_CACHE[bundleName] as ImportedBundles[B];\n\n if (!bundle) {\n return undefined;\n }\n\n return bundle[moduleName];\n}\n\nexport const addLoadListener = addCallback;\n","import { callApi } from '../api/gramjs';\nimport { ApiChat, ApiMediaFormat, ApiMessage, ApiUser, ApiUserReaction } from '../api/types';\nimport { renderActionMessageText } from '../components/common/helpers/renderActionMessageText';\nimport { DEBUG, IS_TEST } from '../config';\nimport { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getMessageAction,\n getMessageRecentReaction,\n getMessageSenderName,\n getMessageSummaryText,\n getPrivateChatUserId,\n isActionMessage,\n isChatChannel,\n selectIsChatMuted,\n selectShouldShowMessagePreview,\n} from '../modules/helpers';\nimport { addNotifyExceptions, replaceSettings } from '../modules/reducers';\nimport {\n selectChatMessage,\n selectCurrentMessageList,\n selectNotifyExceptions,\n selectNotifySettings,\n selectUser,\n} from '../modules/selectors';\nimport { IS_SERVICE_WORKER_SUPPORTED, IS_TOUCH_ENV } from './environment';\nimport { getTranslation } from './langProvider';\nimport * as mediaLoader from './mediaLoader';\nimport { debounce } from './schedulers';\n\nfunction getDeviceToken(subscription: PushSubscription) {\n const data = subscription.toJSON();\n return JSON.stringify({\n endpoint: data.endpoint,\n keys: data.keys,\n });\n}\n\nfunction checkIfPushSupported() {\n if (!IS_SERVICE_WORKER_SUPPORTED) return false;\n if (!('showNotification' in ServiceWorkerRegistration.prototype)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push notifications aren\\'t supported.');\n }\n return false;\n }\n\n // Check the current Notification permission.\n // If its denied, it's a permanent block until the\n // user changes the permission\n if (Notification.permission === 'denied') {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n\n // Check if push messaging is supported\n if (!('PushManager' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push messaging isn\\'t supported.');\n }\n return false;\n }\n return true;\n}\n\nfunction checkIfNotificationsSupported() {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] This browser does not support desktop notification');\n }\n return false;\n }\n\n if (Notification.permission === 'denied' as NotificationPermission) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n return true;\n}\n\nconst expirationTime = 12 * 60 * 60 * 1000; // 12 hours\n// Notification id is removed from soundPlayed cache after 3 seconds\nconst soundPlayedDelay = 3 * 1000;\nconst soundPlayedIds = new Set();\n\nexport async function playNotifySound(id?: string, volume?: number) {\n if (id !== undefined && soundPlayedIds.has(id)) return;\n const { notificationSoundVolume } = selectNotifySettings(getGlobal());\n const currentVolume = volume ? volume / 10 : notificationSoundVolume / 10;\n if (currentVolume === 0) return;\n\n const audio = new Audio('./notification.mp3');\n audio.volume = currentVolume;\n audio.setAttribute('mozaudiochannel', 'notification');\n if (id !== undefined) {\n audio.addEventListener('ended', () => {\n soundPlayedIds.add(id);\n }, { once: true });\n\n setTimeout(() => {\n soundPlayedIds.delete(id);\n }, soundPlayedDelay);\n }\n\n try {\n await audio.play();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Unable to play notification sound');\n }\n }\n}\n\nexport const playNotifySoundDebounced = debounce(playNotifySound, 1000, true, false);\n\nfunction checkIfShouldResubscribe(subscription: PushSubscription | null) {\n const global = getGlobal();\n if (!global.push || !subscription) return true;\n if (getDeviceToken(subscription) !== global.push.deviceToken) return true;\n return Date.now() - global.push.subscribedAt > expirationTime;\n}\n\nasync function requestPermission() {\n if (!('Notification' in window)) return;\n if (!['granted', 'denied'].includes(Notification.permission)) {\n await Notification.requestPermission();\n }\n}\n\nasync function unsubscribeFromPush(subscription: PushSubscription | null) {\n const global = getGlobal();\n const dispatch = getDispatch();\n if (subscription) {\n try {\n const deviceToken = getDeviceToken(subscription);\n await callApi('unregisterDevice', deviceToken);\n await subscription.unsubscribe();\n dispatch.deleteDeviceToken();\n return;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to unsubscribe from push.', error);\n }\n }\n }\n if (global.push) {\n await callApi('unregisterDevice', global.push.deviceToken);\n dispatch.deleteDeviceToken();\n }\n}\n\nexport async function unsubscribe() {\n if (!checkIfPushSupported()) return;\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n const subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n await unsubscribeFromPush(subscription);\n}\n\n// Indicates if notification settings are loaded from the api\nlet areSettingsLoaded = false;\n\n// Load notification settings from the api\nasync function loadNotificationSettings() {\n if (areSettingsLoaded) return selectNotifySettings(getGlobal());\n const [resultSettings, resultExceptions] = await Promise.all([\n callApi('fetchNotificationSettings', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n callApi('fetchNotificationExceptions', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n ]);\n if (!resultSettings) return selectNotifySettings(getGlobal());\n\n let global = replaceSettings(getGlobal(), resultSettings);\n if (resultExceptions) {\n global = addNotifyExceptions(global, resultExceptions);\n }\n setGlobal(global);\n areSettingsLoaded = true;\n return selectNotifySettings(global);\n}\n\nexport async function subscribe() {\n if (!checkIfPushSupported()) {\n // Ask for notification permissions only if service worker notifications are not supported\n // As pushManager.subscribe automatically triggers permission popup\n await requestPermission();\n return;\n }\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n let subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n if (!checkIfShouldResubscribe(subscription)) return;\n await unsubscribeFromPush(subscription);\n try {\n subscription = await serviceWorkerRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n });\n const deviceToken = getDeviceToken(subscription);\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Received push subscription: ', deviceToken);\n }\n await callApi('registerDevice', deviceToken);\n getDispatch()\n .setDeviceToken(deviceToken);\n } catch (error: any) {\n if (Notification.permission === 'denied' as NotificationPermission) {\n // The user denied the notification permission which\n // means we failed to subscribe and the user will need\n // to manually change the notification permission to\n // subscribe to push messages\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n } else if (DEBUG) {\n // A problem occurred with the subscription, this can\n // often be down to an issue or lack of the gcm_sender_id\n // and / or gcm_user_visible_only\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to subscribe to push.', error);\n\n // Request permissions and fall back to local notifications\n // if pushManager.subscribe was aborted due to invalid VAPID key.\n if (error.code === DOMException.ABORT_ERR) {\n await requestPermission();\n }\n }\n }\n}\n\nfunction checkIfShouldNotify(chat: ApiChat) {\n if (!areSettingsLoaded) return false;\n const global = getGlobal();\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n if (isMuted || chat.isNotJoined || !chat.isListed) {\n return false;\n }\n // On touch devices show notifications when chat is not active\n if (IS_TOUCH_ENV) {\n const {\n chatId,\n type,\n } = selectCurrentMessageList(global) || {};\n return !(chatId === chat.id && type === 'thread');\n }\n // On desktop show notifications when window is not focused\n return !document.hasFocus();\n}\n\nfunction getNotificationContent(chat: ApiChat, message: ApiMessage, reaction?: ApiUserReaction) {\n const global = getGlobal();\n let {\n senderId,\n replyToMessageId,\n } = message;\n if (reaction) senderId = reaction.userId;\n\n const messageSender = senderId ? selectUser(global, senderId) : undefined;\n const messageAction = getMessageAction(message as ApiMessage);\n const actionTargetMessage = messageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const {\n targetUserIds: actionTargetUserIds,\n targetChatId: actionTargetChatId,\n } = messageAction || {};\n\n const actionTargetUsers = actionTargetUserIds\n ? actionTargetUserIds.map((userId) => selectUser(global, userId))\n .filter(Boolean as any)\n : undefined;\n const privateChatUserId = getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n\n let body: string;\n if (selectShouldShowMessagePreview(chat, selectNotifySettings(global), selectNotifyExceptions(global))) {\n if (isActionMessage(message)) {\n const isChat = chat && (isChatChannel(chat) || message.senderId === message.chatId);\n\n body = renderActionMessageText(\n getTranslation,\n message,\n !isChat ? messageSender : undefined,\n isChat ? chat : undefined,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlainText: true },\n ) as string;\n } else {\n const senderName = getMessageSenderName(getTranslation, chat.id, messageSender);\n const summary = getMessageSummaryText(getTranslation, message, false, 60, false);\n\n body = senderName ? `${senderName}: ${summary}` : summary;\n }\n } else {\n body = 'New message';\n }\n\n return {\n title: getChatTitle(getTranslation, chat, privateChatUser),\n body,\n };\n}\n\nasync function getAvatar(chat: ApiChat) {\n const imageHash = getChatAvatarHash(chat);\n if (!imageHash) return undefined;\n let mediaData = mediaLoader.getFromMemory(imageHash);\n if (!mediaData) {\n await mediaLoader.fetch(imageHash, ApiMediaFormat.BlobUrl);\n mediaData = mediaLoader.getFromMemory(imageHash);\n }\n return mediaData;\n}\n\nexport async function notifyAboutMessage({\n chat,\n message,\n}: { chat: ApiChat; message: Partial }) {\n const { hasWebNotifications } = await loadNotificationSettings();\n if (!checkIfShouldNotify(chat)) return;\n const areNotificationsSupported = checkIfNotificationsSupported();\n if (!hasWebNotifications || !areNotificationsSupported) {\n // only play sound if web notifications are disabled\n playNotifySoundDebounced(String(message.id) || chat.id);\n return;\n }\n if (!areNotificationsSupported) return;\n\n if (!message.id) return;\n\n const activeReaction = getMessageRecentReaction(message);\n const icon = await getAvatar(chat);\n\n const {\n title,\n body,\n } = getNotificationContent(chat, message as ApiMessage, activeReaction);\n\n if (checkIfPushSupported()) {\n if (navigator.serviceWorker?.controller) {\n // notify service worker about new message notification\n navigator.serviceWorker.controller.postMessage({\n type: 'showMessageNotification',\n payload: {\n title,\n body,\n icon,\n chatId: chat.id,\n messageId: message.id,\n reaction: activeReaction ? activeReaction.reaction : undefined,\n },\n });\n }\n } else {\n const dispatch = getDispatch();\n const options: NotificationOptions = {\n body,\n icon,\n badge: icon,\n tag: String(message.id),\n };\n\n if ('vibrate' in navigator) {\n options.vibrate = [200, 100, 200];\n }\n\n const notification = new Notification(title, options);\n\n notification.onclick = () => {\n notification.close();\n dispatch.focusMessage({\n chatId: chat.id,\n messageId: message.id,\n });\n if (activeReaction) {\n dispatch.startActiveReaction({\n messageId: message.id,\n reaction: activeReaction.reaction,\n });\n }\n if (window.focus) {\n window.focus();\n }\n };\n\n // Play sound when notification is displayed\n notification.onshow = () => {\n playNotifySoundDebounced(String(message.id) || chat.id);\n };\n }\n}\n\nexport function closeMessageNotifications(payload: { chatId: string; lastReadInboxMessageId?: number }) {\n if (IS_TEST || !navigator.serviceWorker?.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'closeMessageNotifications',\n payload,\n });\n}\n\n// Notify service worker that client is fully loaded\nexport function notifyClientReady() {\n if (!navigator.serviceWorker?.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'clientReady',\n });\n}\n","const PERMANENT_VERSION_KEY = 'kz_version';\nconst AVAILABLE_VERSIONS = ['Z', 'K'] as const;\nconst DEFAULT_VERSION = 'Z';\n\nexport function setPermanentWebVersion(version: typeof AVAILABLE_VERSIONS[number]) {\n localStorage.setItem(PERMANENT_VERSION_KEY, JSON.stringify(version));\n}\n\nexport function ensurePermanentWebVersion() {\n if (!hasPermanentWebVersion()) {\n setPermanentWebVersion(DEFAULT_VERSION);\n }\n}\n\nfunction hasPermanentWebVersion() {\n const json = localStorage.getItem(PERMANENT_VERSION_KEY);\n if (!json) {\n return false;\n }\n\n try {\n const version = JSON.parse(json);\n return AVAILABLE_VERSIONS.includes(version);\n } catch (err) {\n return false;\n }\n}\n","import { ApiCountryCode } from '../api/types';\nimport { flatten } from './iteratees';\n\nconst PATTERN_PLACEHOLDER = 'X';\nconst DEFAULT_PATTERN = 'XXX XXX XXX XXX';\n\nexport function getCountryCodesByIso(phoneCodeList: ApiCountryCode[], iso: string) {\n return phoneCodeList.filter((country) => country.iso2 === iso);\n}\n\nexport function getCountryFromPhoneNumber(phoneCodeList: ApiCountryCode[], input = '') {\n let phoneNumber = input.replace(/[^\\d+]+/g, '');\n if (phoneNumber.startsWith('+')) {\n phoneNumber = phoneNumber.substr(1);\n }\n\n const possibleCountries = phoneCodeList\n .filter((country) => phoneNumber.startsWith(country.countryCode));\n const codesWithPrefix: { code: string; country: ApiCountryCode }[] = flatten(possibleCountries\n .map((country) => (country.prefixes || ['']).map((prefix) => {\n return {\n code: `${country.countryCode}${prefix}`,\n country,\n };\n })));\n\n const bestMatches = codesWithPrefix\n .filter(({ code }) => phoneNumber.startsWith(code))\n .sort((a, b) => a.code.length - b.code.length);\n\n return bestMatches[bestMatches.length - 1]?.country;\n}\n\nexport function formatPhoneNumber(input: string, country?: ApiCountryCode) {\n let phoneNumber = input.replace(/[^\\d]+/g, '');\n if (country) {\n phoneNumber = phoneNumber.substr(country.countryCode.length);\n } else if (input.startsWith('+')) {\n return input;\n }\n const pattern = getBestPattern(phoneNumber, country?.patterns);\n\n const result: string[] = []; // Result character array\n let j = 0; // Position inside pattern\n for (let i = 0; i < phoneNumber.length; i++) {\n while (pattern[j] !== PATTERN_PLACEHOLDER && j < pattern.length) {\n result.push(pattern[j]);\n if (pattern[j] === phoneNumber[i]) { // If pattern contains digits, move input position too\n i++;\n if (i === phoneNumber.length) break; // But don't overdo it, or it will insert full pattern unexpectedly\n }\n j++;\n }\n\n result.push(phoneNumber[i]); // For placeholder characters, setting current input digit\n j++;\n }\n\n return result.join('');\n}\n\nfunction getBestPattern(numberWithoutCode: string, patterns?: string[]) {\n if (!patterns || patterns.length === 0) return DEFAULT_PATTERN;\n if (patterns.length === 1) return patterns[0];\n\n const defaultPattern = patterns.find((pattern) => pattern.startsWith(PATTERN_PLACEHOLDER)) || DEFAULT_PATTERN;\n\n const bestMatches = patterns.filter((pattern) => {\n const stripped = pattern.replace(/[^\\dX]+/g, '');\n if (stripped.startsWith(PATTERN_PLACEHOLDER)) return false; // Don't consider default number format here\n for (let i = 0; i < numberWithoutCode.length; i++) {\n if (i > stripped.length - 1 || (stripped[i] !== PATTERN_PLACEHOLDER && stripped[i] !== numberWithoutCode[i])) {\n return false;\n }\n }\n return true;\n });\n\n // Playing it safe: if not sure, use default for that region\n return bestMatches.length === 1 ? bestMatches[0] : defaultPattern;\n}\n\nexport function formatPhoneNumberWithCode(phoneCodeList: ApiCountryCode[], phoneNumber: string) {\n const numberWithPlus = phoneNumber.startsWith('+') ? phoneNumber : `+${phoneNumber}`;\n const country = getCountryFromPhoneNumber(phoneCodeList, numberWithPlus);\n if (!country) {\n return numberWithPlus;\n }\n return `+${country.countryCode} ${formatPhoneNumber(numberWithPlus, country)}`;\n}\n","import { MessageList, MessageListType } from '../global/types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nimport { LOCATION_HASH } from '../hooks/useHistoryBack';\n\nexport function createMessageHash(messageList: MessageList) {\n const typeOrThreadId = messageList.type !== 'thread' ? (\n `_${messageList.type}`\n ) : messageList.threadId !== -1 ? (\n `_${messageList.threadId}`\n ) : '';\n\n return `${messageList.chatId}${typeOrThreadId}`;\n}\n\nexport function parseLocationHash() {\n if (!LOCATION_HASH) return undefined;\n\n const [chatId, typeOrThreadId] = LOCATION_HASH.replace(/^#/, '').split('_');\n if (!chatId?.match(/^-?\\d+$/)) return undefined;\n\n const isType = ['thread', 'pinned', 'scheduled'].includes(typeOrThreadId);\n\n return {\n chatId,\n type: Boolean(typeOrThreadId) && isType ? (typeOrThreadId as MessageListType) : 'thread',\n threadId: Boolean(typeOrThreadId) && !isType ? Number(typeOrThreadId) : MAIN_THREAD_ID,\n };\n}\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastRafPrimary, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n fn(...args);\n });\n }\n };\n}\n\nexport function onIdle(cb: NoneToVoidFunction, timeout?: number) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb, { timeout });\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastRafPrimary(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet onTickEndCallbacks: NoneToVoidFunction[] | undefined;\nlet onTickEndPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onTickEnd(callback: NoneToVoidFunction, isPrimary = false) {\n if (!onTickEndCallbacks) {\n onTickEndCallbacks = isPrimary ? [] : [callback];\n onTickEndPrimaryCallbacks = isPrimary ? [callback] : [];\n\n Promise.resolve().then(() => {\n const currentCallbacks = onTickEndCallbacks!;\n const currentPrimaryCallbacks = onTickEndPrimaryCallbacks!;\n onTickEndCallbacks = undefined;\n onTickEndPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n onTickEndPrimaryCallbacks!.push(callback);\n } else {\n onTickEndCallbacks.push(callback);\n }\n}\n\nexport function onTickEndPrimary(callback: NoneToVoidFunction) {\n onTickEnd(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","let RE_NOT_LETTER: RegExp;\n\ntry {\n RE_NOT_LETTER = new RegExp('[^\\\\p{L}\\\\p{M}]+', 'ui');\n} catch (e) {\n // Support for older versions of firefox\n RE_NOT_LETTER = new RegExp('[^\\\\wа-яё]+', 'i');\n}\n\nexport default function searchWords(haystack: string, needle: string | string[]) {\n if (!haystack || !needle) {\n return false;\n }\n\n const needleWords = typeof needle === 'string' ? needle.toLowerCase().split(RE_NOT_LETTER) : needle;\n const haystackLower = haystack.toLowerCase();\n\n // @optimization\n if (needleWords.length === 1 && !haystackLower.includes(needleWords[0])) {\n return false;\n }\n\n let haystackWords: string[];\n\n return needleWords.every((needleWord) => {\n if (!haystackLower.includes(needleWord)) {\n return false;\n }\n\n if (!haystackWords) {\n haystackWords = haystackLower.split(RE_NOT_LETTER);\n }\n\n return haystackWords.some((haystackWord) => haystackWord.startsWith(needleWord));\n });\n}\n\nexport function prepareSearchWordsForNeedle(needle: string) {\n const needleWords = needle.toLowerCase().split(RE_NOT_LETTER);\n\n return (haystack: string) => searchWords(haystack, needleWords);\n}\n","export const getServerTime = (serverTimeOffset: number) => {\n return Math.floor(Date.now() / 1000) + serverTimeOffset;\n};\n","import safariFix from 'safari-14-idb-fix';\n\nfunction promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const dbp = safariFix().then(() => {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n return promisifyRequest(request);\n });\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * Work around Safari 14 IndexedDB open bug.\n *\n * Safari has a horrible bug where IDB requests can hang while the browser is starting up. https://bugs.webkit.org/show_bug.cgi?id=226547\n * The only solution is to keep nudging it until it's awake.\n */\nfunction idbReady() {\n var isSafari = !navigator.userAgentData &&\n /Safari\\//.test(navigator.userAgent) &&\n !/Chrom(e|ium)\\//.test(navigator.userAgent);\n // No point putting other browsers or older versions of Safari through this mess.\n if (!isSafari || !indexedDB.databases)\n return Promise.resolve();\n var intervalId;\n return new Promise(function (resolve) {\n var tryIdb = function () { return indexedDB.databases().finally(resolve); };\n intervalId = setInterval(tryIdb, 100);\n tryIdb();\n }).finally(function () { return clearInterval(intervalId); });\n}\n\nexport default idbReady;\n","import * as idb from 'idb-keyval';\n\nimport { ApiSessionData } from '../api/types';\n\nimport { DEBUG, LEGACY_SESSION_KEY, SESSION_USER_KEY } from '../config';\nimport * as cacheApi from './cacheApi';\n\nconst DC_IDS = [1, 2, 3, 4, 5];\n\nexport function hasStoredSession(withLegacy = false) {\n if (withLegacy && localStorage.getItem(LEGACY_SESSION_KEY)) {\n return true;\n }\n\n const userAuthJson = localStorage.getItem(SESSION_USER_KEY);\n if (!userAuthJson) return false;\n\n try {\n const userAuth = JSON.parse(userAuthJson);\n return Boolean(userAuth && userAuth.id && userAuth.dcID);\n } catch (err) {\n // Do nothing.\n return false;\n }\n}\n\nexport function storeSession(sessionData: ApiSessionData, currentUserId?: string) {\n const { mainDcId, keys, hashes } = sessionData;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify({ dcID: mainDcId, id: currentUserId }));\n localStorage.setItem('dc', String(mainDcId));\n Object.keys(keys).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_auth_key`, JSON.stringify(keys[dcId]));\n });\n\n if (hashes) {\n Object.keys(hashes).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId]));\n });\n }\n}\n\nexport function clearStoredSession() {\n [\n SESSION_USER_KEY,\n 'dc',\n ...DC_IDS.map((dcId) => `dc${dcId}_auth_key`),\n ...DC_IDS.map((dcId) => `dc${dcId}_hash`),\n ].forEach((key) => {\n localStorage.removeItem(key);\n });\n}\n\nexport function loadStoredSession(): ApiSessionData | undefined {\n if (!hasStoredSession()) {\n return undefined;\n }\n\n const userAuth = JSON.parse(localStorage.getItem(SESSION_USER_KEY)!);\n const mainDcId = Number(userAuth.dcID);\n const keys: Record = {};\n const hashes: Record = {};\n\n DC_IDS.forEach((dcId) => {\n try {\n const key = localStorage.getItem(`dc${dcId}_auth_key`);\n if (key) {\n keys[dcId] = JSON.parse(key);\n }\n\n const hash = localStorage.getItem(`dc${dcId}_hash`);\n if (hash) {\n hashes[dcId] = JSON.parse(hash);\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load stored session', err);\n }\n // Do nothing.\n }\n });\n\n if (!Object.keys(keys).length) return undefined;\n\n return {\n mainDcId,\n keys,\n hashes,\n };\n}\n\nexport async function importLegacySession() {\n const sessionId = localStorage.getItem(LEGACY_SESSION_KEY);\n if (!sessionId) return;\n\n const sessionJson = await idb.get(`GramJs:${sessionId}`);\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData;\n storeSession(sessionData);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load legacy session', err);\n }\n // Do nothing.\n }\n}\n\n// Remove previously created IndexedDB and cache API sessions\nexport async function clearLegacySessions() {\n localStorage.removeItem(LEGACY_SESSION_KEY);\n\n const idbKeys = await idb.keys();\n\n await Promise.all>([\n cacheApi.clear('GramJs'),\n ...idbKeys\n .filter((k) => typeof k === 'string' && k.startsWith('GramJs:GramJs-session-'))\n .map((k) => idb.del(k)),\n ]);\n}\n\nexport function importTestSession() {\n const sessionJson = process.env.TEST_SESSION!;\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData & { userId: string };\n storeSession(sessionData, sessionData.userId);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load test session', err);\n }\n // Do nothing.\n }\n}\n","import { ISettings } from '../types';\n\nimport { animateSingle } from './animation';\nimport { fastRaf } from './schedulers';\n\nimport themeColors from '../styles/themes.json';\n\ntype RGBAColor = {\n r: number;\n g: number;\n b: number;\n a?: number;\n};\n\nlet isInitialized = false;\n\nconst HEX_COLOR_REGEX = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i;\nconst DURATION_MS = 200;\nconst ENABLE_ANIMATION_DELAY_MS = 500;\nconst RGB_VARIABLES = new Set([\n '--color-primary-shade',\n '--color-text-secondary',\n]);\n\nconst lerp = (start: number, end: number, interpolationRatio: number) => {\n return (1 - interpolationRatio) * start + interpolationRatio * end;\n};\n\nconst colors = (Object.keys(themeColors) as Array).map((property) => ({\n property,\n colors: [hexToRgb(themeColors[property][0]), hexToRgb(themeColors[property][1])],\n}));\n\nconst switchTheme = (theme: ISettings['theme'], withAnimation: boolean) => {\n const isDarkTheme = theme === 'dark';\n const shouldAnimate = isInitialized && withAnimation;\n const startIndex = isDarkTheme ? 0 : 1;\n const endIndex = isDarkTheme ? 1 : 0;\n const startAt = Date.now();\n const themeColorTag = document.querySelector('meta[name=\"theme-color\"]');\n\n document.documentElement.classList.remove(`theme-${isDarkTheme ? 'light' : 'dark'}`);\n if (isInitialized) {\n document.documentElement.classList.add('no-animations');\n }\n document.documentElement.classList.add(`theme-${theme}`);\n if (themeColorTag) {\n themeColorTag.setAttribute('content', isDarkTheme ? '#212121' : '#fff');\n }\n\n setTimeout(() => {\n document.documentElement.classList.remove('no-animations');\n }, ENABLE_ANIMATION_DELAY_MS);\n\n isInitialized = true;\n\n if (shouldAnimate) {\n fastRaf(() => {\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / DURATION_MS, 1);\n\n applyColorAnimationStep(startIndex, endIndex, transition(t));\n\n return t < 1;\n });\n });\n } else {\n applyColorAnimationStep(startIndex, endIndex);\n }\n};\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n\nfunction hexToRgb(hex: string): RGBAColor {\n const result = HEX_COLOR_REGEX.exec(hex)!;\n\n return {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n a: result[4] !== undefined ? parseInt(result[4], 16) : undefined,\n };\n}\n\nfunction applyColorAnimationStep(startIndex: number, endIndex: number, interpolationRatio: number = 1) {\n colors.forEach(({ property, colors: propertyColors }) => {\n const r = Math.round(lerp(propertyColors[startIndex].r, propertyColors[endIndex].r, interpolationRatio));\n const g = Math.round(lerp(propertyColors[startIndex].g, propertyColors[endIndex].g, interpolationRatio));\n const b = Math.round(lerp(propertyColors[startIndex].b, propertyColors[endIndex].b, interpolationRatio));\n const a = propertyColors[startIndex].a !== undefined\n ? Math.round(lerp(propertyColors[startIndex].a!, propertyColors[endIndex].a!, interpolationRatio))\n : undefined;\n\n document.documentElement.style.setProperty(property, a !== undefined\n ? `rgba(${r},${g},${b},${a / 255})`\n : `rgb(${r},${g},${b})`);\n\n if (RGB_VARIABLES.has(property)) {\n document.documentElement.style.setProperty(`${property}-rgb`, `${r},${g},${b}`);\n }\n });\n}\n\nexport default switchTheme;\n","import EMOJI_REGEX from '../lib/twemojiRegex';\nimport { fixNonStandardEmoji } from './emoji';\n\nexport function formatInteger(value: number) {\n return String(value).replace(/\\d(?=(\\d{3})+$)/g, '$& ');\n}\n\nfunction formatFixedNumber(number: number) {\n const fixed = String(number.toFixed(1));\n if (fixed.substr(-2) === '.0') {\n return Math.round(number);\n }\n\n return number.toFixed(1).replace('.', ',');\n}\n\nexport function formatIntegerCompact(views: number) {\n if (views < 1e3) {\n return views;\n }\n\n if (views < 1e6) {\n return `${formatFixedNumber(views / 1e3)}K`;\n }\n\n return `${formatFixedNumber(views / 1e6)}M`;\n}\n\nexport function getFirstLetters(phrase: string, count = 2) {\n return phrase\n .replace(/[.,!@#$%^&*()_+=\\-`~[\\]/\\\\{}:\"|<>?]+/gi, '')\n .trim()\n .split(/\\s+/)\n .slice(0, count)\n .map((word: string) => {\n if (!word.length) return '';\n word = fixNonStandardEmoji(word);\n const emojis = word.match(EMOJI_REGEX);\n if (emojis && word.startsWith(emojis[0])) {\n return emojis[0];\n }\n return word.match(/./u)![0].toUpperCase();\n })\n .join('');\n}\n","export default function trimText(text: T, length?: number) {\n if (!text || !length || text.length <= length) {\n return text;\n }\n\n return `${text.substring(0, length)}...`;\n}\n","import { isWebpSupported } from './environment';\nimport { dataUriToBlob, blobToDataUri } from './files';\nimport { pause } from './schedulers';\n\nconst WORKER_INITIALIZATION_TIMEOUT = 2000;\n\nlet canvas: HTMLCanvasElement;\nlet worker: IWebpWorker;\n\nexport const EMPTY_IMAGE_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk'\n + 'YAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n\nexport async function webpToPng(url: string, blob: Blob): Promise {\n initWebpWorker();\n\n while (!worker.wasmReady) {\n await pause(WORKER_INITIALIZATION_TIMEOUT);\n }\n\n const { result, width, height } = await getDecodePromise(url, blob);\n if (!width || !height) {\n return undefined;\n }\n\n return createPng({ result, width, height });\n}\n\nexport async function webpToPngBase64(key: string, dataUri: string): Promise {\n if (isWebpSupported() || dataUri.substr(0, 15) !== 'data:image/webp') {\n return dataUri;\n }\n\n initWebpWorker();\n\n const pngBlob = await webpToPng(key, dataUriToBlob(dataUri));\n\n if (!pngBlob) {\n throw new Error(`Can't convert webp to png. Url: ${dataUri}`);\n }\n\n return blobToDataUri(pngBlob);\n}\n\nfunction initWebpWorker() {\n if (!worker) {\n worker = new Worker(new URL('../lib/webp/webp_wasm.worker.js', import.meta.url)) as IWebpWorker;\n worker.wasmReady = false;\n worker.onmessage = handleLibWebpMessage;\n }\n}\n\nfunction createPng({ result, width, height }: TEncodedImage): Promise {\n if (!canvas) {\n canvas = document.createElement('canvas');\n }\n\n return new Promise((resolve) => {\n const img = new ImageData(result, width, height);\n\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d')!;\n ctx.putImageData(img, 0, 0);\n\n canvas.toBlob((blob) => {\n resolve(blob ?? undefined);\n }, 'image/png', 1);\n });\n}\n\nfunction handleLibWebpMessage(e: MessageEvent) {\n const { id } = e.data;\n switch (e.data.type) {\n case 'initialized': {\n worker.wasmReady = true;\n break;\n }\n\n case 'result': {\n if (worker.requests.has(id)) {\n const resolve = worker.requests.get(id)!;\n\n worker.requests.delete(id);\n resolve(e.data!);\n }\n break;\n }\n }\n}\n\nfunction getDecodePromise(url: string, blob: Blob): Promise {\n return new Promise((resolve) => {\n if (!worker.requests) {\n worker.requests = new Map();\n }\n\n worker.requests.set(url, resolve);\n worker.postMessage({ id: url, blob });\n });\n}\n","import { APP_VERSION, DEBUG } from '../config';\nimport { getGlobal } from '../lib/teact/teactn';\nimport { hasStoredSession } from './sessions';\n\nconst WEBSYNC_URLS = [\n 't.me',\n 'telegram.me',\n].map((domain) => `//${domain}/_websync_?`);\nconst WEBSYNC_VERSION = `${APP_VERSION} Z`;\nconst WEBSYNC_KEY = 'tgme_sync';\nconst WEBSYNC_TIMEOUT = 86400;\n\nconst getTs = () => {\n return Math.floor(Number(new Date()) / 1000);\n};\n\nconst saveSync = (authed: boolean) => {\n const ts = getTs();\n localStorage.setItem(WEBSYNC_KEY, JSON.stringify({\n canRedirect: authed,\n ts,\n }));\n};\n\nlet lastTimeout: NodeJS.Timeout | undefined;\n\nexport const forceWebsync = (authed: boolean) => {\n const currentTs = getTs();\n\n const { canRedirect, ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n if (canRedirect !== authed || ts + WEBSYNC_TIMEOUT <= currentTs) {\n return Promise.all(WEBSYNC_URLS.map((url) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n\n const removeElement = () => Boolean(document.body.removeChild(script));\n\n script.src = url + new URLSearchParams({\n authed: Number(authed).toString(),\n version: WEBSYNC_VERSION,\n });\n\n document.body.appendChild(script);\n\n script.onload = () => {\n saveSync(authed);\n removeElement();\n if (lastTimeout) {\n clearTimeout(lastTimeout);\n lastTimeout = undefined;\n }\n startWebsync();\n resolve();\n };\n\n script.onerror = () => {\n removeElement();\n reject();\n };\n });\n }));\n } else {\n return Promise.resolve();\n }\n};\n\nexport function startWebsync() {\n if (DEBUG) {\n return;\n }\n\n if (lastTimeout !== undefined) return;\n const currentTs = getTs();\n\n const { ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n const timeout = WEBSYNC_TIMEOUT - (currentTs - ts);\n\n lastTimeout = setTimeout(() => {\n const { authState } = getGlobal();\n\n const authed = authState === 'authorizationStateReady' || hasStoredSession(true);\n forceWebsync(authed);\n }, Math.max(0, timeout * 1000));\n}\n\nexport function clearWebsync() {\n localStorage.removeItem(WEBSYNC_KEY);\n}\n","import { throttle } from './schedulers';\nimport {\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT } from './environment';\n\ntype IDimensions = {\n width: number;\n height: number;\n};\n\nconst IS_LANDSCAPE = IS_SINGLE_COLUMN_LAYOUT && isLandscape();\n\nconst initialHeight = window.innerHeight;\nlet currentWindowSize = updateSizes();\nlet isRefreshDisabled = false;\n\nfunction disableRefresh() {\n isRefreshDisabled = true;\n}\n\nfunction enableRefresh() {\n isRefreshDisabled = false;\n}\n\nconst handleResize = throttle(() => {\n currentWindowSize = updateSizes();\n\n if (!isRefreshDisabled && (\n isMobileScreen() !== IS_SINGLE_COLUMN_LAYOUT\n || (IS_SINGLE_COLUMN_LAYOUT && IS_LANDSCAPE !== isLandscape())\n )) {\n window.location.reload();\n }\n}, 250, true);\n\nwindow.addEventListener('orientationchange', handleResize);\nif (IS_IOS) {\n window.visualViewport.addEventListener('resize', handleResize);\n} else {\n window.addEventListener('resize', handleResize);\n}\n\nexport function updateSizes(): IDimensions {\n let height: number;\n if (IS_IOS) {\n height = window.visualViewport.height + window.visualViewport.pageTop;\n } else {\n height = window.innerHeight;\n }\n const vh = height * 0.01;\n\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n}\n\nfunction isMobileScreen() {\n return currentWindowSize.width <= MOBILE_SCREEN_MAX_WIDTH || (\n currentWindowSize.width <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH\n && currentWindowSize.height <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n );\n}\n\nfunction isLandscape() {\n if (IS_IOS) {\n return window.matchMedia('(orientation: landscape)').matches;\n }\n\n // eslint-disable-next-line max-len\n // Source: https://web.archive.org/web/20160509220835/http://blog.abouthalf.com/development/orientation-media-query-challenges-in-android-browsers/\n // Feature is marked as deprecated now, but it is still supported\n // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-aspect-ratio#browser_compatibility\n return window.matchMedia('screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)').matches;\n}\n\nconst windowSize = {\n get: () => currentWindowSize,\n getIsKeyboardVisible: () => initialHeight > currentWindowSize.height,\n disableRefresh,\n enableRefresh,\n};\n\nexport default windowSize;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"47\":\"9ea2a6fe11cbf65b8511\",\"99\":\"4acb17d13e1a5b87b131\",\"133\":\"0e8e598a95d89fe36bff\",\"161\":\"4fade15904bfe66b4f71\",\"176\":\"c9baace07c5f15a8c611\",\"302\":\"cf81ea852f516bfc252f\",\"347\":\"b7e411d2828cadec556d\",\"354\":\"472e40d0f6d6067cc288\",\"472\":\"65a66b6c1fb1be8db986\",\"501\":\"3c8f4d2d9fb141fac95f\",\"524\":\"aa9aa632b1ede321653d\",\"536\":\"ab2a889dae72ec88f68c\",\"626\":\"80b1f20c070778cd2c89\",\"687\":\"2509fbfe3b3556358b45\",\"745\":\"cc53f6e29328dbd2c9ff\",\"830\":\"743a3bc23208a5ae5b3b\",\"915\":\"af01666698d37aea6ce6\",\"941\":\"4aa7cedc56885a7f52cb\",\"993\":\"5065d2f591c9fc4f83b4\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"47\":\"9ea2a6fe11cbf65b8511\",\"133\":\"0e8e598a95d89fe36bff\",\"176\":\"c9baace07c5f15a8c611\",\"347\":\"b7e411d2828cadec556d\",\"472\":\"65a66b6c1fb1be8db986\",\"687\":\"2509fbfe3b3556358b45\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","import { DEBUG, DEBUG_MORE } from '../config';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport { notifyClientReady, playNotifySoundDebounced } from './notifications';\n\ntype WorkerAction = {\n type: string;\n payload: Record;\n};\n\nfunction handleWorkerMessage(e: MessageEvent) {\n const action: WorkerAction = e.data;\n if (DEBUG_MORE) {\n // eslint-disable-next-line no-console\n console.log('[SW] Message from worker', action);\n }\n if (!action.type) return;\n const dispatch = getDispatch();\n const payload = action.payload;\n switch (action.type) {\n case 'focusMessage':\n if (dispatch.focusMessage) {\n dispatch.focusMessage(payload);\n }\n if (dispatch.startActiveReaction && payload.reaction) {\n dispatch.startActiveReaction({\n messageId: payload.messageId,\n reaction: payload.reaction,\n });\n }\n break;\n case 'playNotificationSound':\n playNotifySoundDebounced(action.payload.id);\n break;\n }\n}\n\nfunction subscribeToWorker() {\n navigator.serviceWorker.removeEventListener('message', handleWorkerMessage);\n navigator.serviceWorker.addEventListener('message', handleWorkerMessage);\n // Notify web worker that client is ready to receive messages\n notifyClientReady();\n}\n\nif (IS_SERVICE_WORKER_SUPPORTED) {\n window.addEventListener('load', async () => {\n try {\n if (!navigator.serviceWorker.controller) {\n const registrations = await navigator.serviceWorker.getRegistrations();\n if (registrations.length) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Hard reload detected, re-enabling Service Worker');\n }\n await Promise.all(registrations.map(r => r.unregister()));\n }\n }\n\n await navigator.serviceWorker.register(new URL('../serviceWorker.ts', import.meta.url));\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker registered');\n }\n\n await navigator.serviceWorker.ready;\n\n if (navigator.serviceWorker.controller) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker ready');\n }\n subscribeToWorker();\n } else {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker not available');\n }\n\n if (!IS_IOS && !IS_ANDROID) {\n getDispatch().showDialog({ data: { message: 'SERVICE_WORKER_DISABLED', hasErrorKey: true } });\n }\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker registration failed: ', err);\n }\n }\n });\n window.addEventListener('focus', async () => {\n await navigator.serviceWorker.ready;\n subscribeToWorker();\n });\n}\n","import { GlobalState } from './types';\nimport { NewChatMembersProgress } from '../types';\n\nimport {\n ANIMATION_LEVEL_DEFAULT, DARK_THEME_PATTERN_COLOR, DEFAULT_MESSAGE_TEXT_SIZE_PX, DEFAULT_PATTERN_COLOR,\n DEFAULT_PLAYBACK_RATE,\n DEFAULT_VOLUME,\n IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX, MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX,\n} from '../config';\nimport { IS_IOS, IS_MAC_OS } from '../util/environment';\n\nexport const INITIAL_STATE: GlobalState = {\n isLeftColumnShown: true,\n isChatInfoShown: false,\n newChatMembersProgress: NewChatMembersProgress.Closed,\n uiReadyState: 0,\n serverTimeOffset: 0,\n\n authRememberMe: true,\n countryList: {\n phoneCodes: [],\n general: [],\n },\n\n blocked: {\n ids: [],\n totalCount: 0,\n },\n\n users: {\n byId: {},\n statusesById: {},\n },\n\n chats: {\n listIds: {},\n isFullyLoaded: {},\n orderedPinnedIds: {},\n totalCount: {},\n byId: {},\n },\n\n messages: {\n byChatId: {},\n messageLists: [],\n sponsoredByChatId: {},\n },\n\n groupCalls: {\n byId: {},\n },\n\n scheduledMessages: {\n byChatId: {},\n },\n\n chatFolders: {\n byId: {},\n activeChatFolder: 0,\n },\n\n fileUploads: {\n byMessageLocalId: {},\n },\n\n recentEmojis: ['grinning', 'kissing_heart', 'christmas_tree', 'brain', 'trophy'],\n\n stickers: {\n setsById: {},\n added: {},\n recent: {\n stickers: [],\n },\n favorite: {\n stickers: [],\n },\n greeting: {\n stickers: [],\n },\n featured: {\n setIds: [],\n },\n search: {},\n forEmoji: {},\n },\n\n emojiKeywords: {},\n\n gifs: {\n saved: {},\n search: {},\n },\n\n inlineBots: {\n isLoading: false,\n byUsername: {},\n },\n\n globalSearch: {},\n\n userSearch: {},\n\n localTextSearch: {\n byChatThreadKey: {},\n },\n\n localMediaSearch: {\n byChatId: {},\n },\n\n management: {\n byChatId: {},\n },\n\n topPeers: {},\n\n topInlineBots: {},\n\n mediaViewer: {},\n\n audioPlayer: {\n volume: DEFAULT_VOLUME,\n playbackRate: DEFAULT_PLAYBACK_RATE,\n isMuted: false,\n },\n\n forwardMessages: {},\n\n pollResults: {},\n\n payment: {},\n\n notifications: [],\n\n dialogs: [],\n\n activeSessions: [],\n\n settings: {\n byKey: {\n theme: 'light',\n shouldUseSystemTheme: true,\n messageTextSize: IS_IOS\n ? IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX\n : (IS_MAC_OS ? MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX : DEFAULT_MESSAGE_TEXT_SIZE_PX),\n animationLevel: ANIMATION_LEVEL_DEFAULT,\n messageSendKeyCombo: 'enter',\n canAutoLoadPhotoFromContacts: true,\n canAutoLoadPhotoInPrivateChats: true,\n canAutoLoadPhotoInGroups: true,\n canAutoLoadPhotoInChannels: true,\n canAutoLoadVideoFromContacts: true,\n canAutoLoadVideoInPrivateChats: true,\n canAutoLoadVideoInGroups: true,\n canAutoLoadVideoInChannels: true,\n canAutoLoadFileFromContacts: false,\n canAutoLoadFileInPrivateChats: false,\n canAutoLoadFileInGroups: false,\n canAutoLoadFileInChannels: false,\n autoLoadFileMaxSizeMb: 10,\n hasWebNotifications: true,\n hasPushNotifications: true,\n notificationSoundVolume: 5,\n canAutoPlayGifs: true,\n canAutoPlayVideos: true,\n shouldSuggestStickers: true,\n shouldLoopStickers: true,\n language: 'en',\n timeFormat: '24h',\n wasTimeFormatSetManually: false,\n isConnectionStatusMinimized: true,\n },\n themes: {\n light: {\n isBlurred: true,\n patternColor: DEFAULT_PATTERN_COLOR,\n },\n dark: {\n isBlurred: true,\n patternColor: DARK_THEME_PATTERN_COLOR,\n },\n },\n privacy: {},\n notifyExceptions: {},\n },\n\n twoFaSettings: {},\n activeReactions: {},\n\n shouldShowContextMenuHint: true,\n\n activeDownloads: {\n byChatId: {},\n },\n\n serviceNotifications: [],\n};\n","import {\n addCallback, addReducer, getGlobal, removeCallback,\n} from '../lib/teact/teactn';\n\nimport { GlobalState } from './types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nimport { onBeforeUnload, onIdle, throttle } from '../util/schedulers';\nimport {\n DEBUG,\n GLOBAL_STATE_CACHE_DISABLED,\n GLOBAL_STATE_CACHE_KEY,\n GLOBAL_STATE_CACHE_USER_LIST_LIMIT,\n GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT,\n GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n DEFAULT_VOLUME,\n DEFAULT_PLAYBACK_RATE,\n ALL_FOLDER_ID,\n ARCHIVED_FOLDER_ID,\n} from '../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\nimport { isHeavyAnimating } from '../hooks/useHeavyAnimationCheck';\nimport { pick, unique } from '../util/iteratees';\nimport {\n selectCurrentChat,\n selectCurrentMessageList,\n selectVisibleUsers,\n} from '../modules/selectors';\nimport { hasStoredSession } from '../util/sessions';\nimport { INITIAL_STATE } from './initial';\nimport { parseLocationHash } from '../util/routing';\nimport { isUserId } from '../modules/helpers';\nimport { getOrderedIds } from '../util/folderManager';\n\nconst UPDATE_THROTTLE = 5000;\n\nconst updateCacheThrottled = throttle(() => onIdle(updateCache), UPDATE_THROTTLE, false);\n\nlet isCaching = false;\nlet unsubscribeFromBeforeUnload: NoneToVoidFunction | undefined;\n\nexport function initCache() {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return;\n }\n\n addReducer('saveSession', () => {\n if (isCaching) {\n return;\n }\n\n setupCaching();\n });\n\n addReducer('reset', () => {\n localStorage.removeItem(GLOBAL_STATE_CACHE_KEY);\n\n if (!isCaching) {\n return;\n }\n\n clearCaching();\n });\n}\n\nexport function loadCache(initialState: GlobalState): GlobalState | undefined {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return undefined;\n }\n\n if (hasStoredSession(true)) {\n setupCaching();\n\n return readCache(initialState);\n } else {\n clearCaching();\n\n return undefined;\n }\n}\n\nfunction setupCaching() {\n isCaching = true;\n unsubscribeFromBeforeUnload = onBeforeUnload(updateCache, true);\n window.addEventListener('blur', updateCache);\n addCallback(updateCacheThrottled);\n}\n\nfunction clearCaching() {\n isCaching = false;\n removeCallback(updateCacheThrottled);\n window.removeEventListener('blur', updateCache);\n if (unsubscribeFromBeforeUnload) {\n unsubscribeFromBeforeUnload();\n }\n}\n\nfunction readCache(initialState: GlobalState): GlobalState {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.time('global-state-cache-read');\n }\n\n const json = localStorage.getItem(GLOBAL_STATE_CACHE_KEY);\n const cached = json ? JSON.parse(json) as GlobalState : undefined;\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.timeEnd('global-state-cache-read');\n }\n\n if (cached) {\n migrateCache(cached, initialState);\n }\n\n const newState = {\n ...initialState,\n ...cached,\n };\n\n const parsedMessageList = !IS_SINGLE_COLUMN_LAYOUT ? parseLocationHash() : undefined;\n\n return {\n ...newState,\n messages: {\n ...newState.messages,\n messageLists: parsedMessageList ? [parsedMessageList] : [],\n },\n };\n}\n\nfunction migrateCache(cached: GlobalState, initialState: GlobalState) {\n // Migrate from legacy setting names\n if ('shouldAutoDownloadMediaFromContacts' in cached.settings.byKey) {\n const {\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n shouldAutoPlayVideos,\n shouldAutoPlayGifs,\n ...rest\n } = cached.settings.byKey;\n\n cached.settings.byKey = {\n ...rest,\n canAutoLoadPhotoFromContacts: shouldAutoDownloadMediaFromContacts,\n canAutoLoadVideoFromContacts: shouldAutoDownloadMediaFromContacts,\n canAutoLoadPhotoInPrivateChats: shouldAutoDownloadMediaInPrivateChats,\n canAutoLoadVideoInPrivateChats: shouldAutoDownloadMediaInPrivateChats,\n canAutoLoadPhotoInGroups: shouldAutoDownloadMediaInGroups,\n canAutoLoadVideoInGroups: shouldAutoDownloadMediaInGroups,\n canAutoLoadPhotoInChannels: shouldAutoDownloadMediaInChannels,\n canAutoLoadVideoInChannels: shouldAutoDownloadMediaInChannels,\n canAutoPlayVideos: shouldAutoPlayVideos,\n canAutoPlayGifs: shouldAutoPlayGifs,\n };\n }\n\n // Pre-fill settings with defaults\n cached.settings.byKey = {\n ...initialState.settings.byKey,\n ...cached.settings.byKey,\n };\n\n cached.settings.themes = {\n ...initialState.settings.themes,\n ...cached.settings.themes,\n };\n\n cached.chatFolders = {\n ...initialState.chatFolders,\n ...cached.chatFolders,\n };\n\n if (!cached.stickers.greeting) {\n cached.stickers.greeting = initialState.stickers.greeting;\n }\n\n if (!cached.activeDownloads) {\n cached.activeDownloads = {\n byChatId: {},\n };\n }\n\n if (!cached.serviceNotifications) {\n cached.serviceNotifications = [];\n }\n\n if (cached.audioPlayer.volume === undefined) {\n cached.audioPlayer.volume = DEFAULT_VOLUME;\n }\n\n if (cached.audioPlayer.playbackRate === undefined) {\n cached.audioPlayer.playbackRate = DEFAULT_PLAYBACK_RATE;\n }\n\n if (!cached.groupCalls) {\n cached.groupCalls = initialState.groupCalls;\n }\n\n if (!cached.users.statusesById) {\n cached.users.statusesById = {};\n }\n\n if (!cached.messages.sponsoredByChatId) {\n cached.messages.sponsoredByChatId = {};\n }\n\n if (!cached.activeReactions) {\n cached.activeReactions = {};\n }\n}\n\nfunction updateCache() {\n if (!isCaching || isHeavyAnimating()) {\n return;\n }\n\n const global = getGlobal();\n\n if (global.isLoggingOut) {\n return;\n }\n\n const reducedGlobal: GlobalState = {\n ...INITIAL_STATE,\n ...pick(global, [\n 'authState',\n 'authPhoneNumber',\n 'authRememberMe',\n 'authNearestCountry',\n 'currentUserId',\n 'contactList',\n 'topPeers',\n 'topInlineBots',\n 'recentEmojis',\n 'push',\n 'shouldShowContextMenuHint',\n 'leftColumnWidth',\n 'serviceNotifications',\n ]),\n audioPlayer: {\n volume: global.audioPlayer.volume,\n playbackRate: global.audioPlayer.playbackRate,\n isMuted: global.audioPlayer.isMuted,\n },\n isChatInfoShown: reduceShowChatInfo(global),\n users: reduceUsers(global),\n chats: reduceChats(global),\n messages: reduceMessages(global),\n globalSearch: {\n recentlyFoundChatIds: global.globalSearch.recentlyFoundChatIds,\n },\n settings: reduceSettings(global),\n chatFolders: reduceChatFolders(global),\n groupCalls: reduceGroupCalls(global),\n availableReactions: reduceAvailableReactions(global),\n };\n\n const json = JSON.stringify(reducedGlobal);\n localStorage.setItem(GLOBAL_STATE_CACHE_KEY, json);\n}\n\nfunction reduceShowChatInfo(global: GlobalState): boolean {\n return window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ? global.isChatInfoShown\n : false;\n}\n\nfunction reduceUsers(global: GlobalState): GlobalState['users'] {\n const { users: { byId, statusesById }, currentUserId } = global;\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const visibleUserIds = selectVisibleUsers(global)?.map(({ id }) => id);\n\n const idsToSave = unique([\n ...currentUserId ? [currentUserId] : [],\n ...currentChatId && isUserId(currentChatId) ? [currentChatId] : [],\n ...visibleUserIds || [],\n ...global.topPeers.userIds || [],\n ...getOrderedIds(ALL_FOLDER_ID)?.filter(isUserId) || [],\n ...getOrderedIds(ARCHIVED_FOLDER_ID)?.filter(isUserId) || [],\n ...global.contactList?.userIds || [],\n ...global.globalSearch.recentlyFoundChatIds?.filter(isUserId) || [],\n ...Object.keys(byId),\n ]).slice(0, GLOBAL_STATE_CACHE_USER_LIST_LIMIT);\n\n return {\n byId: pick(byId, idsToSave),\n statusesById: pick(statusesById, idsToSave),\n };\n}\n\nfunction reduceChats(global: GlobalState): GlobalState['chats'] {\n const { chats: { byId }, currentUserId } = global;\n const currentChat = selectCurrentChat(global);\n const idsToSave = unique([\n ...currentUserId ? [currentUserId] : [],\n ...currentChat ? [currentChat.id] : [],\n ...getOrderedIds(ALL_FOLDER_ID) || [],\n ...getOrderedIds(ARCHIVED_FOLDER_ID) || [],\n ...global.globalSearch.recentlyFoundChatIds || [],\n ...Object.keys(byId),\n ]).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT);\n\n return {\n ...global.chats,\n isFullyLoaded: {},\n byId: pick(global.chats.byId, idsToSave),\n };\n}\n\nfunction reduceMessages(global: GlobalState): GlobalState['messages'] {\n const { currentUserId } = global;\n const byChatId: GlobalState['messages']['byChatId'] = {};\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const chatIdsToSave = [\n ...currentChatId ? [currentChatId] : [],\n ...currentUserId ? [currentUserId] : [],\n ...getOrderedIds(ALL_FOLDER_ID)?.slice(0, GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT) || [],\n ];\n\n chatIdsToSave.forEach((chatId) => {\n const current = global.messages.byChatId[chatId];\n if (!current) {\n return;\n }\n\n const mainThread = current.threadsById[MAIN_THREAD_ID];\n if (!mainThread || !mainThread.viewportIds) {\n return;\n }\n\n byChatId[chatId] = {\n byId: pick(current.byId, mainThread.viewportIds),\n threadsById: {\n [MAIN_THREAD_ID]: mainThread,\n },\n };\n });\n\n return {\n byChatId,\n messageLists: [],\n sponsoredByChatId: {},\n };\n}\n\nfunction reduceSettings(global: GlobalState): GlobalState['settings'] {\n const { byKey, themes } = global.settings;\n\n return {\n byKey,\n themes,\n privacy: {},\n notifyExceptions: {},\n };\n}\n\nfunction reduceChatFolders(global: GlobalState): GlobalState['chatFolders'] {\n return {\n ...global.chatFolders,\n activeChatFolder: 0,\n };\n}\n\nfunction reduceGroupCalls(global: GlobalState): GlobalState['groupCalls'] {\n return {\n ...global.groupCalls,\n byId: {},\n activeGroupCallId: undefined,\n isGroupCallPanelHidden: undefined,\n isFallbackConfirmOpen: undefined,\n };\n}\n\nfunction reduceAvailableReactions(global: GlobalState): GlobalState['availableReactions'] {\n return global.availableReactions\n ?.map((r) => pick(r, ['reaction', 'staticIcon', 'title', 'isInactive']));\n}\n","import { addReducer } from '../lib/teact/teactn';\n\nimport { INITIAL_STATE } from './initial';\nimport { initCache, loadCache } from './cache';\nimport { cloneDeep } from '../util/iteratees';\n\ninitCache();\n\naddReducer('init', () => {\n const initial = cloneDeep(INITIAL_STATE);\n return loadCache(initial) || initial;\n});\n","const STORAGE_KEY = 'tt-active-tab';\nconst INTERVAL = 2000;\n\nconst tabKey = String(Date.now() + Math.random());\n\nlocalStorage.setItem(STORAGE_KEY, tabKey);\n\nlet callback: NoneToVoidFunction;\n\nconst interval = window.setInterval(() => {\n if (callback && localStorage.getItem(STORAGE_KEY) !== tabKey) {\n callback();\n clearInterval(interval);\n }\n}, INTERVAL);\n\nexport function addActiveTabChangeListener(_callback: NoneToVoidFunction) {\n callback = _callback;\n}\n","const SITE_FONTS = ['400 1em Roboto', '500 1em Roboto'];\n\nexport default function preloadFonts() {\n if ('fonts' in document) {\n return Promise.all(SITE_FONTS.map((font) => document.fonts.load(font)));\n }\n\n return undefined;\n}\n","import React, { FC, useEffect } from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport { getChatAvatarHash } from '../../modules/helpers/chats'; // Direct import for better module splitting\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { pause } from '../../util/schedulers';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport { Bundles, loadModule } from '../../util/moduleLoader';\nimport buildClassName from '../../util/buildClassName';\n\nimport './UiLoader.scss';\n\nimport telegramLogoPath from '../../assets/telegram-logo.svg';\nimport reactionThumbsPath from '../../assets/reaction-thumbs.png';\nimport monkeyPath from '../../assets/monkey.svg';\nimport { selectIsRightColumnShown, selectTheme } from '../../modules/selectors';\n\ntype OwnProps = {\n page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode';\n children: React.ReactNode;\n};\n\ntype StateProps =\n Pick\n & {\n hasCustomBackground?: boolean;\n hasCustomBackgroundColor: boolean;\n isRightColumnShown?: boolean;\n leftColumnWidth?: number;\n };\n\nconst MAX_PRELOAD_DELAY = 700;\nconst SECOND_STATE_DELAY = 1000;\nconst AVATARS_TO_PRELOAD = 10;\n\nfunction preloadAvatars() {\n const { listIds, byId } = getGlobal().chats;\n if (!listIds.active) {\n return undefined;\n }\n\n return Promise.all(listIds.active.slice(0, AVATARS_TO_PRELOAD).map((chatId) => {\n const chat = byId[chatId];\n if (!chat) {\n return undefined;\n }\n\n const avatarHash = getChatAvatarHash(chat);\n if (!avatarHash) {\n return undefined;\n }\n\n return mediaLoader.fetch(avatarHash, ApiMediaFormat.BlobUrl);\n }));\n}\n\nconst preloadTasks = {\n main: () => Promise.all([\n loadModule(Bundles.Main, 'Main')\n .then(preloadFonts),\n preloadAvatars(),\n preloadImage(reactionThumbsPath),\n ]),\n authPhoneNumber: () => Promise.all([\n preloadFonts(),\n preloadImage(telegramLogoPath),\n ]),\n authCode: () => preloadImage(monkeyPath),\n authPassword: () => preloadImage(monkeyPath),\n authQrCode: preloadFonts,\n};\n\nconst UiLoader: FC = ({\n page,\n children,\n hasCustomBackground,\n hasCustomBackgroundColor,\n isRightColumnShown,\n shouldSkipHistoryAnimations,\n leftColumnWidth,\n}) => {\n const { setIsUiReady } = getDispatch();\n\n const [isReady, markReady] = useFlag();\n const {\n shouldRender: shouldRenderMask, transitionClassNames,\n } = useShowTransition(!isReady, undefined, true);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n const safePreload = async () => {\n try {\n await preloadTasks[page]();\n } catch (err) {\n // Do nothing\n }\n };\n\n Promise.race([\n pause(MAX_PRELOAD_DELAY),\n safePreload(),\n ]).then(() => {\n markReady();\n setIsUiReady({ uiReadyState: 1 });\n\n timeout = window.setTimeout(() => {\n setIsUiReady({ uiReadyState: 2 });\n }, SECOND_STATE_DELAY);\n });\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n setIsUiReady({ uiReadyState: 0 });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n

\n {children}\n {shouldRenderMask && !shouldSkipHistoryAnimations && (\n
\n {page === 'main' ? (\n <>\n \n \n {isRightColumnShown &&
}\n \n ) : (\n
\n )}\n
\n )}\n
\n );\n};\n\nexport default withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, backgroundColor } = global.settings.themes[theme] || {};\n\n return {\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n uiReadyState: global.uiReadyState,\n hasCustomBackground: Boolean(background),\n hasCustomBackgroundColor: Boolean(backgroundColor),\n isRightColumnShown: selectIsRightColumnShown(global),\n leftColumnWidth: global.leftColumnWidth,\n };\n },\n)(UiLoader);\n","import * as langProvider from '../util/langProvider';\nimport { useState } from '../lib/teact/teact';\n\nconst useLangString = (langCode: string | undefined, key: string): string | undefined => {\n const [translation, setTranslation] = useState();\n\n if (langCode) {\n langProvider\n .getTranslationForLangString(langCode, key)\n .then(setTranslation);\n }\n\n return translation;\n};\n\nexport default useLangString;\n","import { LangCode } from '../../../types';\n\nexport function getSuggestedLanguage() {\n let suggestedLanguage = navigator.language;\n\n if (suggestedLanguage && suggestedLanguage !== 'pt-br') {\n suggestedLanguage = suggestedLanguage.substr(0, 2);\n }\n\n return suggestedLanguage as LangCode;\n}\n","import React, {\n FC, useState, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiCountryCode } from '../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { prepareSearchWordsForNeedle } from '../../util/searchWords';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { isoToEmoji } from '../../util/emoji';\nimport useOnChange from '../../hooks/useOnChange';\n\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport Spinner from '../ui/Spinner';\n\nimport './CountryCodeInput.scss';\n\ntype StateProps = {\n phoneCodeList: ApiCountryCode[];\n};\n\ntype OwnProps = {\n id: string;\n value?: ApiCountryCode;\n isLoading?: boolean;\n onChange: (value: ApiCountryCode) => void;\n};\n\nconst MENU_HIDING_DURATION = 200 + ANIMATION_END_DELAY;\nconst SELECT_TIMEOUT = 50;\n\nconst CountryCodeInput: FC = ({\n id,\n value,\n isLoading,\n onChange,\n phoneCodeList,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [filter, setFilter] = useState();\n const [filteredList, setFilteredList] = useState([]);\n\n const updateFilter = useCallback((filterValue?: string) => {\n setFilter(filterValue);\n setFilteredList(getFilteredList(phoneCodeList, filterValue));\n }, [phoneCodeList]);\n\n useOnChange(([prevPhoneCodeList]) => {\n if (prevPhoneCodeList?.length === 0 && phoneCodeList.length > 0) {\n updateFilter(filter);\n }\n }, [phoneCodeList, updateFilter]);\n\n const handleChange = useCallback((country: ApiCountryCode) => {\n onChange(country);\n\n setTimeout(() => updateFilter(undefined), MENU_HIDING_DURATION);\n }, [onChange, updateFilter]);\n\n const handleInput = useCallback((e: React.FormEvent) => {\n updateFilter(e.currentTarget.value);\n }, [updateFilter]);\n\n const handleInputKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 8) {\n return;\n }\n\n const target = e.currentTarget;\n if (value && filter === undefined) {\n target.value = '';\n }\n\n updateFilter(target.value);\n }, [filter, updateFilter, value]);\n\n const CodeInput: FC<{ onTrigger: () => void; isOpen?: boolean }> = ({ onTrigger, isOpen }) => {\n const handleTrigger = () => {\n if (isOpen) {\n return;\n }\n\n setTimeout(() => {\n inputRef.current!.select();\n }, SELECT_TIMEOUT);\n\n onTrigger();\n\n const formEl = document.getElementById('auth-phone-number-form')!;\n formEl.scrollTo({ top: formEl.scrollHeight, behavior: 'smooth' });\n };\n\n const handleCodeInput = (e: React.FormEvent) => {\n handleInput(e);\n handleTrigger();\n };\n\n const inputValue = filter ?? (value?.name || value?.defaultName || '');\n\n return (\n
\n \n \n {isLoading ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n return (\n \n {filteredList\n .map((country: ApiCountryCode) => (\n handleChange(country)}\n >\n {renderText(isoToEmoji(country.iso2), ['hq_emoji'])}\n {country.name || country.defaultName}\n {country.countryCode}\n \n ))}\n {!filteredList.length && (\n \n {lang('lng_country_none')}\n \n )}\n \n );\n};\n\nfunction getFilteredList(countryList: ApiCountryCode[], filter = ''): ApiCountryCode[] {\n if (!filter.length) {\n return countryList;\n }\n\n const searchWords = prepareSearchWordsForNeedle(filter);\n\n return countryList.filter((country) => (\n searchWords(country.defaultName) || (country.name && searchWords(country.name))\n ));\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { countryList: { phoneCodes: phoneCodeList } } = global;\n return {\n phoneCodeList,\n };\n },\n)(CountryCodeInput));\n","import { ChangeEvent } from 'react';\n\nimport monkeyPath from '../../assets/monkey.svg';\n\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\nimport { LangCode } from '../../types';\nimport { ApiCountryCode } from '../../api/types';\n\nimport { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport { pick } from '../../util/iteratees';\nimport { formatPhoneNumber, getCountryCodesByIso, getCountryFromPhoneNumber } from '../../util/phoneNumber';\nimport { setLanguage } from '../../util/langProvider';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\nimport useLangString from '../../hooks/useLangString';\nimport { getSuggestedLanguage } from './helpers/getSuggestedLanguage';\n\nimport Button from '../ui/Button';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport CountryCodeInput from './CountryCodeInput';\n\ntype StateProps = Pick & {\n language?: LangCode;\n phoneCodeList: ApiCountryCode[];\n};\n\nconst MIN_NUMBER_LENGTH = 7;\n\nlet isPreloadInitiated = false;\n\nconst AuthPhoneNumber: FC = ({\n connectionState,\n authState,\n authPhoneNumber,\n authIsLoading,\n authIsLoadingQrCode,\n authError,\n authRememberMe,\n authNearestCountry,\n phoneCodeList,\n language,\n}) => {\n const {\n setAuthPhoneNumber,\n setAuthRememberMe,\n loadNearestCountry,\n loadCountryList,\n clearAuthError,\n goToAuthQrCode,\n setSettingOption,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const suggestedLanguage = getSuggestedLanguage();\n\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [country, setCountry] = useState();\n const [phoneNumber, setPhoneNumber] = useState();\n const [isTouched, setIsTouched] = useState(false);\n const [lastSelection, setLastSelection] = useState<[number, number] | undefined>();\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n const fullNumber = country ? `+${country.countryCode} ${phoneNumber || ''}` : phoneNumber;\n const canSubmit = fullNumber && fullNumber.replace(/[^\\d]+/g, '').length >= MIN_NUMBER_LENGTH;\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, [country]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && !authNearestCountry) {\n loadNearestCountry();\n }\n }, [connectionState, authNearestCountry, loadNearestCountry]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady') {\n loadCountryList({ langCode: language });\n }\n }, [connectionState, language, loadCountryList]);\n\n useEffect(() => {\n if (authNearestCountry && phoneCodeList && !country && !isTouched) {\n setCountry(getCountryCodesByIso(phoneCodeList, authNearestCountry)[0]);\n }\n }, [country, authNearestCountry, isTouched, phoneCodeList]);\n\n const parseFullNumber = useCallback((newFullNumber: string) => {\n if (!newFullNumber.length) {\n setPhoneNumber('');\n }\n\n const suggestedCountry = phoneCodeList && getCountryFromPhoneNumber(phoneCodeList, newFullNumber);\n\n // Any phone numbers should be allowed, in some cases ignoring formatting\n const selectedCountry = !country\n || (suggestedCountry && suggestedCountry.iso2 !== country.iso2)\n || (!suggestedCountry && newFullNumber.length)\n ? suggestedCountry\n : country;\n\n if (!country || !selectedCountry || (selectedCountry && selectedCountry.iso2 !== country.iso2)) {\n setCountry(selectedCountry);\n }\n setPhoneNumber(formatPhoneNumber(newFullNumber, selectedCountry));\n }, [phoneCodeList, country]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n useEffect(() => {\n if (phoneNumber === undefined && authPhoneNumber) {\n parseFullNumber(authPhoneNumber);\n }\n }, [authPhoneNumber, phoneNumber, parseFullNumber]);\n\n useLayoutEffect(() => {\n if (inputRef.current && lastSelection) {\n inputRef.current.setSelectionRange(...lastSelection);\n }\n }, [lastSelection]);\n\n const isJustPastedRef = useRef(false);\n const handlePaste = useCallback(() => {\n isJustPastedRef.current = true;\n requestAnimationFrame(() => {\n isJustPastedRef.current = false;\n });\n }, []);\n\n const handleCountryChange = useCallback((value: ApiCountryCode) => {\n setCountry(value);\n setPhoneNumber('');\n }, []);\n\n const handlePhoneNumberChange = useCallback((e: ChangeEvent) => {\n if (authError) {\n clearAuthError();\n }\n\n // This is for further screens. We delay it until user input to speed up the initial loading.\n if (!isPreloadInitiated) {\n isPreloadInitiated = true;\n preloadFonts();\n void preloadImage(monkeyPath);\n }\n\n const { value, selectionStart, selectionEnd } = e.target;\n setLastSelection(\n selectionStart && selectionEnd && selectionEnd < value.length\n ? [selectionStart, selectionEnd]\n : undefined,\n );\n\n setIsTouched(true);\n\n const shouldFixSafariAutoComplete = (\n IS_SAFARI && country && fullNumber !== undefined\n && value.length - fullNumber.length > 1 && !isJustPastedRef.current\n );\n parseFullNumber(shouldFixSafariAutoComplete ? `${country!.countryCode} ${value}` : value);\n }, [authError, clearAuthError, country, fullNumber, parseFullNumber]);\n\n const handleKeepSessionChange = useCallback((e: ChangeEvent) => {\n setAuthRememberMe(e.target.checked);\n }, [setAuthRememberMe]);\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (authIsLoading) {\n return;\n }\n\n if (canSubmit) {\n setAuthPhoneNumber({ phoneNumber: fullNumber });\n }\n }\n\n const isAuthReady = authState === 'authorizationStateWaitPhoneNumber';\n\n return (\n
\n
\n
\n

Telegram

\n

{lang('StartText')}

\n
\n \n \n \n {canSubmit && (\n isAuthReady ? (\n \n ) : (\n \n )\n )}\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: { byKey: { language } },\n countryList: { phoneCodes: phoneCodeList },\n } = global;\n\n return {\n ...pick(global, [\n 'connectionState',\n 'authState',\n 'authPhoneNumber',\n 'authIsLoading',\n 'authIsLoadingQrCode',\n 'authError',\n 'authRememberMe',\n 'authNearestCountry',\n ]),\n language,\n phoneCodeList,\n };\n },\n)(AuthPhoneNumber));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthCodeAsync: FC = () => {\n const AuthCode = useModuleLoader(Bundles.Auth, 'AuthCode');\n\n return AuthCode ? : ;\n};\n\nexport default memo(AuthCodeAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthPasswordAsync: FC = () => {\n const AuthPassword = useModuleLoader(Bundles.Auth, 'AuthPassword');\n\n return AuthPassword ? : ;\n};\n\nexport default memo(AuthPasswordAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthRegisterAsync: FC = () => {\n const AuthRegister = useModuleLoader(Bundles.Auth, 'AuthRegister');\n\n return AuthRegister ? : ;\n};\n\nexport default memo(AuthRegisterAsync);\n","/*\n jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */\n'use strict';let G=null;class H{}H.render=function(w,B){G(w,B)};self.QrCreator=H;\n(function(w){function B(t,c,a,e){var b={},h=w(a,c);h.u(t);h.J();e=e||0;var r=h.h(),d=h.h()+2*e;b.text=t;b.level=c;b.version=a;b.O=d;b.a=function(b,a){b-=e;a-=e;return 0>b||b>=r||0>a||a>=r?!1:h.a(b,a)};return b}function C(t,c,a,e,b,h,r,d,g,x){function u(b,a,f,c,d,r,g){b?(t.lineTo(a+r,f+g),t.arcTo(a,f,c,d,h)):t.lineTo(a,f)}r?t.moveTo(c+h,a):t.moveTo(c,a);u(d,e,a,e,b,-h,0);u(g,e,b,c,b,0,-h);u(x,c,b,c,a,h,0);u(r,c,a,e,a,0,h)}function z(t,c,a,e,b,h,r,d,g,x){function u(b,a,c,d){t.moveTo(b+c,a);t.lineTo(b,\na);t.lineTo(b,a+d);t.arcTo(b,a,b+c,a,h)}r&&u(c,a,h,h);d&&u(e,a,-h,h);g&&u(e,b,-h,-h);x&&u(c,b,h,-h)}function A(t,c){var a=c.fill;if(\"string\"===typeof a)t.fillStyle=a;else{var e=a.type,b=a.colorStops;a=a.position.map((b)=>Math.round(b*c.size));if(\"linear-gradient\"===e)var h=t.createLinearGradient.apply(t,a);else if(\"radial-gradient\"===e)h=t.createRadialGradient.apply(t,a);else throw Error(\"Unsupported fill\");b.forEach(([b,a])=>{h.addColorStop(b,a)});t.fillStyle=h}}function y(t,c){a:{var a=c.text,e=\nc.v,b=c.N,h=c.K,r=c.P;b=Math.max(1,b||1);for(h=Math.min(40,h||40);b<=h;b+=1)try{var d=B(a,e,b,r);break a}catch(J){}d=void 0}if(!d)return null;a=t.getContext(\"2d\");c.background&&(a.fillStyle=c.background,a.fillRect(c.left,c.top,c.size,c.size));e=d.O;h=c.size/e;a.beginPath();for(r=0;r>>7-b%8&1)},put:function(b,h){for(var a=0;a>>h-a-1&1))},f:function(){return a},m:function(b){var h=Math.floor(a/8);c.length<=h&&c.push(0);b&&(c[h]|=128>>>a%8);a+=1}};return e}function C(c,a){function e(b,h){for(var a=-1;7>=a;a+=1)if(!(-1>=b+a||d<=b+a))for(var c=-1;7>=c;c+=1)-1>=h+c||d<=h+c||(r[b+a][h+c]=0<=a&&6>=a&&(0==c||6==c)||0<=c&&6>=c&&(0==a||6==a)||2<=a&&4>=a&&2<=c&&4>=c?!0:!1)}function b(b,a){for(var f=d=4*c+17,k=Array(f),m=0;m<\nf;m+=1){k[m]=Array(f);for(var p=0;p=n;n+=1)for(var l=-2;2>=l;l+=1)r[p+n][q+l]=-2==n||2==n||-2==l||2==l||0==n&&0==l}for(f=8;fk;k+=1)m=!b&&1==(f>>k&1),r[6>k?k:8>k?k+1:d-15+k][8]=m,r[8][8>k?d-k-1:9>k?15-k:14-k]=m;r[d-8][8]=!b;if(7<=\nc){f=y.A(c);for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[Math.floor(k/3)][k%3+d-8-3]=m;for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[k%3+d-8-3][Math.floor(k/3)]=m}if(null==g){b=t.I(c,h);f=B();for(k=0;k8*m)throw Error(\"code length overflow. (\"+f.f()+\">\"+8*m+\")\");for(f.f()+4<=8*m&&f.put(0,4);0!=f.f()%8;)f.m(!1);for(;!(f.f()>=8*m);){f.put(236,8);if(f.f()>=8*m)break;f.put(17,8)}var u=0;m=k=0;p=Array(b.length);\nq=Array(b.length);for(n=0;nn;n+=1)null==r[k][q-n]&&(l=!1,p>>m&1)),a(k,q-n)&&(l=!l),r[k][q-n]=l,--m,-1==m&&(p+=1,m=7));k+=f;if(0>k||d<=k){k-=f;f=-f;break}}}var h=A[a],r=null,d=0,g=null,x=[],u={u:function(b){b=w(b);x.push(b);g=null},a:function(b,a){if(0>b||d<=b||0>a||d<=a)throw Error(b+\",\"+a);return r[b][a]},h:function(){return d},J:function(){for(var a=0,h=0,c=0;8>c;c+=1){b(!0,c);var d=y.D(u);if(0==c||a>d)a=d,h=c}b(!1,h)}};return u}\nfunction z(c,a){if(\"undefined\"==typeof c.length)throw Error(c.length+\"/\"+a);var e=function(){for(var b=0;bb.b()-a.b())return b;for(var c=v.g(b.c(0))-v.g(a.c(0)),h=Array(b.b()),\ng=0;gb?a.push(b):2048>b?a.push(192|b>>6,128|b&63):55296>b||57344<=b?a.push(224|b>>12,128|b>>6&63,128|b&63):(e++,b=65536+((b&1023)<<10|c.charCodeAt(e)&1023),a.push(240|b>>18,128|b>>12&63,128|b>>6&63,128|b&63))}return a};var A={L:1,M:0,Q:3,H:2},y=function(){function c(b){for(var a=0;0!=b;)a+=1,b>>>=1;return a}var a=[[],[6,18],\n[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],\n[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e={w:function(b){for(var a=b<<10;0<=c(a)-c(1335);)a^=1335<a||40a?8:16},D:function(b){for(var a=b.h(),c=0,\nd=0;d=p;p+=1)if(!(0>d+p||a<=d+p))for(var q=-1;1>=q;q+=1)0>g+q||a<=g+q||(0!=p||0!=q)&&t==b.a(d+p,g+q)&&(e+=1);5e;e+=1)c[e]=1<e;e+=1)c[e]=c[e-4]^c[e-5]^c[e-6]^c[e-8];for(e=0;255>e;e+=1)a[c[e]]=e;return{g:function(b){if(1>b)throw Error(\"glog(\"+b+\")\");return a[b]},i:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return c[b]}}}(),t=function(){function c(b,c){switch(c){case A.L:return a[4*\n(b-1)];case A.M:return a[4*(b-1)+1];case A.Q:return a[4*(b-1)+2];case A.H:return a[4*(b-1)+3]}}var a=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,\n2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,\n45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,\n151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],\n[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],\n[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e={I:function(b,a){var e=c(b,a);if(\"undefined\"==\ntypeof e)throw Error(\"bad rs block @ typeNumber:\"+b+\"/errorCorrectLevel:\"+a);b=e.length/3;a=[];for(var d=0;d\n & {\n language?: LangCode;\n };\n\nconst DATA_PREFIX = 'tg://login?token=';\n\nconst AuthCode: FC = ({\n connectionState,\n authState,\n authQrCode,\n language,\n}) => {\n const {\n returnToAuthPhoneNumber,\n setSettingOption,\n } = getDispatch();\n\n const suggestedLanguage = getSuggestedLanguage();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const qrCodeRef = useRef(null);\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n useEffect(() => {\n if (!authQrCode || connectionState !== 'connectionStateReady') {\n return;\n }\n\n const container = qrCodeRef.current!;\n\n container.innerHTML = '';\n container.classList.remove('pre-animate');\n\n QrCreator.render({\n text: `${DATA_PREFIX}${authQrCode.token}`,\n radius: 0.5,\n ecLevel: 'M',\n fill: '#4E96D4',\n size: 280,\n }, container);\n }, [connectionState, authQrCode]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady') {\n void setLanguage(DEFAULT_LANG_CODE);\n }\n }, [connectionState]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n const isAuthReady = authState === 'authorizationStateWaitQrCode';\n\n return (\n
\n
\n {authQrCode ? (\n
\n ) : (\n
\n )}\n

{lang('Login.QR.Title')}

\n
    \n
  1. {lang('Login.QR.Help1')}
  2. \n
  3. {renderText(lang('Login.QR.Help2'), ['simple_markdown'])}
  4. \n
  5. {lang('Login.QR.Help3')}
  6. \n
\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n connectionState, authState, authQrCode, settings: { byKey: { language } },\n } = global;\n\n return {\n connectionState,\n authState,\n authQrCode,\n language,\n };\n },\n)(AuthCode));\n","import React, { FC, useEffect, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\n\nimport '../../modules/actions/initial';\nimport { pick } from '../../util/iteratees';\nimport { PLATFORM_ENV } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport UiLoader from '../common/UiLoader';\nimport AuthPhoneNumber from './AuthPhoneNumber';\nimport AuthCode from './AuthCode.async';\nimport AuthPassword from './AuthPassword.async';\nimport AuthRegister from './AuthRegister.async';\nimport AuthQrCode from './AuthQrCode';\n\nimport './Auth.scss';\n\ntype StateProps = Pick;\n\nconst Auth: FC = ({\n authState,\n}) => {\n const {\n reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,\n } = getDispatch();\n\n useEffect(() => {\n reset();\n initApi();\n }, [reset, initApi]);\n\n const isMobile = PLATFORM_ENV === 'iOS' || PLATFORM_ENV === 'Android';\n\n const handleChangeAuthorizationMethod = () => {\n if (!isMobile) {\n goToAuthQrCode();\n } else {\n returnToAuthPhoneNumber();\n }\n };\n\n useHistoryBack(\n (!isMobile && authState === 'authorizationStateWaitPhoneNumber')\n || (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,\n );\n\n // Prevent refresh when rotating device\n useEffect(() => {\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, []);\n\n switch (authState) {\n case 'authorizationStateWaitCode':\n return ;\n case 'authorizationStateWaitPassword':\n return ;\n case 'authorizationStateWaitRegistration':\n return ;\n case 'authorizationStateWaitPhoneNumber':\n return ;\n case 'authorizationStateWaitQrCode':\n return ;\n default:\n return isMobile\n ? \n : ;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authState']),\n)(Auth));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MainAsync: FC = () => {\n const Main = useModuleLoader(Bundles.Main, 'Main');\n\n return Main ?
: undefined;\n};\n\nexport default memo(MainAsync);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport Button from '../ui/Button';\n\nimport appInactivePath from '../../assets/app-inactive.png';\nimport './AppInactive.scss';\n\nconst AppInactive: FC = () => {\n const handleReload = () => {\n window.location.reload();\n };\n\n return (\n
\n
\n \"\"\n

Such error, many tabs

\n
\n Telegram supports only one active tab with the app.\n
\n Please reload this page to continue using this tab or close it.\n
\n
\n \n
\n
\n
\n );\n};\n\nexport default AppInactive;\n","import { FC, useEffect } from './lib/teact/teact';\nimport React, { getDispatch, withGlobal } from './lib/teact/teactn';\n\nimport { GlobalState } from './global/types';\n\nimport { INACTIVE_MARKER, PAGE_TITLE } from './config';\nimport { pick } from './util/iteratees';\nimport { updateSizes } from './util/windowSize';\nimport { addActiveTabChangeListener } from './util/activeTabMonitor';\nimport useFlag from './hooks/useFlag';\n\nimport Auth from './components/auth/Auth';\nimport UiLoader from './components/common/UiLoader';\nimport Main from './components/main/Main.async';\nimport AppInactive from './components/main/AppInactive';\nimport { hasStoredSession } from './util/sessions';\n// import Test from './components/test/TestNoRedundancy';\n\ntype StateProps = Pick;\n\nconst App: FC = ({ authState }) => {\n const { disconnect } = getDispatch();\n\n const [isInactive, markInactive] = useFlag(false);\n\n useEffect(() => {\n updateSizes();\n addActiveTabChangeListener(() => {\n disconnect();\n document.title = `${PAGE_TITLE}${INACTIVE_MARKER}`;\n\n markInactive();\n });\n }, [disconnect, markInactive]);\n\n // return ;\n\n if (isInactive) {\n return ;\n }\n\n if (authState) {\n switch (authState) {\n case 'authorizationStateWaitPhoneNumber':\n case 'authorizationStateWaitCode':\n case 'authorizationStateWaitPassword':\n case 'authorizationStateWaitRegistration':\n case 'authorizationStateWaitQrCode':\n return ;\n case 'authorizationStateClosed':\n case 'authorizationStateClosing':\n case 'authorizationStateLoggingOut':\n case 'authorizationStateReady':\n return renderMain();\n }\n }\n\n return hasStoredSession(true) ? renderMain() : ;\n};\n\nfunction renderMain() {\n return (\n \n
\n \n );\n}\n\nexport default withGlobal(\n (global): StateProps => pick(global, ['authState']),\n)(App);\n","import './util/handleError';\nimport './util/setupServiceWorker';\n\nimport React, { getDispatch, getGlobal } from './lib/teact/teactn';\nimport TeactDOM from './lib/teact/teact-dom';\n\nimport './global';\n\nimport { DEBUG } from './config';\n\nimport App from './App';\n\nimport './styles/index.scss';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> INIT');\n}\n\ngetDispatch().init();\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START INITIAL RENDER');\n}\n\nTeactDOM.render(\n ,\n document.getElementById('root'),\n);\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH INITIAL RENDER');\n}\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.warn('GLOBAL STATE', getGlobal());\n});\n"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","loadStylesheet","installedCssChunks","worker","requestStates","Map","requestStatesByCallback","initApi","onUpdate","initialArgs","DEBUG","console","log","Worker","URL","addEventListener","data","type","update","requestState","get","messageId","error","reject","resolve","response","callback","callbackArgs","Error","message","subscribeToWorker","platform","window","ensureWorkerPing","setTimeout","makeRequest","args","callApi","fnName","warn","promise","name","err","cancelApiProgress","progressCallback","isCanceled","postMessage","generateIdFor","payload","Promise","Object","assign","pop","set","catch","finally","delete","startedAt","Date","now","async","race","pause","then","location","reload","ApiMediaFormat","ApiMessageEntityTypes","MAIN_THREAD_ID","MESSAGE_DELETED","base","maxint","adapt","delta","numpoints","firsttime","k","Math","floor","decode","input","preserveCase","output","case_flags","input_length","length","n","out","i","bias","basic","j","ic","oldi","w","digit","t","len","lastIndexOf","charCodeAt","RangeError","push","cp","splice","String","fromCharCode","toUpperCase","value","join","utf16","getDomain","url","href","ensureProtocol","decodedHref","decodeURI","match","domain","replace","domain_array","split","s","slice","convertPunycode","memo","text","className","children","isRtl","toggleSafeLinkModal","openTelegramLink","getDispatch","content","isNotSafe","handleClick","useCallback","e","ctrlKey","altKey","shiftKey","metaKey","RE_TME_LINK","RE_TG_LINK","preventDefault","classNames","buildClassName","title","target","rel","onClick","dir","getFileSizeString","bytes","ONE_GIGABYTE","toFixed","ONE_MEGABYTE","getDocumentExtension","document","fileName","mimeType","getFileExtension","indexOf","getColorFromExtension","extension","getDocumentHasPreview","Boolean","previewBlobUrl","thumbnail","RE_EMOJI_ONLY","RegExp","twemojiRegex","DETECT_UP_TO","emojiCount","sender","openChat","id","Link","focusMessage","handleMessageClick","chatId","groupCall","joinGroupCall","accessHash","MAX_LENGTH","NBSP","renderActionMessageText","lang","actionOriginUser","actionOriginChat","targetUsers","targetMessage","targetChatId","options","action","translationValues","amount","currency","call","noLinks","asPlainText","asTextWithSpoilers","translationKey","processed","unprocessed","undefined","includes","processPlaceholder","formatCurrency","code","renderUserContent","renderChatContent","map","user","filter","renderMessageContent","renderProductContent","renderMigratedContent","trim","renderGroupCallContent","invoice","getMessageSummaryText","messageSummary","renderMessageSummary","trimText","getUserFullName","renderText","chat","getChatTitle","placeholder","replaceValue","placeholderPosition","substring","Array","isArray","forEach","index","renderMessageText","highlight","shouldRenderHqEmoji","isSimple","truncateLength","entities","contentNotSupportedText","getMessageText","renderTextWithEntities","noEmoji","TRUNCATED_SUMMARY_LENGTH","hasSpoilers","some","emoji","getMessageSummaryEmoji","emojiWithSpace","description","getMessageSummaryDescription","RE_LETTER_OR_DIGIT","SIMPLE_MARKDOWN_REGEX","part","filters","params","compact","reduce","escapeHtml","EMOJI_REGEX","replaceEmojis","addLineBreaks","addHighlight","addLinks","replaceSimpleMarkdown","textParts","divEl","createElement","result","innerText","innerHTML","size","IS_EMOJI_SUPPORTED","parts","fixNonStandardEmoji","emojis","emojiResult","nativeToUnified","removeVS16s","src","alt","splittenParts","line","source","trimmedLine","trimLeft","indentLength","repeat","lowerCaseText","toLowerCase","queryPosition","nextSymbol","newParts","RE_LINK","RE_LINK_TEMPLATE","RE_MENTION_TEMPLATE","links","nextLink","shift","lastIndex","startsWith","username","endsWith","entityResult","entity","actionsByMessageId","createClassNameBuilder","contentRef","useRef","isRevealed","reveal","conceal","useFlag","stopPropagation","actions","contentLength","current","readingMs","round","timeoutMs","max","min","useEffect","has","ref","shouldRenderAsHtml","renderMessagePart","deleteLineBreakAfterPre","organizedEntities","organizedEntityIndexes","Set","organizedEntity","organizeEntity","organizedIndexes","organizedIndex","add","organizeEntities","renderEntity","textPartStart","textPartEnd","isLastEntity","renderResult","nestedEntities","offset","textBefore","textBeforeLength","substr","entityStartIndex","entityEndIndex","entityContent","nestedEntityContent","nestedIndex","nestedEntity","nestedEntityIndex","nestedResult","nestedEntityEndIndex","newEntity","rawEntityText","renderedContent","userId","getLinkUrl","processEntityAsHtml","entityText","renderNestedMessagePart","handleBotCommandClick","handleHashtagClick","MentionLink","SafeLink","processEntity","textAfter","arrayIndex","getTextWithEntitiesAsHtml","formattedText","c","concat","parsedEntity","isChanged","sendBotCommand","command","currentTarget","setLocalTextSearchQuery","query","searchTextMessagesLocal","preventMessageInputBlur","withBubbling","IS_IOS","activeElement","EDITABLE_INPUT_ID","preventMessageInputBlurWithBubbling","withGlobal","global","userOrChat","selectUser","openChatByUsername","onContextMenu","onMouseDown","onMouseEnter","onMouseLeave","onFocus","color","backgroundImage","pill","fluid","isText","isLoading","ariaLabel","download","disabled","ripple","faded","tabIndex","withClickPropagation","elementRef","isClicked","setIsClicked","useState","fullClassName","handleMouseDown","style","label","subLabel","checked","blocking","onChange","onCheck","useLang","handleChange","event","trigger","positionX","positionY","footer","forceOpen","onOpen","onClose","menuRef","dropdownRef","isOpen","setIsOpen","onKeyDown","menu","keyCode","focusedElement","elementChildren","from","focus","onTrigger","containerRef","autoClose","shouldSkipTransition","success","readOnly","autoComplete","inputMode","maxLength","onInput","onKeyPress","onBlur","onPaste","labelText","htmlFor","backgroundColor","bubbleStyle","transformOriginX","transformOriginY","noCloseOnBackdrop","noCompact","onCloseAnimationEnd","backdropContainerRef","transitionClassNames","useShowTransition","captureEscKeyListener","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","dispatchHeavyAnimationEvent","handleKeyDown","useKeyboardListNavigation","useVirtualBackdrop","bubbleClassName","transformOriginYStyle","transformOriginXStyle","IS_COMPACT_MENU","IS_BACKDROP_BLUR_SUPPORTED","props","icon","destructive","origin","role","ripples","setRipples","cleanUpDebounced","useMemo","debounce","button","container","position","getBoundingClientRect","rippleSize","offsetWidth","x","clientX","y","clientY","requestAnimationFrame","APP_NAME","APP_VERSION","process","DEBUG_MORE","IS_TEST","DEBUG_ALERT_MSG","PAGE_TITLE","INACTIVE_MARKER","DEBUG_PAYMENT_SMART_GLOCAL","SESSION_USER_KEY","LEGACY_SESSION_KEY","GLOBAL_STATE_CACHE_DISABLED","GLOBAL_STATE_CACHE_KEY","GLOBAL_STATE_CACHE_USER_LIST_LIMIT","GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT","GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT","MEDIA_CACHE_DISABLED","MEDIA_CACHE_NAME","MEDIA_CACHE_NAME_AVATARS","MEDIA_PROGRESSIVE_CACHE_NAME","CUSTOM_BG_CACHE_NAME","LANG_CACHE_NAME","AUTODOWNLOAD_FILESIZE_MB_LIMITS","isBigScreen","innerHeight","MIN_PASSWORD_LENGTH","MESSAGE_LIST_SLICE","MESSAGE_LIST_VIEWPORT_LIMIT","CHAT_HEIGHT_PX","CHAT_LIST_SLICE","CHAT_LIST_LOAD_SLICE","SHARED_MEDIA_SLICE","MESSAGE_SEARCH_SLICE","GLOBAL_SEARCH_SLICE","MEMBERS_SLICE","MEMBERS_LOAD_SLICE","PROFILE_SENSITIVE_AREA","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","DEFAULT_VOLUME","DEFAULT_PLAYBACK_RATE","ANIMATION_LEVEL_MIN","ANIMATION_LEVEL_MAX","ANIMATION_LEVEL_DEFAULT","DEFAULT_MESSAGE_TEXT_SIZE_PX","IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","DRAFT_DEBOUNCE","SEND_MESSAGE_ACTION_INTERVAL","EDITABLE_INPUT_MODAL_ID","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","MOBILE_SCREEN_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT","LOCAL_MESSAGE_ID_BASE","TMP_CHAT_ID","ANIMATION_END_DELAY","FAST_SMOOTH_MAX_DISTANCE","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","STICKER_SIZE_INLINE_DESKTOP_FACTOR","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_AUTH","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_PICKER","STICKER_SIZE_GENERAL_SETTINGS","STICKER_SIZE_PICKER_HEADER","STICKER_SIZE_SEARCH","STICKER_SIZE_MODAL","STICKER_SIZE_TWO_FA","STICKER_SIZE_DISCUSSION_GROUPS","STICKER_SIZE_FOLDER_SETTINGS","STICKER_SIZE_INLINE_BOT_RESULT","STICKER_SIZE_JOIN_REQUESTS","STICKER_SIZE_INVITES","NO_STICKER_SET_ID","BASE_EMOJI_KEYWORD_LANG","MENU_TRANSITION_DURATION","SLIDE_TRANSITION_DURATION","VIDEO_MOV_TYPE","SUPPORTED_IMAGE_CONTENT_TYPES","SUPPORTED_VIDEO_CONTENT_TYPES","CONTENT_TYPES_WITH_PREVIEW","CONTENT_NOT_SUPPORTED","COUNTRIES_WITH_12H_TIME_FORMAT","SERVICE_NOTIFICATIONS_USER_ID","REPLIES_USER_ID","ALL_FOLDER_ID","ARCHIVED_FOLDER_ID","MAX_MEDIA_FILES_FOR_ALBUM","MAX_ACTIVE_PINNED_CHATS","SCHEDULED_WHEN_ONLINE","DEFAULT_LANG_CODE","DEFAULT_LANG_PACK","LANG_PACKS","TIPS_USERNAME","LOCALIZED_TIPS","FEEDBACK_URL","LIGHT_THEME_BG_COLOR","DARK_THEME_BG_COLOR","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","GROUP_CALL_VOLUME_MULTIPLIER","GROUP_CALL_DEFAULT_VOLUME","ENABLE_THUMBNAIL_VIDEO","cb","dependencies","debugKey","prevDeps","usePrevious","initial","setValue","setTrue","setFalse","setTrigger","ANIMATION_START_EVENT","ANIMATION_END_EVENT","timeout","isAnimating","isHeavyAnimating","duration","onEnd","clearTimeout","dispatchEvent","Event","handleAnimationStart","handleAnimationEnd","isDisabled","removeEventListener","LOCATION_HASH","hash","PATH_BASE","pathname","search","historyState","currentIndex","nextStateIndexToReplace","isHistoryAltered","isEdge","currentIndexes","disableHistoryBack","handleTouchEnd","isActive","onBack","onForward","currentState","shouldReplaceNext","hashes","indexRef","isForward","prevIsActive","isClosed","indexHashRef","prevHashes","isHashChangedFromEvent","isForceClose","prev","history","pushState","state","last","realDelta","indexLast","findIndex","l","go","replaceState","back","handlePopState","currIndex","disableHistoryAnimations","hasChanged","areSortedArraysEqual","forceClose","touches","pageX","innerWidth","onSelectWithEnter","itemSelector","noCaptureFocus","focusedIndex","setFocusedIndex","element","querySelectorAll","newIndex","item","forceUpdate","useForceUpdate","useOnChange","langProvider","bundleName","moduleName","noLoad","autoUpdate","module","getModuleFromMemory","addLoadListener","loadModule","d","next","shouldSkipUndefined","onCloseTransitionEnd","noOpenTransition","noCloseTransition","setIsClosed","closeTimeoutRef","hasOpenClassName","setHasOpenClassName","exec","shouldHaveOpenClassName","isClosing","shouldRender","handleEvent","contains","classList","NON_BUBBLEABLE_EVENTS","documentEventCounters","delegationRegistryByEventType","delegatedEventTypesByElement","propName","handler","asCapture","eventType","resolveEventType","canUseEventDelegation","addDelegatedListener","removeDelegatedListener","tagName","realEventType","resolveDelegationRegistry","existing","newSet","resolveDelegatedEventTypes","removeAllDelegatedListeners","eventTypes","realEvent","events","furtherCallsPrevented","Proxy","p","Reflect","body","parentNode","documentListenersCount","keys","delegatedHandlersCount1","values","acc","counter","delegationRegistriesCount","delegatedHandlersCount2","delegationRegistry","delegationElementsCount","delegatedEventTypesCount","FILTERED_ATTRIBUTES","HTML_ATTRIBUTES","MAPPED_ATTRIBUTES","autoPlay","headsByElement","renderWithVirtual","parentEl","$current","$new","$parent","skipComponentUpdate","forceIndex","fragment","moveDirection","isCurrentComponent","isComponentElement","isNewComponent","hasElementChanged","updateComponent","componentInstance","isMounted","setupComponentUpdateListener","initComponent","node","createNode","setTarget","childNodes","insertBefore","appendChild","removeChild","getTarget","unmountTree","replaceChild","areComponents","isRealElement","nextSibling","updateAttributes","renderChildren","$element","mountComponent","$firstChild","renderComponent","isEmptyElement","createTextNode","isTextElement","tag","entries","key","setAttribute","$child","currentEl","teactFastList","newKeys","$newChild","currentRemainingIndex","remainingByKey","$currentChild","isKeyPresent","newChildKey","order","teactOrderKey","fragmentQueue","fragmentIndex","newChildren","currentPreservedIndex","currentChildInfo","flushFragmentQueue","shouldMoveNode","isMovingDown","renderFastListChildren","currentChildrenLength","newChildrenLength","createDocumentFragment","$fragmentChild","currentEntries","newEntries","currentValue","newValue","cssText","removeAttribute","__html","render","headId","getAttribute","$head","VirtualElementTypesEnum","Fragment","Symbol","DEBUG_SILENT_RENDERS_FOR","renderingInstance","Empty","Text","isTagElement","Tag","Component","flatten","createComponentInstance","buildTagElement","parsedChildren","hooks","cursor","byCursor","effects","memos","buildComponentElement","dropEmptyTail","buildChildElement","isEmptyPlaceholder","child","DEBUG_components","newRenderedValue","DEBUG_startAt","componentName","renderCount","renderTimes","performance","handleError","renderedValue","newChild","$old","memoContainer","cleanup","hook","effect","nextValue","setter","helpGc","prepareComponentForFrame","prepareForFrame","throttleWithPrimaryRaf","throttleWithRaf","forceUpdateComponent","currentElement","DEBUG_contentComponentName","useLayoutEffectBase","schedulerFn","primarySchedulerFn","execCleanup","dependency","causedBy","res","prevValue","fastRaf","fastRafPrimary","useLayoutEffect","onTickEnd","onTickEndPrimary","resolver","getUnequalProps","newCallback","orderBy","React","currentGlobal","reducers","callbacks","containers","mapStateToProps","ownProps","mappedProps","newMappedProps","Number","isNaN","DEBUG_componentName","arePropsShallowEqual","areMappedPropsChanged","DEBUG_updates","updateTime","runCallbacksThrottled","throttleWithTickEnd","runCallbacks","forceOnHeavyAnimation","setGlobal","newGlobal","forceSyncOnIOs","getGlobal","addReducer","reducer","onDispatch","addCallback","removeCallback","TeactNContainer","vs16RegExp","zeroWidthJoiner","rawEmoji","importLegacySession","clearLegacySessions","apiUpdate","userAgent","navigator","PLATFORM_ENV","sessionData","loadStoredSession","isTest","isMovSupported","IS_MOV_SUPPORTED","isWebmSupported","IS_WEBM_SUPPORTED","phoneNumber","authIsLoading","authError","password","file","firstName","lastName","authIsLoadingQrCode","storeSession","currentUserId","clearStoredSession","unsubscribe","forceWebsync","reset","cacheApi","langCachePrefix","langCacheVersion","updateAppBadge","init","connectionState","authNearestCountry","deviceToken","subscribedAt","buildInputPrivacyRules","visibility","allowedIds","deniedIds","users","byId","usersById","chats","chatsById","rules","collectUsers","isUserId","collectChats","allowedUsers","allowedChats","blockedUsers","blockedChats","photo","bio","about","profileEdit","progress","ProfileEditProgress","currentUser","updateUser","fullInfo","isUsernameAvailable","settings","loadedWallpapers","wallpapers","createObjectURL","slug","UPLOADING_WALLPAPER_SLUG","wallpaper","firstWallpaper","withLocalMedia","addUsers","buildCollectionByKey","updateChats","blocked","ids","blockedIds","totalCount","contactId","addBlockedContact","removeBlockedContact","activeSessions","session","isCurrent","serverTimeOffset","addNotifyExceptions","replaceSettings","peerType","isSilent","shouldShowPreviews","updateNotifySettings","hasPushNotifications","hasWebNotifications","byKey","subscribe","hasContactJoinedNotifications","languages","phoneNumberSettings","lastSeenSettings","profilePhotoSettings","forwardsSettings","chatInviteSettings","all","privacy","lastSeen","profilePhoto","forwards","chatInvite","privacyKey","allowUserIds","allowChatIds","blockUserIds","blockChatIds","isAllowList","contactsIds","isSensitiveEnabled","langCode","language","countryList","timeFormat","setSettingOption","setTimeFormat","wasTimeFormatSetManually","nearestCountryCode","appConfig","selectNotifySettings","setLanguage","onUpdateApiReady","wasAuthReady","authState","authorizationState","isLoggingOut","authIsCodeViaApp","isCodeViaApp","authHint","hint","authQrCode","qrCode","onUpdateAuthorizationState","onUpdateAuthorizationError","signOut","onUpdateConnectionState","authRememberMe","isEmpty","mainDcId","saveSession","onUpdateSession","onUpdateServerTimeOffset","sessionUserAuth","localStorage","getItem","userAuth","JSON","parse","setItem","stringify","updateSessionUserId","onUpdateCurrentUser","paymentShippingError","getShippingError","addPaymentError","showDialog","handleSystemThemeChange","currentThemeMatch","documentElement","currentTheme","nextTheme","selectTheme","animationLevel","switchTheme","mql","matchMedia","addListener","subscribeToSystemThemeChange","messageTextSize","theme","setProperty","toString","IS_TOUCH_ENV","ensurePermanentWebVersion","startWebsync","IS_ANDROID","IS_MAC_OS","IS_SAFARI","uiReadyState","remove","authPhoneNumber","shouldSkipHistoryAnimations","replaceThemeSettings","FOREVER_BANNED_DATE","VERIFIED_PRIORITY_BASE","PINNED_PRIORITY_BASE","entityId","isChatGroup","isChatBasicGroup","isChatSuperGroup","isChatChannel","isCommonBoxChat","isChatWithRepliesBot","getChatTypeString","getPrivateChatUserId","isSelf","getChatDescription","getChatLink","inviteLink","getChatAvatarHash","owner","avatarHash","isChatSummaryOnly","lastMessage","isChatAdmin","adminRights","getHasAdminRight","isUserRightBanned","currentUserBannedRights","defaultBannedRights","getCanPostInChat","threadId","isRestricted","migratedTo","isNotJoined","isCreator","getAllowedAttachmentOptions","isChatWithBot","canAttachMedia","canAttachPolls","canSendStickers","canSendGifs","canAttachEmbedLinks","isAdmin","getMessageSendingRestrictionReason","sendMessages","untilDate","formatDateToString","formatTime","getChatSlowModeOptions","slowMode","isChatArchived","folderId","selectIsChatMuted","notifySettings","notifyExceptions","isMuted","hasPrivateChatsNotifications","hasBroadcastNotifications","hasGroupNotifications","selectShouldShowMessagePreview","hasPrivateChatsMessagePreview","hasBroadcastMessagePreview","hasGroupMessagePreview","getCanDeleteChat","getFolderDescriptionText","folder","chatsCount","emoticon","pinnedChatIds","excludedChatIds","includedChatIds","excludeArchived","excludeMuted","excludeRead","bots","groups","channels","contacts","nonContacts","getMessageSenderName","getUserFirstOrLastName","sortChatIds","chatIds","shouldPrioritizeVerified","priorityIds","priority","date","isVerified","filterChatsByName","searchWords","prepareSearchWordsForNeedle","getMessageKey","msgId","buildMessageKey","parseMessageKey","getMessageOriginalId","previousLocalId","sticker","video","audio","voice","poll","webPage","contact","getMessageCustomShape","isRound","parseEmojiOnlyString","getMessageSingleEmoji","getFirstLinkInMessage","link","find","isOwnMessage","isOutgoing","isReplyMessage","replyToMessageId","isForwardedMessage","forwardInfo","isActionMessage","isServiceNotificationMessage","isAnonymousOwnMessage","senderId","getSenderTitle","getSendingState","sendingState","isMessageLocal","isHistoryClearMessage","getMessageContentFilename","isLottie","isGif","isWebpSupported","baseFilename","IS_OPUS_SUPPORTED","areReactionsEmpty","reactions","results","count","SPOILER_CHARS","noReactions","isExtended","getMessageTextWithSpoilers","accText","spoiler","fill","random","generateBrailleSpoiler","groupedId","reaction","getMessageRecentReaction","truncatedText","summary","getMessageAudioCaption","question","performer","getMessageContent","hasMessageMedia","getMessagePhoto","getMessageVideo","getMessageDocument","getMessageSticker","getMessageContact","getMessagePoll","getMessageAction","getMessageAudio","getMessageVoice","getMessageRoundVideo","isMessageDocumentPhoto","mediaType","isMessageDocumentVideo","getMessageInvoice","getMessageWebPage","getMessageWebPagePhoto","getMessageWebPageVideo","getMessageMediaThumbDataUri","media","getMessageMediaThumbnail","dataUri","getMessageMediaHash","webPagePhoto","webPageVideo","messageVideo","messagePhoto","mediaId","hasMessageLocalBlobUrl","getVideoOrAudioBaseHash","getAudioHasCover","IS_PROGRESSIVE_SUPPORTED","thumbnailSizes","getMessageMediaFormat","fullVideo","getMessageFileName","getMessageFileSize","blobUrl","getChatMediaMessageIds","messages","listedIds","isFromSharedMedia","getMessageContentIds","getPhotoFullDimensions","sizes","getPhotoInlineDimensions","getVideoDimensions","width","height","getMediaTransferState","isLoadNeeded","isUploading","isTransferring","transferProgress","messageIds","contentType","validator","matchLinkInMessageText","getMediaDuration","buildChatThreadKey","STRIPE_ERRORS","missing_payment_information","field","invalid_number","number","exp_year","exp_month","invalid_expiry_year","invalid_expiry_month","cvc","invalid_cvc","getStripeError","param","recentReactions","checkIfReactionAdded","oldReactions","newReactions","oldReactionsMap","r","USER_COLOR_KEYS","isDeletedUser","getUserStatus","userStatus","wasOnline","getTime","wasOnlineDate","diff","today","setHours","yesterday","setDate","getDate","formatFullDate","isUserOnline","noStatus","isUserBot","getCanAddContact","isContact","sortUserIds","userIds","userStatusesById","getServerTime","expires","filterUsersByName","savedMessagesLang","getUserIdDividend","abs","getUserColorKey","peer","replaceChatListIds","newIds","listIds","updateChatListIds","idsUpdate","replaceChats","newById","updateChat","chatUpdate","updatedChat","getUpdatedChat","updatedById","addChats","isUpdated","addedById","isMin","shouldOmitMinInfo","omit","photos","updateChatListType","listType","currentListIds","listTypeKey","currentFolderList","updateChatListSecondaryInfo","info","totalCountKey","orderedPinnedIds","totalChatCount","isFullyLoaded","leaveChat","leftChatId","selectChatListType","listId","updateStickerSets","category","sets","resultIds","updatedSets","stickerSet","stickers","setsById","setIds","updateStickerSet","stickerSetId","currentStickerSet","addedSets","added","installedDate","updateGifSearch","isNew","nextOffset","currentResults","gifs","newResults","currentIds","gif","replaceAnimatedEmojis","animatedEmojis","updateStickersForEmoji","remoteStickers","allStickers","selectStickersForEmoji","uniqueIds","unique","forEmoji","rebuildStickersForEmoji","replaceUsers","updateContactList","updatedUsers","contactUserIds","contactList","newContactUserIds","userUpdate","updatedUser","getUpdatedUser","updateUsers","deleteContact","MEMO_EMPTY_ARRAY","updateUserSearch","searchStatePartial","userSearch","updateUserSearchFetchingStatus","newState","fetchingStatus","updateUserBlockedState","isBlocked","replaceUserStatuses","statusesById","addUserStatuses","pick","getComplexKey","updateGlobalSearch","globalSearch","updateGlobalSearchContent","currentContent","updateGlobalSearchResults","newFoundMessages","nextRate","resultsByType","newFoundMessagesById","foundIdsForType","foundIds","every","newId","updateGlobalSearchFetchingStatus","prevFoundIds","newFoundIds","prototype","foundOrPrevFoundIds","nextOffsetId","replaceLocalTextSearch","chatThreadKey","searchParams","localTextSearch","byChatThreadKey","updateLocalTextSearch","replaceLocalTextSearchResults","updateLocalTextSearchResults","orderFoundIds","replaceLocalMediaSearch","localMediaSearch","byChatId","updateLocalMediaSearchType","currentType","updateLocalMediaSearchResults","replaceLocalMediaSearchResults","sort","a","b","updateManagementProgress","management","updateManagement","newSettings","themes","notifyException","exceptionData","addNotifyException","updateTwoFaSettings","twoFaSettings","updateShippingOptions","shippingOptions","payment","setRequestInfoId","requestId","setPaymentStep","step","setInvoiceMessageInfo","photoUrl","invoiceContent","setStripeCardInfo","cardInfo","stripeCredentials","setSmartGlocalCardInfo","smartGlocalCredentials","setPaymentForm","form","setConfirmPaymentUrl","confirmPaymentUrl","setReceipt","receipt","messageInvoice","clearPayment","closeInvoice","isPaymentModalOpen","updateCurrentMessageList","shouldReplaceHistory","messageLists","newMessageLists","replaceChatMessages","updateMessageStore","threadsById","replaceThreadParam","paramName","threadUpdate","updateThread","addMessages","addedByChatId","messagesByChatId","addChatMessagesById","selectChatMessages","updateChatMessage","messageUpdate","updatedMessage","updateScheduledMessage","selectScheduledMessages","replaceScheduledMessages","deleteChatMessages","deletedForwardedPosts","pickTruthy","isLinkedChannelPost","threadInfo","selectThreadInfo","selectListedIds","outlyingIds","selectOutlyingIds","viewportIds","selectViewportIds","pinnedIds","selectPinnedIds","newMessageCount","messagesCount","currentMessageList","selectCurrentMessageList","canDeleteCurrentThread","currentThreadId","fromChatId","fromMessageId","originalPost","selectChatMessage","deleteChatScheduledMessages","scheduledIds","selectScheduledIds","updateListedIds","orderHistoryIds","updateOutlyingIds","addViewportId","safeReplaceViewportIds","newViewportIds","updateThreadInfo","newThreadInfo","updateThreadInfos","updates","scheduledMessages","updateScheduledMessages","updateFocusedMessage","noHighlight","isResizingContainer","focusedMessage","updateSponsoredMessage","sponsoredByChatId","updateFocusDirection","direction","enterMessageSelectMode","selectedMessages","toggleMessageSelection","messageListType","childMessageIds","withShift","oldSelectedMessages","selectMessageIdsByGroupId","selectedMessageIds","newMessageIds","newSelectedMessageIds","selectCurrentMessageIds","prevIndex","to","exitMessageSelectMode","updateThreadUnreadFromForwardedMessage","originMessage","lastMessageId","isDeleting","channelPostId","threadInfoOld","selectChat","selectChatUser","selectIsChatWithSelf","selectIsChatWithBot","selectSupportChat","isSupport","selectChatOnlineCount","members","onlineCount","selectChatBot","selectIsChatBotNotStarted","bot","messageInfo","selectAreActiveChatsLoaded","active","selectIsChatListed","targetList","list","selectChatFolder","chatFolders","selectIsChatPinned","archived","chatFoldersById","selectChatByUsername","usernameLowered","selectIsServiceChatReady","selectSendAs","sendAsId","selectCurrentStickerSearch","selectCurrentGifSearch","selectStickerSet","selectStickerSetByShortName","shortName","stickerSets","stickersForEmoji","favorite","packs","cleanEmoji","selectAnimatedEmoji","cleanedEmoji","selectAnimatedEmojiEffect","animatedEmojiEffects","selectAnimatedEmojiSound","emojiSounds","selectLocalAnimatedEmoji","selectLocalAnimatedEmojiEffect","selectLocalAnimatedEmojiEffectByName","selectCurrentChat","selectThreadParam","thread","selectScrollOffset","selectReplyingToId","selectEditingId","selectEditingScheduledId","selectDraft","selectNoWebPage","selectFirstMessageId","selectReplyStack","selectThreadOriginChat","originChannelId","selectThreadTopMessageId","topMessageId","selectThreadByMessage","replyToTopMessageId","isMessageInCurrentMessageList","selectIsViewportNewest","chatMessages","selectScheduledMessage","selectEditingMessage","selectChatMessageByPollId","pollId","messageWithPoll","selectFocusedMessageId","focusedChatId","selectIsMessageFocused","focusedId","selectIsMessageUnread","lastReadOutboxMessageId","selectOutgoingStatus","isScheduledList","selectSender","selectForwardedSender","isChannelPost","senderUserId","selectAllowedMessageActions","isPrivate","isChatWithSelf","isBasicGroup","isSuperGroup","isChannel","isLocal","isServiceNotification","isOwn","isAction","isMessageEditable","viaBotId","canReply","hasPinPermission","canPin","canUnpin","pinnedMessageIds","canDelete","canReport","canDeleteForAll","canEdit","canForward","hasSticker","hasFavoriteSticker","selectIsStickerFavorite","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","canDownload","noOptions","ability","selectCanDeleteSelectedMessages","messageActions","selectCanReportSelectedMessages","selectCanDownloadSelectedMessages","selectIsDownloading","activeInChat","activeDownloads","selectActiveDownloadIds","selectUploadProgress","fileUploads","byMessageLocalId","selectRealLastReadId","lastReadInboxMessageId","Infinity","selectFirstUnreadId","lastReadId","lastReadServiceNotificationId","serviceNotifications","notification","isUnread","findAfterLastReadId","isFromScheduled","found","selectIsForwardModalOpen","forwardMessages","isModalShown","selectCommonBoxChatId","fromLastMessage","selectIsInSelectMode","selectIsMessageSelected","selectForwardedMessageIdsByGroupId","selectIsDocumentGroupSelected","selectedIds","groupIds","selectSelectedMessagesCount","selectNewestMessageWithBotKeyboardButtons","findLast","keyboardButtons","replyHideMessageId","shouldHideKeyboardButtons","selectCanAutoLoadMedia","isPhoto","isVideo","isFile","canAutoLoadPhotoFromContacts","canAutoLoadPhotoInPrivateChats","canAutoLoadPhotoInGroups","canAutoLoadPhotoInChannels","canAutoLoadVideoFromContacts","canAutoLoadVideoInPrivateChats","canAutoLoadVideoInGroups","canAutoLoadVideoInChannels","canAutoLoadFileFromContacts","canAutoLoadFileInPrivateChats","canAutoLoadFileInGroups","canAutoLoadFileInChannels","canAutoLoadMedia","canAutoLoadMediaFromContacts","canAutoLoadMediaInPrivateChats","canAutoLoadMediaInGroups","canAutoLoadMediaInChannels","isMediaFromContact","selectIsUserOrChatContact","selectCanAutoPlayMedia","canAutoPlayVideos","canAutoPlayGifs","asGif","selectShouldLoopStickers","shouldLoopStickers","selectLastServiceNotification","maxId","selectIsMessageProtected","isProtected","selectHasProtectedMessage","selectSponsoredMessage","expiresAt","selectDefaultReaction","defaultReaction","availableReactions","isInactive","enabledReactions","selectVisibleUsers","selectCurrentTextSearch","currentSearch","selectCurrentMediaSearch","selectManagement","selectCurrentManagementType","selectIsMediaViewerOpen","mediaViewer","avatarOwnerId","selectRightColumnContentKey","pollResults","selectIsPollResultsOpen","RightColumnContent","IS_SINGLE_COLUMN_LAYOUT","currentManagement","selectCurrentManagement","newChatMembersProgress","NewChatMembersProgress","isChatInfoShown","selectIsRightColumnShown","shouldUseSystemTheme","getSystemTheme","selectCurrentGlobalSearchQuery","selectPaymentChatId","selectPaymentMessageId","selectPaymentFormId","formId","selectPaymentRequestId","selectProviderPublishableKey","nativeParams","publishableKey","selectProviderPublicToken","publicToken","selectStripeCredentials","selectSmartGlocalCredentials","selectNotifyExceptions","selectUserStatus","selectIsUserBlocked","LoadMoreDirection","FocusDirection","SettingsScreens","LeftColumnContent","GlobalSearchContent","MediaViewerOrigin","AudioOrigin","ChatCreationProgress","ManagementProgress","ProfileState","PaymentStep","ManagementScreens","currentInstance","animateSingle","tick","instance","isCancelled","animate","timingFunctions","linear","easeIn","easeOut","easeInOut","sin","PI","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","animateNumber","timing","t0","canceled","f","unreadCount","setAppBadge","currentProps","newProps","currentKeys","currentKeysLength","prop","elementName","baseName","modifiers","modifier","self","caches","Type","fetch","cacheName","isHtmlAllowed","request","Request","cache","open","headers","Blob","blob","shouldRecreate","resolvedType","Json","json","save","cacheData","Response","put","clear","createCallbackManager","hasCallbacks","captureKeyboardListener","onEsc","keyToHandlerName","Enter","Backspace","Delete","Esc","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","handlers","onEnter","onDelete","onBackspace","onUp","onDown","onLeft","onRight","onTab","captureKeyboardListeners","hasActiveHandlers","handlerName","currentEventHandlers","releaseKeyboardListener","keyHandlers","WEEKDAYS_FULL","MONTHS_FULL","MONTHS_FULL_LOWERCASE","month","MILLISECONDS_IN_DAY","isToday","getDayStart","datetime","getDayStartAt","toYearMonth","timestamp","getFullYear","getMonth","toIsoString","hours","getHours","marker","padStart","getMinutes","formatPastTimeShort","weekAgo","getDay","withYear","format","formatDate","formatMonthAndYear","isShort","formatCountdown","msLeft","days","formatMediaDuration","formatHumanDate","noWeekdays","isUpperFirst","upperFirst","lowerFirst","weekAhead","weekDay","formatKey","day","monthIndex","formatMediaDateTime","maxValue","minutes","seconds","maxHours","maxMinutes","string","formatVoiceRecordDuration","durationInMs","milliseconds","locale","toLocaleString","year","formatDateTimeToString","hour","minute","second","isValidDate","MAX_MONTH_IN_YEAR","parseDateString","matchStringDate","matchEuropeStringDate","matchNumberDate","dateParts","timestampPlusDay","str","EXCLUDE_EMOJIS","EMOJI_EXCEPTIONS","unifiedToNative","unified","codePoints","parseInt","fromCodePoint","regex","replacement","pairs","uncompressEmoji","emojiData","categories","emojiRaw","names","native","image","isoToEmoji","iso","test","codePointAt","isWebpSupportedCache","webp","Image","handleLoadOrError","onload","onerror","hasWebp","systemThemeCache","matches","os","getPlatform","IS_PWA","standalone","referrer","IS_TABLET_COLUMN_LAYOUT","IS_VOICE_RECORDING_SUPPORTED","mediaDevices","AudioContext","webkitAudioContext","IS_SERVICE_WORKER_SUPPORTED","Audio","canPlayType","IS_CANVAS_FILTER_SUPPORTED","getContext","IS_REQUEST_FULLSCREEN_SUPPORTED","ARE_CALLS_SUPPORTED","LAYERS_ANIMATION_NAME","TEST_VIDEO","DPR","devicePixelRatio","MASK_IMAGE_DISABLED","CSS","supports","IS_SCROLL_PATCH_NEEDED","MESSAGE_LIST_SENSITIVE_AREA","dataUriToBlob","arr","mime","bstr","atob","u8arr","Uint8Array","blobToDataUri","reader","FileReader","readAsDataURL","blobToFile","File","lastModified","preloadImage","img","preloadVideo","volume","onloadedmetadata","createPosterForVideo","onseeked","videoWidth","videoHeight","canvas","drawImage","toDataURL","currentTime","fetchBlob","fetchFile","imgToCanvas","constructor","fileBits","rest","super","this","initials","buildInitials","prevGlobal","prepared","updateFolderManagerThrottled","throttle","onIdle","updateFolderManager","inited","getOrderedIds","orderedIdsByFolderId","getPinnedChatsCount","pinnedCountByFolderId","getChatsCount","chatsCountByFolderId","getUnreadCounters","unreadCountersByFolderId","getAllNotificationsCount","notificationsCount","addOrderedIdsCallback","addChatsCountCallback","addUnreadCountersCallback","DEBUG_startedAt","isAllFolderChanged","isMainFolderChanged","isArchivedFolderChanged","isAllFullyLoadedChanged","isAllFolderFullyLoaded","isArchivedFullyLoadedChanged","isArchivedFolderFullyLoaded","areFoldersChanged","foldersById","areChatsChanged","areUsersChanged","areNotifySettingsChanged","areNotifyExceptionsChanged","affectedFolderIds","emptyFolderIds","folderSummariesById","updateFullyLoaded","updateResults","prevAllFolderListIds","allFolderListIds","prevArchivedFolderListIds","archivedFolderListIds","changedFolders","newListIds","newPinnedIds","buildFolderSummaryFromMainList","allFolderPinnedIds","archivedFolderPinnedIds","newFoldersById","buildFolderSummary","updateFolders","newChatsById","newUsersById","newNotifySettings","newNotifyExceptions","folderSummaries","newAllFolderListIds","newArchivedFolderListIds","allIds","newFolderIds","currentSummary","chatSummariesById","newSummary","unreadMentionsCount","hasUnreadMark","joinDate","draftDate","userInfo","isListed","isArchived","isUserContact","buildChatSummary","chatSummary","folderSummary","isChatInFolder","buildChatFolderIds","currentFolderIds","folderIdsByChatId","deletedFolderIds","currentFolderIdsSet","newFolderIdsSet","currentFolderOrderedIds","chatIdsByFolderId","isOrderedListJustPatched","updateListsForChat","currentPinnedIds","wasUnreadCountersChanged","wasChatsCountChanged","pinnedCount","newPinnedCount","orderedIds","newOrderedIds","prevOrderedIds","sortedPinnedIds","allListIds","sortedNotPinnedIds","chatId1","chatId2","buildFolderOrderedIds","currentOrderedIds","currentPinnedCount","currentChatsCount","newChatsCount","currentUnreadCounters","newUnreadCounters","buildFolderUnreadCounters","newInitials","totalPrice","Intl","NumberFormat","store","hasOwnProperty","READABLE_ERROR_MESSAGES","CHAT_RESTRICTED","CHAT_WRITE_FORBIDDEN","CHAT_SEND_POLL_FORBIDDEN","CHAT_SEND_STICKERS_FORBIDDEN","CHAT_SEND_GIFS_FORBIDDEN","CHAT_SEND_MEDIA_FORBIDDEN","CHAT_LINK_EXISTS","SLOWMODE_WAIT_X","USER_BANNED_IN_CHANNEL","USER_IS_BLOCKED","YOU_BLOCKED_USER","IMAGE_PROCESS_FAILED","MEDIA_EMPTY","MEDIA_INVALID","PHOTO_EXT_INVALID","PHOTO_INVALID_DIMENSIONS","PHOTO_SAVE_FILE_INVALID","MESSAGE_DELETE_FORBIDDEN","MESSAGE_POLL_CLOSED","MESSAGE_EDIT_TIME_EXPIRED","CHAT_ADMIN_REQUIRED","PINNED_DIALOGS_TOO_MUCH","DIALOG_FILTERS_TOO_MUCH","CHANNEL_PRIVATE","MEDIA_CAPTION_TOO_LONG","ADDRESS_STREET_LINE1_INVALID","ADDRESS_STREET_LINE2_INVALID","ADDRESS_CITY_INVALID","ADDRESS_COUNTRY_INVALID","ADDRESS_POSTCODE_INVALID","ADDRESS_STATE_INVALID","REQ_INFO_NAME_INVALID","REQ_INFO_PHONE_INVALID","REQ_INFO_EMAIL_INVALID","LINK_NOT_MODIFIED","MESSAGE_TOO_LONG","SERVICE_WORKER_DISABLED","MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS","FRESH_RESET_AUTHORISATION_FORBIDDEN","BOTS_TOO_MUCH","BOT_GROUPS_BLOCKED","USERS_TOO_MUCH","USER_CHANNELS_TOO_MUCH","USER_KICKED","USER_NOT_MUTUAL_CONTACT","USER_PRIVACY_RESTRICTED","INVITE_HASH_EMPTY","INVITE_HASH_EXPIRED","INVITE_HASH_INVALID","CHANNELS_TOO_MUCH","USER_ALREADY_PARTICIPANT","SCHEDULE_DATE_INVALID","WALLPAPER_DIMENSIONS_INVALID","ADMINS_TOO_MUCH","ADMIN_RANK_EMOJI_NOT_ALLOWED","ADMIN_RANK_INVALID","FRESH_CHANGE_ADMINS_FORBIDDEN","INPUT_USER_DEACTIVATED","BOT_PRECHECKOUT_TIMEOUT","SHIPPING_ERRORS","getReadableErrorText","isSlowMode","textParams","extraPartIndex","errorMessage","handleErrorEvent","ErrorEvent","reason","alert","collection","member","mapValues","newByKey","object","stringKeys","orderRule","mode","compareValues","currentOrderRule","isAsc","aValue","bValue","mode1","mode2","orderRule1","orderRule2","isAsc1","isAsc2","array","array1","array2","areSortedArraysIntersecting","findIntersectionWithSet","chunkSize","cloneDeep","predicate","SUBSTITUTION_REGEX","PLURAL_OPTIONS","PLURAL_RULES","en","ar","ca","de","es","fa","fr","it","ko","ms","nl","pl","pt_BR","ru","tr","uk","uz","langPack","fallbackLangPack","currentLangCode","currentTimeFormat","getTranslation","cacheValue","cached","langString","processTranslation","importFallbackLangPack","getTranslationForLangString","translateString","remoteLangPack","remote","fetchRemoteString","withFallback","newLangPack","fetchRemote","langInfo","rtl","default","sourceLangPacks","template","optionIndex","getPluralOption","translationSlices","initialValue","processTemplate","formatInteger","SAMPLE_RATE","oggToWav","opusData","arrayBuffer","typedArray","decoderWorker","wavWorker","onmessage","buffers","buffer","page","terminate","wavBitDepth","wavSampleRate","decoderSampleRate","outputBufferSampleRate","pages","asCacheApiType","memoryCache","fetchPromises","progressCallbacks","cancellableCallbacks","mediaFormat","onProgress","callbackUniqueId","getProgressive","fetchFromCacheOrRemote","activeCallbacks","getFromMemory","cancelProgress","parentCallback","progressiveUrl","mediaPng","webpToPng","prepareMedia","mediaSource","MediaSource","streamUrl","sourceBuffer","addSourceBuffer","makeOnProgress","revokeObjectURL","endOfStream","appendBuffer","mediaData","serviceWorker","fullSize","controller","Bundles","LOAD_PROMISES","MEMORY_CACHE","Auth","Main","Extra","Calls","bundle","getDeviceToken","subscription","toJSON","endpoint","checkIfPushSupported","ServiceWorkerRegistration","Notification","permission","soundPlayedIds","playNotifySound","notificationSoundVolume","currentVolume","once","play","playNotifySoundDebounced","requestPermission","unsubscribeFromPush","dispatch","deleteDeviceToken","serviceWorkerRegistration","ready","pushManager","getSubscription","areSettingsLoaded","checkIfShouldResubscribe","userVisibleOnly","setDeviceToken","DOMException","ABORT_ERR","notifyAboutMessage","resultSettings","resultExceptions","loadNotificationSettings","hasFocus","checkIfShouldNotify","areNotificationsSupported","activeReaction","imageHash","mediaLoader","getAvatar","messageSender","messageAction","actionTargetMessage","targetUserIds","actionTargetUserIds","actionTargetChatId","actionTargetUsers","privateChatUserId","privateChatUser","isChat","senderName","getNotificationContent","badge","vibrate","onclick","close","startActiveReaction","onshow","closeMessageNotifications","notifyClientReady","PERMANENT_VERSION_KEY","AVAILABLE_VERSIONS","setPermanentWebVersion","version","hasPermanentWebVersion","PATTERN_PLACEHOLDER","DEFAULT_PATTERN","getCountryCodesByIso","phoneCodeList","country","iso2","getCountryFromPhoneNumber","possibleCountries","countryCode","codesWithPrefix","prefixes","prefix","bestMatches","formatPhoneNumber","pattern","numberWithoutCode","patterns","defaultPattern","stripped","getBestPattern","formatPhoneNumberWithCode","numberWithPlus","createMessageHash","messageList","typeOrThreadId","parseLocationHash","isType","fn","waitingTimeout","shouldRunFirst","shouldRunLast","interval","isPending","_args","setInterval","clearInterval","throttleWith","waiting","requestIdleCallback","rafPromise","fastRafCallbacks","fastRafPrimaryCallbacks","onTickEndCallbacks","onTickEndPrimaryCallbacks","beforeUnloadCallbacks","isPrimary","currentCallbacks","currentPrimaryCallbacks","onBeforeUnload","isLast","unshift","RE_NOT_LETTER","haystack","needle","needleWords","haystackLower","haystackWords","needleWord","haystackWord","promisifyRequest","oncomplete","onsuccess","onabort","defaultGetStoreFunc","defaultGetStore","dbName","storeName","dbp","userAgentData","indexedDB","databases","tryIdb","intervalId","onupgradeneeded","createObjectStore","txMode","db","transaction","objectStore","createStore","DC_IDS","hasStoredSession","withLegacy","userAuthJson","dcID","dcId","removeItem","sessionId","sessionJson","customStore","idb","idbKeys","getAllKeys","items","openCursor","continue","eachCursor","isInitialized","HEX_COLOR_REGEX","RGB_VARIABLES","lerp","start","end","interpolationRatio","colors","themeColors","property","hexToRgb","hex","g","applyColorAnimationStep","startIndex","endIndex","propertyColors","withAnimation","isDarkTheme","shouldAnimate","startAt","themeColorTag","querySelector","transition","formatFixedNumber","formatIntegerCompact","views","getFirstLetters","phrase","word","EMPTY_IMAGE_DATA_URI","initWebpWorker","wasmReady","requests","getDecodePromise","ImageData","putImageData","toBlob","createPng","webpToPngBase64","pngBlob","handleLibWebpMessage","WEBSYNC_URLS","WEBSYNC_VERSION","WEBSYNC_KEY","getTs","lastTimeout","authed","currentTs","canRedirect","ts","script","removeElement","URLSearchParams","saveSync","clearWebsync","IS_LANDSCAPE","isLandscape","initialHeight","currentWindowSize","updateSizes","isRefreshDisabled","handleResize","visualViewport","pageTop","vh","getIsKeyboardVisible","disableRefresh","enableRefresh","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","__webpack_modules__","m","getter","__esModule","getPrototypeOf","obj","ns","create","def","getOwnPropertyNames","definition","o","defineProperty","enumerable","chunkId","promises","u","miniCssF","globalThis","Function","done","needAttach","scripts","getElementsByTagName","charset","nc","onScriptComplete","doneFns","bind","head","toStringTag","scriptUrl","importScripts","currentScript","fullhref","existingLinkTags","dataHref","existingStyleTags","findStylesheet","linkTag","errorType","realHref","createStylesheet","miniCss","baseURI","installedChunks","installedChunkData","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","handleWorkerMessage","registrations","getRegistrations","unregister","register","hasErrorKey","INITIAL_STATE","isLeftColumnShown","phoneCodes","general","groupCalls","activeChatFolder","recentEmojis","recent","greeting","featured","emojiKeywords","saved","inlineBots","byUsername","topPeers","topInlineBots","audioPlayer","playbackRate","notifications","dialogs","messageSendKeyCombo","autoLoadFileMaxSizeMb","shouldSuggestStickers","isConnectionStatusMinimized","light","isBlurred","patternColor","dark","activeReactions","shouldShowContextMenuHint","updateCacheThrottled","updateCache","unsubscribeFromBeforeUnload","isCaching","setupCaching","clearCaching","reducedGlobal","reduceShowChatInfo","reduceUsers","reduceChats","reduceMessages","recentlyFoundChatIds","reduceSettings","reduceChatFolders","reduceGroupCalls","reduceAvailableReactions","currentChatId","visibleUserIds","idsToSave","currentChat","mainThread","activeGroupCallId","isGroupCallPanelHidden","isFallbackConfirmOpen","initialState","time","timeEnd","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayVideos","shouldAutoPlayGifs","migrateCache","parsedMessageList","readCache","loadCache","STORAGE_KEY","tabKey","SITE_FONTS","preloadFonts","font","fonts","load","preloadAvatars","preloadTasks","main","reactionThumbsPath","telegramLogoPath","authCode","monkeyPath","authPassword","background","hasCustomBackground","hasCustomBackgroundColor","isRightColumnShown","leftColumnWidth","setIsUiReady","isReady","markReady","shouldRenderMask","safePreload","translation","setTranslation","getSuggestedLanguage","suggestedLanguage","MENU_HIDING_DURATION","inputRef","setFilter","filteredList","setFilteredList","updateFilter","filterValue","defaultName","getFilteredList","prevPhoneCodeList","handleInput","handleInputKeyDown","DropdownMenu","handleTrigger","select","formEl","getElementById","scrollTo","top","scrollHeight","behavior","inputValue","Spinner","MenuItem","isPreloadInitiated","setAuthPhoneNumber","setAuthRememberMe","loadNearestCountry","loadCountryList","clearAuthError","goToAuthQrCode","continueText","useLangString","setCountry","setPhoneNumber","isTouched","setIsTouched","lastSelection","setLastSelection","markIsLoading","unmarkIsLoading","fullNumber","canSubmit","parseFullNumber","newFullNumber","suggestedCountry","selectedCountry","handleLangChange","setSelectionRange","isJustPastedRef","handlePaste","handleCountryChange","handlePhoneNumberChange","selectionStart","selectionEnd","shouldFixSafariAutoComplete","handleKeepSessionChange","isAuthReady","onSubmit","InputText","Checkbox","Button","Loading","AuthCode","useModuleLoader","AuthPassword","AuthRegister","G","H","B","QrCreator","h","J","level","O","C","lineTo","arcTo","moveTo","z","v","N","K","P","fillStyle","fillRect","left","beginPath","q","D","E","R","I","F","colorStops","createLinearGradient","apply","createRadialGradient","addColorStop","A","minVersion","maxVersion","ecLevel","radius","quiet","HTMLCanvasElement","clearRect","write","S","multiply","L","M","Q","returnToAuthPhoneNumber","qrCodeRef","token","isMobile","windowSize","AuthQrCode","appInactivePath","renderMain","disconnect","markInactive","TeactDOM"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.1badc5f80faa798031b2.css.map b/dist/main.1badc5f80faa798031b2.css.map deleted file mode 100644 index 7f657328..00000000 --- a/dist/main.1badc5f80faa798031b2.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.1badc5f80faa798031b2.css","mappings":"AACE,oBACE,eACA,yDACA,wCACA,oBAEA,sKAIE,yDAGF,gCACE,8BAIJ,mBACE,oDAGF,kBACE,UACA,8BAGF,sCACE,0CACA,UAIJ,+BACE,IACE,UAEF,IACE,YAEF,IACE,+B;AC1CJ,MACE,cAEA,YACE,cAEA,0BACE,qB;ACPN,UACE,YACA,yBAFF,UAGI,iCAGF,gBACE,eACA,MACA,OACA,QACA,cACA,WACA,YACA,gCACA,aAGA,yBAZF,gBAaI,aACA,+BACA,yBAGF,sBACE,OACA,mCACA,gBACA,WACA,kBAEA,yBAPF,sBAQI,gBAGF,0BAXF,sBAYI,WACA,gBAGF,0BAhBF,sBAiBI,QAGF,yBApBF,sBAqBI,0BAGF,yBAxBF,sBAyBI,eACA,wBAIJ,wBACE,OACA,2CACA,4CACA,kBACA,UACA,gBAEA,gCACE,WACA,cACA,kBACA,MACA,OACA,SACA,QACA,4BACA,sBACA,WACA,6BAEA,yDACE,yBAGF,6GAEE,yDAIJ,kDACE,sBAGF,sCACE,gCACE,8BAIJ,gDACE,aACA,iCAGF,0BA9CF,wBA+CI,OACA,mBAGF,yBAnDF,wBAoDI,cAIJ,uBACE,kBACA,MACA,QACA,UACA,YACA,gCACA,2CACA,mCAIJ,iBACE,OACA,kC;AC5HJ,SACE,qBAEA,kBACA,aACA,mBACA,uBAEA,0BACA,2BAEA,aACE,kBACA,MACA,OACA,QACA,SAEA,4BACA,qBAEA,oBACA,sBACA,mCACA,iCAIA,iCACE,WACA,kBACA,eACA,cACA,iBACA,gBACA,kBAGF,yCACE,2BAGF,0CACE,gCAKF,mBACE,2CAIA,mCACE,gDAMJ,kBACE,0CAEA,8BACE,+CAMJ,mBACE,2CAKF,mBACE,2CAKF,kBACE,0CAKF,oBACE,4CAKN,gBACE,KACE,uBAGF,GACE,0B;ACtFJ,4BACE,KACE,mBACA,UAEF,IACE,UAEF,GACE,UACA,oBAIJ,kBACE,kBACA,MACA,OACA,SACA,QAEA,y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sBACA,sBAGF,0BACE,oBACA,sBAEA,4BACE,iBACA,mBAGF,mCACE,qBACA,qBAEA,qCACE,kBACA,eAKN,yBAlCF,gBAmCI,cAEA,sBACE,cAKN,aACE,eACA,iBACA,iDACA,kBACA,gBAEA,mBACE,cACA,eACA,kBAGF,eACE,kBAGF,kBACE,YACA,mBACA,sBACA,eAIJ,cACE,qBACA,sBACA,WAEA,mBACE,sBACA,uBAIJ,aACE,sBACA,qBACA,sBACA,oBAGF,gBACE,kBACA,oBAEA,yBACE,kBACA,cACA,YAEA,0BAIJ,eACE,oB;AC/UJ,UACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,mBACE,oBACA,WAKE,uCACE,kBAGF,sCACE,0FAGA,qBACA,kBAMJ,iFAEE,qBAGF,2BACE,kBACA,aACA,YACA,UACA,oCACA,wBAMA,8DACE,gCAGF,6DACE,yDACA,UAGA,yBACA,wCAKN,gBACE,kBACA,uBACA,UAIA,iEAEE,WACA,cACA,kBACA,eACA,aACA,eACA,gBAGF,iCACE,4CACA,qBACA,yCACA,2DAGF,gCAEE,oEAEA,wBACA,UACA,4BAGF,gCACE,cACA,mBAGF,mCACE,cACA,kBACA,iBACA,kCAKF,+CACE,kCACA,sCAGF,8CACE,UAIJ,mBACE,eACA,qBAGE,oCACE,UACA,cAIJ,uDAEE,iBAIA,mFAEE,UACA,g1C;AC7IR,SACE,aACA,YACA,mBACA,uBAEA,qBACE,eAGF,kBACE,wB;ACVF,oBACE,kBACA,WAGF,gBACE,eACA,YACA,aACA,WACA,cACA,+BAGF,cACE,gBACA,cACA,gBACA,gBACA,SACA,kBACA,yCACA,8DACA,2CACA,kBACA,6BACA,4BAEA,qBACA,0GAmBA,gCACA,cAlBA,mBACE,mBAGF,sBACE,gEAGF,qCACE,0BACA,mCAGF,mCACE,2BAMF,kBACE,oBAGF,qBACE,uBAGF,mBACE,qBAGF,oBACE,sBAGF,0BACE,iBAIJ,cACE,gBACA,mCACA,kCACA,mBACA,kBAIA,sBACE,gDACA,8DACA,iBAGF,sBACE,gB;ACzFN,cACE,kB;ACDF,UACE,WACA,gBACA,uBACA,2BACA,wBACA,aACA,oBACA,kBACA,gBACA,mBACA,mBACA,wBACA,oCACA,eACA,uBAEA,qBACE,gCAEE,yCACA,qBACA,eAIJ,yBACE,iDAGE,qBACA,cAGF,iBACE,0CAIJ,YACE,iBACA,kBACA,kCAGF,0BACE,kBAEA,qCACE,0BAIJ,mBACE,sBACA,0BAGF,sBACE,yBAEA,wBACE,cAIJ,+DACE,0CACA,2BAGF,oBACE,iBAIA,qBACE,iBACA,eAGF,mCACE,iBACA,eAGF,6BACE,cACA,kBAIJ,kBACE,mBACA,kBACA,sBACA,eACA,sBACA,WACA,gBACA,mBACA,sCAEA,oBACE,kBACA,kBACA,qBAGF,qBACE,yEAGE,sDACA,qBAGF,yBACE,uB;ACrHN,+BACE,eAEA,0CAEA,wCACE,kBACA,SACA,aACA,WACA,uBAIF,8CACE,kBACA,aACA,WACA,aACA,cACA,6CACA,aACA,cACA,kCACA,0DAEA,mDACE,kCACA,mCACA,WAKN,0BACE,WACA,mBACA,gBACA,uCACA,sBAEA,+BACE,oBAKF,mCACE,aACA,mBAGF,8CACE,uBACA,mBAEA,mDACE,kBAKN,gCACE,eACA,kBAEA,uCACE,WACA,YACA,qBACA,mBACA,uBAIJ,gCACE,mBACA,gBACA,uBACA,kBACA,gBAGF,gCACE,iBACA,W;ACtFJ,WACE,WACA,kBACA,cACA,uBACA,kBAEA,gDAPF,WAQI,gCAEA,cACE,kBAIJ,kDAEE,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDATF,kDAUI,YACA,aACA,sBAIJ,iBACE,oEACA,qBAGF,cACE,kBACA,cAEA,yBAJF,cAKI,eACA,iBAIJ,iBACE,kBACA,iBACA,qBACA,kCAEA,yBANF,iBAOI,eACA,oBAKN,kGAKE,YACA,gBAIA,6BACE,oBAGF,gCACE,mBAGF,wCACE,gBAMF,0CACE,aACA,mBACA,uBAIJ,kBACE,aACA,cACA,cACA,iBACA,kCACA,YACA,aACA,mBACA,uBACA,eAEA,gDAEE,UAKF,sDAEE,aAGF,4BACE,UACA,mBACA,2EAEA,wCACE,WACA,qBAGF,mCACE,gBACA,2CACA,8BACA,qBAIJ,iBACE,uBAGF,iBACE,gBACA,mBACA,kBAEA,oBACE,uBACA,gBACA,gBACA,aAEA,4BACE,sBACA,aACA,uBACA,mBACA,mBACA,gBACA,UACA,oBACA,gCACA,kBACA,kBACA,WAMR,kBACE,kC;ACvKF,aACE,YACA,aACA,sBACA,mBACA,uBAEA,sBACE,gBACA,YACA,eACA,kBAGF,oBACE,gBAGF,0BACE,kCACA,kBAGF,iBACE,WACA,gBAGF,qBACE,gB;AC7BJ,iBAAiB;AACjB;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,sFAAsF;AACxF;AACA,aAAa;AACb;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;AAC9D;AACA,cAAc;AACd;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,UAAU;AACV;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,eAAe;AACf;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;AAC9D;AACA,cAAc;AACd;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,mHAAmH;AACrH;AACA,UAAU;AACV;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAoG;EACpG,yKAAyK;AAC3K;AACA,iBAAiB;AACjB;EACE,qBA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AGF,eAGE,OAGF,aACE,SAGF,iBAEE,cACA,cACA,wBACA,KAGF,cACE,KAGF,UACE,GAGF,wBACE,qBACA,6BACA,qCACA,SAEF,aACE,0BACA,uGAGF,aAGE,qBACA,qCAEF,SACE,mBAGF,uHAIE,qBAEA,KAGF,YACE,mBACA,cACA,6BACA,KAGF,qBACE,kBACA,gBAGF,eACE,mFAGF,yBASE,OAGF,wBACE,SAGF,kBACE,sBACA,cACA,gBACA,oBACA,IAGF,kBACE,OAGF,oBACE,oBACA,QAGF,eACE,cAGF,kBACE,0CACA,uCAGF,QAKE,oBACA,kBACA,oBACA,cAGF,gBAEE,eAGF,mBAEE,sDAGF,yBAIE,yHAGF,SAIE,kBACA,wCAGF,qBAEE,UACA,gFAGF,0BAIE,UAGF,aACE,gBACA,UAGF,WACE,UACA,SACA,SACA,QAGF,aACE,WACA,eACA,UACA,oBACA,iBACA,oBACA,cACA,mBACA,UAGF,uBACE,mFAGF,WAEE,eAGF,mBACE,wBACA,sFAGF,uBAEE,8BAGF,YACE,0BACA,QAGF,oBACE,SAGF,iBACE,UAGF,YACE,UAGF,uBACE,OCnQF,2BACE,2CACA,qDACA,iDACA,qCACA,sCACA,6CACA,gCACA,wEACA,sBACA,8BACA,gCACA,0CACA,sCACA,2BACA,qCACA,mCACA,iCACA,4BACA,oCACA,yBACA,+BACA,0BACA,4CACA,iDACA,0EACA,0EACA,+EACA,mCACA,yBAEA,+BACA,sCACA,wCACA,yDACA,uBACA,8BACA,uBAEA,6BACA,+BACA,yBAEA,wBAEA,uBAEA,2BAEA,8BAEA,wBAEA,sBAEA,2CACA,0BACA,+CACA,4BAEA,kCACA,kDAEA,8DACA,0DACA,sEACA,6BAEA,8BACA,iCACA,kCACA,sCAEA,uCACA,wCACA,uBAEA,sBACA,4BAEA,6BACA,6BACA,qCAEA,2DACA,wBAEA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,kCAEA,gCACA,UAEA,iCAEA,wCACA,uCACA,kCACA,yCACA,oCAC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F,8BAEE,aAEF,4BAEE,MAjBF,uBACE,aAEF,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,cChDN,iBACE,qBACA,oBAEA,aACE,iBACA,kBACA,YACA,aACA,yCACA,eACA,gBACA,gCACA,uDACA,YACA,oBACA,6BACA,mBACA,gCAIA,UACE,kBACA,cACA,aACA,kDACA,oDACA,yBACA,WACA,SACA,8JAIJ,kDAKE,yEAGF,+BAEE,4BAGF,iCACE,0BAGF,mCACE,4BAGF,wCACE,uBAGF,UACE,oBACA,6BAIA,gBACE,6BAGF,SACE,aACA,yCAIA,gBACE,mDACA,WACA,UACA,2MAIJ,iDAKE,eAKN,mBACE,cACA,WACA,gBACA,6EACA,4DACA,2CACA,wBACA,yCACA,aACA,kCACA,sBACA,wBACA,eAEA,oBACA,oBAEA,kBACE,qBAGF,iCACE,2BAEA,0BACE,yCAIJ,iCAEE,gDACA,iCACA,qDAEA,0BACE,wBAIJ,0BACE,sBAGF,+BACE,8CACA,+BACA,wBAGF,oCACE,mDACA,oCACA,4BAKF,gBACE,uBAIJ,WACE,gBACA,sBACA,6CACA,gDACA,6BAGF,iBACE,2CAEA,sBACE,8CAGF,iBACE,MACA,QACA,eACA,gBACA,aACA,mBACA,uBACA,eACA,wBACA,kCAEA,WACA,iBACA,uGAEA,SAEE,oDAKF,qBACE,gDACA,uDAGF,MACE,WACA,YC3MN,qBACE,qHACA,mBAEA,kBACA,mBACA,kCAGF,gCAGE,WACA,kBACA,mBACA,oBACA,oBACA,cACA,mCAGA,kCACA,4DAIA,8CACE,wBACA,aACA,kBACA,cACA,mBAIJ,WACE,wBAEF,WACE,4BAEF,WACE,uBAEF,WACE,uBAEF,WACE,uBAEF,WACE,8BAEF,WACE,wBAEF,WACE,sBAEF,WACE,yBAEF,WACE,sBAEF,WACE,8BAEF,WACE,oCAEF,WACE,0BAEF,WACE,gCAEF,WACE,2BAEF,WACE,yBAEF,WACE,oBAEF,WACE,gCAEF,WACE,4BAEF,WACE,k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BACE,oCACA,gBAGF,YACE,kBACA,MACA,eACA,SACA,aACA,+BACA,iBACA,0BAEA,eAVF,aAWI,mBAQJ,4BACE,QACA,SACA,gBACA,sBACA,WACA,kBAGF,UACE,qCAEA,6BAEE,GAIJ,qBACE,qFAGF,0BAGE,iCAGF,oBAEE,6CACA,oCACA,iCAEA,oBAEA,mFAEA,iCACE,sBACA,yCAEA,mJAGF,6CAGE,ySAEA,kCACE,qDAOF,aACE,uDAKF,cACE,eAKN,oBACE,kCAEA,YACE,cAIJ,oBACE,wBACA,kBACA,qBACA,cACA,eACA,sBACA,gBACA,cACA,yBAEA,uDACE,kBACA,kBAIJ,uBACE,eACA,qBAGF,SACE,6BACA,gCAEA,SACE,iCAGF,YACE,0BAGF,uBACE,gBAIJ,qCACE,eAGF,mCACE,aAGF,4CACE,YAGF,iBACE,OACA,MACA,QACA,SACA,UACA,iCAGF,cACE,eACA,UACA,YACA,WACA,sBAGF,GACE,oBACE,WACA,KAEF,oBACE,UACA,MAEF,kBACE,uBAIJ,KACE,kBACE,WACA,IAEF,oBACE,UACA,6mH","sources":["webpack://telegram-t/./src/components/common/spoiler/Spoiler.scss","webpack://telegram-t/./src/components/ui/Link.scss","webpack://telegram-t/./src/components/common/UiLoader.scss","webpack://telegram-t/./src/components/ui/Spinner.scss","webpack://telegram-t/./src/components/ui/RippleEffect.scss","webpack://telegram-t/./src/components/ui/Button.scss","webpack://telegram-t/./src/components/ui/Checkbox.scss","webpack://telegram-t/./src/components/ui/Loading.scss","webpack://telegram-t/./src/components/ui/Menu.scss","webpack://telegram-t/./src/components/ui/DropdownMenu.scss","webpack://telegram-t/./src/components/ui/MenuItem.scss","webpack://telegram-t/./src/components/auth/CountryCodeInput.scss","webpack://telegram-t/./src/components/auth/Auth.scss","webpack://telegram-t/./src/components/main/AppInactive.scss","webpack://telegram-t/./src/assets/fonts/roboto.css","webpack://telegram-t/./src/styles/index.scss","webpack://telegram-t/./src/styles/reboot.css","webpack://telegram-t/./src/styles/_variables.scss","webpack://telegram-t/./src/styles/_spacing.scss","webpack://telegram-t/./src/styles/_forms.scss","webpack://telegram-t/./src/styles/icons.scss","webpack://telegram-t/./src/styles/_common.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/styles/print.scss"],"sourcesContent":[".Spoiler {\n &--concealed {\n cursor: pointer;\n background-image: url('../../../assets/spoiler-dots-black.png');\n background-size: auto min(100%, 1.125rem);\n border-radius: 0.5rem;\n\n html.theme-dark &,\n html.theme-light .ListItem.selected &,\n .ActionMessage &,\n .MediaViewerFooter & {\n background-image: url('../../../assets/spoiler-dots-white.png');\n }\n\n .emoji-only & {\n background-size: auto 1.125rem;\n }\n }\n\n &--animated {\n animation: pulse-opacity-light 1.75s linear infinite;\n }\n\n &__content {\n opacity: 1;\n transition: opacity 250ms ease;\n }\n\n &--concealed &__content {\n user-select: none;\n opacity: 0;\n }\n}\n\n@keyframes pulse-opacity-light {\n 25% {\n opacity: 1;\n }\n 50% {\n opacity: 0.25;\n }\n 75% {\n opacity: 1;\n }\n}\n",".Link {\n color: inherit;\n\n &:hover {\n color: inherit;\n\n &.GroupCallLink {\n text-decoration: none;\n }\n }\n}\n","#UiLoader {\n height: 100%;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n .mask {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 100%;\n height: 100%;\n z-index: var(--z-ui-loader-mask);\n display: flex;\n\n\n @media (min-width: 600px) {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 100%;\n }\n\n .left {\n flex: 1;\n background: var(--color-background);\n min-width: 12rem;\n width: 33vw;\n max-width: 26.5rem;\n\n @media (min-width: 926px) {\n max-width: 40vw;\n }\n\n @media (min-width: 1276px) {\n width: 25vw;\n max-width: 33vw;\n }\n\n @media (max-width: 1275px) {\n flex: 2;\n }\n\n @media (max-width: 925px) {\n width: 26.5rem !important;\n }\n\n @media (max-width: 600px) {\n max-width: none;\n width: 100vw !important;\n }\n }\n\n .middle {\n flex: 3;\n border-left: 1px solid var(--color-borders);\n border-right: 1px solid var(--color-borders);\n position: relative;\n z-index: 1;\n overflow: hidden;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: no-repeat center;\n background-size: cover;\n z-index: -1;\n transform-origin: left center;\n\n .theme-dark body.initial & {\n background-color: #0f0f0f;\n }\n\n .theme-light body.initial &,\n body:not(.initial) & {\n background-image: url('../../assets/chat-bg.jpg');\n }\n }\n\n &.with-right-column::before {\n transform: scale(0.67);\n }\n\n @media screen and (min-width: 1276px) {\n &::before {\n margin: -16rem -5rem -20rem 0;\n }\n }\n\n &.custom-bg-image::before {\n margin: -1rem;\n background-image: none !important;\n }\n\n @media (max-width: 1275px) {\n flex: 3;\n border-right: none;\n }\n\n @media (max-width: 600px) {\n display: none;\n }\n }\n\n .right {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n height: 100%;\n width: var(--right-column-width);\n border-left: 1px solid var(--color-borders);\n background: var(--color-background);\n }\n }\n\n .blank {\n flex: 1;\n background: var(--color-background);\n }\n}\n",".Spinner {\n --spinner-size: 2rem;\n\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: var(--spinner-size);\n height: var(--spinner-size);\n\n > div {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n background-repeat: no-repeat;\n background-size: 100%;\n\n animation-name: spin;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n\n &.with-background {\n &::before {\n content: '';\n position: absolute;\n left: -0.125rem;\n top: -0.125rem;\n bottom: -0.125rem;\n right: -0.125rem;\n border-radius: 50%;\n }\n\n &.bg-dark::before {\n background: rgba(0, 0, 0, 0.25);\n }\n\n &.bg-light::before {\n background: rgba(255, 255, 255, 0.4);\n }\n }\n\n &.white {\n > div {\n background-image: var(--spinner-white-data);\n }\n\n &.with-background {\n > div {\n background-image: var(--spinner-white-thin-data);\n }\n }\n }\n\n &.blue {\n > div {\n background-image: var(--spinner-blue-data);\n\n .theme-dark & {\n background-image: var(--spinner-dark-blue-data);\n }\n }\n }\n\n &.black {\n > div {\n background-image: var(--spinner-black-data);\n }\n }\n\n &.green {\n > div {\n background-image: var(--spinner-green-data);\n }\n }\n\n &.gray {\n > div {\n background-image: var(--spinner-gray-data);\n }\n }\n\n &.yellow {\n > div {\n background-image: var(--spinner-yellow-data);\n }\n }\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n}\n\n","@-webkit-keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n@keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n.ripple-container {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n\n body.animation-level-0 & {\n display: none;\n }\n\n span {\n position: absolute;\n display: block;\n background-color: var(--ripple-color, rgba(0, 0, 0, 0.08));\n border-radius: 50%;\n transform: scale(0);\n animation: ripple-animation 700ms;\n }\n}\n","@mixin active-styles() {\n &:not(.disabled):not(:disabled) {\n &:active,\n &.active,\n &:focus {\n @content;\n }\n @media (hover: hover) {\n &:hover {\n @content;\n }\n }\n }\n}\n\n@mixin no-ripple-styles() {\n body.animation-level-0 & {\n &:not(.disabled):not(:disabled) {\n &:active {\n @content;\n }\n }\n }\n}\n\n.Button {\n outline: none !important;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 3.5rem;\n border: 0;\n border-radius: var(--border-radius-default);\n background-color: transparent;\n background-size: cover;\n padding: 0.625rem;\n color: white;\n line-height: 1.2;\n cursor: pointer;\n text-transform: uppercase;\n flex-shrink: 0;\n position: relative;\n overflow: hidden;\n transition: background-color 0.15s, color 0.15s;\n text-decoration: none !important;\n\n // @optimization\n &:active,\n &.clicked,\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default;\n pointer-events: none;\n }\n\n &.round {\n width: 3.5rem;\n border-radius: 50%;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.primary {\n background-color: var(--color-primary);\n color: var(--color-white);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n background-color: var(--color-primary-shade);\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-primary-shade-darker);\n }\n }\n\n &.secondary {\n background-color: var(--color-background);\n color: rgba(var(--color-text-secondary-rgb), 0.75);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n background-color: var(--color-primary);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-primary-shade);\n }\n }\n\n &.gray {\n background-color: var(--color-background);\n color: var(--color-text-secondary);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n color: var(--color-primary);\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-chat-hover);\n }\n }\n\n &.danger {\n background-color: var(--color-background);\n color: var(--color-error);\n --ripple-color: rgba(var(--color-error-rgb), 0.16);\n\n @include active-styles() {\n background-color: var(--color-error);\n color: var(--color-white);\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-error-shade);\n }\n }\n\n &.text {\n background-color: transparent;\n\n &.primary {\n color: var(--color-primary);\n background-color: transparent;\n\n @include active-styles() {\n background-color: rgba(var(--color-primary-shade-rgb), 0.08);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-primary-shade-rgb), 0.16);\n }\n }\n\n &.secondary {\n background-color: transparent;\n color: var(--color-text-secondary);\n }\n\n &.danger {\n @include active-styles() {\n background-color: rgba(var(--color-error-rgb), 0.08);\n color: var(--color-error);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-error-rgb), 0.16);\n }\n }\n }\n\n &.faded {\n opacity: 0.8;\n\n @include active-styles() {\n opacity: 1;\n }\n\n &.activated {\n opacity: 1;\n }\n }\n\n &.translucent {\n background-color: transparent;\n color: var(--color-text-secondary);\n\n --ripple-color: var(--color-interactive-element-hover);\n\n @include active-styles() {\n background-color: var(--color-interactive-element-hover);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-text-secondary-rgb), 0.16);\n }\n\n &.activated {\n color: var(--color-primary);\n }\n }\n\n &.translucent-white {\n background-color: transparent;\n color: rgba(255, 255, 255, 0.5);\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(255, 255, 255, 0.08);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(255, 255, 255, 0.16);\n }\n }\n\n &.translucent-black {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.8);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n background-color: rgba(0, 0, 0, 0.08);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(0, 0, 0, 0.16);\n }\n }\n\n &.dark {\n background-color: rgba(0, 0, 0, 0.75);\n color: white;\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(0, 0, 0, 0.95);\n }\n }\n\n &.smaller {\n height: 2.75rem;\n padding: 0.3125rem;\n\n &.round {\n width: 2.75rem;\n }\n\n &.pill {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding: 0.3125rem 1rem;\n }\n\n &.with-icon {\n padding-left: 0.75rem;\n padding-right: 1.25rem;\n\n i {\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n\n &[dir=\"rtl\"] {\n padding-left: 1.25rem;\n padding-right: 0.75rem;\n\n i {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n }\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n\n &.round {\n width: 2.5rem;\n }\n }\n }\n\n &.tiny {\n height: 2.25rem;\n padding: 0.4375rem;\n border-radius: var(--border-radius-default-small);\n font-size: 0.875rem;\n font-weight: 500;\n\n &.round {\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 50%;\n }\n\n i {\n font-size: 1.25rem;\n }\n\n &.pill {\n height: 2rem;\n border-radius: 1rem;\n padding: 0.3125rem 1rem;\n font-size: 1rem;\n }\n }\n\n &.fluid {\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n width: auto;\n\n &.tiny {\n padding-left: 1.375rem;\n padding-right: 1.375rem;\n }\n }\n\n &.pill {\n border-radius: 1.75rem;\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n text-transform: none;\n }\n\n &.loading {\n position: relative;\n pointer-events: none;\n\n .Spinner {\n position: absolute;\n right: 0.875rem;\n top: 0.875rem;\n\n --spinner-size: 1.8125rem;\n }\n }\n\n .emoji {\n vertical-align: -3px;\n }\n}\n",".Checkbox {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.round {\n .Checkbox-main {\n &::before {\n border-radius: 50%;\n }\n\n &::after {\n background: var(--color-primary)\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=)\n no-repeat 50% 50%;\n background-size: 12px;\n border-radius: 50%;\n }\n }\n }\n\n &.loading {\n .Checkbox-main::before,\n .Checkbox-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 0.375rem;\n top: 0.125rem;\n opacity: 0;\n animation: fade-in 0.2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &.blocking {\n input:not(:checked) ~ .Checkbox-main {\n &::before {\n border-color: var(--color-error);\n }\n\n &::after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBvbHlnb24gcG9pbnRzPSIwIDAgMjQgMCAyNCAyNCAwIDI0Ii8+CiAgICA8cGF0aCBmaWxsPSIjZTUzOTM1IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xOCwzIEMxOS42NTY4NTQyLDMgMjEsNC4zNDMxNDU3NSAyMSw2IEwyMSwxOCBDMjEsMTkuNjU2ODU0MiAxOS42NTY4NTQyLDIxIDE4LDIxIEw2LDIxIEM0LjM0MzE0NTc1LDIxIDMsMTkuNjU2ODU0MiAzLDE4IEwzLDYgQzMsNC4zNDMxNDU3NSA0LjM0MzE0NTc1LDMgNiwzIEwxOCwzIFogTTE2LDExIEw4LDExIEM3LjQ0NzcxNTI1LDExIDcsMTEuNDQ3NzE1MyA3LDEyIEM3LDEyLjU1MjI4NDcgNy40NDc3MTUyNSwxMyA4LDEzIEwxNiwxMyBDMTYuNTUyMjg0NywxMyAxNywxMi41NTIyODQ3IDE3LDEyIEMxNywxMS40NDc3MTUzIDE2LjU1MjI4NDcsMTEgMTYsMTEgWiIvPgogIDwvZz4KPC9zdmc+Cg==);\n opacity: 1;\n\n // Compensate for svg having incorrect size\n background-size: 1.375rem;\n background-position: -0.125rem -0.125rem;\n }\n }\n }\n\n input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Checkbox-main {\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 1.1875rem;\n top: 0.1875rem;\n width: 1.125rem;\n height: 1.125rem;\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: 0.25rem;\n background-color: var(--color-background);\n transition: border-color 0.1s ease, background-color 0.1s ease;\n }\n\n &::after {\n /* stylelint-disable-next-line scss/operator-no-unspaced */\n background: center no-repeat\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==);\n background-size: 0.875rem;\n opacity: 0;\n transition: opacity 0.1s ease;\n }\n\n .label {\n display: block;\n text-align: initial;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--color-primary);\n background-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &[dir=\"rtl\"] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n &.loading {\n .Spinner {\n left: auto;\n right: 0.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n .Checkbox-main {\n &::before,\n &::after {\n left: auto;\n right: 1.1875rem;\n }\n }\n }\n}\n",".Loading {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n\n &.interactive {\n cursor: pointer;\n }\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n}\n",".Menu {\n &.fluid .bubble {\n min-width: 13.5rem;\n width: auto;\n }\n\n .backdrop {\n position: fixed;\n left: -100vw;\n right: -100vw;\n top: -100vh;\n bottom: -100vh;\n z-index: var(--z-menu-backdrop);\n }\n\n .bubble {\n overflow: hidden;\n display: block;\n list-style: none;\n padding: 0.5rem 0;\n margin: 0;\n position: absolute;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n min-width: 13.5rem;\n z-index: var(--z-menu-bubble);\n overscroll-behavior: contain;\n\n transform: scale(0.5);\n transition: opacity 0.2s cubic-bezier(0.2, 0, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0, 0.2, 1) !important;\n\n &.open {\n transform: scale(1);\n }\n\n &.closing {\n transition: opacity 0.2s ease-in, transform 0.2s ease-in !important;\n }\n\n body.animation-level-0 & {\n transform: none !important;\n transition: opacity 0.15s !important;\n }\n\n body.has-open-dialog & {\n transition: none !important;\n }\n\n --offset-y: calc(100% + 0.5rem);\n --offset-x: 0;\n\n &.top {\n top: var(--offset-y);\n }\n\n &.bottom {\n bottom: var(--offset-y);\n }\n\n &.left {\n left: var(--offset-x);\n }\n\n &.right {\n right: var(--offset-x);\n }\n\n &.with-footer {\n padding-bottom: 0;\n }\n }\n\n .footer {\n padding: 0.5rem 0;\n background: var(--color-chat-hover);\n color: var(--color-text-secondary);\n font-size: 0.8125rem;\n text-align: center;\n }\n\n &.compact {\n .bubble {\n background: var(--color-background-compact-menu);\n backdrop-filter: blur(10px);\n padding: 0.25rem 0;\n }\n\n .footer {\n background: none;\n }\n }\n}\n",".DropdownMenu {\n position: relative;\n}\n",".MenuItem {\n width: 100%;\n background: none;\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 0.75rem 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n --ripple-color: rgba(0, 0, 0, 0.08);\n cursor: pointer;\n unicode-bidi: plaintext;\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n background-color: var(--color-chat-hover);\n text-decoration: none;\n color: inherit;\n }\n }\n\n @media (max-width: 600px) {\n &:focus,\n &:hover,\n &:active {\n text-decoration: none;\n color: inherit;\n }\n\n &:active {\n background-color: var(--color-chat-hover);\n }\n }\n\n i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n\n .menu-item-name {\n margin-right: 2rem;\n\n &.capitalize {\n text-transform: capitalize;\n }\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default !important;\n }\n\n &.destructive {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n\n &:not(.has-ripple):not(.disabled):not(.compact):active {\n background-color: var(--color-item-active);\n transition: none !important;\n }\n\n & > .Switcher {\n margin-left: auto;\n }\n\n &[dir=\"rtl\"] {\n i {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n .menu-item-name {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n > .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n\n &.compact {\n align-items: center;\n font-size: 0.875rem;\n margin: 0.125rem 0.25rem;\n padding: 0.25rem;\n border-radius: 0.375rem;\n width: auto;\n font-weight: 500;\n transform: scale(1);\n transition: 0.15s ease-in-out transform;\n\n i {\n font-size: 1.25rem;\n margin-left: 0.5rem;\n margin-right: 1.25rem;\n }\n\n @media (hover: hover) {\n &:hover,\n &:focus,\n &:active {\n background: var(--color-background-compact-menu-hover);\n text-decoration: none;\n }\n\n &:active {\n transform: scale(0.98);\n }\n }\n }\n}\n",".CountryCodeInput {\n .input-group {\n cursor: pointer;\n\n z-index: var(--z-country-code-input-group);\n\n .Spinner {\n position: absolute;\n top: 1rem;\n right: 0.75rem;\n opacity: 0.5;\n --spinner-size: 1.5rem;\n }\n\n // Prevent loading additional 10 kB of icomoon font on initial load.\n .css-icon-down {\n position: absolute;\n top: 1.125rem;\n right: 1rem;\n width: 0.75rem;\n height: 0.75rem;\n border: 2px solid var(--color-text-secondary);\n border-top: 0;\n border-left: 0;\n transform: scaleY(1) rotate(45deg);\n transition: color 0.2s ease, transform 0.2s ease, top 0.2s ease;\n\n &.open {\n border-color: var(--color-primary);\n transform: scaleY(-1) rotate(45deg);\n top: 1.5rem;\n }\n }\n }\n\n .bubble {\n width: 100%;\n max-height: 23.5rem;\n overflow-y: auto;\n transform-origin: top center !important;\n transform: scale(0.95);\n\n &.open {\n transform: scaleY(1);\n }\n }\n\n .MenuItem {\n button {\n display: flex;\n align-items: center;\n }\n\n &.no-results button {\n justify-content: center;\n padding: 0.5rem 1rem;\n\n span {\n font-size: 0.875rem;\n }\n }\n }\n\n .country-flag {\n font-size: 2rem;\n margin-right: 2rem;\n\n .emoji {\n width: 2rem;\n height: 2rem;\n display: inline-block;\n vertical-align: 4px;\n margin: -0.5rem 0.125rem;\n }\n }\n\n .country-name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 1rem;\n text-align: left;\n }\n\n .country-code {\n margin-left: auto;\n opacity: 0.5;\n }\n}\n",".auth-form {\n width: 100%;\n max-width: 25.5rem;\n margin: 0 auto;\n padding: 6rem 1rem 1rem;\n text-align: center;\n\n @media (min-width: 600px) and (min-height: 450px) {\n padding: 6.8125rem 1.5rem 1.5rem;\n\n &.qr {\n padding-top: 4rem;\n }\n }\n\n #logo,\n .AvatarEditable label {\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n }\n\n #logo {\n background: url(\"../../assets/telegram-logo.svg\") center no-repeat;\n background-size: 100%;\n }\n\n h2 {\n font-size: 1.25rem;\n line-height: 1;\n\n @media (min-width: 600px) {\n font-size: 2rem;\n line-height: 1.5;\n }\n }\n\n .note {\n font-size: 0.875rem;\n line-height: 1.35;\n margin-bottom: 2.5rem;\n color: var(--color-text-secondary);\n\n @media (min-width: 600px) {\n font-size: 1rem;\n margin-bottom: 3rem;\n }\n }\n}\n\n#auth-registration-form,\n#auth-phone-number-form,\n#auth-code-form,\n#auth-password-form,\n#auth-qr-form {\n height: 100%;\n overflow-y: auto;\n}\n\n#auth-phone-number-form {\n form {\n min-height: 26.25rem;\n }\n\n .Button {\n margin-top: 2.75rem;\n }\n\n .Button + .Button {\n margin-top: 1rem;\n }\n}\n\n#auth-code-form,\n#auth-password-form {\n h2 {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n.auth-number-edit {\n width: 2.5rem;\n height: 2.5rem;\n padding: 0.5rem;\n font-size: 1.5rem;\n color: var(--color-text-secondary);\n opacity: 0.75;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n}\n\n#auth-qr-form {\n .qr-container,\n .qr-loading {\n height: 280px;\n }\n\n .qr-container {\n opacity: 1;\n transform: scale(1);\n transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms;\n\n &.pre-animate {\n opacity: 0.5;\n transform: scale(0.8);\n }\n\n canvas {\n padding: 0.625rem;\n border-radius: var(--border-radius-default);\n background: var(--color-white);\n margin-top: -0.625rem;\n }\n }\n\n h3 {\n margin: 1.5rem 0 1rem 0;\n }\n\n ol {\n list-style: none;\n counter-reset: item;\n padding: 0 1.75rem;\n\n li {\n counter-increment: item;\n text-align: left;\n margin: 0.75rem 0;\n display: flex;\n\n &::before {\n content: counter(item);\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 1.375rem;\n height: 1.375rem;\n padding: 0;\n margin: 0 0.75rem 0 0;\n background: var(--color-primary);\n border-radius: 50%;\n font-size: smaller;\n color: white;\n }\n }\n }\n}\n\n#sign-in-password {\n word-break: normal !important;\n}\n","#AppInactive {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n .content {\n max-width: 28rem;\n margin: auto;\n padding: 1.5rem;\n text-align: center;\n }\n\n .title {\n margin-top: 1rem;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: 0.875rem;\n }\n\n img {\n width: 100%;\n max-width: 20rem;\n }\n\n .Button {\n margin-top: 1rem;\n }\n}\n","/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Regular-WOL.woff2') format('woff2'),\n url('Vazir-Regular-WOL.woff') format('woff');\n font-weight: normal;\n font-display:swap;\n unicode-range:U+0627-06FF;\n}\n\n/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Medium-WOL.woff2') format('woff2'),\n url('Vazir-Medium-WOL.woff') format('woff');\n font-weight: 500;\n font-display:swap;\n unicode-range: U+0600-06FF;\n}\n","@import \"reboot\";\n@import \"variables\";\n@import \"mixins\";\n@import \"spacing\";\n@import \"forms\";\n@import \"icons\";\n@import \"common\";\n@import \"../assets/fonts/roboto.css\";\n@import \"./print\";\n\nhtml,\nbody {\n width: 100%;\n height: 100%;\n background: var(--color-background);\n margin: 0;\n padding: 0;\n font-size: 16px;\n font-family: \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Segoe UI\", Oxygen, Ubuntu, Cantarell,\n \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n color: var(--color-text);\n font-weight: 400;\n line-height: 1.5;\n text-align: left;\n overflow: hidden;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\nbody.is-ios,\nbody.is-macos {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n}\n\nhtml[lang=\"fa\"],\nhtml[lang=\"fa\"] body {\n font-family: \"Vazir\", \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Segoe UI\", Oxygen, Ubuntu,\n Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n\n &.is-ios,\n &.is-macos {\n font-family: \"Vazir\", -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Segoe UI\", Oxygen, Ubuntu,\n Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n }\n}\n\nbody.is-ios {\n --border-radius-messages: 1rem;\n --border-radius-messages-small: 0.5rem;\n}\n\nbody.cursor-grabbing,\nbody.cursor-grabbing * {\n cursor: grabbing !important;\n}\n\nbody.cursor-ew-resize {\n cursor: ew-resize !important;\n}\n\n#root {\n height: 100%;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\n#middle-column-portals,\n#portals {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.hidden {\n visibility: hidden;\n}\n\n.no-selection {\n user-select: none;\n -webkit-user-select: none !important;\n}\n\n.resize-handle {\n display: none;\n position: absolute;\n top: 0;\n right: -0.25rem;\n bottom: 0;\n width: 0.25rem;\n z-index: var(--z-resize-handle);\n cursor: ew-resize;\n\n @media (min-width: 926px) {\n display: block;\n }\n}\n\n/*\n See the article for more information on this visually-hidden pattern.\n https://snook.ca/archives/html_and_css/hiding-content-for-accessibility\n*/\n.visually-hidden {\n position: absolute !important;\n width: 0;\n height: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n z-index: -1;\n}\n\n.not-implemented {\n opacity: 0.5;\n\n &,\n & * {\n cursor: not-allowed !important;\n }\n}\n\n* {\n box-sizing: border-box;\n}\n\n.no-animations #root *,\n.no-animations #root *::before,\n.no-animations #root *::after {\n transition: none !important;\n}\n\n.custom-scroll,\n.custom-scroll-x {\n scrollbar-width: thin;\n scrollbar-color: rgba(90, 90, 90, 0) transparent;\n transition: scrollbar-color 0.3s ease;\n\n -webkit-overflow-scrolling: touch;\n // Fix scroll lock on iOS\n pointer-events: auto;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0);\n border-radius: 0.375rem;\n // `box-shadow` prevents repaint on macOS when hovering out of scrollable container\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.01);\n }\n\n &:hover,\n &:focus,\n &:focus-within {\n scrollbar-color: rgba(90, 90, 90, 0.3) transparent;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0.3);\n }\n }\n}\n\nbody:not(.is-ios) {\n .custom-scroll {\n &::-webkit-scrollbar {\n width: 0.375rem;\n }\n }\n\n .custom-scroll-x {\n &::-webkit-scrollbar {\n height: 0.375rem;\n }\n }\n}\n\n.no-scrollbar {\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n.emoji-small {\n background: no-repeat;\n background-size: 1.25rem;\n color: transparent;\n display: inline-block;\n width: 1.25rem;\n height: 1.25rem;\n margin-inline-end: 1px;\n overflow: hidden;\n flex-shrink: 0;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n}\n\ndiv[role=\"button\"] {\n outline: none !important;\n cursor: pointer;\n}\n\n.opacity-transition {\n opacity: 1;\n transition: opacity 0.15s ease;\n\n &:not(.open) {\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.slow {\n transition-duration: 0.3s;\n }\n}\n\n.color-primary {\n color: var(--color-primary) !important;\n}\n\n.color-danger {\n color: var(--color-error) !important;\n}\n\n.text-muted {\n color: var(--color-text-secondary) !important;\n}\n\n.protector {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n}\n\n.for-ios-autocapitalization-fix {\n position: fixed;\n font-size: 16px;\n opacity: 0;\n bottom: 1rem;\n z-index: -1;\n}\n\n@keyframes grow-icon {\n 0% {\n transform: scale(0.5);\n opacity: 0.8;\n }\n 50% {\n transform: scale(1.1);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes hide-icon {\n from {\n transform: scale(1);\n opacity: 0.4;\n }\n to {\n transform: scale(0.5);\n opacity: 0;\n }\n}\n","*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n@-ms-viewport {\n width: device-width;\n}\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n font-weight: 500;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\np,\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndd {\n margin-bottom: 0.5rem;\n margin-left: 0;\n}\n\nblockquote,\nfigure {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\ndt,\nb,\nstrong {\n font-weight: 500;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\na {\n color: var(--color-links);\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]),\na:not([href]):not([tabindex]):hover,\na:not([href]):not([tabindex]):focus {\n color: inherit;\n text-decoration: none;\n}\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font: 0.9375rem/1.25 \"Courier\", \"Courier New\", \"Nimbus Mono L\", \"Courier 10 Pitch\", \"FreeMono\", sans-serif-monospace,\n monospace;\n font-size-adjust: 0.43;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput:not([type=\"range\"]),\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: 0.5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: 0.5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n","@use \"sass:color\";\n\n@function toRGB($color) {\n @return red($color) + \", \" + green($color) + \", \" + blue($color);\n}\n\n@function blend-normal($foreground, $background) {\n $opacity: opacity($foreground);\n $background-opacity: opacity($background);\n\n // calculate opacity\n $bm-red: color.red($foreground) * $opacity + color.red($background) * $background-opacity * (1 - $opacity);\n $bm-green: color.green($foreground) * $opacity + color.green($background) * $background-opacity * (1 - $opacity);\n $bm-blue: color.blue($foreground) * $opacity + color.blue($background) * $background-opacity * (1 - $opacity);\n @return rgb($bm-red, $bm-green, $bm-blue);\n}\n\n$color-primary: #3390ec;\n\n$color-links: #3390ec;\n\n$color-placeholders: #a2acb4;\n\n$color-text-green: #4fae4e;\n$color-green: #00c73e;\n$color-light-green: #eeffde;\n\n$color-error: #e53935;\n\n$color-warning: #fb8c00;\n\n$color-yellow: #fdd764;\n\n$color-white: #ffffff;\n$color-black: #000000;\n$color-dark-gray: #2e3939;\n$color-gray: #c4c9cc;\n$color-text-secondary: #707579;\n$color-text-secondary-apple: #8a8a90;\n$color-text-meta: #686c72;\n$color-text-meta-apple: #8c8c91;\n$color-borders: #dadce0;\n$color-dividers: #c8c6cc;\n$color-item-active: #ededed;\n$color-chat-hover: #f4f4f5;\n$color-chat-active: #3390ec;\n$color-selection: #3993fb;\n\n// https://github.com/telegramdesktop/tdesktop/wiki/Theme-Reference#user-content-standard-color-constants\n// Colors borrowed from https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/Resources/day-blue.tdesktop-theme\n// historyPeer[1-8]UserpicBg\n$color-user-1: #e17076;\n$color-user-2: #7bc862;\n//$color-user-3: #E5CA77;\n$color-user-4: #65aadd;\n$color-user-5: #a695e7;\n$color-user-6: #ee7aae;\n$color-user-7: #6ec9cb;\n$color-user-8: #faa774;\n\n$color-message-reaction: #ebf3fd;\n$color-message-reaction-hover: #c5def9;\n$color-message-reaction-own: #cef0ba;\n$color-message-reaction-own-hover: #b5e0a4;\n\n:root {\n --color-background: #{$color-white};\n --color-background-compact-menu: #FFFFFFBB;\n --color-background-compact-menu-reactions: #FFFFFFEB;\n --color-background-compact-menu-hover: #000000B2;\n --color-background-selected: #f4f4f5;\n --color-background-secondary: #f4f4f5;\n --color-background-secondary-accent: #e4e4e5;\n --color-background-own: #{$color-light-green};\n --color-background-own-selected: color.adjust($color-light-green, -10%);\n --color-text: #{$color-black};\n --color-text-lighter: #{$color-dark-gray};\n --color-text-secondary: #{$color-text-secondary};\n --color-text-secondary-rgb: #{toRGB($color-text-secondary)};\n --color-text-secondary-apple: #{$color-text-secondary-apple};\n --color-text-meta: #{$color-text-meta};\n --color-text-meta-rgb: #{toRGB($color-text-meta)};\n --color-text-meta-colored: #{$color-text-green};\n --color-text-meta-apple: #{$color-text-meta-apple};\n --color-text-green: #{$color-text-green};\n --color-text-green-rgb: #{toRGB($color-text-green)};\n --color-borders: #{$color-borders};\n --color-borders-input: #{$color-borders};\n --color-dividers: #{$color-dividers};\n --color-webpage-initial-background: #{$color-dark-gray};\n --color-interactive-active: var(--color-primary);\n --color-interactive-inactive: rgba(var(--color-text-secondary-rgb), 0.25);\n --color-interactive-buffered: rgba(var(--color-text-secondary-rgb), 0.25); // Overlays underlying inactive element\n --color-interactive-element-hover: rgba(var(--color-text-secondary-rgb), 0.08);\n --color-composer-button: #{$color-text-secondary}CC;\n\n --color-primary: #{$color-primary};\n --color-primary-shade: #{color.mix($color-primary, $color-black, 92%)};\n --color-primary-shade-darker: #{color.mix($color-primary, $color-black, 84%)};\n --color-primary-shade-rgb: #{toRGB(color.mix($color-primary, $color-black, 92%))};\n --color-primary-opacity: rgba(var(--color-primary), 0.5);\n --color-green: #{$color-green};\n --color-green-darker: #{color.mix($color-green, $color-black, 84%)};\n\n --color-error: #{$color-error};\n --color-error-shade: #{color.mix($color-error, $color-black, 92%)};\n --color-error-rgb: #{toRGB($color-error)};\n\n --color-warning: #{$color-warning};\n\n --color-yellow: #{$color-yellow};\n\n --color-links: #{$color-links};\n\n --color-own-links: #{$color-white};\n\n --color-placeholders: #{$color-placeholders};\n\n --color-pinned: #{$color-white};\n\n --color-code: #4a729a;\n --color-code-bg: #{rgba($color-text-secondary, 0.08)};\n --color-code-own: #3c7940;\n --color-code-own-bg: #{rgba($color-text-secondary, 0.08)};\n\n --color-accent-own: #{$color-text-green};\n --color-message-meta-own: #{$color-text-green};\n\n --color-message-reaction: $color-message-reaction;\n --color-message-reaction-hover: $color-message-reaction-hover;\n --color-message-reaction-own: $color-message-reaction-own;\n --color-message-reaction-hover-own: $color-message-reaction-own-hover;\n\n --color-reply-hover: #{blend-normal(rgba($color-text-secondary, 0.08), $color-white)};\n --color-reply-active: #{blend-normal(rgba($color-text-secondary, 0.16), $color-white)};\n --color-reply-own-hover: #{blend-normal(rgba($color-text-green, 0.12), $color-light-green)};\n --color-reply-own-active: #{blend-normal(rgba($color-text-green, 0.24), $color-light-green)};\n\n --color-background-own-apple: #dcf8c5;\n --color-reply-own-hover-apple: #cbefb7;\n --color-reply-own-active-apple: #bae6a8;\n\n --color-white: #{$color-white};\n --color-gray: #{$color-gray};\n\n --color-chat-hover: #{$color-chat-hover};\n --color-chat-active: #{$color-chat-active};\n --color-item-active: #{$color-item-active};\n\n --color-selection-highlight: #{$color-selection};\n --color-selection-highlight-emoji: rgba(#{toRGB($color-selection)}, 0.7);\n\n --color-user-1: #{$color-user-1};\n --color-user-2: #{$color-user-2};\n --color-user-4: #{$color-user-4};\n --color-user-5: #{$color-user-5};\n --color-user-6: #{$color-user-6};\n --color-user-7: #{$color-user-7};\n --color-user-8: #{$color-user-8};\n\n --color-default-shadow: #72727240;\n --color-light-shadow: #7272722b;\n\n --vh: 1vh;\n\n --border-radius-default: 0.75rem;\n --border-radius-default-small: 0.625rem;\n --border-radius-default-tiny: 0.375rem;\n --border-radius-messages: 0.75rem;\n --border-radius-messages-small: 0.375rem;\n --messages-container-width: 45.5rem;\n --right-column-width: 26.5rem;\n --header-height: 3.5rem;\n\n --symbol-menu-width: 26.25rem;\n --symbol-menu-height: 23.25rem;\n --symbol-menu-footer-height: 3rem;\n\n @media (min-width: 1276px) and (max-width: 1920px) {\n --right-column-width: 25vw;\n }\n\n @media (min-width: 1921px) {\n --messages-container-width: 50vw;\n }\n\n @media (max-width: 600px) {\n --right-column-width: 100vw;\n --symbol-menu-width: 100vw;\n --symbol-menu-height: 14.6875rem;\n }\n\n --z-ui-loader-mask: 2000;\n --z-notification: 1000;\n --z-right-column: 900;\n --z-header-menu: 990;\n --z-header-menu-backdrop: 980;\n --z-modal: 1000;\n --z-media-viewer: 1500;\n --z-drop-area: 55;\n --z-animation-fade: 50;\n --z-menu-bubble: 21;\n --z-menu-backdrop: 20;\n --z-message-highlighted: 14;\n --z-message-context-menu: 13;\n --z-scroll-down-button: 12;\n --z-mobile-search: 12;\n --z-middle-header: 11;\n --z-middle-footer: 11;\n --z-country-code-input-group: 10;\n --z-message-select-control: 9;\n --z-message-select-area: 8;\n --z-sticky-date: 9;\n --z-register-add-avatar: 5;\n --z-media-viewer-head: 3;\n --z-resize-handle: 2;\n --z-below: -1;\n\n --spinner-white-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI2ZmZmZmZiIvPjwvc3ZnPg==);\n --spinner-white-thin-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3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AxMC40LTExLjYgOS43eiIgZmlsbD0iIzgzNzhEQiIvPjwvc3ZnPg==);\n --spinner-black-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzJlMzkzOSIvPjwvc3ZnPg==);\n --spinner-green-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRmYWU0ZSIvPjwvc3ZnPg==);\n --spinner-gray-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzcwNzU3OSIvPjwvc3ZnPg==);\n --spinner-yellow-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI0ZERDc2NCIvPjwvc3ZnPg==);\n\n --drag-target-border: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%23DDDFE0' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n --drag-target-border-hovered: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%2363A2E3' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n\n --layer-blackout-opacity: 0.3;\n\n --layer-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);\n --slide-transition: 300ms cubic-bezier(0.25, 1, 0.5, 1);\n --select-transition: 200ms ease-out;\n\n body.is-ios {\n --layer-transition: 450ms cubic-bezier(0.33, 1, 0.68, 1);\n --slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n }\n\n body.is-android {\n --layer-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n --slide-transition: 400ms cubic-bezier(0.25, 1, 0.5, 1);\n }\n}\n","@use \"sass:map\";\n\n$spacer: 1rem !default;\n$spacers: () !default;\n$spacers: map.merge(\n (\n 0: 0,\n 1: (\n $spacer * 0.25,\n ),\n 2: (\n $spacer * 0.5,\n ),\n 3: $spacer,\n 4: (\n $spacer * 1.5,\n ),\n 5: (\n $spacer * 2,\n ),\n 6: (\n $spacer * 3,\n ),\n ),\n $spacers\n);\n\n// Margin and Padding\n\n@each $prop, $abbrev in (margin: m, padding: p) {\n @each $size, $length in $spacers {\n .#{$abbrev}-#{$size} {\n #{$prop}: $length !important;\n }\n .#{$abbrev}t-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-top: $length !important;\n }\n .#{$abbrev}r-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-right: $length !important;\n }\n .#{$abbrev}b-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-bottom: $length !important;\n }\n .#{$abbrev}l-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-left: $length !important;\n }\n }\n}\n",".input-group {\n position: relative;\n margin-bottom: 1.5rem;\n\n label {\n display: block;\n padding: 0 0.25rem;\n position: absolute;\n left: 0.75rem;\n top: 0.9375rem;\n background-color: var(--color-background);\n font-size: 1rem;\n font-weight: 400;\n color: var(--color-placeholders);\n transition: transform 0.15s ease-out, color 0.15s ease-out;\n cursor: text;\n pointer-events: none;\n transform-origin: left center;\n white-space: nowrap;\n }\n\n &.with-arrow {\n &::after {\n content: \"\";\n position: absolute;\n height: 0.75rem;\n width: 0.75rem;\n border-left: 1px var(--color-text-secondary) solid;\n border-bottom: 1px var(--color-text-secondary) solid;\n transform: rotate(-45deg);\n right: 2rem;\n top: 1rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(0.75) translate(-0.5rem, -2.25rem);\n }\n\n input::placeholder,\n .form-control::placeholder {\n color: var(--color-placeholders);\n }\n\n &.touched label {\n color: var(--color-text-secondary);\n }\n\n &.error label {\n color: var(--color-error) !important;\n }\n\n &.success label {\n color: var(--color-text-green) !important;\n }\n\n &.disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n\n &[dir=\"rtl\"] {\n input {\n text-align: right;\n }\n\n label {\n left: auto;\n right: 0.75rem;\n }\n\n &.with-arrow {\n &::after {\n border-left: none;\n border-right: 1px var(--color-text-secondary) solid;\n right: auto;\n left: 2rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(0.75) translate(1.5rem, -2.25rem);\n }\n }\n}\n\n.form-control {\n --border-width: 1px;\n display: block;\n width: 100%;\n height: 3.375rem;\n padding: calc(0.75rem - var(--border-width)) calc(0.9rem - var(--border-width));\n border: var(--border-width) solid var(--color-borders-input);\n border-radius: var(--border-radius-default);\n color: var(--color-text);\n background-color: var(--color-background);\n outline: none;\n transition: border-color 0.15s ease;\n word-break: break-word;\n -webkit-appearance: none;\n\n font-size: 1rem;\n line-height: 1.25rem;\n\n &[dir] {\n text-align: initial;\n }\n\n &:hover {\n border-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:focus,\n &.focus {\n border-color: var(--color-primary);\n box-shadow: inset 0 0 0 1px var(--color-primary);\n caret-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:disabled {\n background: none !important;\n }\n\n .error & {\n border-color: var(--color-error);\n box-shadow: inset 0 0 0 1px var(--color-error);\n caret-color: var(--color-error);\n }\n\n .success & {\n border-color: var(--color-text-green);\n box-shadow: inset 0 0 0 1px var(--color-text-green);\n caret-color: var(--color-text-green);\n }\n}\n\nselect.form-control {\n option {\n line-height: 2rem;\n }\n}\n\ntextarea.form-control {\n resize: none;\n overflow: hidden;\n line-height: 1.3125rem;\n padding-top: calc(1rem - var(--border-width));\n padding-bottom: calc(1rem - var(--border-width));\n}\n\n.input-group.password-input {\n position: relative;\n\n .form-control {\n padding-right: 3.375rem;\n }\n\n .toggle-password {\n position: absolute;\n top: 0;\n right: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n outline: none !important;\n\n color: var(--color-text-secondary);\n opacity: 0.7;\n font-size: 1.5rem;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n }\n\n &[dir=\"rtl\"] {\n .form-control {\n padding-left: 3.375rem;\n padding-right: calc(0.9rem - var(--border-width));\n }\n\n .toggle-password {\n left: 0;\n right: auto;\n }\n }\n}\n","@font-face {\n font-family: 'icomoon';\n src: url('../assets/fonts/icomoon.woff2?n9djnk') format('woff2'),\n url('../assets/fonts/icomoon.woff?n9djnk') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n}\n\n[class^=\"icon-\"], [class*=\" icon-\"] {\n /* use !important to prevent issues with browser extensions that change fonts */\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: 'icomoon' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[class^=\"icon-char-\"], [class*=\" icon-char-\"] {\n &::before {\n font-family: Roboto, \"Helvetica Neue\", sans-serif;\n content: attr(data-char);\n width: 1.5rem;\n text-align: center;\n display: block;\n }\n}\n\n.icon-loop:before {\n content: \"\\e98c\";\n}\n.icon-skip-next:before {\n content: \"\\e98d\";\n}\n.icon-skip-previous:before {\n content: \"\\e98e\";\n}\n.icon-volume-1:before {\n content: \"\\e98f\";\n}\n.icon-volume-2:before {\n content: \"\\e990\";\n}\n.icon-volume-3:before {\n content: \"\\e991\";\n}\n.icon-reaction-filled:before {\n content: \"\\e994\";\n}\n.icon-reactions:before {\n content: \"\\e993\";\n}\n.icon-sidebar:before {\n content: \"\\e992\";\n}\n.icon-video-stop:before {\n content: \"\\e98b\";\n}\n.icon-speaker:before {\n content: \"\\e981\";\n}\n.icon-speaker-outline:before {\n content: \"\\e982\";\n}\n.icon-phone-discard-outline:before {\n content: \"\\e983\";\n}\n.icon-allow-speak:before {\n content: \"\\e984\";\n}\n.icon-stop-raising-hand:before {\n content: \"\\e985\";\n}\n.icon-share-screen:before {\n content: \"\\e986\";\n}\n.icon-voice-chat:before {\n content: \"\\e987\";\n}\n.icon-video:before {\n content: \"\\e988\";\n}\n.icon-noise-suppression:before {\n content: \"\\e989\";\n}\n.icon-phone-discard:before {\n content: \"\\e98a\";\n}\n.icon-bot-commands-filled:before {\n content: \"\\e97f\";\n}\n.icon-reply-filled:before {\n content: \"\\e980\";\n}\n.icon-bug:before {\n content: \"\\e97e\";\n}\n.icon-data:before {\n content: \"\\e97d\";\n}\n.icon-darkmode:before {\n content: \"\\e979\";\n}\n.icon-animations:before {\n content: \"\\e97a\";\n}\n.icon-enter:before {\n content: \"\\e97b\";\n}\n.icon-fontsize:before {\n content: \"\\e97c\";\n}\n.icon-permissions:before {\n content: \"\\e976\";\n}\n.icon-card:before {\n content: \"\\e977\";\n}\n.icon-truck:before {\n content: \"\\e978\";\n}\n.icon-share-filled:before {\n content: \"\\e95a\";\n}\n.icon-bold:before {\n content: \"\\e961\";\n}\n.icon-bot-command:before {\n content: \"\\e962\";\n}\n.icon-calendar-filter:before {\n content: \"\\e963\";\n}\n.icon-comments:before {\n content: \"\\e964\";\n}\n.icon-comments-sticker:before {\n content: \"\\e965\";\n}\n.icon-arrow-down:before {\n content: \"\\e966\";\n}\n.icon-email:before {\n content: \"\\e967\";\n}\n.icon-italic:before {\n content: \"\\e968\";\n}\n.icon-link:before {\n content: \"\\e969\";\n}\n.icon-mention:before {\n content: \"\\e96a\";\n}\n.icon-monospace:before {\n content: \"\\e96b\";\n}\n.icon-next:before {\n content: \"\\e96c\";\n}\n.icon-password-off:before {\n content: \"\\e96d\";\n}\n.icon-pin-list:before {\n content: \"\\e96e\";\n}\n.icon-previous:before {\n content: \"\\e96f\";\n}\n.icon-replace:before {\n content: \"\\e970\";\n}\n.icon-schedule:before {\n content: \"\\e971\";\n}\n.icon-strikethrough:before {\n content: \"\\e972\";\n}\n.icon-underlined:before {\n content: \"\\e973\";\n}\n.icon-zoom-in:before {\n content: \"\\e974\";\n}\n.icon-zoom-out:before {\n content: \"\\e975\";\n}\n.icon-select:before {\n content: \"\\e960\";\n}\n.icon-folder:before {\n content: \"\\e913\";\n}\n.icon-bots:before {\n content: \"\\e915\";\n}\n.icon-calendar:before {\n content: \"\\e916\";\n}\n.icon-cloud-download:before {\n content: \"\\e917\";\n}\n.icon-colorize:before {\n content: \"\\e918\";\n}\n.icon-forward:before {\n content: \"\\e927\";\n}\n.icon-reply:before {\n content: \"\\e947\";\n}\n.icon-help:before {\n content: \"\\e92a\";\n}\n.icon-info:before {\n content: \"\\e92b\";\n}\n.icon-info-filled:before {\n content: \"\\e91b\";\n}\n.icon-delete-filled:before {\n content: \"\\e91c\";\n}\n.icon-delete:before {\n content: \"\\e91d\";\n}\n.icon-edit:before {\n content: \"\\e923\";\n}\n.icon-new-chat-filled:before {\n content: \"\\e939\";\n}\n.icon-send:before {\n content: \"\\e94a\";\n}\n.icon-send-outline:before {\n content: \"\\e94b\";\n}\n.icon-add-user-filled:before {\n content: \"\\e904\";\n}\n.icon-add-user:before {\n content: \"\\e905\";\n}\n.icon-delete-user:before {\n content: \"\\e91e\";\n}\n.icon-microphone:before {\n content: \"\\e935\";\n}\n.icon-microphone-alt:before {\n content: \"\\e93b\";\n}\n.icon-poll:before {\n content: \"\\e938\";\n}\n.icon-revote:before {\n content: \"\\e93a\";\n}\n.icon-photo:before {\n content: \"\\e940\";\n}\n.icon-document:before {\n content: \"\\e91f\";\n}\n.icon-camera:before {\n content: \"\\e90e\";\n}\n.icon-camera-add:before {\n content: \"\\e90f\";\n}\n.icon-logout:before {\n content: \"\\e932\";\n}\n.icon-saved-messages:before {\n content: \"\\e948\";\n}\n.icon-settings:before {\n content: \"\\e94e\";\n}\n.icon-phone:before {\n content: \"\\e93f\";\n}\n.icon-attach:before {\n content: \"\\e909\";\n}\n.icon-copy:before {\n content: \"\\e91a\";\n}\n.icon-channel:before {\n content: \"\\e911\";\n}\n.icon-group:before {\n content: \"\\e929\";\n}\n.icon-user:before {\n content: \"\\e959\";\n}\n.icon-non-contacts:before {\n content: \"\\e928\";\n}\n.icon-active-sessions:before {\n content: \"\\e902\";\n}\n.icon-admin:before {\n content: \"\\e906\";\n}\n.icon-download:before {\n content: \"\\e921\";\n}\n.icon-location:before {\n content: \"\\e930\";\n}\n.icon-stop:before {\n content: \"\\e952\";\n}\n.icon-archive:before {\n content: \"\\e908\";\n}\n.icon-unarchive:before {\n content: \"\\e953\";\n}\n.icon-readchats:before {\n content: \"\\e933\";\n}\n.icon-unread:before {\n content: \"\\e957\";\n}\n.icon-message:before {\n content: \"\\e934\";\n}\n.icon-lock:before {\n content: \"\\e931\";\n}\n.icon-unlock:before {\n content: \"\\e954\";\n}\n.icon-mute:before {\n content: \"\\e937\";\n}\n.icon-unmute:before {\n content: \"\\e955\";\n}\n.icon-pin:before {\n content: \"\\e941\";\n}\n.icon-unpin:before {\n content: \"\\e956\";\n}\n.icon-smallscreen:before {\n content: \"\\e95e\";\n}\n.icon-fullscreen:before {\n content: \"\\e95f\";\n}\n.icon-large-pause:before {\n content: \"\\e92e\";\n}\n.icon-large-play:before {\n content: \"\\e92f\";\n}\n.icon-pause:before {\n content: \"\\e93d\";\n}\n.icon-play:before {\n content: \"\\e943\";\n}\n.icon-channelviews:before {\n content: \"\\e912\";\n}\n.icon-message-succeeded:before {\n content: \"\\e900\";\n}\n.icon-message-read:before {\n content: \"\\e901\";\n}\n.icon-message-pending:before {\n content: \"\\e94c\";\n}\n.icon-message-failed:before {\n content: \"\\e94d\";\n}\n.icon-favorite:before {\n content: \"\\e93e\";\n}\n.icon-keyboard:before {\n content: \"\\e944\";\n}\n.icon-delete-left:before {\n content: \"\\e945\";\n}\n.icon-recent:before {\n content: \"\\e946\";\n}\n.icon-gifs:before {\n content: \"\\e94f\";\n}\n.icon-stickers:before {\n content: \"\\e95b\";\n}\n.icon-smile:before {\n content: \"\\e950\";\n}\n.icon-animals:before {\n content: \"\\e907\";\n}\n.icon-eats:before {\n content: \"\\e922\";\n}\n.icon-sport:before {\n content: \"\\e951\";\n}\n.icon-car:before {\n content: \"\\e910\";\n}\n.icon-lamp:before {\n content: \"\\e92c\";\n}\n.icon-language:before {\n content: \"\\e92d\";\n}\n.icon-flag:before {\n content: \"\\e926\";\n}\n.icon-more:before {\n content: \"\\e936\";\n}\n.icon-search:before {\n content: \"\\e949\";\n}\n.icon-remove:before {\n content: \"\\e95c\";\n}\n.icon-add:before {\n content: \"\\e903\";\n}\n.icon-check:before {\n content: \"\\e914\";\n}\n.icon-close:before {\n content: \"\\e919\";\n}\n.icon-arrow-left:before {\n content: \"\\e90d\";\n}\n.icon-arrow-right:before {\n content: \"\\e93c\";\n}\n.icon-down:before {\n content: \"\\e920\";\n}\n.icon-up:before {\n content: \"\\e958\";\n}\n.icon-eye-closed:before {\n content: \"\\e925\";\n}\n.icon-eye:before {\n content: \"\\e924\";\n}\n.icon-muted:before {\n content: \"\\e95d\";\n}\n.icon-avatar-archived-chats:before {\n content: \"\\e90a\";\n}\n.icon-avatar-deleted-account:before {\n content: \"\\e90b\";\n}\n.icon-avatar-saved-messages:before {\n content: \"\\e90c\";\n}\n.icon-pinned-chat:before {\n content: \"\\e942\";\n}\n","@import \"./mixins\";\n\n// Common styles for all media-type components across the app.\n.media-inner {\n position: relative;\n\n video,\n img {\n display: block;\n object-fit: cover;\n }\n\n video {\n background: no-repeat 50% 50%;\n background-size: contain;\n }\n\n .thumbnail ~ .thumbnail,\n .thumbnail ~ .full-media,\n .media-loading {\n position: absolute;\n }\n}\n\n.animated-close-icon {\n position: absolute;\n transform: rotate(-45deg);\n\n &,\n &::before,\n &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform var(--slide-transition);\n }\n\n &::before,\n &::after {\n position: absolute;\n left: 0;\n top: 0;\n content: \"\";\n }\n\n &::before {\n transform: rotate(90deg);\n }\n\n &.no-transition {\n &,\n &::before,\n &::after {\n transition: none;\n }\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0, -0.375rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0, 0.375rem);\n }\n }\n}\n\n// Used by ChatList and ContactList components\n.chat-list {\n background: var(--color-background);\n height: 100%;\n padding: 0.5rem 0.125rem 0.5rem 0.4375rem;\n\n overflow-y: auto;\n body.is-android & {\n @include overflow-y-overlay();\n }\n\n .scroll-container {\n position: relative;\n }\n\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 0;\n padding-right: 0;\n }\n\n .no-results {\n color: var(--color-text-meta);\n margin-top: 2rem;\n text-align: center;\n }\n}\n\n// Used by Avatar and ProfilePhoto components\ndiv {\n &.color-bg-1 {\n --color-user: var(--color-user-1);\n }\n\n &.color-bg-2 {\n --color-user: var(--color-user-2);\n }\n\n &.color-bg-4 {\n --color-user: var(--color-user-4);\n }\n\n &.color-bg-5 {\n --color-user: var(--color-user-5);\n }\n\n &.color-bg-6 {\n --color-user: var(--color-user-6);\n }\n\n &.color-bg-7 {\n --color-user: var(--color-user-7);\n }\n\n &.color-bg-8 {\n --color-user: var(--color-user-8);\n }\n\n &.replies-bot-account,\n &.saved-messages {\n --color-user: var(--color-primary);\n }\n\n &.deleted-account {\n --color-user: var(--color-gray);\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n","@media print {\n body,\n html,\n .messages-layout {\n background: #fff;\n }\n\n #LeftColumn,\n #RightColumn-wrapper,\n .ChatOrUserPicker,\n #Notifications,\n .Modal,\n .ActiveCallHeader,\n .unread-count,\n #middle-column-bg,\n #middle-column-portals,\n .header-tools,\n .ScrollDownButton,\n .middle-column-footer {\n display: none !important;\n }\n\n #MiddleColumn {\n border-left: none !important;\n }\n\n html,\n body,\n #root,\n #UiLoader,\n #Main,\n #MiddleColumn,\n .MessageList,\n .messages-layout,\n .Transition,\n .Transition > * {\n height: auto !important;\n overflow: visible !important;\n display: block !important;\n position: static !important;\n margin: 0 !important;\n padding: 0 !important;\n width: 100% !important;\n max-width: 100% !important;\n transform: none !important;\n }\n\n .messages-container {\n max-width: 100rem !important;\n width: 100% !important;\n }\n\n .MessageList .sticky-date > span,\n .MessageList .local-action-message > span,\n .MessageList .ActionMessage > span,\n .MessageList .empty > span {\n background: var(--color-background-own) !important;\n color: var(--color-text) !important;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.1badc5f80faa798031b2.css b/dist/main.fa9fe60109fab1dcd0cb.css similarity index 99% rename from dist/main.1badc5f80faa798031b2.css rename to dist/main.fa9fe60109fab1dcd0cb.css index a4733662..b6cf8e33 100644 --- a/dist/main.1badc5f80faa798031b2.css +++ b/dist/main.fa9fe60109fab1dcd0cb.css @@ -6,7 +6,7 @@ .Button{outline:none !important;display:flex;align-items:center;justify-content:center;width:100%;height:3.5rem;border:0;border-radius:var(--border-radius-default);background-color:transparent;background-size:cover;padding:.625rem;color:#fff;line-height:1.2;cursor:pointer;text-transform:uppercase;flex-shrink:0;position:relative;overflow:hidden;transition:background-color .15s,color .15s;text-decoration:none !important}.Button:active,.Button.clicked,body.animation-level-0 .Button{transition:none !important}.Button.disabled{opacity:.5 !important;cursor:default;pointer-events:none}.Button.round{width:3.5rem;border-radius:50%}.Button.round i{font-size:1.5rem}.Button.primary{background-color:var(--color-primary);color:var(--color-white);--ripple-color: rgba(0, 0, 0, 0.08)}.Button.primary:not(.disabled):not(:disabled):active,.Button.primary:not(.disabled):not(:disabled).active,.Button.primary:not(.disabled):not(:disabled):focus{background-color:var(--color-primary-shade)}@media(hover: hover){.Button.primary:not(.disabled):not(:disabled):hover{background-color:var(--color-primary-shade)}}body.animation-level-0 .Button.primary:not(.disabled):not(:disabled):active{background-color:var(--color-primary-shade-darker)}.Button.secondary{background-color:var(--color-background);color:rgba(var(--color-text-secondary-rgb), 0.75);--ripple-color: rgba(0, 0, 0, 0.08)}.Button.secondary:not(.disabled):not(:disabled):active,.Button.secondary:not(.disabled):not(:disabled).active,.Button.secondary:not(.disabled):not(:disabled):focus{background-color:var(--color-primary);color:#fff}@media(hover: hover){.Button.secondary:not(.disabled):not(:disabled):hover{background-color:var(--color-primary);color:#fff}}body.animation-level-0 .Button.secondary:not(.disabled):not(:disabled):active{background-color:var(--color-primary-shade)}.Button.gray{background-color:var(--color-background);color:var(--color-text-secondary);--ripple-color: rgba(0, 0, 0, 0.08)}.Button.gray:not(.disabled):not(:disabled):active,.Button.gray:not(.disabled):not(:disabled).active,.Button.gray:not(.disabled):not(:disabled):focus{color:var(--color-primary)}@media(hover: hover){.Button.gray:not(.disabled):not(:disabled):hover{color:var(--color-primary)}}body.animation-level-0 .Button.gray:not(.disabled):not(:disabled):active{background-color:var(--color-chat-hover)}.Button.danger{background-color:var(--color-background);color:var(--color-error);--ripple-color: rgba(var(--color-error-rgb), 0.16)}.Button.danger:not(.disabled):not(:disabled):active,.Button.danger:not(.disabled):not(:disabled).active,.Button.danger:not(.disabled):not(:disabled):focus{background-color:var(--color-error);color:var(--color-white)}@media(hover: hover){.Button.danger:not(.disabled):not(:disabled):hover{background-color:var(--color-error);color:var(--color-white)}}body.animation-level-0 .Button.danger:not(.disabled):not(:disabled):active{background-color:var(--color-error-shade)}.Button.text{background-color:transparent}.Button.text.primary{color:var(--color-primary);background-color:transparent}.Button.text.primary:not(.disabled):not(:disabled):active,.Button.text.primary:not(.disabled):not(:disabled).active,.Button.text.primary:not(.disabled):not(:disabled):focus{background-color:rgba(var(--color-primary-shade-rgb), 0.08)}@media(hover: hover){.Button.text.primary:not(.disabled):not(:disabled):hover{background-color:rgba(var(--color-primary-shade-rgb), 0.08)}}body.animation-level-0 .Button.text.primary:not(.disabled):not(:disabled):active{background-color:rgba(var(--color-primary-shade-rgb), 0.16)}.Button.text.secondary{background-color:transparent;color:var(--color-text-secondary)}.Button.text.danger:not(.disabled):not(:disabled):active,.Button.text.danger:not(.disabled):not(:disabled).active,.Button.text.danger:not(.disabled):not(:disabled):focus{background-color:rgba(var(--color-error-rgb), 0.08);color:var(--color-error)}@media(hover: hover){.Button.text.danger:not(.disabled):not(:disabled):hover{background-color:rgba(var(--color-error-rgb), 0.08);color:var(--color-error)}}body.animation-level-0 .Button.text.danger:not(.disabled):not(:disabled):active{background-color:rgba(var(--color-error-rgb), 0.16)}.Button.faded{opacity:.8}.Button.faded:not(.disabled):not(:disabled):active,.Button.faded:not(.disabled):not(:disabled).active,.Button.faded:not(.disabled):not(:disabled):focus{opacity:1}@media(hover: hover){.Button.faded:not(.disabled):not(:disabled):hover{opacity:1}}.Button.faded.activated{opacity:1}.Button.translucent{background-color:transparent;color:var(--color-text-secondary);--ripple-color: var(--color-interactive-element-hover)}.Button.translucent:not(.disabled):not(:disabled):active,.Button.translucent:not(.disabled):not(:disabled).active,.Button.translucent:not(.disabled):not(:disabled):focus{background-color:var(--color-interactive-element-hover)}@media(hover: hover){.Button.translucent:not(.disabled):not(:disabled):hover{background-color:var(--color-interactive-element-hover)}}body.animation-level-0 .Button.translucent:not(.disabled):not(:disabled):active{background-color:rgba(var(--color-text-secondary-rgb), 0.16)}.Button.translucent.activated{color:var(--color-primary)}.Button.translucent-white{background-color:transparent;color:rgba(255,255,255,.5);--ripple-color: rgba(255, 255, 255, 0.08)}.Button.translucent-white:not(.disabled):not(:disabled):active,.Button.translucent-white:not(.disabled):not(:disabled).active,.Button.translucent-white:not(.disabled):not(:disabled):focus{background-color:rgba(255,255,255,.08);color:#fff}@media(hover: hover){.Button.translucent-white:not(.disabled):not(:disabled):hover{background-color:rgba(255,255,255,.08);color:#fff}}body.animation-level-0 .Button.translucent-white:not(.disabled):not(:disabled):active{background-color:rgba(255,255,255,.16)}.Button.translucent-black{background-color:transparent;color:rgba(0,0,0,.8);--ripple-color: rgba(0, 0, 0, 0.08)}.Button.translucent-black:not(.disabled):not(:disabled):active,.Button.translucent-black:not(.disabled):not(:disabled).active,.Button.translucent-black:not(.disabled):not(:disabled):focus{background-color:rgba(0,0,0,.08)}@media(hover: hover){.Button.translucent-black:not(.disabled):not(:disabled):hover{background-color:rgba(0,0,0,.08)}}body.animation-level-0 .Button.translucent-black:not(.disabled):not(:disabled):active{background-color:rgba(0,0,0,.16)}.Button.dark{background-color:rgba(0,0,0,.75);color:#fff;--ripple-color: rgba(255, 255, 255, 0.08)}.Button.dark:not(.disabled):not(:disabled):active,.Button.dark:not(.disabled):not(:disabled).active,.Button.dark:not(.disabled):not(:disabled):focus{background-color:rgba(0,0,0,.85);color:#fff}@media(hover: hover){.Button.dark:not(.disabled):not(:disabled):hover{background-color:rgba(0,0,0,.85);color:#fff}}body.animation-level-0 .Button.dark:not(.disabled):not(:disabled):active{background-color:rgba(0,0,0,.95)}.Button.smaller{height:2.75rem;padding:.3125rem}.Button.smaller.round{width:2.75rem}.Button.smaller.pill{height:2.5rem;border-radius:1.25rem;padding:.3125rem 1rem}.Button.smaller.with-icon{padding-left:.75rem;padding-right:1.25rem}.Button.smaller.with-icon i{font-size:1.5rem;margin-right:.5rem}.Button.smaller.with-icon[dir=rtl]{padding-left:1.25rem;padding-right:.75rem}.Button.smaller.with-icon[dir=rtl] i{margin-left:.5rem;margin-right:0}@media(max-width: 600px){.Button.smaller{height:2.5rem}.Button.smaller.round{width:2.5rem}}.Button.tiny{height:2.25rem;padding:.4375rem;border-radius:var(--border-radius-default-small);font-size:.875rem;font-weight:500}.Button.tiny.round{width:2.25rem;height:2.25rem;border-radius:50%}.Button.tiny i{font-size:1.25rem}.Button.tiny.pill{height:2rem;border-radius:1rem;padding:.3125rem 1rem;font-size:1rem}.Button.fluid{padding-left:1.75rem;padding-right:1.75rem;width:auto}.Button.fluid.tiny{padding-left:1.375rem;padding-right:1.375rem}.Button.pill{border-radius:1.75rem;padding-left:1.75rem;padding-right:1.75rem;text-transform:none}.Button.loading{position:relative;pointer-events:none}.Button.loading .Spinner{position:absolute;right:.875rem;top:.875rem;--spinner-size: 1.8125rem}.Button .emoji{vertical-align:-3px} .Checkbox{display:block;position:relative;padding-left:4.5rem;text-align:left;margin-bottom:1.5rem;line-height:1.5rem;cursor:pointer}.Checkbox.disabled{pointer-events:none;opacity:.5}.Checkbox.round .Checkbox-main::before{border-radius:50%}.Checkbox.round .Checkbox-main::after{background:var(--color-primary) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=) no-repeat 50% 50%;background-size:12px;border-radius:50%}.Checkbox.loading .Checkbox-main::before,.Checkbox.loading .Checkbox-main::after{opacity:0 !important}.Checkbox.loading .Spinner{position:absolute;left:.375rem;top:.125rem;opacity:0;animation:fade-in .2s ease forwards;--spinner-size: 1.25rem}.Checkbox.blocking input:not(:checked)~.Checkbox-main::before{border-color:var(--color-error)}.Checkbox.blocking input:not(:checked)~.Checkbox-main::after{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBvbHlnb24gcG9pbnRzPSIwIDAgMjQgMCAyNCAyNCAwIDI0Ii8+CiAgICA8cGF0aCBmaWxsPSIjZTUzOTM1IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xOCwzIEMxOS42NTY4NTQyLDMgMjEsNC4zNDMxNDU3NSAyMSw2IEwyMSwxOCBDMjEsMTkuNjU2ODU0MiAxOS42NTY4NTQyLDIxIDE4LDIxIEw2LDIxIEM0LjM0MzE0NTc1LDIxIDMsMTkuNjU2ODU0MiAzLDE4IEwzLDYgQzMsNC4zNDMxNDU3NSA0LjM0MzE0NTc1LDMgNiwzIEwxOCwzIFogTTE2LDExIEw4LDExIEM3LjQ0NzcxNTI1LDExIDcsMTEuNDQ3NzE1MyA3LDEyIEM3LDEyLjU1MjI4NDcgNy40NDc3MTUyNSwxMyA4LDEzIEwxNiwxMyBDMTYuNTUyMjg0NywxMyAxNywxMi41NTIyODQ3IDE3LDEyIEMxNywxMS40NDc3MTUzIDE2LjU1MjI4NDcsMTEgMTYsMTEgWiIvPgogIDwvZz4KPC9zdmc+Cg==);opacity:1;background-size:1.375rem;background-position:-0.125rem -0.125rem}.Checkbox input{position:absolute;z-index:var(--z-below);opacity:0}.Checkbox .Checkbox-main::before,.Checkbox .Checkbox-main::after{content:"";display:block;position:absolute;left:1.1875rem;top:.1875rem;width:1.125rem;height:1.125rem}.Checkbox .Checkbox-main::before{border:2px solid var(--color-borders-input);border-radius:.25rem;background-color:var(--color-background);transition:border-color .1s ease,background-color .1s ease}.Checkbox .Checkbox-main::after{background:center no-repeat url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==);background-size:.875rem;opacity:0;transition:opacity .1s ease}.Checkbox .Checkbox-main .label{display:block;text-align:initial}.Checkbox .Checkbox-main .subLabel{display:block;font-size:.875rem;line-height:1rem;color:var(--color-text-secondary)}.Checkbox input:checked~.Checkbox-main::before{border-color:var(--color-primary);background-color:var(--color-primary)}.Checkbox input:checked~.Checkbox-main::after{opacity:1}.Checkbox[dir=rtl]{padding-left:0;padding-right:4.5rem}.Checkbox[dir=rtl].loading .Spinner{left:auto;right:.375rem}.Checkbox[dir=rtl] .label,.Checkbox[dir=rtl] .subLabel{text-align:right}.Checkbox[dir=rtl] .Checkbox-main::before,.Checkbox[dir=rtl] .Checkbox-main::after{left:auto;right:1.1875rem} .Loading{display:flex;height:100%;align-items:center;justify-content:center}.Loading.interactive{cursor:pointer}.Loading .Spinner{--spinner-size: 2.75rem} -.Menu.fluid .bubble{min-width:13.5rem;width:auto}.Menu .backdrop{position:fixed;left:-100vw;right:-100vw;top:-100vh;bottom:-100vh;z-index:var(--z-menu-backdrop)}.Menu .bubble{overflow:hidden;display:block;list-style:none;padding:.5rem 0;margin:0;position:absolute;background-color:var(--color-background);box-shadow:0 .25rem .5rem .125rem var(--color-default-shadow);border-radius:var(--border-radius-default);min-width:13.5rem;z-index:var(--z-menu-bubble);overscroll-behavior:contain;transform:scale(0.5);transition:opacity .2s cubic-bezier(0.2, 0, 0.2, 1),transform .2s cubic-bezier(0.2, 0, 0.2, 1) !important;--offset-y: calc(100% + 0.5rem);--offset-x: 0}.Menu .bubble.open{transform:scale(1)}.Menu .bubble.closing{transition:opacity .2s ease-in,transform .2s ease-in !important}body.animation-level-0 .Menu .bubble{transform:none !important;transition:opacity .15s !important}body.has-open-dialog .Menu .bubble{transition:none !important}.Menu .bubble.top{top:var(--offset-y)}.Menu .bubble.bottom{bottom:var(--offset-y)}.Menu .bubble.left{left:var(--offset-x)}.Menu .bubble.right{right:var(--offset-x)}.Menu .bubble.with-footer{padding-bottom:0}.Menu .footer{padding:.5rem 0;background:var(--color-chat-hover);color:var(--color-text-secondary);font-size:.8125rem;text-align:center}.Menu.compact .bubble{background:var(--color-background-compact-menu);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:.25rem 0}.Menu.compact .footer{background:none} +.Menu.fluid .bubble{min-width:13.5rem;width:auto}.Menu .backdrop{position:fixed;left:-100vw;right:-100vw;top:-100vh;bottom:-100vh;z-index:var(--z-menu-backdrop)}.Menu .bubble{overflow:hidden;display:block;list-style:none;padding:.5rem 0;margin:0;position:absolute;background-color:var(--color-background);box-shadow:0 .25rem .5rem .125rem var(--color-default-shadow);border-radius:var(--border-radius-default);min-width:13.5rem;z-index:var(--z-menu-bubble);overscroll-behavior:contain;transform:scale(0.5);transition:opacity .2s cubic-bezier(0.2, 0, 0.2, 1),transform .2s cubic-bezier(0.2, 0, 0.2, 1) !important;--offset-y: calc(100% + 0.5rem);--offset-x: 0}.Menu .bubble.open{transform:scale(1)}.Menu .bubble.closing{transition:opacity .2s ease-in,transform .2s ease-in !important}body.animation-level-0 .Menu .bubble{transform:none !important;transition:opacity .15s !important}body.has-open-dialog .Menu .bubble{transition:none !important}.Menu .bubble.top{top:var(--offset-y)}.Menu .bubble.bottom{bottom:var(--offset-y)}.Menu .bubble.left{left:var(--offset-x)}.Menu .bubble.right{right:var(--offset-x)}.Menu .bubble.with-footer{padding-bottom:0}.Menu .footer{padding:.5rem 0;background:var(--color-chat-hover);color:var(--color-text-secondary);font-size:.8125rem;text-align:center}.Menu.compact .bubble{background:var(--color-background-compact-menu);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:.25rem 0}.Menu.compact .footer{background:none}.Menu.compact.no-blur .bubble{background:var(--color-background)} .DropdownMenu{position:relative} .MenuItem{width:100%;background:none;border:none !important;box-shadow:none !important;outline:none !important;display:flex;padding:.75rem 1rem;position:relative;overflow:hidden;line-height:1.5rem;white-space:nowrap;color:var(--color-text);--ripple-color: rgba(0, 0, 0, 0.08);cursor:pointer;unicode-bidi:plaintext}@media(hover: hover){.MenuItem:hover,.MenuItem:focus{background-color:var(--color-chat-hover);text-decoration:none;color:inherit}}@media(max-width: 600px){.MenuItem:focus,.MenuItem:hover,.MenuItem:active{text-decoration:none;color:inherit}.MenuItem:active{background-color:var(--color-chat-hover)}}.MenuItem i{font-size:1.5rem;margin-right:2rem;color:var(--color-text-secondary)}.MenuItem .menu-item-name{margin-right:2rem}.MenuItem .menu-item-name.capitalize{text-transform:capitalize}.MenuItem.disabled{opacity:.5 !important;cursor:default !important}.MenuItem.destructive{color:var(--color-error)}.MenuItem.destructive i{color:inherit}.MenuItem:not(.has-ripple):not(.disabled):not(.compact):active{background-color:var(--color-item-active);transition:none !important}.MenuItem>.Switcher{margin-left:auto}.MenuItem[dir=rtl] i{margin-left:2rem;margin-right:0}.MenuItem[dir=rtl] .menu-item-name{margin-left:2rem;margin-right:0}.MenuItem[dir=rtl]>.Switcher{margin-left:0;margin-right:auto}.MenuItem.compact{align-items:center;font-size:.875rem;margin:.125rem .25rem;padding:.25rem;border-radius:.375rem;width:auto;font-weight:500;transform:scale(1);transition:.15s ease-in-out transform}.MenuItem.compact i{font-size:1.25rem;margin-left:.5rem;margin-right:1.25rem}@media(hover: hover){.MenuItem.compact:hover,.MenuItem.compact:focus,.MenuItem.compact:active{background:var(--color-background-compact-menu-hover);text-decoration:none}.MenuItem.compact:active{transform:scale(0.98)}} .CountryCodeInput .input-group{cursor:pointer;z-index:var(--z-country-code-input-group)}.CountryCodeInput .input-group .Spinner{position:absolute;top:1rem;right:.75rem;opacity:.5;--spinner-size: 1.5rem}.CountryCodeInput .input-group .css-icon-down{position:absolute;top:1.125rem;right:1rem;width:.75rem;height:.75rem;border:2px solid var(--color-text-secondary);border-top:0;border-left:0;transform:scaleY(1) rotate(45deg);transition:color .2s ease,transform .2s ease,top .2s ease}.CountryCodeInput .input-group .css-icon-down.open{border-color:var(--color-primary);transform:scaleY(-1) rotate(45deg);top:1.5rem}.CountryCodeInput .bubble{width:100%;max-height:23.5rem;overflow-y:auto;transform-origin:top center !important;transform:scale(0.95)}.CountryCodeInput .bubble.open{transform:scaleY(1)}.CountryCodeInput .MenuItem button{display:flex;align-items:center}.CountryCodeInput .MenuItem.no-results button{justify-content:center;padding:.5rem 1rem}.CountryCodeInput .MenuItem.no-results button span{font-size:.875rem}.CountryCodeInput .country-flag{font-size:2rem;margin-right:2rem}.CountryCodeInput .country-flag .emoji{width:2rem;height:2rem;display:inline-block;vertical-align:4px;margin:-0.5rem .125rem}.CountryCodeInput .country-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:1rem;text-align:left}.CountryCodeInput .country-code{margin-left:auto;opacity:.5} @@ -161,4 +161,4 @@ *,*::before,*::after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0}[tabindex="-1"]:focus{outline:none !important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500}abbr[title],abbr[data-original-title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}p,ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dd{margin-bottom:.5rem;margin-left:0}blockquote,figure{margin:0 0 1rem}dfn{font-style:italic}dt,b,strong{font-weight:500}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}a{color:var(--color-links);text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]),a:not([href]):not([tabindex]):hover,a:not([href]):not([tabindex]):focus{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre,code,kbd,samp{font:.9375rem/1.25 "Courier","Courier New","Nimbus Mono L","Courier 10 Pitch","FreeMono",sans-serif-monospace,monospace;font-size-adjust:.43}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none !important}:root{--color-background: #ffffff;--color-background-compact-menu: #FFFFFFBB;--color-background-compact-menu-reactions: #FFFFFFEB;--color-background-compact-menu-hover: #000000B2;--color-background-selected: #f4f4f5;--color-background-secondary: #f4f4f5;--color-background-secondary-accent: #e4e4e5;--color-background-own: #eeffde;--color-background-own-selected: color.adjust($color-light-green, -10%);--color-text: #000000;--color-text-lighter: #2e3939;--color-text-secondary: #707579;--color-text-secondary-rgb: 112, 117, 121;--color-text-secondary-apple: #8a8a90;--color-text-meta: #686c72;--color-text-meta-rgb: 104, 108, 114;--color-text-meta-colored: #4fae4e;--color-text-meta-apple: #8c8c91;--color-text-green: #4fae4e;--color-text-green-rgb: 79, 174, 78;--color-borders: #dadce0;--color-borders-input: #dadce0;--color-dividers: #c8c6cc;--color-webpage-initial-background: #2e3939;--color-interactive-active: var(--color-primary);--color-interactive-inactive: rgba(var(--color-text-secondary-rgb), 0.25);--color-interactive-buffered: rgba(var(--color-text-secondary-rgb), 0.25);--color-interactive-element-hover: rgba(var(--color-text-secondary-rgb), 0.08);--color-composer-button: #707579CC;--color-primary: #3390ec;--color-primary-shade: #2f84d9;--color-primary-shade-darker: #2b79c6;--color-primary-shade-rgb: 47, 132, 217;--color-primary-opacity: rgba(var(--color-primary), 0.5);--color-green: #00c73e;--color-green-darker: #00a734;--color-error: #e53935;--color-error-shade: #d33431;--color-error-rgb: 229, 57, 53;--color-warning: #fb8c00;--color-yellow: #fdd764;--color-links: #3390ec;--color-own-links: #ffffff;--color-placeholders: #a2acb4;--color-pinned: #ffffff;--color-code: #4a729a;--color-code-bg: rgba(112, 117, 121, 0.08);--color-code-own: #3c7940;--color-code-own-bg: rgba(112, 117, 121, 0.08);--color-accent-own: #4fae4e;--color-message-meta-own: #4fae4e;--color-message-reaction: $color-message-reaction;--color-message-reaction-hover: $color-message-reaction-hover;--color-message-reaction-own: $color-message-reaction-own;--color-message-reaction-hover-own: $color-message-reaction-own-hover;--color-reply-hover: #f4f4f4;--color-reply-active: #e8e9ea;--color-reply-own-hover: #dbf5cd;--color-reply-own-active: #c8ecbb;--color-background-own-apple: #dcf8c5;--color-reply-own-hover-apple: #cbefb7;--color-reply-own-active-apple: #bae6a8;--color-white: #ffffff;--color-gray: #c4c9cc;--color-chat-hover: #f4f4f5;--color-chat-active: #3390ec;--color-item-active: #ededed;--color-selection-highlight: #3993fb;--color-selection-highlight-emoji: rgba(57, 147, 251, 0.7);--color-user-1: #e17076;--color-user-2: #7bc862;--color-user-4: #65aadd;--color-user-5: #a695e7;--color-user-6: #ee7aae;--color-user-7: #6ec9cb;--color-user-8: #faa774;--color-default-shadow: #72727240;--color-light-shadow: #7272722b;--vh: 1vh;--border-radius-default: 0.75rem;--border-radius-default-small: 0.625rem;--border-radius-default-tiny: 0.375rem;--border-radius-messages: 0.75rem;--border-radius-messages-small: 0.375rem;--messages-container-width: 45.5rem;--right-column-width: 26.5rem;--header-height: 3.5rem;--symbol-menu-width: 26.25rem;--symbol-menu-height: 23.25rem;--symbol-menu-footer-height: 3rem;--z-ui-loader-mask: 2000;--z-notification: 1000;--z-right-column: 900;--z-header-menu: 990;--z-header-menu-backdrop: 980;--z-modal: 1000;--z-media-viewer: 1500;--z-drop-area: 55;--z-animation-fade: 50;--z-menu-bubble: 21;--z-menu-backdrop: 20;--z-message-highlighted: 14;--z-message-context-menu: 13;--z-scroll-down-button: 12;--z-mobile-search: 12;--z-middle-header: 11;--z-middle-footer: 11;--z-country-code-input-group: 10;--z-message-select-control: 9;--z-message-select-area: 8;--z-sticky-date: 9;--z-register-add-avatar: 5;--z-media-viewer-head: 3;--z-resize-handle: 2;--z-below: -1;--spinner-white-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI2ZmZmZmZiIvPjwvc3ZnPg==);--spinner-white-thin-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTEyIDIzQzUuOSAyMyAxIDE4LjEgMSAxMlM1LjkgMSAxMiAxVjBDNS40IDAgMCA1LjQgMCAxMnM1LjQgMTIgMTIgMTIgMTItNS40IDEyLTEyaC0xYzAgNi4xLTQuOSAxMS0xMSAxMXoiLz48L3N2Zz4=);--spinner-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRlYTRmNiIvPjwvc3ZnPg==);--spinner-dark-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzgzNzhEQiIvPjwvc3ZnPg==);--spinner-black-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmc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IuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzcwNzU3OSIvPjwvc3ZnPg==);--spinner-yellow-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI0ZERDc2NCIvPjwvc3ZnPg==);--drag-target-border: url("data:image/svg+xml,%3csvg width=%27100%25%27 height=%27100%25%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3crect width=%27100%25%27 height=%27100%25%27 fill=%27none%27 rx=%278%27 ry=%278%27 stroke=%27%23DDDFE0%27 stroke-width=%274%27 stroke-dasharray=%279.1%2c 10.5%27 stroke-dashoffset=%273%27 stroke-linecap=%27round%27/%3e%3c/svg%3e");--drag-target-border-hovered: url("data:image/svg+xml,%3csvg width=%27100%25%27 height=%27100%25%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3crect width=%27100%25%27 height=%27100%25%27 fill=%27none%27 rx=%278%27 ry=%278%27 stroke=%27%2363A2E3%27 stroke-width=%274%27 stroke-dasharray=%279.1%2c 10.5%27 stroke-dashoffset=%273%27 stroke-linecap=%27round%27/%3e%3c/svg%3e");--layer-blackout-opacity: 0.3;--layer-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);--slide-transition: 300ms cubic-bezier(0.25, 1, 0.5, 1);--select-transition: 200ms ease-out}@media(min-width: 1276px)and (max-width: 1920px){:root{--right-column-width: 25vw}}@media(min-width: 1921px){:root{--messages-container-width: 50vw}}@media(max-width: 600px){:root{--right-column-width: 100vw;--symbol-menu-width: 100vw;--symbol-menu-height: 14.6875rem}}:root body.is-ios{--layer-transition: 450ms cubic-bezier(0.33, 1, 0.68, 1);--slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1)}:root body.is-android{--layer-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);--slide-transition: 400ms cubic-bezier(0.25, 1, 0.5, 1)}.m-0{margin:0 !important}.mt-0,.my-0{margin-top:0 !important}.mr-0,.mx-0{margin-right:0 !important}.mb-0,.my-0{margin-bottom:0 !important}.ml-0,.mx-0{margin-left:0 !important}.m-1{margin:.25rem !important}.mt-1,.my-1{margin-top:.25rem !important}.mr-1,.mx-1{margin-right:.25rem !important}.mb-1,.my-1{margin-bottom:.25rem !important}.ml-1,.mx-1{margin-left:.25rem !important}.m-2{margin:.5rem !important}.mt-2,.my-2{margin-top:.5rem !important}.mr-2,.mx-2{margin-right:.5rem !important}.mb-2,.my-2{margin-bottom:.5rem !important}.ml-2,.mx-2{margin-left:.5rem !important}.m-3{margin:1rem !important}.mt-3,.my-3{margin-top:1rem !important}.mr-3,.mx-3{margin-right:1rem !important}.mb-3,.my-3{margin-bottom:1rem !important}.ml-3,.mx-3{margin-left:1rem !important}.m-4{margin:1.5rem !important}.mt-4,.my-4{margin-top:1.5rem !important}.mr-4,.mx-4{margin-right:1.5rem !important}.mb-4,.my-4{margin-bottom:1.5rem !important}.ml-4,.mx-4{margin-left:1.5rem !important}.m-5{margin:2rem !important}.mt-5,.my-5{margin-top:2rem !important}.mr-5,.mx-5{margin-right:2rem !important}.mb-5,.my-5{margin-bottom:2rem !important}.ml-5,.mx-5{margin-left:2rem !important}.m-6{margin:3rem !important}.mt-6,.my-6{margin-top:3rem !important}.mr-6,.mx-6{margin-right:3rem !important}.mb-6,.my-6{margin-bottom:3rem !important}.ml-6,.mx-6{margin-left:3rem !important}.p-0{padding:0 !important}.pt-0,.py-0{padding-top:0 !important}.pr-0,.px-0{padding-right:0 !important}.pb-0,.py-0{padding-bottom:0 !important}.pl-0,.px-0{padding-left:0 !important}.p-1{padding:.25rem !important}.pt-1,.py-1{padding-top:.25rem !important}.pr-1,.px-1{padding-right:.25rem !important}.pb-1,.py-1{padding-bottom:.25rem !important}.pl-1,.px-1{padding-left:.25rem !important}.p-2{padding:.5rem !important}.pt-2,.py-2{padding-top:.5rem !important}.pr-2,.px-2{padding-right:.5rem !important}.pb-2,.py-2{padding-bottom:.5rem !important}.pl-2,.px-2{padding-left:.5rem !important}.p-3{padding:1rem !important}.pt-3,.py-3{padding-top:1rem !important}.pr-3,.px-3{padding-right:1rem !important}.pb-3,.py-3{padding-bottom:1rem !important}.pl-3,.px-3{padding-left:1rem !important}.p-4{padding:1.5rem !important}.pt-4,.py-4{padding-top:1.5rem !important}.pr-4,.px-4{padding-right:1.5rem !important}.pb-4,.py-4{padding-bottom:1.5rem !important}.pl-4,.px-4{padding-left:1.5rem !important}.p-5{padding:2rem !important}.pt-5,.py-5{padding-top:2rem !important}.pr-5,.px-5{padding-right:2rem !important}.pb-5,.py-5{padding-bottom:2rem !important}.pl-5,.px-5{padding-left:2rem !important}.p-6{padding:3rem !important}.pt-6,.py-6{padding-top:3rem !important}.pr-6,.px-6{padding-right:3rem !important}.pb-6,.py-6{padding-bottom:3rem !important}.pl-6,.px-6{padding-left:3rem !important}.input-group{position:relative;margin-bottom:1.5rem}.input-group label{display:block;padding:0 .25rem;position:absolute;left:.75rem;top:.9375rem;background-color:var(--color-background);font-size:1rem;font-weight:400;color:var(--color-placeholders);transition:transform .15s ease-out,color .15s ease-out;cursor:text;pointer-events:none;transform-origin:left center;white-space:nowrap}.input-group.with-arrow::after{content:"";position:absolute;height:.75rem;width:.75rem;border-left:1px var(--color-text-secondary) solid;border-bottom:1px var(--color-text-secondary) solid;transform:rotate(-45deg);right:2rem;top:1rem}.input-group.touched label,.input-group.error label,.input-group.success label,.input-group .form-control:focus+label,.input-group .form-control.focus+label{transform:scale(0.75) translate(-0.5rem, -2.25rem)}.input-group input::placeholder,.input-group .form-control::placeholder{color:var(--color-placeholders)}.input-group.touched label{color:var(--color-text-secondary)}.input-group.error label{color:var(--color-error) !important}.input-group.success label{color:var(--color-text-green) !important}.input-group.disabled{opacity:.5;pointer-events:none}.input-group[dir=rtl] input{text-align:right}.input-group[dir=rtl] label{left:auto;right:.75rem}.input-group[dir=rtl].with-arrow::after{border-left:none;border-right:1px var(--color-text-secondary) solid;right:auto;left:2rem}.input-group[dir=rtl].touched label,.input-group[dir=rtl].error label,.input-group[dir=rtl].success label,.input-group[dir=rtl] .form-control:focus+label,.input-group[dir=rtl] .form-control.focus+label{transform:scale(0.75) translate(1.5rem, -2.25rem)}.form-control{--border-width: 1px;display:block;width:100%;height:3.375rem;padding:calc(.75rem - var(--border-width)) calc(.9rem - var(--border-width));border:var(--border-width) solid var(--color-borders-input);border-radius:var(--border-radius-default);color:var(--color-text);background-color:var(--color-background);outline:none;transition:border-color .15s ease;word-break:break-word;-webkit-appearance:none;font-size:1rem;line-height:1.25rem}.form-control[dir]{text-align:initial}.form-control:hover{border-color:var(--color-primary)}.form-control:hover+label{color:var(--color-primary)}.form-control:focus,.form-control.focus{border-color:var(--color-primary);box-shadow:inset 0 0 0 1px var(--color-primary);caret-color:var(--color-primary)}.form-control:focus+label,.form-control.focus+label{color:var(--color-primary)}.form-control:disabled{background:none !important}.error .form-control{border-color:var(--color-error);box-shadow:inset 0 0 0 1px var(--color-error);caret-color:var(--color-error)}.success .form-control{border-color:var(--color-text-green);box-shadow:inset 0 0 0 1px var(--color-text-green);caret-color:var(--color-text-green)}select.form-control option{line-height:2rem}textarea.form-control{resize:none;overflow:hidden;line-height:1.3125rem;padding-top:calc(1rem - var(--border-width));padding-bottom:calc(1rem - var(--border-width))}.input-group.password-input{position:relative}.input-group.password-input .form-control{padding-right:3.375rem}.input-group.password-input .toggle-password{position:absolute;top:0;right:0;width:3.375rem;height:3.375rem;display:flex;align-items:center;justify-content:center;cursor:pointer;outline:none !important;color:var(--color-text-secondary);opacity:.7;font-size:1.5rem}.input-group.password-input .toggle-password:hover,.input-group.password-input .toggle-password:focus{opacity:1}.input-group.password-input[dir=rtl] .form-control{padding-left:3.375rem;padding-right:calc(.9rem - var(--border-width))}.input-group.password-input[dir=rtl] .toggle-password{left:0;right:auto}@font-face{font-family:"icomoon";src:url(icomoon.57726174156380af4e68..woff2) format("woff2"),url(icomoon.9b265b61a1efa088d5c6..woff) format("woff");font-weight:normal;font-style:normal;font-display:block}[class^=icon-],[class*=" icon-"]{font-family:"icomoon" !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[class^=icon-char-]::before,[class*=" icon-char-"]::before{font-family:Roboto,"Helvetica Neue",sans-serif;content:attr(data-char);width:1.5rem;text-align:center;display:block}.icon-loop:before{content:""}.icon-skip-next:before{content:""}.icon-skip-previous:before{content:""}.icon-volume-1:before{content:""}.icon-volume-2:before{content:""}.icon-volume-3:before{content:""}.icon-reaction-filled:before{content:""}.icon-reactions:before{content:""}.icon-sidebar:before{content:""}.icon-video-stop:before{content:""}.icon-speaker:before{content:""}.icon-speaker-outline:before{content:""}.icon-phone-discard-outline:before{content:""}.icon-allow-speak:before{content:""}.icon-stop-raising-hand:before{content:""}.icon-share-screen:before{content:""}.icon-voice-chat:before{content:""}.icon-video:before{content:""}.icon-noise-suppression:before{content:""}.icon-phone-discard:before{content:""}.icon-bot-commands-filled:before{content:""}.icon-reply-filled:before{content:""}.icon-bug:before{content:""}.icon-data:before{content:""}.icon-darkmode:before{content:""}.icon-animations:before{content:""}.icon-enter:before{content:""}.icon-fontsize:before{content:""}.icon-permissions:before{content:""}.icon-card:before{content:""}.icon-truck:before{content:""}.icon-share-filled:before{content:""}.icon-bold:before{content:""}.icon-bot-command:before{content:""}.icon-calendar-filter:before{content:""}.icon-comments:before{content:""}.icon-comments-sticker:before{content:""}.icon-arrow-down:before{content:""}.icon-email:before{content:""}.icon-italic:before{content:""}.icon-link:before{content:""}.icon-mention:before{content:""}.icon-monospace:before{content:""}.icon-next:before{content:""}.icon-password-off:before{content:""}.icon-pin-list:before{content:""}.icon-previous:before{content:""}.icon-replace:before{content:""}.icon-schedule:before{content:""}.icon-strikethrough:before{content:""}.icon-underlined:before{content:""}.icon-zoom-in:before{content:""}.icon-zoom-out:before{content:""}.icon-select:before{content:""}.icon-folder:before{content:""}.icon-bots:before{content:""}.icon-calendar:before{content:""}.icon-cloud-download:before{content:""}.icon-colorize:before{content:""}.icon-forward:before{content:""}.icon-reply:before{content:""}.icon-help:before{content:""}.icon-info:before{content:""}.icon-info-filled:before{content:""}.icon-delete-filled:before{content:""}.icon-delete:before{content:""}.icon-edit:before{content:""}.icon-new-chat-filled:before{content:""}.icon-send:before{content:""}.icon-send-outline:before{content:""}.icon-add-user-filled:before{content:""}.icon-add-user:before{content:""}.icon-delete-user:before{content:""}.icon-microphone:before{content:""}.icon-microphone-alt:before{content:""}.icon-poll:before{content:""}.icon-revote:before{content:""}.icon-photo:before{content:""}.icon-document:before{content:""}.icon-camera:before{content:""}.icon-camera-add:before{content:""}.icon-logout:before{content:""}.icon-saved-messages:before{content:""}.icon-settings:before{content:""}.icon-phone:before{content:""}.icon-attach:before{content:""}.icon-copy:before{content:""}.icon-channel:before{content:""}.icon-group:before{content:""}.icon-user:before{content:""}.icon-non-contacts:before{content:""}.icon-active-sessions:before{content:""}.icon-admin:before{content:""}.icon-download:before{content:""}.icon-location:before{content:""}.icon-stop:before{content:""}.icon-archive:before{content:""}.icon-unarchive:before{content:""}.icon-readchats:before{content:""}.icon-unread:before{content:""}.icon-message:before{content:""}.icon-lock:before{content:""}.icon-unlock:before{content:""}.icon-mute:before{content:""}.icon-unmute:before{content:""}.icon-pin:before{content:""}.icon-unpin:before{content:""}.icon-smallscreen:before{content:""}.icon-fullscreen:before{content:""}.icon-large-pause:before{content:""}.icon-large-play:before{content:""}.icon-pause:before{content:""}.icon-play:before{content:""}.icon-channelviews:before{content:""}.icon-message-succeeded:before{content:""}.icon-message-read:before{content:""}.icon-message-pending:before{content:""}.icon-message-failed:before{content:""}.icon-favorite:before{content:""}.icon-keyboard:before{content:""}.icon-delete-left:before{content:""}.icon-recent:before{content:""}.icon-gifs:before{content:""}.icon-stickers:before{content:""}.icon-smile:before{content:""}.icon-animals:before{content:""}.icon-eats:before{content:""}.icon-sport:before{content:""}.icon-car:before{content:""}.icon-lamp:before{content:""}.icon-language:before{content:""}.icon-flag:before{content:""}.icon-more:before{content:""}.icon-search:before{content:""}.icon-remove:before{content:""}.icon-add:before{content:""}.icon-check:before{content:""}.icon-close:before{content:""}.icon-arrow-left:before{content:""}.icon-arrow-right:before{content:""}.icon-down:before{content:""}.icon-up:before{content:""}.icon-eye-closed:before{content:""}.icon-eye:before{content:""}.icon-muted:before{content:""}.icon-avatar-archived-chats:before{content:""}.icon-avatar-deleted-account:before{content:""}.icon-avatar-saved-messages:before{content:""}.icon-pinned-chat:before{content:""}.media-inner{position:relative}.media-inner video,.media-inner img{display:block;object-fit:cover}.media-inner video{background:no-repeat 50% 50%;background-size:contain}.media-inner .thumbnail~.thumbnail,.media-inner .thumbnail~.full-media,.media-inner .media-loading{position:absolute}.animated-close-icon{position:absolute;transform:rotate(-45deg)}.animated-close-icon,.animated-close-icon::before,.animated-close-icon::after{width:1.125rem;height:.125rem;border-radius:.125rem;background-color:var(--color-text-secondary);transition:transform var(--slide-transition)}.animated-close-icon::before,.animated-close-icon::after{position:absolute;left:0;top:0;content:""}.animated-close-icon::before{transform:rotate(90deg)}.animated-close-icon.no-transition,.animated-close-icon.no-transition::before,.animated-close-icon.no-transition::after{transition:none}.animated-close-icon.state-back{transform:rotate(180deg)}.animated-close-icon.state-back::before{transform:rotate(45deg) scaleX(0.75) translate(0, -0.375rem)}.animated-close-icon.state-back::after{transform:rotate(-45deg) scaleX(0.75) translate(0, 0.375rem)}.chat-list{background:var(--color-background);height:100%;padding:.5rem .125rem .5rem .4375rem;overflow-y:auto}@supports(overflow-y: overlay){body.is-android .chat-list{overflow-y:overlay;overflow-x:hidden}}.chat-list .scroll-container{position:relative}.chat-list .ListItem.chat-item-clickable{margin:0}@media(max-width: 600px){.chat-list{padding-left:0;padding-right:0}}.chat-list .no-results{color:var(--color-text-meta);margin-top:2rem;text-align:center}div.color-bg-1{--color-user: var(--color-user-1)}div.color-bg-2{--color-user: var(--color-user-2)}div.color-bg-4{--color-user: var(--color-user-4)}div.color-bg-5{--color-user: var(--color-user-5)}div.color-bg-6{--color-user: var(--color-user-6)}div.color-bg-7{--color-user: var(--color-user-7)}div.color-bg-8{--color-user: var(--color-user-8)}div.replies-bot-account,div.saved-messages{--color-user: var(--color-primary)}div.deleted-account{--color-user: var(--color-gray)}@media print{body,html,.messages-layout{background:#fff}#LeftColumn,#RightColumn-wrapper,.ChatOrUserPicker,#Notifications,.Modal,.ActiveCallHeader,.unread-count,#middle-column-bg,#middle-column-portals,.header-tools,.ScrollDownButton,.middle-column-footer{display:none !important}#MiddleColumn{border-left:none !important}html,body,#root,#UiLoader,#Main,#MiddleColumn,.MessageList,.messages-layout,.Transition,.Transition>*{height:auto !important;overflow:visible !important;display:block !important;position:static !important;margin:0 !important;padding:0 !important;width:100% !important;max-width:100% !important;transform:none !important}.messages-container{max-width:100rem !important;width:100% !important}.MessageList .sticky-date>span,.MessageList .local-action-message>span,.MessageList .ActionMessage>span,.MessageList .empty>span{background:var(--color-background-own) !important;color:var(--color-text) !important}}html,body{width:100%;height:100%;background:var(--color-background);margin:0;padding:0;font-size:16px;font-family:"Roboto",-apple-system,BlinkMacSystemFont,"Apple Color Emoji","Segoe UI",Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:var(--color-text);font-weight:400;line-height:1.5;text-align:left;overflow:hidden;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(max-width: 600px){html,body{height:calc(var(--vh, 1vh)*100)}}body.is-ios,body.is-macos{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Roboto","Apple Color Emoji","Helvetica Neue",sans-serif}html[lang=fa],html[lang=fa] body{font-family:"Vazir","Roboto",-apple-system,BlinkMacSystemFont,"Apple Color Emoji","Segoe UI",Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}html[lang=fa].is-ios,html[lang=fa].is-macos,html[lang=fa] body.is-ios,html[lang=fa] body.is-macos{font-family:"Vazir",-apple-system,BlinkMacSystemFont,"Roboto","Apple Color Emoji","Segoe UI",Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}body.is-ios{--border-radius-messages: 1rem;--border-radius-messages-small: 0.5rem}body.cursor-grabbing,body.cursor-grabbing *{cursor:grabbing !important}body.cursor-ew-resize{cursor:ew-resize !important}#root{height:100%}@media(max-width: 600px){#root{height:calc(var(--vh, 1vh)*100)}}#middle-column-portals,#portals{position:absolute;top:0;left:0;right:0}.hidden{visibility:hidden}.no-selection{user-select:none;-webkit-user-select:none !important}.resize-handle{display:none;position:absolute;top:0;right:-0.25rem;bottom:0;width:.25rem;z-index:var(--z-resize-handle);cursor:ew-resize}@media(min-width: 926px){.resize-handle{display:block}}.visually-hidden{position:absolute !important;width:0;height:0;overflow:hidden;clip:rect(0, 0, 0, 0);z-index:-1}.not-implemented{opacity:.5}.not-implemented,.not-implemented *{cursor:not-allowed !important}*{box-sizing:border-box}.no-animations #root *,.no-animations #root *::before,.no-animations #root *::after{transition:none !important}.custom-scroll,.custom-scroll-x{scrollbar-width:thin;scrollbar-color:rgba(90,90,90,0) transparent;transition:scrollbar-color .3s ease;-webkit-overflow-scrolling:touch;pointer-events:auto}.custom-scroll::-webkit-scrollbar-thumb,.custom-scroll-x::-webkit-scrollbar-thumb{background-color:rgba(90,90,90,0);border-radius:.375rem;box-shadow:0 0 1px rgba(255,255,255,.01)}.custom-scroll:hover,.custom-scroll:focus,.custom-scroll:focus-within,.custom-scroll-x:hover,.custom-scroll-x:focus,.custom-scroll-x:focus-within{scrollbar-color:rgba(90,90,90,.3) transparent}.custom-scroll:hover::-webkit-scrollbar-thumb,.custom-scroll:focus::-webkit-scrollbar-thumb,.custom-scroll:focus-within::-webkit-scrollbar-thumb,.custom-scroll-x:hover::-webkit-scrollbar-thumb,.custom-scroll-x:focus::-webkit-scrollbar-thumb,.custom-scroll-x:focus-within::-webkit-scrollbar-thumb{background-color:rgba(90,90,90,.3)}body:not(.is-ios) .custom-scroll::-webkit-scrollbar{width:.375rem}body:not(.is-ios) .custom-scroll-x::-webkit-scrollbar{height:.375rem}.no-scrollbar{scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{display:none}.emoji-small{background:no-repeat;background-size:1.25rem;color:transparent;display:inline-block;width:1.25rem;height:1.25rem;margin-inline-end:1px;overflow:hidden;flex-shrink:0}.emoji-small::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}div[role=button]{outline:none !important;cursor:pointer}.opacity-transition{opacity:1;transition:opacity .15s ease}.opacity-transition:not(.open){opacity:0}.opacity-transition:not(.shown){display:none}.opacity-transition.slow{transition-duration:.3s}.color-primary{color:var(--color-primary) !important}.color-danger{color:var(--color-error) !important}.text-muted{color:var(--color-text-secondary) !important}.protector{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2}.for-ios-autocapitalization-fix{position:fixed;font-size:16px;opacity:0;bottom:1rem;z-index:-1}@keyframes grow-icon{0%{transform:scale(0.5);opacity:.8}50%{transform:scale(1.1);opacity:1}100%{transform:scale(1)}}@keyframes hide-icon{from{transform:scale(1);opacity:.4}to{transform:scale(0.5);opacity:0}} -/*# sourceMappingURL=main.1badc5f80faa798031b2.css.map*/ \ No newline at end of file +/*# sourceMappingURL=main.fa9fe60109fab1dcd0cb.css.map*/ \ No newline at end of file diff --git a/dist/main.fa9fe60109fab1dcd0cb.css.map b/dist/main.fa9fe60109fab1dcd0cb.css.map new file mode 100644 index 00000000..c7aa4fd9 --- /dev/null +++ b/dist/main.fa9fe60109fab1dcd0cb.css.map @@ -0,0 +1 @@ +{"version":3,"file":"main.fa9fe60109fab1dcd0cb.css","mappings":"AACE,oBACE,eACA,yDACA,wCACA,oBAEA,sKAIE,yDAGF,gCACE,8BAIJ,mBACE,oDAGF,kBACE,UACA,8BAGF,sCACE,0CACA,UAIJ,+BACE,IACE,UAEF,IACE,YAEF,IACE,+B;AC1CJ,MACE,cAEA,YACE,cAEA,0BACE,qB;ACPN,UACE,YACA,yBAFF,UAGI,iCAGF,gBACE,eACA,MACA,OACA,QACA,cACA,WACA,YACA,gCACA,aAGA,yBAZF,gBAaI,aACA,+BACA,yBAGF,sBACE,OACA,mCACA,gBACA,WACA,kBAEA,yBAPF,sBAQI,gBAGF,0BAXF,sBAYI,WACA,gBAGF,0BAhBF,sBAiBI,QAGF,yBApBF,sBAqBI,0BAGF,yBAxBF,sBAyBI,eACA,wBAIJ,wBACE,OACA,2CACA,4CACA,kBACA,UACA,gBAEA,gCACE,WACA,cACA,kBACA,MACA,OACA,SACA,QACA,4BACA,sBACA,WACA,6BAEA,yDACE,yBAGF,6GAEE,yDAIJ,kDACE,sBAGF,sCACE,gCACE,8BAIJ,gDACE,aACA,iCAGF,0BA9CF,wBA+CI,OACA,mBAGF,yBAnDF,wBAoDI,cAIJ,uBACE,kBACA,MACA,QACA,UACA,YACA,gCACA,2CACA,mCAIJ,iBACE,OACA,kC;AC5HJ,SACE,qBAEA,kBACA,aACA,mBACA,uBAEA,0BACA,2BAEA,aACE,kBACA,MACA,OACA,QACA,SAEA,4BACA,qBAEA,oBACA,sBACA,mCACA,iCAIA,iCACE,WACA,kBACA,eACA,cACA,iBACA,gBACA,kBAGF,yCACE,2BAGF,0CACE,gCAKF,mBACE,2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CAIJ,0BACE,6BACA,qBACA,oCA/MA,4LAkNE,iCA7MF,qBACE,8DA4MA,kCAlMA,sFAsMA,iCAIJ,aACE,iCACA,WACA,0CA7NA,qJAgOE,iCACA,WA5NF,qBACE,iDA0NA,iCACA,YAjNA,yEAqNA,iCAIJ,gBACE,eACA,iBAEA,sBACE,cAGF,qBACE,cACA,sBACA,sBAGF,0BACE,oBACA,sBAEA,4BACE,iBACA,mBAGF,mCACE,qBACA,qBAEA,qCACE,kBACA,eAKN,yBAlCF,gBAmCI,cAEA,sBACE,cAKN,aACE,eACA,iBACA,iDACA,kBACA,gBAEA,mBACE,cACA,eACA,kBAGF,eACE,kBAGF,kBACE,YACA,mBACA,sBACA,eAIJ,cACE,qBACA,sBACA,WAEA,mBACE,sBACA,uBAIJ,aACE,sBACA,qBACA,sBACA,oBAGF,gBACE,kBACA,oBAEA,yBACE,kBACA,cACA,YAEA,0BAIJ,eACE,oB;AC/UJ,UACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,mBACE,oBACA,WAKE,uCACE,kBAGF,sCACE,0FAGA,qBACA,kBAMJ,iFAEE,qBAGF,2BACE,kBACA,aACA,YACA,UACA,oCACA,wBAMA,8DACE,gCAGF,6DACE,yDACA,UAGA,yBACA,wCAKN,gBACE,kBACA,uBACA,UAIA,iEAEE,WACA,cACA,kBACA,eACA,aACA,eACA,gBAGF,iCACE,4CACA,qBACA,yCACA,2DAGF,gCAEE,oEAEA,wBACA,UACA,4BAGF,gCACE,cACA,mBAGF,mCACE,cACA,kBACA,iBACA,kCAKF,+CACE,kCACA,sCAGF,8CACE,UAIJ,mBACE,eACA,qBAGE,oCACE,UACA,cAIJ,uDAEE,iBAIA,mFAEE,UACA,g1C;AC7IR,SACE,aACA,YACA,mBACA,uBAEA,qBACE,eAGF,kBACE,wB;ACVF,oBACE,kBACA,WAGF,gBACE,eACA,YACA,aACA,WACA,cACA,+BAGF,cACE,gBACA,cACA,gBACA,gBACA,SACA,kBACA,yCACA,8DACA,2CACA,kBACA,6BACA,4BAEA,qBACA,0GAmBA,gCACA,cAlBA,mBACE,mBAGF,sBACE,gEAGF,qCACE,0BACA,mCAGF,mCACE,2BAMF,kBACE,oBAGF,qBACE,uBAGF,mBACE,qBAGF,oBACE,sBAGF,0BACE,iBAIJ,cACE,gBACA,mCACA,kCACA,mBACA,kBAIA,sBACE,gDACA,8DACA,iBAGF,sBACE,gBAGF,8BACE,mC;AC7FN,cACE,kB;ACDF,UACE,WACA,gBACA,uBACA,2BACA,wBACA,aACA,oBACA,kBACA,gBACA,mBACA,mBACA,wBACA,oCACA,eACA,uBAEA,qBACE,gCAEE,yCACA,qBACA,eAIJ,yBACE,iDAGE,qBACA,cAGF,iBACE,0CAIJ,YACE,iBACA,kBACA,kCAGF,0BACE,kBAEA,qCACE,0BAIJ,mBACE,sBACA,0BAGF,sBACE,yBAEA,wBACE,cAIJ,+DACE,0CACA,2BAGF,oBACE,iBAIA,qBACE,iBACA,eAGF,mCACE,iBACA,eAGF,6BACE,cACA,kBAIJ,kBACE,mBACA,kBACA,sBACA,eACA,sBACA,WACA,gBACA,mBACA,sCAEA,oBACE,kBACA,kBACA,qBAGF,qBACE,yEAGE,sDACA,qBAGF,yBACE,uB;ACrHN,+BACE,eAEA,0CAEA,wCACE,kBACA,SACA,aACA,WACA,uBAIF,8CACE,kBACA,aACA,WACA,aACA,cACA,6CACA,aACA,cACA,kCACA,0DAEA,mDACE,kCACA,mCACA,WAKN,0BACE,WACA,mBACA,gBACA,uCACA,sBAEA,+BACE,oBAKF,mCACE,aACA,mBAGF,8CACE,uBACA,mBAEA,mDACE,kBAKN,gCACE,eACA,kBAEA,uCACE,WACA,YACA,qBACA,mBACA,uBAIJ,gCACE,mBACA,gBACA,uBACA,kBACA,gBAGF,gCACE,iBACA,W;ACtFJ,WACE,WACA,kBACA,cACA,uBACA,kBAEA,gDAPF,WAQI,gCAEA,cACE,kBAIJ,kDAEE,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDATF,kDAUI,YACA,aACA,sBAIJ,iBACE,oEACA,qBAGF,cACE,kBACA,cAEA,yBAJF,cAKI,eACA,iBAIJ,iBACE,kBACA,iBACA,qBACA,kCAEA,yBANF,iBAOI,eACA,oBAKN,kGAKE,YACA,gBAIA,6BACE,oBAGF,gCACE,mBAGF,wCACE,gBAMF,0CACE,aACA,mBACA,uBAIJ,kBACE,aACA,cACA,cACA,iBACA,kCACA,YACA,aACA,mBACA,uBACA,eAEA,gDAEE,UAKF,sDAEE,aAGF,4BACE,UACA,mBACA,2EAEA,wCACE,WACA,qBAGF,mCACE,gBACA,2CACA,8BACA,qBAIJ,iBACE,uBAGF,iBACE,gBACA,mBACA,kBAEA,oBACE,uBACA,gBACA,gBACA,aAEA,4BACE,sBACA,aACA,uBACA,mBACA,mBACA,gBACA,UACA,oBACA,gCACA,kBACA,kBACA,WAMR,kBACE,kC;ACvKF,aACE,YACA,aACA,sBACA,mBACA,uBAEA,sBACE,gBACA,YACA,eACA,kBAGF,oBACE,gBAGF,0BACE,kCACA,kBAGF,iBACE,WACA,gBAGF,qBACE,gB;AC7BJ,iBAAiB;AACjB;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,sFAAsF;AACxF;AACA,aAAa;AACb;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;AAC9D;AACA,cAAc;AACd;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,UAAU;AACV;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,eAAe;AACf;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;AAC9D;AACA,cAA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ACA,CAIA,6EAEF,aAWE,MAGF,QACE,uBAGF,uBACE,IAGF,sBACE,SACA,iBACA,mBAGF,YAME,oBACA,gBACA,uCAGF,yBAEE,yCACA,CADA,gCACA,YACA,gBACA,SAGF,kBACE,kBACA,oBACA,YAGF,YAIE,mBACA,yBAGF,eAIE,IAGF,mBACE,cACA,mBAGF,eAEE,KAGF,iBACE,aAGF,eAGE,OAGF,aACE,SAGF,iBAEE,cACA,cACA,wBACA,KAGF,cACE,KAGF,UACE,GAGF,wBACE,qBACA,6BACA,qCACA,SAEF,aACE,0BACA,uGAGF,aAGE,qBACA,qCAEF,SACE,mBAGF,uHAIE,qBAEA,KAGF,YACE,mBACA,cACA,6BACA,KAGF,qBACE,kBACA,gBAGF,eACE,mFAGF,yBASE,OAGF,wBACE,SAGF,kBACE,sBACA,cACA,gBACA,oBACA,IAGF,kBACE,OAGF,oBACE,oBACA,QAGF,eACE,cAGF,kBACE,0CACA,uCAGF,QAKE,oBACA,kBACA,oBACA,cAGF,gBAEE,eAGF,mBAEE,sDAGF,yBAIE,yHAGF,SAIE,kBACA,wCAGF,qBAEE,UACA,gFAGF,0BAIE,UAGF,aACE,gBACA,UAGF,WACE,UACA,SACA,SACA,QAGF,aACE,WACA,eACA,UACA,oBACA,iBACA,oBACA,cACA,mBACA,UAGF,uBACE,mFAGF,WAEE,eAGF,mBACE,wBACA,sFAGF,uBAEE,8BAGF,YACE,0BACA,QAGF,oBACE,SAGF,iBACE,UAGF,YACE,UAGF,uBACE,OCnQF,2BACE,2CACA,qDACA,iDACA,qCACA,sCACA,6CACA,gCACA,wEACA,sBACA,8BACA,gCACA,0CACA,sCACA,2BACA,qCACA,mCACA,iCACA,4BACA,oCACA,yBACA,+BACA,0BACA,4CACA,iDACA,0EACA,0EACA,+EACA,mCACA,yBAEA,+BACA,sCACA,wCACA,yDACA,uBACA,8BACA,uBAEA,6BACA,+BACA,yBAEA,wBAEA,uBAEA,2BAEA,8BAEA,wBAEA,sBAEA,2CACA,0BAC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wBACE,aAEF,4BAEE,aAEF,8BAEE,aAEF,+BAEE,aAEF,6BAEE,MAjBF,uBACE,aAEF,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,MAjBF,yBACE,aAEF,6BAEE,aAEF,+BAEE,aAEF,gCAEE,aAEF,8BAEE,MAjBF,uBACE,aAEF,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,MAjBF,uBACE,aAEF,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,cChDN,iBACE,qBACA,oBAEA,aACE,iBACA,kBACA,YACA,aACA,yCACA,eACA,gBACA,gCACA,uDACA,YACA,oBACA,6BACA,mBACA,gCAIA,UACE,kBACA,cACA,aACA,kDACA,oDACA,yBACA,WACA,SACA,8JAIJ,kDAKE,yEAGF,+BAEE,4BAGF,iCACE,0BAGF,mCACE,4BAGF,wCACE,uBAGF,UACE,oBACA,6BAIA,gBACE,6BAGF,SACE,aACA,yCAIA,gBACE,mDACA,WACA,UACA,2MAIJ,iDAKE,eAKN,mBACE,cACA,WACA,gBACA,6EACA,4DACA,2CACA,wBACA,yCACA,aACA,kCACA,sBACA,wBACA,eAEA,oBACA,oBAEA,kBACE,qBAGF,iCACE,2BAEA,0BACE,yCAIJ,iCAEE,gDACA,iCACA,qDAEA,0BACE,wBAIJ,0BACE,sBAGF,+BACE,8CACA,+BACA,wBAGF,oCACE,mDACA,oCACA,4BAKF,gBACE,uBAIJ,WACE,gBACA,sBACA,6CACA,gDACA,6BAGF,iBACE,2CAEA,sBACE,8CAGF,iBACE,MACA,QACA,eACA,gBACA,aACA,mBACA,uBACA,eACA,wBACA,kCAEA,WACA,iBACA,uGAEA,SAEE,oDAKF,qBACE,gDACA,uDAGF,MACE,WACA,YC3MN,qBACE,qHACA,mBAEA,kBACA,mBACA,kCAGF,gCAGE,WACA,kBACA,mBACA,oBACA,oBACA,cACA,mCAGA,kCACA,4DAIA,8CACE,wBACA,aACA,kBACA,cACA,mBAIJ,WACE,wBAEF,WACE,4BAEF,WACE,uBAEF,WACE,uBAEF,WACE,uBAEF,WACE,8BAEF,WACE,wBAEF,WACE,sBAEF,WACE,yBAEF,WACE,sBAEF,WACE,8BAEF,WACE,oCAEF,WACE,0BAEF,WACE,gCAEF,WACE,2BAEF,WACE,yBAEF,WACE,oBAEF,WACE,gCAEF,WACE,4BAEF,WACE,kCAEF,WACE,2BAEF,WACE,kBAEF,WACE,mBAEF,WACE,uBAEF,WACE,yBAEF,WACE,oBAEF,WACE,uBAEF,WACE,0BAEF,WACE,mBAEF,WACE,oBAEF,WACE,2BAEF,WACE,mBAEF,WACE,0BAEF,WACE,8BAEF,WACE,uBAEF,WACE,+BAEF,WACE,yBAEF,WACE,oBAEF,WACE,qBAEF,WACE,mBAEF,WACE,sBAEF,WACE,wBAEF,WACE,mBAEF,WACE,2BAEF,WACE,uBAEF,WACE,uBAEF,WACE,sBAEF,WACE,uBAEF,WACE,4BAEF,WACE,yBAEF,WACE,sBAEF,WACE,uBAEF,WACE,qBAEF,WACE,qBAEF,WACE,mBAEF,WACE,uBAEF,WACE,6BAEF,WACE,uBAEF,WACE,sBAEF,WACE,oBAEF,WACE,mBAEF,WACE,mBAEF,WACE,0BAEF,WACE,4BAEF,WACE,qBAEF,WACE,mBAEF,WACE,8BAEF,WACE,mBAEF,WACE,2BAEF,WACE,8BAEF,WACE,uBAEF,WACE,0BAEF,WACE,yBAEF,WACE,6BAEF,WACE,mBAEF,WACE,qBAEF,WACE,oBAEF,WACE,uBAEF,WACE,qBAEF,WACE,yBAEF,WACE,qBAEF,WACE,6BAEF,WACE,uBAEF,WACE,oBAEF,WACE,qBAEF,WACE,mBAEF,WACE,sBAEF,WACE,oBAEF,WACE,mBAEF,WACE,2BAEF,WACE,8BAEF,WACE,oBAEF,WACE,uBAEF,WACE,uBAEF,WACE,mBAEF,WACE,sBAEF,WACE,wBAEF,WACE,wBAEF,WACE,qBAEF,WACE,sBAEF,WACE,mBAEF,WACE,qBAEF,WACE,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AEA,gBACA,gBACA,gBACA,gBACA,mCACA,kCACA,0BAEA,UAlBF,+BAmBI,4BAIJ,+GAEE,kCAGF,yKAEE,mGAGA,yKAEE,aAKJ,8BACE,uCACA,6CAGF,0BAEE,uBAGF,2BACE,OAGF,WACE,0BACA,MAFF,+BAGI,kCAIJ,iBAEE,MACA,OACA,QACA,SAGF,iBACE,eAGF,gBACE,oCACA,gBAGF,YACE,kBACA,MACA,eACA,SACA,aACA,+BACA,iBACA,0BAEA,eAVF,aAWI,mBAQJ,4BACE,QACA,SACA,gBACA,sBACA,WACA,kBAGF,UACE,qCAEA,6BAEE,GAIJ,qBACE,qFAGF,0BAGE,iCAGF,oBAEE,6CACA,oCACA,iCAEA,oBAEA,mFAEA,iCACE,sBACA,yCAEA,mJAGF,6CAGE,ySAEA,kCACE,qDAOF,aACE,uDAKF,cACE,eAKN,oBACE,kCAEA,YACE,cAIJ,oBACE,wBACA,kBACA,qBACA,cACA,eACA,sBACA,gBACA,cACA,yBAEA,uDACE,kBACA,kBAIJ,uBACE,eACA,qBAGF,SACE,6BACA,gCAEA,SACE,iCAGF,YACE,0BAGF,uBACE,gBAIJ,qCACE,eAGF,mCACE,aAGF,4CACE,YAGF,iBACE,OACA,MACA,QACA,SACA,UACA,iCAGF,cACE,eACA,UACA,YACA,WACA,sBAGF,GACE,oBACE,WACA,KAEF,oBACE,UACA,MAEF,kBACE,uBAIJ,KACE,kBACE,WACA,IAEF,oBACE,UACA,6mH","sources":["webpack://telegram-t/./src/components/common/spoiler/Spoiler.scss","webpack://telegram-t/./src/components/ui/Link.scss","webpack://telegram-t/./src/components/common/UiLoader.scss","webpack://telegram-t/./src/components/ui/Spinner.scss","webpack://telegram-t/./src/components/ui/RippleEffect.scss","webpack://telegram-t/./src/components/ui/Button.scss","webpack://telegram-t/./src/components/ui/Checkbox.scss","webpack://telegram-t/./src/components/ui/Loading.scss","webpack://telegram-t/./src/components/ui/Menu.scss","webpack://telegram-t/./src/components/ui/DropdownMenu.scss","webpack://telegram-t/./src/components/ui/MenuItem.scss","webpack://telegram-t/./src/components/auth/CountryCodeInput.scss","webpack://telegram-t/./src/components/auth/Auth.scss","webpack://telegram-t/./src/components/main/AppInactive.scss","webpack://telegram-t/./src/assets/fonts/roboto.css","webpack://telegram-t/./src/styles/index.scss","webpack://telegram-t/./src/styles/reboot.css","webpack://telegram-t/./src/styles/_variables.scss","webpack://telegram-t/./src/styles/_spacing.scss","webpack://telegram-t/./src/styles/_forms.scss","webpack://telegram-t/./src/styles/icons.scss","webpack://telegram-t/./src/styles/_common.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/styles/print.scss"],"sourcesContent":[".Spoiler {\n &--concealed {\n cursor: pointer;\n background-image: url('../../../assets/spoiler-dots-black.png');\n background-size: auto min(100%, 1.125rem);\n border-radius: 0.5rem;\n\n html.theme-dark &,\n html.theme-light .ListItem.selected &,\n .ActionMessage &,\n .MediaViewerFooter & {\n background-image: url('../../../assets/spoiler-dots-white.png');\n }\n\n .emoji-only & {\n background-size: auto 1.125rem;\n }\n }\n\n &--animated {\n animation: pulse-opacity-light 1.75s linear infinite;\n }\n\n &__content {\n opacity: 1;\n transition: opacity 250ms ease;\n }\n\n &--concealed &__content {\n user-select: none;\n opacity: 0;\n }\n}\n\n@keyframes pulse-opacity-light {\n 25% {\n opacity: 1;\n }\n 50% {\n opacity: 0.25;\n }\n 75% {\n opacity: 1;\n }\n}\n",".Link {\n color: inherit;\n\n &:hover {\n color: inherit;\n\n &.GroupCallLink {\n text-decoration: none;\n }\n }\n}\n","#UiLoader {\n height: 100%;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n .mask {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 100%;\n height: 100%;\n z-index: var(--z-ui-loader-mask);\n display: flex;\n\n\n @media (min-width: 600px) {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 100%;\n }\n\n .left {\n flex: 1;\n background: var(--color-background);\n min-width: 12rem;\n width: 33vw;\n max-width: 26.5rem;\n\n @media (min-width: 926px) {\n max-width: 40vw;\n }\n\n @media (min-width: 1276px) {\n width: 25vw;\n max-width: 33vw;\n }\n\n @media (max-width: 1275px) {\n flex: 2;\n }\n\n @media (max-width: 925px) {\n width: 26.5rem !important;\n }\n\n @media (max-width: 600px) {\n max-width: none;\n width: 100vw !important;\n }\n }\n\n .middle {\n flex: 3;\n border-left: 1px solid var(--color-borders);\n border-right: 1px solid var(--color-borders);\n position: relative;\n z-index: 1;\n overflow: hidden;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: no-repeat center;\n background-size: cover;\n z-index: -1;\n transform-origin: left center;\n\n .theme-dark body.initial & {\n background-color: #0f0f0f;\n }\n\n .theme-light body.initial &,\n body:not(.initial) & {\n background-image: url('../../assets/chat-bg.jpg');\n }\n }\n\n &.with-right-column::before {\n transform: scale(0.67);\n }\n\n @media screen and (min-width: 1276px) {\n &::before {\n margin: -16rem -5rem -20rem 0;\n }\n }\n\n &.custom-bg-image::before {\n margin: -1rem;\n background-image: none !important;\n }\n\n @media (max-width: 1275px) {\n flex: 3;\n border-right: none;\n }\n\n @media (max-width: 600px) {\n display: none;\n }\n }\n\n .right {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n height: 100%;\n width: var(--right-column-width);\n border-left: 1px solid var(--color-borders);\n background: var(--color-background);\n }\n }\n\n .blank {\n flex: 1;\n background: var(--color-background);\n }\n}\n",".Spinner {\n --spinner-size: 2rem;\n\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: var(--spinner-size);\n height: var(--spinner-size);\n\n > div {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n background-repeat: no-repeat;\n background-size: 100%;\n\n animation-name: spin;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n\n &.with-background {\n &::before {\n content: '';\n position: absolute;\n left: -0.125rem;\n top: -0.125rem;\n bottom: -0.125rem;\n right: -0.125rem;\n border-radius: 50%;\n }\n\n &.bg-dark::before {\n background: rgba(0, 0, 0, 0.25);\n }\n\n &.bg-light::before {\n background: rgba(255, 255, 255, 0.4);\n }\n }\n\n &.white {\n > div {\n background-image: var(--spinner-white-data);\n }\n\n &.with-background {\n > div {\n background-image: var(--spinner-white-thin-data);\n }\n }\n }\n\n &.blue {\n > div {\n background-image: var(--spinner-blue-data);\n\n .theme-dark & {\n background-image: var(--spinner-dark-blue-data);\n }\n }\n }\n\n &.black {\n > div {\n background-image: var(--spinner-black-data);\n }\n }\n\n &.green {\n > div {\n background-image: var(--spinner-green-data);\n }\n }\n\n &.gray {\n > div {\n background-image: var(--spinner-gray-data);\n }\n }\n\n &.yellow {\n > div {\n background-image: var(--spinner-yellow-data);\n }\n }\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n}\n\n","@-webkit-keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n@keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n.ripple-container {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n\n body.animation-level-0 & {\n display: none;\n }\n\n span {\n position: absolute;\n display: block;\n background-color: var(--ripple-color, rgba(0, 0, 0, 0.08));\n border-radius: 50%;\n transform: scale(0);\n animation: ripple-animation 700ms;\n }\n}\n","@mixin active-styles() {\n &:not(.disabled):not(:disabled) {\n &:active,\n &.active,\n &:focus {\n @content;\n }\n @media (hover: hover) {\n &:hover {\n @content;\n }\n }\n }\n}\n\n@mixin no-ripple-styles() {\n body.animation-level-0 & {\n &:not(.disabled):not(:disabled) {\n &:active {\n @content;\n }\n }\n }\n}\n\n.Button {\n outline: none !important;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 3.5rem;\n border: 0;\n border-radius: var(--border-radius-default);\n background-color: transparent;\n background-size: cover;\n padding: 0.625rem;\n color: white;\n line-height: 1.2;\n cursor: pointer;\n text-transform: uppercase;\n flex-shrink: 0;\n position: relative;\n overflow: hidden;\n transition: background-color 0.15s, color 0.15s;\n text-decoration: none !important;\n\n // @optimization\n &:active,\n &.clicked,\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default;\n pointer-events: none;\n }\n\n &.round {\n width: 3.5rem;\n border-radius: 50%;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.primary {\n background-color: var(--color-primary);\n color: var(--color-white);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n background-color: var(--color-primary-shade);\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-primary-shade-darker);\n }\n }\n\n &.secondary {\n background-color: var(--color-background);\n color: rgba(var(--color-text-secondary-rgb), 0.75);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n background-color: var(--color-primary);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-primary-shade);\n }\n }\n\n &.gray {\n background-color: var(--color-background);\n color: var(--color-text-secondary);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n color: var(--color-primary);\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-chat-hover);\n }\n }\n\n &.danger {\n background-color: var(--color-background);\n color: var(--color-error);\n --ripple-color: rgba(var(--color-error-rgb), 0.16);\n\n @include active-styles() {\n background-color: var(--color-error);\n color: var(--color-white);\n }\n\n @include no-ripple-styles() {\n background-color: var(--color-error-shade);\n }\n }\n\n &.text {\n background-color: transparent;\n\n &.primary {\n color: var(--color-primary);\n background-color: transparent;\n\n @include active-styles() {\n background-color: rgba(var(--color-primary-shade-rgb), 0.08);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-primary-shade-rgb), 0.16);\n }\n }\n\n &.secondary {\n background-color: transparent;\n color: var(--color-text-secondary);\n }\n\n &.danger {\n @include active-styles() {\n background-color: rgba(var(--color-error-rgb), 0.08);\n color: var(--color-error);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-error-rgb), 0.16);\n }\n }\n }\n\n &.faded {\n opacity: 0.8;\n\n @include active-styles() {\n opacity: 1;\n }\n\n &.activated {\n opacity: 1;\n }\n }\n\n &.translucent {\n background-color: transparent;\n color: var(--color-text-secondary);\n\n --ripple-color: var(--color-interactive-element-hover);\n\n @include active-styles() {\n background-color: var(--color-interactive-element-hover);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-text-secondary-rgb), 0.16);\n }\n\n &.activated {\n color: var(--color-primary);\n }\n }\n\n &.translucent-white {\n background-color: transparent;\n color: rgba(255, 255, 255, 0.5);\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(255, 255, 255, 0.08);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(255, 255, 255, 0.16);\n }\n }\n\n &.translucent-black {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.8);\n --ripple-color: rgba(0, 0, 0, 0.08);\n\n @include active-styles() {\n background-color: rgba(0, 0, 0, 0.08);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(0, 0, 0, 0.16);\n }\n }\n\n &.dark {\n background-color: rgba(0, 0, 0, 0.75);\n color: white;\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(0, 0, 0, 0.95);\n }\n }\n\n &.smaller {\n height: 2.75rem;\n padding: 0.3125rem;\n\n &.round {\n width: 2.75rem;\n }\n\n &.pill {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding: 0.3125rem 1rem;\n }\n\n &.with-icon {\n padding-left: 0.75rem;\n padding-right: 1.25rem;\n\n i {\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n\n &[dir=\"rtl\"] {\n padding-left: 1.25rem;\n padding-right: 0.75rem;\n\n i {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n }\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n\n &.round {\n width: 2.5rem;\n }\n }\n }\n\n &.tiny {\n height: 2.25rem;\n padding: 0.4375rem;\n border-radius: var(--border-radius-default-small);\n font-size: 0.875rem;\n font-weight: 500;\n\n &.round {\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 50%;\n }\n\n i {\n font-size: 1.25rem;\n }\n\n &.pill {\n height: 2rem;\n border-radius: 1rem;\n padding: 0.3125rem 1rem;\n font-size: 1rem;\n }\n }\n\n &.fluid {\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n width: auto;\n\n &.tiny {\n padding-left: 1.375rem;\n padding-right: 1.375rem;\n }\n }\n\n &.pill {\n border-radius: 1.75rem;\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n text-transform: none;\n }\n\n &.loading {\n position: relative;\n pointer-events: none;\n\n .Spinner {\n position: absolute;\n right: 0.875rem;\n top: 0.875rem;\n\n --spinner-size: 1.8125rem;\n }\n }\n\n .emoji {\n vertical-align: -3px;\n }\n}\n",".Checkbox {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.round {\n .Checkbox-main {\n &::before {\n border-radius: 50%;\n }\n\n &::after {\n background: var(--color-primary)\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=)\n no-repeat 50% 50%;\n background-size: 12px;\n border-radius: 50%;\n }\n }\n }\n\n &.loading {\n .Checkbox-main::before,\n .Checkbox-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 0.375rem;\n top: 0.125rem;\n opacity: 0;\n animation: fade-in 0.2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &.blocking {\n input:not(:checked) ~ .Checkbox-main {\n &::before {\n border-color: var(--color-error);\n }\n\n &::after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBvbHlnb24gcG9pbnRzPSIwIDAgMjQgMCAyNCAyNCAwIDI0Ii8+CiAgICA8cGF0aCBmaWxsPSIjZTUzOTM1IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xOCwzIEMxOS42NTY4NTQyLDMgMjEsNC4zNDMxNDU3NSAyMSw2IEwyMSwxOCBDMjEsMTkuNjU2ODU0MiAxOS42NTY4NTQyLDIxIDE4LDIxIEw2LDIxIEM0LjM0MzE0NTc1LDIxIDMsMTkuNjU2ODU0MiAzLDE4IEwzLDYgQzMsNC4zNDMxNDU3NSA0LjM0MzE0NTc1LDMgNiwzIEwxOCwzIFogTTE2LDExIEw4LDExIEM3LjQ0NzcxNTI1LDExIDcsMTEuNDQ3NzE1MyA3LDEyIEM3LDEyLjU1MjI4NDcgNy40NDc3MTUyNSwxMyA4LDEzIEwxNiwxMyBDMTYuNTUyMjg0NywxMyAxNywxMi41NTIyODQ3IDE3LDEyIEMxNywxMS40NDc3MTUzIDE2LjU1MjI4NDcsMTEgMTYsMTEgWiIvPgogIDwvZz4KPC9zdmc+Cg==);\n opacity: 1;\n\n // Compensate for svg having incorrect size\n background-size: 1.375rem;\n background-position: -0.125rem -0.125rem;\n }\n }\n }\n\n input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Checkbox-main {\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 1.1875rem;\n top: 0.1875rem;\n width: 1.125rem;\n height: 1.125rem;\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: 0.25rem;\n background-color: var(--color-background);\n transition: border-color 0.1s ease, background-color 0.1s ease;\n }\n\n &::after {\n /* stylelint-disable-next-line scss/operator-no-unspaced */\n background: center no-repeat\n url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==);\n background-size: 0.875rem;\n opacity: 0;\n transition: opacity 0.1s ease;\n }\n\n .label {\n display: block;\n text-align: initial;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--color-primary);\n background-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &[dir=\"rtl\"] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n &.loading {\n .Spinner {\n left: auto;\n right: 0.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n .Checkbox-main {\n &::before,\n &::after {\n left: auto;\n right: 1.1875rem;\n }\n }\n }\n}\n",".Loading {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n\n &.interactive {\n cursor: pointer;\n }\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n}\n",".Menu {\n &.fluid .bubble {\n min-width: 13.5rem;\n width: auto;\n }\n\n .backdrop {\n position: fixed;\n left: -100vw;\n right: -100vw;\n top: -100vh;\n bottom: -100vh;\n z-index: var(--z-menu-backdrop);\n }\n\n .bubble {\n overflow: hidden;\n display: block;\n list-style: none;\n padding: 0.5rem 0;\n margin: 0;\n position: absolute;\n background-color: var(--color-background);\n box-shadow: 0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n min-width: 13.5rem;\n z-index: var(--z-menu-bubble);\n overscroll-behavior: contain;\n\n transform: scale(0.5);\n transition: opacity 0.2s cubic-bezier(0.2, 0, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0, 0.2, 1) !important;\n\n &.open {\n transform: scale(1);\n }\n\n &.closing {\n transition: opacity 0.2s ease-in, transform 0.2s ease-in !important;\n }\n\n body.animation-level-0 & {\n transform: none !important;\n transition: opacity 0.15s !important;\n }\n\n body.has-open-dialog & {\n transition: none !important;\n }\n\n --offset-y: calc(100% + 0.5rem);\n --offset-x: 0;\n\n &.top {\n top: var(--offset-y);\n }\n\n &.bottom {\n bottom: var(--offset-y);\n }\n\n &.left {\n left: var(--offset-x);\n }\n\n &.right {\n right: var(--offset-x);\n }\n\n &.with-footer {\n padding-bottom: 0;\n }\n }\n\n .footer {\n padding: 0.5rem 0;\n background: var(--color-chat-hover);\n color: var(--color-text-secondary);\n font-size: 0.8125rem;\n text-align: center;\n }\n\n &.compact {\n .bubble {\n background: var(--color-background-compact-menu);\n backdrop-filter: blur(10px);\n padding: 0.25rem 0;\n }\n\n .footer {\n background: none;\n }\n\n &.no-blur .bubble {\n background: var(--color-background);\n }\n }\n}\n",".DropdownMenu {\n position: relative;\n}\n",".MenuItem {\n width: 100%;\n background: none;\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 0.75rem 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n --ripple-color: rgba(0, 0, 0, 0.08);\n cursor: pointer;\n unicode-bidi: plaintext;\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n background-color: var(--color-chat-hover);\n text-decoration: none;\n color: inherit;\n }\n }\n\n @media (max-width: 600px) {\n &:focus,\n &:hover,\n &:active {\n text-decoration: none;\n color: inherit;\n }\n\n &:active {\n background-color: var(--color-chat-hover);\n }\n }\n\n i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n\n .menu-item-name {\n margin-right: 2rem;\n\n &.capitalize {\n text-transform: capitalize;\n }\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default !important;\n }\n\n &.destructive {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n\n &:not(.has-ripple):not(.disabled):not(.compact):active {\n background-color: var(--color-item-active);\n transition: none !important;\n }\n\n & > .Switcher {\n margin-left: auto;\n }\n\n &[dir=\"rtl\"] {\n i {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n .menu-item-name {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n > .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n\n &.compact {\n align-items: center;\n font-size: 0.875rem;\n margin: 0.125rem 0.25rem;\n padding: 0.25rem;\n border-radius: 0.375rem;\n width: auto;\n font-weight: 500;\n transform: scale(1);\n transition: 0.15s ease-in-out transform;\n\n i {\n font-size: 1.25rem;\n margin-left: 0.5rem;\n margin-right: 1.25rem;\n }\n\n @media (hover: hover) {\n &:hover,\n &:focus,\n &:active {\n background: var(--color-background-compact-menu-hover);\n text-decoration: none;\n }\n\n &:active {\n transform: scale(0.98);\n }\n }\n }\n}\n",".CountryCodeInput {\n .input-group {\n cursor: pointer;\n\n z-index: var(--z-country-code-input-group);\n\n .Spinner {\n position: absolute;\n top: 1rem;\n right: 0.75rem;\n opacity: 0.5;\n --spinner-size: 1.5rem;\n }\n\n // Prevent loading additional 10 kB of icomoon font on initial load.\n .css-icon-down {\n position: absolute;\n top: 1.125rem;\n right: 1rem;\n width: 0.75rem;\n height: 0.75rem;\n border: 2px solid var(--color-text-secondary);\n border-top: 0;\n border-left: 0;\n transform: scaleY(1) rotate(45deg);\n transition: color 0.2s ease, transform 0.2s ease, top 0.2s ease;\n\n &.open {\n border-color: var(--color-primary);\n transform: scaleY(-1) rotate(45deg);\n top: 1.5rem;\n }\n }\n }\n\n .bubble {\n width: 100%;\n max-height: 23.5rem;\n overflow-y: auto;\n transform-origin: top center !important;\n transform: scale(0.95);\n\n &.open {\n transform: scaleY(1);\n }\n }\n\n .MenuItem {\n button {\n display: flex;\n align-items: center;\n }\n\n &.no-results button {\n justify-content: center;\n padding: 0.5rem 1rem;\n\n span {\n font-size: 0.875rem;\n }\n }\n }\n\n .country-flag {\n font-size: 2rem;\n margin-right: 2rem;\n\n .emoji {\n width: 2rem;\n height: 2rem;\n display: inline-block;\n vertical-align: 4px;\n margin: -0.5rem 0.125rem;\n }\n }\n\n .country-name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 1rem;\n text-align: left;\n }\n\n .country-code {\n margin-left: auto;\n opacity: 0.5;\n }\n}\n",".auth-form {\n width: 100%;\n max-width: 25.5rem;\n margin: 0 auto;\n padding: 6rem 1rem 1rem;\n text-align: center;\n\n @media (min-width: 600px) and (min-height: 450px) {\n padding: 6.8125rem 1.5rem 1.5rem;\n\n &.qr {\n padding-top: 4rem;\n }\n }\n\n #logo,\n .AvatarEditable label {\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n }\n\n #logo {\n background: url(\"../../assets/telegram-logo.svg\") center no-repeat;\n background-size: 100%;\n }\n\n h2 {\n font-size: 1.25rem;\n line-height: 1;\n\n @media (min-width: 600px) {\n font-size: 2rem;\n line-height: 1.5;\n }\n }\n\n .note {\n font-size: 0.875rem;\n line-height: 1.35;\n margin-bottom: 2.5rem;\n color: var(--color-text-secondary);\n\n @media (min-width: 600px) {\n font-size: 1rem;\n margin-bottom: 3rem;\n }\n }\n}\n\n#auth-registration-form,\n#auth-phone-number-form,\n#auth-code-form,\n#auth-password-form,\n#auth-qr-form {\n height: 100%;\n overflow-y: auto;\n}\n\n#auth-phone-number-form {\n form {\n min-height: 26.25rem;\n }\n\n .Button {\n margin-top: 2.75rem;\n }\n\n .Button + .Button {\n margin-top: 1rem;\n }\n}\n\n#auth-code-form,\n#auth-password-form {\n h2 {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n.auth-number-edit {\n width: 2.5rem;\n height: 2.5rem;\n padding: 0.5rem;\n font-size: 1.5rem;\n color: var(--color-text-secondary);\n opacity: 0.75;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n}\n\n#auth-qr-form {\n .qr-container,\n .qr-loading {\n height: 280px;\n }\n\n .qr-container {\n opacity: 1;\n transform: scale(1);\n transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms;\n\n &.pre-animate {\n opacity: 0.5;\n transform: scale(0.8);\n }\n\n canvas {\n padding: 0.625rem;\n border-radius: var(--border-radius-default);\n background: var(--color-white);\n margin-top: -0.625rem;\n }\n }\n\n h3 {\n margin: 1.5rem 0 1rem 0;\n }\n\n ol {\n list-style: none;\n counter-reset: item;\n padding: 0 1.75rem;\n\n li {\n counter-increment: item;\n text-align: left;\n margin: 0.75rem 0;\n display: flex;\n\n &::before {\n content: counter(item);\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 1.375rem;\n height: 1.375rem;\n padding: 0;\n margin: 0 0.75rem 0 0;\n background: var(--color-primary);\n border-radius: 50%;\n font-size: smaller;\n color: white;\n }\n }\n }\n}\n\n#sign-in-password {\n word-break: normal !important;\n}\n","#AppInactive {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n .content {\n max-width: 28rem;\n margin: auto;\n padding: 1.5rem;\n text-align: center;\n }\n\n .title {\n margin-top: 1rem;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: 0.875rem;\n }\n\n img {\n width: 100%;\n max-width: 20rem;\n }\n\n .Button {\n margin-top: 1rem;\n }\n}\n","/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Regular-WOL.woff2') format('woff2'),\n url('Vazir-Regular-WOL.woff') format('woff');\n font-weight: normal;\n font-display:swap;\n unicode-range:U+0627-06FF;\n}\n\n/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Medium-WOL.woff2') format('woff2'),\n url('Vazir-Medium-WOL.woff') format('woff');\n font-weight: 500;\n font-display:swap;\n unicode-range: U+0600-06FF;\n}\n","@import \"reboot\";\n@import \"variables\";\n@import \"mixins\";\n@import \"spacing\";\n@import \"forms\";\n@import \"icons\";\n@import \"common\";\n@import \"../assets/fonts/roboto.css\";\n@import \"./print\";\n\nhtml,\nbody {\n width: 100%;\n height: 100%;\n background: var(--color-background);\n margin: 0;\n padding: 0;\n font-size: 16px;\n font-family: \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Segoe UI\", Oxygen, Ubuntu, Cantarell,\n \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n color: var(--color-text);\n font-weight: 400;\n line-height: 1.5;\n text-align: left;\n overflow: hidden;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\nbody.is-ios,\nbody.is-macos {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n}\n\nhtml[lang=\"fa\"],\nhtml[lang=\"fa\"] body {\n font-family: \"Vazir\", \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Segoe UI\", Oxygen, Ubuntu,\n Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n\n &.is-ios,\n &.is-macos {\n font-family: \"Vazir\", -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Segoe UI\", Oxygen, Ubuntu,\n Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n }\n}\n\nbody.is-ios {\n --border-radius-messages: 1rem;\n --border-radius-messages-small: 0.5rem;\n}\n\nbody.cursor-grabbing,\nbody.cursor-grabbing * {\n cursor: grabbing !important;\n}\n\nbody.cursor-ew-resize {\n cursor: ew-resize !important;\n}\n\n#root {\n height: 100%;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\n#middle-column-portals,\n#portals {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.hidden {\n visibility: hidden;\n}\n\n.no-selection {\n user-select: none;\n -webkit-user-select: none !important;\n}\n\n.resize-handle {\n display: none;\n position: absolute;\n top: 0;\n right: -0.25rem;\n bottom: 0;\n width: 0.25rem;\n z-index: var(--z-resize-handle);\n cursor: ew-resize;\n\n @media (min-width: 926px) {\n display: block;\n }\n}\n\n/*\n See the article for more information on this visually-hidden pattern.\n https://snook.ca/archives/html_and_css/hiding-content-for-accessibility\n*/\n.visually-hidden {\n position: absolute !important;\n width: 0;\n height: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n z-index: -1;\n}\n\n.not-implemented {\n opacity: 0.5;\n\n &,\n & * {\n cursor: not-allowed !important;\n }\n}\n\n* {\n box-sizing: border-box;\n}\n\n.no-animations #root *,\n.no-animations #root *::before,\n.no-animations #root *::after {\n transition: none !important;\n}\n\n.custom-scroll,\n.custom-scroll-x {\n scrollbar-width: thin;\n scrollbar-color: rgba(90, 90, 90, 0) transparent;\n transition: scrollbar-color 0.3s ease;\n\n -webkit-overflow-scrolling: touch;\n // Fix scroll lock on iOS\n pointer-events: auto;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0);\n border-radius: 0.375rem;\n // `box-shadow` prevents repaint on macOS when hovering out of scrollable container\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.01);\n }\n\n &:hover,\n &:focus,\n &:focus-within {\n scrollbar-color: rgba(90, 90, 90, 0.3) transparent;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0.3);\n }\n }\n}\n\nbody:not(.is-ios) {\n .custom-scroll {\n &::-webkit-scrollbar {\n width: 0.375rem;\n }\n }\n\n .custom-scroll-x {\n &::-webkit-scrollbar {\n height: 0.375rem;\n }\n }\n}\n\n.no-scrollbar {\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n.emoji-small {\n background: no-repeat;\n background-size: 1.25rem;\n color: transparent;\n display: inline-block;\n width: 1.25rem;\n height: 1.25rem;\n margin-inline-end: 1px;\n overflow: hidden;\n flex-shrink: 0;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n}\n\ndiv[role=\"button\"] {\n outline: none !important;\n cursor: pointer;\n}\n\n.opacity-transition {\n opacity: 1;\n transition: opacity 0.15s ease;\n\n &:not(.open) {\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.slow {\n transition-duration: 0.3s;\n }\n}\n\n.color-primary {\n color: var(--color-primary) !important;\n}\n\n.color-danger {\n color: var(--color-error) !important;\n}\n\n.text-muted {\n color: var(--color-text-secondary) !important;\n}\n\n.protector {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n}\n\n.for-ios-autocapitalization-fix {\n position: fixed;\n font-size: 16px;\n opacity: 0;\n bottom: 1rem;\n z-index: -1;\n}\n\n@keyframes grow-icon {\n 0% {\n transform: scale(0.5);\n opacity: 0.8;\n }\n 50% {\n transform: scale(1.1);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes hide-icon {\n from {\n transform: scale(1);\n opacity: 0.4;\n }\n to {\n transform: scale(0.5);\n opacity: 0;\n }\n}\n","*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n@-ms-viewport {\n width: device-width;\n}\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n font-weight: 500;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\np,\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndd {\n margin-bottom: 0.5rem;\n margin-left: 0;\n}\n\nblockquote,\nfigure {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\ndt,\nb,\nstrong {\n font-weight: 500;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\na {\n color: var(--color-links);\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]),\na:not([href]):not([tabindex]):hover,\na:not([href]):not([tabindex]):focus {\n color: inherit;\n text-decoration: none;\n}\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font: 0.9375rem/1.25 \"Courier\", \"Courier New\", \"Nimbus Mono L\", \"Courier 10 Pitch\", \"FreeMono\", sans-serif-monospace,\n monospace;\n font-size-adjust: 0.43;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput:not([type=\"range\"]),\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: 0.5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: 0.5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n","@use \"sass:color\";\n\n@function toRGB($color) {\n @return red($color) + \", \" + green($color) + \", \" + blue($color);\n}\n\n@function blend-normal($foreground, $background) {\n $opacity: opacity($foreground);\n $background-opacity: opacity($background);\n\n // calculate opacity\n $bm-red: color.red($foreground) * $opacity + color.red($background) * $background-opacity * (1 - $opacity);\n $bm-green: color.green($foreground) * $opacity + color.green($background) * $background-opacity * (1 - $opacity);\n $bm-blue: color.blue($foreground) * $opacity + color.blue($background) * $background-opacity * (1 - $opacity);\n @return rgb($bm-red, $bm-green, $bm-blue);\n}\n\n$color-primary: #3390ec;\n\n$color-links: #3390ec;\n\n$color-placeholders: #a2acb4;\n\n$color-text-green: #4fae4e;\n$color-green: #00c73e;\n$color-light-green: #eeffde;\n\n$color-error: #e53935;\n\n$color-warning: #fb8c00;\n\n$color-yellow: #fdd764;\n\n$color-white: #ffffff;\n$color-black: #000000;\n$color-dark-gray: #2e3939;\n$color-gray: #c4c9cc;\n$color-text-secondary: #707579;\n$color-text-secondary-apple: #8a8a90;\n$color-text-meta: #686c72;\n$color-text-meta-apple: #8c8c91;\n$color-borders: #dadce0;\n$color-dividers: #c8c6cc;\n$color-item-active: #ededed;\n$color-chat-hover: #f4f4f5;\n$color-chat-active: #3390ec;\n$color-selection: #3993fb;\n\n// https://github.com/telegramdesktop/tdesktop/wiki/Theme-Reference#user-content-standard-color-constants\n// Colors borrowed from https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/Resources/day-blue.tdesktop-theme\n// historyPeer[1-8]UserpicBg\n$color-user-1: #e17076;\n$color-user-2: #7bc862;\n//$color-user-3: #E5CA77;\n$color-user-4: #65aadd;\n$color-user-5: #a695e7;\n$color-user-6: #ee7aae;\n$color-user-7: #6ec9cb;\n$color-user-8: #faa774;\n\n$color-message-reaction: #ebf3fd;\n$color-message-reaction-hover: #c5def9;\n$color-message-reaction-own: #cef0ba;\n$color-message-reaction-own-hover: #b5e0a4;\n\n:root {\n --color-background: #{$color-white};\n --color-background-compact-menu: #FFFFFFBB;\n --color-background-compact-menu-reactions: #FFFFFFEB;\n --color-background-compact-menu-hover: #000000B2;\n --color-background-selected: #f4f4f5;\n --color-background-secondary: #f4f4f5;\n --color-background-secondary-accent: #e4e4e5;\n --color-background-own: #{$color-light-green};\n --color-background-own-selected: color.adjust($color-light-green, -10%);\n --color-text: #{$color-black};\n --color-text-lighter: #{$color-dark-gray};\n --color-text-secondary: #{$color-text-secondary};\n --color-text-secondary-rgb: #{toRGB($color-text-secondary)};\n --color-text-secondary-apple: #{$color-text-secondary-apple};\n --color-text-meta: #{$color-text-meta};\n --color-text-meta-rgb: #{toRGB($color-text-meta)};\n --color-text-meta-colored: #{$color-text-green};\n --color-text-meta-apple: #{$color-text-meta-apple};\n --color-text-green: #{$color-text-green};\n --color-text-green-rgb: #{toRGB($color-text-green)};\n --color-borders: #{$color-borders};\n --color-borders-input: #{$color-borders};\n --color-dividers: #{$color-dividers};\n --color-webpage-initial-background: #{$color-dark-gray};\n --color-interactive-active: var(--color-primary);\n --color-interactive-inactive: rgba(var(--color-text-secondary-rgb), 0.25);\n --color-interactive-buffered: rgba(var(--color-text-secondary-rgb), 0.25); // Overlays underlying inactive element\n --color-interactive-element-hover: rgba(var(--color-text-secondary-rgb), 0.08);\n --color-composer-button: #{$color-text-secondary}CC;\n\n --color-primary: #{$color-primary};\n --color-primary-shade: #{color.mix($color-primary, $color-black, 92%)};\n --color-primary-shade-darker: #{color.mix($color-primary, $color-black, 84%)};\n --color-primary-shade-rgb: #{toRGB(color.mix($color-primary, $color-black, 92%))};\n --color-primary-opacity: rgba(var(--color-primary), 0.5);\n --color-green: #{$color-green};\n --color-green-darker: #{color.mix($color-green, $color-black, 84%)};\n\n --color-error: #{$color-error};\n --color-error-shade: #{color.mix($color-error, $color-black, 92%)};\n --color-error-rgb: #{toRGB($color-error)};\n\n --color-warning: #{$color-warning};\n\n --color-yellow: #{$color-yellow};\n\n --color-links: #{$color-links};\n\n --color-own-links: #{$color-white};\n\n --color-placeholders: #{$color-placeholders};\n\n --color-pinned: #{$color-white};\n\n --color-code: #4a729a;\n --color-code-bg: #{rgba($color-text-secondary, 0.08)};\n --color-code-own: #3c7940;\n --color-code-own-bg: #{rgba($color-text-secondary, 0.08)};\n\n --color-accent-own: #{$color-text-green};\n --color-message-meta-own: #{$color-text-green};\n\n --color-message-reaction: $color-message-reaction;\n --color-message-reaction-hover: $color-message-reaction-hover;\n --color-message-reaction-own: $color-message-reaction-own;\n --color-message-reaction-hover-own: $color-message-reaction-own-hover;\n\n --color-reply-hover: #{blend-normal(rgba($color-text-secondary, 0.08), $color-white)};\n --color-reply-active: #{blend-normal(rgba($color-text-secondary, 0.16), $color-white)};\n --color-reply-own-hover: #{blend-normal(rgba($color-text-green, 0.12), $color-light-green)};\n --color-reply-own-active: #{blend-normal(rgba($color-text-green, 0.24), $color-light-green)};\n\n --color-background-own-apple: #dcf8c5;\n --color-reply-own-hover-apple: #cbefb7;\n --color-reply-own-active-apple: #bae6a8;\n\n --color-white: #{$color-white};\n --color-gray: #{$color-gray};\n\n --color-chat-hover: #{$color-chat-hover};\n --color-chat-active: #{$color-chat-active};\n --color-item-active: #{$color-item-active};\n\n --color-selection-highlight: #{$color-selection};\n --color-selection-highlight-emoji: rgba(#{toRGB($color-selection)}, 0.7);\n\n --color-user-1: #{$color-user-1};\n --color-user-2: #{$color-user-2};\n --color-user-4: #{$color-user-4};\n --color-user-5: #{$color-user-5};\n --color-user-6: #{$color-user-6};\n --color-user-7: #{$color-user-7};\n --color-user-8: #{$color-user-8};\n\n --color-default-shadow: #72727240;\n --color-light-shadow: #7272722b;\n\n --vh: 1vh;\n\n --border-radius-default: 0.75rem;\n --border-radius-default-small: 0.625rem;\n --border-radius-default-tiny: 0.375rem;\n --border-radius-messages: 0.75rem;\n --border-radius-messages-small: 0.375rem;\n --messages-container-width: 45.5rem;\n --right-column-width: 26.5rem;\n --header-height: 3.5rem;\n\n --symbol-menu-width: 26.25rem;\n --symbol-menu-height: 23.25rem;\n --symbol-menu-footer-height: 3rem;\n\n @media (min-width: 1276px) and (max-width: 1920px) {\n --right-column-width: 25vw;\n }\n\n @media (min-width: 1921px) {\n --messages-container-width: 50vw;\n }\n\n @media (max-width: 600px) {\n --right-column-width: 100vw;\n --symbol-menu-width: 100vw;\n --symbol-menu-height: 14.6875rem;\n }\n\n --z-ui-loader-mask: 2000;\n --z-notification: 1000;\n --z-right-column: 900;\n --z-header-menu: 990;\n --z-header-menu-backdrop: 980;\n --z-modal: 1000;\n --z-media-viewer: 1500;\n --z-drop-area: 55;\n --z-animation-fade: 50;\n --z-menu-bubble: 21;\n --z-menu-backdrop: 20;\n --z-message-highlighted: 14;\n --z-message-context-menu: 13;\n --z-scroll-down-button: 12;\n --z-mobile-search: 12;\n --z-middle-header: 11;\n --z-middle-footer: 11;\n --z-country-code-input-group: 10;\n --z-message-select-control: 9;\n --z-message-select-area: 8;\n --z-sticky-date: 9;\n --z-register-add-avatar: 5;\n --z-media-viewer-head: 3;\n --z-resize-handle: 2;\n --z-below: -1;\n\n --spinner-white-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI2ZmZmZmZiIvPjwvc3ZnPg==);\n --spinner-white-thin-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTEyIDIzQzUuOSAyMyAxIDE4LjEgMSAxMlM1LjkgMSAxMiAxVjBDNS40IDAgMCA1LjQgMCAxMnM1LjQgMTIgMTIgMTIgMTItNS40IDEyLTEyaC0xYzAgNi4xLTQuOSAxMS0xMSAxMXoiLz48L3N2Zz4=);\n --spinner-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRlYTRmNiIvPjwvc3ZnPg==);\n --spinner-dark-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzgzNzhEQiIvPjwvc3ZnPg==);\n --spinner-black-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzJlMzkzOSIvPjwvc3ZnPg==);\n --spinner-green-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRmYWU0ZSIvPjwvc3ZnPg==);\n --spinner-gray-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzcwNzU3OSIvPjwvc3ZnPg==);\n --spinner-yellow-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI0ZERDc2NCIvPjwvc3ZnPg==);\n\n --drag-target-border: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%23DDDFE0' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n --drag-target-border-hovered: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%2363A2E3' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n\n --layer-blackout-opacity: 0.3;\n\n --layer-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);\n --slide-transition: 300ms cubic-bezier(0.25, 1, 0.5, 1);\n --select-transition: 200ms ease-out;\n\n body.is-ios {\n --layer-transition: 450ms cubic-bezier(0.33, 1, 0.68, 1);\n --slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n }\n\n body.is-android {\n --layer-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n --slide-transition: 400ms cubic-bezier(0.25, 1, 0.5, 1);\n }\n}\n","@use \"sass:map\";\n\n$spacer: 1rem !default;\n$spacers: () !default;\n$spacers: map.merge(\n (\n 0: 0,\n 1: (\n $spacer * 0.25,\n ),\n 2: (\n $spacer * 0.5,\n ),\n 3: $spacer,\n 4: (\n $spacer * 1.5,\n ),\n 5: (\n $spacer * 2,\n ),\n 6: (\n $spacer * 3,\n ),\n ),\n $spacers\n);\n\n// Margin and Padding\n\n@each $prop, $abbrev in (margin: m, padding: p) {\n @each $size, $length in $spacers {\n .#{$abbrev}-#{$size} {\n #{$prop}: $length !important;\n }\n .#{$abbrev}t-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-top: $length !important;\n }\n .#{$abbrev}r-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-right: $length !important;\n }\n .#{$abbrev}b-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-bottom: $length !important;\n }\n .#{$abbrev}l-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-left: $length !important;\n }\n }\n}\n",".input-group {\n position: relative;\n margin-bottom: 1.5rem;\n\n label {\n display: block;\n padding: 0 0.25rem;\n position: absolute;\n left: 0.75rem;\n top: 0.9375rem;\n background-color: var(--color-background);\n font-size: 1rem;\n font-weight: 400;\n color: var(--color-placeholders);\n transition: transform 0.15s ease-out, color 0.15s ease-out;\n cursor: text;\n pointer-events: none;\n transform-origin: left center;\n white-space: nowrap;\n }\n\n &.with-arrow {\n &::after {\n content: \"\";\n position: absolute;\n height: 0.75rem;\n width: 0.75rem;\n border-left: 1px var(--color-text-secondary) solid;\n border-bottom: 1px var(--color-text-secondary) solid;\n transform: rotate(-45deg);\n right: 2rem;\n top: 1rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(0.75) translate(-0.5rem, -2.25rem);\n }\n\n input::placeholder,\n .form-control::placeholder {\n color: var(--color-placeholders);\n }\n\n &.touched label {\n color: var(--color-text-secondary);\n }\n\n &.error label {\n color: var(--color-error) !important;\n }\n\n &.success label {\n color: var(--color-text-green) !important;\n }\n\n &.disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n\n &[dir=\"rtl\"] {\n input {\n text-align: right;\n }\n\n label {\n left: auto;\n right: 0.75rem;\n }\n\n &.with-arrow {\n &::after {\n border-left: none;\n border-right: 1px var(--color-text-secondary) solid;\n right: auto;\n left: 2rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(0.75) translate(1.5rem, -2.25rem);\n }\n }\n}\n\n.form-control {\n --border-width: 1px;\n display: block;\n width: 100%;\n height: 3.375rem;\n padding: calc(0.75rem - var(--border-width)) calc(0.9rem - var(--border-width));\n border: var(--border-width) solid var(--color-borders-input);\n border-radius: var(--border-radius-default);\n color: var(--color-text);\n background-color: var(--color-background);\n outline: none;\n transition: border-color 0.15s ease;\n word-break: break-word;\n -webkit-appearance: none;\n\n font-size: 1rem;\n line-height: 1.25rem;\n\n &[dir] {\n text-align: initial;\n }\n\n &:hover {\n border-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:focus,\n &.focus {\n border-color: var(--color-primary);\n box-shadow: inset 0 0 0 1px var(--color-primary);\n caret-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:disabled {\n background: none !important;\n }\n\n .error & {\n border-color: var(--color-error);\n box-shadow: inset 0 0 0 1px var(--color-error);\n caret-color: var(--color-error);\n }\n\n .success & {\n border-color: var(--color-text-green);\n box-shadow: inset 0 0 0 1px var(--color-text-green);\n caret-color: var(--color-text-green);\n }\n}\n\nselect.form-control {\n option {\n line-height: 2rem;\n }\n}\n\ntextarea.form-control {\n resize: none;\n overflow: hidden;\n line-height: 1.3125rem;\n padding-top: calc(1rem - var(--border-width));\n padding-bottom: calc(1rem - var(--border-width));\n}\n\n.input-group.password-input {\n position: relative;\n\n .form-control {\n padding-right: 3.375rem;\n }\n\n .toggle-password {\n position: absolute;\n top: 0;\n right: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n outline: none !important;\n\n color: var(--color-text-secondary);\n opacity: 0.7;\n font-size: 1.5rem;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n }\n\n &[dir=\"rtl\"] {\n .form-control {\n padding-left: 3.375rem;\n padding-right: calc(0.9rem - var(--border-width));\n }\n\n .toggle-password {\n left: 0;\n right: auto;\n }\n }\n}\n","@font-face {\n font-family: 'icomoon';\n src: url('../assets/fonts/icomoon.woff2?n9djnk') format('woff2'),\n url('../assets/fonts/icomoon.woff?n9djnk') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n}\n\n[class^=\"icon-\"], [class*=\" icon-\"] {\n /* use !important to prevent issues with browser extensions that change fonts */\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: 'icomoon' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[class^=\"icon-char-\"], [class*=\" icon-char-\"] {\n &::before {\n font-family: Roboto, \"Helvetica Neue\", sans-serif;\n content: attr(data-char);\n width: 1.5rem;\n text-align: center;\n display: block;\n }\n}\n\n.icon-loop:before {\n content: \"\\e98c\";\n}\n.icon-skip-next:before {\n content: \"\\e98d\";\n}\n.icon-skip-previous:before {\n content: \"\\e98e\";\n}\n.icon-volume-1:before {\n content: \"\\e98f\";\n}\n.icon-volume-2:before {\n content: \"\\e990\";\n}\n.icon-volume-3:before {\n content: \"\\e991\";\n}\n.icon-reaction-filled:before {\n content: \"\\e994\";\n}\n.icon-reactions:before {\n content: \"\\e993\";\n}\n.icon-sidebar:before {\n content: \"\\e992\";\n}\n.icon-video-stop:before {\n content: \"\\e98b\";\n}\n.icon-speaker:before {\n content: \"\\e981\";\n}\n.icon-speaker-outline:before {\n content: \"\\e982\";\n}\n.icon-phone-discard-outline:before {\n content: \"\\e983\";\n}\n.icon-allow-speak:before {\n content: \"\\e984\";\n}\n.icon-stop-raising-hand:before {\n content: \"\\e985\";\n}\n.icon-share-screen:before {\n content: \"\\e986\";\n}\n.icon-voice-chat:before {\n content: \"\\e987\";\n}\n.icon-video:before {\n content: \"\\e988\";\n}\n.icon-noise-suppression:before {\n content: \"\\e989\";\n}\n.icon-phone-discard:before {\n content: \"\\e98a\";\n}\n.icon-bot-commands-filled:before {\n content: \"\\e97f\";\n}\n.icon-reply-filled:before {\n content: \"\\e980\";\n}\n.icon-bug:before {\n content: \"\\e97e\";\n}\n.icon-data:before {\n content: \"\\e97d\";\n}\n.icon-darkmode:before {\n content: \"\\e979\";\n}\n.icon-animations:before {\n content: \"\\e97a\";\n}\n.icon-enter:before {\n content: \"\\e97b\";\n}\n.icon-fontsize:before {\n content: \"\\e97c\";\n}\n.icon-permissions:before {\n content: \"\\e976\";\n}\n.icon-card:before {\n content: \"\\e977\";\n}\n.icon-truck:before {\n content: \"\\e978\";\n}\n.icon-share-filled:before {\n content: \"\\e95a\";\n}\n.icon-bold:before {\n content: \"\\e961\";\n}\n.icon-bot-command:before {\n content: \"\\e962\";\n}\n.icon-calendar-filter:before {\n content: \"\\e963\";\n}\n.icon-comments:before {\n content: \"\\e964\";\n}\n.icon-comments-sticker:before {\n content: \"\\e965\";\n}\n.icon-arrow-down:before {\n content: \"\\e966\";\n}\n.icon-email:before {\n content: \"\\e967\";\n}\n.icon-italic:before {\n content: \"\\e968\";\n}\n.icon-link:before {\n content: \"\\e969\";\n}\n.icon-mention:before {\n content: \"\\e96a\";\n}\n.icon-monospace:before {\n content: \"\\e96b\";\n}\n.icon-next:before {\n content: \"\\e96c\";\n}\n.icon-password-off:before {\n content: \"\\e96d\";\n}\n.icon-pin-list:before {\n content: \"\\e96e\";\n}\n.icon-previous:before {\n content: \"\\e96f\";\n}\n.icon-replace:before {\n content: \"\\e970\";\n}\n.icon-schedule:before {\n content: \"\\e971\";\n}\n.icon-strikethrough:before {\n content: \"\\e972\";\n}\n.icon-underlined:before {\n content: \"\\e973\";\n}\n.icon-zoom-in:before {\n content: \"\\e974\";\n}\n.icon-zoom-out:before {\n content: \"\\e975\";\n}\n.icon-select:before {\n content: \"\\e960\";\n}\n.icon-folder:before {\n content: \"\\e913\";\n}\n.icon-bots:before {\n content: \"\\e915\";\n}\n.icon-calendar:before {\n content: \"\\e916\";\n}\n.icon-cloud-download:before {\n content: \"\\e917\";\n}\n.icon-colorize:before {\n content: \"\\e918\";\n}\n.icon-forward:before {\n content: \"\\e927\";\n}\n.icon-reply:before {\n content: \"\\e947\";\n}\n.icon-help:before {\n content: \"\\e92a\";\n}\n.icon-info:before {\n content: \"\\e92b\";\n}\n.icon-info-filled:before {\n content: \"\\e91b\";\n}\n.icon-delete-filled:before {\n content: \"\\e91c\";\n}\n.icon-delete:before {\n content: \"\\e91d\";\n}\n.icon-edit:before {\n content: \"\\e923\";\n}\n.icon-new-chat-filled:before {\n content: \"\\e939\";\n}\n.icon-send:before {\n content: \"\\e94a\";\n}\n.icon-send-outline:before {\n content: \"\\e94b\";\n}\n.icon-add-user-filled:before {\n content: \"\\e904\";\n}\n.icon-add-user:before {\n content: \"\\e905\";\n}\n.icon-delete-user:before {\n content: \"\\e91e\";\n}\n.icon-microphone:before {\n content: \"\\e935\";\n}\n.icon-microphone-alt:before {\n content: \"\\e93b\";\n}\n.icon-poll:before {\n content: \"\\e938\";\n}\n.icon-revote:before {\n content: \"\\e93a\";\n}\n.icon-photo:before {\n content: \"\\e940\";\n}\n.icon-document:before {\n content: \"\\e91f\";\n}\n.icon-camera:before {\n content: \"\\e90e\";\n}\n.icon-camera-add:before {\n content: \"\\e90f\";\n}\n.icon-logout:before {\n content: \"\\e932\";\n}\n.icon-saved-messages:before {\n content: \"\\e948\";\n}\n.icon-settings:before {\n content: \"\\e94e\";\n}\n.icon-phone:before {\n content: \"\\e93f\";\n}\n.icon-attach:before {\n content: \"\\e909\";\n}\n.icon-copy:before {\n content: \"\\e91a\";\n}\n.icon-channel:before {\n content: \"\\e911\";\n}\n.icon-group:before {\n content: \"\\e929\";\n}\n.icon-user:before {\n content: \"\\e959\";\n}\n.icon-non-contacts:before {\n content: \"\\e928\";\n}\n.icon-active-sessions:before {\n content: \"\\e902\";\n}\n.icon-admin:before {\n content: \"\\e906\";\n}\n.icon-download:before {\n content: \"\\e921\";\n}\n.icon-location:before {\n content: \"\\e930\";\n}\n.icon-stop:before {\n content: \"\\e952\";\n}\n.icon-archive:before {\n content: \"\\e908\";\n}\n.icon-unarchive:before {\n content: \"\\e953\";\n}\n.icon-readchats:before {\n content: \"\\e933\";\n}\n.icon-unread:before {\n content: \"\\e957\";\n}\n.icon-message:before {\n content: \"\\e934\";\n}\n.icon-lock:before {\n content: \"\\e931\";\n}\n.icon-unlock:before {\n content: \"\\e954\";\n}\n.icon-mute:before {\n content: \"\\e937\";\n}\n.icon-unmute:before {\n content: \"\\e955\";\n}\n.icon-pin:before {\n content: \"\\e941\";\n}\n.icon-unpin:before {\n content: \"\\e956\";\n}\n.icon-smallscreen:before {\n content: \"\\e95e\";\n}\n.icon-fullscreen:before {\n content: \"\\e95f\";\n}\n.icon-large-pause:before {\n content: \"\\e92e\";\n}\n.icon-large-play:before {\n content: \"\\e92f\";\n}\n.icon-pause:before {\n content: \"\\e93d\";\n}\n.icon-play:before {\n content: \"\\e943\";\n}\n.icon-channelviews:before {\n content: \"\\e912\";\n}\n.icon-message-succeeded:before {\n content: \"\\e900\";\n}\n.icon-message-read:before {\n content: \"\\e901\";\n}\n.icon-message-pending:before {\n content: \"\\e94c\";\n}\n.icon-message-failed:before {\n content: \"\\e94d\";\n}\n.icon-favorite:before {\n content: \"\\e93e\";\n}\n.icon-keyboard:before {\n content: \"\\e944\";\n}\n.icon-delete-left:before {\n content: \"\\e945\";\n}\n.icon-recent:before {\n content: \"\\e946\";\n}\n.icon-gifs:before {\n content: \"\\e94f\";\n}\n.icon-stickers:before {\n content: \"\\e95b\";\n}\n.icon-smile:before {\n content: \"\\e950\";\n}\n.icon-animals:before {\n content: \"\\e907\";\n}\n.icon-eats:before {\n content: \"\\e922\";\n}\n.icon-sport:before {\n content: \"\\e951\";\n}\n.icon-car:before {\n content: \"\\e910\";\n}\n.icon-lamp:before {\n content: \"\\e92c\";\n}\n.icon-language:before {\n content: \"\\e92d\";\n}\n.icon-flag:before {\n content: \"\\e926\";\n}\n.icon-more:before {\n content: \"\\e936\";\n}\n.icon-search:before {\n content: \"\\e949\";\n}\n.icon-remove:before {\n content: \"\\e95c\";\n}\n.icon-add:before {\n content: \"\\e903\";\n}\n.icon-check:before {\n content: \"\\e914\";\n}\n.icon-close:before {\n content: \"\\e919\";\n}\n.icon-arrow-left:before {\n content: \"\\e90d\";\n}\n.icon-arrow-right:before {\n content: \"\\e93c\";\n}\n.icon-down:before {\n content: \"\\e920\";\n}\n.icon-up:before {\n content: \"\\e958\";\n}\n.icon-eye-closed:before {\n content: \"\\e925\";\n}\n.icon-eye:before {\n content: \"\\e924\";\n}\n.icon-muted:before {\n content: \"\\e95d\";\n}\n.icon-avatar-archived-chats:before {\n content: \"\\e90a\";\n}\n.icon-avatar-deleted-account:before {\n content: \"\\e90b\";\n}\n.icon-avatar-saved-messages:before {\n content: \"\\e90c\";\n}\n.icon-pinned-chat:before {\n content: \"\\e942\";\n}\n","@import \"./mixins\";\n\n// Common styles for all media-type components across the app.\n.media-inner {\n position: relative;\n\n video,\n img {\n display: block;\n object-fit: cover;\n }\n\n video {\n background: no-repeat 50% 50%;\n background-size: contain;\n }\n\n .thumbnail ~ .thumbnail,\n .thumbnail ~ .full-media,\n .media-loading {\n position: absolute;\n }\n}\n\n.animated-close-icon {\n position: absolute;\n transform: rotate(-45deg);\n\n &,\n &::before,\n &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform var(--slide-transition);\n }\n\n &::before,\n &::after {\n position: absolute;\n left: 0;\n top: 0;\n content: \"\";\n }\n\n &::before {\n transform: rotate(90deg);\n }\n\n &.no-transition {\n &,\n &::before,\n &::after {\n transition: none;\n }\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0, -0.375rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0, 0.375rem);\n }\n }\n}\n\n// Used by ChatList and ContactList components\n.chat-list {\n background: var(--color-background);\n height: 100%;\n padding: 0.5rem 0.125rem 0.5rem 0.4375rem;\n\n overflow-y: auto;\n body.is-android & {\n @include overflow-y-overlay();\n }\n\n .scroll-container {\n position: relative;\n }\n\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 0;\n padding-right: 0;\n }\n\n .no-results {\n color: var(--color-text-meta);\n margin-top: 2rem;\n text-align: center;\n }\n}\n\n// Used by Avatar and ProfilePhoto components\ndiv {\n &.color-bg-1 {\n --color-user: var(--color-user-1);\n }\n\n &.color-bg-2 {\n --color-user: var(--color-user-2);\n }\n\n &.color-bg-4 {\n --color-user: var(--color-user-4);\n }\n\n &.color-bg-5 {\n --color-user: var(--color-user-5);\n }\n\n &.color-bg-6 {\n --color-user: var(--color-user-6);\n }\n\n &.color-bg-7 {\n --color-user: var(--color-user-7);\n }\n\n &.color-bg-8 {\n --color-user: var(--color-user-8);\n }\n\n &.replies-bot-account,\n &.saved-messages {\n --color-user: var(--color-primary);\n }\n\n &.deleted-account {\n --color-user: var(--color-gray);\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.Transition__slide--active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n\n@mixin reset-range() {\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n\n &::-moz-slider-thumb {\n -moz-appearance: none;\n }\n\n &::-webkit-slider-runnable-track {\n cursor: pointer;\n }\n\n &::-moz-range-track, &::-moz-range-progress {\n cursor: pointer;\n }\n }\n}\n","@media print {\n body,\n html,\n .messages-layout {\n background: #fff;\n }\n\n #LeftColumn,\n #RightColumn-wrapper,\n .ChatOrUserPicker,\n #Notifications,\n .Modal,\n .ActiveCallHeader,\n .unread-count,\n #middle-column-bg,\n #middle-column-portals,\n .header-tools,\n .ScrollDownButton,\n .middle-column-footer {\n display: none !important;\n }\n\n #MiddleColumn {\n border-left: none !important;\n }\n\n html,\n body,\n #root,\n #UiLoader,\n #Main,\n #MiddleColumn,\n .MessageList,\n .messages-layout,\n .Transition,\n .Transition > * {\n height: auto !important;\n overflow: visible !important;\n display: block !important;\n position: static !important;\n margin: 0 !important;\n padding: 0 !important;\n width: 100% !important;\n max-width: 100% !important;\n transform: none !important;\n }\n\n .messages-container {\n max-width: 100rem !important;\n width: 100% !important;\n }\n\n .MessageList .sticky-date > span,\n .MessageList .local-action-message > span,\n .MessageList .ActionMessage > span,\n .MessageList .empty > span {\n background: var(--color-background-own) !important;\n color: var(--color-text) !important;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.fe60a7529fd8efae014a.js b/dist/main.fe60a7529fd8efae014a.js deleted file mode 100644 index 7cfde312..00000000 --- a/dist/main.fe60a7529fd8efae014a.js +++ /dev/null @@ -1,2 +0,0 @@ -(()=>{"use strict";var e,t,n,r,o,d,a={1226:(e,t,n)=>{n.d(t,{t9:()=>c,u3:()=>l,g8:()=>i});var r=n(3716),o=n(6926),d=n(9118);let a;const u=new Map,s=new Map;function i(e,t){return a||(r.eM&&console.log(">>> START LOAD WORKER"),a=new Worker(new URL(n.p+n.u(626),n.b)),function(e){a.addEventListener("message",(t=>{let{data:n}=t;if("update"===n.type)e(n.update);else if("methodResponse"===n.type){const e=u.get(n.messageId);e&&(n.error?e.reject(n.error):e.resolve(n.response))}else if("methodCallback"===n.type){var r,o;null===(r=u.get(n.messageId))||void 0===r||null===(o=r.callback)||void 0===o||o.call(r,...n.callbackArgs)}else if("unhandledError"===n.type){var d;throw new Error(null===(d=n.error)||void 0===d?void 0:d.message)}}))}(e),"iOS"===t.platform&&window.addEventListener("focus",(()=>{m(),setTimeout((()=>m()),1e3)}))),f({type:"initApi",args:[t]})}function c(e){if(!a)return void(r.eM&&console.warn("API is not initialized"));for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{try{await d}catch(e){}})(),d}function l(e){e.isCanceled=!0;const{messageId:t}=s.get(e)||{};t&&a.postMessage({type:"cancelProgress",messageId:t})}function f(e){const t=(0,o.Z)(u),n={messageId:t,...e},r={messageId:t},d=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("args"in n&&"function"==typeof n.args[1]){const e=n.args.pop();r.callback=e,s.set(e,r)}return u.set(t,r),d.catch((()=>{})).finally((()=>{u.delete(t),r.callback&&s.delete(r.callback)})),a.postMessage(n),d}const h=Date.now();async function m(){try{await Promise.race([f({type:"ping"}),(0,d.wO)(150).then((()=>Promise.reject(new Error("HEALTH_CHECK_TIMEOUT"))))])}catch(e){console.error(e),Date.now()-h>=5e3&&window.location.reload()}}},6137:(e,t,n)=>{n.d(t,{Vv:()=>r.Vv,_f:()=>r._f,_Q:()=>r._Q,IU:()=>o.I});var r=n(4746),o=n(9077)},9077:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e[e.BlobUrl=0]="BlobUrl",e[e.Lottie=1]="Lottie",e[e.Progressive=2]="Progressive",e[e.Stream=3]="Stream"}(r||(r={}))},4746:(e,t,n)=>{let r;n.d(t,{Vv:()=>r,_f:()=>o,_Q:()=>d}),function(e){e.Bold="MessageEntityBold",e.Blockquote="MessageEntityBlockquote",e.BotCommand="MessageEntityBotCommand",e.Cashtag="MessageEntityCashtag",e.Code="MessageEntityCode",e.Email="MessageEntityEmail",e.Hashtag="MessageEntityHashtag",e.Italic="MessageEntityItalic",e.MentionName="MessageEntityMentionName",e.Mention="MessageEntityMention",e.Phone="MessageEntityPhone",e.Pre="MessageEntityPre",e.Strike="MessageEntityStrike",e.TextUrl="MessageEntityTextUrl",e.Url="MessageEntityUrl",e.Underline="MessageEntityUnderline",e.Spoiler="MessageEntitySpoiler",e.Unknown="MessageEntityUnknown"}(r||(r={}));const o=-1,d="MESSAGE_DELETED"},88:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),o=n(5116);const d=36,a=2147483647;function u(e,t,n){let r;for(e=n?Math.floor(e/700):e>>1,e+=Math.floor(e/t),r=0;e>455;r+=d)e=Math.floor(e/35);return Math.floor(r+36*e/(e+38))}function s(e,t){const n=[],r=[],o=e.length;let s,i,c,l,f,h,m,p,g,v,y,b,I;for(s=128,c=0,l=72,f=e.lastIndexOf("-"),f<0&&(f=0),h=0;h=128)throw new RangeError("Illegal input >= 0x80");n.push(e.charCodeAt(h))}for(m=f>0?f+1:0;m=o)throw RangeError("punycode_bad_input(1)");if(y=(w=e.charCodeAt(m++))-48<10?w-22:w-65<26?w-65:w-97<26?w-97:d,y>=d)throw RangeError("punycode_bad_input(2)");if(y>Math.floor((a-c)/g))throw RangeError("punycode_overflow(1)");if(c+=y*g,b=v<=l?1:v>=l+26?26:v-l,yMath.floor(a/(d-b)))throw RangeError("punycode_overflow(2)");g*=d-b}if(i=n.length+1,l=u(c-p,i,0===p),Math.floor(c/i)>a-s)throw RangeError("punycode_overflow(3)");s+=Math.floor(c/i),c%=i,t&&r.splice(c,0,e.charCodeAt(m-1)-65<26),n.splice(c,0,s),c++}var w;if(t)for(c=0,I=n.length;c{const t=[];let n=0;const r=e.length;let o;for(;n65535&&(o-=65536,t.push(String.fromCharCode(o>>>10&1023|55296)),o=56320|1023&o),t.push(String.fromCharCode(o))}return t.join("")})(n)}var i=n(3716),c=n(6752),l=n(1396);function f(e){if(!e)return;const t=(0,l.X)(e);if(t)try{let e=decodeURI(t);const n=e.match(/^https?:\/\/([^/:?#]+)(?:[/:?#]|$)/i);if(!n)return;const r=n[1];return e=e.replace(r,function(e){const t=e.split("."),n=[];for(let e=0;e{let{url:t,text:n,className:d,children:a,isRtl:u}=e;const{toggleSafeLinkModal:s,openTelegramLink:h}=(0,o.uC)(),m=a||n,p=t!==m,g=(0,r.I4)((e=>e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||!t||!t.match(i.FS)&&!t.match(i.g$)?!p||(s({url:t}),e.preventDefault(),!1):(e.preventDefault(),h({url:t}),!1)),[p,h,s,t]);if(!t)return;const v=(0,c.Z)(d||"text-entity-link",n.length>50&&"long-word-break-all");return r.ZP.createElement("a",{href:(0,l.X)(t),title:f(t),target:"_blank",rel:"noopener noreferrer",className:v,onClick:g,dir:u?"rtl":"auto"},m)}))},5376:(e,t,n)=>{n.d(t,{yW:()=>r,K2:()=>o,mD:()=>d,Oh:()=>a,v6:()=>u});function r(e){return e>536870912?`${(e/1073741824).toFixed(1)} GB`:e>524288?`${(e/1048576).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function o(e){const{fileName:t,mimeType:n}=e;return d(t,n)}function d(e,t){return e&&-1!==e.indexOf(".")?e.split(".").pop():t.split("/").pop()}function a(e){switch(e){case"apk":case"xls":case"xlsx":return"green";case"zip":case"rar":case"7z":case"tar":case"gz":case"ppt":case"pptx":return"orange";case"pdf":case"xps":return"red";default:return"default"}}function u(e){return Boolean(e.previewBlobUrl||e.thumbnail)}},4784:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(3681);const o=new RegExp(`^(?:${r.Z.source})+$`,""),d=e=>{if(e.length>24)return!1;if(!Boolean(e.match(o)))return!1;let t=0;for(;r.Z.exec(e);)if(t++,t>3)return r.Z.lastIndex=0,!1;return t}},8005:(e,t,n)=>{n.d(t,{D:()=>y});var r=n(4050),o=n(8415),d=n(8035),a=n(9937),u=n(996),s=n(2340),i=n(6752),c=n(8033),l=n(5116);const f=e=>{let{className:t,sender:n,children:o}=e;const{openChat:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({id:n.id})}),[n,d]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("UserLink",t),onClick:a},o):o},h=e=>{let{className:t,message:n,children:o}=e;const{focusMessage:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({chatId:n.chatId,messageId:n.id})}),[d,n]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("MessageLink",t),onClick:a},o):o},m=e=>{let{className:t,chatId:n,children:o}=e;const{openChat:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({id:n})}),[n,d]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("ChatLink",t),onClick:a},o):o},p=e=>{let{className:t,groupCall:n,children:o}=e;const{joinGroupCall:d}=(0,l.uC)(),a=(0,r.I4)((()=>{n&&d({id:n.id,accessHash:n.accessHash})}),[n,d]);return n?r.ZP.createElement(c.Z,{className:(0,i.Z)("GroupCallLink",t),onClick:a},o):o},g=32,v=" ";function y(e,t,n,r,o,d,u){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};if(!t.content.action)return[];const{text:i,translationValues:c,amount:l,currency:f,call:h}=t.content.action,m=[],p=s.asPlainText||s.asTextWithSpoilers,g="Chat.Service.Group.UpdatedPinnedMessage1"!==i||d?i:"Message.PinnedGenericMessage";let y,M=e(g,null!=c&&c.length?c:void 0);return M.includes("%payment_amount%")&&(y=P(M,"%payment_amount%",(0,a.x)(l,f,e.code)),M=y.pop(),m.push(...y)),y=P(M,"%action_origin%",n?C(n,p)||v:r?S(e,r,p)||v:"User"),M=y.pop(),m.push(...y),y=P(M,"%target_user%",o?o.map((e=>C(e,p))).filter(Boolean):"User"),M=y.pop(),m.push(...y),y=P(M,"%message%",d?I(e,d,s):"a message"),M=y.pop(),m.push(...y),y=P(M,"%product%",d?b(d):"a product"),M=y.pop(),m.push(...y),y=P(M,"%target_chat%",u?E(u,p):"another chat"),m.push(...y),s.asPlainText?m.join("").trim():h?w(h,m):m}function b(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{asPlainText:d,asTextWithSpoilers:a}=n;if(d)return(0,o.MK)(e,t,void 0,g);const s=(0,u.e)(e,t,void 0,void 0,g);return a?r.ZP.createElement("span",null,s):r.ZP.createElement(h,{className:"action-link",message:t},s)}function w(e,t){return r.ZP.createElement(p,{groupCall:e},t)}function C(e,t){const n=(0,d.Z)((0,o.Js)(e),g);return t?n:r.ZP.createElement(f,{className:"action-link",sender:e},e&&(0,s.Z)(n))}function S(e,t,n){const a=(0,d.Z)((0,o.U)(e,t),g);return n?a:r.ZP.createElement(m,{className:"action-link",chatId:t.id},t&&(0,s.Z)(a))}function E(e,t){const n="another chat";return t?n:r.ZP.createElement(m,{className:"action-link",chatId:e},n)}function P(e,t,n){const r=e.indexOf(t);if(r<0||!n)return[e];const o=[];return o.push(e.substring(0,r)),Array.isArray(n)?n.forEach(((e,t)=>{o.push(e),t+1{n.d(t,{X:()=>s,e:()=>i});var r=n(6137),o=n(8415),d=n(2340),a=n(8974),u=n(8035);function s(e,t,n,r,d){const{text:s,entities:i}=e.content.text||{};if(!s){const t=(0,o.UD)(e);return t?[(0,u.Z)(t,d)]:void 0}return(0,a.H)((0,u.Z)(s,d),i,t,n,void 0,e.id,r)}function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.lN,{entities:c}=t.content.text||{};const l=null==c?void 0:c.some((e=>e.type===r.Vv.Spoiler));if(!l){const r=(0,u.Z)((0,o.MK)(e,t,n),i);return a?(0,d.Z)(r,["emoji","highlight"],{highlight:a}):(0,d.Z)(r)}const f=!n&&(0,o.Eb)(t),h=f?`${f} `:"",m=s(t,a,void 0,!0,i),p=(0,o.Kk)(e,t,m);return[h,...Array.isArray(p)?p:[p]].filter(Boolean)}},2340:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),o=n(3681),d=n(3716),a=n(7361),u=n(4284),s=n(6752),i=n(782),c=n(7373),l=n(88);const f=/^[\d\wа-яё]$/i,h=/(\*\*|__).+?\1/g;function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["emoji"],n=arguments.length>2?arguments[2]:void 0;return"string"!=typeof e?[e]:(0,i.oA)(t.reduce(((e,t)=>{switch(t){case"escape_html":return p(e);case"hq_emoji":return o.Z.lastIndex=0,g(e,"big","jsx");case"emoji":return o.Z.lastIndex=0,g(e,"small","jsx");case"emoji_html":return o.Z.lastIndex=0,g(e,"small","html");case"br":return v(e,"jsx");case"br_html":return v(e,"html");case"highlight":return y(e,n.highlight);case"links":return I(e);case"simple_markdown":return w(e,"jsx");case"simple_markdown_html":return w(e,"html")}return e}),[e]))}function p(e){const t=document.createElement("div");return e.reduce(((e,n)=>"string"!=typeof n?(e.push(n),e):(t.innerText=n,e.push(t.innerHTML),e)),[])}function g(e,t,n){return a.op?e:e.reduce(((e,d)=>{if("string"!=typeof d)return e.push(d),e;const a=(d=(0,u.g6)(d)).split(o.Z),i=d.match(o.Z)||[];return e.push(a[0]),i.reduce(((e,d,i)=>{const c=(0,u.U_)((0,o.l)(d));if(!c)return e;const l=(0,s.Z)("emoji","small"===t&&"emoji-small");"jsx"===n&&e.push(r.ZP.createElement("img",{className:l,src:`./img-apple-${"big"===t?"160":"64"}/${c}.png`,alt:d})),"html"===n&&e.push(`${d}`);const f=2*i+2;return a[f]&&e.push(a[f]),e}),e)}),[])}function v(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n)return e.push(n),e;const o=n.split(/\r\n|\r|\n/g).reduce(((e,n,o,d)=>{const a=n.trimLeft(),u=n.length-a.length;return e.push(String.fromCharCode(160).repeat(u)+a),o!==d.length-1&&e.push("jsx"===t?r.ZP.createElement("br",null):"
"),e}),[]);return[...e,...o]}),[])}function y(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n||!t)return e.push(n),e;const o=n.toLowerCase(),d=o.indexOf(t.toLowerCase()),a=o[d+t.length];if(d<0||a&&a.match(f))return e.push(n),e;const u=[];return u.push(n.substring(0,d)),u.push(r.ZP.createElement("span",{className:"matching-text-highlight"},n.substring(d,d+t.length))),u.push(n.substring(d+t.length)),[...e,...u]}),[])}const b=new RegExp(`${d.FM}|${d.uW}`,"ig");function I(e){return e.reduce(((e,t)=>{if("string"!=typeof t)return e.push(t),e;const n=t.match(b);if(!n||!n.length)return e.push(t),e;const o=[];let d=n.shift(),a=0;for(;d;){const e=t.indexOf(d,a);o.push(t.substring(a,e)),d.startsWith("@")?o.push(r.ZP.createElement(c.Z,{username:d},d)):(d.endsWith("?")&&(d=d.slice(0,d.length-1)),o.push(r.ZP.createElement(l.Z,{text:d,url:d}))),a=e+d.length,d=n.shift()}return o.push(t.substring(a)),[...e,...o]}),[])}function w(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n)return e.push(n),e;const o=n.split(h),d=n.match(h)||[];return e.push(o[0]),d.reduce(((e,n,d)=>{"jsx"===t?e.push(n.startsWith("**")?r.ZP.createElement("b",null,n.replace(/\*\*/g,"")):r.ZP.createElement("i",null,n.replace(/__/g,""))):e.push(n.startsWith("**")?`${n.replace(/\*\*/g,"")}`:`${n.replace(/__/g,"")}`);const a=2*d+2;return o[a]&&e.push(o[a]),e}),e)}),[])}},8974:(e,t,n)=>{n.d(t,{z:()=>p,H:()=>m});var r=n(4050),o=n(5116),d=n(6137),a=n(2340),u=n(7373),s=n(88),i=n(6752),c=n(706);const l=new Map,f=(0,i.y)("Spoiler"),h=(0,r.X$)((e=>{let{children:t,messageId:n}=e;const o=(0,r.sO)(null),[d,a,u]=(0,c.Z)(),s=(0,r.I4)((e=>{var t;e.preventDefault(),e.stopPropagation(),null===(t=l.get(n))||void 0===t||t.forEach((e=>e.reveal()));const r=o.current.innerText.length,d=1e3*Math.round(r/23),a=Math.max(5e3,Math.min(d,6e4));setTimeout((()=>{var e;null===(e=l.get(n))||void 0===e||e.forEach((e=>e.conceal())),u()}),a)}),[u,n]);return(0,r.d4)((()=>{if(n)return l.has(n)?l.get(n).push({reveal:a,conceal:u}):l.set(n,[{reveal:a,conceal:u}]),()=>{l.delete(n)}}),[u,s,d,n,a]),r.ZP.createElement("span",{className:f("&",!d&&"concealed",!d&&Boolean(n)&&"animated"),onClick:n&&!d?s:void 0},r.ZP.createElement("span",{className:f("content"),ref:o},t))}));function m(e,t,n,o,i,c,l){if(!t||!t.length)return g(e,n,o,i,l);const f=[];let m=!1;const p=function(e){const t=new Set,n=[];return e.forEach(((r,o)=>{if(t.has(o))return;const d=v(r,o,e,t);d&&(d.organizedIndexes.forEach((e=>{t.add(e)})),n.push(d))})),n}(t);function w(t,f,p,v){const C=[],{entity:S,nestedEntities:E}=p,{offset:P,length:M,type:A}=S;let k=e.substring(t,P);const T=k.length;k&&(m&&k.length>0&&"\n"===k[0]&&(k=k.substr(1),m=!1),k&&C.push(...g(k,n,o,i,l)));const N=t+T,L=N+M;let R=e.substring(P,P+M);const F=[];if(m&&R.length>0&&"\n"===R[0]&&(R=R.substr(1),m=!1),A===d.Vv.Pre&&(m=!0),E.length){let e=N;E.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:o}=w(e,L,t,n===E.length-1);F.push(...r),e=o}))}const x=i?function(e,t,n){const r="string"==typeof t&&t,o=n.length?n.join(""):(0,a.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!r)return o;switch(e.type){case d.Vv.Bold:return`${o}`;case d.Vv.Italic:return`${o}`;case d.Vv.Underline:return`${o}`;case d.Vv.Code:return`${o}`;case d.Vv.Pre:return`\`\`\`
${o}
\`\`\``;case d.Vv.Strike:return`${o}`;case d.Vv.MentionName:return`${o}`;case d.Vv.Url:case d.Vv.TextUrl:return`${o}`;case d.Vv.Spoiler:return`${o}`;default:return o}}(S,R,F):function(e,t,n,o,a,i){const c="string"==typeof t&&t,l=n.length?n:t;function f(){return g(l,o,void 0,void 0,i)}if(!c)return f();if(i){const t=f();return e.type===d.Vv.Spoiler?r.ZP.createElement(h,null,t):t}switch(e.type){case d.Vv.Bold:return r.ZP.createElement("strong",null,f());case d.Vv.Blockquote:return r.ZP.createElement("blockquote",null,f());case d.Vv.BotCommand:return r.ZP.createElement("a",{onClick:b,className:"text-entity-link",dir:"auto"},f());case d.Vv.Hashtag:case d.Vv.Cashtag:return r.ZP.createElement("a",{onClick:I,className:"text-entity-link",dir:"auto"},f());case d.Vv.Code:return r.ZP.createElement("code",{className:"text-entity-code"},f());case d.Vv.Email:return r.ZP.createElement("a",{href:`mailto:${c}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f());case d.Vv.Italic:return r.ZP.createElement("em",null,f());case d.Vv.MentionName:return r.ZP.createElement(u.Z,{userId:e.userId},f());case d.Vv.Mention:return r.ZP.createElement(u.Z,{username:c},f());case d.Vv.Phone:return r.ZP.createElement("a",{href:`tel:${c}`,className:"text-entity-link",dir:"auto"},f());case d.Vv.Pre:return r.ZP.createElement("pre",{className:"text-entity-pre"},f());case d.Vv.Strike:return r.ZP.createElement("del",null,f());case d.Vv.TextUrl:case d.Vv.Url:return r.ZP.createElement(s.Z,{url:y(c,e),text:c},f());case d.Vv.Underline:return r.ZP.createElement("ins",null,f());case d.Vv.Spoiler:return r.ZP.createElement(h,{messageId:a},f());default:return f()}}(S,R,F,n,c,l);if(Array.isArray(x)?C.push(...x):C.push(x),v&&L0&&"\n"===t[0]&&(t=t.substring(1)),t&&C.push(...g(t,n,o,i,l))}return{renderResult:C,entityEndIndex:L}}let C=0;return p.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:o}=w(C,e.length,t,n===p.length-1);f.push(...r),C=o})),f}function p(e){const{text:t,entities:n}=e||{};if(!t)return"";const r=m(t,n,void 0,void 0,!0);return Array.isArray(r)?r.join(""):r}function g(e,t,n,r,o){if(Array.isArray(e)){const d=[];return e.forEach((e=>{d.push(...g(e,t,n,r,o))})),d}if(r)return(0,a.Z)(e,["escape_html","emoji_html","br_html"]);const d=[n?"hq_emoji":"emoji"];return o||d.push("br"),t?(0,a.Z)(e,d.concat("highlight"),{highlight:t}):(0,a.Z)(e,d)}function v(e,t,n,r){const{offset:o,length:d}=e,a=new Set([t]);if(r.has(t))return;const u=[];return n.filter(((e,n)=>n>t&&e.offset>=o&&e.offsetv(e,n.indexOf(e),n,r))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||a.has(e)||(t=!0),a.add(e)})),t&&u.push(e)})),{entity:e,organizedIndexes:a,nestedEntities:u}}function y(e,t){const{type:n,url:r}=t;return n===d.Vv.TextUrl&&r?r:e}function b(e){(0,o.uC)().sendBotCommand({command:e.currentTarget.innerText})}function I(e){(0,o.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,o.uC)().searchTextMessagesLocal()}},386:(e,t,n)=>{n.d(t,{q:()=>d,b:()=>a});var r=n(3716),o=n(7361);function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.cj||!document.activeElement||document.activeElement.id!==r.R2||!t&&e.target!==e.currentTarget||e.preventDefault()}function a(e){d(e,!0)}},7373:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(5116),d=n(9066);const a=(0,o.c$)(((e,t)=>{let{userId:n}=t;return{userOrChat:n?(0,d.dy)(e,n):void 0}}))((e=>{let{username:t,userOrChat:n,children:d}=e;const{openChat:a,openChatByUsername:u}=(0,o.uC)();return r.ZP.createElement("a",{onClick:()=>{n?a({id:n.id}):t&&u({username:t.substring(1)})},className:"text-entity-link",dir:"auto"},d)}))},231:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9204),a=n(8512);const u=e=>{let{ref:t,type:n="button",onClick:u,onContextMenu:s,onMouseDown:i,onMouseEnter:c,onMouseLeave:l,onFocus:f,children:h,size:m="default",color:p="primary",backgroundImage:g,className:v,round:y,pill:b,fluid:I,isText:w,isLoading:C,ariaLabel:S,href:E,download:P,disabled:M,ripple:A,faded:k,tabIndex:T,isRtl:N,withClickPropagation:L}=e,R=(0,r.sO)(null);t&&(R=t);const[F,x]=(0,r.eJ)(!1),B=(0,o.Z)("Button",v,m,p,y&&"round",b&&"pill",I&&"fluid",M&&"disabled",w&&"text",C&&"loading",A&&"has-ripple",k&&"faded",F&&"clicked",g&&"with-image"),O=(0,r.I4)((e=>{!M&&u&&u(e),x(!0),setTimeout((()=>{x(!1)}),400)}),[M,u]),Z=(0,r.I4)((e=>{L||e.preventDefault(),!M&&i&&i(e)}),[i,M,L]);return E?r.ZP.createElement("a",{ref:R,className:B,href:E,title:S,download:P,tabIndex:T,dir:N?"rtl":void 0},h,!M&&A&&r.ZP.createElement(a.Z,null)):r.ZP.createElement("button",{ref:R,type:n,className:B,onClick:O,onContextMenu:s,onMouseDown:Z,onMouseEnter:c&&!M?c:void 0,onMouseLeave:l&&!M?l:void 0,onFocus:f&&!M?f:void 0,"aria-label":S,title:S,tabIndex:T,dir:N?"rtl":void 0,style:g?`background-image: url(${g})`:void 0},C?r.ZP.createElement("div",null,r.ZP.createElement("span",{dir:N?"auto":void 0},"Please wait..."),r.ZP.createElement(d.Z,{color:w?"blue":"white"})):h,!M&&A&&r.ZP.createElement(a.Z,null))}},4605:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),o=n(6752),d=n(9107),a=n(2340),u=n(9204);const s=(0,r.X$)((e=>{let{id:t,name:n,value:s,label:i,subLabel:c,checked:l,disabled:f,round:h,blocking:m,isLoading:p,onChange:g,onCheck:v}=e;const y=(0,d.Z)(),b=(0,r.I4)((e=>{g&&g(e),v&&v(e.currentTarget.checked)}),[g,v]),I=(0,o.Z)("Checkbox",f&&"disabled",h&&"round",p&&"loading",m&&"blocking");return r.ZP.createElement("label",{className:I,dir:y.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"checkbox",id:t,name:n,value:s,checked:l,disabled:f,onChange:b}),r.ZP.createElement("div",{className:"Checkbox-main"},r.ZP.createElement("span",{className:"label",dir:"auto"},(0,a.Z)(i)),c&&r.ZP.createElement("span",{className:"subLabel",dir:"auto"},(0,a.Z)(c))),p&&r.ZP.createElement(u.Z,null))}))},3106:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(2328);const d=e=>{let{trigger:t,className:n,children:d,positionX:a="left",positionY:u="top",footer:s,forceOpen:i,onOpen:c,onClose:l}=e;const f=(0,r.sO)(null),h=(0,r.sO)(null),[m,p]=(0,r.eJ)(!1);return r.ZP.createElement("div",{ref:h,className:`DropdownMenu ${n||""}`,onKeyDown:e=>{const t=f.current;if(!m||40!==e.keyCode||!t)return;const n=document.activeElement,r=Array.from(t.children);n&&-1!==r.indexOf(n)||r[0].focus()}},t({onTrigger:()=>{p(!m),m?l&&l():c&&c()},isOpen:m}),r.ZP.createElement(o.Z,{ref:f,containerRef:h,isOpen:m||Boolean(i),className:n||"",positionX:a,positionY:u,footer:s,autoClose:!0,onClose:()=>{p(!1),l&&l()},shouldSkipTransition:i},d))}},7687:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6752),d=n(9107);const a=(0,r.X$)((e=>{let{ref:t,id:n,className:a,value:u,label:s,error:i,success:c,disabled:l,readOnly:f,placeholder:h,autoComplete:m,inputMode:p,maxLength:g,onChange:v,onInput:y,onKeyPress:b,onKeyDown:I,onBlur:w,onPaste:C}=e;const S=(0,d.Z)(),E=i||c||s,P=(0,o.Z)("input-group",u&&"touched",i?"error":c&&"success",l&&"disabled",f&&"disabled",E&&"with-label",a);return r.ZP.createElement("div",{className:P,dir:S.isRtl?"rtl":void 0},r.ZP.createElement("input",{ref:t,className:"form-control",type:"text",id:n,dir:"auto",value:u||"",placeholder:h,maxLength:g,autoComplete:m,inputMode:p,disabled:l,readOnly:f,onChange:v,onInput:y,onKeyPress:b,onKeyDown:I,onBlur:w,onPaste:C}),E&&r.ZP.createElement("label",{htmlFor:n},E))}))},8033:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=e=>{let{children:t,className:n,isRtl:d,onClick:a}=e;const u=(0,r.I4)((e=>{e.preventDefault(),a(e)}),[a]);return r.ZP.createElement("a",{href:"#",className:(0,o.Z)("Link",n),dir:d?"rtl":"auto",onClick:a?u:void 0},t)}},4288:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(9204),d=n(6752);const a=(0,r.X$)((e=>{let{color:t="blue",backgroundColor:n,onClick:a}=e;return r.ZP.createElement("div",{className:(0,d.Z)("Loading",a&&"interactive"),onClick:a},r.ZP.createElement(o.Z,{color:t,backgroundColor:n}))}))},2328:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),o=n(1212),d=n(2313),a=n(8758),u=n(274),s=n(3989),i=n(6752),c=n(8674),l=n(6590),f=n(386),h=n(7361);const m=e=>{let{ref:t,containerRef:n,isOpen:m,className:p,style:g,bubbleStyle:v,children:y,transformOriginX:b,transformOriginY:I,positionX:w="left",positionY:C="top",autoClose:S=!1,footer:E,noCloseOnBackdrop:P=!1,noCompact:M,onCloseAnimationEnd:A,onClose:k,onMouseEnter:T,onMouseLeave:N,shouldSkipTransition:L}=e,R=(0,r.sO)(null);t&&(R=t);const F=n||R,{transitionClassNames:x}=(0,o.Z)(m,A,L,void 0,L);(0,r.d4)((()=>m&&k?(0,s.Z)(k):void 0),[m,k]),(0,l.ZP)(m,k,void 0,void 0,S),(0,u.Z)((e=>{let[t]=e;(m||!m&&!0===t)&&(0,c.YW)(200)}),[m]);const B=(0,d.Z)(R,m,S?k:void 0,void 0,!0);(0,a.Z)(m,F,P?void 0:k);const O=(0,i.Z)("bubble menu-container custom-scroll",C,w,E&&"with-footer",x),Z=void 0!==I?`${I}px`:void 0,D=void 0!==b?`${b}px`:void 0;return r.ZP.createElement("div",{className:(0,i.Z)("Menu no-selection",!M&&h.FW&&"compact",p),onKeyDown:m?B:void 0,onMouseEnter:T,onMouseLeave:m?N:void 0,style:g},m&&r.ZP.createElement("div",{className:"backdrop",onMouseDown:f.b}),r.ZP.createElement("div",{ref:R,className:O,style:`transform-origin: ${D||w} ${Z||C};${v||""}`,onClick:S?k:void 0},y,E&&r.ZP.createElement("div",{className:"footer"},E)))}},8964:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9107),a=n(7361);const u=e=>{const{icon:t,className:n,children:u,onClick:s,href:i,download:c,disabled:l,destructive:f,ariaLabel:h}=e,m=(0,d.Z)(),p=(0,r.I4)((e=>{if(l||!s)return e.stopPropagation(),void e.preventDefault();s(e)}),[l,s]),g=(0,r.I4)((e=>{if(13===e.keyCode||32===e.keyCode)return l||!s?(e.stopPropagation(),void e.preventDefault()):void s(e)}),[l,s]),v=(0,o.Z)("MenuItem",n,l&&"disabled",f&&"destructive",a.FW&&"compact"),y=r.ZP.createElement(r.ZP.Fragment,null,t&&r.ZP.createElement("i",{className:`icon-${t}`,"data-char":t.startsWith("char-")?t.replace("char-",""):void 0}),u);return i?r.ZP.createElement("a",{tabIndex:0,className:v,href:i,download:c,"aria-label":h,title:h,target:i.startsWith(window.location.origin)?"_self":"_blank",rel:"noopener noreferrer",dir:m.isRtl?"rtl":void 0,onClick:s},y):r.ZP.createElement("div",{role:"button",tabIndex:0,className:v,onClick:p,onKeyDown:g,"aria-label":h,title:h,dir:m.isRtl?"rtl":void 0},y)}},8512:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(9118);const d=(0,r.X$)((()=>{const[e,t]=(0,r.eJ)([]),n=(0,r.Ye)((()=>(0,o.Ds)((()=>{t([])}),700,!1)),[]),d=(0,r.I4)((r=>{if(0!==r.button)return;const o=r.currentTarget,d=o.getBoundingClientRect(),a=o.offsetWidth/2;t([...e,{x:r.clientX-d.x-a/2,y:r.clientY-d.y-a/2,size:a}]),requestAnimationFrame((()=>{n()}))}),[e,n]);return r.ZP.createElement("div",{className:"ripple-container",onMouseDown:d},e.map((e=>{let{x:t,y:n,size:o}=e;return r.ZP.createElement("span",{style:`left: ${t}px; top: ${n}px; width: ${o}px; height: ${o}px;`})})))}))},9204:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=e=>{let{color:t="blue",backgroundColor:n}=e;return r.ZP.createElement("div",{className:(0,o.Z)("Spinner",t,n&&"with-background",`bg-${n}`)},r.ZP.createElement("div",null))}},3716:(e,t,n)=>{n.d(t,{iC:()=>r,Ji:()=>o,eM:()=>d,ZT:()=>a,Cg:()=>u,S:()=>s,Ti:()=>i,ou:()=>c,eA:()=>l,b_:()=>f,Vx:()=>h,sd:()=>m,Uh:()=>p,lO:()=>g,gJ:()=>v,Rk:()=>y,Cy:()=>b,lW:()=>I,SG:()=>w,lF:()=>C,fo:()=>S,ee:()=>E,by:()=>P,lo:()=>A,hT:()=>k,YQ:()=>T,rS:()=>N,t_:()=>L,Ov:()=>R,EN:()=>F,pn:()=>x,Hk:()=>B,Vk:()=>O,mo:()=>Z,qU:()=>D,ul:()=>_,Qx:()=>$,mw:()=>U,oB:()=>j,zy:()=>W,CX:()=>V,xS:()=>G,b6:()=>H,AR:()=>z,r_:()=>Q,o_:()=>K,R2:()=>J,nY:()=>q,QU:()=>Y,jT:()=>X,_m:()=>ee,ks:()=>te,l3:()=>ne,u_:()=>re,rO:()=>oe,AE:()=>de,AJ:()=>ae,fK:()=>ue,V$:()=>se,bK:()=>ie,ck:()=>ce,xn:()=>le,K7:()=>fe,w7:()=>he,z7:()=>me,qp:()=>pe,Q:()=>ge,Mw:()=>ve,DC:()=>ye,Y7:()=>be,yK:()=>Ie,K2:()=>we,bM:()=>Ce,ku:()=>Se,zq:()=>Ee,PM:()=>Pe,jV:()=>Me,$E:()=>Ae,pR:()=>ke,kU:()=>Te,Y:()=>Ne,Ng:()=>Le,oG:()=>Re,wG:()=>Fe,dI:()=>xe,VC:()=>Be,FM:()=>Oe,uW:()=>Ze,g$:()=>De,FS:()=>_e,FD:()=>$e,aw:()=>Ue,FV:()=>je,Nf:()=>We,WS:()=>Ve,DU:()=>Ge,EG:()=>He,t4:()=>ze,sR:()=>Qe,$O:()=>Ke,Bg:()=>Je,vi:()=>qe,Db:()=>Ye,mU:()=>Xe,p3:()=>et,It:()=>tt,Vv:()=>nt,g:()=>rt,Ro:()=>ot,aC:()=>dt,LH:()=>at});const r="Telegram WebZ",o="1.35.1",d=!1,a=!1,u=!1,s="Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.",i="Telegram",c=" [Inactive]",l=!1,f="user_auth",h="GramJs:sessionId",m=!1,p="tt-global-state",g=500,v=200,y=30,b=!1,I="tt-media",w="tt-media-avatars",C="tt-media-progressive",S="tt-custom-bg",E="tt-lang-packs-v7",P=[1,5,10,50,100,500],M="undefined"!=typeof window&&window.innerHeight>=900,A=1,k=M?60:40,T=2*k,N=72,L=M?30:25,R=100,F=42,x=42,B=20,O=30,Z=200,D=500,_=20,$=1,U=1,j=0,W=2,V=W,G=16,H=17,z=15,Q=1e4,K=3e3,J="editable-message-text",q="editable-message-text-modal",Y=1440,X=1150,ee=1275,te=925,ne=600,re=950,oe=450,de=1e9,ae="0",ue=100,se=1500,ie=250,ce=600,le=500,fe=(Math.round((ie+ce)/2),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),13),he=11,me=160,pe=120,ge=64,ve=48,ye=32,be=64,Ie=64,we=160,Ce=140,Se=100,Ee=100,Pe=140,Me=140,Ae="NO_STICKER_SET",ke="en",Te=200,Ne=450,Le="video/quicktime",Re=new Set(["image/png","image/gif","image/jpeg"]),Fe=new Set(["video/mp4"]),xe=new Set([...Re,...Fe]),Be="The message is not supported on this version of Telegram.",Oe="((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)",Ze="(@[\\w\\d_-]+)",De=/^tg:(\/\/)?([?=&\d\w_-]+)?/gm,_e=/^(?:https?:\/\/)?(?:t\.me\/)/gm,$e=new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),Ue="777000",je="1271266957",We=0,Ve=1,Ge=10,He=5,ze=2147483646,Qe="en",Ke="android",Je=["android","ios","tdesktop","macos"],qe="TelegramTips",Ye=["ar","pt-br","id","it","ko","ms","pl","es","tr"],Xe="https://bugs.telegram.org/?tag_ids=41&sort=time",et="#A2AF8E",tt="#0F0F0F",nt="#0a0a0a8c",rt="rgba(90, 110, 70, 0.6)",ot=100,dt=100*ot,at=!1},274:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(7204);const d=(e,t,n)=>{const d=(0,o.Z)(t);return(0,r.d4)((()=>e(d||[])),t,n)}},706:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[t,n]=(0,r.eJ)(e),o=(0,r.I4)((()=>{n(!0)}),[]),d=(0,r.I4)((()=>{n(!1)}),[]);return[t,o,d]}},5326:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=()=>{const[,e]=(0,r.eJ)(!1);return(0,r.I4)((()=>{e((e=>!e))}),[])}},8674:(e,t,n)=>{n.d(t,{zG:()=>s,YW:()=>i,ZP:()=>c});var r=n(4050);const o="tt-event-heavy-animation-start",d="tt-event-heavy-animation-end";let a,u=!1;function s(){return u}function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;function t(){a&&(clearTimeout(a),a=void 0),u=!1,document.dispatchEvent(new Event(d))}return u||(u=!0,document.dispatchEvent(new Event(o))),a&&(clearTimeout(a),a=void 0),a=window.setTimeout(t,e),t}const c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.d4)((()=>{if(!n)return u&&e(),document.addEventListener(o,e),document.addEventListener(d,t),()=>{document.removeEventListener(d,t),document.removeEventListener(o,e)}}),[n,t,e])}},6590:(e,t,n)=>{n.d(t,{Oy:()=>s,Wv:()=>l,ZP:()=>h});var r=n(4050),o=n(7361),d=n(7204),a=n(5116),u=n(782);const s=window.location.hash,i=`${window.location.pathname}${window.location.search}`,c={currentIndex:0,nextStateIndexToReplace:-1,isHistoryAltered:!1,isDisabled:!1,isEdge:!1,currentIndexes:[]},l=()=>{c.isDisabled=!0},f=()=>{c.isEdge&&setTimeout((()=>{c.isEdge=!1}),350)};function h(e,t,n,o){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5?arguments[5]:void 0;const f=(0,r.sO)(-1),h=(0,r.sO)(!1),m=(0,d.Z)(e),p=(0,r.sO)(!0),g=(0,r.sO)([]),v=(0,d.Z)(l),y=(0,r.sO)(!1),b=(0,r.I4)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(l){const e=v||[];if(e.length{const e=++c.currentIndex;c.currentIndexes.push(e),window.history.pushState({index:e,state:o},"",`#${l[l.length-1]}`),g.current.push({index:e,hash:l[l.length-1]})}),0);else{const t=e.length-l.length;if(y.current)y.current=!1;else{if(l.length!==g.current.length&&t>0){const e=g.current[g.current.length-t-1];let n=t;if(e){const t=c.currentIndexes.findIndex((t=>t===e.index));n=c.currentIndexes.length-t-1}c.isHistoryAltered=!0,window.history.go(-n),g.current.splice(g.current.length-t-1,t).forEach((e=>{let{index:t}=e;c.currentIndexes.splice(c.currentIndexes.indexOf(t),1)}))}l.length>0&&setTimeout((()=>{const e=++c.currentIndex;c.currentIndexes[c.currentIndexes.length-1]=e,window.history.replaceState({index:e,state:o},"",`${i}#${l[l.length-1]}`),g.current[g.current.length-1]={index:e,hash:l[l.length-1]}}),0)}}}else e&&!t&&(p.current=!1,h.current?(h.current=!1,c.currentIndexes.push(f.current)):setTimeout((()=>{const e=++c.currentIndex;c.currentIndexes.push(e),window.history[c.currentIndexes.includes(c.nextStateIndexToReplace-1)&&0!==window.history.state.index&&c.nextStateIndexToReplace===e&&!s?"replaceState":"pushState"]({index:e,state:o},""),f.current=e,s&&(c.nextStateIndexToReplace=c.currentIndex+1)}),0)),!t&&e||p.current||(f.current!==c.currentIndex&&s||(c.isHistoryAltered=!0,window.history.back(),setTimeout((()=>{c.nextStateIndexToReplace=-1}),400)),c.currentIndexes.splice(c.currentIndexes.indexOf(f.current),1),p.current=!0)}),[o,l,e,v,s]);return(0,r.d4)((()=>{const r=e=>{if(c.isHistoryAltered)return void setTimeout((()=>{c.isHistoryAltered=!1}),0);const{index:r}=e.state,o=r||0;try{const r=l?g.current[g.current.length-1].index:f.current,d=c.currentIndexes[c.currentIndexes.indexOf(r)-1];if(c.isDisabled)return;!p.current&&(0===o||o===d)||l&&(0===o||o===d)?(l&&(y.current=!0,g.current.pop()),c.currentIndexes.splice(c.currentIndexes.indexOf(r),1),t&&(c.isEdge&&(0,a.uC)().disableHistoryAnimations(),t(!c.isEdge),p.current=!0)):o===r&&p.current&&n&&!l&&(h.current=!0,c.isEdge&&(0,a.uC)().disableHistoryAnimations(),n(e.state.state))}catch(e){}},o=l?!v||!(0,u.et)(v,l):m!==e;return!c.isDisabled&&o&&b(),window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)}),[o,b,l,e,t,n,v,m,s]),{forceClose:()=>b(!0)}}o.cj&&(window.addEventListener("touchstart",(e=>{const t=e.touches[0].pageX;(t<=300||t>=window.innerWidth-300)&&(c.isEdge=!0)})),window.addEventListener("touchend",f),window.addEventListener("popstate",f)),window.history.replaceState({index:c.currentIndex},"",i)},2313:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=(e,t,n,o,d)=>{const[a,u]=(0,r.eJ)(-1);return(0,r.d4)((()=>{u(-1);const n=e.current;t&&n&&!d&&(n.tabIndex=-1,n.focus())}),[e,t,d]),(0,r.I4)((t=>{const r=e.current;if(!r)return;if(13===t.keyCode&&n)return void n(a);if(38!==t.keyCode&&40!==t.keyCode)return;const d=document.activeElement,s=Array.from(o?r.querySelectorAll(o):r.children);let i=d&&s.indexOf(d)||a;if(38===t.keyCode&&i>0)i--;else if(40===t.keyCode&&i{n.d(t,{Z:()=>a});var r=n(711),o=n(5326),d=n(9290);const a=()=>{const e=(0,o.Z)();return(0,d.Z)((()=>r.ll(e)),[e]),r.i0}},8778:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(9203),d=n(5326);const a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const u=(0,o.o5)(e,t),s=(0,d.Z)();return(0,r.d4)((()=>{if(a)return(0,o.Qt)(s)}),[a,s]),(0,r.d4)((()=>{n||u||(0,o.$y)(e,t).then(s)}),[e,s,u,t,n]),u}},9290:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7204);const o=(e,t)=>{const n=(0,r.Z)(t);n&&!t.some(((e,t)=>e!==n[t]))||e(n||[])}},7204:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=function(e,t){const n=(0,r.sO)(),{current:o}=n;return t&&void 0===e||(n.current=e),o}},1212:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"fast",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const[u,s]=(0,r.eJ)(!e),i=(0,r.sO)(),[c,l]=(0,r.eJ)(e&&n);if(e)s(!1),l(!0),i.current&&(window.clearTimeout(i.current),i.current=void 0);else if(l(!1),!u&&!i.current){const e=()=>{s(!0),t&&t(),i.current=void 0};a?e():i.current=window.setTimeout(e,350)}const f=c&&!(a&&!e),h=Boolean(i.current),m=e||h,p=(0,o.Z)(d&&"opacity-transition",d,f&&"open",m&&"shown",h&&"closing");return{shouldRender:m,transitionClassNames:p}}},8758:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);function o(e,t,n){(0,r.d4)((()=>{const r=e=>{const r=t.current,o=e.target;r&&o&&(r.contains(e.target)&&!o.classList.contains("backdrop")||(e.preventDefault(),e.stopPropagation(),n&&n()))};return e&&n&&document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}}),[e,t,n])}},5247:(e,t,n)=>{n.d(t,{Oo:()=>s,xg:()=>i,lQ:()=>m});var r=n(3716);const o=new Set(["scroll","mouseenter","mouseleave"]),d={},a={},u=new Map;function s(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=c(t,e);l(o,e,r)?f(o,e,n):e.addEventListener(o,n,r)}function i(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=c(t,e);l(o,e,r)?h(o,e):e.removeEventListener(o,n,r)}function c(e,t){const n=e.replace(/^on/,"").replace(/Capture$/,"").toLowerCase();return"change"===n&&"SELECT"!==t.tagName?"input":"doubleclick"===n?"dblclick":"focus"===n?"focusin":"blur"===n?"focusout":n}function l(e,t,n){return!n&&!o.has(e)&&"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName}function f(e,t,n){d[e]||(d[e]=0,document.addEventListener(e,p)),function(e){return a[e]||(a[e]=new Map),a[e]}(e).set(t,n),function(e){const t=u.get(e);if(t)return t;const n=new Set;return u.set(e,n),n}(t).add(e),d[e]++}function h(e,t){d[e]--,d[e]||document.removeEventListener(e,p),a[e].delete(t),u.get(t).delete(e)}function m(e){const t=u.get(e);t&&(t.forEach((t=>h(t,e))),u.delete(e))}function p(e){const t=a[e.type];if(t){let n=!1,r=e.target;const o=()=>{n=!0},d=()=>{e.preventDefault()},a=new Proxy(e,{get:(e,t)=>"currentTarget"===t?r:"stopPropagation"===t||"stopImmediatePropagation"===t?o:"preventDefault"===t?d:Reflect.get(e,t)});for(;r&&r!==document.body;){const e=t.get(r);if(e&&(e(a),n))return;r=r.parentNode}}}r.eM&&document.addEventListener("dblclick",(()=>{const e=Object.keys(d).length,t=Object.values(d).reduce(((e,t)=>e+t),0),n=Object.keys(a).length,r=Object.values(a).reduce(((e,t)=>e+t.size),0),o=u.size,s=Array.from(u.values()).reduce(((e,t)=>e+t.size),0);console.warn("DELEGATED EVENTS STATS",{delegatedHandlersCount1:t,delegatedHandlersCount2:r,delegatedEventTypesCount:s,delegationRegistriesCount:n,delegationElementsCount:o,documentListenersCount:e})}))},2916:(e,t,n)=>{n.d(t,{Z:()=>I});var r=n(4050),o=n(6926),d=n(3716),a=n(5247);const u=new Set(["key","ref","teactFastList","teactOrderKey"]),s=new Set(["dir","role"]),i={autoPlay:"autoplay",autoComplete:"autocomplete"},c={};function l(e,t,n,o,d){let{skipComponentUpdate:a=!1,forceIndex:u=!1,fragment:s,moveDirection:i}=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const c=t&&(0,r.op)(t),l=n&&(0,r.op)(n);if(!a&&c&&l&&!(0,r.k)(t,n)&&(n=h(t,n)),!a&&l&&n.componentInstance.isMounted&&m(n,o,d,e),t===n)return n;if(!t&&n){l&&(n=f(n,o,d,e));const t=p(n);(0,r.CD)(n,t),u&&e.childNodes[d]?e.insertBefore(t,e.childNodes[d]):(s||e).appendChild(t)}else if(t&&!n)e.removeChild((0,r.U9)(t)),(0,r.Zb)(t);else if(t&&n)if((0,r.k)(t,n)){l&&(n=f(n,o,d,e));const a=p(n);(0,r.CD)(n,a),e.replaceChild(a,(0,r.U9)(t)),(0,r.Zb)(t)}else{const o=c&&l,a=(0,r.U9)(t);if(o||((0,r.CD)(n,a),(0,r.CD)(t,void 0),"props"in t&&"props"in n&&(n.props.ref=t.props.ref)),(0,r.O_)(n)){if(i){const t=a,n=e.childNodes["up"===i?d:d+1];n?e.insertBefore(t,n):(s||e).appendChild(t)}o||y(t,n,a),n.children=g(t,n,o?e:a)}}return n}function f(e,t,n,o){if(!(0,r.op)(e))return e;const{componentInstance:d}=e;if(!d.isMounted){m(e=(0,r.Hb)(d),t,n,o);const a=e.children[0];(0,r.op)(a)&&(e.children=[f(a,e,0,o)]),d.isMounted=!0}return e}function h(e,t){return e.componentInstance.props=t.componentInstance.props,(0,r.SO)(e.componentInstance)}function m(e,t,n,r){const{componentInstance:o}=e;o.onUpdate=()=>{t.children[n]=l(r,t.children[n],o.$element,t,n,{skipComponentUpdate:!0})}}function p(e){if((0,r.V2)(e))return document.createTextNode("");if((0,r.iB)(e))return document.createTextNode(e.value);if((0,r.op)(e))return p(e.children[0]);const{tag:t,props:n,children:o=[]}=e,d=document.createElement(t);return"object"==typeof n.ref&&(n.ref.current=d),Object.entries(n).forEach((e=>{let[t,r]=e;void 0!==n[t]&&b(d,t,r)})),e.children=o.map(((t,n)=>l(d,void 0,t,e,n))),d}function g(e,t,n){if(t.props.teactFastList)return function(e,t,n){const o=new Set(t.children.map((e=>{const t="props"in e&&e.props.key;return d.eM&&(0,r.O_)(e)&&null==t&&console.warn("Missing `key` in `teactFastList`"),t})));let a=0;const u=e.children.reduce(((e,r,d)=>{let u="props"in r?r.props.key:void 0;const s=null!=u;if(s&&!o.has(u))return l(n,r,void 0,t,-1),e;if(!s){const o=t.children[d],a=o&&"props"in o?o.props.key:void 0;if(!o||a)return l(n,r,void 0,t,-1),e;u=`__indexKey#${d}`}return e[u]={$element:r,index:a++,order:"props"in r?r.props.teactOrderKey:void 0},e}),{});let s,i,c=[],f=0;return t.children.forEach(((e,r)=>{const o="props"in e?e.props.key:`__indexKey#${r}`,d=u[o];if(!d)return s||(s=[],i=r),void s.push(e);s&&(c=c.concat(v(s,i,n,t)),i=void 0,s=void 0);const a="props"in e?e.props.teactOrderKey:void 0,h=d.index!==f&&d.order!==a,m=h&&f>d.index;h&&!m||f++,c.push(l(n,d.$element,e,t,r,{forceIndex:!0,moveDirection:h?m?"down":"up":void 0}))})),s&&(c=c.concat(v(s,i,n,t))),c}(e,t,n);const o=e.children.length,a=t.children.length,u=Math.max(o,a),s=[],i=a>o+1?document.createDocumentFragment():void 0;for(let r=0;r=o?{fragment:i}:void 0);d&&s.push(d)}return i&&n.appendChild(i),s}function v(e,t,n,r){if(1===e.length)return[l(n,void 0,e[0],r,t,{forceIndex:!0})];if(e.length>1){const o=document.createDocumentFragment(),d=e.map((e=>l(n,void 0,e,r,t,{fragment:o})));return n.childNodes[t]?n.insertBefore(o,n.childNodes[t]):n.appendChild(o),d}throw new Error("Unexpected input")}function y(e,t,n){const r=Object.entries(e.props),o=Object.entries(t.props);r.forEach((e=>{let[r,o]=e;const d=t.props[r];void 0!==o&&(void 0===d||o!==d&&r.startsWith("on"))&&function(e,t,n){"className"===t?e.className="":"value"===t?e.value="":"style"===t?e.style.cssText="":"dangerouslySetInnerHTML"===t?e.innerHTML="":t.startsWith("on")?(0,a.xg)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||t.startsWith("aria-")||s.has(t)?e.removeAttribute(t):u.has(t)||delete e[i[t]||t]}(n,r,o)})),o.forEach((t=>{let[r,o]=t;const d=e.props[r];void 0!==o&&o!==d&&b(n,r,o)}))}function b(e,t,n){"className"===t?e.className=n:"value"===t?e.value!==n&&(e.value=n):"style"===t?e.style.cssText=n:"dangerouslySetInnerHTML"===t?e.innerHTML=n.__html:t.startsWith("on")?(0,a.Oo)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||t.startsWith("aria-")||s.has(t)?e.setAttribute(t,n):u.has(t)||(e[i[t]||t]=n)}const I={render:function(e,t){if(!t)return;let n=t.getAttribute("data-teact-head-id");n||(n=(0,o.Z)(c),c[n]={children:[]},t.setAttribute("data-teact-head-id",n));const r=c[n];r.children=[l(t,r.children[0],e,r,0)]}}},4050:(e,t,n)=>{n.d(t,{V2:()=>h,iB:()=>m,op:()=>g,O_:()=>v,SO:()=>M,k:()=>A,Zb:()=>k,Hb:()=>T,U9:()=>R,CD:()=>F,eJ:()=>x,d4:()=>O,bt:()=>Z,Ye:()=>D,I4:()=>_,sO:()=>$,X$:()=>U,ZP:()=>j});var r=n(3716),o=n(9118),d=n(782),a=n(275),u=n(3592),s=n(5247);let i;!function(e){e[e.Empty=0]="Empty",e[e.Text=1]="Text",e[e.Tag=2]="Tag",e[e.Component=3]="Component"}(i||(i={}));const c=Symbol("Fragment"),l=new Set(["TeactMemoWrapper","TeactNContainer","Button","ListItem","MenuItem"]);let f;function h(e){return e.type===i.Empty}function m(e){return e.type===i.Text}function p(e){return e.type===i.Tag}function g(e){return e.type===i.Component}function v(e){return p(e)||g(e)}function y(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:[];const{props:n}=e;return{componentInstance:e,type:i.Component,props:n,children:t}}function w(e,t,n){return{type:i.Tag,tag:e,props:t,children:C(n).map(E)}}function C(e){let t=e.length-1;for(;t>=0&&S(e[t]);t--);return t+17&&console.warn(`[Teact] Slow component render: ${n}, ${Math.round(t)} ms`),P[n].renderTimes.push(t),P[n].renderCount++}}catch(t){(0,u.S)(t),o=e.renderedValue}if(e.isMounted&&o===e.renderedValue)return e.$element;e.renderedValue=o;const d=E(o);return e.$element=I(e,[d]),e.$element}function A(e,t){return typeof e!=typeof t||e.type!==t.type||(m(e)&&m(t)?e.value!==t.value:p(e)&&p(t)?e.tag!==t.tag||e.props.key!==t.props.key:!(!g(e)||!g(t)||e.componentInstance.Component===t.componentInstance.Component&&e.props.key===t.props.key))}function k(e){if(g(e))(t=e.componentInstance).isMounted&&(t.hooks.memos.byCursor.forEach((e=>{e.current=void 0})),t.hooks.effects.byCursor.forEach((e=>{let{cleanup:t}=e;if("function"==typeof t)try{t()}catch(e){(0,u.S)(e)}})),t.isMounted=!1,function(e){e.hooks.effects.byCursor.forEach((e=>{e.cleanup=void 0,e.effect=void 0,e.dependencies=void 0})),e.hooks.state.byCursor.forEach((e=>{e.value=void 0,e.nextValue=void 0,e.setter=void 0})),e.hooks.memos.byCursor.forEach((e=>{e.dependencies=void 0})),e.hooks=void 0,e.$element=void 0,e.renderedValue=void 0,e.Component=void 0,e.props=void 0,e.forceUpdate=void 0,e.onUpdate=void 0}(t));else if(p(e)&&(e.target&&(0,s.lQ)(e.target),e.props.ref&&(e.props.ref.current=void 0)),e.target&&(e.target=void 0),!v(e))return;var t;e.children.forEach(k)}function T(e){return M(e),e.isMounted=!0,e.$element}function N(e){e.isMounted&&(e.hooks.state.byCursor.forEach((e=>{e.value=e.nextValue})),e.prepareForFrame=(0,o.wT)((()=>N(e))),e.forceUpdate=(0,o.mS)((()=>L(e))))}function L(e){if(!e.isMounted||!e.onUpdate)return;const t=e.$element;M(e),e.$element!==t&&e.onUpdate()}function R(e){return g(e)?R(e.children[0]):e.target}function F(e,t){g(e)?F(e.children[0],t):e.target=t}function x(e){const{cursor:t,byCursor:n}=f.hooks.state;var d;return void 0===n[t]&&(n[t]={value:e,nextValue:e,setter:(d=f,e=>{n[t].nextValue!==e&&(n[t].nextValue="function"==typeof e?e(n[t].value):e,d.prepareForFrame&&d.forceUpdate||(d.prepareForFrame=(0,o.wT)((()=>N(d))),d.forceUpdate=(0,o.mS)((()=>L(d)))),d.prepareForFrame(),d.forceUpdate(),r.ZT&&"TeactNContainer"!==d.name&&console.log("[Teact.useState]",d.name,d.Component&&d.Component.DEBUG_contentComponentName?`> ${d.Component.DEBUG_contentComponentName}`:"",`Forced update at cursor #${t}, next value: `,n[t].nextValue))})}),f.hooks.state.cursor++,[n[t].value,n[t].setter]}function B(e,t,n,o,d){const{cursor:a,byCursor:s}=f.hooks.effects,i=f;function c(){if(!i.isMounted)return;const{cleanup:e}=s[a];if("function"==typeof e)try{let t;if(r.eM&&(t=performance.now()),e(),r.eM){const e=performance.now()-t,n=i.name;e>7&&console.warn(`[Teact] Slow cleanup at effect cursor #${a}: ${n}, ${Math.round(e)} ms`)}}catch(e){(0,u.S)(e)}}function l(){if(!i.isMounted)return;let e;if(r.eM&&(e=performance.now()),s[a].cleanup=n(),r.eM){const t=performance.now()-e,n=i.name;t>7&&console.warn(`[Teact] Slow effect at cursor #${a}: ${n}, ${Math.round(t)} ms`)}}if(void 0!==s[a]&&o&&s[a].dependencies){if(o.some(((e,t)=>e!==s[a].dependencies[t]))){if(d){const e=o.reduce(((e,t,n)=>{const r=s[a].dependencies[n];return t!==r&&e.push(`${n}: ${r} => ${t}`),e}),[]);console.log(`[Teact] Effect "${d}" caused by dependencies.`,e.join(", "))}t(c),e(l)}}else d&&console.log(`[Teact] Effect "${d}" caused by missing dependencies.`),t(c),e(l);s[a]={effect:n,dependencies:o,cleanup:s[a]?s[a].cleanup:void 0},f.hooks.effects.cursor++}function O(e,t,n){return B(o.T2,o.D0,e,t,n)}function Z(e,t,n){return B(o.R3,o.zD,e,t,n)}function D(e,t,n){const{cursor:o,byCursor:d}=f.hooks.memos;let{current:u}=d[o]||{};return(void 0===d[o]||t.some(((e,t)=>e!==d[o].dependencies[t])))&&(r.eM&&n&&console.log(`[Teact.useMemo] ${f.name} (${n}): Update is caused by:`,d[o]?(0,a.c)(t,d[o].dependencies).join(", "):"[first render]"),u=e()),d[o]={current:u,dependencies:t},f.hooks.memos.cursor++,u}function _(e,t,n){return D((()=>e),t,n)}function $(e){return D((()=>({current:e})),[])}function U(e,t){return function(n){return D((()=>y(e,n)),Object.values(n),t)}}document.addEventListener("dblclick",(()=>{console.warn("COMPONENTS",(0,d.Xo)(Object.values(P),"renderCount","desc"))}));const j={createElement:y,Fragment:c}},5116:(e,t,n)=>{n.d(t,{ZP:()=>h,R3:()=>w,Rd:()=>C,uC:()=>S,Q6:()=>E,ll:()=>P,Iq:()=>M,c$:()=>A});var r=n(4050),o=n(3716),d=n(5326),a=n(6926),u=n(9118),s=n(275),i=n(782),c=n(3592),l=n(8674);function f(){return f=Object.assign||function(e){for(var t=1;t7&&console.warn(`[TeactN] Slow containers update: ${Math.round(t)} ms`)}}],v={},y=new Map,b=(0,u.$6)(I);function I(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||!(0,l.zG)()?g.forEach((e=>e(m))):(0,u.T2)(b)}function w(e,t){"object"==typeof e&&e!==m&&(m=e,null!=t&&t.forceSyncOnIOs?I(!0):b(null==t?void 0:t.forceOnHeavyAnimation))}function C(){return m}function S(){return v}function E(e,t){p[e]||(p[e]=[],v[e]=(t,n)=>{!function(e,t,n){p[e]&&p[e].forEach((e=>{const r=e(m,v,t);r&&w(r,n)}))}(e,t,n)}),p[e].push(t)}function P(e){g.push(e)}function M(e){const t=g.indexOf(e);-1!==t&&g.splice(t,1)}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>({});return t=>function n(o){n.DEBUG_contentComponentName=t.name;const[u]=(0,r.eJ)((0,a.Z)(y)),i=(0,d.Z)();(0,r.d4)((()=>()=>{y.delete(u)}),[u]);let l=y.get(u);if(l||(l={mapStateToProps:e,ownProps:o,areMappedPropsChanged:!1,forceUpdate:i,DEBUG_updates:0,DEBUG_componentName:t.name},y.set(u,l)),l.areMappedPropsChanged&&(l.areMappedPropsChanged=!1),!l.mappedProps||!(0,s.Z)(l.ownProps,o)){l.ownProps=o;try{l.mappedProps=e(m,o)}catch(e){(0,c.S)(e)}}return r.ZP.createElement(t,f({},l.mappedProps,o))}}o.eM&&(window.getGlobal=C,document.addEventListener("dblclick",(()=>{console.warn("GLOBAL CONTAINERS",(0,i.Xo)(Array.from(y.values()).map((e=>{let{DEBUG_componentName:t,DEBUG_updates:n}=e;return{DEBUG_componentName:t,DEBUG_updates:n}})),"DEBUG_updates","desc"))})))},3681:(e,t,n)=>{n.d(t,{l:()=>d,Z:()=>a});const r=/\uFE0F/g,o=String.fromCharCode(8205);function d(e){return e.indexOf(o)<0?e.replace(r,""):e}const a=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g},1363:(e,t,n)=>{var r=n(5116),o=n(1226),d=n(3716),a=n(7361),u=n(8406),s=n(9524),i=n(7358),c=n(3100),l=n(1622);(0,r.Q6)("initApi",((e,t)=>{(async()=>{d.Cg||(await(0,c.Qw)(),(0,c.f3)()),(0,o.g8)(t.apiUpdate,{userAgent:navigator.userAgent,platform:a.Lt,sessionData:(0,c.K8)(),isTest:window.location.search.includes("test"),isMovSupported:a.pA,isWebmSupported:a.Hh})})()})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return(0,o.t9)("provideAuthPhoneNumber",r.replace(/[^\d]/g,"")),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthCode",((e,t,n)=>{const{code:r}=n;return(0,o.t9)("provideAuthCode",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthPassword",((e,t,n)=>{const{password:r}=n;return(0,o.t9)("provideAuthPassword",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("uploadProfilePhoto",((e,t,n)=>{const{file:r}=n;(0,o.t9)("uploadProfilePhoto",r)})),(0,r.Q6)("signUp",((e,t,n)=>{const{firstName:r,lastName:d}=n;return(0,o.t9)("provideAuthRegistration",{firstName:r,lastName:d}),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("returnToAuthPhoneNumber",(e=>((0,o.t9)("restartAuth"),{...e,authError:void 0}))),(0,r.Q6)("goToAuthQrCode",(e=>((0,o.t9)("restartAuthWithQr"),{...e,authIsLoadingQrCode:!0,authError:void 0}))),(0,r.Q6)("saveSession",((e,t,n)=>{const{sessionData:r}=n;r?(0,c.wX)(n.sessionData,e.currentUserId):(0,c.jv)()})),(0,r.Q6)("signOut",(()=>{(async()=>{try{await(0,u.r1)(),await(0,o.t9)("destroy"),await(0,l.IT)(!1)}catch(e){}(0,r.uC)().reset()})()})),(0,r.Q6)("reset",(()=>{(0,c.jv)(),s.clear(d.lW),s.clear(d.SG),s.clear(d.lF),s.clear(d.fo);const e=d.ee.replace(/\d+$/,""),t=(d.ee.match(/\d+$/)||[0])[0];for(let n=0;n{(async()=>{await(0,o.t9)("disconnect")})()})),(0,r.Q6)("loadNearestCountry",(e=>{"connectionStateReady"===e.connectionState&&(async()=>{const e=await(0,o.t9)("fetchNearestCountry");(0,r.R3)({...(0,r.Rd)(),authNearestCountry:e})})()})),(0,r.Q6)("setDeviceToken",((e,t,n)=>{(0,r.R3)({...e,push:{deviceToken:n,subscribedAt:Date.now()}})})),(0,r.Q6)("deleteDeviceToken",(e=>{const t={...e};delete t.push,(0,r.R3)(t)}))},9667:(e,t,n)=>{var r=n(5116),o=n(1713),d=n(3716),a=n(1226),u=n(782),s=n(8406),i=n(711),c=n(9066),l=n(9959),f=n(8415);function h(e,t){let{visibility:n,allowedIds:r,deniedIds:o}=t;const{users:{byId:d},chats:{byId:a}}=e,u={visibility:n};let s,i;const c=e=>{if(!(0,f.YC)(e))return;const{id:t,accessHash:n}=d[e]||{};return t?{id:t,accessHash:n}:void 0},l=e=>{if((0,f.YC)(e))return;const t=a[e];return t?{id:t.id}:void 0};return"contacts"!==n&&"nobody"!==n||(s=r.map(c).filter(Boolean),i=r.map(l).filter(Boolean),s.length>0&&(u.allowedUsers=s),i.length>0&&(u.allowedChats=i)),"everybody"!==n&&"contacts"!==n||(s=o.map(c).filter(Boolean),i=o.map(l).filter(Boolean),s.length>0&&(u.blockedUsers=s),i.length>0&&(u.blockedChats=i)),u}(0,r.Q6)("updateProfile",((e,t,n)=>{const{photo:d,firstName:u,lastName:s,bio:i,username:f}=n;(async()=>{const{currentUserId:t}=e;if(t){if((0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.InProgress}}),d&&await(0,a.t9)("updateProfilePhoto",d),(u||s||i)&&await(0,a.t9)("updateProfile",{firstName:u,lastName:s,about:i})){e=(0,r.Rd)();const n=t&&(0,c.dy)(e,t);n&&(0,r.R3)((0,l.Nq)(e,n.id,{firstName:u,lastName:s,fullInfo:{...n.fullInfo,bio:i}}))}f&&await(0,a.t9)("updateUsername",f)&&t&&(0,r.R3)((0,l.Nq)((0,r.Rd)(),t,{username:f})),(0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.Complete}})}})()})),(0,r.Q6)("checkUsername",((e,t,n)=>{const{username:d}=n;(async()=>{if(e.profileEdit&&e.profileEdit.progress===o.rN.InProgress)return;(0,r.R3)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:o.rN.Idle,isUsernameAvailable:void 0}});const t=await(0,a.t9)("checkUsername",d);e=(0,r.Rd)(),(0,r.R3)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()})),(0,r.Q6)("loadWallpapers",(()=>{(async()=>{const e=await(0,a.t9)("fetchWallpapers");if(!e)return;const t=(0,r.Rd)();(0,r.R3)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()})),(0,r.Q6)("uploadWallpaper",((e,t,n)=>{const d=n,u=URL.createObjectURL(d);(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[{slug:o.mp,document:{fileName:"",size:d.size,mimeType:d.type,previewBlobUrl:u}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await(0,a.t9)("uploadWallpaper",d);if(!t)return;const{wallpaper:n}=t;if(!(e=(0,r.Rd)()).settings.loadedWallpapers)return;const s=e.settings.loadedWallpapers[0];if(!s||s.slug!==o.mp)return;const i={...n,document:{...n.document,previewBlobUrl:u}};(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[i,...e.settings.loadedWallpapers.slice(1)]}})})()})),(0,r.Q6)("loadBlockedContacts",(()=>{(async()=>{var e,t;const n=await(0,a.t9)("fetchBlockedContacts");if(!n)return;let o=(0,r.Rd)();null!==(e=n.users)&&void 0!==e&&e.length&&(o=(0,l.Sh)(o,(0,u.ee)(n.users,"id"))),null!==(t=n.chats)&&void 0!==t&&t.length&&(o=(0,l.GL)(o,(0,u.ee)(n.chats,"id"))),o={...o,blocked:{...o.blocked,ids:[...o.blocked.ids||[],...n.blockedIds],totalCount:n.totalCount}},(0,r.R3)(o)})()})),(0,r.Q6)("blockContact",((e,t,n)=>{const{contactId:o,accessHash:d}=n;(async()=>{if(!await(0,a.t9)("blockContact",o,d))return;const e=(0,r.Rd)();(0,r.R3)((0,l.O4)(e,o))})()})),(0,r.Q6)("unblockContact",((e,t,n)=>{const{contactId:o}=n;let d;if((0,f.YC)(o)){const t=(0,c.dy)(e,o);if(!t)return;d=t.accessHash}(async()=>{if(!await(0,a.t9)("unblockContact",o,d))return;const e=(0,r.Rd)();(0,r.R3)((0,l.rB)(e,o))})()})),(0,r.Q6)("loadAuthorizations",(()=>{(async()=>{const e=await(0,a.t9)("fetchAuthorizations");e&&(0,r.R3)({...(0,r.Rd)(),activeSessions:e})})()})),(0,r.Q6)("terminateAuthorization",((e,t,n)=>{const{hash:o}=n;(async()=>{if(!await(0,a.t9)("terminateAuthorization",o))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.hash!==o))})})()})),(0,r.Q6)("terminateAllAuthorizations",(()=>{(async()=>{if(!await(0,a.t9)("terminateAllAuthorizations"))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.isCurrent))})})()})),(0,r.Q6)("loadNotificationExceptions",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,a.t9)("fetchNotificationExceptions",{serverTimeOffset:t});e&&(0,r.R3)((0,l.aJ)((0,r.Rd)(),e))})()})),(0,r.Q6)("loadNotificationSettings",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,a.t9)("fetchNotificationSettings",{serverTimeOffset:t});e&&(0,r.R3)((0,l.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateNotificationSettings",((e,t,n)=>{const{peerType:o,isSilent:d,shouldShowPreviews:u}=n;(async()=>{await(0,a.t9)("updateNotificationSettings",o,{isSilent:d,shouldShowPreviews:u})&&(0,r.R3)((0,l.HN)((0,r.Rd)(),o,d,u))})()})),(0,r.Q6)("updateWebNotificationSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,l.BI)((0,r.Rd)(),n));const e=(0,r.Rd)(),{hasPushNotifications:t,hasWebNotifications:o}=e.settings.byKey;o&&t?await(0,s.Ld)():await(0,s.r1)()})()})),(0,r.Q6)("updateContactSignUpNotification",((e,t,n)=>{const{isSilent:o}=n;(async()=>{await(0,a.t9)("updateContactSignUpNotification",o)&&(0,r.R3)((0,l.BI)((0,r.Rd)(),{hasContactJoinedNotifications:!o}))})()})),(0,r.Q6)("loadLanguages",(()=>{(async()=>{const e=await(0,a.t9)("fetchLanguages");e&&(0,r.R3)((0,l.BI)((0,r.Rd)(),{languages:e}))})()})),(0,r.Q6)("loadPrivacySettings",(()=>{(async()=>{const[e,t,n,o,d]=await Promise.all([(0,a.t9)("fetchPrivacySettings","phoneNumber"),(0,a.t9)("fetchPrivacySettings","lastSeen"),(0,a.t9)("fetchPrivacySettings","profilePhoto"),(0,a.t9)("fetchPrivacySettings","forwards"),(0,a.t9)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&n&&o&&d))return;const u=(0,r.Rd)();u.settings.privacy.phoneNumber=e,u.settings.privacy.lastSeen=t,u.settings.privacy.profilePhoto=n,u.settings.privacy.forwards=o,u.settings.privacy.chatInvite=d,(0,r.R3)(u)})()})),(0,r.Q6)("setPrivacyVisibility",((e,t,n)=>{const{privacyKey:o,visibility:d}=n,{privacy:{[o]:u}}=e.settings;if(!u)return;const s=h(e,{visibility:d,allowedIds:[...u.allowUserIds,...u.allowChatIds],deniedIds:[...u.blockUserIds,...u.blockChatIds]});(async()=>{const e=await(0,a.t9)("setPrivacySettings",o,s);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("setPrivacySettings",((e,t,n)=>{const{privacyKey:o,isAllowList:d,contactsIds:u}=n,{privacy:{[o]:s}}=e.settings;if(!s)return;const i=h(e,{visibility:s.visibility,allowedIds:d?u:[...s.allowUserIds,...s.allowChatIds],deniedIds:d?[...s.blockUserIds,...s.blockChatIds]:u});(async()=>{const e=await(0,a.t9)("setPrivacySettings",o,i);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("updateIsOnline",((e,t,n)=>{(0,a.t9)("updateIsOnline",n)})),(0,r.Q6)("loadContentSettings",(()=>{(async()=>{const e=await(0,a.t9)("fetchContentSettings");e&&(0,r.R3)((0,l.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateContentSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,l.BI)((0,r.Rd)(),{isSensitiveEnabled:n})),await(0,a.t9)("updateContentSettings",n)||(0,r.R3)((0,l.BI)((0,r.Rd)(),{isSensitiveEnabled:!n}))})()})),(0,r.Q6)("loadCountryList",(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{langCode:o}=n;o||(o=e.settings.byKey.language),(async()=>{const e=await(0,a.t9)("fetchCountryList",{langCode:o});e&&(0,r.R3)({...(0,r.Rd)(),countryList:e})})()})),(0,r.Q6)("ensureTimeFormat",((e,t)=>{if(e.authNearestCountry){const n=d.FD.has(e.authNearestCountry.toUpperCase())?"12h":"24h";t.setSettingOption({timeFormat:n}),(0,i.qf)(n)}(async()=>{if((0,r.Rd)().settings.byKey.wasTimeFormatSetManually)return;const e=await(0,a.t9)("fetchNearestCountry");if(e){const n=d.FD.has(e.toUpperCase())?"12h":"24h";t.setSettingOption({timeFormat:n}),(0,i.qf)(n)}})()})),(0,r.Q6)("loadAppConfig",(()=>{(async()=>{const e=await(0,a.t9)("fetchAppConfig");e&&(0,r.R3)({...(0,r.Rd)(),appConfig:e})})()}))},4907:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(8406),a=n(9959),u=n(711),s=n(9066),i=n(1622),c=n(1947);(0,r.Q6)("apiUpdate",((e,t,n)=>{switch(o.eM&&"updateUserStatus"!==n["@type"]&&"updateServerTimeOffset"!==n["@type"]&&console.log("[GramJs] UPDATE",n["@type"],{update:n}),n["@type"]){case"updateApiReady":!function(e){const{hasWebNotifications:t,hasPushNotifications:n}=(0,s.dZ)(e);t&&n&&(0,d.Ld)(),(0,u.m0)(e.settings.byKey.language)}(e);break;case"updateAuthorizationState":!function(e){let t=(0,r.Rd)();const n="authorizationStateReady"===t.authState,o=e.authorizationState;switch((0,r.R3)({...t,authState:o,authIsLoading:!1}),t=(0,r.Rd)(),o){case"authorizationStateLoggingOut":(0,i.IT)(!1),(0,r.R3)({...t,isLoggingOut:!0});break;case"authorizationStateWaitCode":(0,r.R3)({...t,authIsCodeViaApp:e.isCodeViaApp});break;case"authorizationStateWaitPassword":(0,r.R3)({...t,authHint:e.hint});break;case"authorizationStateWaitQrCode":(0,r.R3)({...t,authIsLoadingQrCode:!1,authQrCode:e.qrCode});break;case"authorizationStateReady":if(n)break;(0,i.IT)(!0),(0,r.R3)({...t,isLoggingOut:!1})}}(n);break;case"updateAuthorizationError":!function(e){(0,r.R3)({...(0,r.Rd)(),authError:e.message})}(n);break;case"updateConnectionState":!function(e){const{connectionState:t}=e,n=(0,r.Rd)();t!==n.connectionState&&((0,r.R3)({...n,connectionState:t}),"connectionStateBroken"===t&&(0,r.uC)().signOut())}(n);break;case"updateSession":!function(e){const{sessionData:t}=e,{authRememberMe:n,authState:o}=(0,r.Rd)(),d=!t||!t.mainDcId;n&&"authorizationStateReady"===o&&!d&&(0,r.uC)().saveSession({sessionData:t})}(n);break;case"updateServerTimeOffset":!function(e){const t=(0,r.Rd)();t.serverTimeOffset!==e.serverTimeOffset&&(0,r.R3)({...t,serverTimeOffset:e.serverTimeOffset})}(n);break;case"updateCurrentUser":!function(e){const{currentUser:t}=e;(0,r.R3)({...(0,a.Nq)((0,r.Rd)(),t.id,t),currentUserId:t.id}),function(e){const t=localStorage.getItem(o.b_);if(!t)return;const n=JSON.parse(t);n.id=e,localStorage.setItem(o.b_,JSON.stringify(n))}(t.id)}(n);break;case"error":{"SESSION_REVOKED"===n.error.message&&t.signOut();const e=(0,c.J_)(n.error);e?t.addPaymentError({error:e}):t.showDialog&&t.showDialog({data:n.error});break}}}))},7895:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(7361),a=n(711),u=n(7370),s=n(9066),i=n(1622),c=n(7926);!function(){function e(){const e=document.documentElement.className.match(/theme-(\w+)/),t=e?e[1]:"light",n=(0,r.Rd)(),d=(0,s.Pu)(n),{animationLevel:a}=n.settings.byKey;d!==t&&((0,u.Z)(d,a===o.zy),(0,r.R3)({...n}))}const t=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e)}(),(0,r.Q6)("init",(e=>{const{animationLevel:t,messageTextSize:n,language:r}=e.settings.byKey,l=(0,s.Pu)(e);(0,a.m0)(r,void 0,!0),document.documentElement.style.setProperty("--composer-text-size",`${Math.max(n,d.cj?16:15)}px`),document.documentElement.style.setProperty("--message-meta-height",`${Math.floor(1.3125*n)}px`),document.documentElement.style.setProperty("--message-text-size",`${n}px`),document.documentElement.setAttribute("data-message-text-size",n.toString()),document.body.classList.add("initial"),document.body.classList.add(`animation-level-${t}`),document.body.classList.add(d.$b?"is-touch-env":"is-pointer-env"),(0,u.Z)(l,t===o.zy),(0,c.$)(),(0,i.px)(),d.cj?document.body.classList.add("is-ios"):d.wZ?document.body.classList.add("is-android"):d.jm&&document.body.classList.add("is-macos"),d.s$&&document.body.classList.add("is-safari")})),(0,r.Q6)("setIsUiReady",((e,t,n)=>{const{uiReadyState:r}=n;return 2===r&&document.body.classList.remove("initial"),{...e,uiReadyState:r}})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return{...e,authPhoneNumber:r}})),(0,r.Q6)("setAuthRememberMe",((e,t,n)=>({...e,authRememberMe:Boolean(n)}))),(0,r.Q6)("clearAuthError",(e=>({...e,authError:void 0}))),(0,r.Q6)("disableHistoryAnimations",(()=>{setTimeout((()=>{(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!1}),document.body.classList.remove("no-animate")}),450),(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!0},{forceSyncOnIOs:!0})}))},3781:(e,t,n)=>{var r=n(5116),o=n(9959);(0,r.Q6)("setSettingOption",((e,t,n)=>(0,o.BI)(e,n))),(0,r.Q6)("setThemeSettings",((e,t,n)=>{const{theme:r,...d}=n;return(0,o.lr)(e,r,d)}))},8332:(e,t,n)=>{n.d(t,{YC:()=>f,Bf:()=>h,G9:()=>m,ZV:()=>p,eA:()=>g,Ru:()=>v,pK:()=>y,l6:()=>b,zX:()=>I,U:()=>w,GM:()=>C,hu:()=>S,RT:()=>E,Hp:()=>P,Nl:()=>M,VE:()=>A,Mg:()=>k,Qm:()=>T,H5:()=>N,q8:()=>L,Hd:()=>R,pE:()=>F,i4:()=>x,Sm:()=>B,cc:()=>O,SB:()=>Z,zF:()=>D,ih:()=>_,$l:()=>$});var r=n(6137),o=n(3716),d=n(782),a=n(5527),u=n(790),s=n(5765);const i=Date.now()/1e3+31622400,c=3e9,l=3e8;function f(e){return"number"==typeof e?e>0:!e.startsWith("-")}function h(e){return m(e)||p(e)}function m(e){return"chatTypeBasicGroup"===e.type}function p(e){return"chatTypeSuperGroup"===e.type}function g(e){return"chatTypeChannel"===e.type}function v(e){return"chatTypePrivate"===e.type||"chatTypeBasicGroup"===e.type}function y(e){return e===o.FV}function b(e){switch(e.type){case"chatTypePrivate":return"PrivateChat";case"chatTypeBasicGroup":case"chatTypeSuperGroup":return"AccDescrGroup";case"chatTypeChannel":return"AccDescrChannel";default:return"Chat"}}function I(e){if("chatTypePrivate"===e.type||"chatTypeSecret"===e.type)return e.id}function w(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return r||n&&t.id===n.id&&n.isSelf?e("SavedMessages"):t.title||e("HiddenName")}function C(e){if(e.fullInfo)return e.fullInfo.about}function S(e){const{username:t}=e;if(t)return`https://t.me/${t}`;const{inviteLink:n}=e.fullInfo||{};return n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";if(e.avatarHash)return"big"===t?`profile${e.id}?${e.avatarHash}`:`avatar${e.id}?${e.avatarHash}`}function P(e){return!e.lastMessage}function M(e){return Boolean(e.adminRights)}function A(e,t){return!!e.adminRights&&e.adminRights[t]}function k(e,t){var n,r;return Boolean((null===(n=e.currentUserBannedRights)||void 0===n?void 0:n[t])||(null===(r=e.defaultBannedRights)||void 0===r?void 0:r[t]))}function T(e,t){return t!==r._f||!(e.isRestricted||e.migratedTo||e.isNotJoined||y(e.id))&&(!!e.isCreator||!!f(e.id)||(g(e)?A(e,"postMessages"):M(e)||!k(e,"sendMessages")))}function N(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return{canAttachMedia:!1,canAttachPolls:!1,canSendStickers:!1,canSendGifs:!1,canAttachEmbedLinks:!1};const n=M(e);return{canAttachMedia:n||!k(e,"sendMedia"),canAttachPolls:(n||!k(e,"sendPolls"))&&(!f(e.id)||t),canSendStickers:n||!k(e,"sendStickers"),canSendGifs:n||!k(e,"sendGifs"),canAttachEmbedLinks:n||!k(e,"embedLinks")}}function L(e,t,n){if(null!=t&&t.sendMessages){const{untilDate:n}=t;return n&&n2&&void 0!==arguments[2]?arguments[2]:{};return n[e.id]&&void 0!==n[e.id].isMuted?n[e.id].isMuted:e.isMuted||f(e.id)&&!t.hasPrivateChatsNotifications||g(e)&&!t.hasBroadcastNotifications||h(e)&&!t.hasGroupNotifications}function B(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{hasPrivateChatsMessagePreview:r=!0,hasBroadcastMessagePreview:o=!0,hasGroupMessagePreview:d=!0}=t;return n[e.id]&&void 0!==n[e.id].shouldShowPreviews?n[e.id].shouldShowPreviews:f(e.id)&&r||g(e)&&o||h(e)&&d}function O(e){return m(e)||(p(e)||g(e))&&e.isCreator}function Z(e,t,n){const{id:r,title:o,emoticon:d,description:a,pinnedChatIds:u,excludedChatIds:s,includedChatIds:i,excludeArchived:c,excludeMuted:l,excludeRead:f,...h}=t;return void 0!==n&&(Object.values(h).filter(Boolean).length>1||null!=s&&s.length||null!=i&&i.length)?e("Chats",n):h.bots?e("FilterBots"):h.groups?e("FilterGroups"):h.channels?e("FilterChannels"):h.contacts?e("FilterContacts"):h.nonContacts?e("FilterNonContacts"):void 0}function D(e,t,n){if(n&&!f(t))return n.isSelf?e("FromYou"):(0,a.Vl)(n)}function _(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return(0,d.Xo)(e,(e=>{const o=t[e];if(!o)return 0;let d=0;return o.lastMessage&&(d+=o.lastMessage.date),n&&o.isVerified&&(d+=c),r&&r.includes(e)&&(d=Date.now()+l+(r.length-r.indexOf(e))),d}),"desc")}function $(e,t,n,r,o){if(!r)return t;const d=(0,s.W)(r);return t.filter((t=>{const r=n[t];return!!r&&d(w(e,r,void 0,t===o))}))}},8415:(e,t,n)=>{n.d(t,{lN:()=>R,JE:()=>k,uw:()=>ve,$l:()=>o.$l,kK:()=>r.kK,H5:()=>o.H5,MR:()=>de,kw:()=>r.kw,cc:()=>o.cc,Qm:()=>o.Qm,RT:()=>o.RT,GM:()=>o.GM,hu:()=>o.hu,N0:()=>ce,Hd:()=>o.Hd,U:()=>o.U,l6:()=>o.l6,T7:()=>g,SB:()=>o.SB,VE:()=>o.VE,XV:()=>ge,Sc:()=>me,N5:()=>V,oP:()=>G,qp:()=>_,w6:()=>A,R5:()=>pe,$D:()=>m,aE:()=>Q,ep:()=>ue,c0:()=>se,eO:()=>Y,Tp:()=>c,kG:()=>ae,Ti:()=>re,DH:()=>ne,KK:()=>f,O$:()=>U,t9:()=>q,dT:()=>N.d,Y5:()=>W,zF:()=>o.zF,q8:()=>o.q8,_O:()=>p,bf:()=>z,Kk:()=>O,Eb:()=>B,MK:()=>F,UD:()=>h,EU:()=>x,b7:()=>j,kd:()=>H,s1:()=>X,F$:()=>ee,Cg:()=>te,bV:()=>le,HV:()=>fe,zX:()=>o.zX,OU:()=>S,RI:()=>E,Ow:()=>be,Rs:()=>r.Rs,Vl:()=>r.Vl,Js:()=>r.Js,db:()=>r.db,Tq:()=>r.Tq,jC:()=>he,BM:()=>ie,u8:()=>$,Lo:()=>I,Ul:()=>C,Nl:()=>o.Nl,pE:()=>o.pE,G9:()=>o.G9,eA:()=>o.eA,Bf:()=>o.Bf,Hp:()=>o.Hp,ZV:()=>o.ZV,pK:()=>o.pK,Ru:()=>o.Ru,NB:()=>r.NB,MF:()=>b,CD:()=>M,rl:()=>K,hC:()=>J,CI:()=>P,B4:()=>v,ss:()=>y,jM:()=>w,cS:()=>r.cS,YC:()=>o.YC,kM:()=>r.kM,Mg:()=>o.Mg,Ak:()=>l,i4:()=>o.i4,Sm:()=>o.Sm,ih:()=>o.ih,Z0:()=>r.Z0});var r=n(5527),o=n(8332),d=n(6137),a=n(3716),u=n(7361),s=n(4784);const i=new RegExp(a.FM,"i");function c(e){const{chatId:t,id:n}=e;return function(e,t){return`msg${e}-${t}`}(t,n)}function l(e){const t=e.match(/^msg(-?\d+)-(\d+)/);return{chatId:t[1],messageId:Number(t[2])}}function f(e){return e.previousLocalId||e.id}function h(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:u,document:s,poll:i,webPage:c,contact:l,invoice:f}=e.content;return t?t.text:n||r||o||d||u||s||l||i||c||f?void 0:a.VC}function m(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:a,document:u,poll:i,webPage:c,contact:l}=e.content;return!!(n||null!=o&&o.isRound)||!(!t||r||o||d||a||u||i||c||l)&&((0,s.Z)(t.text)||!1)}function p(e){const{text:t}=e.content;if(t&&t.text.length<=6&&1===m(e))return t.text}function g(e){const{text:t}=e.content;let n;if(null!=t&&t.entities){let e=t.entities.find((e=>e.type===d.Vv.TextUrl));if(e&&(n=e.url.match(i)),!n&&(e=t.entities.find((e=>e.type===d.Vv.Url)),e)){const{offset:r,length:o}=e;n=t.text.substring(r,r+o).match(i)}}if(!n&&t&&(n=t.text.match(i)),n)return{url:n[0],domain:n[3]}}function v(e){return e.isOutgoing}function y(e){return Boolean(e.replyToMessageId)}function b(e){return Boolean(e.forwardInfo)}function I(e){return Boolean(e.content.action)}function w(e){return e.chatId===a.aw&&Math.round(e.id)!==e.id}function C(e){return Boolean(e.senderId)&&!(0,o.YC)(e.senderId)&&v(e)}function S(e,t){return(0,o.YC)(t.id)?(0,r.Js)(t):(0,o.U)(e,t)}function E(e){return e.sendingState?"messageSendingStateFailed"===e.sendingState?"failed":"pending":"succeeded"}function P(e){return e.id>=a.AE}function M(e){return e.content.action&&"historyClear"===e.content.action.type}function A(e){const{content:t}=e,n=t.webPage?t.webPage.video:t.video,r=t.webPage?t.webPage.photo:t.photo,o=t.webPage?t.webPage.document:t.document;if(o)return o.fileName;if(n)return n.fileName;if(t.sticker){const e=t.sticker.isLottie?"tgs":t.sticker.isGif?"webm":(0,u.on)()?"webp":"png";return`${t.sticker.id}.${e}`}if(t.audio)return t.audio.fileName;const d=c(e);return r?`${d}.jpg`:t.voice?u.m5?`${d}.ogg`:`${d}.wav`:d}function k(e){return!e.results.some((e=>e.count>0))}var T=n(8035),N=n(3995);const L=["⠺","⠵","⠞","⠟"],R=80;function F(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:R,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],d=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const a=!n&&B(t,o),u=a?`${a} `:"",s=(0,T.Z)(x(t),r),i=O(e,t,s,o,d);return`${u}${i}`}function x(e){const t=h(e);if(!t)return;const{entities:n}=e.content.text||{};return null!=n&&n.length?n.reduce(((e,t)=>{let{type:n,offset:r,length:o}=t;if(n!==d.Vv.Spoiler)return e;const a=function(e){return new Array(e).fill(void 0).map((()=>L[Math.floor(Math.random()*L.length)])).join("")}(o);return`${e.substr(0,r)}${a}${e.substr(r+o,e.length)}`}),t):t}function B(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{photo:n,video:r,audio:o,voice:d,document:a,sticker:u,poll:s}=e.content;if(e.groupedId||n)return"🖼";if(r)return"📹";if(u)return u.emoji;if(o)return"🎧";if(d)return"🎤";if(a)return"📎";if(s)return"📊";const i=!t&&(0,N.d)(e);return i?i.reaction:void 0}function O(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{text:d,photo:u,video:s,audio:i,voice:c,document:l,sticker:f,contact:h,poll:m,invoice:p}=t.content;let g;t.groupedId&&(g=n||e("lng_in_dlg_album")),u&&(g=n||e("AttachPhoto")),s&&(g=n||e(s.isGif?"AttachGif":"AttachVideo")),f&&(g=e("AttachSticker").trim()),i&&(g=Z(t)||e("AttachMusic")),c&&(g=n||e("AttachAudio")),l&&(g=o?l.fileName:n||l.fileName),h&&(g=e("AttachContact")),m&&(g=m.summary.question),p&&(g=e("PaymentInvoice")+": "+p.text),d&&(o&&g?g+="\n"+n:g=n);const v=!r&&(0,N.d)(t);return g&&v&&(g=`to your "${g}"`),g||a.VC}function Z(e){const{audio:t,text:n}=e.content;return t&&[t.title,t.performer].filter(Boolean).join(" — ")||(null==n?void 0:n.text)}var D=n(5376);function _(e){return e.content}function $(e){return Boolean(U(e)||j(e)||Q(e)||z(e)||function(e){return e.content.contact}(e)||q(e)||V(e)||G(e)||H(e))}function U(e){return e.content.photo}function j(e){return e.content.video}function W(e){const{video:t}=e.content;return null!=t&&t.isRound?t:void 0}function V(e){return e.content.action}function G(e){return e.content.audio}function H(e){return e.content.voice}function z(e){return e.content.sticker}function Q(e){return e.content.document}function K(e){const t=Q(e);return t?"photo"===t.mediaType:void 0}function J(e){const t=Q(e);return t?"video"===t.mediaType:void 0}function q(e){return e.content.poll}function Y(e){return e.content.invoice}function X(e){return e.content.webPage}function ee(e){var t;return null===(t=X(e))||void 0===t?void 0:t.photo}function te(e){var t;return null===(t=X(e))||void 0===t?void 0:t.video}function ne(e){var t;return null===(t=function(e){const t=U(e)||j(e)||Q(e)||z(e)||ee(e)||te(e);if(t)return t.thumbnail}(e))||void 0===t?void 0:t.dataUri}function re(e,t){const{photo:n,video:r,sticker:o,audio:d,voice:a,document:u}=e.content,s=ee(e),i=te(e),l=r||i,f=n||s;if(!(f||l||o||d||a||u))return;const h=(f||l||o||d||a||u).id,m=`${c(e)}${h?`:${h}`:""}`;if(l)switch(t){case"micro":case"pictogram":case"viewerPreview":return`${m}?size=m`;case"inline":return ie(e)?void 0:oe(l,m);case"viewerFull":return oe(l,m);case"download":return`${m}?download`}if(f)switch(t){case"micro":case"pictogram":return`${m}?size=m`;case"inline":return ie(e)?void 0:`${m}?size=x`;case"viewerPreview":return`${m}?size=x`;case"viewerFull":case"download":return`${m}?size=z`}if(u)switch(t){case"micro":case"pictogram":case"inline":case"viewerPreview":if(!(0,D.v6)(u)||ie(e))return;return`${m}?size=m`;case"viewerFull":case"download":return m}if(o)switch(t){case"micro":return;case"pictogram":return`${m}?size=m`;case"inline":return m;case"download":return`${m}?download`}if(d)switch(t){case"micro":case"pictogram":return de(d)?`${m}?size=m`:void 0;case"inline":return oe(d,m);case"download":return`${m}?download`}if(a)switch(t){case"micro":case"pictogram":return;case"inline":return m;case"download":return`${m}?download`}}function oe(e,t){return u.I_&&u.s$?`${t}?fileSize=${e.size}&mimeType=${e.mimeType}`:t}function de(e){return e.thumbnailSizes&&e.thumbnailSizes.length>0}function ae(e,t){const{sticker:n,video:r,audio:o,voice:a}=e.content,s=r||te(e);return n&&"inline"===t&&n.isLottie?d.IU.Lottie:s&&u.I_&&("viewerFull"===t||"inline"===t)?d.IU.Progressive:o||a?a&&!u.m5?d.IU.BlobUrl:d.IU.Progressive:d.IU.BlobUrl}function ue(e){const{photo:t,video:n,document:r}=e.content,o=ee(e),d=te(e);if(t||o)return`photo${e.date}.jpeg`;const{fileName:a}=n||d||r||{};return a}function se(e){const{video:t,document:n}=e.content,r=te(e),{size:o}=t||r||n||{};return o}function ie(e){const{photo:t,video:n,document:r}=e.content;return(null==t?void 0:t.blobUrl)||(null==n?void 0:n.blobUrl)||(null==r?void 0:r.previewBlobUrl)}function ce(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return pe(e,t,n?"media":"inlineMedia")}function le(e){return e.sizes.find((e=>"z"===e.type))||e.sizes.find((e=>"y"===e.type))||fe(e)}function fe(e){return e.sizes.find((e=>"x"===e.type))||e.sizes.find((e=>"m"===e.type))||e.sizes.find((e=>"s"===e.type))||e.thumbnail}function he(e){if(e.width&&e.height)return e}function me(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=P(e),o=r||n,d=Number(t);return{isUploading:r,isTransferring:o,transferProgress:d}}function pe(e,t,n){let r;switch(n){case"media":r=e=>{const t=j(e);return U(e)||t&&!t.isRound&&!t.isGif};break;case"documents":r=Q;break;case"links":r=e=>X(e)||function(e){const{text:t}=e.content,n=t&&t.text.match(i);if(n)return{url:n[0],domain:n[3]}}(e);break;case"audio":r=G;break;case"voice":r=e=>{const t=j(e);return H(e)||t&&t.isRound};break;case"inlineMedia":r=e=>{const t=j(e);return U(e)||t&&!t.isRound&&!t.isGif||K(e)||J(e)};break;default:return[]}return t.reduce(((t,n)=>(e[n]&&r(e[n])&&t.push(n),t)),[])}function ge(e){const{audio:t,voice:n,video:r}=_(e),o=t||n||r||te(e);if(o)return o.duration}function ve(e,t){return`${e}_${t}`}const ye={missing_payment_information:{field:"cardNumber",message:"Incorrect card number"},invalid_number:{field:"cardNumber",message:"Incorrect card number"},number:{field:"cardNumber",message:"Incorrect card number"},exp_year:{field:"expiry",message:"Incorrect year"},exp_month:{field:"expiry",message:"Incorrect month"},invalid_expiry_year:{field:"expiry",message:"Incorrect year"},invalid_expiry_month:{field:"expiry",message:"Incorrect month"},cvc:{field:"cvv",message:"Incorrect CVV"},invalid_cvc:{field:"cvv",message:"Incorrect CVV"}};function be(e){const{message:t,code:n,param:r}=e,{field:o,message:d}=r?ye[r]:ye[n];return{field:o,message:d,description:t}}},3995:(e,t,n)=>{function r(e){var t,n;return e.isOutgoing?null===(t=e.reactions)||void 0===t||null===(n=t.recentReactions)||void 0===n?void 0:n[0]:void 0}function o(e,t){if(!e||!e.recentReactions)return!0;if(!t||!t.recentReactions)return!1;const n=e.results.reduce(((e,t)=>(e[t.reaction]=t.count,e)),{});return t.results.some((e=>!n[e.reaction]||n[e.reaction]r,l:()=>o})},5527:(e,t,n)=>{n.d(t,{Vl:()=>i,Js:()=>c,Tq:()=>l,kM:()=>f,NB:()=>h,cS:()=>m,kw:()=>p,Z0:()=>g,kK:()=>v,db:()=>y,Rs:()=>b});var r=n(3716),o=n(790),d=n(782),a=n(2267),u=n(5765);const s=[1,8,5,2,7,4,6];function i(e){if(e)switch(e.type){case"userTypeBot":case"userTypeRegular":return e.firstName||e.lastName;case"userTypeDeleted":case"userTypeUnknown":return"Deleted";default:return}}function c(e){if(e){if(h(e))return"Deleted account";switch(e.type){case"userTypeBot":case"userTypeRegular":if(e.firstName&&e.lastName)return`${e.firstName} ${e.lastName}`;if(e.firstName)return e.firstName;if(e.lastName)return e.lastName;break;case"userTypeDeleted":case"userTypeUnknown":return"Deleted account"}}}function l(e,t,n,d){if(t.id===r.aw)return e("ServiceNotifications").toLowerCase();if(t.type&&"userTypeBot"===t.type)return e("Bot");if(!n)return"";switch(n.type){case"userStatusEmpty":return e("ALongTimeAgo");case"userStatusLastMonth":return e("WithinAMonth");case"userStatusLastWeek":return e("WithinAWeek");case"userStatusOffline":{const{wasOnline:t}=n;if(!t)return e("LastSeen.Offline");const r=new Date((new Date).getTime()+1e3*d),a=new Date(1e3*t);if(a>=r)return e("LastSeen.JustNow");const u=new Date(r.getTime()-a.getTime());if(u.getTime()/1e3<60)return e("LastSeen.JustNow");if(u.getTime()/1e3<3600)return e("LastSeen.MinutesAgo",Math.floor(u.getTime()/1e3/60));const s=new Date;if(s.setHours(0,0,0,0),a>new Date(s.getTime()+1e3*d))return u.getTime()/1e3<21600?e("LastSeen.HoursAgo",Math.floor(u.getTime()/1e3/60/60)):e("LastSeen.TodayAt",(0,o.mr)(e,a));const i=new Date;return i.setDate(r.getDate()-1),i.setHours(0,0,0,0),a>new Date(i.getTime()+1e3*d)?e("LastSeen.YesterdayAt",(0,o.mr)(e,a)):e("LastSeen.AtDate",(0,o.Tu)(e,a))}case"userStatusOnline":return e("Online");case"userStatusRecently":return e("Lately");default:return}}function f(e,t){const{id:n,type:o}=e;return!!t&&n!==r.aw&&"userStatusOnline"===t.type&&"userTypeBot"!==o}function h(e){return!e.noStatus&&"userTypeBot"!==e.type&&e.id!==r.aw&&("userTypeDeleted"===e.type||"userTypeUnknown"===e.type)}function m(e){return"userTypeBot"===e.type}function p(e){return!e.isContact&&!m(e)}function g(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return(0,d.Xo)(e,(e=>{const d=(0,a.b)(o);if(r&&r.includes(e))return d+172800-(r.length-r.indexOf(e));const u=t[e],s=n[e];if(!u||!s)return 0;if("userStatusOnline"===s.type)return s.expires;if("userStatusOffline"===s.type&&s.wasOnline)return s.wasOnline;switch(s.type){case"userStatusRecently":return d-86400;case"userStatusLastWeek":return d-604800;case"userStatusLastMonth":return d-18144e3;default:return 0}}),"desc")}function v(e,t,n,r,o){if(!n)return e;const d=(0,u.W)(n);return e.filter((e=>{const n=t[e];if(!n)return!1;const a=e===r?o:c(n);return a&&d(a)||d(n.username)}))}function y(e){return"number"==typeof e?Math.abs(e):Math.abs(Number(e))}function b(e){const t=e?y(e.id)%7:0;return s[t]}},6788:(e,t,n)=>{n.d(t,{Mg:()=>a,B1:()=>u,SL:()=>s,a4:()=>i,GL:()=>c,fZ:()=>l,Pi:()=>h,vv:()=>m,Dd:()=>p});var r=n(3716),o=n(782),d=n(9066);function a(e,t,n){return{...e,chats:{...e.chats,listIds:{...e.chats.listIds,[t]:n}}}}function u(e,t,n){const{[t]:r}=e.chats.listIds,o=null!=r&&r.length?n.filter((e=>!r.includes(e))):n;return r&&!o.length?e:a(e,t,[...r||[],...o])}function s(e,t){return{...e,chats:{...e.chats,byId:t}}}function i(e,t,n,r){const{byId:o}=e.chats,d=f(e,t,n,r);return d?s(e,{...o,[t]:d}):e}function c(e,t){const n=Object.keys(t).reduce(((n,r)=>{const o=f(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=s(e,{...e.chats.byId,...n})}function l(e,t){const{byId:n}=e.chats;let r=!1;const o=Object.keys(t).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=f(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r?e=s(e,{...n,...o}):e}function f(e,t,n,r){const{byId:d}=e.chats,a=d[t],u=n.isMin&&a&&!a.isMin,s={...a,...u?(0,o.CE)(n,["isMin","accessHash"]):n,...r&&{photos:[r,...a.photos||[]]}};if(s.id&&s.type)return s}function h(e,t,n){const o=n===r.WS?"archived":"active";let d=e.chats.listIds;return Object.keys(d).forEach((e=>{const n=d[e]||[];e!==o||n.includes(t)?e!==o&&n.includes(t)&&(d={...d,[e]:n.filter((e=>e!==t))}):d={...d,[e]:[...n,t]}})),i(e={...e,chats:{...e.chats,listIds:d}},t,{folderId:n||void 0})}function m(e,t,n){const r="active"===t?"all":"archived";return{...e,chats:{...e.chats,...n.orderedPinnedIds&&{orderedPinnedIds:{...e.chats.orderedPinnedIds,[t]:n.orderedPinnedIds}},totalCount:{...e.chats.totalCount,[r]:n.totalChatCount},isFullyLoaded:{...e.chats.isFullyLoaded,[t]:!1}}}}function p(e,t){const n=(0,d.Ek)(e,t);if(!n)return e;const{[n]:r}=e.chats.listIds;return r&&(e=a(e,n,r.filter((e=>e!==t)))),i(e,t,{isNotJoined:!0})}},9959:(e,t,n)=>{n.d(t,{O4:()=>z,c_:()=>o.c_,fZ:()=>r.fZ,m6:()=>o.m6,aK:()=>G,aJ:()=>V,zn:()=>P,Sh:()=>y,$S:()=>o.$S,bp:()=>de,WY:()=>ae,K4:()=>o.K4,bV:()=>o.bV,GK:()=>I,M6:()=>o.M6,i9:()=>o.i9,Dd:()=>r.Dd,vy:()=>f,rB:()=>Q,g_:()=>c,Mg:()=>r.Mg,SL:()=>r.SL,Pb:()=>x,w3:()=>o.w3,BI:()=>j,lr:()=>W,pf:()=>o.pf,ps:()=>E,s5:()=>m,y9:()=>o.y9,fS:()=>re,nA:()=>X,_7:()=>ne,Q$:()=>Y,Dq:()=>oe,vT:()=>q,QD:()=>te,QH:()=>ee,Ob:()=>o.Ob,a4:()=>r.a4,B1:()=>r.B1,vv:()=>r.vv,Pi:()=>r.Pi,cY:()=>o.cY,GL:()=>r.GL,Wy:()=>o.Wy,wV:()=>o.wV,cq:()=>o.cq,rq:()=>i,No:()=>A,Og:()=>k,xv:()=>N,px:()=>T,xj:()=>o.xj,c1:()=>D,z5:()=>Z,qr:()=>F,dx:()=>B,fw:()=>U,H9:()=>$,HN:()=>H,ff:()=>o.ff,P4:()=>o.P4,TM:()=>J,Fn:()=>o.Fn,Rg:()=>s,z3:()=>u,IM:()=>l,Xg:()=>o.Xg,j6:()=>o.j6,lG:()=>o.lG,IE:()=>K,Nq:()=>g,Lm:()=>w,Q3:()=>C,eD:()=>v});var r=n(6788),o=n(3495),d=n(782),a=n(9066);function u(e,t,n,r,o){const a=r.map((t=>{const n=e.stickers.setsById[t.id];return n?{...n,...t}:t}));return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,...(0,d.ee)(a,"id")},[t]:{...e.stickers[t],hash:n,..."search"===t?{resultIds:o}:{setIds:r.map((e=>{let{id:t}=e;return t}))}}}}}function s(e,t,n){const r=e.stickers.setsById[t]||{},o=e.stickers.added.setIds||[];let d=o;return n.installedDate&&o&&!o.includes(t)&&(d=[t,...d]),!n.installedDate&&null!=o&&o.includes(t)&&(d=d.filter((e=>e!==t))),{...e,stickers:{...e.stickers,added:{...e.stickers.added,setIds:d},setsById:{...e.stickers.setsById,[t]:{...r,...n}}}}}function i(e,t,n,r){const{results:o}=e.gifs.search;let d;if(t||!o)d=n;else{const e=new Set(o.map((e=>e.id)));d=[...o,...n.filter((t=>!e.has(t.id)))]}return{...e,gifs:{...e.gifs,search:{...e.gifs.search,offset:r,results:d}}}}function c(e,t){return{...e,animatedEmojis:t}}function l(e,t,n,r){const o=[...(0,a.Pk)(e,t),...n||[]],u=(0,d.Tw)(o.map((e=>{let{id:t}=e;return t}))),s=(0,d.ee)(o,"id"),i=u.map((e=>s[e]));return{...e,stickers:{...e.stickers,forEmoji:{emoji:t,stickers:i,hash:r}}}}function f(e){const{emoji:t,stickers:n,hash:r}=e.stickers.forEmoji||{};return t?l(e,t,n,r):e}var h=n(735);function m(e,t){return{...e,users:{...e.users,byId:t}}}function p(e,t){const{userIds:n}=e.contactList||{};if(!n)return e;const r=t.filter((e=>(null==e?void 0:e.isContact)&&!n.includes(e.id))).map((e=>e.id));return 0===r.length?e:{...e,contactList:{userIds:[...r,...n]}}}function g(e,t,n){const{byId:r}=e.users,o=b(e,t,n);return o?m(e=p(e,[o]),{...r,[t]:o}):e}function v(e,t){const n=Object.keys(t).reduce(((n,r)=>{const o=b(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=p(e=m(e,{...e.users.byId,...n}),Object.values(n))}function y(e,t){const{byId:n}=e.users;let r=!1;const o=Object.keys(t).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=b(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r?e=p(e=m(e,{...n,...o}),Object.values(o)):e}function b(e,t,n){const{byId:r}=e.users,o=r[t],a=n.isMin&&o&&!o.isMin,u={...o,...a?(0,d.CE)(n,["isMin","accessHash"]):n};if(u.id&&u.type)return u}function I(e,t){const{byId:n}=e.users,{userIds:r}=e.contactList||{};return m(e={...e,contactList:{userIds:r?r.filter((e=>e!==t)):h.D}},{...n,[t]:{...n[t],isContact:void 0}})}function w(e,t){return{...e,userSearch:{...e.userSearch,...t}}}function C(e,t){return w(e,{fetchingStatus:t})}function S(e,t,n){const{byId:r}=e.users,o=r[t];return o&&o.fullInfo?g(e,t,{...o,fullInfo:{...o.fullInfo,isBlocked:n}}):e}function E(e,t){return{...e,users:{...e.users,statusesById:t}}}function P(e,t){const{statusesById:n}=e.users,r=Object.keys(t).filter((e=>!n[e]));return r.length?e=E(e,{...n,...(0,d.ei)(t,r)}):e}const M=e=>`${e.chatId}_${e.id}`;function A(e,t){return{...e,globalSearch:{...e.globalSearch,...t}}}function k(e,t){return A(e,{currentContent:t})}function T(e,t,n,r,o){var a;const{resultsByType:u}=e.globalSearch||{},s=t.reduce(((e,t)=>(e[M(t)]=t,e)),{}),i=null==u||null===(a=u[r])||void 0===a?void 0:a.foundIds;if(void 0!==i&&Object.keys(s).every((e=>i.includes(M(s[e])))))return N(e,{messages:!1});const c=i||[],l=t.map((e=>M(e))),f=Array.prototype.concat(c,l),h=(0,d.et)(c,f)?c:f;return A(e=N(e,{messages:!1}),{resultsByType:{...(e.globalSearch||{}).resultsByType,[r]:{totalCount:n,nextOffsetId:o,foundIds:h}}})}function N(e,t){return A(e,{fetchingStatus:{...e.globalSearch.fetchingStatus,...t}})}var L=n(8415);function R(e,t,n){return{...e,localTextSearch:{byChatThreadKey:{...e.localTextSearch.byChatThreadKey,[t]:n}}}}function F(e,t,n,r,o){const d=(0,L.uw)(t,n);return R(e,d,{...e.localTextSearch.byChatThreadKey[d],isActive:r,query:o})}function x(e,t,n,r,o,d){const a=(0,L.uw)(t,n);return R(e,a,{...e.localTextSearch.byChatThreadKey[a],results:{foundIds:r,totalCount:o,nextOffsetId:d}})}function B(e,t,n,r,o,a){const u=(0,L.uw)(t,n),{results:s}=e.localTextSearch.byChatThreadKey[u]||{},i=(null==s?void 0:s.foundIds)||[],c=_((0,d.Tw)(Array.prototype.concat(i,r)));return x(e,t,n,(0,d.et)(i,c)?i:c,o,a)}function O(e,t,n){return{...e,localMediaSearch:{byChatId:{...e.localMediaSearch.byChatId,[t]:n}}}}function Z(e,t,n){return O(e,t,{...e.localMediaSearch.byChatId[t],currentType:n})}function D(e,t,n,r,o,a){const{resultsByType:u}=e.localMediaSearch.byChatId[t]||{},s=null!=u&&u[n]?u[n].foundIds:[],i=_((0,d.Tw)(Array.prototype.concat(s,r)));return function(e,t,n,r,o,d){return O(e,t,{...e.localMediaSearch.byChatId[t],resultsByType:{...(e.localMediaSearch.byChatId[t]||{}).resultsByType,[n]:{foundIds:r,totalCount:o,nextOffsetId:d}}})}(e,t,n,(0,d.et)(s,i)?s:i,o,a)}function _(e){return e.sort(((e,t)=>t-e))}function $(e,t){return{...e,management:{...e.management,progress:t}}}function U(e,t,n){return{...e,management:{...e.management,byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t]||{},...n}}}}}function j(e,t){return{...e,settings:{...e.settings,byKey:{...e.settings.byKey,...t}}}}function W(e,t,n){return{...e,settings:{...e.settings,themes:{...e.settings.themes,[t]:{...e.settings.themes[t]||{},...n}}}}}function V(e,t){return t.forEach((t=>{const{chatId:n,...r}=t;e=G(e,n,r)})),e}function G(e,t,n){return{...e,settings:{...e.settings,notifyExceptions:{...e.settings.notifyExceptions,[t]:n}}}}function H(e,t,n,r){switch(t){case"contact":return j(e,{...void 0!==n&&{hasPrivateChatsNotifications:!n},...void 0!==r&&{hasPrivateChatsMessagePreview:r}});case"group":return j(e,{...void 0!==n&&{hasGroupNotifications:!n},...void 0!==r&&{hasGroupMessagePreview:r}});case"broadcast":return j(e,{...void 0!==n&&{hasBroadcastNotifications:!n},...void 0!==r&&{hasBroadcastMessagePreview:r}});default:return}}function z(e,t){return e=S(e,t,!0),{...e,blocked:{...e.blocked,ids:[t,...e.blocked.ids],totalCount:e.blocked.totalCount+1}}}function Q(e,t){return e=S(e,t,!1),{...e,blocked:{...e.blocked,ids:e.blocked.ids.filter((e=>e!==t)),totalCount:e.blocked.totalCount-1}}}function K(e,t){return{...e,twoFaSettings:{...e.twoFaSettings,...t}}}function J(e,t){return{...e,payment:{...e.payment,shippingOptions:t}}}function q(e,t){return{...e,payment:{...e.payment,requestId:t}}}function Y(e,t){return{...e,payment:{...e.payment,step:t}}}function X(e,t){if(!t.content||!t.content.invoice)return e;const{title:n,text:r,amount:o,currency:d,isTest:a,photoUrl:u}=t.content.invoice;return{...e,payment:{...e.payment,invoiceContent:{title:n,text:r,photoUrl:u,amount:o,currency:d,isTest:a}}}}function ee(e,t){return{...e,payment:{...e.payment,stripeCredentials:{...t}}}}function te(e,t){return{...e,payment:{...e.payment,smartGlocalCredentials:{...t}}}}function ne(e,t){return{...e,payment:{...e.payment,...t}}}function re(e,t){return{...e,payment:{...e.payment,confirmPaymentUrl:t}}}function oe(e,t,n){if(!t||!n)return{...e,payment:{...e.payment,receipt:void 0}};const{invoice:r}=n.content,{photoUrl:o,text:d,title:a}=r||{};return{...e,payment:{...e.payment,receipt:{...t,photoUrl:o,text:d,title:a}}}}function de(e){return{...e,payment:{}}}function ae(e){return{...e,payment:{...e.payment,isPaymentModalOpen:!1}}}},3495:(e,t,n)=>{n.d(t,{Wy:()=>u,pf:()=>c,m6:()=>l,c_:()=>f,cY:()=>h,P4:()=>m,K4:()=>p,bV:()=>g,xj:()=>v,ff:()=>y,$S:()=>I,y9:()=>w,Xg:()=>C,j6:()=>S,w3:()=>E,cq:()=>P,Fn:()=>M,wV:()=>A,M6:()=>k,Ob:()=>T,i9:()=>N,lG:()=>L});var r=n(6137),o=n(3716),d=n(9066),a=n(782);function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r._f,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"thread",a=arguments.length>4?arguments[4]:void 0;const{messageLists:u}=e.messages;let s=u;if(a||o.Cg)s=t?[{chatId:t,threadId:n,type:d}]:[];else if(t){const e=u[u.length-1];e&&e.chatId===t&&e.threadId===n&&e.type===d||(s=e&&e.chatId===o.AJ?[...u.slice(0,-1),{chatId:t,threadId:n,type:d}]:[...u,{chatId:t,threadId:n,type:d}])}else s=u.slice(0,-1);return{...e,messages:{...e.messages,messageLists:s}}}function s(e,t,n){return i(e,t,{byId:n})}function i(e,t,n){const r=e.messages.byChatId[t]||{byId:{},threadsById:{}};return{...e,messages:{...e.messages,byChatId:{...e.messages.byChatId,[t]:{...r,...n}}}}}function c(e,t,n,r,o){return function(e,t,n,r){const o=e.messages.byChatId[t];return i(e,t,{threadsById:{...null==o?void 0:o.threadsById,[n]:{...null==o?void 0:o.threadsById[n],...r}}})}(e,t,n,{[r]:o})}function l(e,t){const n=t.reduce(((e,t)=>(e[t.chatId]||(e[t.chatId]={}),e[t.chatId][t.id]=t,e)),{});return Object.keys(n).forEach((t=>{e=f(e,t,n[t])})),e}function f(e,t,n){const r=(0,d.Zw)(e,t);return r&&Object.keys(n).every((e=>Boolean(r[Number(e)])))?e:s(e,t,{...n,...r})}function h(e,t,n,r){const o=(0,d.Zw)(e,t)||{},a={...o[n],...r};return a.id?s(e,t,{...o,[n]:a}):e}function m(e,t,n,r){const o=(0,d.Fn)(e,t)||{},a={...o[n],...r};return a.id?E(e,t,{...o,[n]:a}):e}function p(e,t,n){const r=(0,d.Zw)(e,t);if(!r)return e;const o=(0,a.CE)(r,n),i=Object.values((0,a.q0)(r,n)).filter((e=>{let{forwardInfo:t}=e;return null==t?void 0:t.isLinkedChannelPost}));if(Object.keys(e.messages.byChatId[t].threadsById).map(Number).forEach((r=>{const o=(0,d.tZ)(e,t,r);let a=(0,d.gb)(e,t,r),u=(0,d.qC)(e,t,r),s=(0,d.Cb)(e,t,r),i=(0,d.KB)(e,t),l=null==o?void 0:o.messagesCount;n.forEach((e=>{a&&a.includes(e)&&(a=a.filter((t=>t!==e)),void 0!==l&&(l-=1)),u&&u.includes(e)&&(u=u.filter((t=>t!==e))),s&&s.includes(e)&&(s=s.filter((t=>t!==e))),i&&i.includes(e)&&(i=i.filter((t=>t!==e)))})),e=c(e,t,r,"listedIds",a),e=c(e,t,r,"outlyingIds",u),e=c(e,t,r,"viewportIds",s),e=c(e,t,r,"pinnedIds",i),o&&void 0!==l&&(e=c(e,t,r,"threadInfo",{...o,messagesCount:l}))})),i.length){const n=(0,d.Bt)(e),r=n&&n.chatId===t&&"thread"===n.type,o=null==n?void 0:n.threadId;i.forEach((n=>{const{fromChatId:a,fromMessageId:s}=n.forwardInfo,i=(0,d.hj)(e,a,s);r&&o===s&&(e=u(e,t)),i&&(e=h(e,a,s,{threadInfo:void 0}))}))}return e=s(e,t,o)}function g(e,t,n){const o=(0,d.Fn)(e,t);if(!o)return e;const u=(0,a.CE)(o,n);let s=(0,d.qy)(e,t);return s&&(n.forEach((e=>{s.includes(e)&&(s=s.filter((t=>t!==e)))})),e=c(e,t,r._f,"scheduledIds",s)),E(e,t,u)}function v(e,t,n,r){const o=(0,d.gb)(e,t,n),a=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!a.length?e:c(e,t,n,"listedIds",b([...o||[],...a]))}function y(e,t,n,r){const o=(0,d.qC)(e,t,n),a=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!a.length?e:c(e,t,n,"outlyingIds",b([...o||[],...a]))}function b(e){return e.sort(((e,t)=>e-t))}function I(e,t,n,r){const a=(0,d.Cb)(e,t,n)||[];return a.includes(r)?e:c(e,t,n,"viewportIds",b([...a.length{e=C(e,t.chatId,t.threadId,t)})),e}function E(e,t,n){return function(e,t,n){const r=e.scheduledMessages.byChatId[t]||{byId:{},hash:0};return{...e,scheduledMessages:{byChatId:{...e.scheduledMessages.byChatId,[t]:{...r,...n}}}}}(e,t,{byId:n})}function P(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{...e,focusedMessage:{...e.focusedMessage,chatId:t,messageId:n,noHighlight:r,isResizingContainer:o}}}function M(e,t,n){return{...e,messages:{...e.messages,sponsoredByChatId:{...e.messages.sponsoredByChatId,[t]:n}}}}function A(e,t){return{...e,focusedMessage:{...e.focusedMessage,direction:t}}}function k(e,t,n){return{...e,selectedMessages:{chatId:t,messageIds:n?Array.prototype.concat([],n):[]}}}function T(e,t,n,r,o,u,s){let i=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const{selectedMessages:c}=e;u&&(s=(0,d.xH)(e,t,u));const l=s||[o];if(!c)return k(e,t,l);const{messageIds:f}=c;let h;const m=l.filter((e=>!f.includes(e)));if(m&&!m.length)h=f.filter((e=>!l.includes(e)));else if(i&&f.length){const u=(0,d.$W)(e,t,n,r),s=u.indexOf(f[f.length-1]),i=u.indexOf(o),c=Math.min(s,i),l=Math.max(s,i),m=u.slice(c,l+1);h=(0,a.Tw)([...f,...m])}else h=[...f,...m];return h.length?{...e,selectedMessages:{...c,messageIds:h}}:N(e)}function N(e){return{...e,selectedMessages:void 0}}function L(e,t,n,r,o){const{channelPostId:a,fromChatId:u}=t.forwardInfo||{};if(a&&u){const t=(0,d.tZ)(e,n,a);t&&(e=c(e,n,a,"threadInfo",{...t,lastMessageId:r,messagesCount:t.messagesCount+(o?-1:1)}))}return e}},8857:(e,t,n)=>{n.d(t,{Z1:()=>u,Dg:()=>s,FM:()=>i,xo:()=>c,P_:()=>l,YK:()=>f,IK:()=>h,pk:()=>m,g4:()=>p,N:()=>g,Ek:()=>v,Mw:()=>y,ep:()=>b,DI:()=>I,UW:()=>w,_5:()=>C});var r=n(6137),o=n(8415),d=n(6376),a=n(3716);function u(e,t){return e.chats.byId[t]}function s(e,t){const n=(0,o.zX)(t);return!!n&&(0,d.dy)(e,n)}function i(e,t){return t===e.currentUserId}function c(e,t){const n=s(e,t);return n&&(0,o.cS)(n)}function l(e){return Object.values(e.chats.byId).find((e=>{let{isSupport:t}=e;return t}))}function f(e,t){if(!(0,o.YC)(t.id)&&!(0,o.eA)(t)&&t.fullInfo)return t.fullInfo.members&&t.fullInfo.members.length!==a.mo?t.fullInfo.members.reduce(((t,n)=>{let{userId:r}=n;return r!==e.currentUserId&&e.users.byId[r]&&(0,o.kM)(e.users.byId[r],e.users.statusesById[r])?t+1:t}),0):t.fullInfo.onlineCount}function h(e,t){const n=u(e,t),r=n&&(0,o.zX)(n),a=r&&(0,d.dy)(e,r);if(a&&(0,o.cS)(a))return a}function m(e,t){const n=u(e,t),d=h(e,t);if(!n||!d)return!1;if(n.lastMessage&&(0,o.CD)(n.lastMessage))return!0;const a=e.messages.byChatId[t];if(!a)return!1;const{listedIds:s}=a.threadsById[r._f]||{};return s&&!s.length}function p(e){return Boolean(e.chats.listIds.active)}function g(e,t,n){const{listIds:r}=e.chats;if(n){const e=r[n];return Boolean(e&&e.includes(t))}return Object.values(r).some((e=>e&&e.includes(t)))}function v(e,t){const n=u(e,t);if(n&&g(e,t))return n.folderId===a.WS?"archived":"active"}function y(e,t){return e.chatFolders.byId[t]}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.Nf;const{active:r,archived:o}=e.chats.orderedPinnedIds;if(n===a.Nf)return Boolean(null==r?void 0:r.includes(t));if(n===a.WS)return Boolean(null==o?void 0:o.includes(t));const{byId:d}=e.chatFolders,{pinnedChatIds:u}=d[n]||{};return Boolean(null==u?void 0:u.includes(t))}function I(e,t){const n=t.toLowerCase();return Object.values(e.chats.byId).find((e=>e.username&&e.username.toLowerCase()===n))}function w(e){return Boolean(u(e,a.aw))}function C(e,t){var n;const r=u(e,t);if(!r)return;const o=null==r||null===(n=r.fullInfo)||void 0===n?void 0:n.sendAsId;return o?(0,d.dy)(e,o)||u(e,o):void 0}},9066:(e,t,n)=>{n.d(t,{hg:()=>Q,xs:()=>le,_k:()=>ae,zB:()=>v,tH:()=>y,Oh:()=>b,g4:()=>u.g4,bH:()=>Ee,__:()=>Me,xl:()=>ue,Nu:()=>ie,nB:()=>se,Z1:()=>u.Z1,IK:()=>u.IK,DI:()=>u.DI,Mw:()=>u.Mw,Ek:()=>u.Ek,hj:()=>J,ZB:()=>X,Zw:()=>A,YK:()=>u.YK,Dg:()=>u.Dg,X5:()=>ge,jr:()=>M,yN:()=>f,JX:()=>je,pP:()=>Ze,we:()=>Be,$W:()=>R,Bt:()=>P,y5:()=>l,n5:()=>xe,q6:()=>Re,Ms:()=>$,_$:()=>D,kK:()=>Y,wU:()=>_,yZ:()=>W,It:()=>me,G$:()=>ee,y8:()=>be,cv:()=>de,ku:()=>Ne,pk:()=>u.pk,N:()=>u.N,ep:()=>u.ep,xo:()=>u.xo,FM:()=>u.FM,a6:()=>we,te:()=>ce,Ev:()=>pe,CA:()=>ve,zQ:()=>De,_X:()=>te,EV:()=>Te,vk:()=>ye,Jf:()=>$e,UW:()=>u.UW,s4:()=>s.s4,b9:()=>K,VF:()=>ke,gb:()=>N,CP:()=>I,cu:()=>w,ji:()=>C,aW:()=>Oe,xH:()=>Ie,FT:()=>Se,tV:()=>U,NJ:()=>Ye,dZ:()=>qe,dT:()=>re,qC:()=>L,gx:()=>We,eh:()=>Ge,Mz:()=>Ve,sp:()=>He,KB:()=>x,EB:()=>Qe,$$:()=>ze,rd:()=>he,p9:()=>V,Yy:()=>Z,Wq:()=>_e,qy:()=>B,Tm:()=>q,Fn:()=>k,Vt:()=>O,D7:()=>Ce,_5:()=>u._5,Ur:()=>oe,yB:()=>Ae,Jg:()=>Je,fS:()=>Le,Ny:()=>h,E_:()=>m,Pk:()=>p,i3:()=>Ke,P_:()=>u.P_,Pu:()=>Ue,Db:()=>z,tZ:()=>j,Cm:()=>G,qS:()=>H,uZ:()=>fe,dy:()=>s.dy,ss:()=>s.ss,Cb:()=>F,P2:()=>Fe});var r=n(1713),o=n(7361),d=n(6137),a=n(3716),u=n(8857),s=n(6376),i=n(8415),c=n(782);function l(e){return e.stickers.search}function f(e){return e.gifs.search}function h(e,t){return e.stickers.setsById[t]}function m(e,t){return Object.values(e.stickers.setsById).find((e=>e.shortName.toLowerCase()===t.toLowerCase()))}function p(e,t){const n=Object.values(e.stickers.setsById);let r=[];return e.stickers.favorite.stickers.forEach((e=>{e.emoji===t&&r.push(e)})),n.forEach((e=>{let{packs:n}=e;n&&(r=r.concat(n[t]||[],n[g(t)]||[]))})),r}function g(e){return e.replace("️","")}function v(e,t){const{animatedEmojis:n}=e;if(!n||!n.stickers)return;const r=g(t);return n.stickers.find((e=>e.emoji===t||e.emoji===r))}function y(e,t){const{animatedEmojiEffects:n}=e;if(!n||!n.stickers)return;const r=g(t);return n.stickers.find((e=>e.emoji===t||e.emoji===r))}function b(e,t){var n;return null==e||null===(n=e.appConfig)||void 0===n?void 0:n.emojiSounds[g(t)]}function I(e,t){const n=g(t);return"🍑"===n?"Peach":"🍆"===n?"Eggplant":void 0}function w(e){return"Eggplant"===e?"Cumshot":void 0}function C(e){return"Cumshot"===e?"🍆":void 0}var S=n(2267),E=n(735);function P(e){const{messageLists:t}=e.messages;if(t.length)return t[t.length-1]}function M(e){const{chatId:t}=P(e)||{};return t?(0,u.Z1)(e,t):void 0}function A(e,t){var n;return null===(n=e.messages.byChatId[t])||void 0===n?void 0:n.byId}function k(e,t){var n;return null===(n=e.scheduledMessages.byChatId[t])||void 0===n?void 0:n.byId}function T(e,t,n,r){const o=e.messages.byChatId[t];if(!o)return;const d=o.threadsById[n];return d?d[r]:void 0}function N(e,t,n){return T(e,t,n,"listedIds")}function L(e,t,n){return T(e,t,n,"outlyingIds")}function R(e,t,n,r){switch(r){case"thread":return F(e,t,n);case"pinned":return x(e,t);case"scheduled":return B(e,t)}}function F(e,t,n){return T(e,t,n,"viewportIds")}function x(e,t){return T(e,t,d._f,"pinnedIds")}function B(e,t){return T(e,t,d._f,"scheduledIds")}function O(e,t,n){return T(e,t,n,"scrollOffset")}function Z(e,t,n){return T(e,t,n,"replyingToId")}function D(e,t,n){return T(e,t,n,"editingId")}function _(e,t){return T(e,t,d._f,"editingScheduledId")}function $(e,t,n){return T(e,t,n,"draft")}function U(e,t,n){return T(e,t,n,"noWebPage")}function j(e,t,n){return T(e,t,n,"threadInfo")}function W(e,t,n){return T(e,t,n,"firstMessageId")}function V(e,t,n){return T(e,t,n,"replyStack")}function G(e,t,n){if(n===d._f)return(0,u.Z1)(e,t);const r=j(e,t,n);return r?(0,u.Z1)(e,r.originChannelId||t):void 0}function H(e,t,n){if(n===d._f)return;const r=j(e,t,n);return r?r.topMessageId:void 0}function z(e,t,n){const r=e.messages.byChatId[t];if(!r)return;const{replyToMessageId:o,replyToTopMessageId:d}=n;return o||d?Object.values(r.threadsById).find((e=>e.threadInfo&&(o&&o===e.threadInfo.topMessageId||d&&d===e.threadInfo.topMessageId))):void 0}function Q(e,t,n){const r=P(e);if(!r)return!1;const{threadInfo:o}=z(e,t,n)||{};return t===r.chatId&&(r.threadId===d._f||o&&r.threadId===o.threadId)}function K(e,t,n){const r=F(e,t,n);if(!r||!r.length)return!0;let o;if(n===d._f){const n=(0,u.Z1)(e,t);if(!n||!n.lastMessage)return!0;o=n.lastMessage.id}else{const r=j(e,t,n);if(!r||!r.lastMessageId)return;o=r.lastMessageId}return o>=a.AE&&!J(e,t,o)||r[r.length-1]>=o}function J(e,t,n){const r=A(e,t);return r?r[n]:void 0}function q(e,t,n){const r=k(e,t);return r?r[n]:void 0}function Y(e,t,n,r){if("scheduled"===r){const n=_(e,t);return n?q(e,t,n):void 0}{const r=D(e,t,n);return r?J(e,t,r):void 0}}function X(e,t){let n;for(const r of Object.values(e.messages.byChatId)){const{byId:e}=r;if(n=Object.values(e).find((e=>e.content.poll&&e.content.poll.id===t)),n)break}return n}function ee(e,t){const{chatId:n,messageId:r}=e.focusedMessage||{};return n===t?r:void 0}function te(e,t){const n=ee(e,t.chatId);return!!n&&(n===t.id||n===t.previousLocalId)}function ne(e,t){const{lastReadOutboxMessageId:n}=(0,u.Z1)(e,t.chatId)||{};return(0,i.CI)(t)||!n||n2&&void 0!==arguments[2]&&arguments[2];return ne(e,t)||n?(0,i.RI)(t):"read"}function oe(e,t){const{senderId:n}=t;if(n)return(0,i.YC)(n)?(0,s.dy)(e,n):(0,u.Z1)(e,n)}function de(e,t){const{forwardInfo:n}=t;if(n)return n.isChannelPost&&n.fromChatId?(0,u.Z1)(e,n.fromChatId):n.senderUserId?(0,s.dy)(e,n.senderUserId)||(0,u.Z1)(e,n.senderUserId):void 0}function ae(e,t,n){var r,o,d,a;const s=(0,u.Z1)(e,t.chatId);if(!s||s.isRestricted)return{};const c=(0,i.YC)(s.id),l=(0,u.FM)(e,t.chatId),f=(0,i.G9)(s),h=(0,i.ZV)(s),m=(0,i.eA)(s),p=(0,i.CI)(t),g=(0,i.jM)(t),v=(0,i.B4)(t),y=(0,i.Lo)(t),{content:b}=t,I=(l||h&&(0,i.VE)(s,"pinMessages")||m&&(0,i.VE)(s,"editMessages")||(0,S.b)(e.serverTimeOffset)-t.date<172800)&&!(b.sticker||b.contact||b.poll||b.action||b.audio||null!==(r=b.video)&&void 0!==r&&r.isRound)&&!(0,i.MF)(t)&&!t.viaBotId,w=!p&&!g&&(0,i.Qm)(s,n),C=c||s.isCreator||!m&&!(0,i.Mg)(s,"pinMessages")||(0,i.VE)(s,"pinMessages");let E=!p&&!g&&!y&&C,P=!1;const M=x(e,s.id);E&&(P=Boolean(M&&M.includes(t.id)),E=!P);const A=!p&&!g&&(c||v||f||s.isCreator||(0,i.VE)(s,"deleteMessages")),k=!c&&!v,T=A&&(c&&!l||f&&(v||(0,i.VE)(s,"deleteMessages")||s.isCreator)),N=!p&&!y&&I&&(v||m&&(s.isCreator||(0,i.VE)(s,"editMessages"))),L=!p&&!y,R=Boolean(t.content.sticker),F=R&&function(e,t){const{stickers:n}=e.stickers.favorite;return n&&n.some((e=>{let{id:n}=e;return n===t.id}))}(e,t.content.sticker),B=!y&&R&&!F,O=!y&&F,Z=!y,D=!y&&(m||h),_=!y,$=Boolean((null===(o=b.webPage)||void 0===o?void 0:o.document)||(null===(d=b.webPage)||void 0===d?void 0:d.video)||(null===(a=b.webPage)||void 0===a?void 0:a.photo)||b.audio||b.voice||b.photo||b.video||b.document||b.sticker);return{noOptions:[w,N,E,P,k,A,T,L,B,O,Z,D,_,$].every((e=>!e)),canReply:w,canEdit:N,canPin:E,canUnpin:P,canReport:k,canDelete:A,canDeleteForAll:T,canForward:L,canFaveSticker:B,canUnfaveSticker:O,canCopy:Z,canCopyLink:D,canSelect:_,canDownload:$}}function ue(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=P(e)||{},o=n&&A(e,n);if(!o||!t||!r)return{};const d=t.map((t=>o[t]&&ae(e,o[t],r))).filter(Boolean);return{canDelete:d.every((e=>e.canDelete)),canDeleteForAll:d.every((e=>e.canDeleteForAll))}}function se(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=P(e)||{},o=n&&A(e,n);return!!(o&&t&&r)&&t.map((t=>o[t]&&ae(e,o[t],r))).filter(Boolean).every((e=>e.canReport))}function ie(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=P(e)||{},o=n&&A(e,n);return!!(o&&t&&r)&&t.map((t=>o[t]&&ae(e,o[t],r))).filter(Boolean).some((e=>e.canDownload))}function ce(e,t){const n=e.activeDownloads.byChatId[t.chatId];return!!n&&n.includes(t.id)}function le(e,t){return e.activeDownloads.byChatId[t]||E.D}function fe(e,t){var n;return null===(n=e.fileUploads.byMessageLocalId[t.previousLocalId||t.id])||void 0===n?void 0:n.progress}function he(e,t,n){if(n===d._f){const n=(0,u.Z1)(e,t);if(!n)return;if(!n.lastReadInboxMessageId)return;return n.lastMessage?(0,i.CI)(n.lastMessage)?n.lastMessage.id:Math.min(n.lastMessage.id,n.lastReadInboxMessageId):n.lastReadInboxMessageId}{const r=j(e,t,n);if(!r)return;return r.lastReadInboxMessageId?Math.min(r.lastReadInboxMessageId,r.lastMessageId||1/0):r.topMessageId}}function me(e,t,n){const r=(0,u.Z1)(e,t);if(n===d._f){if(!r)return}else{const r=j(e,t,n);if(!r||void 0!==r.lastMessageId&&r.lastMessageId===r.lastReadInboxMessageId)return}const o=L(e,t,n),s=N(e,t,n),i=A(e,t);if(!i||!o&&!s)return;const c=he(e,t,n);if(!c&&r&&r.isNotJoined)return;const l=t===a.aw?e.serviceNotifications.reduce(((e,t)=>!t.isUnread&&t.id>e?t.id:e),-1):-1;function f(e){return e.find((e=>(!c||e>c)&&i[e]&&(!i[e].isOutgoing||i[e].isFromScheduled)&&e>l))}if(o){const e=f(o);if(e)return e}if(s){const e=f(s);if(e)return e}}function pe(e){const{forwardMessages:t}=e;return Boolean(t.isModalShown)}function ge(e,t){const n=Object.values(e.chats.byId).find((e=>(0,i.Ru)(e)&&e.lastMessage&&e.lastMessage.id===t));if(n)return n.id;const{byChatId:r}=e.messages;return Object.keys(r).find((n=>{const o=(0,u.Z1)(e,n);return o&&(0,i.Ru)(o)&&r[o.id].byId[t]}))}function ve(e){const{selectedMessages:t}=e;return Boolean(t)}function ye(e,t){const{messageIds:n}=e.selectedMessages||{};return!!n&&n.includes(t)}function be(e,t,n){const r=A(e,t);if(r)return Object.values(r).filter((e=>e.groupedId===n&&e.forwardInfo)).map((e=>{let{forwardInfo:t}=e;return t.fromMessageId}))}function Ie(e,t,n){const r=A(e,t);if(r)return Object.keys(r).map(Number).filter((e=>r[e].groupedId===n))}function we(e,t,n){const{messageIds:r}=e.selectedMessages||{};if(!r)return!1;const o=Ie(e,t,n);return o&&o.every((e=>r.includes(e)))}function Ce(e){const{messageIds:t}=e.selectedMessages||{};return t?t.length:0}function Se(e,t){const n=(0,u.Z1)(e,t);if(!n)return;if(!(0,u.xo)(e,n))return;const r=A(e,t),o=F(e,t,d._f);if(!r||!o)return;const a=(0,c.dF)(o,(e=>!r[e].isOutgoing&&Boolean(r[e].keyboardButtons))),s=(0,c.dF)(o,(e=>Boolean(r[e].shouldHideKeyboardButtons)));return a&&s&&s>a?void 0:a?r[a]:void 0}function Ee(e,t){const n=(0,u.Z1)(e,t.chatId);if(!n)return;const r=oe(e,t),o=Boolean((0,i.O$)(t)||(0,i.F$)(t)),d=Boolean((0,i.b7)(t)||(0,i.Cg)(t)),a=Boolean((0,i.oP)(t)||(0,i.kd)(t)||(0,i.aE)(t)),{canAutoLoadPhotoFromContacts:s,canAutoLoadPhotoInPrivateChats:c,canAutoLoadPhotoInGroups:l,canAutoLoadPhotoInChannels:f,canAutoLoadVideoFromContacts:h,canAutoLoadVideoInPrivateChats:m,canAutoLoadVideoInGroups:p,canAutoLoadVideoInChannels:g,canAutoLoadFileFromContacts:v,canAutoLoadFileInPrivateChats:y,canAutoLoadFileInGroups:b,canAutoLoadFileInChannels:I}=e.settings.byKey;return o?Pe({global:e,chat:n,sender:r,canAutoLoadMediaFromContacts:s,canAutoLoadMediaInPrivateChats:c,canAutoLoadMediaInGroups:l,canAutoLoadMediaInChannels:f}):d?Pe({global:e,chat:n,sender:r,canAutoLoadMediaFromContacts:h,canAutoLoadMediaInPrivateChats:m,canAutoLoadMediaInGroups:p,canAutoLoadMediaInChannels:g}):!a||Pe({global:e,chat:n,sender:r,canAutoLoadMediaFromContacts:v,canAutoLoadMediaInPrivateChats:y,canAutoLoadMediaInGroups:b,canAutoLoadMediaInChannels:I})}function Pe(e){let{global:t,chat:n,sender:r,canAutoLoadMediaFromContacts:o,canAutoLoadMediaInPrivateChats:d,canAutoLoadMediaInGroups:a,canAutoLoadMediaInChannels:u}=e;const c=Boolean(r&&(r.id===t.currentUserId||(0,s.nM)(t,r)));return Boolean(c&&o||!c&&d&&(0,i.YC)(n.id)||a&&(0,i.Bf)(n)||u&&(0,i.eA)(n))}function Me(e,t){const n=(0,i.b7)(t)||(0,i.Cg)(t);if(!n)return;const{canAutoPlayVideos:r,canAutoPlayGifs:o}=e.settings.byKey,d=n.isGif||n.isRound;return r&&!d||o&&d}function Ae(e){return e.settings.byKey.shouldLoopStickers}function ke(e){const{serviceNotifications:t}=e,n=Math.max(...t.map((e=>{let{id:t}=e;return t})));return t.find((e=>{let{id:t}=e;return t===n}))}function Te(e,t){var n;return!!t&&(t.isProtected||(null===(n=(0,u.Z1)(e,t.chatId))||void 0===n?void 0:n.isProtected))}function Ne(e,t,n){var r;if(null!==(r=(0,u.Z1)(e,t))&&void 0!==r&&r.isProtected)return!0;if(!n)return!1;const o=A(e,t);return n.some((e=>{var t;return null===(t=o[e])||void 0===t?void 0:t.isProtected}))}function Le(e,t){const n=(0,u.Z1)(e,t),r=n&&(0,i.eA)(n)?e.messages.sponsoredByChatId[t]:void 0;return r&&r.expiresAt>=Math.round(Date.now()/1e3)?r:void 0}function Re(e,t){var n,r,o;if(t===a.aw)return;const d=(0,i.YC)(t),s=null===(n=e.appConfig)||void 0===n?void 0:n.defaultReaction,{availableReactions:c}=e;if(!s||null==c||!c.some((e=>e.reaction===s&&!e.isInactive)))return;if(d)return s;const l=null===(r=(0,u.Z1)(e,t))||void 0===r||null===(o=r.fullInfo)||void 0===o?void 0:o.enabledReactions;return null!=l&&l.includes(s)?s:void 0}function Fe(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;const r=T(e,t,n,"viewportIds");return r?r.map((n=>{const{senderId:r}=J(e,t,n)||{};return r?(0,s.dy)(e,r):void 0})).filter(Boolean):void 0}function xe(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;const r=(0,i.uw)(t,n),o=e.localTextSearch.byChatThreadKey[r];return o&&o.isActive?o:void 0}function Be(e){const{chatId:t}=P(e)||{};if(t)return e.localMediaSearch.byChatId[t]}function Oe(e,t){return e.management.byChatId[t]}function Ze(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;if((0,i.YC)(t))return"user";const r=(0,u.Z1)(e,t);return r?(0,i.Bf)(r)?"group":"channel":void 0}function De(e){const{mediaViewer:t}=e;return Boolean(t.messageId||t.avatarOwnerId)}function _e(e){return function(e){const{pollResults:t}=e;return Boolean(t.messageId)}(e)?r.qt.PollResults:!o.wB&&xe(e)?r.qt.Search:function(e){const{chatId:t,threadId:n}=P(e)||{};if(!t||!n)return;const r=e.management.byChatId[t];return r&&r.isActive?r:void 0}(e)?r.qt.Management:void 0!==l(e).query?r.qt.StickerSearch:void 0!==f(e).query?r.qt.GifSearch:e.newChatMembersProgress!==r.WB.Closed?r.qt.AddingMembers:e.isChatInfoShown&&P(e)?r.qt.ChatInfo:void 0}function $e(e){return void 0!==_e(e)}function Ue(e){const{theme:t,shouldUseSystemTheme:n}=e.settings.byKey;return n?(0,o.vn)():t}function je(e){return e.globalSearch.query}function We(e){return e.payment.chatId}function Ve(e){return e.payment.messageId}function Ge(e){return e.payment.formId}function He(e){return e.payment.requestId}function ze(e){var t;return null===(t=e.payment.nativeParams)||void 0===t?void 0:t.publishableKey}function Qe(e){var t;return null===(t=e.payment.nativeParams)||void 0===t?void 0:t.publicToken}function Ke(e){return e.payment.stripeCredentials}function Je(e){return e.payment.smartGlocalCredentials}function qe(e){return e.settings.byKey}function Ye(e){return e.settings.notifyExceptions}},6376:(e,t,n)=>{function r(e,t){return e.users.byId[t]}function o(e,t){return e.users.statusesById[t]}function d(e,t){var n;const o=r(e,t);return null==o||null===(n=o.fullInfo)||void 0===n?void 0:n.isBlocked}function a(e,t){return e.contactList&&e.contactList.userIds.includes(t.id)}n.d(t,{dy:()=>r,ss:()=>o,s4:()=>d,nM:()=>a})},1713:(e,t,n)=>{let r,o,d,a,u,s,i,c,l,f,h,m,p,g;n.d(t,{Uq:()=>r,fo:()=>o,MT:()=>d,du:()=>a,nJ:()=>u,qt:()=>s,bZ:()=>i,Cr:()=>c,Nh:()=>l,rN:()=>f,wv:()=>h,WB:()=>m,vi:()=>p,KB:()=>g,mp:()=>v,u1:()=>y}),function(e){e[e.Backwards=0]="Backwards",e[e.Forwards=1]="Forwards",e[e.Around=2]="Around"}(r||(r={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Static=2]="Static"}(o||(o={})),function(e){e[e.Main=0]="Main",e[e.EditProfile=1]="EditProfile",e[e.Notifications=2]="Notifications",e[e.DataStorage=3]="DataStorage",e[e.Language=4]="Language",e[e.General=5]="General",e[e.GeneralChatBackground=6]="GeneralChatBackground",e[e.GeneralChatBackgroundColor=7]="GeneralChatBackgroundColor",e[e.Privacy=8]="Privacy",e[e.PrivacyPhoneNumber=9]="PrivacyPhoneNumber",e[e.PrivacyLastSeen=10]="PrivacyLastSeen",e[e.PrivacyProfilePhoto=11]="PrivacyProfilePhoto",e[e.PrivacyForwarding=12]="PrivacyForwarding",e[e.PrivacyGroupChats=13]="PrivacyGroupChats",e[e.PrivacyPhoneNumberAllowedContacts=14]="PrivacyPhoneNumberAllowedContacts",e[e.PrivacyPhoneNumberDeniedContacts=15]="PrivacyPhoneNumberDeniedContacts",e[e.PrivacyLastSeenAllowedContacts=16]="PrivacyLastSeenAllowedContacts",e[e.PrivacyLastSeenDeniedContacts=17]="PrivacyLastSeenDeniedContacts",e[e.PrivacyProfilePhotoAllowedContacts=18]="PrivacyProfilePhotoAllowedContacts",e[e.PrivacyProfilePhotoDeniedContacts=19]="PrivacyProfilePhotoDeniedContacts",e[e.PrivacyForwardingAllowedContacts=20]="PrivacyForwardingAllowedContacts",e[e.PrivacyForwardingDeniedContacts=21]="PrivacyForwardingDeniedContacts",e[e.PrivacyGroupChatsAllowedContacts=22]="PrivacyGroupChatsAllowedContacts",e[e.PrivacyGroupChatsDeniedContacts=23]="PrivacyGroupChatsDeniedContacts",e[e.PrivacyActiveSessions=24]="PrivacyActiveSessions",e[e.PrivacyBlockedUsers=25]="PrivacyBlockedUsers",e[e.Folders=26]="Folders",e[e.FoldersCreateFolder=27]="FoldersCreateFolder",e[e.FoldersEditFolder=28]="FoldersEditFolder",e[e.FoldersEditFolderFromChatList=29]="FoldersEditFolderFromChatList",e[e.FoldersIncludedChats=30]="FoldersIncludedChats",e[e.FoldersIncludedChatsFromChatList=31]="FoldersIncludedChatsFromChatList",e[e.FoldersExcludedChats=32]="FoldersExcludedChats",e[e.FoldersExcludedChatsFromChatList=33]="FoldersExcludedChatsFromChatList",e[e.TwoFaDisabled=34]="TwoFaDisabled",e[e.TwoFaNewPassword=35]="TwoFaNewPassword",e[e.TwoFaNewPasswordConfirm=36]="TwoFaNewPasswordConfirm",e[e.TwoFaNewPasswordHint=37]="TwoFaNewPasswordHint",e[e.TwoFaNewPasswordEmail=38]="TwoFaNewPasswordEmail",e[e.TwoFaNewPasswordEmailCode=39]="TwoFaNewPasswordEmailCode",e[e.TwoFaEnabled=40]="TwoFaEnabled",e[e.TwoFaChangePasswordCurrent=41]="TwoFaChangePasswordCurrent",e[e.TwoFaChangePasswordNew=42]="TwoFaChangePasswordNew",e[e.TwoFaChangePasswordConfirm=43]="TwoFaChangePasswordConfirm",e[e.TwoFaChangePasswordHint=44]="TwoFaChangePasswordHint",e[e.TwoFaTurnOff=45]="TwoFaTurnOff",e[e.TwoFaRecoveryEmailCurrentPassword=46]="TwoFaRecoveryEmailCurrentPassword",e[e.TwoFaRecoveryEmail=47]="TwoFaRecoveryEmail",e[e.TwoFaRecoveryEmailCode=48]="TwoFaRecoveryEmailCode",e[e.TwoFaCongratulations=49]="TwoFaCongratulations",e[e.QuickReaction=50]="QuickReaction"}(d||(d={})),function(e){e[e.ChatList=0]="ChatList",e[e.GlobalSearch=1]="GlobalSearch",e[e.Settings=2]="Settings",e[e.Contacts=3]="Contacts",e[e.Archived=4]="Archived",e[e.NewChannelStep1=5]="NewChannelStep1",e[e.NewChannelStep2=6]="NewChannelStep2",e[e.NewGroupStep1=7]="NewGroupStep1",e[e.NewGroupStep2=8]="NewGroupStep2"}(a||(a={})),function(e){e[e.ChatList=0]="ChatList",e[e.Media=1]="Media",e[e.Links=2]="Links",e[e.Files=3]="Files",e[e.Music=4]="Music",e[e.Voice=5]="Voice"}(u||(u={})),function(e){e[e.ChatInfo=0]="ChatInfo",e[e.Search=1]="Search",e[e.Management=2]="Management",e[e.StickerSearch=3]="StickerSearch",e[e.GifSearch=4]="GifSearch",e[e.PollResults=5]="PollResults",e[e.AddingMembers=6]="AddingMembers"}(s||(s={})),function(e){e[e.Inline=0]="Inline",e[e.ScheduledInline=1]="ScheduledInline",e[e.SharedMedia=2]="SharedMedia",e[e.ProfileAvatar=3]="ProfileAvatar",e[e.SettingsAvatar=4]="SettingsAvatar",e[e.MiddleHeaderAvatar=5]="MiddleHeaderAvatar",e[e.Album=6]="Album",e[e.ScheduledAlbum=7]="ScheduledAlbum",e[e.SearchResult=8]="SearchResult"}(i||(i={})),function(e){e[e.Inline=0]="Inline",e[e.SharedMedia=1]="SharedMedia",e[e.Search=2]="Search"}(c||(c={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(l||(l={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(f||(f={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(h||(h={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Loading=2]="Loading"}(m||(m={})),function(e){e[e.Profile=0]="Profile",e[e.SharedMedia=1]="SharedMedia",e[e.MemberList=2]="MemberList"}(p||(p={})),function(e){e[e.ShippingInfo=0]="ShippingInfo",e[e.Shipping=1]="Shipping",e[e.PaymentInfo=2]="PaymentInfo",e[e.Checkout=3]="Checkout",e[e.ConfirmPayment=4]="ConfirmPayment"}(g||(g={}));const v="UPLOADING_WALLPAPER_SLUG";let y;!function(e){e[e.Initial=0]="Initial",e[e.ChatPrivacyType=1]="ChatPrivacyType",e[e.Discussion=2]="Discussion",e[e.ChannelSubscribers=3]="ChannelSubscribers",e[e.GroupType=4]="GroupType",e[e.GroupPermissions=5]="GroupPermissions",e[e.GroupRemovedUsers=6]="GroupRemovedUsers",e[e.ChannelRemovedUsers=7]="ChannelRemovedUsers",e[e.GroupUserPermissionsCreate=8]="GroupUserPermissionsCreate",e[e.GroupUserPermissions=9]="GroupUserPermissions",e[e.ChatAdministrators=10]="ChatAdministrators",e[e.GroupRecentActions=11]="GroupRecentActions",e[e.ChatAdminRights=12]="ChatAdminRights",e[e.ChatNewAdminRights=13]="ChatNewAdminRights",e[e.GroupMembers=14]="GroupMembers",e[e.GroupAddAdmins=15]="GroupAddAdmins",e[e.Invites=16]="Invites",e[e.EditInvite=17]="EditInvite",e[e.Reactions=18]="Reactions",e[e.InviteInfo=19]="InviteInfo",e[e.JoinRequests=20]="JoinRequests"}(y||(y={}))},9933:(e,t,n)=>{n.d(t,{cK:()=>d,jt:()=>a,M8:()=>u,vr:()=>s});var r=n(9118);let o;function d(e,t){t||(o&&!o.isCancelled&&(o.isCancelled=!0),o=t={isCancelled:!1}),!t.isCancelled&&e()&&(0,r.T2)((()=>{d(e,t)}))}function a(e){e()&&(0,r.T2)((()=>{a(e)}))}const u={linear:e=>e,easeIn:e=>e**1.675,easeOut:e=>1-(1-e**1.675),easeInOut:e=>.5*(Math.sin((e-.5)*Math.PI)+1),easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};function s(e){let{timing:t=u.linear,onUpdate:n,duration:r,onEnd:o,from:d,to:s}=e;const i=Date.now();let c=!1;return a((()=>{if(c)return!1;let e=(Date.now()-i)/r;e>1&&(e=1);const a=t(e);if("number"==typeof d&&"number"==typeof s)n(d+(s-d)*a);else if(Array.isArray(d)&&Array.isArray(s)){const e=d.map(((e,t)=>e+(s[t]-e)*a));n(e)}return 1===e&&o&&o(),e<1})),()=>{c=!0,o&&o()}}},7358:(e,t,n)=>{n.d(t,{w:()=>o});var r=n(3716);function o(e){"function"==typeof window.navigator.setAppBadge&&window.navigator.setAppBadge(e).catch((e=>{r.eM&&console.error(e)}))}},275:(e,t,n)=>{function r(e,t){if(e===t)return!0;const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;if(0===r)return!0;for(let o=0;o(e[r]!==t[r]&&n.push(`${r}: ${e[r]} => ${t[r]}`),n)),[])}n.d(t,{Z:()=>r,c:()=>o})},6752:(e,t,n)=>{function r(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),d=1;d(t&&(Array.isArray(t)?e.push(...t):e.push(`${n}--${t}`)),e)),[n]).join(" ")}}n.d(t,{Z:()=>r,y:()=>o})},9524:(e,t,n)=>{n.d(t,{Type:()=>o,fetch:()=>d,save:()=>a,clear:()=>u});const r=self.caches;let o;async function d(e,t,n){let d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(r)try{const a=new Request(t.replace(/:/g,"_")),u=await r.open(e),s=await u.match(a);if(!s)return;const i=s.headers.get("Content-Type");switch(n){case o.Text:return await s.text();case o.Blob:{if(t.startsWith("avatar")&&i&&i.startsWith("text"))return;const e=await s.blob(),n=!e.type||!d&&e.type.includes("html");let r=e.type||i;return n&&r?(d||(r=r.replace(/html/gi,"")),new Blob([e],{type:r})):e}case o.Json:return await s.json();default:return}}catch(e){return void console.warn(e)}}async function a(e,t,n){if(r)try{const o="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),d=new Request(t.replace(/:/g,"_")),a=new Response(o),u=await r.open(e);return await u.put(d,a)}catch(e){return void console.warn(e)}}async function u(e){try{if(!r)return;return await r.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json"}(o||(o={}))},6063:(e,t,n)=>{function r(){const e=[];function t(t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}return{runCallbacks:function(){for(var t=arguments.length,n=new Array(t),r=0;r{e(...n)}))},addCallback:function(n){return e.push(n),()=>{t(n)}},removeCallback:t,hasCallbacks:function(){return Boolean(e.length)}}}n.d(t,{_:()=>r})},3989:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(517);function o(e){return(0,r.Z)({onEsc:e})}},517:(e,t,n)=>{n.d(t,{Z:()=>d});const r={Enter:"onEnter",Backspace:"onBackspace",Delete:"onDelete",Esc:"onEsc",Escape:"onEsc",ArrowUp:"onUp",ArrowDown:"onDown",ArrowLeft:"onLeft",ArrowRight:"onRight",Tab:"onTab"},o={onEnter:[],onDelete:[],onBackspace:[],onEsc:[],onUp:[],onDown:[],onLeft:[],onRight:[],onTab:[]};function d(e){return a()||document.addEventListener("keydown",u,!0),Object.keys(e).forEach((t=>{const n=e[t];if(!n)return;const r=o[t];r&&r.push(n)})),()=>{!function(e){Object.keys(e).forEach((t=>{const n=e[t],r=o[t];if(r){const e=r.findIndex((e=>e===n));-1!==e&&r.splice(e,1)}})),a()||document.removeEventListener("keydown",u,!1)}(e)}}function a(){return Object.values(o).some((e=>Boolean(e.length)))}function u(e){const t=r[e.key];if(!t)return;const{length:n}=o[t];n&&(e.stopPropagation(),(0,o[t][n-1])(e))}},790:(e,t,n)=>{n.d(t,{xR:()=>a,zk:()=>u,$Y:()=>s,_F:()=>i,kj:()=>c,mr:()=>f,VX:()=>h,Tu:()=>m,np:()=>p,D:()=>g,j1:()=>v,ZK:()=>b,k9:()=>I,rM:()=>w,xH:()=>C,SA:()=>S,xk:()=>P,IS:()=>M});const r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],d=o.map((e=>e.toLowerCase())),a=864e5;function u(e){return s(new Date)===s(e)}function s(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function i(e){return s(e).getTime()}function c(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${t.getMonth()}`}function l(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function f(e,t){const n="number"==typeof t?new Date(t):t,r=e.timeFormat||"24h";let o=n.getHours(),d="";return"12h"===r&&(d=o>=12?" PM":" AM",o=o>12?o%12:o),`${String(o).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}${d}`}function h(e,t){const n="number"==typeof t?new Date(t):t,o=s(new Date);if(n>=o)return f(e,n);const d=new Date(o);if(d.setDate(o.getDate()-7),n>=d)return e(`Weekday.Short${r[n.getDay()]}`);const a=n.getFullYear()!==o.getFullYear(),u=e(a?"formatDateScheduleYear":"formatDateSchedule")||(a?"d MMM yyyy":"d MMM");return y(e,n,u)}function m(e,t){const n="number"==typeof t?new Date(t):t,r=e("formatterYearMax")||"dd.MM.yyyy";return y(e,n,r)}function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e(n?"formatterMonthYear2":"formatterMonthYear")||"MMM yyyy";return y(e,t,r)}function g(e,t){const n=Math.floor(t/a);return t<0?0:n<1?I(t/1e3):n<7?e("Days",n):n<30?e("Weeks",Math.floor(n/7)):n<365?e("Months",Math.floor(n/30)):e("Years",Math.floor(n/365))}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=arguments.length>4?arguments[4]:void 0;const a="number"==typeof t?new Date(t):t,u=s(new Date);if(!o){if(l(a)===l(u))return(d||!n?k:A)(e("Weekday.Today"));const t=new Date(u);if(t.setDate(u.getDate()-1),l(a)===l(t))return(d||!n?k:A)(e("Weekday.Yesterday"));const o=new Date(u),s=new Date(u);if(o.setDate(u.getDate()-7),s.setDate(u.getDate()+7),a>=o&&a<=s){const t=r[a.getDay()];return(d||!n?k:A)(e(n?`Weekday.Short${t}`:`Weekday.${t}`))}}const i=a.getFullYear()!==u.getFullYear(),c=n?i?"formatDateScheduleYear":"formatDateSchedule":i?"chatFullDate":"chatDate",f=e(c)||"d MMMM yyyy";return(d||!n?k:A)(y(e,a,f))}function y(e,t,n){const r=t.getDate(),d=t.getMonth();return n.replace("LLLL",e(o[d])).replace("MMMM",e(`Month.Gen${o[d]}`)).replace("MMM",e(`Month.Short${o[d]}`)).replace("MM",String(d+1).padStart(2,"0")).replace("dd",String(r).padStart(2,"0")).replace("d",String(r)).replace("yyyy",String(t.getFullYear())).replace(/'de'/g,"de")}function b(e,t,n){const r="number"==typeof t?new Date(t):t;return`${v(e,r,!0,void 0,n)}, ${f(e,r)}`}function I(e,t){const n=Math.floor(e/3600),r=Math.floor(e%3600/60),o=Math.floor(e%3600%60),d=t?Math.floor(t/3600):0,a=t?Math.floor(t%3600/60):0;let u="";return n>0||d>0?(u+=`${String(n).padStart(2,"0")}:`,u+=`${String(r).padStart(2,"0")}:`):u+=a>=10?`${String(r).padStart(2,"0")}:`:`${String(r)}:`,u+=String(o).padStart(2,"0"),u}function w(e){const t=[];let n=e%1e3;e-=n,n=Math.floor(n/10);const r=(e=Math.floor(e/1e3))%60;e-=r;const o=(e=Math.floor(e/60))%60;e-=o;const d=(e=Math.floor(e/60))%60;return d>0&&t.push(String(d).padStart(2,"0")),t.push(String(o).padStart(d>0?2:1,"0")),t.push(String(r).padStart(2,"0")),`${t.join(":")},${String(n).padStart(2,"0")}`}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";const n="number"==typeof e?new Date(e):e;return n.toLocaleString(t,{year:"numeric",month:"short",day:"numeric"})}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";const n="number"==typeof e?new Date(e):e;return n.toLocaleString(t,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}function E(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2021;if(t>11||e>31)return!1;const r=new Date(n,t,e);return!Number.isNaN(r.getTime())&&r.getDate()===e}function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=e.match(/\d{1,2}\s[a-zA-Z]{3,}/),n=e.match(/[a-zA-Z]{3,}\s\d{1,2}/),r=e.match(/\d{1,2}[./-]\d{1,2}([./-]\d{2,4})?/);if(!t&&!r&&!n)return;if(r){const[t,n,r]=e.split(/[./-]/).map(Number);return r&&r<2015||!E(t,n-1,r||void 0)?void 0:`${r?`${r}-`:""}${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}`}const o=e.split(" "),a=t?o[0]:o[1],u=(t?o[1]:o[0]).toLowerCase(),s=d.findIndex((e=>e.startsWith(u)));return-1!==s&&E(Number(a),s)?`${String(s+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`:void 0}function M(e){return e+a/1e3}function A(e){return`${e[0].toLowerCase()}${e.slice(1)}`}function k(e){return`${e[0].toUpperCase()}${e.slice(1)}`}},4284:(e,t,n)=>{n.d(t,{g6:()=>u,U_:()=>s,NM:()=>i,Wg:()=>c});var r=n(3681);const o=["female_sign","male_sign","medical_symbol"],d=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️‍🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f/gu,"🏳️‍⚧️"],[/\u{1f937}\u200d\u2642[^\ufe0f]/gu,"🤷‍♂️"]];function a(e){const t=e.split("-").map((e=>parseInt(e,16)));return String.fromCodePoint(...t)}function u(e){if(!e.match(r.Z))return e;for(const[t,n]of d)e=e.replace(t,n);return e}function s(e){let t;if(1===e.length)t=e.charCodeAt(0).toString(16).padStart(4,"0");else{const n=[];for(let t=0;t=55296&&e.charCodeAt(t)<=56319?e.charCodeAt(t+1)>=56320&&e.charCodeAt(t+1)<=57343&&n.push(1024*(e.charCodeAt(t)-55296)+(e.charCodeAt(t+1)-56320)+65536):(e.charCodeAt(t)<55296||e.charCodeAt(t)>57343)&&n.push(e.charCodeAt(t));t=n.map((e=>e.toString(16).padStart(4,"0"))).join("-")}return t}function i(e){const t={categories:[],emojis:{}};for(let n=0;ne.codePointAt(0)+127397));return String.fromCodePoint(...n)}},1396:(e,t,n)=>{function r(e){if(e)return e.includes("://")?e:`http://${e}`}n.d(t,{X:()=>r})},7361:(e,t,n)=>{n.d(t,{Bi:()=>k,cL:()=>F,wZ:()=>p,vX:()=>M,FW:()=>B,op:()=>C,cj:()=>m,jm:()=>h,pA:()=>L,m5:()=>P,I_:()=>E,fl:()=>v,t0:()=>A,s$:()=>g,i4:()=>O,Mc:()=>S,wB:()=>b,p7:()=>I,$b:()=>y,mh:()=>w,Hh:()=>R,s0:()=>T,aZ:()=>x,gZ:()=>Z,Lt:()=>f,vn:()=>i,on:()=>d});var r=n(3716);let o;function d(){return Boolean(o)}var a,u;new Promise((e=>{const t=new Image;t.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA";const n=()=>{e(2===t.height)};t.onload=n,t.onerror=n})).then((e=>{o=e}));let s=null!==(a=(u=window).matchMedia)&&void 0!==a&&a.call(u,"(prefers-color-scheme: dark)").matches?"dark":"light";function i(){return s}function c(e){s=e.matches?"dark":"light"}const l=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof l.addEventListener?l.addEventListener("change",c):"function"==typeof l.addListener&&l.addListener(c);const f=function(){const{userAgent:e,platform:t}=window.navigator;let n;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?n="macOS":-1!==["iPhone","iPad","iPod"].indexOf(t)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?n="Windows":/Android/.test(e)?n="Android":/Linux/.test(t)&&(n="Linux"),n}(),h="macOS"===f,m="iOS"===f,p="Android"===f,g=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),v=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"),y=window.matchMedia("(pointer: coarse)").matches,b=window.innerWidth<=r.l3||window.innerWidth<=r.u_&&window.innerHeight<=r.rO,I=!b&&window.innerWidth<=r.ks,w=Boolean(navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&(window.AudioContext||window.webkitAudioContext)),C=(document.documentElement.style,f&&(h||m)),S="serviceWorker"in navigator,E=S,P=(window,Boolean((new Audio).canPlayType("audio/ogg; codecs=opus"))),M=!r.Cg&&"filter"in(document.createElement("canvas").getContext("2d")||{}),A="requestFullscreen"in document.createElement("div"),k=!navigator.userAgent.includes("Firefox"),T=p?"slide-fade":m?"slide-layers":"push-slide",N=document.createElement("video"),L=!0;L&&r.wG.add(r.Ng);const R=Boolean(N.canPlayType('video/webm; codecs="vp9"').replace("no",""))&&!(h&&g),F=window.devicePixelRatio||1,x=!0,B=!y,O=!h&&!m&&!p,Z=O?300:750},1394:(e,t,n)=>{n.d(t,{A9:()=>d,YJ:()=>a,hl:()=>u,pt:()=>s,jj:()=>i,ud:()=>c,gm:()=>l,dc:()=>f,ao:()=>h});var r=n(9118);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let o=r.length;const d=new Uint8Array(o);for(;o--;)d[o]=r.charCodeAt(o);return new Blob([d],{type:n})}function a(e){return new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{const{result:r}=e.target||{};"string"==typeof r&&t(r),n(new Error("Failed to read blob"))},r.onerror=n,r.readAsDataURL(e)}))}function u(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}function s(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=n,r.src=e}))}function i(e){return new Promise(((t,n)=>{const r=document.createElement("video");r.volume=0,r.onloadedmetadata=()=>t(r),r.onerror=n,r.src=e}))}async function c(e){const t=await i(e);return Promise.race([(0,r.wO)(2e3),new Promise(((e,n)=>{t.onseeked=()=>{t.videoWidth&&t.videoHeight||e(void 0);const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0),e(n.toDataURL("image/jpeg"))},t.onerror=n,t.currentTime=Math.min(t.duration,1)}))])}async function l(e){return(await fetch(e)).blob()}async function f(e,t){return u(await l(e),t)}function h(e){const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...r}=n;super(e,{type:t}),o(this,"name",void 0),Object.assign(this,r)}else super(e),o(this,"name",void 0);this.name=t}})},6974:(e,t,n)=>{n.d(t,{S1:()=>y,gO:()=>b,aE:()=>I,Yz:()=>w,wC:()=>C,xW:()=>S,M2:()=>E,r_:()=>P,O6:()=>M});var r=n(5116),o=n(3716),d=n(9066),a=n(8415),u=n(9118),s=n(782),i=n(275),c=n(6063);const l=L();let f=l.prevGlobal,h=l.prepared,m=l.results,p=l.callbacks;const g=(0,u.P2)((()=>{(0,u.Q8)((()=>{A((0,r.Rd)())}))}),500);let v=!1;function y(){v=!0,(0,r.ll)(g),(0,r.Q6)("reset",R),A((0,r.Rd)())}function b(e){return v||y(),m.orderedIdsByFolderId[e]}function I(e){return v||y(),m.pinnedCountByFolderId[e]||0}function w(){return v||y(),m.chatsCountByFolderId}function C(){return v||y(),m.unreadCountersByFolderId}function S(){var e;return(null===(e=C()[o.Nf])||void 0===e?void 0:e.notificationsCount)||0}function E(e,t){return p.orderedIdsByFolderId[e]||(p.orderedIdsByFolderId[e]=(0,c._)()),p.orderedIdsByFolderId[e].addCallback(t)}function P(e){return p.chatsCountByFolderId.addCallback(e)}function M(e){return p.unreadCountersByFolderId.addCallback(e)}function A(e){let t;o.eM&&(t=performance.now());const n=Boolean(e.chats.listIds.active&&k(o.Nf,e.chats.listIds.active,e.chats.orderedPinnedIds.active)),r=Boolean(e.chats.listIds.archived&&k(o.WS,e.chats.listIds.archived,e.chats.orderedPinnedIds.archived)),u=e.chats.isFullyLoaded.active!==f.isAllFolderFullyLoaded,c=e.chats.isFullyLoaded.archived!==f.isArchivedFolderFullyLoaded,l=e.chatFolders.byId!==f.foldersById,p=e.chats.byId!==f.chatsById,g=e.users.byId!==f.usersById,v=(0,d.dZ)(e)!==f.notifySettings,y=(0,d.NJ)(e)!==f.notifyExceptions;let b=[];if((u||c)&&(b=b.concat(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];t&&n.push(o.WS);const r=e.chats.isFullyLoaded.active,d=e.chats.isFullyLoaded.archived;if(r&&d){const e=Object.keys(h.folderSummariesById).filter((e=>!m.orderedIdsByFolderId[e])).map(Number);n=n.concat(e)}return f.isAllFolderFullyLoaded=r,f.isArchivedFolderFullyLoaded=d,n}(e,c))),!(n||r||l||p||g||v||y))return void(b.length&&N(b));const I=f.allFolderListIds,w=f.archivedFolderListIds;if(function(e,t,n,r){const d=[];if(t){const t=e.chats.listIds.active,n=e.chats.orderedPinnedIds.active;h.folderSummariesById[o.Nf]=T(o.Nf,t,n),f.allFolderListIds=t,f.allFolderPinnedIds=n,d.push(o.Nf)}if(n){const t=e.chats.listIds.archived,n=e.chats.orderedPinnedIds.archived;h.folderSummariesById[o.WS]=T(o.WS,t,n),f.archivedFolderListIds=t,f.archivedFolderPinnedIds=n,d.push(o.WS)}if(r){const t=e.chatFolders.byId;Object.values(t).forEach((e=>{e!==f.foldersById[e.id]&&(h.folderSummariesById[e.id]=function(e){return{...e,orderedPinnedIds:e.pinnedChatIds,excludedChatIds:e.excludedChatIds?new Set(e.excludedChatIds):void 0,includedChatIds:e.excludedChatIds?new Set(e.includedChatIds):void 0,pinnedChatIds:e.excludedChatIds?new Set(e.pinnedChatIds):void 0}}(e),d.push(e.id))})),f.foldersById=t}}(e,n,r,l),b=b.concat(function(e,t,n,r,u,c){const l=e.chats.byId,p=e.users.byId,g=(0,d.dZ)(e),v=(0,d.NJ)(e),y=Object.values(h.folderSummariesById),b=new Set,I=e.chats.listIds.active,w=e.chats.listIds.archived;let C=[...I||[],...w||[]];return I===u&&w===c||(C=(0,s.Tw)(C.concat(u||[],c||[]))),C.forEach((e=>{const d=l[e];if(!t&&!n&&!r&&d===f.chatsById[e]&&p[e]===f.usersById[e])return;let u;if(d){const n=h.chatSummariesById.get(e),r=function(e,t,n,r){const{id:d,type:u,lastMessage:s,isRestricted:i,isNotJoined:c,folderId:l,unreadCount:f,unreadMentionsCount:h,hasUnreadMark:m,joinDate:p,draftDate:g}=e,v="chatTypePrivate"===u&&r;return{id:d,type:u,isListed:Boolean(s&&!i&&!c),isArchived:l===o.WS,isMuted:(0,a.i4)(e,t,n),isUnread:Boolean(f||h||m),unreadCount:f,unreadMentionsCount:h,order:Math.max(p||0,g||0,(null==s?void 0:s.date)||0),isUserBot:v?"userTypeBot"===v.type:void 0,isUserContact:v?v.isContact:void 0}}(d,g,v,p[e]);if(!t&&n&&(0,i.Z)(r,n))return;h.chatSummariesById.set(e,r),u=function(e,t){return t.reduce(((t,n)=>(function(e,t){var n,r,d;if(!e.isListed)return!1;const{id:a,type:u}=e;if(t.listIds)return!(e.isArchived&&t.id===o.Nf||!e.isArchived&&t.id===o.WS)&&t.listIds.has(a);if(null!==(n=t.excludedChatIds)&&void 0!==n&&n.has(a))return!1;if(null!==(r=t.includedChatIds)&&void 0!==r&&r.has(a))return!0;if(null!==(d=t.pinnedChatIds)&&void 0!==d&&d.has(a))return!0;if(t.excludeArchived&&e.isArchived)return!1;if(t.excludeRead&&!e.isUnread)return!1;if(t.excludeMuted&&e.isMuted&&!e.unreadMentionsCount)return!1;if("chatTypePrivate"===u)if(e.isUserBot){if(t.bots)return!0}else{if(t.contacts&&e.isUserContact)return!0;if(t.nonContacts&&!e.isUserContact)return!0}else{if("chatTypeChannel"===u)return Boolean(t.channels);if("chatTypeBasicGroup"===u||"chatTypeSuperGroup"===u)return Boolean(t.groups)}return!1}(e,n)&&t.push(n.id),t)),[]).sort()}(r,y),u.forEach((e=>{b.add(e)}))}else h.chatSummariesById.delete(e),u=[];const c=h.folderIdsByChatId[e]||[];if((0,s.et)(u,c))return;const I=function(e,t,n){const r=new Set(t),o=new Set(n),d=[];return(0,s.Tw)([...t,...n]).forEach((t=>{let n=m.orderedIdsByFolderId[t];r.has(t)&&!o.has(t)?(h.chatIdsByFolderId[t].delete(e),d.push(t),n&&(n=n.filter((t=>t!==e)),h.isOrderedListJustPatched[t]=!0)):!r.has(t)&&o.has(t)&&(h.chatIdsByFolderId[t]||(h.chatIdsByFolderId[t]=new Set),h.chatIdsByFolderId[t].add(e),n&&(n.push(e),h.isOrderedListJustPatched[t]=!0)),m.orderedIdsByFolderId[t]=n})),h.folderIdsByChatId[e]=n,d}(e,c,u);I.forEach((e=>{b.add(e)}))})),f.chatsById=l,f.usersById=p,f.notifySettings=g,f.notifyExceptions=v,Array.from(b)}(e,l||n||r,v,y,I,w)),N((0,s.Tw)(b)),o.eM){const e=performance.now()-t;e>6&&console.warn(`Slow \`updateFolderManager\`: ${Math.round(e)} ms`)}}function k(e,t,n){const r=e===o.Nf?f.allFolderListIds:f.archivedFolderListIds,d=e===o.Nf?f.allFolderPinnedIds:f.archivedFolderPinnedIds;return r!==t||d!==n}function T(e,t,n){return{id:e,listIds:new Set(t),orderedPinnedIds:n,pinnedChatIds:new Set(n)}}function N(e){let t=!1,n=!1;if(Array.from(e).forEach((e=>{const{pinnedCount:r,orderedIds:o}=function(e){const t=h.folderSummariesById[e];if(!t)return{};const{orderedPinnedIds:n,pinnedChatIds:r}=t,{chatSummariesById:o,chatIdsByFolderId:{[e]:d}}=h,{orderedIdsByFolderId:{[e]:a}}=m,u=d?null==n?void 0:n.filter((e=>d.has(e))):n,s=a||d&&Array.from(d)||[],i=(r?s.filter((e=>!r.has(e))):s).sort(((e,t)=>o.get(t).order-o.get(e).order));return{pinnedCount:(null==u?void 0:u.length)||0,orderedIds:[...u||[],...i]}}(e);if(!o)return;const d=m.orderedIdsByFolderId[e],a=m.pinnedCountByFolderId[e];var u;d&&void 0!==a&&a===r&&!h.isOrderedListJustPatched[e]&&(0,s.et)(o,d)||(h.isOrderedListJustPatched[e]=!1,m.orderedIdsByFolderId[e]=o,m.pinnedCountByFolderId[e]=r,null===(u=p.orderedIdsByFolderId[e])||void 0===u||u.runCallbacks(o));const c=m.chatsCountByFolderId[e],l=o.length;n||(n=c!==l),m.chatsCountByFolderId[e]=l;const f=m.unreadCountersByFolderId[e],g=function(e){const{chatSummariesById:t}=h,{orderedIdsByFolderId:{[e]:n}}=m;return n.reduce(((e,n)=>{const r=t.get(n);return r?(r.isUnread&&(e.chatsCount++,r.unreadMentionsCount&&(e.notificationsCount+=r.unreadMentionsCount),r.isMuted||(r.unreadCount?e.notificationsCount+=r.unreadCount:r.unreadMentionsCount||(e.notificationsCount+=1))),e):e}),{chatsCount:0,notificationsCount:0})}(e);t||(t=!f||!(0,i.Z)(g,f)),m.unreadCountersByFolderId[e]=g})),n){const e={...m.chatsCountByFolderId};m.chatsCountByFolderId=e,p.chatsCountByFolderId.runCallbacks(e)}if(t){const e={...m.unreadCountersByFolderId};m.unreadCountersByFolderId=e,p.unreadCountersByFolderId.runCallbacks(e)}}function L(){return{prevGlobal:{foldersById:{},chatsById:{},usersById:{},notifySettings:{},notifyExceptions:{}},prepared:{folderSummariesById:{},chatSummariesById:new Map,folderIdsByChatId:{},chatIdsByFolderId:{},isOrderedListJustPatched:{}},results:{orderedIdsByFolderId:{},pinnedCountByFolderId:{},chatsCountByFolderId:{},unreadCountersByFolderId:{}},callbacks:{orderedIdsByFolderId:{},chatsCountByFolderId:(0,c._)(),unreadCountersByFolderId:(0,c._)()}}}function R(){const e=L();f=e.prevGlobal,h=e.prepared,m=e.results,p=e.callbacks}},9937:(e,t,n)=>{function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";return new Intl.NumberFormat(n,{style:"currency",currency:t}).format("JPY"===t?e:e/100)}n.d(t,{x:()=>r})},6926:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t}},1947:(e,t,n)=>{n.d(t,{ZP:()=>d,J_:()=>a});const r={CHAT_RESTRICTED:"You can't send messages in this chat, you were restricted",CHAT_WRITE_FORBIDDEN:"You can't write in this chat",CHAT_SEND_POLL_FORBIDDEN:"You can't create polls in this chat",CHAT_SEND_STICKERS_FORBIDDEN:"You can't send stickers in this chat",CHAT_SEND_GIFS_FORBIDDEN:"You can't send gifs in this chat",CHAT_SEND_MEDIA_FORBIDDEN:"You can't send media in this chat",CHAT_LINK_EXISTS:"The chat is public, you can't hide the history to new users",SLOWMODE_WAIT_X:"Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.",USER_BANNED_IN_CHANNEL:"You're banned from sending messages in supergroups / channels",USER_IS_BLOCKED:"You were blocked by this user",YOU_BLOCKED_USER:"You blocked this user",IMAGE_PROCESS_FAILED:"Failure while processing image",MEDIA_EMPTY:"The provided media object is invalid",MEDIA_INVALID:"Media invalid",PHOTO_EXT_INVALID:"The extension of the photo is invalid",PHOTO_INVALID_DIMENSIONS:"The photo dimensions are invalid",PHOTO_SAVE_FILE_INVALID:"Internal issues, try again later",MESSAGE_DELETE_FORBIDDEN:"You can't delete one of the messages you tried to delete, most likely because it is a service message.",MESSAGE_POLL_CLOSED:"Poll closed",MESSAGE_EDIT_TIME_EXPIRED:"You can't edit this message anymore.",CHAT_ADMIN_REQUIRED:"You must be an admin in this chat to do this",PINNED_DIALOGS_TOO_MUCH:"Sorry, you can only pin 5 chats to the top",DIALOG_FILTERS_TOO_MUCH:"Sorry, you can't have more than 10 folders",CHANNEL_PRIVATE:"This channel is private",MEDIA_CAPTION_TOO_LONG:"The provided caption is too long",ADDRESS_STREET_LINE1_INVALID:"The address you provided is not valid",ADDRESS_STREET_LINE2_INVALID:"The address you provided is not valid",ADDRESS_CITY_INVALID:"The city you provided is not valid",ADDRESS_COUNTRY_INVALID:"The country you provided is not valid",ADDRESS_POSTCODE_INVALID:"The postcode you provided is not valid",ADDRESS_STATE_INVALID:"The state you provided is not valid",REQ_INFO_NAME_INVALID:"The name you provided is not valid",REQ_INFO_PHONE_INVALID:"The phone you provided is not valid",REQ_INFO_EMAIL_INVALID:"The email you provided is not valid",LINK_NOT_MODIFIED:"This discussion is already linked to the channel",MESSAGE_TOO_LONG:"Message is too long",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Streaming media may not be supported. Try reloading the page without holding key",MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.",FRESH_RESET_AUTHORISATION_FORBIDDEN:"You can’t logout other sessions if less than 24 hours have passed since you logged on the current session",BOTS_TOO_MUCH:"There are too many bots in this chat/channel",BOT_GROUPS_BLOCKED:"This bot can't be added to groups",USERS_TOO_MUCH:"The maximum number of users has been exceeded",USER_CHANNELS_TOO_MUCH:"One of the users you tried to add is already in too many channels/supergroups",USER_KICKED:"This user was kicked from this supergroup/channel",USER_NOT_MUTUAL_CONTACT:"The provided user is not a mutual contact",USER_PRIVACY_RESTRICTED:"The user's privacy settings do not allow you to do this",INVITE_HASH_EMPTY:"The invite hash is empty",INVITE_HASH_EXPIRED:"The invite link has expired",INVITE_HASH_INVALID:"The invite hash is invalid",CHANNELS_TOO_MUCH:"You have joined too many channels/supergroups",USER_ALREADY_PARTICIPANT:"You already in the group",SCHEDULE_DATE_INVALID:"Invalid schedule date provided",WALLPAPER_DIMENSIONS_INVALID:"The wallpaper dimensions are invalid, please select another file",ADMINS_TOO_MUCH:"There are too many admins",ADMIN_RANK_EMOJI_NOT_ALLOWED:"An admin rank cannot contain emojis",ADMIN_RANK_INVALID:"The specified admin rank is invalid",FRESH_CHANGE_ADMINS_FORBIDDEN:"You were just elected admin, you can't add or modify other admins yet",INPUT_USER_DEACTIVATED:"The specified user was deleted",BOT_PRECHECKOUT_TIMEOUT:"The request for payment has expired"},o={ADDRESS_STREET_LINE1_INVALID:{field:"streetLine1",message:"Incorrect street address"},ADDRESS_STREET_LINE2_INVALID:{field:"streetLine2",message:"Incorrect street address"},ADDRESS_CITY_INVALID:{field:"city",message:"Incorrect city"},ADDRESS_COUNTRY_INVALID:{field:"countryIso2",message:"Incorrect country"},ADDRESS_POSTCODE_INVALID:{field:"postCode",message:"Incorrect post code"},ADDRESS_STATE_INVALID:{field:"state",message:"Incorrect state"},REQ_INFO_NAME_INVALID:{field:"fullName",message:"Incorrect name"},REQ_INFO_PHONE_INVALID:{field:"phone",message:"Incorrect phone"},REQ_INFO_EMAIL_INVALID:{field:"email",message:"Incorrect email"}};function d(e){const{message:t,isSlowMode:n,textParams:o}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let d=r[t];return d&&o&&(d=Object.keys(o).reduce(((e,t)=>e.replace(t,o[t])),d)),d}function a(e){return o[e.message]}},3592:(e,t,n)=>{n.d(t,{S:()=>d}),n(3716);var r=n(9118);function o(e){e instanceof ErrorEvent&&"ResizeObserver loop limit exceeded"===e.message||(e.preventDefault(),d(e instanceof ErrorEvent?e.error||e.message:e.reason))}function d(e){console.error(e)}window.addEventListener("error",o),window.addEventListener("unhandledrejection",o),(0,r.P2)(window.alert,1e3)},782:(e,t,n)=>{function r(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function o(e,t){return Object.keys(e).reduce(((n,r,o)=>(n[r]=t(e[r],r,o,e),n)),{})}function d(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function a(e,t){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}function u(e,t){const n=new Set(t.map(String));return d(e,Object.keys(e).filter((e=>!n.has(e))))}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";function r(e,t,n,r){const o=("function"==typeof n?n(e):e[n])||0,d=("function"==typeof n?n(t):t[n])||0;return r?o-d:d-o}if(Array.isArray(t)){const[o,d]=Array.isArray(n)?n:[n,n],[a,u]=t,s="asc"===o,i="asc"===d;return e.sort(((e,t)=>r(e,t,a,s)||r(e,t,u,i)))}const o="asc"===n;return e.sort(((e,n)=>r(e,n,t,o)))}function i(e){return e.reduce(((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e)),[])}function c(e){return Array.from(new Set(e))}function l(e){return e.filter(Boolean)}function f(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function h(e,t){return e[0]<=t[t.length-1]&&e[e.length-1]>=t[0]}function m(e,t){return e.filter((e=>t.has(e)))}function p(e,t){const n=[];for(let r=0;r(t[n]=g(e[n]),t)),{})}function v(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return e[n]}n.d(t,{ee:()=>r,Q8:()=>o,ei:()=>d,q0:()=>a,CE:()=>u,Xo:()=>s,xH:()=>i,Tw:()=>c,oA:()=>l,et:()=>f,YE:()=>h,eL:()=>m,Vl:()=>p,Xh:()=>g,dF:()=>v})},711:(e,t,n)=>{n.d(t,{ll:()=>p,i0:()=>I,Pn:()=>w,m0:()=>C,qf:()=>S});var r=n(5116),o=n(3716),d=n(9524),a=n(1226),u=n(6063),s=n(2155);const i=/%\d?\$?[sdf@]/g,c=["value","zeroValue","oneValue","twoValue","fewValue","manyValue","otherValue"],l={en:e=>1!==e?6:2,ar:e=>0===e?1:1===e?2:2===e?3:e%100>=3&&e%100<=10?4:e%100>=11?5:6,ca:e=>1!==e?6:2,de:e=>1!==e?6:2,es:e=>1!==e?6:2,fa:e=>e>1?6:2,fr:e=>e>1?6:2,id:()=>0,it:e=>1!==e?6:2,ko:()=>0,ms:()=>0,nl:e=>1!==e?6:2,pl:e=>1===e?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,pt_BR:e=>e>1?6:2,ru:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,tr:e=>e>1?6:2,uk:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,uz:e=>e>1?6:2},f=new Map;let h,m;const{addCallback:p,removeCallback:g,runCallbacks:v}=(0,u._)();let y,b;const I=(e,t,n)=>{var r,o;if(void 0!==t){const r=Array.isArray(t)?JSON.stringify(t):t,o=f.get(`${e}_${r}_${n}`);if(o)return o}if(!h&&!m)return e;const d=(null===(r=h)||void 0===r?void 0:r[e])||(null===(o=m)||void 0===o?void 0:o[e]);return d?M(d,e,t,n):(m||E(),e)};async function w(e,t){let n=await d.fetch(o.ee,`${o.$O}_${e}_${t}`,d.Type.Json);return n||(n=await async function(e,t,n){const r=await(0,a.t9)("fetchLangStrings",{langPack:e,langCode:t,keys:[n]});if(null!=r&&r.length)return await d.save(o.ee,`${e}_${t}_${n}`,r[0]),r[0]}(o.$O,e,t)),M(n,t)}async function C(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(h&&e===y)return void(t&&t());let a=await d.fetch(o.ee,e,d.Type.Json);if(!a&&(n&&await E(),a=await P(e),!a))return;f.clear(),y=e,h=a,document.documentElement.lang=e;const{languages:u,timeFormat:s}=(0,r.Rd)().settings.byKey,i=null==u?void 0:u.find((t=>t.langCode===e));I.isRtl=Boolean(null==i?void 0:i.rtl),I.code=e,I.timeFormat=s,t&&t(),v()}function S(e){e&&e===b||(b=e,I.timeFormat=e,v())}async function E(){m||(m=(await n.e(915).then(n.bind(n,1915))).default,v())}async function P(e){const t=await(0,a.t9)("fetchLangPack",{sourceLangPacks:o.Bg,langCode:e});if(t)return await d.save(o.ee,e,t.langPack),t.langPack}function M(e,t,n,r){const d=e?e["number"==typeof n?function(e){const t=y||o.sR,n=l[t]?l[t](e):0;return c[n]}(n):"value"]:void 0;if(!d||!d.trim()){const e=t.split(".");return e[e.length-1]}if(void 0!==n){const e=function(e,t){t=Array.isArray(t)?t:[t];const n=e.split(i),r=n.shift();return n.reduce(((e,n,r)=>`${e}${String(t[r]||"")}${n}`),r||"")}(d,"i"===r?(0,s.kh)(n):n),o=Array.isArray(n)?JSON.stringify(n):n;return f.set(`${t}_${o}_${r}`,e),e}return d}},647:(e,t,n)=>{n.d(t,{cC:()=>b,he:()=>v,UV:()=>y,Iq:()=>I});var r=n(6137),o=n(3716),d=n(1226),a=n(9524),u=n(1394),s=n(7361);const i=48e3;async function c(e){const t=await new Response(e).arrayBuffer();return new Promise((e=>{const r=new Uint8Array(t);let o=new Worker(new URL(n.p+n.u(745),n.b)),d=new Worker(new URL(n.p+n.u(993),n.b));o.onmessage=e=>{null===e.data?d.postMessage({command:"done"}):d.postMessage({command:"encode",buffers:e.data},e.data.map((e=>{let{buffer:t}=e;return t})))},d.onmessage=t=>{"page"===t.data.message&&(e(new Blob([t.data.page],{type:"audio/wav"})),o.terminate(),o=void 0,d.terminate(),d=void 0)},d.postMessage({command:"init",wavBitDepth:16,wavSampleRate:i}),o.postMessage({command:"init",decoderSampleRate:i,outputBufferSampleRate:i}),o.postMessage({command:"decode",pages:r},[r.buffer])}))}var l=n(862);const f={[r.IU.BlobUrl]:a.Type.Blob,[r.IU.Lottie]:a.Type.Blob,[r.IU.Progressive]:void 0,[r.IU.Stream]:void 0},h=new Map,m=new Map,p=new Map,g=new Map;function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(t===r.IU.Progressive)return s.I_?w(e):v(e,r.IU.BlobUrl,n,d,a);if(!m.has(e)){const r=C(e,t,n).catch((e=>{o.eM&&console.warn(e)})).finally((()=>{m.delete(e),p.delete(e),g.delete(e)}));m.set(e,r)}if(d&&a){let t=p.get(e);t||(t=new Map,p.set(e,t)),t.set(a,d)}return m.get(e)}function y(e){return h.get(e)}function b(e){p.forEach(((t,n)=>{t.forEach((t=>{if(t===e){const e=g.get(n);if(!e)return;(0,d.u3)(e),g.delete(n),p.delete(n)}}))}))}function I(e,t){const n=p.get(e);n&&n.delete(t)}function w(e){const t=`./progressive/${e}`;return h.set(e,t),Promise.resolve(t)}async function C(e,t,n){if(!o.Cy){const r=e.startsWith("avatar")?o.SG:o.lW,d=await a.fetch(r,e,f[t],n);if(d){let t=d;if("audio/ogg"!==d.type||s.m5||(t=await c(t)),"image/webp"===d.type&&!(0,s.on)()&&t){const n=await(0,l._y)(e,t);n&&(t=n)}const n=E(t);return h.set(e,n),n}}if(t===r.IU.Stream){const n=new MediaSource,r=URL.createObjectURL(n);let o=!1;return n.addEventListener("sourceopen",(()=>{if(o)return;o=!0;const r=n.addSourceBuffer("audio/mpeg"),a=S(e,n,r);g.set(e,a),(0,d.t9)("downloadMedia",{url:e,mediaFormat:t},a)})),h.set(e,r),r}const i=S(e);g.set(e,i);const m=await(0,d.t9)("downloadMedia",{url:e,mediaFormat:t,isHtmlAllowed:n},i);if(!m)throw new Error(`Failed to fetch media ${e}`);let{prepared:p,mimeType:v}=m;if("audio/ogg"===v&&!s.m5){const e=await(0,u.gm)(p);URL.revokeObjectURL(p);const t=await c(e);p=E(t),v=t.type}if("image/webp"===v&&!(0,s.on)()){const t=await(0,u.gm)(p);URL.revokeObjectURL(p);const n=await(0,l._y)(e,t);n&&(p=E(n))}return h.set(e,p),p}function S(e,t,n){const r=(o,d)=>{var a;null===(a=p.get(e))||void 0===a||a.forEach((e=>{e(o),e.isCanceled&&(r.isCanceled=!0)})),1===o&&(null==t||t.endOfStream()),d&&(null==n||n.appendBuffer(d))};return r}function E(e){return e instanceof Blob?URL.createObjectURL(e):e}s.I_&&navigator.serviceWorker.addEventListener("message",(async e=>{const{type:t,messageId:n,params:o}=e.data;if("requestPart"!==t)return;const a=await(0,d.t9)("downloadMedia",{mediaFormat:r.IU.Progressive,...o});if(!a)return;const{arrayBuffer:u,mimeType:s,fullSize:i}=a;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:n,result:{arrayBuffer:u,mimeType:s,fullSize:i}},[u])}))},735:(e,t,n)=>{n.d(t,{D:()=>r});const r=[]},9203:(e,t,n)=>{n.d(t,{gl:()=>d,$y:()=>c,o5:()=>l,Qt:()=>f});var r=n(3716),o=n(6063);let d;!function(e){e[e.Auth=0]="Auth",e[e.Main=1]="Main",e[e.Extra=2]="Extra",e[e.Calls=3]="Calls"}(d||(d={}));const a={},u={},{addCallback:s,runCallbacks:i}=(0,o._)();async function c(e,t){if(!a[e]){switch(e){case d.Auth:a[d.Auth]=n.e(133).then(n.bind(n,1133));break;case d.Main:r.eM&&console.log(">>> START LOAD MAIN BUNDLE"),a[d.Main]=Promise.all([n.e(830),n.e(347),n.e(302),n.e(176)]).then(n.bind(n,3176));break;case d.Extra:a[d.Extra]=Promise.all([n.e(830),n.e(347),n.e(687)]).then(n.bind(n,687));break;case d.Calls:a[d.Calls]=Promise.all([n.e(830),n.e(302),n.e(47)]).then(n.bind(n,6628))}a[e].then(i)}const o=await a[e];return u[e]||(u[e]=o),l(e,t)}function l(e,t){const n=u[e];if(n)return n[t]}const f=s},8406:(e,t,n)=>{n.d(t,{q3:()=>y,Nz:()=>b,r1:()=>C,Ld:()=>E,rh:()=>P,Vr:()=>M,KC:()=>A});var r=n(1226),o=n(6137),d=n(8005),a=n(3716),u=n(5116),s=n(8415),i=n(9959),c=n(9066),l=n(7361),f=n(711),h=n(647),m=n(9118);function p(e){const t=e.toJSON();return JSON.stringify({endpoint:t.endpoint,keys:t.keys})}function g(){return!!l.Mc&&("showNotification"in ServiceWorkerRegistration.prototype?"denied"===Notification.permission?(a.eM&&console.warn("[PUSH] The user has blocked push notifications."),!1):"PushManager"in window||(a.eM&&console.warn("[PUSH] Push messaging isn't supported."),!1):(a.eM&&console.warn("[PUSH] Push notifications aren't supported."),!1))}const v=new Set;async function y(e,t){if(void 0!==e&&v.has(e))return;const{notificationSoundVolume:n}=(0,c.dZ)((0,u.Rd)()),r=t?t/10:n/10;if(0===r)return;const o=new Audio("./notification.mp3");o.volume=r,o.setAttribute("mozaudiochannel","notification"),void 0!==e&&(o.addEventListener("ended",(()=>{v.add(e)}),{once:!0}),setTimeout((()=>{v.delete(e)}),3e3));try{await o.play()}catch(e){a.eM&&console.warn("[PUSH] Unable to play notification sound")}}const b=(0,m.Ds)(y,1e3,!0,!1);async function I(){"Notification"in window&&(["granted","denied"].includes(Notification.permission)||await Notification.requestPermission())}async function w(e){const t=(0,u.Rd)(),n=(0,u.uC)();if(e)try{const t=p(e);return await(0,r.t9)("unregisterDevice",t),await e.unsubscribe(),void n.deleteDeviceToken()}catch(e){a.eM&&console.log("[PUSH] Unable to unsubscribe from push.",e)}t.push&&(await(0,r.t9)("unregisterDevice",t.push.deviceToken),n.deleteDeviceToken())}async function C(){if(!g())return;const e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();await w(t)}let S=!1;async function E(){if(!g())return void await I();const e=await navigator.serviceWorker.ready;let t=await e.pushManager.getSubscription();if(function(e){const t=(0,u.Rd)();return!t.push||!e||p(e)!==t.push.deviceToken||Date.now()-t.push.subscribedAt>432e5}(t)){await w(t);try{t=await e.pushManager.subscribe({userVisibleOnly:!0});const n=p(t);a.eM&&console.log("[PUSH] Received push subscription: ",n),await(0,r.t9)("registerDevice",n),(0,u.uC)().setDeviceToken(n)}catch(e){"denied"===Notification.permission?a.eM&&console.warn("[PUSH] The user has blocked push notifications."):a.eM&&(console.log("[PUSH] Unable to subscribe to push.",e),e.code===DOMException.ABORT_ERR&&await I())}}}async function P(e){let{chat:t,message:n}=e;const{hasWebNotifications:m}=await async function(){if(S)return(0,c.dZ)((0,u.Rd)());const[e,t]=await Promise.all([(0,r.t9)("fetchNotificationSettings",{serverTimeOffset:(0,u.Rd)().serverTimeOffset}),(0,r.t9)("fetchNotificationExceptions",{serverTimeOffset:(0,u.Rd)().serverTimeOffset})]);if(!e)return(0,c.dZ)((0,u.Rd)());let n=(0,i.BI)((0,u.Rd)(),e);return t&&(n=(0,i.aJ)(n,t)),(0,u.R3)(n),S=!0,(0,c.dZ)(n)}();if(!function(e){if(!S)return!1;const t=(0,u.Rd)();if((0,s.i4)(e,(0,c.dZ)(t),(0,c.NJ)(t))||e.isNotJoined||!e.isListed)return!1;if(l.$b){const{chatId:n,type:r}=(0,c.Bt)(t)||{};return!(n===e.id&&"thread"===r)}return!document.hasFocus()}(t))return;const p="Notification"in window?"denied"!==Notification.permission||(a.eM&&console.warn("[PUSH] The user has blocked push notifications."),!1):(a.eM&&console.warn("[PUSH] This browser does not support desktop notification"),!1);if(!m||!p)return void b(String(n.id)||t.id);if(!p)return;if(!n.id)return;const v=(0,s.dT)(n),y=await async function(e){const t=(0,s.RT)(e);if(!t)return;let n=h.UV(t);return n||(await h.he(t,o.IU.BlobUrl),n=h.UV(t)),n}(t),{title:I,body:w}=function(e,t,n){const r=(0,u.Rd)();let{senderId:o,replyToMessageId:a}=t;n&&(o=n.userId);const i=o?(0,c.dy)(r,o):void 0,l=(0,s.N5)(t),h=l&&a?(0,c.hj)(r,e.id,a):void 0,{targetUserIds:m,targetChatId:p}=l||{},g=m?m.map((e=>(0,c.dy)(r,e))).filter(Boolean):void 0,v=(0,s.zX)(e),y=v?(0,c.dy)(r,v):void 0;let b;if((0,s.Sm)(e,(0,c.dZ)(r),(0,c.NJ)(r)))if((0,s.Lo)(t)){const n=e&&((0,s.eA)(e)||t.senderId===t.chatId);b=(0,d.D)(f.i0,t,n?void 0:i,n?e:void 0,g,h,p,{asPlainText:!0})}else{const n=(0,s.zF)(f.i0,e.id,i),r=(0,s.MK)(f.i0,t,!1,60,!1);b=n?`${n}: ${r}`:r}else b="New message";return{title:(0,s.U)(f.i0,e,y),body:b}}(t,n,v);if(g()){var C;null!==(C=navigator.serviceWorker)&&void 0!==C&&C.controller&&navigator.serviceWorker.controller.postMessage({type:"showMessageNotification",payload:{title:I,body:w,icon:y,chatId:t.id,messageId:n.id,reaction:v?v.reaction:void 0}})}else{const e=(0,u.uC)(),r={body:w,icon:y,badge:y,tag:String(n.id)};"vibrate"in navigator&&(r.vibrate=[200,100,200]);const o=new Notification(I,r);o.onclick=()=>{o.close(),e.focusMessage({chatId:t.id,messageId:n.id}),v&&e.startActiveReaction({messageId:n.id,reaction:v.reaction}),window.focus&&window.focus()},o.onshow=()=>{b(String(n.id)||t.id)}}}function M(e){var t;!a.Cg&&null!==(t=navigator.serviceWorker)&&void 0!==t&&t.controller&&navigator.serviceWorker.controller.postMessage({type:"closeMessageNotifications",payload:e})}function A(){var e;null!==(e=navigator.serviceWorker)&&void 0!==e&&e.controller&&navigator.serviceWorker.controller.postMessage({type:"clientReady"})}},7926:(e,t,n)=>{n.d(t,{L:()=>d,$:()=>a});const r="kz_version",o=["Z","K"];function d(e){localStorage.setItem(r,JSON.stringify(e))}function a(){(function(){const e=localStorage.getItem(r);if(!e)return!1;try{const t=JSON.parse(e);return o.includes(t)}catch(e){return!1}})()||d("Z")}},6272:(e,t,n)=>{n.d(t,{U9:()=>a,g3:()=>u,un:()=>s,WZ:()=>i});var r=n(782);const o="X",d="XXX XXX XXX XXX";function a(e,t){return e.filter((e=>e.iso2===t))}function u(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=n.replace(/[^\d+]+/g,"");o.startsWith("+")&&(o=o.substr(1));const d=e.filter((e=>o.startsWith(e.countryCode))),a=(0,r.xH)(d.map((e=>(e.prefixes||[""]).map((t=>({code:`${e.countryCode}${t}`,country:e})))))),u=a.filter((e=>{let{code:t}=e;return o.startsWith(t)})).sort(((e,t)=>e.code.length-t.code.length));return null===(t=u[u.length-1])||void 0===t?void 0:t.country}function s(e,t){let n=e.replace(/[^\d]+/g,"");if(t)n=n.substr(t.countryCode.length);else if(e.startsWith("+"))return e;const r=function(e,t){if(!t||0===t.length)return d;if(1===t.length)return t[0];const n=t.find((e=>e.startsWith(o)))||d,r=t.filter((t=>{const n=t.replace(/[^\dX]+/g,"");if(n.startsWith(o))return!1;for(let t=0;tn.length-1||n[t]!==o&&n[t]!==e[t])return!1;return!0}));return 1===r.length?r[0]:n}(n,null==t?void 0:t.patterns),a=[];let u=0;for(let e=0;e{n.d(t,{q:()=>d,V:()=>a});var r=n(6137),o=n(6590);function d(e){const t="thread"!==e.type?`_${e.type}`:-1!==e.threadId?`_${e.threadId}`:"";return`${e.chatId}${t}`}function a(){if(!o.Oy)return;const[e,t]=o.Oy.replace(/^#/,"").split("_");if(null==e||!e.match(/^-?\d+$/))return;const n=["thread","pinned","scheduled"].includes(t);return{chatId:e,type:Boolean(t)&&n?t:"thread",threadId:Boolean(t)&&!n?Number(t):r._f}}},9118:(e,t,n)=>{function r(e,t){let n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(){for(var d=arguments.length,a=new Array(d),u=0;u{o&&e(...a),n=void 0}),t)}}function o(e,t){let n,r,o,d=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(){r=!0;for(var a=arguments.length,u=new Array(a),s=0;s{if(!r)return self.clearInterval(n),void(n=void 0);r=!1,e(...o)}),t))}}function d(e){return s(v,e)}function a(e){return s(y,e)}function u(e){return s(b,e)}function s(e,t){let n,r=!1;return function(){for(var o=arguments.length,d=new Array(o),a=0;a{r=!1,t(...n)})))}}function i(e,t){self.requestIdleCallback?self.requestIdleCallback(e,{timeout:t}):b(e)}n.d(t,{Ds:()=>r,P2:()=>o,mS:()=>d,wT:()=>a,$6:()=>u,Q8:()=>i,wO:()=>c,Pn:()=>l,T2:()=>v,D0:()=>y,R3:()=>b,zD:()=>I,Gq:()=>w});const c=e=>new Promise((t=>{setTimeout((()=>t()),e)}));function l(){return new Promise((e=>{v(e)}))}let f,h,m,p,g;function v(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];f?t?h.push(e):f.push(e):(f=t?[]:[e],h=t?[e]:[],requestAnimationFrame((()=>{const e=f,t=h;f=void 0,h=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}function y(e){v(e,!0)}function b(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m?t?p.push(e):m.push(e):(m=t?[]:[e],p=t?[e]:[],Promise.resolve().then((()=>{const e=m,t=p;m=void 0,p=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}function I(e){b(e,!0)}function w(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return g||(g=[],self.addEventListener("beforeunload",(()=>{g.forEach((e=>e()))}))),t?g.push(e):g.unshift(e),()=>{g=g.filter((t=>t!==e))}}},5765:(e,t,n)=>{let r;n.d(t,{Z:()=>o,W:()=>d});try{r=new RegExp("[^\\p{L}\\p{M}]+","ui")}catch(e){r=new RegExp("[^\\wа-яё]+","i")}function o(e,t){if(!e||!t)return!1;const n="string"==typeof t?t.toLowerCase().split(r):t,o=e.toLowerCase();if(1===n.length&&!o.includes(n[0]))return!1;let d;return n.every((e=>!!o.includes(e)&&(d||(d=o.split(r)),d.some((t=>t.startsWith(e))))))}function d(e){const t=e.toLowerCase().split(r);return e=>o(e,t)}},2267:(e,t,n)=>{n.d(t,{b:()=>r});const r=e=>Math.floor(Date.now()/1e3)+e},3100:(e,t,n)=>{n.d(t,{f3:()=>m,jv:()=>l,ti:()=>i,Qw:()=>h,K8:()=>f,wX:()=>c});function r(e){return new Promise(((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)}))}let o;function d(){return o||(o=function(e,t){const n=(!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){var t=function(){return indexedDB.databases().finally(e)};o=setInterval(t,100),t()})).finally((function(){return clearInterval(o)})):Promise.resolve()).then((()=>{const e=indexedDB.open("keyval-store");return e.onupgradeneeded=()=>e.result.createObjectStore(t),r(e)}));var o;return(e,r)=>n.then((n=>r(n.transaction(t,e).objectStore(t))))}(0,"keyval")),o}var a=n(3716),u=n(9524);const s=[1,2,3,4,5];function i(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&localStorage.getItem(a.Vx))return!0;const t=localStorage.getItem(a.b_);if(!t)return!1;try{const e=JSON.parse(t);return Boolean(e&&e.id&&e.dcID)}catch(e){return!1}}function c(e,t){const{mainDcId:n,keys:r,hashes:o}=e;localStorage.setItem(a.b_,JSON.stringify({dcID:n,id:t})),localStorage.setItem("dc",String(n)),Object.keys(r).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_auth_key`,JSON.stringify(r[e]))})),o&&Object.keys(o).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_hash`,JSON.stringify(o[e]))}))}function l(){[a.b_,"dc",...s.map((e=>`dc${e}_auth_key`)),...s.map((e=>`dc${e}_hash`))].forEach((e=>{localStorage.removeItem(e)}))}function f(){if(!i())return;const e=JSON.parse(localStorage.getItem(a.b_)),t=Number(e.dcID),n={},r={};return s.forEach((e=>{try{const t=localStorage.getItem(`dc${e}_auth_key`);t&&(n[e]=JSON.parse(t));const o=localStorage.getItem(`dc${e}_hash`);o&&(r[e]=JSON.parse(o))}catch(e){a.eM&&console.warn("Failed to load stored session",e)}})),Object.keys(n).length?{mainDcId:t,keys:n,hashes:r}:void 0}async function h(){const e=localStorage.getItem(a.Vx);if(!e)return;const t=await function(e,t=d()){return t("readonly",(t=>r(t.get(e))))}(`GramJs:${e}`);try{c(JSON.parse(t))}catch(e){a.eM&&console.warn("Failed to load legacy session",e)}}async function m(){localStorage.removeItem(a.Vx);const e=await function(e=d()){return e("readonly",(e=>{if(e.getAllKeys)return r(e.getAllKeys());const t=[];return function(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},r(e.transaction)}(e,(e=>t.push(e.key))).then((()=>t))}))}();await Promise.all([u.clear("GramJs"),...e.filter((e=>"string"==typeof e&&e.startsWith("GramJs:GramJs-session-"))).map((e=>function(e,t=d()){return t("readwrite",(t=>(t.delete(e),r(t.transaction))))}(e)))])}},7370:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(9933),o=n(9118);const d=JSON.parse('{"--color-primary":["#3390EC","#8774E1"],"--color-primary-opacity":["#50A2E980","#8378DB80"],"--color-primary-shade":["#4a95d6","#7b71c6"],"--color-background":["#FFFFFF","#212121"],"--color-background-compact-menu":["#FFFFFFBB","#212121DD"],"--color-background-compact-menu-reactions":["#FFFFFFEB","#212121DD"],"--color-background-compact-menu-hover":["#00000011","#00000066"],"--color-background-secondary":["#f4f4f5","#0F0F0F"],"--color-background-secondary-accent":["#E4E4E5","#100f10"],"--color-background-own":["#EEFFDE","#8774E1"],"--color-background-own-apple":["#DCF8C5","#8774E1"],"--color-background-selected":["#F4F4F5","#2C2C2C"],"--color-background-own-selected":["#d0ffac","#6549d4"],"--color-chat-hover":["#F4F4F5","#2C2C2C"],"--color-chat-active":["#3390EC","#8774E1"],"--color-item-active":["#ededed","#292929"],"--color-text":["#000000","#FFFFFF"],"--color-text-secondary":["#707579","#AAAAAA"],"--color-text-secondary-apple":["#8E8E92","#AAAAAA"],"--color-borders":["#DADCE0","#303030"],"--color-borders-input":["#DADCE0","#5B5B5A"],"--color-dividers":["#C8C6CC","#404040"],"--color-links":["#3390EC","#8774E1"],"--color-gray":["#C4C9CC","#717579"],"--color-pinned":["#C4C9CC","#707579"],"--color-default-shadow":["#72727240","#1010109c"],"--color-light-shadow":["#7272722B","#00000040"],"--color-green":["#00C73E","#8774E1"],"--color-text-meta-colored":["#4DCD5E","#8378DB"],"--color-reply-hover":["#F4F4F4","#272727"],"--color-reply-active":["#E8E9E9","#2E2F2F"],"--color-reply-own-hover":["#D9F5CE","#7d6bca"],"--color-reply-own-hover-apple":["#cbefb7","#7d6bca"],"--color-reply-own-active":["#C5ECBE","#7264b6"],"--color-reply-own-active-apple":["#bae6a8","#7264b6"],"--color-accent-own":["#45AF54","#FFFFFF"],"--color-message-meta-own":["#4FAE4EFF","#FFFFFF88"],"--color-own-links":["#3390EC","#FFFFFF"],"--color-code":["#4a729a","#8774E1"],"--color-code-own":["#3c7940","#FFFFFF"],"--color-code-bg":["#70757914","#ffffff26"],"--color-code-own-bg":["#70757914","#ffffff26"],"--color-composer-button":["#707579CC","#AAAAAACC"],"--color-message-reaction":["#ebf3fd","#2b2a35"],"--color-message-reaction-hover":["#c5def9","#343147"],"--color-message-reaction-own":["#cef0ba","#7a68ca"],"--color-message-reaction-hover-own":["#b5e0a4","#7567bc"]}');let a=!1;const u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,s=new Set(["--color-primary-shade","--color-text-secondary"]),i=(e,t,n)=>(1-n)*e+n*t,c=Object.keys(d).map((e=>({property:e,colors:[l(d[e][0]),l(d[e][1])]})));function l(e){const t=u.exec(e);return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:void 0!==t[4]?parseInt(t[4],16):void 0}}function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;c.forEach((r=>{let{property:o,colors:d}=r;const a=Math.round(i(d[e].r,d[t].r,n)),u=Math.round(i(d[e].g,d[t].g,n)),c=Math.round(i(d[e].b,d[t].b,n)),l=void 0!==d[e].a?Math.round(i(d[e].a,d[t].a,n)):void 0;document.documentElement.style.setProperty(o,void 0!==l?`rgba(${a},${u},${c},${l/255})`:`rgb(${a},${u},${c})`),s.has(o)&&document.documentElement.style.setProperty(`${o}-rgb`,`${a},${u},${c}`)}))}const h=(e,t)=>{const n="dark"===e,d=a&&t,u=n?0:1,s=n?1:0,i=Date.now(),c=document.querySelector('meta[name="theme-color"]');document.documentElement.classList.remove("theme-"+(n?"light":"dark")),a&&document.documentElement.classList.add("no-animations"),document.documentElement.classList.add(`theme-${e}`),c&&c.setAttribute("content",n?"#212121":"#fff"),setTimeout((()=>{document.documentElement.classList.remove("no-animations")}),500),a=!0,d?(0,o.T2)((()=>{(0,r.cK)((()=>{const e=Math.min((Date.now()-i)/200,1);return f(u,s,function(e){return 1-(1-e)**3.5}(e)),e<1}))})):f(u,s)}},2155:(e,t,n)=>{n.d(t,{kh:()=>d,bi:()=>u,Xv:()=>s});var r=n(3681),o=n(4284);function d(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function a(e){return".0"===String(e.toFixed(1)).substr(-2)?Math.round(e):e.toFixed(1).replace(".",",")}function u(e){return e<1e3?e:e<1e6?`${a(e/1e3)}K`:`${a(e/1e6)}M`}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map((e=>{if(!e.length)return"";const t=(e=(0,o.g6)(e)).match(r.Z);return t&&e.startsWith(t[0])?t[0]:e.match(/./u)[0].toUpperCase()})).join("")}},8035:(e,t,n)=>{function r(e,t){return!e||!t||e.length<=t?e:`${e.substring(0,t)}...`}n.d(t,{Z:()=>r})},862:(e,t,n)=>{n.d(t,{Hu:()=>s,_y:()=>i,p6:()=>c});var r=n(7361),o=n(1394),d=n(9118);let a,u;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";async function i(e,t){for(l();!u.wasmReady;)await(0,d.wO)(2e3);const{result:n,width:r,height:o}=await function(e,t){return new Promise((n=>{u.requests||(u.requests=new Map),u.requests.set(e,n),u.postMessage({id:e,blob:t})}))}(e,t);if(r&&o)return function(e){let{result:t,width:n,height:r}=e;return a||(a=document.createElement("canvas")),new Promise((e=>{const o=new ImageData(t,n,r);a.width=n,a.height=r,a.getContext("2d").putImageData(o,0,0),a.toBlob((t=>{e(null!=t?t:void 0)}),"image/png",1)}))}({result:n,width:r,height:o})}async function c(e,t){if((0,r.on)()||"data:image/webp"!==t.substr(0,15))return t;l();const n=await i(e,(0,o.A9)(t));if(!n)throw new Error(`Can't convert webp to png. Url: ${t}`);return(0,o.YJ)(n)}function l(){u||(u=new Worker(new URL(n.p+n.u(536),n.b)),u.wasmReady=!1,u.onmessage=f)}function f(e){const{id:t}=e.data;switch(e.data.type){case"initialized":u.wasmReady=!0;break;case"result":if(u.requests.has(t)){const n=u.requests.get(t);u.requests.delete(t),n(e.data)}}}},1622:(e,t,n)=>{n.d(t,{IT:()=>l,px:()=>f,W8:()=>h});var r=n(3716),o=n(5116),d=n(3100);const a=["t.me","telegram.me"].map((e=>`//${e}/_websync_?`)),u=`${r.Ji} Z`,s="tgme_sync",i=()=>Math.floor(Number(new Date)/1e3);let c;const l=e=>{const t=i(),{canRedirect:n,ts:r}=JSON.parse(localStorage.getItem(s)||"{}");return n!==e||r+86400<=t?Promise.all(a.map((t=>new Promise(((n,r)=>{const o=document.createElement("script"),d=()=>Boolean(document.body.removeChild(o));o.src=t+new URLSearchParams({authed:Number(e).toString(),version:u}),document.body.appendChild(o),o.onload=()=>{(e=>{const t=i();localStorage.setItem(s,JSON.stringify({canRedirect:e,ts:t}))})(e),d(),c&&(clearTimeout(c),c=void 0),f(),n()},o.onerror=()=>{d(),r()}}))))):Promise.resolve()};function f(){if(r.eM)return;if(void 0!==c)return;const e=i(),{ts:t}=JSON.parse(localStorage.getItem(s)||"{}"),n=86400-(e-t);c=setTimeout((()=>{const{authState:e}=(0,o.Rd)(),t="authorizationStateReady"===e||(0,d.ti)(!0);l(t)}),Math.max(0,1e3*n))}function h(){localStorage.removeItem(s)}},3858:(e,t,n)=>{n.d(t,{z:()=>l,Z:()=>h});var r=n(9118),o=n(3716),d=n(7361);const a=d.wB&&f(),u=window.innerHeight;let s=l(),i=!1;const c=(0,r.P2)((()=>{s=l(),!i&&((s.width<=o.l3||s.width<=o.u_&&s.height<=o.rO)!==d.wB||d.wB&&a!==f())&&window.location.reload()}),250,!0);function l(){let e;e=d.cj?window.visualViewport.height+window.visualViewport.pageTop:window.innerHeight;const t=.01*e;return document.documentElement.style.setProperty("--vh",`${t}px`),{width:window.innerWidth,height:window.innerHeight}}function f(){return d.cj?window.matchMedia("(orientation: landscape)").matches:window.matchMedia("screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)").matches}window.addEventListener("orientationchange",c),d.cj?window.visualViewport.addEventListener("resize",c):window.addEventListener("resize",c);const h={get:()=>s,getIsKeyboardVisible:()=>u>s.height,disableRefresh:function(){i=!0},enableRefresh:function(){i=!1}}},5359:(e,t,n)=>{e.exports=n.p+"app-inactive.bc7953c2dfebcabce2c4..png"},2162:(e,t,n)=>{e.exports=n.p+"monkey.a3d5fcdc50b18dc55695..svg"},5523:(e,t,n)=>{e.exports=n.p+"reaction-thumbs.4007ef2a82a070efb3ce..png"},4128:(e,t,n)=>{e.exports=n.p+"telegram-logo.1b2bb5b107f046ea9325..svg"}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return a[e].call(n.exports,n,n.exports,s),n.exports}s.m=a,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);s.r(o);var d={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>d[e]=()=>n[e]));return d.default=()=>n,s.d(o,d),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+"."+{47:"b422d6da038c24068089",99:"4acb17d13e1a5b87b131",133:"ac23512cbe1955fbc721",161:"4fade15904bfe66b4f71",176:"2bd8fc859463a252c8a2",302:"317a243801f66d9ed028",347:"595121c92ffb31ae37da",354:"e30ac9a934f7627782aa",472:"65a66b6c1fb1be8db986",501:"3c8f4d2d9fb141fac95f",524:"08e4e0ac4b22371b853f",536:"ab2a889dae72ec88f68c",626:"6c9310e081bfd315824b",687:"b0ad3fcc6328cf70a271",745:"cc53f6e29328dbd2c9ff",830:"3dad49e3bca3c0b28df2",915:"af01666698d37aea6ce6",941:"24c93ec02ada9e8159a1",993:"5065d2f591c9fc4f83b4"}[e]+".js",s.miniCssF=e=>e+"."+{47:"b422d6da038c24068089",133:"ac23512cbe1955fbc721",176:"2bd8fc859463a252c8a2",347:"595121c92ffb31ae37da",472:"65a66b6c1fb1be8db986",687:"b0ad3fcc6328cf70a271"}[e]+".css",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="telegram-t:",s.l=(e,t,o,d)=>{if(n[e])n[e].push(t);else{var a,u;if(void 0!==o)for(var i=document.getElementsByTagName("script"),c=0;c{a.onerror=a.onload=null,clearTimeout(h);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),o=e=>new Promise(((t,n)=>{var r=s.miniCssF(e),o=s.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=d=>{if(o.onerror=o.onload=null,"load"===d.type)n();else{var a=d&&("load"===d.type?"missing":d.type),u=d&&d.target&&d.target.href||t,s=new Error("Loading CSS chunk "+e+" failed.\n("+u+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=a,s.request=u,o.parentNode.removeChild(o),r(s)}},o.href=t,document.head.appendChild(o)})(e,o,t,n)})),d={179:0},s.f.miniCss=(e,t)=>{d[e]?t.push(d[e]):0!==d[e]&&{47:1,133:1,176:1,347:1,472:1,687:1}[e]&&t.push(d[e]=o(e).then((()=>{d[e]=0}),(t=>{throw delete d[e],t})))},(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var d=s.p+s.u(t),a=new Error;s.l(d,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+d+")",a.name="ChunkLoadError",a.type=o,a.request=d,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[d,a,u]=n,i=0;if(d.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);u&&u(s)}for(t&&t(n);i{s(3592);var e=s(3716),t=s(5116),n=s(7361),r=s(8406);function o(n){const o=n.data;if(e.ZT&&console.log("[SW] Message from worker",o),!o.type)return;const d=(0,t.uC)(),a=o.payload;switch(o.type){case"focusMessage":d.focusMessage&&d.focusMessage(a),d.startActiveReaction&&a.reaction&&d.startActiveReaction({messageId:a.messageId,reaction:a.reaction});break;case"playNotificationSound":(0,r.Nz)(o.payload.id)}}function d(){navigator.serviceWorker.removeEventListener("message",o),navigator.serviceWorker.addEventListener("message",o),(0,r.KC)()}n.Mc&&(window.addEventListener("load",(async()=>{try{if(!navigator.serviceWorker.controller){const t=await navigator.serviceWorker.getRegistrations();t.length&&(e.eM&&console.log("[SW] Hard reload detected, re-enabling Service Worker"),await Promise.all(t.map((e=>e.unregister()))))}await navigator.serviceWorker.register(new URL(s.p+s.u(524),s.b)),e.eM&&console.log("[SW] ServiceWorker registered"),await navigator.serviceWorker.ready,navigator.serviceWorker.controller?(e.eM&&console.log("[SW] ServiceWorker ready"),d()):(e.eM&&console.error("[SW] ServiceWorker not available"),n.cj||n.wZ||(0,t.uC)().showDialog({data:{message:"SERVICE_WORKER_DISABLED",hasErrorKey:!0}}))}catch(t){e.eM&&console.error("[SW] ServiceWorker registration failed: ",t)}})),window.addEventListener("focus",(async()=>{await navigator.serviceWorker.ready,d()})));var a=s(2916);const u={isLeftColumnShown:!0,isChatInfoShown:!1,newChatMembersProgress:s(1713).WB.Closed,uiReadyState:0,serverTimeOffset:0,authRememberMe:!0,countryList:{phoneCodes:[],general:[]},blocked:{ids:[],totalCount:0},users:{byId:{},statusesById:{}},chats:{listIds:{},isFullyLoaded:{},orderedPinnedIds:{},totalCount:{},byId:{}},messages:{byChatId:{},messageLists:[],sponsoredByChatId:{}},groupCalls:{byId:{}},scheduledMessages:{byChatId:{}},chatFolders:{byId:{},activeChatFolder:0},fileUploads:{byMessageLocalId:{}},recentEmojis:["grinning","kissing_heart","christmas_tree","brain","trophy"],stickers:{setsById:{},added:{},recent:{stickers:[]},favorite:{stickers:[]},greeting:{stickers:[]},featured:{setIds:[]},search:{},forEmoji:{}},emojiKeywords:{},gifs:{saved:{},search:{}},inlineBots:{isLoading:!1,byUsername:{}},globalSearch:{},userSearch:{},localTextSearch:{byChatThreadKey:{}},localMediaSearch:{byChatId:{}},management:{byChatId:{}},topPeers:{},topInlineBots:{},mediaViewer:{},audioPlayer:{volume:e.Qx,playbackRate:e.mw,isMuted:!1},forwardMessages:{},pollResults:{},payment:{},notifications:[],dialogs:[],activeSessions:[],settings:{byKey:{theme:"light",shouldUseSystemTheme:!0,messageTextSize:n.cj?e.b6:n.jm?e.AR:e.xS,animationLevel:e.CX,messageSendKeyCombo:"enter",canAutoLoadPhotoFromContacts:!0,canAutoLoadPhotoInPrivateChats:!0,canAutoLoadPhotoInGroups:!0,canAutoLoadPhotoInChannels:!0,canAutoLoadVideoFromContacts:!0,canAutoLoadVideoInPrivateChats:!0,canAutoLoadVideoInGroups:!0,canAutoLoadVideoInChannels:!0,canAutoLoadFileFromContacts:!1,canAutoLoadFileInPrivateChats:!1,canAutoLoadFileInGroups:!1,canAutoLoadFileInChannels:!1,autoLoadFileMaxSizeMb:10,hasWebNotifications:!0,hasPushNotifications:!0,notificationSoundVolume:5,canAutoPlayGifs:!0,canAutoPlayVideos:!0,shouldSuggestStickers:!0,shouldLoopStickers:!0,language:"en",timeFormat:"24h",wasTimeFormatSetManually:!1,isConnectionStatusMinimized:!0},themes:{light:{isBlurred:!0,patternColor:e.g},dark:{isBlurred:!0,patternColor:e.Vv}},privacy:{},notifyExceptions:{}},twoFaSettings:{},activeReactions:{},shouldShowContextMenuHint:!0,activeDownloads:{byChatId:{}},serviceNotifications:[]};var i=s(6137),c=s(9118),l=s(8674),f=s(782),h=s(9066),m=s(3100),p=s(5780),g=s(8415),v=s(6974);const y=(0,c.P2)((()=>(0,c.Q8)(S)),5e3,!1);let b,I=!1;function w(){I=!0,b=(0,c.Gq)(S,!0),window.addEventListener("blur",S),(0,t.ll)(y)}function C(){I=!1,(0,t.Iq)(y),window.removeEventListener("blur",S),b&&b()}function S(){if(!I||(0,l.zG)())return;const n=(0,t.Rd)();if(n.isLoggingOut)return;const r={...u,...(0,f.ei)(n,["authState","authPhoneNumber","authRememberMe","authNearestCountry","currentUserId","contactList","topPeers","topInlineBots","recentEmojis","push","shouldShowContextMenuHint","leftColumnWidth","serviceNotifications"]),audioPlayer:{volume:n.audioPlayer.volume,playbackRate:n.audioPlayer.playbackRate,isMuted:n.audioPlayer.isMuted},isChatInfoShown:E(n),users:P(n),chats:M(n),messages:A(n),globalSearch:{recentlyFoundChatIds:n.globalSearch.recentlyFoundChatIds},settings:k(n),chatFolders:T(n),groupCalls:N(n),availableReactions:L(n)},o=JSON.stringify(r);localStorage.setItem(e.Uh,o)}function E(t){return window.innerWidth>e._m&&t.isChatInfoShown}function P(t){var n,r,o,d,a;const{users:{byId:u,statusesById:s},currentUserId:i}=t,{chatId:c}=(0,h.Bt)(t)||{},l=null===(n=(0,h.P2)(t))||void 0===n?void 0:n.map((e=>{let{id:t}=e;return t})),m=(0,f.Tw)([...i?[i]:[],...c&&(0,g.YC)(c)?[c]:[],...l||[],...t.topPeers.userIds||[],...(null===(r=(0,v.gO)(e.Nf))||void 0===r?void 0:r.filter(g.YC))||[],...(null===(o=(0,v.gO)(e.WS))||void 0===o?void 0:o.filter(g.YC))||[],...(null===(d=t.contactList)||void 0===d?void 0:d.userIds)||[],...(null===(a=t.globalSearch.recentlyFoundChatIds)||void 0===a?void 0:a.filter(g.YC))||[],...Object.keys(u)]).slice(0,e.lO);return{byId:(0,f.ei)(u,m),statusesById:(0,f.ei)(s,m)}}function M(t){const{chats:{byId:n},currentUserId:r}=t,o=(0,h.jr)(t),d=(0,f.Tw)([...r?[r]:[],...o?[o.id]:[],...(0,v.gO)(e.Nf)||[],...(0,v.gO)(e.WS)||[],...t.globalSearch.recentlyFoundChatIds||[],...Object.keys(n)]).slice(0,e.gJ);return{...t.chats,isFullyLoaded:{},byId:(0,f.ei)(t.chats.byId,d)}}function A(t){var n;const{currentUserId:r}=t,o={},{chatId:d}=(0,h.Bt)(t)||{};return[...d?[d]:[],...r?[r]:[],...(null===(n=(0,v.gO)(e.Nf))||void 0===n?void 0:n.slice(0,e.Rk))||[]].forEach((e=>{const n=t.messages.byChatId[e];if(!n)return;const r=n.threadsById[i._f];r&&r.viewportIds&&(o[e]={byId:(0,f.ei)(n.byId,r.viewportIds),threadsById:{[i._f]:r}})})),{byChatId:o,messageLists:[],sponsoredByChatId:{}}}function k(e){const{byKey:t,themes:n}=e.settings;return{byKey:t,themes:n,privacy:{},notifyExceptions:{}}}function T(e){return{...e.chatFolders,activeChatFolder:0}}function N(e){return{...e.groupCalls,byId:{},activeGroupCallId:void 0,isGroupCallPanelHidden:void 0,isFallbackConfirmOpen:void 0}}function L(e){var t;return null===(t=e.availableReactions)||void 0===t?void 0:t.map((e=>(0,f.ei)(e,["reaction","staticIcon","title","isInactive"])))}e.sd||((0,t.Q6)("saveSession",(()=>{I||w()})),(0,t.Q6)("reset",(()=>{localStorage.removeItem(e.Uh),I&&C()}))),(0,t.Q6)("init",(()=>{const t=(0,f.Xh)(u);return function(t){if(!e.sd)return(0,m.ti)(!0)?(w(),function(t){e.eM&&console.time("global-state-cache-read");const r=localStorage.getItem(e.Uh),o=r?JSON.parse(r):void 0;e.eM&&console.timeEnd("global-state-cache-read"),o&&function(t,n){if("shouldAutoDownloadMediaFromContacts"in t.settings.byKey){const{shouldAutoDownloadMediaFromContacts:e,shouldAutoDownloadMediaInPrivateChats:n,shouldAutoDownloadMediaInGroups:r,shouldAutoDownloadMediaInChannels:o,shouldAutoPlayVideos:d,shouldAutoPlayGifs:a,...u}=t.settings.byKey;t.settings.byKey={...u,canAutoLoadPhotoFromContacts:e,canAutoLoadVideoFromContacts:e,canAutoLoadPhotoInPrivateChats:n,canAutoLoadVideoInPrivateChats:n,canAutoLoadPhotoInGroups:r,canAutoLoadVideoInGroups:r,canAutoLoadPhotoInChannels:o,canAutoLoadVideoInChannels:o,canAutoPlayVideos:d,canAutoPlayGifs:a}}t.settings.byKey={...n.settings.byKey,...t.settings.byKey},t.settings.themes={...n.settings.themes,...t.settings.themes},t.chatFolders={...n.chatFolders,...t.chatFolders},t.stickers.greeting||(t.stickers.greeting=n.stickers.greeting),t.activeDownloads||(t.activeDownloads={byChatId:{}}),t.serviceNotifications||(t.serviceNotifications=[]),void 0===t.audioPlayer.volume&&(t.audioPlayer.volume=e.Qx),void 0===t.audioPlayer.playbackRate&&(t.audioPlayer.playbackRate=e.mw),t.groupCalls||(t.groupCalls=n.groupCalls),t.users.statusesById||(t.users.statusesById={}),t.messages.sponsoredByChatId||(t.messages.sponsoredByChatId={}),t.activeReactions||(t.activeReactions={})}(o,t);const d={...t,...o},a=n.wB?void 0:(0,p.V)();return{...d,messages:{...d.messages,messageLists:a?[a]:[]}}}(t)):void C()}(t)||t}));var R=s(4050),F=s(3858);const x="tt-active-tab",B=String(Date.now()+Math.random());let O;localStorage.setItem(x,B);const Z=window.setInterval((()=>{O&&localStorage.getItem(x)!==B&&(O(),clearInterval(Z))}),2e3);var D=s(706),_=(s(7895),s(3781),s(1363),s(9667),s(4907),s(6590)),$=s(8332),U=s(1212),j=s(1394);const W=["400 1em Roboto","500 1em Roboto"];function V(){if("fonts"in document)return Promise.all(W.map((e=>document.fonts.load(e))))}var G=s(647),H=s(9203),z=s(6752),Q=s(4128),K=s(5523),J=s(2162);function q(){const{listIds:e,byId:n}=(0,t.Rd)().chats;if(e.active)return Promise.all(e.active.slice(0,10).map((e=>{const t=n[e];if(!t)return;const r=(0,$.RT)(t);return r?G.he(r,i.IU.BlobUrl):void 0})))}const Y={main:()=>Promise.all([(0,H.$y)(H.gl.Main,"Main").then(V),q(),(0,j.pt)(K)]),authPhoneNumber:()=>Promise.all([V(),(0,j.pt)(Q)]),authCode:()=>(0,j.pt)(J),authPassword:()=>(0,j.pt)(J),authQrCode:V},X=(0,t.c$)((e=>{const t=(0,h.Pu)(e),{background:n,backgroundColor:r}=e.settings.themes[t]||{};return{shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,uiReadyState:e.uiReadyState,hasCustomBackground:Boolean(n),hasCustomBackgroundColor:Boolean(r),isRightColumnShown:(0,h.Jf)(e),leftColumnWidth:e.leftColumnWidth}}))((e=>{let{page:n,children:r,hasCustomBackground:o,hasCustomBackgroundColor:d,isRightColumnShown:a,shouldSkipHistoryAnimations:u,leftColumnWidth:s}=e;const{setIsUiReady:i}=(0,t.uC)(),[l,f]=(0,D.Z)(),{shouldRender:h,transitionClassNames:m}=(0,U.Z)(!l,void 0,!0);return(0,R.d4)((()=>{let e;return Promise.race([(0,c.wO)(700),(async()=>{try{await Y[n]()}catch(e){}})()]).then((()=>{f(),i({uiReadyState:1}),e=window.setTimeout((()=>{i({uiReadyState:2})}),1e3)})),()=>{e&&(clearTimeout(e),e=void 0),i({uiReadyState:0})}}),[]),R.ZP.createElement("div",{id:"UiLoader"},r,h&&!u&&R.ZP.createElement("div",{className:(0,z.Z)("mask",m)},"main"===n?R.ZP.createElement(R.ZP.Fragment,null,R.ZP.createElement("div",{className:"left",style:s?`width: ${s}px`:void 0}),R.ZP.createElement("div",{className:(0,z.Z)("middle",o&&"custom-bg-image",d&&"custom-bg-color",a&&"with-right-column")}),a&&R.ZP.createElement("div",{className:"right"})):R.ZP.createElement("div",{className:"blank"})))}));var ee=s(6272),te=s(711),ne=s(9107);const re=(e,t)=>{const[n,r]=(0,R.eJ)();return e&&te.Pn(e,t).then(r),n};function oe(){let e=navigator.language;return e&&"pt-br"!==e&&(e=e.substr(0,2)),e}var de=s(231),ae=s(4605),ue=s(7687),se=s(4288),ie=s(5765),ce=s(2340),le=s(4284),fe=s(9290),he=s(3106),me=s(8964),pe=s(9204);const ge=200+e.fK,ve=(0,R.X$)((0,t.c$)((e=>{const{countryList:{phoneCodes:t}}=e;return{phoneCodeList:t}}))((e=>{let{id:t,value:n,isLoading:r,onChange:o,phoneCodeList:d}=e;const a=(0,ne.Z)(),u=(0,R.sO)(null),[s,i]=(0,R.eJ)(),[c,l]=(0,R.eJ)([]),f=(0,R.I4)((e=>{i(e),l(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t.length)return e;const n=(0,ie.W)(t);return e.filter((e=>n(e.defaultName)||e.name&&n(e.name)))}(d,e))}),[d]);(0,fe.Z)((e=>{let[t]=e;0===(null==t?void 0:t.length)&&d.length>0&&f(s)}),[d,f]);const h=(0,R.I4)((e=>{o(e),setTimeout((()=>f(void 0)),ge)}),[o,f]),m=(0,R.I4)((e=>{f(e.currentTarget.value)}),[f]),p=(0,R.I4)((e=>{if(8!==e.keyCode)return;const t=e.currentTarget;n&&void 0===s&&(t.value=""),f(t.value)}),[s,f,n]);return R.ZP.createElement(he.Z,{className:"CountryCodeInput",trigger:e=>{let{onTrigger:o,isOpen:d}=e;const i=()=>{if(d)return;setTimeout((()=>{u.current.select()}),50),o();const e=document.getElementById("auth-phone-number-form");e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},c=null!=s?s:(null==n?void 0:n.name)||(null==n?void 0:n.defaultName)||"";return R.ZP.createElement("div",{className:(0,z.Z)("input-group",n&&"touched")},R.ZP.createElement("input",{ref:u,className:(0,z.Z)("form-control",d&&"focus"),type:"text",id:t,value:c,autoComplete:"off",onClick:i,onFocus:i,onInput:e=>{m(e),i()},onKeyDown:p}),R.ZP.createElement("label",null,a("Login.SelectCountry.Title")),r?R.ZP.createElement(pe.Z,{color:"black"}):R.ZP.createElement("i",{onClick:i,className:(0,z.Z)("css-icon-down",d&&"open")}))}},c.map((e=>R.ZP.createElement(me.Z,{key:e.iso2,className:n&&e.iso2===n.iso2?"selected":"",onClick:()=>h(e)},R.ZP.createElement("span",{className:"country-flag"},(0,ce.Z)((0,le.Wg)(e.iso2),["hq_emoji"])),R.ZP.createElement("span",{className:"country-name"},e.name||e.defaultName),R.ZP.createElement("span",{className:"country-code"},e.countryCode)))),!c.length&&R.ZP.createElement(me.Z,{key:"no-results",className:"no-results",disabled:!0},R.ZP.createElement("span",null,a("lng_country_none"))))})));let ye=!1;const be=(0,R.X$)((0,t.c$)((e=>{const{settings:{byKey:{language:t}},countryList:{phoneCodes:n}}=e;return{...(0,f.ei)(e,["connectionState","authState","authPhoneNumber","authIsLoading","authIsLoadingQrCode","authError","authRememberMe","authNearestCountry"]),language:t,phoneCodeList:n}}))((e=>{let{connectionState:r,authState:o,authPhoneNumber:d,authIsLoading:a,authIsLoadingQrCode:u,authError:s,authRememberMe:i,authNearestCountry:c,phoneCodeList:l,language:f}=e;const{setAuthPhoneNumber:h,setAuthRememberMe:m,loadNearestCountry:p,loadCountryList:g,clearAuthError:v,goToAuthQrCode:y,setSettingOption:b}=(0,t.uC)(),I=(0,ne.Z)(),w=(0,R.sO)(null),C=oe(),S=re(C,"ContinueOnThisLanguage"),[E,P]=(0,R.eJ)(),[M,A]=(0,R.eJ)(),[k,T]=(0,R.eJ)(!1),[N,L]=(0,R.eJ)(),[F,x,B]=(0,D.Z)(),O=E?`+${E.countryCode} ${M||""}`:M,Z=O&&O.replace(/[^\d]+/g,"").length>=7;(0,R.d4)((()=>{n.$b||w.current.focus()}),[E]),(0,R.d4)((()=>{"connectionStateReady"!==r||c||p()}),[r,c,p]),(0,R.d4)((()=>{"connectionStateReady"===r&&g({langCode:f})}),[r,f,g]),(0,R.d4)((()=>{c&&l&&!E&&!k&&P((0,ee.U9)(l,c)[0])}),[E,c,k,l]);const _=(0,R.I4)((e=>{e.length||A("");const t=l&&(0,ee.g3)(l,e),n=!E||t&&t.iso2!==E.iso2||!t&&e.length?t:E;(!E||!n||n&&n.iso2!==E.iso2)&&P(n),A((0,ee.un)(e,n))}),[l,E]),$=(0,R.I4)((()=>{x(),(0,te.m0)(C,(()=>{B(),b({language:C})}))}),[x,b,C,B]);(0,R.d4)((()=>{void 0===M&&d&&_(d)}),[d,M,_]),(0,R.bt)((()=>{w.current&&N&&w.current.setSelectionRange(...N)}),[N]);const U=(0,R.sO)(!1),W=(0,R.I4)((()=>{U.current=!0,requestAnimationFrame((()=>{U.current=!1}))}),[]),G=(0,R.I4)((e=>{P(e),A("")}),[]),H=(0,R.I4)((e=>{s&&v(),ye||(ye=!0,V(),(0,j.pt)(J));const{value:t,selectionStart:r,selectionEnd:o}=e.target;L(r&&o&&o1&&!U.current;_(d?`${E.countryCode} ${t}`:t)}),[s,v,E,O,_]),z=(0,R.I4)((e=>{m(e.target.checked)}),[m]),Q="authorizationStateWaitPhoneNumber"===o;return R.ZP.createElement("div",{id:"auth-phone-number-form",className:"custom-scroll"},R.ZP.createElement("div",{className:"auth-form"},R.ZP.createElement("div",{id:"logo"}),R.ZP.createElement("h2",null,"Telegram"),R.ZP.createElement("p",{className:"note"},I("StartText")),R.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),a||Z&&h({phoneNumber:O})}},R.ZP.createElement(ve,{id:"sign-in-phone-code",value:E,isLoading:!c&&!E,onChange:G}),R.ZP.createElement(ue.Z,{ref:w,id:"sign-in-phone-number",label:I("Login.PhonePlaceholder"),value:O,error:s&&I(s),inputMode:"tel",onChange:H,onPaste:n.s$?W:void 0}),R.ZP.createElement(ae.Z,{id:"sign-in-keep-session",label:"Keep me signed in",checked:Boolean(i),onChange:z}),Z&&(Q?R.ZP.createElement(de.Z,{type:"submit",ripple:!0,isLoading:a},I("Login.Next")):R.ZP.createElement(se.Z,null)),Q&&R.ZP.createElement(de.Z,{isText:!0,ripple:!0,isLoading:u,onClick:y},I("Login.QR.Login")),C&&C!==f&&S&&R.ZP.createElement(de.Z,{isText:!0,isLoading:F,onClick:$},S))))})));var Ie=s(8778);const we=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Auth,"AuthCode");return e?R.ZP.createElement(e,null):R.ZP.createElement(se.Z,null)})),Ce=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Auth,"AuthPassword");return e?R.ZP.createElement(e,null):R.ZP.createElement(se.Z,null)})),Se=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Auth,"AuthRegister");return e?R.ZP.createElement(e,null):R.ZP.createElement(se.Z,null)}));let Ee=null;class Pe{}Pe.render=function(e,t){Ee(e,t)},self.QrCreator=Pe,function(e){function t(t,n,r,o){var d={},a=e(r,n);a.u(t),a.J(),o=o||0;var u=a.h(),s=a.h()+2*o;return d.text=t,d.level=n,d.version=r,d.O=s,d.a=function(e,t){return t-=o,!(0>(e-=o)||e>=u||0>t||t>=u)&&a.a(e,t)},d}function n(e,t,n,r,o,d,a,u,s,i){function c(t,n,r,o,a,u,s){t?(e.lineTo(n+u,r+s),e.arcTo(n,r,o,a,d)):e.lineTo(n,r)}a?e.moveTo(t+d,n):e.moveTo(t,n),c(u,r,n,r,o,-d,0),c(s,r,o,t,o,0,-d),c(i,t,o,t,n,d,0),c(a,t,n,r,n,0,d)}function r(e,t,n,r,o,d,a,u,s,i){function c(t,n,r,o){e.moveTo(t+r,n),e.lineTo(t,n),e.lineTo(t,n+o),e.arcTo(t,n,t+r,n,d)}a&&c(t,n,d,d),u&&c(r,n,-d,d),s&&c(r,o,-d,-d),i&&c(t,o,d,-d)}function o(e,o){e:{var d=o.text,a=o.v,u=o.N,s=o.K,i=o.P;for(u=Math.max(1,u||1),s=Math.min(40,s||40);u<=s;u+=1)try{var c=t(d,a,u,i);break e}catch(e){}c=void 0}if(!c)return null;for(d=e.getContext("2d"),o.background&&(d.fillStyle=o.background,d.fillRect(o.left,o.top,o.size,o.size)),a=c.O,s=o.size/a,d.beginPath(),i=0;iMath.round(e*t.size))),"linear-gradient"===r)var d=e.createLinearGradient.apply(e,n);else{if("radial-gradient"!==r)throw Error("Unsupported fill");d=e.createRadialGradient.apply(e,n)}o.forEach((([e,t])=>{d.addColorStop(e,t)})),e.fillStyle=d}}(d,o),d.fill(),e}var d={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};Ee=function(e,t){var n={};Object.assign(n,d,e),n.N=n.minVersion,n.K=n.maxVersion,n.v=n.ecLevel,n.left=n.left,n.top=n.top,n.size=n.size,n.fill=n.fill,n.background=n.background,n.text=n.text,n.R=n.radius,n.P=n.quiet,t instanceof HTMLCanvasElement?(t.width===n.size&&t.height===n.size||(t.width=n.size,t.height=n.size),t.getContext("2d").clearRect(0,0,t.width,t.height),o(t,n)):((e=document.createElement("canvas")).width=n.size,e.height=n.size,n=o(e,n),t.appendChild(n))}}(function(){function e(o,a){function u(e,t){for(var n=-1;7>=n;n+=1)if(!(-1>=e+n||l<=e+n))for(var r=-1;7>=r;r+=1)-1>=t+r||l<=t+r||(c[e+n][t+r]=0<=n&&6>=n&&(0==r||6==r)||0<=r&&6>=r&&(0==n||6==n)||2<=n&&4>=n&&2<=r&&4>=r)}function s(e,n){for(var a=l=4*o+17,s=Array(a),m=0;m=v;v+=1)for(var y=-2;2>=y;y+=1)c[p+v][g+y]=-2==v||2==v||-2==y||2==y||0==v&&0==y}for(a=8;as;s+=1)m=!e&&1==(a>>s&1),c[6>s?s:8>s?s+1:l-15+s][8]=m,c[8][8>s?l-s-1:9>s?15-s:14-s]=m;if(c[l-8][8]=!e,7<=o){for(a=r.A(o),s=0;18>s;s+=1)m=!e&&1==(a>>s&1),c[Math.floor(s/3)][s%3+l-8-3]=m;for(s=0;18>s;s+=1)m=!e&&1==(a>>s&1),c[s%3+l-8-3][Math.floor(s/3)]=m}if(null==f){for(e=d.I(o,i),a=function(){var e=[],t=0,n={B:function(){return e},c:function(t){return 1==(e[Math.floor(t/8)]>>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},f:function(){return t},m:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n}(),s=0;s8*m)throw Error("code length overflow. ("+a.f()+">"+8*m+")");for(a.f()+4<=8*m&&a.put(0,4);0!=a.f()%8;)a.m(!1);for(;!(a.f()>=8*m||(a.put(236,8),a.f()>=8*m));)a.put(17,8);var b=0;for(m=s=0,p=Array(e.length),g=Array(e.length),v=0;vv;v+=1)null==c[s][g-v]&&(y=!1,p>>m&1)),n(s,g-v)&&(y=!y),c[s][g-v]=y,-1==--m&&(p+=1,m=7));if(0>(s+=a)||l<=s){s-=a,a=-a;break}}}var i=n[a],c=null,l=0,f=null,h=[],m={u:function(t){t=function(t){var n=e.s(t);return{S:function(){return 4},b:function(){return n.length},write:function(e){for(var t=0;te||l<=e||0>t||l<=t)throw Error(e+","+t);return c[e][t]},h:function(){return l},J:function(){for(var e=0,t=0,n=0;8>n;n+=1){s(!0,n);var o=r.D(m);(0==n||e>o)&&(e=o,t=n)}s(!1,t)}};return m}function t(e,n){if(void 0===e.length)throw Error(e.length+"/"+n);var r=function(){for(var t=0;td.b()-e.b())return d;for(var n=o.g(d.c(0))-o.g(e.c(0)),r=Array(d.b()),a=0;ar?t.push(r):2048>r?t.push(192|r>>6,128|63&r):55296>r||57344<=r?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t};var n={L:1,M:0,Q:3,H:2},r=function(){function e(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t}var n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r={w:function(t){for(var n=t<<10;0<=e(n)-e(1335);)n^=1335<t||40t?8:16},D:function(e){for(var t=e.h(),n=0,r=0;r=u;u+=1)if(!(0>r+u||t<=r+u))for(var s=-1;1>=s;s+=1)0>o+s||t<=o+s||(0!=u||0!=s)&&a==e.a(r+u,o+s)&&(d+=1);5n;n+=1)e[n]=1<n;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;255>n;n+=1)t[e[n]]=n;return{g:function(e){if(1>e)throw Error("glog("+e+")");return t[e]},i:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return e[t]}}}(),d=function(){function e(e,r){switch(r){case n.L:return t[4*(e-1)];case n.M:return t[4*(e-1)+1];case n.Q:return t[4*(e-1)+2];case n.H:return t[4*(e-1)+3]}}var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r={I:function(t,n){var r=e(t,n);if(void 0===r)throw Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+n);t=r.length/3,n=[];for(var o=0;o{const{connectionState:t,authState:n,authQrCode:r,settings:{byKey:{language:o}}}=e;return{connectionState:t,authState:n,authQrCode:r,language:o}}))((n=>{let{connectionState:r,authState:o,authQrCode:d,language:a}=n;const{returnToAuthPhoneNumber:u,setSettingOption:s}=(0,t.uC)(),i=oe(),c=(0,ne.Z)(),l=(0,R.sO)(null),f=re(i,"ContinueOnThisLanguage"),[h,m,p]=(0,D.Z)();(0,R.d4)((()=>{if(!d||"connectionStateReady"!==r)return;const e=l.current;e.innerHTML="",e.classList.remove("pre-animate"),Me.render({text:`tg://login?token=${d.token}`,radius:.5,ecLevel:"M",fill:"#4E96D4",size:280},e)}),[r,d]),(0,R.d4)((()=>{"connectionStateReady"===r&&(0,te.m0)(e.sR)}),[r]);const g=(0,R.I4)((()=>{m(),(0,te.m0)(i,(()=>{p(),s({language:i})}))}),[m,s,i,p]),v="authorizationStateWaitQrCode"===o;return R.ZP.createElement("div",{id:"auth-qr-form",className:"custom-scroll"},R.ZP.createElement("div",{className:"auth-form qr"},d?R.ZP.createElement("div",{key:"qr-container",className:"qr-container pre-animate",ref:l}):R.ZP.createElement("div",{key:"qr-loading",className:"qr-loading"},R.ZP.createElement(se.Z,null)),R.ZP.createElement("h3",null,c("Login.QR.Title")),R.ZP.createElement("ol",null,R.ZP.createElement("li",null,R.ZP.createElement("span",null,c("Login.QR.Help1"))),R.ZP.createElement("li",null,R.ZP.createElement("span",null,(0,ce.Z)(c("Login.QR.Help2"),["simple_markdown"]))),R.ZP.createElement("li",null,R.ZP.createElement("span",null,c("Login.QR.Help3")))),v&&R.ZP.createElement(de.Z,{isText:!0,onClick:u},c("Login.QR.Cancel")),i&&i!==a&&f&&R.ZP.createElement(de.Z,{isText:!0,isLoading:h,onClick:g},f)))}))),ke=(0,R.X$)((0,t.c$)((e=>(0,f.ei)(e,["authState"])))((e=>{let{authState:r}=e;const{reset:o,initApi:d,returnToAuthPhoneNumber:a,goToAuthQrCode:u}=(0,t.uC)();(0,R.d4)((()=>{o(),d()}),[o,d]);const s="iOS"===n.Lt||"Android"===n.Lt;switch((0,_.ZP)(!s&&"authorizationStateWaitPhoneNumber"===r||s&&"authorizationStateWaitQrCode"===r,(()=>{s?a():u()})),(0,R.d4)((()=>(F.Z.disableRefresh(),()=>{F.Z.enableRefresh()})),[]),r){case"authorizationStateWaitCode":return R.ZP.createElement(X,{page:"authCode",key:"authCode"},R.ZP.createElement(we,null));case"authorizationStateWaitPassword":return R.ZP.createElement(X,{page:"authPassword",key:"authPassword"},R.ZP.createElement(Ce,null));case"authorizationStateWaitRegistration":return R.ZP.createElement(Se,null);case"authorizationStateWaitPhoneNumber":return R.ZP.createElement(X,{page:"authPhoneNumber",key:"authPhoneNumber"},R.ZP.createElement(be,null));case"authorizationStateWaitQrCode":return R.ZP.createElement(X,{page:"authQrCode",key:"authQrCode"},R.ZP.createElement(Ae,null));default:return s?R.ZP.createElement(X,{page:"authPhoneNumber",key:"authPhoneNumber"},R.ZP.createElement(be,null)):R.ZP.createElement(X,{page:"authQrCode",key:"authQrCode"},R.ZP.createElement(Ae,null))}}))),Te=(0,R.X$)((()=>{const e=(0,Ie.Z)(H.gl.Main,"Main");return e?R.ZP.createElement(e,null):void 0}));var Ne=s(5359);const Le=()=>R.ZP.createElement("div",{id:"AppInactive"},R.ZP.createElement("div",{className:"content"},R.ZP.createElement("img",{src:Ne,alt:""}),R.ZP.createElement("h3",{className:"title"},"Such error, many tabs"),R.ZP.createElement("div",{className:"description"},"Telegram supports only one active tab with the app.",R.ZP.createElement("br",null),"Please reload this page to continue using this tab or close it."),R.ZP.createElement("div",{className:"actions"},R.ZP.createElement(de.Z,{isText:!0,ripple:!0,onClick:()=>{window.location.reload()}},"Reload app"))));function Re(){return t.ZP.createElement(X,{page:"main",key:"main"},t.ZP.createElement(Te,null))}const Fe=(0,t.c$)((e=>(0,f.ei)(e,["authState"])))((n=>{let{authState:r}=n;const{disconnect:o}=(0,t.uC)(),[d,a]=(0,D.Z)(!1);if((0,R.d4)((()=>{(0,F.z)(),O=()=>{o(),document.title=`${e.Ti}${e.ou}`,a()}}),[o,a]),d)return t.ZP.createElement(Le,null);if(r)switch(r){case"authorizationStateWaitPhoneNumber":case"authorizationStateWaitCode":case"authorizationStateWaitPassword":case"authorizationStateWaitRegistration":case"authorizationStateWaitQrCode":return t.ZP.createElement(ke,null);case"authorizationStateClosed":case"authorizationStateClosing":case"authorizationStateLoggingOut":case"authorizationStateReady":return Re()}return(0,m.ti)(!0)?Re():t.ZP.createElement(ke,null)}));e.eM&&console.log(">>> INIT"),(0,t.uC)().init(),e.eM&&console.log(">>> START INITIAL RENDER"),a.Z.render(t.ZP.createElement(Fe,null),document.getElementById("root")),e.eM&&console.log(">>> FINISH INITIAL RENDER"),document.addEventListener("dblclick",(()=>{console.warn("GLOBAL STATE",(0,t.Rd)())}))})()})(); -//# sourceMappingURL=main.fe60a7529fd8efae014a.js.map \ No newline at end of file diff --git a/dist/main.fe60a7529fd8efae014a.js.map b/dist/main.fe60a7529fd8efae014a.js.map deleted file mode 100644 index e65bcbf7..00000000 --- a/dist/main.fe60a7529fd8efae014a.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.fe60a7529fd8efae014a.js","mappings":"uBACIA,EADAC,ECAAC,EACAC,ECwCAC,EASAC,E,wFC/BJ,IAAIC,EACJ,MAAMC,EAAgB,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BAAC,EAAD,CAAU9iB,KAAK,OAAO1kD,IAAI,QACxB,mBAAC,GAAD,OAKN,UAAena,EAAAA,EAAAA,KACZC,IAAuBwkC,EAAAA,EAAAA,IAAKxkC,EAAQ,CAAC,eADxC,EAhD4B,IAAmB,IAAlB,UAAE6qB,GAAgB,EAC7C,MAAM,WAAE82D,IAAejyF,EAAAA,EAAAA,OAEhBsrD,EAAY4mC,IAAgB1mF,EAAAA,EAAAA,IAAQ,GAc3C,IAZAU,EAAAA,EAAAA,KAAU,MACR4zE,EAAAA,EAAAA,KfTFvmF,EeU6B,KACzB04F,IACAvwF,SAASX,MAAS,GAAE+W,EAAAA,KAAaC,EAAAA,KAEjCm6E,OAED,CAACD,EAAYC,IAIZ5mC,EACF,OAAO,mBAAC,GAAD,MAGT,GAAInwB,EACF,OAAQA,GACN,IAAK,oCACL,IAAK,6BACL,IAAK,iCACL,IAAK,qCACL,IAAK,+BACH,OAAO,mBAAC,GAAD,MACT,IAAK,2BACL,IAAK,4BACL,IAAK,+BACL,IAAK,0BACH,OAAO62D,KAIb,OAAO9W,EAAAA,EAAAA,KAAiB,GAAQ8W,KAAe,mBAAC,GAAD,SC3C7Cz5F,EAAAA,IAEFC,QAAQC,IAAI,aAGduH,EAAAA,EAAAA,MAAcg1B,OAEVz8B,EAAAA,IAEFC,QAAQC,IAAI,4BAGd05F,EAAAA,EAAAA,OACE,mBAAC,GAAD,MACAzwF,SAAS8pF,eAAe,SAGtBjzF,EAAAA,IAEFC,QAAQC,IAAI,6BAGdiJ,SAAS9I,iBAAiB,YAAY,KAEpCJ,QAAQ4B,KAAK,gBAAgBm4B,EAAAA,EAAAA,W","sources":["webpack://telegram-t/webpack/runtime/create fake namespace object","webpack://telegram-t/webpack/runtime/load script","webpack://telegram-t/webpack/runtime/css loading","webpack://telegram-t/./src/api/gramjs/worker/provider.ts","webpack://telegram-t/./src/api/types/media.ts","webpack://telegram-t/./src/api/types/messages.ts","webpack://telegram-t/./src/lib/punycode.js","webpack://telegram-t/./src/components/common/SafeLink.tsx","webpack://telegram-t/./src/components/common/helpers/documentInfo.ts","webpack://telegram-t/./src/components/common/helpers/parseEmojiOnlyString.ts","webpack://telegram-t/./src/components/common/UserLink.tsx","webpack://telegram-t/./src/components/common/MessageLink.tsx","webpack://telegram-t/./src/components/common/ChatLink.tsx","webpack://telegram-t/./src/components/common/GroupCallLink.tsx","webpack://telegram-t/./src/components/common/helpers/renderActionMessageText.tsx","webpack://telegram-t/./src/components/common/helpers/renderMessageText.ts","webpack://telegram-t/./src/components/common/helpers/renderText.tsx","webpack://telegram-t/./src/components/common/spoiler/Spoiler.tsx","webpack://telegram-t/./src/components/common/helpers/renderTextWithEntities.tsx","webpack://telegram-t/./src/components/middle/helpers/preventMessageInputBlur.ts","webpack://telegram-t/./src/components/middle/message/MentionLink.tsx","webpack://telegram-t/./src/components/ui/Button.tsx","webpack://telegram-t/./src/components/ui/Checkbox.tsx","webpack://telegram-t/./src/components/ui/DropdownMenu.tsx","webpack://telegram-t/./src/components/ui/InputText.tsx","webpack://telegram-t/./src/components/ui/Link.tsx","webpack://telegram-t/./src/components/ui/Loading.tsx","webpack://telegram-t/./src/components/ui/Menu.tsx","webpack://telegram-t/./src/components/ui/MenuItem.tsx","webpack://telegram-t/./src/components/ui/RippleEffect.tsx","webpack://telegram-t/./src/components/ui/Spinner.tsx","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/hooks/useEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useFlag.ts","webpack://telegram-t/./src/hooks/useForceUpdate.ts","webpack://telegram-t/./src/hooks/useHeavyAnimationCheck.ts","webpack://telegram-t/./src/hooks/useHistoryBack.ts","webpack://telegram-t/./src/hooks/useKeyboardListNavigation.ts","webpack://telegram-t/./src/hooks/useLang.ts","webpack://telegram-t/./src/hooks/useModuleLoader.ts","webpack://telegram-t/./src/hooks/useOnChange.ts","webpack://telegram-t/./src/hooks/usePrevious.ts","webpack://telegram-t/./src/hooks/useShowTransition.ts","webpack://telegram-t/./src/hooks/useVirtualBackdrop.ts","webpack://telegram-t/./src/lib/teact/dom-events.ts","webpack://telegram-t/./src/lib/teact/teact-dom.ts","webpack://telegram-t/./src/lib/teact/teact.ts","webpack://telegram-t/./src/lib/teact/teactn.tsx","webpack://telegram-t/./src/lib/twemojiRegex.js","webpack://telegram-t/./src/modules/actions/api/initial.ts","webpack://telegram-t/./src/modules/actions/api/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/initial.ts","webpack://telegram-t/./src/modules/actions/ui/initial.ts","webpack://telegram-t/./src/modules/actions/ui/settings.ts","webpack://telegram-t/./src/modules/helpers/chats.ts","webpack://telegram-t/./src/modules/helpers/messages.ts","webpack://telegram-t/./src/modules/helpers/messageSummary.ts","webpack://telegram-t/./src/modules/helpers/messageMedia.ts","webpack://telegram-t/./src/modules/helpers/localSearch.ts","webpack://telegram-t/./src/modules/helpers/payments.ts","webpack://telegram-t/./src/modules/helpers/reactions.ts","webpack://telegram-t/./src/modules/helpers/users.ts","webpack://telegram-t/./src/modules/reducers/chats.ts","webpack://telegram-t/./src/modules/reducers/symbols.ts","webpack://telegram-t/./src/modules/reducers/users.ts","webpack://telegram-t/./src/modules/reducers/globalSearch.ts","webpack://telegram-t/./src/modules/reducers/localSearch.ts","webpack://telegram-t/./src/modules/reducers/management.ts","webpack://telegram-t/./src/modules/reducers/settings.ts","webpack://telegram-t/./src/modules/reducers/twoFaSettings.ts","webpack://telegram-t/./src/modules/reducers/payments.ts","webpack://telegram-t/./src/modules/reducers/messages.ts","webpack://telegram-t/./src/modules/selectors/chats.ts","webpack://telegram-t/./src/modules/selectors/symbols.ts","webpack://telegram-t/./src/modules/selectors/messages.ts","webpack://telegram-t/./src/modules/selectors/localSearch.ts","webpack://telegram-t/./src/modules/selectors/management.ts","webpack://telegram-t/./src/modules/selectors/ui.ts","webpack://telegram-t/./src/modules/selectors/globalSearch.ts","webpack://telegram-t/./src/modules/selectors/payments.ts","webpack://telegram-t/./src/modules/selectors/settings.ts","webpack://telegram-t/./src/modules/selectors/users.ts","webpack://telegram-t/./src/types/index.ts","webpack://telegram-t/./src/util/animation.ts","webpack://telegram-t/./src/util/appBadge.ts","webpack://telegram-t/./src/util/arePropsShallowEqual.ts","webpack://telegram-t/./src/util/buildClassName.ts","webpack://telegram-t/./src/util/cacheApi.ts","webpack://telegram-t/./src/util/callbacks.ts","webpack://telegram-t/./src/util/captureEscKeyListener.ts","webpack://telegram-t/./src/util/captureKeyboardListeners.ts","webpack://telegram-t/./src/util/dateFormat.ts","webpack://telegram-t/./src/util/emoji.ts","webpack://telegram-t/./src/util/ensureProtocol.ts","webpack://telegram-t/./src/util/environmentWebp.ts","webpack://telegram-t/./src/util/environmentSystemTheme.ts","webpack://telegram-t/./src/util/environment.ts","webpack://telegram-t/./src/util/files.ts","webpack://telegram-t/./src/util/folderManager.ts","webpack://telegram-t/./src/util/formatCurrency.ts","webpack://telegram-t/./src/util/generateIdFor.ts","webpack://telegram-t/./src/util/getReadableErrorText.ts","webpack://telegram-t/./src/util/handleError.ts","webpack://telegram-t/./src/util/iteratees.ts","webpack://telegram-t/./src/util/langProvider.ts","webpack://telegram-t/./src/util/oggToWav.ts","webpack://telegram-t/./src/util/mediaLoader.ts","webpack://telegram-t/./src/util/memo.ts","webpack://telegram-t/./src/util/moduleLoader.ts","webpack://telegram-t/./src/util/notifications.ts","webpack://telegram-t/./src/util/permanentWebVersion.ts","webpack://telegram-t/./src/util/phoneNumber.ts","webpack://telegram-t/./src/util/routing.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/util/searchWords.ts","webpack://telegram-t/./src/util/serverTime.ts","webpack://telegram-t/./node_modules/idb-keyval/dist/index.js","webpack://telegram-t/./node_modules/safari-14-idb-fix/dist/index.js","webpack://telegram-t/./src/util/sessions.ts","webpack://telegram-t/./src/util/switchTheme.ts","webpack://telegram-t/./src/util/textFormat.ts","webpack://telegram-t/./src/util/trimText.ts","webpack://telegram-t/./src/util/webpToPng.ts","webpack://telegram-t/./src/util/websync.ts","webpack://telegram-t/./src/util/windowSize.ts","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/compat get default export","webpack://telegram-t/webpack/runtime/define property getters","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/make namespace object","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/jsonp chunk loading","webpack://telegram-t/./src/util/setupServiceWorker.ts","webpack://telegram-t/./src/global/initial.ts","webpack://telegram-t/./src/global/cache.ts","webpack://telegram-t/./src/global/index.ts","webpack://telegram-t/./src/util/activeTabMonitor.ts","webpack://telegram-t/./src/util/fonts.ts","webpack://telegram-t/./src/components/common/UiLoader.tsx","webpack://telegram-t/./src/hooks/useLangString.ts","webpack://telegram-t/./src/components/auth/helpers/getSuggestedLanguage.ts","webpack://telegram-t/./src/components/auth/CountryCodeInput.tsx","webpack://telegram-t/./src/components/auth/AuthPhoneNumber.tsx","webpack://telegram-t/./src/components/auth/AuthCode.async.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.async.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.async.tsx","webpack://telegram-t/./node_modules/qr-creator/dist/qr-creator.es6.min.js","webpack://telegram-t/./src/components/auth/AuthQrCode.tsx","webpack://telegram-t/./src/components/auth/Auth.tsx","webpack://telegram-t/./src/components/main/Main.async.tsx","webpack://telegram-t/./src/components/main/AppInactive.tsx","webpack://telegram-t/./src/App.tsx","webpack://telegram-t/./src/index.tsx"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"telegram-t:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var createStylesheet = (chunkId, fullhref, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"47\":1,\"133\":1,\"176\":1,\"347\":1,\"472\":1,\"687\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","import { Api } from '../../../lib/gramjs';\nimport { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';\nimport { Methods, MethodArgs, MethodResponse } from '../methods/types';\nimport { WorkerMessageEvent, OriginRequest } from './types';\n\nimport { DEBUG } from '../../../config';\nimport generateIdFor from '../../../util/generateIdFor';\nimport { pause } from '../../../util/schedulers';\n\ntype RequestStates = {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback?: AnyToVoidFunction;\n};\n\nconst HEALTH_CHECK_TIMEOUT = 150;\nconst HEALTH_CHECK_MIN_DELAY = 5 * 1000; // 5 sec\n\nlet worker: Worker;\nconst requestStates = new Map();\nconst requestStatesByCallback = new Map();\n\n// TODO Re-use `util/WorkerConnector.ts`\n\nexport function initApi(onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD WORKER');\n }\n\n worker = new Worker(new URL('./worker.ts', import.meta.url));\n subscribeToWorker(onUpdate);\n\n if (initialArgs.platform === 'iOS') {\n setupIosHealthCheck();\n }\n }\n\n return makeRequest({\n type: 'initApi',\n args: [initialArgs],\n });\n}\n\nexport function callApi(fnName: T, ...args: MethodArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('API is not initialized');\n }\n\n return undefined;\n }\n\n const promise = makeRequest({\n type: 'callMethod',\n name: fnName,\n args,\n });\n\n // Some TypeScript magic to make sure `VirtualClass` is never returned from any method\n if (DEBUG) {\n (async () => {\n try {\n type ForbiddenTypes =\n Api.VirtualClass\n | (Api.VirtualClass | undefined)[];\n type ForbiddenResponses =\n ForbiddenTypes\n | (AnyLiteral & { [k: string]: ForbiddenTypes });\n\n // Unwrap all chained promises\n const response = await promise;\n // Make sure responses do not include `VirtualClass` instances\n const allowedResponse: Exclude = response;\n // Suppress \"unused variable\" constraint\n void allowedResponse;\n } catch (err) {\n // Do noting\n }\n })();\n }\n\n return promise as MethodResponse;\n}\n\nexport function cancelApiProgress(progressCallback: ApiOnProgress) {\n progressCallback.isCanceled = true;\n\n const { messageId } = requestStatesByCallback.get(progressCallback) || {};\n if (!messageId) {\n return;\n }\n\n worker.postMessage({\n type: 'cancelProgress',\n messageId,\n });\n}\n\nfunction subscribeToWorker(onUpdate: OnApiUpdate) {\n worker.addEventListener('message', ({ data }: WorkerMessageEvent) => {\n if (data.type === 'update') {\n onUpdate(data.update);\n } else if (data.type === 'methodResponse') {\n const requestState = requestStates.get(data.messageId);\n if (requestState) {\n if (data.error) {\n requestState.reject(data.error);\n } else {\n requestState.resolve(data.response);\n }\n }\n } else if (data.type === 'methodCallback') {\n requestStates.get(data.messageId)?.callback?.(...data.callbackArgs);\n } else if (data.type === 'unhandledError') {\n throw new Error(data.error?.message);\n }\n });\n}\n\nfunction makeRequest(message: OriginRequest) {\n const messageId = generateIdFor(requestStates);\n const payload: OriginRequest = {\n messageId,\n ...message,\n };\n\n const requestState = { messageId } as RequestStates;\n\n // Re-wrap type because of `postMessage`\n const promise: Promise> = new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n });\n\n if (('args' in payload) && typeof payload.args[1] === 'function') {\n const callback = payload.args.pop() as AnyToVoidFunction;\n requestState.callback = callback;\n requestStatesByCallback.set(callback, requestState);\n }\n\n requestStates.set(messageId, requestState);\n\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n\n if (requestState.callback) {\n requestStatesByCallback.delete(requestState.callback);\n }\n });\n\n worker.postMessage(payload);\n\n return promise;\n}\n\nconst startedAt = Date.now();\n\n// Workaround for iOS sometimes stops interacting with worker\nfunction setupIosHealthCheck() {\n window.addEventListener('focus', () => {\n void ensureWorkerPing();\n // Sometimes a single check is not enough\n setTimeout(() => ensureWorkerPing(), 1000);\n });\n}\n\nasync function ensureWorkerPing() {\n try {\n await Promise.race([\n makeRequest({ type: 'ping' }),\n pause(HEALTH_CHECK_TIMEOUT).then(() => Promise.reject(new Error('HEALTH_CHECK_TIMEOUT'))),\n ]);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (Date.now() - startedAt >= HEALTH_CHECK_MIN_DELAY) {\n window.location.reload();\n }\n }\n}\n","// We cache avatars as Data URI for faster initial load\n// and messages media as Blob for smaller size.\n\nexport enum ApiMediaFormat {\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | ArrayBuffer;\nexport type ApiPreparedMedia = string;\n","import { ApiGroupCall } from './calls';\n\nexport interface ApiDimensions {\n width: number;\n height: number;\n}\n\nexport interface ApiPhotoSize extends ApiDimensions {\n type: 's' | 'm' | 'x' | 'y' | 'z';\n}\n\nexport interface ApiThumbnail extends ApiDimensions {\n dataUri: string;\n}\n\nexport interface ApiPhoto {\n id: string;\n thumbnail?: ApiThumbnail;\n sizes: ApiPhotoSize[];\n blobUrl?: string;\n}\n\nexport interface ApiSticker {\n id: string;\n stickerSetId: string;\n stickerSetAccessHash?: string;\n emoji?: string;\n isLottie: boolean;\n isGif: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isLottie?: true;\n isGifs?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\n shortName: string;\n}\n\nexport interface ApiVideo {\n id: string;\n mimeType: string;\n duration: number;\n fileName: string;\n width?: number;\n height?: number;\n supportsStreaming?: boolean;\n isRound?: boolean;\n isGif?: boolean;\n thumbnail?: ApiThumbnail;\n blobUrl?: string;\n size: number;\n}\n\nexport interface ApiAudio {\n id: string;\n size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n thumbnailSizes?: ApiPhotoSize[];\n}\n\nexport interface ApiVoice {\n id: string;\n duration: number;\n waveform?: number[];\n}\n\nexport interface ApiDocument {\n id?: string;\n fileName: string;\n size: number;\n timestamp?: number;\n mimeType: string;\n thumbnail?: ApiThumbnail;\n previewBlobUrl?: string;\n mediaType?: 'photo' | 'video';\n mediaSize?: ApiDimensions;\n}\n\nexport interface ApiContact {\n firstName: string;\n lastName: string;\n phoneNumber: string;\n userId: string;\n}\n\nexport interface ApiPollAnswer {\n text: string;\n option: string;\n}\n\nexport interface ApiPollResult {\n isChosen?: true;\n isCorrect?: true;\n option: string;\n votersCount: number;\n}\n\nexport interface ApiPoll {\n id: string;\n summary: {\n closed?: true;\n isPublic?: true;\n multipleChoice?: true;\n quiz?: true;\n question: string;\n answers: ApiPollAnswer[];\n closePeriod?: number;\n closeDate?: number;\n };\n results: {\n results?: ApiPollResult[];\n totalVoters?: number;\n recentVoterIds?: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n amount: number;\n currency: string;\n receiptMsgId?: number;\n isTest?: boolean;\n}\n\nexport type ApiNewPoll = {\n summary: ApiPoll['summary'];\n quiz?: {\n correctAnswers: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n};\n\nexport interface ApiAction {\n text: string;\n targetUserIds?: string[];\n targetChatId?: string;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n amount?: number;\n currency?: string;\n translationValues: string[];\n call?: Partial;\n}\n\nexport interface ApiWebPage {\n id: number;\n url: string;\n displayUrl: string;\n type?: string;\n siteName?: string;\n title?: string;\n description?: string;\n photo?: ApiPhoto;\n duration?: number;\n document?: ApiDocument;\n video?: ApiVideo;\n}\n\nexport interface ApiMessageForwardInfo {\n date: number;\n isChannelPost: boolean;\n channelPostId?: number;\n isLinkedChannelPost?: boolean;\n fromChatId?: string;\n senderUserId?: string;\n fromMessageId?: number;\n hiddenUserName?: string;\n adminTitle?: string;\n}\n\nexport interface ApiMessageEntity {\n type: string;\n offset: number;\n length: number;\n userId?: string;\n url?: string;\n}\n\nexport enum ApiMessageEntityTypes {\n Bold = 'MessageEntityBold',\n Blockquote = 'MessageEntityBlockquote',\n BotCommand = 'MessageEntityBotCommand',\n Cashtag = 'MessageEntityCashtag',\n Code = 'MessageEntityCode',\n Email = 'MessageEntityEmail',\n Hashtag = 'MessageEntityHashtag',\n Italic = 'MessageEntityItalic',\n MentionName = 'MessageEntityMentionName',\n Mention = 'MessageEntityMention',\n Phone = 'MessageEntityPhone',\n Pre = 'MessageEntityPre',\n Strike = 'MessageEntityStrike',\n TextUrl = 'MessageEntityTextUrl',\n Url = 'MessageEntityUrl',\n Underline = 'MessageEntityUnderline',\n Spoiler = 'MessageEntitySpoiler',\n Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: string;\n content: {\n text?: ApiFormattedText;\n photo?: ApiPhoto;\n video?: ApiVideo;\n document?: ApiDocument;\n sticker?: ApiSticker;\n contact?: ApiContact;\n poll?: ApiPoll;\n action?: ApiAction;\n webPage?: ApiWebPage;\n audio?: ApiAudio;\n voice?: ApiVoice;\n invoice?: ApiInvoice;\n };\n date: number;\n isOutgoing: boolean;\n senderId?: string;\n replyToChatId?: string;\n replyToMessageId?: number;\n replyToTopMessageId?: number;\n sendingState?: 'messageSendingStatePending' | 'messageSendingStateFailed';\n forwardInfo?: ApiMessageForwardInfo;\n isDeleting?: boolean;\n previousLocalId?: number;\n views?: number;\n isEdited?: boolean;\n editDate?: number;\n isMentioned?: boolean;\n isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n viaBotId?: string;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n seenByUserIds?: string[];\n isProtected?: boolean;\n reactors?: {\n nextOffset?: string;\n count: number;\n reactions: ApiUserReaction[];\n };\n reactions?: ApiReactions;\n}\n\nexport interface ApiReactions {\n canSeeList?: boolean;\n results: ApiReactionCount[];\n recentReactions?: ApiUserReaction[];\n}\n\nexport interface ApiUserReaction {\n userId: string;\n reaction: string;\n}\n\nexport interface ApiReactionCount {\n isChosen?: boolean;\n count: number;\n reaction: string;\n}\n\nexport interface ApiAvailableReaction {\n selectAnimation?: ApiDocument;\n staticIcon?: ApiDocument;\n centerIcon?: ApiDocument;\n aroundAnimation?: ApiDocument;\n reaction: string;\n title: string;\n isInactive?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: string;\n topMessageId?: number;\n originChannelId?: string;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: string[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport type ApiSponsoredMessage = {\n chatId?: string;\n randomId: string;\n isBot?: boolean;\n channelPostId?: number;\n startParam?: string;\n chatInviteHash?: string;\n chatInviteTitle?: string;\n text: ApiFormattedText;\n expiresAt: number;\n};\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'requestSelfContact' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\nexport type ApiReplyKeyboard = {\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n} & {\n [K in 'inlineButtons' | 'keyboardButtons']?: ApiKeyboardButtons;\n};\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice' | 'profilePhoto';\nexport type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\n\nexport type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'\n| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';\n\nexport type ApiSendMessageAction = {\n type: 'cancel' | 'typing' | 'recordAudio' | 'chooseSticker';\n};\n\nexport const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n\nconst utf16 = {\n // The utf16-class is necessary to convert from javascripts internal character representation to unicode and back.\n decode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n let extra;\n\n while (i < len) {\n value = input.charCodeAt(i++);\n if ((value & 0xf800) === 0xd800) {\n extra = input.charCodeAt(i++);\n if ((value & 0xfc00) !== 0xd800 || (extra & 0xfc00) !== 0xdc00) {\n throw new RangeError('UTF-16(decode): Illegal UTF-16 sequence');\n }\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n output.push(value);\n }\n return output;\n },\n encode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n\n while (i < len) {\n value = input[i++];\n if ((value & 0xf800) === 0xd800) {\n throw new RangeError('UTF-16(encode): Illegal UTF-16 value');\n }\n if (value > 0xffff) {\n value -= 0x10000;\n output.push(String.fromCharCode(((value >>> 10) & 0x3ff) | 0xd800));\n value = 0xdc00 | (value & 0x3ff);\n }\n output.push(String.fromCharCode(value));\n }\n return output.join('');\n },\n};\n\n// Default parameters\nconst initial_n = 0x80;\nconst initial_bias = 72;\nconst delimiter = '\\x2D';\nconst base = 36;\nconst damp = 700;\nconst tmin = 1;\nconst tmax = 26;\nconst skew = 38;\nconst maxint = 0x7fffffff;\n\n// decode_digit(cp) returns the numeric value of a basic code\n// point (for use in representing integers) in the range 0 to\n// base-1, or base if cp is does not represent a value.\n\nfunction decode_digit(cp) {\n return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base;\n}\n\n// ** Bias adaptation function **\nfunction adapt(delta, numpoints, firsttime) {\n let k;\n delta = firsttime ? Math.floor(delta / damp) : delta >> 1;\n delta += Math.floor(delta / numpoints);\n\n for (k = 0; delta > ((base - tmin) * tmax) >> 1; k += base) {\n delta = Math.floor(delta / (base - tmin));\n }\n return Math.floor(k + ((base - tmin + 1) * delta) / (delta + skew));\n}\n\n// Main decode\nfunction decode(input, preserveCase) {\n // Dont use utf16\n const output = [];\n const case_flags = [];\n const input_length = input.length;\n\n let n; let out; let i; let bias; let basic; let j; let ic; let oldi; let w; let k; let digit; let t; let len;\n\n // Initialize the state:\n\n n = initial_n;\n i = 0;\n bias = initial_bias;\n\n // Handle the basic code points: Let basic be the number of input code\n // points before the last delimiter, or 0 if there is none, then\n // copy the first basic code points to the output.\n\n basic = input.lastIndexOf(delimiter);\n if (basic < 0) basic = 0;\n\n for (j = 0; j < basic; ++j) {\n if (preserveCase) case_flags[output.length] = input.charCodeAt(j) - 65 < 26;\n if (input.charCodeAt(j) >= 0x80) {\n throw new RangeError('Illegal input >= 0x80');\n }\n output.push(input.charCodeAt(j));\n }\n\n // Main decoding loop: Start just after the last delimiter if any\n // basic code points were copied; start at the beginning otherwise.\n\n for (ic = basic > 0 ? basic + 1 : 0; ic < input_length;) {\n // ic is the index of the next character to be consumed,\n\n // Decode a generalized variable-length integer into delta,\n // which gets added to i. The overflow checking is easier\n // if we increase i as we go, then subtract off its starting\n // value at the end to obtain delta.\n for (oldi = i, w = 1, k = base; ; k += base) {\n if (ic >= input_length) {\n throw RangeError('punycode_bad_input(1)');\n }\n digit = decode_digit(input.charCodeAt(ic++));\n\n if (digit >= base) {\n throw RangeError('punycode_bad_input(2)');\n }\n if (digit > Math.floor((maxint - i) / w)) {\n throw RangeError('punycode_overflow(1)');\n }\n i += digit * w;\n t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;\n if (digit < t) {\n break;\n }\n if (w > Math.floor(maxint / (base - t))) {\n throw RangeError('punycode_overflow(2)');\n }\n w *= base - t;\n }\n\n out = output.length + 1;\n bias = adapt(i - oldi, out, oldi === 0);\n\n // i was supposed to wrap around from out to 0,\n // incrementing n each time, so we'll fix that now:\n if (Math.floor(i / out) > maxint - n) {\n throw RangeError('punycode_overflow(3)');\n }\n n += Math.floor(i / out);\n i %= out;\n\n // Insert n at position i of the output:\n // Case of last character determines uppercase flag:\n if (preserveCase) {\n case_flags.splice(i, 0, input.charCodeAt(ic - 1) - 65 < 26);\n }\n\n output.splice(i, 0, n);\n i++;\n }\n if (preserveCase) {\n for (i = 0, len = output.length; i < len; i++) {\n if (case_flags[i]) {\n output[i] = String.fromCharCode(output[i])\n .toUpperCase()\n .charCodeAt(0);\n }\n }\n }\n return utf16.encode(output);\n}\n\nfunction toUnicode(domain) {\n const domain_array = domain.split('.');\n const out = [];\n for (let i = 0; i < domain_array.length; ++i) {\n const s = domain_array[i];\n out.push(s.match(/^xn--/) ? decode(s.slice(4)) : s);\n }\n return out.join('.');\n}\n\nexport default toUnicode;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\nimport convertPunycode from '../../lib/punycode';\n\nimport {\n DEBUG, RE_TG_LINK, RE_TME_LINK,\n} from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport { ensureProtocol } from '../../util/ensureProtocol';\n\ntype OwnProps = {\n url?: string;\n text: string;\n className?: string;\n children?: React.ReactNode;\n isRtl?: boolean;\n};\n\nconst SafeLink: FC = ({\n url,\n text,\n className,\n children,\n isRtl,\n}) => {\n const { toggleSafeLinkModal, openTelegramLink } = getDispatch();\n\n const content = children || text;\n const isNotSafe = url !== content;\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (\n e.ctrlKey || e.altKey || e.shiftKey || e.metaKey\n || !url || (!url.match(RE_TME_LINK) && !url.match(RE_TG_LINK))\n ) {\n if (isNotSafe) {\n toggleSafeLinkModal({ url });\n\n e.preventDefault();\n return false;\n }\n\n return true;\n }\n\n e.preventDefault();\n openTelegramLink({ url });\n\n return false;\n }, [isNotSafe, openTelegramLink, toggleSafeLinkModal, url]);\n\n if (!url) {\n return undefined;\n }\n\n const classNames = buildClassName(\n className || 'text-entity-link',\n text.length > 50 && 'long-word-break-all',\n );\n\n return (\n \n {content}\n \n );\n};\n\nfunction getDomain(url?: string) {\n if (!url) {\n return undefined;\n }\n\n const href = ensureProtocol(url);\n if (!href) {\n return undefined;\n }\n\n try {\n let decodedHref = decodeURI(href);\n\n const match = decodedHref.match(/^https?:\\/\\/([^/:?#]+)(?:[/:?#]|$)/i);\n if (!match) {\n return undefined;\n }\n const domain = match[1];\n decodedHref = decodedHref.replace(domain, convertPunycode(domain));\n\n return decodedHref;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('SafeLink.getDecodedUrl error ', url, error);\n }\n }\n\n return undefined;\n}\n\nexport default memo(SafeLink);\n","import { ApiDocument } from '../../../api/types';\n\nconst ONE_GIGABYTE = 1024 * 1024 * 1024;\nconst ONE_MEGABYTE = 1024 * 1024;\n\nexport function getFileSizeString(bytes: number) {\n if (bytes > (ONE_GIGABYTE / 2)) {\n return `${(bytes / ONE_GIGABYTE).toFixed(1)} GB`;\n }\n if (bytes > (ONE_MEGABYTE / 2)) {\n return `${(bytes / ONE_MEGABYTE).toFixed(1)} MB`;\n }\n return `${(bytes / (1024)).toFixed(1)} KB`;\n}\n\nexport function getDocumentExtension(document: ApiDocument) {\n const { fileName, mimeType } = document;\n\n return getFileExtension(fileName, mimeType);\n}\n\nexport function getFileExtension(fileName: string, mimeType: string) {\n if (fileName && fileName.indexOf('.') !== -1) {\n return fileName.split('.').pop();\n } else {\n return mimeType.split('/').pop();\n }\n}\n\nexport function getColorFromExtension(extension: string) {\n switch (extension) {\n case 'apk':\n case 'xls':\n case 'xlsx':\n return 'green';\n case 'zip':\n case 'rar':\n case '7z':\n case 'tar':\n case 'gz':\n case 'ppt':\n case 'pptx':\n return 'orange';\n case 'pdf':\n case 'xps':\n return 'red';\n default:\n return 'default';\n }\n}\n\nexport function getDocumentHasPreview(document: ApiDocument) {\n return Boolean(document.previewBlobUrl || document.thumbnail);\n}\n","import twemojiRegex from '../../../lib/twemojiRegex';\n\nconst DETECT_UP_TO = 3;\nconst MAX_LENGTH = DETECT_UP_TO * 8; // Maximum 8 per one emoji.\nconst RE_EMOJI_ONLY = new RegExp(`^(?:${twemojiRegex.source})+$`, '');\n\nconst parseEmojiOnlyString = (text: string): number | false => {\n if (text.length > MAX_LENGTH) {\n return false;\n }\n\n const isEmojiOnly = Boolean(text.match(RE_EMOJI_ONLY));\n if (!isEmojiOnly) {\n return false;\n }\n\n let emojiCount = 0;\n while (twemojiRegex.exec(text)) {\n emojiCount++;\n\n if (emojiCount > DETECT_UP_TO) {\n twemojiRegex.lastIndex = 0;\n return false;\n }\n }\n\n return emojiCount;\n};\n\nexport default parseEmojiOnlyString;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\nimport { getDispatch } from '../../lib/teact/teactn';\n\ntype OwnProps = {\n className?: string;\n sender?: ApiUser | ApiChat;\n children: React.ReactNode;\n};\n\nconst UserLink: FC = ({\n className, sender, children,\n}) => {\n const { openChat } = getDispatch();\n\n const handleClick = useCallback(() => {\n if (sender) {\n openChat({ id: sender.id });\n }\n }, [sender, openChat]);\n\n if (!sender) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default UserLink;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n message?: ApiMessage;\n children: React.ReactNode;\n};\n\nconst MessageLink: FC = ({\n className, message, children,\n}) => {\n const { focusMessage } = getDispatch();\n\n const handleMessageClick = useCallback((): void => {\n if (message) {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }\n }, [focusMessage, message]);\n\n if (!message) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default MessageLink;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n chatId?: string;\n children: React.ReactNode;\n};\n\nconst ChatLink: FC = ({\n className, chatId, children,\n}) => {\n const { openChat } = getDispatch();\n\n const handleClick = useCallback(() => {\n if (chatId) {\n openChat({ id: chatId });\n }\n }, [chatId, openChat]);\n\n if (!chatId) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default ChatLink;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport { ApiGroupCall } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\nimport { getDispatch } from '../../lib/teact/teactn';\n\ntype OwnProps = {\n className?: string;\n groupCall?: Partial;\n children: React.ReactNode;\n};\n\nconst GroupCallLink: FC = ({\n className, groupCall, children,\n}) => {\n const { joinGroupCall } = getDispatch();\n\n const handleClick = useCallback(() => {\n if (groupCall) {\n joinGroupCall({ id: groupCall.id, accessHash: groupCall.accessHash });\n }\n }, [groupCall, joinGroupCall]);\n\n if (!groupCall) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default GroupCallLink;\n","import React from '../../../lib/teact/teact';\n\nimport {\n ApiChat, ApiMessage, ApiUser, ApiGroupCall,\n} from '../../../api/types';\nimport { LangFn } from '../../../hooks/useLang';\nimport {\n getChatTitle,\n getMessageSummaryText,\n getUserFullName,\n} from '../../../modules/helpers';\nimport trimText from '../../../util/trimText';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport { TextPart, renderMessageSummary } from './renderMessageText';\nimport renderText from './renderText';\n\nimport UserLink from '../UserLink';\nimport MessageLink from '../MessageLink';\nimport ChatLink from '../ChatLink';\nimport GroupCallLink from '../GroupCallLink';\n\ninterface RenderOptions {\n asPlainText?: boolean;\n asTextWithSpoilers?: boolean;\n}\n\nconst MAX_LENGTH = 32;\nconst NBSP = '\\u00A0';\n\nexport function renderActionMessageText(\n lang: LangFn,\n message: ApiMessage,\n actionOriginUser?: ApiUser,\n actionOriginChat?: ApiChat,\n targetUsers?: ApiUser[],\n targetMessage?: ApiMessage,\n targetChatId?: string,\n options: RenderOptions = {},\n) {\n if (!message.content.action) {\n return [];\n }\n\n const {\n text, translationValues, amount, currency, call,\n } = message.content.action;\n const content: TextPart[] = [];\n const noLinks = options.asPlainText || options.asTextWithSpoilers;\n const translationKey = text === 'Chat.Service.Group.UpdatedPinnedMessage1' && !targetMessage\n ? 'Message.PinnedGenericMessage'\n : text;\n\n let unprocessed = lang(translationKey, translationValues?.length ? translationValues : undefined);\n let processed: TextPart[];\n\n if (unprocessed.includes('%payment_amount%')) {\n processed = processPlaceholder(\n unprocessed,\n '%payment_amount%',\n formatCurrency(amount!, currency, lang.code),\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n }\n\n processed = processPlaceholder(\n unprocessed,\n '%action_origin%',\n actionOriginUser ? (\n renderUserContent(actionOriginUser, noLinks) || NBSP\n ) : actionOriginChat ? (\n renderChatContent(lang, actionOriginChat, noLinks) || NBSP\n ) : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_user%',\n targetUsers\n ? targetUsers.map((user) => renderUserContent(user, noLinks)).filter(Boolean as any)\n : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%message%',\n targetMessage\n ? renderMessageContent(lang, targetMessage, options)\n : 'a message',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%product%',\n targetMessage\n ? renderProductContent(targetMessage)\n : 'a product',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_chat%',\n targetChatId\n ? renderMigratedContent(targetChatId, noLinks)\n : 'another chat',\n );\n content.push(...processed);\n\n if (options.asPlainText) {\n return content.join('').trim();\n }\n\n if (call) {\n return renderGroupCallContent(call, content);\n }\n\n return content;\n}\n\nfunction renderProductContent(message: ApiMessage) {\n return message.content && message.content.invoice\n ? message.content.invoice.title\n : 'a product';\n}\n\nfunction renderMessageContent(lang: LangFn, message: ApiMessage, options: RenderOptions = {}) {\n const { asPlainText, asTextWithSpoilers } = options;\n\n if (asPlainText) {\n return getMessageSummaryText(lang, message, undefined, MAX_LENGTH);\n }\n\n const messageSummary = renderMessageSummary(lang, message, undefined, undefined, MAX_LENGTH);\n\n if (asTextWithSpoilers) {\n return (\n {messageSummary}\n );\n }\n\n return (\n {messageSummary}\n );\n}\n\nfunction renderGroupCallContent(groupCall: Partial, text: TextPart[]): string | TextPart | undefined {\n return (\n \n {text}\n \n );\n}\n\nfunction renderUserContent(sender: ApiUser, noLinks?: boolean): string | TextPart | undefined {\n const text = trimText(getUserFullName(sender), MAX_LENGTH);\n\n if (noLinks) {\n return text;\n }\n\n return {sender && renderText(text!)};\n}\n\nfunction renderChatContent(lang: LangFn, chat: ApiChat, noLinks?: boolean): string | TextPart | undefined {\n const text = trimText(getChatTitle(lang, chat), MAX_LENGTH);\n\n if (noLinks) {\n return text;\n }\n\n return {chat && renderText(text!)};\n}\n\nfunction renderMigratedContent(chatId: string, noLinks?: boolean): string | TextPart | undefined {\n const text = 'another chat';\n\n if (noLinks) {\n return text;\n }\n\n return {text};\n}\n\nfunction processPlaceholder(text: string, placeholder: string, replaceValue?: TextPart | TextPart[]): TextPart[] {\n const placeholderPosition = text.indexOf(placeholder);\n if (placeholderPosition < 0 || !replaceValue) {\n return [text];\n }\n\n const content: TextPart[] = [];\n content.push(text.substring(0, placeholderPosition));\n if (Array.isArray(replaceValue)) {\n replaceValue.forEach((value, index) => {\n content.push(value);\n if (index + 1 < replaceValue.length) {\n content.push(', ');\n }\n });\n } else {\n content.push(replaceValue);\n }\n content.push(text.substring(placeholderPosition + placeholder.length));\n\n return content;\n}\n","import { ApiMessage, ApiMessageEntityTypes } from '../../../api/types';\nimport {\n getMessageSummaryDescription,\n getMessageSummaryEmoji,\n getMessageSummaryText,\n getMessageText,\n TRUNCATED_SUMMARY_LENGTH,\n} from '../../../modules/helpers';\nimport { LangFn } from '../../../hooks/useLang';\nimport renderText from './renderText';\nimport { renderTextWithEntities, TextPart } from './renderTextWithEntities';\nimport trimText from '../../../util/trimText';\n\nexport type { TextPart };\n\nexport function renderMessageText(\n message: ApiMessage,\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n isSimple?: boolean,\n truncateLength?: number,\n) {\n const { text, entities } = message.content.text || {};\n\n if (!text) {\n const contentNotSupportedText = getMessageText(message);\n return contentNotSupportedText ? [trimText(contentNotSupportedText, truncateLength)] : undefined;\n }\n\n return renderTextWithEntities(\n trimText(text, truncateLength),\n entities,\n highlight,\n shouldRenderHqEmoji,\n undefined,\n message.id,\n isSimple,\n );\n}\n\nexport function renderMessageSummary(\n lang: LangFn,\n message: ApiMessage,\n noEmoji = false,\n highlight?: string,\n truncateLength = TRUNCATED_SUMMARY_LENGTH,\n): TextPart[] {\n let { entities } = message.content.text || {};\n\n const hasSpoilers = entities?.some((e) => e.type === ApiMessageEntityTypes.Spoiler);\n if (!hasSpoilers) {\n const text = trimText(getMessageSummaryText(lang, message, noEmoji), truncateLength);\n\n if (highlight) {\n return renderText(text, ['emoji', 'highlight'], { highlight });\n } else {\n return renderText(text);\n }\n }\n\n const emoji = !noEmoji && getMessageSummaryEmoji(message);\n const emojiWithSpace = emoji ? `${emoji} ` : '';\n\n const text = renderMessageText(message, highlight, undefined, true, truncateLength);\n const description = getMessageSummaryDescription(lang, message, text);\n\n return [\n emojiWithSpace,\n ...(Array.isArray(description) ? description : [description]),\n ].filter(Boolean);\n}\n","import React from '../../../lib/teact/teact';\nimport EMOJI_REGEX, { removeVS16s } from '../../../lib/twemojiRegex';\n\nimport { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config';\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\nimport { fixNonStandardEmoji, nativeToUnified } from '../../../util/emoji';\nimport buildClassName from '../../../util/buildClassName';\nimport { compact } from '../../../util/iteratees';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\ntype TextPart = string | Element;\nexport type TextFilter = (\n 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |\n 'simple_markdown' | 'simple_markdown_html'\n);\n\nconst RE_LETTER_OR_DIGIT = /^[\\d\\wа-яё]$/i;\nconst SIMPLE_MARKDOWN_REGEX = /(\\*\\*|__).+?\\1/g;\n\nexport default function renderText(\n part: TextPart,\n filters: Array = ['emoji'],\n params?: { highlight: string | undefined },\n): TextPart[] {\n if (typeof part !== 'string') {\n return [part];\n }\n\n return compact(filters.reduce((text, filter) => {\n switch (filter) {\n case 'escape_html':\n return escapeHtml(text);\n\n case 'hq_emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'big', 'jsx');\n\n case 'emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'jsx');\n\n case 'emoji_html':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'html');\n\n case 'br':\n return addLineBreaks(text, 'jsx');\n\n case 'br_html':\n return addLineBreaks(text, 'html');\n\n case 'highlight':\n return addHighlight(text, params!.highlight);\n\n case 'links':\n return addLinks(text);\n\n case 'simple_markdown':\n return replaceSimpleMarkdown(text, 'jsx');\n\n case 'simple_markdown_html':\n return replaceSimpleMarkdown(text, 'html');\n }\n\n return text;\n }, [part] as TextPart[]));\n}\n\nfunction escapeHtml(textParts: TextPart[]): TextPart[] {\n const divEl = document.createElement('div');\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n divEl.innerText = part;\n result.push(divEl.innerHTML);\n\n return result;\n }, [] as TextPart[]);\n}\n\nfunction replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx' | 'html'): TextPart[] {\n if (IS_EMOJI_SUPPORTED) {\n return textParts;\n }\n\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n part = fixNonStandardEmoji(part);\n const parts = part.split(EMOJI_REGEX);\n const emojis = part.match(EMOJI_REGEX) || [];\n result.push(parts[0]);\n\n return emojis.reduce((emojiResult: TextPart[], emoji, i) => {\n const code = nativeToUnified(removeVS16s(emoji));\n if (!code) return emojiResult;\n const className = buildClassName(\n 'emoji',\n size === 'small' && 'emoji-small',\n );\n if (type === 'jsx') {\n emojiResult.push(\n ,\n );\n }\n if (type === 'html') {\n emojiResult.push(\n // For preventing extra spaces in html\n // eslint-disable-next-line max-len\n `\"${emoji}\"`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n emojiResult.push(parts[index]);\n }\n\n return emojiResult;\n }, result);\n }, [] as TextPart[]);\n}\n\nfunction addLineBreaks(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result: TextPart[], part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n const splittenParts = part\n .split(/\\r\\n|\\r|\\n/g)\n .reduce((parts: TextPart[], line: string, i, source) => {\n // This adds non-breaking space if line was indented with spaces, to preserve the indentation\n const trimmedLine = line.trimLeft();\n const indentLength = line.length - trimmedLine.length;\n parts.push(String.fromCharCode(160).repeat(indentLength) + trimmedLine);\n\n if (i !== source.length - 1) {\n parts.push(\n type === 'jsx' ?
: '
',\n );\n }\n\n return parts;\n }, []);\n\n return [...result, ...splittenParts];\n }, []);\n}\n\nfunction addHighlight(textParts: TextPart[], highlight: string | undefined): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string' || !highlight) {\n result.push(part);\n return result;\n }\n\n const lowerCaseText = part.toLowerCase();\n const queryPosition = lowerCaseText.indexOf(highlight.toLowerCase());\n const nextSymbol = lowerCaseText[queryPosition + highlight.length];\n if (queryPosition < 0 || (nextSymbol && nextSymbol.match(RE_LETTER_OR_DIGIT))) {\n result.push(part);\n return result;\n }\n\n const newParts: TextPart[] = [];\n newParts.push(part.substring(0, queryPosition));\n newParts.push(\n \n {part.substring(queryPosition, queryPosition + highlight.length)}\n ,\n );\n newParts.push(part.substring(queryPosition + highlight.length));\n\n return [...result, ...newParts];\n }, [] as TextPart[]);\n}\n\nconst RE_LINK = new RegExp(`${RE_LINK_TEMPLATE}|${RE_MENTION_TEMPLATE}`, 'ig');\n\nfunction addLinks(textParts: TextPart[]): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n const links = part.match(RE_LINK);\n if (!links || !links.length) {\n result.push(part);\n return result;\n }\n\n const content: TextPart[] = [];\n\n let nextLink = links.shift();\n let lastIndex = 0;\n while (nextLink) {\n const index = part.indexOf(nextLink, lastIndex);\n content.push(part.substring(lastIndex, index));\n if (nextLink.startsWith('@')) {\n content.push(\n \n {nextLink}\n ,\n );\n } else {\n if (nextLink.endsWith('?')) {\n nextLink = nextLink.slice(0, nextLink.length - 1);\n }\n\n content.push(\n ,\n );\n }\n lastIndex = index + nextLink.length;\n nextLink = links.shift();\n }\n content.push(part.substring(lastIndex));\n\n return [...result, ...content];\n }, [] as TextPart[]);\n}\n\nfunction replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n result.push(part);\n return result;\n }\n\n const parts = part.split(SIMPLE_MARKDOWN_REGEX);\n const entities = part.match(SIMPLE_MARKDOWN_REGEX) || [];\n result.push(parts[0]);\n\n return entities.reduce((entityResult: TextPart[], entity, i) => {\n if (type === 'jsx') {\n entityResult.push(\n entity.startsWith('**')\n ? {entity.replace(/\\*\\*/g, '')}\n : {entity.replace(/__/g, '')},\n );\n } else {\n entityResult.push(\n entity.startsWith('**')\n ? `${entity.replace(/\\*\\*/g, '')}`\n : `${entity.replace(/__/g, '')}`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n entityResult.push(parts[index]);\n }\n\n return entityResult;\n }, result);\n }, [] as TextPart[]);\n}\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { createClassNameBuilder } from '../../../util/buildClassName';\nimport useFlag from '../../../hooks/useFlag';\n\nimport './Spoiler.scss';\n\ntype OwnProps = {\n children?: React.ReactNode;\n messageId?: number;\n};\n\nconst READING_SYMBOLS_PER_SECOND = 23; // Heuristics\nconst MIN_HIDE_TIMEOUT = 5000; // 5s\nconst MAX_HIDE_TIMEOUT = 60000; // 1m\n\nconst actionsByMessageId: Map = new Map();\n\nconst buildClassName = createClassNameBuilder('Spoiler');\n\nconst Spoiler: FC = ({\n children,\n messageId,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const contentRef = useRef(null);\n\n const [isRevealed, reveal, conceal] = useFlag();\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n actionsByMessageId.get(messageId!)?.forEach((actions) => actions.reveal());\n\n const contentLength = contentRef.current!.innerText.length;\n const readingMs = Math.round(contentLength / READING_SYMBOLS_PER_SECOND) * 1000;\n const timeoutMs = Math.max(MIN_HIDE_TIMEOUT, Math.min(readingMs, MAX_HIDE_TIMEOUT));\n\n setTimeout(() => {\n actionsByMessageId.get(messageId!)?.forEach((actions) => actions.conceal());\n conceal();\n }, timeoutMs);\n }, [conceal, messageId]);\n\n useEffect(() => {\n if (!messageId) {\n return undefined;\n }\n\n if (actionsByMessageId.has(messageId)) {\n actionsByMessageId.get(messageId)!.push({ reveal, conceal });\n } else {\n actionsByMessageId.set(messageId, [{ reveal, conceal }]);\n }\n\n return () => {\n actionsByMessageId.delete(messageId);\n };\n }, [conceal, handleClick, isRevealed, messageId, reveal]);\n\n return (\n \n \n {children}\n \n \n );\n};\n\nexport default memo(Spoiler);\n","import { MouseEvent } from 'react';\nimport React from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types';\nimport renderText, { TextFilter } from './renderText';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\nimport Spoiler from '../spoiler/Spoiler';\n\nexport type TextPart =\n string\n | Element;\n\ninterface IOrganizedEntity {\n entity: ApiMessageEntity;\n organizedIndexes: Set;\n nestedEntities: IOrganizedEntity[];\n}\n\nexport function renderTextWithEntities(\n text: string,\n entities?: ApiMessageEntity[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n messageId?: number,\n isSimple?: boolean,\n) {\n if (!entities || !entities.length) {\n return renderMessagePart(text, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple);\n }\n\n const result: TextPart[] = [];\n let deleteLineBreakAfterPre = false;\n\n const organizedEntities = organizeEntities(entities);\n\n // Recursive function to render regular and nested entities\n function renderEntity(\n textPartStart: number,\n textPartEnd: number,\n organizedEntity: IOrganizedEntity,\n isLastEntity: boolean,\n ) {\n const renderResult: TextPart[] = [];\n const { entity, nestedEntities } = organizedEntity;\n const { offset, length, type } = entity;\n\n // Render text before the entity\n let textBefore = text.substring(textPartStart, offset);\n const textBeforeLength = textBefore.length;\n if (textBefore) {\n if (deleteLineBreakAfterPre && textBefore.length > 0 && textBefore[0] === '\\n') {\n textBefore = textBefore.substr(1);\n deleteLineBreakAfterPre = false;\n }\n if (textBefore) {\n renderResult.push(...renderMessagePart(\n textBefore, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple,\n ) as TextPart[]);\n }\n }\n\n const entityStartIndex = textPartStart + textBeforeLength;\n const entityEndIndex = entityStartIndex + length;\n\n let entityContent: TextPart = text.substring(offset, offset + length);\n const nestedEntityContent: TextPart[] = [];\n\n if (deleteLineBreakAfterPre && entityContent.length > 0 && entityContent[0] === '\\n') {\n entityContent = entityContent.substr(1);\n deleteLineBreakAfterPre = false;\n }\n\n if (type === ApiMessageEntityTypes.Pre) {\n deleteLineBreakAfterPre = true;\n }\n\n // Render nested entities, if any\n if (nestedEntities.length) {\n let nestedIndex = entityStartIndex;\n\n nestedEntities.forEach((nestedEntity, nestedEntityIndex) => {\n const {\n renderResult: nestedResult,\n entityEndIndex: nestedEntityEndIndex,\n } = renderEntity(\n nestedIndex,\n entityEndIndex,\n nestedEntity,\n nestedEntityIndex === nestedEntities.length - 1,\n );\n\n nestedEntityContent.push(...nestedResult);\n nestedIndex = nestedEntityEndIndex;\n });\n }\n\n // Render the entity itself\n const newEntity = shouldRenderAsHtml\n ? processEntityAsHtml(entity, entityContent, nestedEntityContent)\n : processEntity(entity, entityContent, nestedEntityContent, highlight, messageId, isSimple);\n\n if (Array.isArray(newEntity)) {\n renderResult.push(...newEntity);\n } else {\n renderResult.push(newEntity);\n }\n\n // Render text after the entity, if it is the last entity in the text,\n // or the last nested entity inside of another entity\n if (isLastEntity && entityEndIndex < textPartEnd) {\n let textAfter = text.substring(entityEndIndex, textPartEnd);\n if (deleteLineBreakAfterPre && textAfter.length > 0 && textAfter[0] === '\\n') {\n textAfter = textAfter.substring(1);\n }\n if (textAfter) {\n renderResult.push(...renderMessagePart(\n textAfter, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple,\n ) as TextPart[]);\n }\n }\n\n return {\n renderResult,\n entityEndIndex,\n };\n }\n\n // Process highest-level entities\n let index = 0;\n\n organizedEntities.forEach((entity, arrayIndex) => {\n const { renderResult, entityEndIndex } = renderEntity(\n index,\n text.length,\n entity,\n arrayIndex === organizedEntities.length - 1,\n );\n\n result.push(...renderResult);\n index = entityEndIndex;\n });\n\n return result;\n}\n\nexport function getTextWithEntitiesAsHtml(formattedText?: ApiFormattedText) {\n const { text, entities } = formattedText || {};\n if (!text) {\n return '';\n }\n\n const result = renderTextWithEntities(\n text,\n entities,\n undefined,\n undefined,\n true,\n );\n\n if (Array.isArray(result)) {\n return result.join('');\n }\n\n return result;\n}\n\nfunction renderMessagePart(\n content: TextPart | TextPart[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n isSimple?: boolean,\n) {\n if (Array.isArray(content)) {\n const result: TextPart[] = [];\n\n content.forEach((c) => {\n result.push(...renderMessagePart(c, highlight, shouldRenderHqEmoji, shouldRenderAsHtml, isSimple));\n });\n\n return result;\n }\n\n if (shouldRenderAsHtml) {\n return renderText(content, ['escape_html', 'emoji_html', 'br_html']);\n }\n\n const emojiFilter = shouldRenderHqEmoji ? 'hq_emoji' : 'emoji';\n\n const filters: TextFilter[] = [emojiFilter];\n if (!isSimple) {\n filters.push('br');\n }\n\n if (highlight) {\n return renderText(content, filters.concat('highlight'), { highlight });\n } else {\n return renderText(content, filters);\n }\n}\n\n// Organize entities in a tree-like structure to better represent how the text will be displayed\nfunction organizeEntities(entities: ApiMessageEntity[]) {\n const organizedEntityIndexes: Set = new Set();\n const organizedEntities: IOrganizedEntity[] = [];\n\n entities.forEach((entity, index) => {\n if (organizedEntityIndexes.has(index)) {\n return;\n }\n\n const organizedEntity = organizeEntity(entity, index, entities, organizedEntityIndexes);\n if (organizedEntity) {\n organizedEntity.organizedIndexes.forEach((organizedIndex) => {\n organizedEntityIndexes.add(organizedIndex);\n });\n\n organizedEntities.push(organizedEntity);\n }\n });\n\n return organizedEntities;\n}\n\nfunction organizeEntity(\n entity: ApiMessageEntity,\n index: number,\n entities: ApiMessageEntity[],\n organizedEntityIndexes: Set,\n): IOrganizedEntity | undefined {\n const { offset, length } = entity;\n const organizedIndexes = new Set([index]);\n\n if (organizedEntityIndexes.has(index)) {\n return undefined;\n }\n\n // Determine any nested entities inside current entity\n const nestedEntities: IOrganizedEntity[] = [];\n const parsedNestedEntities = entities\n .filter((e, i) => i > index && e.offset >= offset && e.offset < offset + length)\n .map((e) => organizeEntity(e, entities.indexOf(e), entities, organizedEntityIndexes))\n .filter(Boolean as any);\n\n parsedNestedEntities.forEach((parsedEntity) => {\n let isChanged = false;\n\n parsedEntity.organizedIndexes.forEach((organizedIndex) => {\n if (!isChanged && !organizedIndexes.has(organizedIndex)) {\n isChanged = true;\n }\n\n organizedIndexes.add(organizedIndex);\n });\n\n if (isChanged) {\n nestedEntities.push(parsedEntity);\n }\n });\n\n return {\n entity,\n organizedIndexes,\n nestedEntities,\n };\n}\n\nfunction processEntity(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n highlight?: string,\n messageId?: number,\n isSimple?: boolean,\n) {\n const entityText = typeof entityContent === 'string' && entityContent;\n const renderedContent = nestedEntityContent.length ? nestedEntityContent : entityContent;\n\n function renderNestedMessagePart() {\n return renderMessagePart(\n renderedContent, highlight, undefined, undefined, isSimple,\n );\n }\n\n if (!entityText) {\n return renderNestedMessagePart();\n }\n\n if (isSimple) {\n const text = renderNestedMessagePart();\n if (entity.type === ApiMessageEntityTypes.Spoiler) {\n return {text};\n }\n return text;\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.Blockquote:\n return
{renderNestedMessagePart()}
;\n case ApiMessageEntityTypes.BotCommand:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Hashtag:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Cashtag:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Code:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.Email:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Italic:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.MentionName:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Mention:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Phone:\n return (\n \n {renderNestedMessagePart()}\n \n );\n case ApiMessageEntityTypes.Pre:\n return
{renderNestedMessagePart()}
;\n case ApiMessageEntityTypes.Strike:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.TextUrl:\n case ApiMessageEntityTypes.Url:\n return (\n \n {renderNestedMessagePart()}\n
\n );\n case ApiMessageEntityTypes.Underline:\n return {renderNestedMessagePart()};\n case ApiMessageEntityTypes.Spoiler:\n return {renderNestedMessagePart()};\n default:\n return renderNestedMessagePart();\n }\n}\n\nfunction processEntityAsHtml(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const rawEntityText = typeof entityContent === 'string' && entityContent;\n\n const renderedContent = nestedEntityContent.length\n ? nestedEntityContent.join('')\n : renderText(entityContent, ['escape_html', 'emoji_html', 'br_html']).join('');\n\n if (!rawEntityText) {\n return renderedContent;\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Italic:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Underline:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Code:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Pre:\n return `\\`\\`\\`
${renderedContent}
\\`\\`\\``;\n case ApiMessageEntityTypes.Strike:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.MentionName:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Url:\n case ApiMessageEntityTypes.TextUrl:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Spoiler:\n return `${renderedContent}`;\n default:\n return renderedContent;\n }\n}\n\nfunction getLinkUrl(entityContent: string, entity: ApiMessageEntity) {\n const { type, url } = entity;\n return type === ApiMessageEntityTypes.TextUrl && url ? url : entityContent;\n}\n\nfunction handleBotCommandClick(e: MouseEvent) {\n getDispatch().sendBotCommand({ command: e.currentTarget.innerText });\n}\n\nfunction handleHashtagClick(e: MouseEvent) {\n getDispatch().setLocalTextSearchQuery({ query: e.currentTarget.innerText });\n getDispatch().searchTextMessagesLocal();\n}\n","import React from '../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { IS_IOS } from '../../../util/environment';\n\nexport function preventMessageInputBlur(e: React.MouseEvent, withBubbling = false) {\n if (\n IS_IOS\n || !document.activeElement\n || document.activeElement.id !== EDITABLE_INPUT_ID\n || (!withBubbling && e.target !== e.currentTarget)\n ) {\n return;\n }\n\n e.preventDefault();\n}\n\nexport function preventMessageInputBlurWithBubbling(e: React.MouseEvent) {\n preventMessageInputBlur(e, true);\n}\n","import React, { FC } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\n\ntype OwnProps = {\n userId?: string;\n username?: string;\n children: React.ReactNode;\n};\n\ntype StateProps = {\n userOrChat?: ApiUser | ApiChat;\n};\n\nconst MentionLink: FC = ({\n username,\n userOrChat,\n children,\n}) => {\n const {\n openChat,\n openChatByUsername,\n } = getDispatch();\n\n const handleClick = () => {\n if (userOrChat) {\n openChat({ id: userOrChat.id });\n } else if (username) {\n openChatByUsername({ username: username.substring(1) });\n }\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport default withGlobal(\n (global, { userId }): StateProps => {\n return {\n userOrChat: userId ? selectUser(global, userId) : undefined,\n };\n },\n)(MentionLink);\n","import { MouseEvent as ReactMouseEvent, RefObject } from 'react';\n\nimport React, {\n FC, useRef, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Spinner from './Spinner';\nimport RippleEffect from './RippleEffect';\n\nimport './Button.scss';\n\nexport type OwnProps = {\n ref?: RefObject;\n type?: 'button' | 'submit' | 'reset';\n children: React.ReactNode;\n size?: 'default' | 'smaller' | 'tiny';\n color?: (\n 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'translucent-black' | 'dark'\n );\n backgroundImage?: string;\n className?: string;\n round?: boolean;\n pill?: boolean;\n fluid?: boolean;\n isText?: boolean;\n isLoading?: boolean;\n ariaLabel?: string;\n href?: string;\n download?: string;\n disabled?: boolean;\n ripple?: boolean;\n faded?: boolean;\n tabIndex?: number;\n isRtl?: boolean;\n withClickPropagation?: boolean;\n onClick?: (e: ReactMouseEvent) => void;\n onContextMenu?: (e: ReactMouseEvent) => void;\n onMouseDown?: (e: ReactMouseEvent) => void;\n onMouseEnter?: NoneToVoidFunction;\n onMouseLeave?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n};\n\n// Longest animation duration;\nconst CLICKED_TIMEOUT = 400;\n\nconst Button: FC = ({\n ref,\n type = 'button',\n onClick,\n onContextMenu,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n children,\n size = 'default',\n color = 'primary',\n backgroundImage,\n className,\n round,\n pill,\n fluid,\n isText,\n isLoading,\n ariaLabel,\n href,\n download,\n disabled,\n ripple,\n faded,\n tabIndex,\n isRtl,\n withClickPropagation,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const [isClicked, setIsClicked] = useState(false);\n\n const fullClassName = buildClassName(\n 'Button',\n className,\n size,\n color,\n round && 'round',\n pill && 'pill',\n fluid && 'fluid',\n disabled && 'disabled',\n isText && 'text',\n isLoading && 'loading',\n ripple && 'has-ripple',\n faded && 'faded',\n isClicked && 'clicked',\n backgroundImage && 'with-image',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (!disabled && onClick) {\n onClick(e);\n }\n\n setIsClicked(true);\n setTimeout(() => {\n setIsClicked(false);\n }, CLICKED_TIMEOUT);\n }, [disabled, onClick]);\n\n const handleMouseDown = useCallback((e: ReactMouseEvent) => {\n if (!withClickPropagation) e.preventDefault();\n if (!disabled && onMouseDown) {\n onMouseDown(e);\n }\n }, [onMouseDown, disabled, withClickPropagation]);\n\n if (href) {\n return (\n }\n className={fullClassName}\n href={href}\n title={ariaLabel}\n download={download}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n >\n {children}\n {!disabled && ripple && (\n \n )}\n \n );\n }\n\n return (\n // eslint-disable-next-line react/button-has-type\n }\n type={type}\n className={fullClassName}\n onClick={handleClick}\n onContextMenu={onContextMenu}\n onMouseDown={handleMouseDown}\n onMouseEnter={onMouseEnter && !disabled ? onMouseEnter : undefined}\n onMouseLeave={onMouseLeave && !disabled ? onMouseLeave : undefined}\n onFocus={onFocus && !disabled ? onFocus : undefined}\n aria-label={ariaLabel}\n title={ariaLabel}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n style={backgroundImage ? `background-image: url(${backgroundImage})` : undefined}\n >\n {isLoading ? (\n
\n Please wait...\n \n
\n ) : children}\n {!disabled && ripple && (\n \n )}\n \n );\n};\n\nexport default Button;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport renderText from '../common/helpers/renderText';\n\nimport Spinner from './Spinner';\n\nimport './Checkbox.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n subLabel?: string;\n checked: boolean;\n disabled?: boolean;\n round?: boolean;\n blocking?: boolean;\n isLoading?: boolean;\n withCheckedCallback?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Checkbox: FC = ({\n id,\n name,\n value,\n label,\n subLabel,\n checked,\n disabled,\n round,\n blocking,\n isLoading,\n onChange,\n onCheck,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n if (onChange) {\n onChange(event);\n }\n\n if (onCheck) {\n onCheck(event.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Checkbox',\n disabled && 'disabled',\n round && 'round',\n isLoading && 'loading',\n blocking && 'blocking',\n );\n\n return (\n \n );\n};\n\nexport default memo(Checkbox);\n","import React, { FC, useState, useRef } from '../../lib/teact/teact';\n\nimport Menu from './Menu';\n\nimport './DropdownMenu.scss';\n\ntype OwnProps = {\n className?: string;\n trigger: FC<{ onTrigger: () => void; isOpen?: boolean }>;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n footer?: string;\n forceOpen?: boolean;\n onOpen?: NoneToVoidFunction;\n onClose?: NoneToVoidFunction;\n children: React.ReactNode;\n};\n\nconst DropdownMenu: FC = ({\n trigger,\n className,\n children,\n positionX = 'left',\n positionY = 'top',\n footer,\n forceOpen,\n onOpen,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const dropdownRef = useRef(null);\n const [isOpen, setIsOpen] = useState(false);\n\n const toggleIsOpen = () => {\n setIsOpen(!isOpen);\n if (isOpen) {\n if (onClose) onClose();\n } else if (onOpen) onOpen();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const menu = menuRef.current;\n\n if (!isOpen || e.keyCode !== 40 || !menu) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(menu.children);\n\n if (!focusedElement || elementChildren.indexOf(focusedElement) === -1) {\n (elementChildren[0] as HTMLElement).focus();\n }\n };\n\n const handleClose = () => {\n setIsOpen(false);\n if (onClose) onClose();\n };\n\n return (\n \n {trigger({ onTrigger: toggleIsOpen, isOpen })}\n\n \n {children}\n \n
\n );\n};\n\nexport default DropdownMenu;\n","import {\n ChangeEvent, FormEvent, RefObject,\n} from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\ntype OwnProps = {\n ref?: RefObject;\n id?: string;\n className?: string;\n value?: string;\n label?: string;\n error?: string;\n success?: string;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n autoComplete?: string;\n maxLength?: number;\n inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n onChange?: (e: ChangeEvent) => void;\n onInput?: (e: FormEvent) => void;\n onKeyPress?: (e: React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onPaste?: (e: React.ClipboardEvent) => void;\n};\n\nconst InputText: FC = ({\n ref,\n id,\n className,\n value,\n label,\n error,\n success,\n disabled,\n readOnly,\n placeholder,\n autoComplete,\n inputMode,\n maxLength,\n onChange,\n onInput,\n onKeyPress,\n onKeyDown,\n onBlur,\n onPaste,\n}) => {\n const lang = useLang();\n const labelText = error || success || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error ? 'error' : success && 'success',\n disabled && 'disabled',\n readOnly && 'disabled',\n labelText && 'with-label',\n className,\n );\n\n return (\n
\n \n {labelText && (\n \n )}\n
\n );\n};\n\nexport default memo(InputText);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Link.scss';\n\ntype OwnProps = {\n children: React.ReactNode;\n className?: string;\n isRtl?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n};\n\nconst Link: FC = ({\n children, className, isRtl, onClick,\n}) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n onClick!(e);\n }, [onClick]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default Link;\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport Spinner from './Spinner';\nimport buildClassName from '../../util/buildClassName';\n\nimport './Loading.scss';\n\ntype OwnProps = {\n color?: 'blue' | 'white' | 'black' | 'yellow';\n backgroundColor?: 'light' | 'dark';\n onClick?: NoneToVoidFunction;\n};\n\nconst Loading: FC = ({ color = 'blue', backgroundColor, onClick }) => {\n return (\n
\n \n
\n );\n};\n\nexport default memo(Loading);\n","import { RefObject } from 'react';\nimport React, { FC, useEffect, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useVirtualBackdrop from '../../hooks/useVirtualBackdrop';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\nimport { IS_COMPACT_MENU } from '../../util/environment';\n\nimport './Menu.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n containerRef?: RefObject;\n isOpen: boolean;\n className?: string;\n style?: string;\n bubbleStyle?: string;\n transformOriginX?: number;\n transformOriginY?: number;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n autoClose?: boolean;\n shouldSkipTransition?: boolean;\n footer?: string;\n noCloseOnBackdrop?: boolean;\n noCompact?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onCloseAnimationEnd?: () => void;\n onClose?: () => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n children: React.ReactNode;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Menu: FC = ({\n ref,\n containerRef,\n isOpen,\n className,\n style,\n bubbleStyle,\n children,\n transformOriginX,\n transformOriginY,\n positionX = 'left',\n positionY = 'top',\n autoClose = false,\n footer,\n noCloseOnBackdrop = false,\n noCompact,\n onCloseAnimationEnd,\n onClose,\n onMouseEnter,\n onMouseLeave,\n shouldSkipTransition,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let menuRef = useRef(null);\n if (ref) {\n menuRef = ref;\n }\n const backdropContainerRef = containerRef || menuRef;\n\n const {\n transitionClassNames,\n } = useShowTransition(\n isOpen,\n onCloseAnimationEnd,\n shouldSkipTransition,\n undefined,\n shouldSkipTransition,\n );\n\n useEffect(\n () => (isOpen && onClose ? captureEscKeyListener(onClose) : undefined),\n [isOpen, onClose],\n );\n\n useHistoryBack(isOpen, onClose, undefined, undefined, autoClose);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n if (isOpen || (!isOpen && prevIsOpen === true)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n }, [isOpen]);\n\n const handleKeyDown = useKeyboardListNavigation(menuRef, isOpen, autoClose ? onClose : undefined, undefined, true);\n\n useVirtualBackdrop(\n isOpen,\n backdropContainerRef,\n noCloseOnBackdrop ? undefined : onClose,\n );\n\n const bubbleClassName = buildClassName(\n 'bubble menu-container custom-scroll',\n positionY,\n positionX,\n footer && 'with-footer',\n transitionClassNames,\n );\n\n const transformOriginYStyle = transformOriginY !== undefined ? `${transformOriginY}px` : undefined;\n const transformOriginXStyle = transformOriginX !== undefined ? `${transformOriginX}px` : undefined;\n\n return (\n \n {isOpen && (\n // This only prevents click events triggering on underlying elements\n
\n )}\n \n {children}\n {footer &&
{footer}
}\n
\n
\n );\n};\n\nexport default Menu;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport { IS_COMPACT_MENU } from '../../util/environment';\n\nimport './MenuItem.scss';\n\ntype OnClickHandler = (e: React.SyntheticEvent) => void;\n\ntype OwnProps = {\n icon?: string;\n className?: string;\n children: React.ReactNode;\n onClick?: OnClickHandler;\n href?: string;\n download?: string;\n disabled?: boolean;\n destructive?: boolean;\n ariaLabel?: string;\n};\n\nconst MenuItem: FC = (props) => {\n const {\n icon,\n className,\n children,\n onClick,\n href,\n download,\n disabled,\n destructive,\n ariaLabel,\n } = props;\n\n const lang = useLang();\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 13 && e.keyCode !== 32) {\n return;\n }\n\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const fullClassName = buildClassName(\n 'MenuItem',\n className,\n disabled && 'disabled',\n destructive && 'destructive',\n IS_COMPACT_MENU && 'compact',\n );\n\n const content = (\n <>\n {icon && (\n \n )}\n {children}\n \n );\n\n if (href) {\n return (\n \n {content}\n \n );\n }\n\n return (\n \n {content}\n
\n );\n};\n\nexport default MenuItem;\n","import React, {\n FC, useCallback, useMemo, useState, memo,\n} from '../../lib/teact/teact';\nimport { debounce } from '../../util/schedulers';\n\nimport './RippleEffect.scss';\n\ninterface Ripple {\n x: number;\n y: number;\n size: number;\n}\n\nconst ANIMATION_DURATION_MS = 700;\n\nconst RippleEffect: FC = () => {\n const [ripples, setRipples] = useState([]);\n\n const cleanUpDebounced = useMemo(() => {\n return debounce(() => {\n setRipples([]);\n }, ANIMATION_DURATION_MS, false);\n }, []);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (e.button !== 0) {\n return;\n }\n\n const container = e.currentTarget as HTMLDivElement;\n const position = container.getBoundingClientRect() as DOMRect;\n\n const rippleSize = container.offsetWidth / 2;\n\n setRipples([\n ...ripples,\n {\n x: e.clientX - position.x - (rippleSize / 2),\n y: e.clientY - position.y - (rippleSize / 2),\n size: rippleSize,\n },\n ]);\n\n requestAnimationFrame(() => {\n cleanUpDebounced();\n });\n }, [ripples, cleanUpDebounced]);\n\n return (\n
\n {ripples.map(({ x, y, size }) => (\n \n ))}\n
\n );\n};\n\nexport default memo(RippleEffect);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Spinner.scss';\n\nconst Spinner: FC<{\n color?: 'blue' | 'white' | 'black' | 'green' | 'gray' | 'yellow';\n backgroundColor?: 'light' | 'dark';\n}> = ({\n color = 'blue',\n backgroundColor,\n}) => {\n return (\n
\n
\n
\n );\n};\n\nexport default Spinner;\n","export const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION!;\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const DEBUG_PAYMENT_SMART_GLOCAL = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 500;\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 200;\nexport const GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT = 30;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v7';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const AUTODOWNLOAD_FILESIZE_MB_LIMITS = [1, 5, 10, 50, 100, 500];\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\nexport const COMMON_CHATS_LIMIT = 100;\nexport const GROUP_CALL_PARTICIPANTS_LIMIT = 100;\nexport const REACTION_LIST_LIMIT = 100;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\n\nexport const SPONSORED_MESSAGE_CACHE_MS = 300000; // 5 min\n\nexport const DEFAULT_VOLUME = 1;\nexport const DEFAULT_PLAYBACK_RATE = 1;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\nexport const SEND_MESSAGE_ACTION_INTERVAL = 3000; // 3s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\nexport const TMP_CHAT_ID = '0';\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 100;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const STICKER_SIZE_JOIN_REQUESTS = 140;\nexport const STICKER_SIZE_INVITES = 140;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const NO_STICKER_SET_ID = 'NO_STICKER_SET';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const VIDEO_MOV_TYPE = 'video/quicktime';\nexport const VIDEO_WEBM_TYPE = 'video/webm';\n\nexport const SUPPORTED_IMAGE_CONTENT_TYPES = new Set([\n 'image/png', 'image/gif', 'image/jpeg',\n]);\n\nexport const SUPPORTED_VIDEO_CONTENT_TYPES = new Set([\n 'video/mp4', // video/quicktime added dynamically in environment.ts\n]);\n\nexport const CONTENT_TYPES_WITH_PREVIEW = new Set([\n ...SUPPORTED_IMAGE_CONTENT_TYPES,\n ...SUPPORTED_VIDEO_CONTENT_TYPES,\n]);\n\nexport const CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram.';\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TG_LINK = /^tg:(\\/\\/)?([?=&\\d\\w_-]+)?/gm;\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)/gm;\n\n// eslint-disable-next-line max-len\nexport const COUNTRIES_WITH_12H_TIME_FORMAT = new Set(['AU', 'BD', 'CA', 'CO', 'EG', 'HN', 'IE', 'IN', 'JO', 'MX', 'MY', 'NI', 'NZ', 'PH', 'PK', 'SA', 'SV', 'US']);\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = '777000';\nexport const REPLIES_USER_ID = '1271266957'; // TODO For Test connection ID must be equal to 708513\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = '-777';\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n\n// Group calls\nexport const GROUP_CALL_VOLUME_MULTIPLIER = 100;\nexport const GROUP_CALL_DEFAULT_VOLUME = 100 * GROUP_CALL_VOLUME_MULTIPLIER;\nexport const ENABLE_THUMBNAIL_VIDEO = false;\n","import { useEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nconst useEffectWithPrevDeps = (cb: (args: T | []) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useEffect(() => {\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n\nexport default useEffectWithPrevDeps;\n","import { useCallback, useState } from '../lib/teact/teact';\n\nconst useFlag = (initial = false): [boolean, AnyToVoidFunction, AnyToVoidFunction] => {\n const [value, setValue] = useState(initial);\n\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n\n return [value, setTrue, setFalse];\n};\n\nexport default useFlag;\n","import { useCallback, useState } from '../lib/teact/teact';\n\nconst useForceUpdate = () => {\n const [, setTrigger] = useState(false);\n\n return useCallback(() => {\n setTrigger((trigger) => !trigger);\n }, []);\n};\n\nexport default useForceUpdate;\n","import { useEffect } from '../lib/teact/teact';\n\nconst ANIMATION_START_EVENT = 'tt-event-heavy-animation-start';\nconst ANIMATION_END_EVENT = 'tt-event-heavy-animation-end';\n\nlet timeout: number | undefined;\nlet isAnimating = false;\n\n// Make sure to end even if end callback was not called (which was some hardly-reproducible bug)\nconst AUTO_END_TIMEOUT = 1000;\n\nconst useHeavyAnimationCheck = (\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n isDisabled = false,\n) => {\n useEffect(() => {\n if (isDisabled) {\n return undefined;\n }\n\n if (isAnimating) {\n handleAnimationStart();\n }\n\n document.addEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n document.addEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n\n return () => {\n document.removeEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n document.removeEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n };\n }, [isDisabled, handleAnimationEnd, handleAnimationStart]);\n};\n\nexport function isHeavyAnimating() {\n return isAnimating;\n}\n\nexport function dispatchHeavyAnimationEvent(duration = AUTO_END_TIMEOUT) {\n if (!isAnimating) {\n isAnimating = true;\n document.dispatchEvent(new Event(ANIMATION_START_EVENT));\n }\n\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n // Race condition may happen if another `dispatchHeavyAnimationEvent` is called before `onEnd`\n function onEnd() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n }\n\n timeout = window.setTimeout(onEnd, duration);\n\n return onEnd;\n}\n\nexport default useHeavyAnimationCheck;\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_IOS } from '../util/environment';\nimport usePrevious from './usePrevious';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { areSortedArraysEqual } from '../util/iteratees';\n\ntype HistoryState = {\n currentIndex: number;\n nextStateIndexToReplace: number;\n isHistoryAltered: boolean;\n isDisabled: boolean;\n isEdge: boolean;\n currentIndexes: number[];\n};\n\n// Carefully selected by swiping and observing visual changes\n// TODO: may be different on other devices such as iPad, maybe take dpi into account?\nconst SAFARI_EDGE_BACK_GESTURE_LIMIT = 300;\nconst SAFARI_EDGE_BACK_GESTURE_DURATION = 350;\nexport const LOCATION_HASH = window.location.hash;\nconst PATH_BASE = `${window.location.pathname}${window.location.search}`;\n\nconst historyState: HistoryState = {\n currentIndex: 0,\n nextStateIndexToReplace: -1,\n isHistoryAltered: false,\n isDisabled: false,\n isEdge: false,\n currentIndexes: [],\n};\n\nexport const disableHistoryBack = () => {\n historyState.isDisabled = true;\n};\n\nconst handleTouchStart = (event: TouchEvent) => {\n const x = event.touches[0].pageX;\n\n if (x <= SAFARI_EDGE_BACK_GESTURE_LIMIT || x >= window.innerWidth - SAFARI_EDGE_BACK_GESTURE_LIMIT) {\n historyState.isEdge = true;\n }\n};\n\nconst handleTouchEnd = () => {\n if (historyState.isEdge) {\n setTimeout(() => {\n historyState.isEdge = false;\n }, SAFARI_EDGE_BACK_GESTURE_DURATION);\n }\n};\n\nif (IS_IOS) {\n window.addEventListener('touchstart', handleTouchStart);\n window.addEventListener('touchend', handleTouchEnd);\n window.addEventListener('popstate', handleTouchEnd);\n}\n\nwindow.history.replaceState({ index: historyState.currentIndex }, '', PATH_BASE);\n\nexport default function useHistoryBack(\n isActive: boolean | undefined,\n onBack: ((noDisableAnimation: boolean) => void) | undefined,\n onForward?: (state: any) => void,\n currentState?: any,\n shouldReplaceNext = false,\n hashes?: string[],\n) {\n const indexRef = useRef(-1);\n const isForward = useRef(false);\n const prevIsActive = usePrevious(isActive);\n const isClosed = useRef(true);\n const indexHashRef = useRef<{ index: number; hash: string }[]>([]);\n const prevHashes = usePrevious(hashes);\n const isHashChangedFromEvent = useRef(false);\n\n const handleChange = useCallback((isForceClose = false) => {\n if (!hashes) {\n if (isActive && !isForceClose) {\n isClosed.current = false;\n\n if (isForward.current) {\n isForward.current = false;\n historyState.currentIndexes.push(indexRef.current);\n } else {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n\n historyState.currentIndexes.push(index);\n\n window.history[(\n (\n historyState.currentIndexes.includes(historyState.nextStateIndexToReplace - 1)\n && window.history.state.index !== 0\n && historyState.nextStateIndexToReplace === index\n && !shouldReplaceNext\n )\n ? 'replaceState'\n : 'pushState'\n )]({\n index,\n state: currentState,\n }, '');\n\n indexRef.current = index;\n\n if (shouldReplaceNext) {\n historyState.nextStateIndexToReplace = historyState.currentIndex + 1;\n }\n }, 0);\n }\n }\n\n if ((isForceClose || !isActive) && !isClosed.current) {\n if ((indexRef.current === historyState.currentIndex || !shouldReplaceNext)) {\n historyState.isHistoryAltered = true;\n window.history.back();\n\n setTimeout(() => {\n historyState.nextStateIndexToReplace = -1;\n }, 400);\n }\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(indexRef.current), 1);\n\n isClosed.current = true;\n }\n } else {\n const prev = prevHashes || [];\n if (prev.length < hashes.length) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes.push(index);\n\n window.history.pushState({\n index,\n state: currentState,\n }, '', `#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current.push({\n index,\n hash: hashes[hashes.length - 1],\n });\n }, 0);\n } else {\n const delta = prev.length - hashes.length;\n if (isHashChangedFromEvent.current) {\n isHashChangedFromEvent.current = false;\n } else {\n if (hashes.length !== indexHashRef.current.length) {\n if (delta > 0) {\n const last = indexHashRef.current[indexHashRef.current.length - delta - 1];\n let realDelta = delta;\n if (last) {\n const indexLast = historyState.currentIndexes.findIndex(\n (l) => l === last.index,\n );\n realDelta = historyState.currentIndexes.length - indexLast - 1;\n }\n historyState.isHistoryAltered = true;\n window.history.go(-realDelta);\n const removed = indexHashRef.current.splice(indexHashRef.current.length - delta - 1, delta);\n removed.forEach(({ index }) => {\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(index), 1);\n });\n }\n }\n\n if (hashes.length > 0) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes[historyState.currentIndexes.length - 1] = index;\n\n window.history.replaceState({\n index,\n state: currentState,\n }, '', `${PATH_BASE}#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current[indexHashRef.current.length - 1] = {\n index,\n hash: hashes[hashes.length - 1],\n };\n }, 0);\n }\n }\n }\n }\n }, [currentState, hashes, isActive, prevHashes, shouldReplaceNext]);\n\n useEffect(() => {\n const handlePopState = (event: PopStateEvent) => {\n if (historyState.isHistoryAltered) {\n setTimeout(() => {\n historyState.isHistoryAltered = false;\n }, 0);\n return;\n }\n const { index: i } = event.state;\n const index = i || 0;\n try {\n const currIndex = hashes ? indexHashRef.current[indexHashRef.current.length - 1].index : indexRef.current;\n\n const prev = historyState.currentIndexes[historyState.currentIndexes.indexOf(currIndex) - 1];\n\n if (historyState.isDisabled) return;\n\n if ((!isClosed.current && (index === 0 || index === prev)) || (hashes && (index === 0 || index === prev))) {\n if (hashes) {\n isHashChangedFromEvent.current = true;\n indexHashRef.current.pop();\n }\n\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(currIndex), 1);\n\n if (onBack) {\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onBack(!historyState.isEdge);\n isClosed.current = true;\n }\n } else if (index === currIndex && isClosed.current && onForward && !hashes) {\n isForward.current = true;\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onForward(event.state.state);\n }\n } catch (e) {\n // Forward navigation for hashed is not supported\n }\n };\n\n const hasChanged = hashes\n ? (!prevHashes || !areSortedArraysEqual(prevHashes, hashes))\n : prevIsActive !== isActive;\n\n if (!historyState.isDisabled && hasChanged) {\n handleChange();\n }\n\n window.addEventListener('popstate', handlePopState);\n return () => window.removeEventListener('popstate', handlePopState);\n }, [\n currentState, handleChange, hashes, isActive, onBack, onForward, prevHashes, prevIsActive, shouldReplaceNext,\n ]);\n\n return {\n forceClose: () => handleChange(true),\n };\n}\n","import { RefObject } from 'react';\nimport { useState, useCallback, useEffect } from '../lib/teact/teact';\n\nconst useKeyboardListNavigation = (\n elementRef: RefObject,\n isOpen: boolean,\n onSelectWithEnter?: (index: number) => void,\n itemSelector?: string,\n noCaptureFocus?: boolean,\n) => {\n const [focusedIndex, setFocusedIndex] = useState(-1);\n\n useEffect(() => {\n setFocusedIndex(-1);\n\n const element = elementRef.current;\n if (isOpen && element && !noCaptureFocus) {\n element.tabIndex = -1;\n element.focus();\n }\n }, [elementRef, isOpen, noCaptureFocus]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n if (e.keyCode === 13 && onSelectWithEnter) {\n onSelectWithEnter(focusedIndex);\n return;\n }\n\n if (e.keyCode !== 38 && e.keyCode !== 40) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(itemSelector ? element.querySelectorAll(itemSelector) : element.children);\n\n let newIndex = (focusedElement && elementChildren.indexOf(focusedElement)) || focusedIndex;\n\n if (e.keyCode === 38 && newIndex > 0) {\n newIndex--;\n } else if (e.keyCode === 40 && newIndex < elementChildren.length - 1) {\n newIndex++;\n } else if (elementChildren.length === 1) {\n newIndex = 0;\n } else {\n return;\n }\n\n const item = elementChildren[newIndex] as HTMLElement;\n if (item) {\n setFocusedIndex(newIndex);\n item.focus();\n }\n }, [elementRef, onSelectWithEnter, itemSelector, focusedIndex]);\n\n return handleKeyDown;\n};\n\nexport default useKeyboardListNavigation;\n","import * as langProvider from '../util/langProvider';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport type LangFn = typeof langProvider.getTranslation;\n\nconst useLang = (): LangFn => {\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n return langProvider.addCallback(forceUpdate);\n }, [forceUpdate]);\n\n return langProvider.getTranslation;\n};\n\nexport default useLang;\n","import { useEffect } from '../lib/teact/teact';\n\nimport {\n BundleModules, Bundles, getModuleFromMemory, loadModule, addLoadListener,\n} from '../util/moduleLoader';\n\nimport useForceUpdate from './useForceUpdate';\n\nconst useModuleLoader = >(\n bundleName: B, moduleName: M, noLoad = false, autoUpdate = false,\n) => {\n const module = getModuleFromMemory(bundleName, moduleName);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!autoUpdate) {\n return undefined;\n }\n\n return addLoadListener(forceUpdate);\n }, [autoUpdate, forceUpdate]);\n\n useEffect(() => {\n if (!noLoad && !module) {\n loadModule(bundleName, moduleName).then(forceUpdate);\n }\n }, [bundleName, forceUpdate, module, moduleName, noLoad]);\n\n return module;\n};\n\nexport default useModuleLoader;\n","import usePrevious from './usePrevious';\n\nconst useOnChange = (cb: (args: T | []) => void, dependencies: T) => {\n const prevDeps = usePrevious(dependencies);\n if (!prevDeps || dependencies.some((d, i) => d !== prevDeps[i])) {\n cb(prevDeps || []);\n }\n};\n\nexport default useOnChange;\n","import { useRef } from '../lib/teact/teact';\n\nfunction usePrevious(next: T): T | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined: true): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean) {\n const ref = useRef();\n const { current } = ref;\n if (!shouldSkipUndefined || next !== undefined) {\n ref.current = next;\n }\n\n return current;\n}\n\nexport default usePrevious;\n","import { useRef, useState } from '../lib/teact/teact';\nimport buildClassName from '../util/buildClassName';\n\nconst CLOSE_DURATION = 350;\n\nconst useShowTransition = (\n isOpen = false,\n onCloseTransitionEnd?: () => void,\n noOpenTransition = false,\n className: string | false = 'fast',\n noCloseTransition = false,\n) => {\n const [isClosed, setIsClosed] = useState(!isOpen);\n const closeTimeoutRef = useRef();\n // СSS class should be added in a separate tick to turn on CSS transition.\n const [hasOpenClassName, setHasOpenClassName] = useState(isOpen && noOpenTransition);\n\n if (isOpen) {\n setIsClosed(false);\n setHasOpenClassName(true);\n\n if (closeTimeoutRef.current) {\n window.clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = undefined;\n }\n } else {\n setHasOpenClassName(false);\n\n if (!isClosed && !closeTimeoutRef.current) {\n const exec = () => {\n setIsClosed(true);\n\n if (onCloseTransitionEnd) {\n onCloseTransitionEnd();\n }\n\n closeTimeoutRef.current = undefined;\n };\n\n if (noCloseTransition) {\n exec();\n } else {\n closeTimeoutRef.current = window.setTimeout(exec, CLOSE_DURATION);\n }\n }\n }\n\n // `noCloseTransition`, when set to true, should remove the open class immediately\n const shouldHaveOpenClassName = hasOpenClassName && !(noCloseTransition && !isOpen);\n const isClosing = Boolean(closeTimeoutRef.current);\n const shouldRender = isOpen || isClosing;\n const transitionClassNames = buildClassName(\n className && 'opacity-transition',\n className,\n shouldHaveOpenClassName && 'open',\n shouldRender && 'shown',\n isClosing && 'closing',\n );\n\n return {\n shouldRender,\n transitionClassNames,\n };\n};\n\nexport default useShowTransition;\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\n\nconst BACKDROP_CLASSNAME = 'backdrop';\n\n// This effect implements closing menus by clicking outside of them\n// without adding extra elements to the DOM\nexport default function useVirtualBackdrop(\n isOpen: boolean,\n menuRef: RefObject,\n onClose?: () => void | undefined,\n) {\n useEffect(() => {\n const handleEvent = (e: Event) => {\n const menu = menuRef.current;\n const target = e.target as HTMLElement | null;\n if (!menu || !target) {\n return;\n }\n\n if (\n !menu.contains(e.target as Node | null)\n || target.classList.contains(BACKDROP_CLASSNAME)\n ) {\n e.preventDefault();\n e.stopPropagation();\n if (onClose) {\n onClose();\n }\n }\n };\n\n if (isOpen && onClose) {\n document.addEventListener('mousedown', handleEvent);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleEvent);\n };\n }, [isOpen, menuRef, onClose]);\n}\n","import { DEBUG } from '../../config';\n\ntype Handler = (e: Event) => void;\ntype DelegationRegistry = Map;\n\nconst NON_BUBBLEABLE_EVENTS = new Set(['scroll', 'mouseenter', 'mouseleave']);\n\nconst documentEventCounters: Record = {};\nconst delegationRegistryByEventType: Record = {};\nconst delegatedEventTypesByElement = new Map>();\n\nexport function addEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventType = resolveEventType(propName, element);\n if (canUseEventDelegation(eventType, element, asCapture)) {\n addDelegatedListener(eventType, element, handler);\n } else {\n element.addEventListener(eventType, handler, asCapture);\n }\n}\n\nexport function removeEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventType = resolveEventType(propName, element);\n if (canUseEventDelegation(eventType, element, asCapture)) {\n removeDelegatedListener(eventType, element);\n } else {\n element.removeEventListener(eventType, handler, asCapture);\n }\n}\n\nfunction resolveEventType(propName: string, element: HTMLElement) {\n const eventType = propName\n .replace(/^on/, '')\n .replace(/Capture$/, '').toLowerCase();\n\n if (eventType === 'change' && element.tagName !== 'SELECT') {\n // React behavior repeated here.\n // https://stackoverflow.com/questions/38256332/in-react-whats-the-difference-between-onchange-and-oninput\n return 'input';\n }\n\n if (eventType === 'doubleclick') {\n return 'dblclick';\n }\n\n // Replace focus/blur by their \"bubbleable\" versions\n if (eventType === 'focus') {\n return 'focusin';\n }\n\n if (eventType === 'blur') {\n return 'focusout';\n }\n\n return eventType;\n}\n\nfunction canUseEventDelegation(realEventType: string, element: HTMLElement, asCapture: boolean) {\n return (\n !asCapture\n && !NON_BUBBLEABLE_EVENTS.has(realEventType)\n && element.tagName !== 'VIDEO'\n && element.tagName !== 'IFRAME'\n );\n}\n\nfunction addDelegatedListener(eventType: string, element: HTMLElement, handler: Handler) {\n if (!documentEventCounters[eventType]) {\n documentEventCounters[eventType] = 0;\n document.addEventListener(eventType, handleEvent);\n }\n\n resolveDelegationRegistry(eventType).set(element, handler);\n resolveDelegatedEventTypes(element).add(eventType);\n documentEventCounters[eventType]++;\n}\n\nfunction removeDelegatedListener(eventType: string, element: HTMLElement) {\n documentEventCounters[eventType]--;\n if (!documentEventCounters[eventType]) {\n // Synchronous deletion on 0 will cause perf degradation in the case of 1 element\n // which is not a real case, so it's ok to do it this way\n document.removeEventListener(eventType, handleEvent);\n }\n\n delegationRegistryByEventType[eventType].delete(element);\n delegatedEventTypesByElement.get(element)!.delete(eventType);\n}\n\nexport function removeAllDelegatedListeners(element: HTMLElement) {\n const eventTypes = delegatedEventTypesByElement.get(element);\n if (!eventTypes) {\n return;\n }\n\n eventTypes.forEach((eventType) => removeDelegatedListener(eventType, element));\n delegatedEventTypesByElement.delete(element);\n}\n\nfunction handleEvent(realEvent: Event) {\n const events = delegationRegistryByEventType[realEvent.type];\n\n if (events) {\n let furtherCallsPrevented = false;\n let current: HTMLElement = realEvent.target as HTMLElement;\n\n const stopPropagation = () => {\n furtherCallsPrevented = true;\n };\n\n const preventDefault = () => {\n realEvent.preventDefault();\n };\n\n // Proxy is a simplest way to provide an access to the event property\n const event = new Proxy(realEvent, {\n get(target, p) {\n if (p === 'currentTarget') {\n return current;\n }\n if (p === 'stopPropagation' || p === 'stopImmediatePropagation') {\n return stopPropagation;\n }\n if (p === 'preventDefault') {\n // \"this\" is changed to proxy and one can't call methods via it\n return preventDefault;\n }\n return Reflect.get(target, p);\n },\n });\n\n // This can also be limited by teact root\n while (current && current !== document.body) {\n const handler = events.get(current);\n if (handler) {\n handler(event);\n if (furtherCallsPrevented) {\n return;\n }\n }\n\n current = current.parentNode as HTMLElement;\n }\n }\n}\n\nfunction resolveDelegationRegistry(eventType: string) {\n if (!delegationRegistryByEventType[eventType]) {\n delegationRegistryByEventType[eventType] = new Map();\n }\n\n return delegationRegistryByEventType[eventType];\n}\n\nfunction resolveDelegatedEventTypes(element: HTMLElement) {\n const existing = delegatedEventTypesByElement.get(element);\n if (existing) {\n return existing;\n }\n\n const newSet = new Set();\n delegatedEventTypesByElement.set(element, newSet);\n\n return newSet;\n}\n\nif (DEBUG) {\n document.addEventListener('dblclick', () => {\n const documentListenersCount = Object.keys(documentEventCounters).length;\n const delegatedHandlersCount1 = Object.values(documentEventCounters)\n .reduce((acc, counter) => acc + counter, 0);\n const delegationRegistriesCount = Object.keys(delegationRegistryByEventType).length;\n const delegatedHandlersCount2 = Object.values(delegationRegistryByEventType)\n .reduce((acc, delegationRegistry) => acc + delegationRegistry.size, 0);\n const delegationElementsCount = delegatedEventTypesByElement.size;\n const delegatedEventTypesCount = Array.from(delegatedEventTypesByElement.values())\n .reduce((acc, eventTypes) => acc + eventTypes.size, 0);\n\n // eslint-disable-next-line no-console\n console.warn('DELEGATED EVENTS STATS', {\n delegatedHandlersCount1,\n delegatedHandlersCount2,\n delegatedEventTypesCount,\n delegationRegistriesCount,\n delegationElementsCount,\n documentListenersCount,\n });\n });\n}\n","import {\n hasElementChanged,\n isComponentElement,\n isEmptyElement,\n isRealElement,\n isTextElement,\n mountComponent,\n renderComponent,\n unmountTree,\n getTarget,\n setTarget,\n VirtualElement,\n VirtualElementComponent,\n VirtualRealElement,\n} from './teact';\nimport generateIdFor from '../../util/generateIdFor';\nimport { DEBUG } from '../../config';\nimport { addEventListener, removeEventListener } from './dom-events';\n\ntype VirtualDomHead = {\n children: [VirtualElement] | [];\n};\n\nconst FILTERED_ATTRIBUTES = new Set(['key', 'ref', 'teactFastList', 'teactOrderKey']);\nconst HTML_ATTRIBUTES = new Set(['dir', 'role']);\nconst MAPPED_ATTRIBUTES: { [k: string]: string } = {\n autoPlay: 'autoplay',\n autoComplete: 'autocomplete',\n};\nconst INDEX_KEY_PREFIX = '__indexKey#';\n\nconst headsByElement: Record = {};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_virtualTreeSize = 1;\n\nfunction render($element?: VirtualElement, parentEl?: HTMLElement | null) {\n if (!parentEl) {\n return undefined;\n }\n\n let headId = parentEl.getAttribute('data-teact-head-id');\n if (!headId) {\n headId = generateIdFor(headsByElement);\n headsByElement[headId] = { children: [] };\n parentEl.setAttribute('data-teact-head-id', headId);\n }\n\n const $head = headsByElement[headId];\n $head.children = [renderWithVirtual(parentEl, $head.children[0], $element, $head, 0) as VirtualElement];\n\n if (process.env.APP_ENV === 'perf') {\n DEBUG_virtualTreeSize = 0;\n DEBUG_addToVirtualTreeSize($head);\n\n return DEBUG_virtualTreeSize;\n }\n\n return undefined;\n}\n\nfunction renderWithVirtual(\n parentEl: HTMLElement,\n $current: VirtualElement | undefined,\n $new: VirtualElement | undefined,\n $parent: VirtualRealElement | VirtualDomHead,\n index: number,\n {\n skipComponentUpdate = false,\n forceIndex = false,\n fragment,\n moveDirection,\n }: {\n skipComponentUpdate?: boolean;\n forceIndex?: boolean;\n fragment?: DocumentFragment;\n moveDirection?: 'up' | 'down';\n } = {},\n) {\n const isCurrentComponent = $current && isComponentElement($current);\n const isNewComponent = $new && isComponentElement($new);\n\n if (\n !skipComponentUpdate\n && isCurrentComponent && isNewComponent\n && !hasElementChanged($current!, $new!)\n ) {\n $new = updateComponent($current as VirtualElementComponent, $new as VirtualElementComponent);\n }\n\n // Parent element may have changed, so we need to update the listener closure.\n if (!skipComponentUpdate && isNewComponent && ($new as VirtualElementComponent).componentInstance.isMounted) {\n setupComponentUpdateListener($new as VirtualElementComponent, $parent, index, parentEl);\n }\n\n if ($current === $new) {\n return $new;\n }\n\n if (!$current && $new) {\n if (isNewComponent) {\n $new = initComponent($new as VirtualElementComponent, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n\n if (forceIndex && parentEl.childNodes[index]) {\n parentEl.insertBefore(node, parentEl.childNodes[index]);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n } else if ($current && !$new) {\n parentEl.removeChild(getTarget($current)!);\n unmountTree($current);\n } else if ($current && $new) {\n if (hasElementChanged($current, $new)) {\n if (isNewComponent) {\n $new = initComponent($new as VirtualElementComponent, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n parentEl.replaceChild(node, getTarget($current)!);\n unmountTree($current);\n } else {\n const areComponents = isCurrentComponent && isNewComponent;\n const currentTarget = getTarget($current);\n\n if (!areComponents) {\n setTarget($new, currentTarget!);\n setTarget($current, undefined as any); // Help GC\n\n if ('props' in $current && 'props' in $new) {\n $new.props.ref = $current.props.ref;\n }\n }\n\n if (isRealElement($new)) {\n if (moveDirection) {\n const node = currentTarget!;\n const nextSibling = parentEl.childNodes[moveDirection === 'up' ? index : index + 1];\n\n if (nextSibling) {\n parentEl.insertBefore(node, nextSibling);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n }\n\n if (!areComponents) {\n updateAttributes(($current as VirtualRealElement), $new, currentTarget as HTMLElement);\n }\n\n $new.children = renderChildren(\n ($current as VirtualRealElement),\n $new,\n areComponents ? parentEl : currentTarget as HTMLElement,\n );\n }\n }\n }\n\n return $new;\n}\n\nfunction initComponent(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n if (!isComponentElement($element)) {\n return $element;\n }\n\n const { componentInstance } = $element;\n\n if (!componentInstance.isMounted) {\n $element = mountComponent(componentInstance);\n setupComponentUpdateListener($element, $parent, index, parentEl);\n\n const $firstChild = $element.children[0];\n if (isComponentElement($firstChild)) {\n $element.children = [initComponent($firstChild, $element, 0, parentEl)];\n }\n\n componentInstance.isMounted = true;\n }\n\n return $element;\n}\n\nfunction updateComponent($current: VirtualElementComponent, $new: VirtualElementComponent) {\n $current.componentInstance.props = $new.componentInstance.props;\n\n return renderComponent($current.componentInstance);\n}\n\nfunction setupComponentUpdateListener(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n const { componentInstance } = $element;\n\n componentInstance.onUpdate = () => {\n $parent.children[index] = renderWithVirtual(\n parentEl,\n $parent.children[index],\n componentInstance.$element,\n $parent,\n index,\n { skipComponentUpdate: true },\n ) as VirtualElementComponent;\n };\n}\n\nfunction createNode($element: VirtualElement): Node {\n if (isEmptyElement($element)) {\n return document.createTextNode('');\n }\n\n if (isTextElement($element)) {\n return document.createTextNode($element.value);\n }\n\n if (isComponentElement($element)) {\n return createNode($element.children[0] as VirtualElement);\n }\n\n const { tag, props, children = [] } = $element;\n const element = document.createElement(tag);\n\n if (typeof props.ref === 'object') {\n props.ref.current = element;\n }\n\n Object.entries(props).forEach(([key, value]) => {\n if (props[key] !== undefined) {\n setAttribute(element, key, value);\n }\n });\n\n $element.children = children.map(($child, i) => (\n renderWithVirtual(element, undefined, $child, $element, i) as VirtualElement\n ));\n\n return element;\n}\n\nfunction renderChildren(\n $current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement,\n) {\n if ($new.props.teactFastList) {\n return renderFastListChildren($current, $new, currentEl);\n }\n\n const currentChildrenLength = $current.children.length;\n const newChildrenLength = $new.children.length;\n const maxLength = Math.max(currentChildrenLength, newChildrenLength);\n const newChildren = [];\n const fragment = newChildrenLength > currentChildrenLength + 1 ? document.createDocumentFragment() : undefined;\n\n for (let i = 0; i < maxLength; i++) {\n const $newChild = renderWithVirtual(\n currentEl,\n $current.children[i],\n $new.children[i],\n $new,\n i,\n i >= currentChildrenLength ? { fragment } : undefined,\n );\n\n if ($newChild) {\n newChildren.push($newChild);\n }\n }\n\n if (fragment) {\n currentEl.appendChild(fragment);\n }\n\n return newChildren;\n}\n\nfunction renderFastListChildren($current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement) {\n const newKeys = new Set(\n $new.children.map(($newChild) => {\n const key = 'props' in $newChild && $newChild.props.key;\n\n // eslint-disable-next-line no-null/no-null\n if (DEBUG && isRealElement($newChild) && (key === undefined || key === null)) {\n // eslint-disable-next-line no-console\n console.warn('Missing `key` in `teactFastList`');\n }\n\n return key;\n }),\n );\n\n let currentRemainingIndex = 0;\n const remainingByKey = $current.children\n .reduce((acc, $currentChild, i) => {\n let key = 'props' in $currentChild ? $currentChild.props.key : undefined;\n // eslint-disable-next-line no-null/no-null\n const isKeyPresent = key !== undefined && key !== null;\n\n // First we handle removed children\n if (isKeyPresent && !newKeys.has(key)) {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n } else if (!isKeyPresent) {\n const $newChild = $new.children[i];\n const newChildKey = ($newChild && 'props' in $newChild) ? $newChild.props.key : undefined;\n // If a non-key element remains at the same index we preserve it with a virtual `key`\n if ($newChild && !newChildKey) {\n key = `${INDEX_KEY_PREFIX}${i}`;\n } else {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n }\n }\n\n // Then we build up info about remaining children\n acc[key] = {\n $element: $currentChild,\n index: currentRemainingIndex++,\n order: 'props' in $currentChild ? $currentChild.props.teactOrderKey : undefined,\n };\n return acc;\n }, {} as Record);\n\n let newChildren: VirtualElement[] = [];\n\n let fragmentQueue: VirtualElement[] | undefined;\n let fragmentIndex: number | undefined;\n\n let currentPreservedIndex = 0;\n\n $new.children.forEach(($newChild, i) => {\n const key = 'props' in $newChild ? $newChild.props.key : `${INDEX_KEY_PREFIX}${i}`;\n const currentChildInfo = remainingByKey[key];\n\n if (!currentChildInfo) {\n // All new nodes are queued to be inserted with fragments if possible.\n if (!fragmentQueue) {\n fragmentQueue = [];\n fragmentIndex = i;\n }\n\n fragmentQueue.push($newChild);\n return;\n }\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n fragmentIndex = undefined;\n fragmentQueue = undefined;\n }\n\n // This is a \"magic\" `teactOrderKey` property that tells us the element is updated\n const order = 'props' in $newChild ? $newChild.props.teactOrderKey : undefined;\n const shouldMoveNode = currentChildInfo.index !== currentPreservedIndex && currentChildInfo.order !== order;\n const isMovingDown = shouldMoveNode && currentPreservedIndex > currentChildInfo.index;\n\n // When the node goes down, preserved indexing actually breaks, so the \"magic\" should help.\n if (!shouldMoveNode || isMovingDown) {\n currentPreservedIndex++;\n }\n\n newChildren.push(\n renderWithVirtual(currentEl, currentChildInfo.$element, $newChild, $new, i, {\n forceIndex: true,\n moveDirection: shouldMoveNode ? (isMovingDown ? 'down' : 'up') : undefined,\n })!,\n );\n });\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n }\n\n return newChildren;\n}\n\nfunction flushFragmentQueue(\n fragmentQueue: VirtualElement[], fragmentIndex: number, parentEl: HTMLElement, $parent: VirtualRealElement,\n) {\n if (fragmentQueue.length === 1) {\n return [renderWithVirtual(parentEl, undefined, fragmentQueue[0], $parent, fragmentIndex, { forceIndex: true })!];\n } else if (fragmentQueue.length > 1) {\n const fragment = document.createDocumentFragment();\n const newChildren = fragmentQueue.map(($fragmentChild) => (\n renderWithVirtual(parentEl, undefined, $fragmentChild, $parent, fragmentIndex!, { fragment })!\n ));\n\n if (parentEl.childNodes[fragmentIndex]) {\n parentEl.insertBefore(fragment, parentEl.childNodes[fragmentIndex]);\n } else {\n parentEl.appendChild(fragment);\n }\n\n return newChildren;\n }\n\n throw new Error('Unexpected input');\n}\n\nfunction updateAttributes($current: VirtualRealElement, $new: VirtualRealElement, element: HTMLElement) {\n const currentEntries = Object.entries($current.props);\n const newEntries = Object.entries($new.props);\n\n currentEntries.forEach(([key, currentValue]) => {\n const newValue = $new.props[key];\n\n if (\n currentValue !== undefined\n && (\n newValue === undefined\n || (currentValue !== newValue && key.startsWith('on'))\n )\n ) {\n removeAttribute(element, key, currentValue);\n }\n });\n\n newEntries.forEach(([key, newValue]) => {\n const currentValue = $current.props[key];\n\n if (newValue !== undefined && newValue !== currentValue) {\n setAttribute(element, key, newValue);\n }\n });\n}\n\nfunction setAttribute(element: HTMLElement, key: string, value: any) {\n // An optimization attempt\n if (key === 'className') {\n element.className = value;\n // An optimization attempt\n } else if (key === 'value') {\n if ((element as HTMLInputElement).value !== value) {\n (element as HTMLInputElement).value = value;\n }\n } else if (key === 'style') {\n element.style.cssText = value;\n } else if (key === 'dangerouslySetInnerHTML') {\n // eslint-disable-next-line no-underscore-dangle\n element.innerHTML = value.__html;\n } else if (key.startsWith('on')) {\n addEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || key.startsWith('aria-') || HTML_ATTRIBUTES.has(key)) {\n element.setAttribute(key, value);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n (element as any)[MAPPED_ATTRIBUTES[key] || key] = value;\n }\n}\n\nfunction removeAttribute(element: HTMLElement, key: string, value: any) {\n if (key === 'className') {\n element.className = '';\n } else if (key === 'value') {\n (element as HTMLInputElement).value = '';\n } else if (key === 'style') {\n element.style.cssText = '';\n } else if (key === 'dangerouslySetInnerHTML') {\n element.innerHTML = '';\n } else if (key.startsWith('on')) {\n removeEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || key.startsWith('aria-') || HTML_ATTRIBUTES.has(key)) {\n element.removeAttribute(key);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n delete (element as any)[MAPPED_ATTRIBUTES[key] || key];\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction DEBUG_addToVirtualTreeSize($current: VirtualRealElement | VirtualDomHead) {\n DEBUG_virtualTreeSize += $current.children.length;\n\n $current.children.forEach(($child) => {\n if (isRealElement($child)) {\n DEBUG_addToVirtualTreeSize($child);\n }\n });\n}\n\nconst TeactDOM = { render };\nexport default TeactDOM;\n","import { DEBUG, DEBUG_MORE } from '../../config';\nimport {\n fastRaf, fastRafPrimary, onTickEnd, onTickEndPrimary, throttleWithPrimaryRaf, throttleWithRaf,\n} from '../../util/schedulers';\nimport { flatten, orderBy } from '../../util/iteratees';\nimport { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { handleError } from '../../util/handleError';\nimport { removeAllDelegatedListeners } from './dom-events';\n\nexport type Props = AnyLiteral;\nexport type FC

= (props: P) => any;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type FC_withDebug = FC & {\n DEBUG_contentComponentName?: string;\n};\n\nexport enum VirtualElementTypesEnum {\n Empty,\n Text,\n Tag,\n Component,\n}\n\ninterface VirtualElementEmpty {\n type: VirtualElementTypesEnum.Empty;\n target?: Node;\n}\n\ninterface VirtualElementText {\n type: VirtualElementTypesEnum.Text;\n target?: Node;\n value: string;\n}\n\nexport interface VirtualElementTag {\n type: VirtualElementTypesEnum.Tag;\n target?: Node;\n tag: string;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport interface VirtualElementComponent {\n type: VirtualElementTypesEnum.Component;\n componentInstance: ComponentInstance;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport type StateHookSetter = (newValue: ((current: T) => T) | T) => void;\n\ninterface ComponentInstance {\n $element: VirtualElementComponent;\n Component: FC;\n name: string;\n props: Props;\n renderedValue?: any;\n isMounted: boolean;\n hooks: {\n state: {\n cursor: number;\n byCursor: {\n value: any;\n nextValue: any;\n setter: StateHookSetter;\n }[];\n };\n effects: {\n cursor: number;\n byCursor: {\n effect: () => void;\n dependencies?: readonly any[];\n cleanup?: Function;\n }[];\n };\n memos: {\n cursor: number;\n byCursor: {\n current: any;\n dependencies: any[];\n }[];\n };\n };\n prepareForFrame?: () => void;\n forceUpdate?: () => void;\n onUpdate?: () => void;\n}\n\nexport type VirtualElement =\n VirtualElementEmpty\n | VirtualElementText\n | VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualRealElement =\n VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualElementChildren = VirtualElement[];\n\nconst Fragment = Symbol('Fragment');\n\nconst DEBUG_RENDER_THRESHOLD = 7;\nconst DEBUG_EFFECT_THRESHOLD = 7;\nconst DEBUG_SILENT_RENDERS_FOR = new Set(['TeactMemoWrapper', 'TeactNContainer', 'Button', 'ListItem', 'MenuItem']);\n\nlet renderingInstance: ComponentInstance;\n\nexport function isEmptyElement($element: VirtualElement): $element is VirtualElementEmpty {\n return $element.type === VirtualElementTypesEnum.Empty;\n}\n\nexport function isTextElement($element: VirtualElement): $element is VirtualElementText {\n return $element.type === VirtualElementTypesEnum.Text;\n}\n\nexport function isTagElement($element: VirtualElement): $element is VirtualElementTag {\n return $element.type === VirtualElementTypesEnum.Tag;\n}\n\nexport function isComponentElement($element: VirtualElement): $element is VirtualElementComponent {\n return $element.type === VirtualElementTypesEnum.Component;\n}\n\nexport function isRealElement($element: VirtualElement): $element is VirtualRealElement {\n return isTagElement($element) || isComponentElement($element);\n}\n\nfunction createElement(\n source: string | FC | typeof Fragment,\n props: Props,\n ...children: any[]\n): VirtualRealElement | VirtualElementChildren {\n if (!props) {\n props = {};\n }\n\n children = flatten(children);\n\n if (source === Fragment) {\n return children;\n } else if (typeof source === 'function') {\n return createComponentInstance(source, props, children);\n } else {\n return buildTagElement(source, props, children);\n }\n}\n\nfunction createComponentInstance(Component: FC, props: Props, children: any[]): VirtualElementComponent {\n let parsedChildren: any | any[] | undefined;\n if (children.length === 0) {\n parsedChildren = undefined;\n } else if (children.length === 1) {\n [parsedChildren] = children;\n } else {\n parsedChildren = children;\n }\n\n const componentInstance: ComponentInstance = {\n $element: {} as VirtualElementComponent,\n Component,\n name: Component.name,\n props: {\n ...props,\n ...(parsedChildren && { children: parsedChildren }),\n },\n isMounted: false,\n hooks: {\n state: {\n cursor: 0,\n byCursor: [],\n },\n effects: {\n cursor: 0,\n byCursor: [],\n },\n memos: {\n cursor: 0,\n byCursor: [],\n },\n },\n };\n\n componentInstance.$element = buildComponentElement(componentInstance);\n\n return componentInstance.$element;\n}\n\nfunction buildComponentElement(\n componentInstance: ComponentInstance,\n children: VirtualElementChildren = [],\n): VirtualElementComponent {\n const { props } = componentInstance;\n\n return {\n componentInstance,\n type: VirtualElementTypesEnum.Component,\n props,\n children,\n };\n}\n\nfunction buildTagElement(tag: string, props: Props, children: any[]): VirtualElementTag {\n return {\n type: VirtualElementTypesEnum.Tag,\n tag,\n props,\n children: dropEmptyTail(children).map(buildChildElement),\n };\n}\n\n// We only need placeholders in the middle of collection (to ensure other elements order).\nfunction dropEmptyTail(children: any[]) {\n let i = children.length - 1;\n\n for (; i >= 0; i--) {\n if (!isEmptyPlaceholder(children[i])) {\n break;\n }\n }\n\n return i + 1 < children.length ? children.slice(0, i + 1) : children;\n}\n\nfunction isEmptyPlaceholder(child: any) {\n // eslint-disable-next-line no-null/no-null\n return child === false || child === null || child === undefined;\n}\n\nfunction buildChildElement(child: any): VirtualElement {\n if (isEmptyPlaceholder(child)) {\n return buildEmptyElement();\n } else if (isRealElement(child)) {\n return child;\n } else {\n return buildTextElement(child);\n }\n}\n\nfunction buildTextElement(value: any): VirtualElementText {\n return {\n type: VirtualElementTypesEnum.Text,\n value: String(value),\n };\n}\n\nfunction buildEmptyElement(): VirtualElementEmpty {\n return { type: VirtualElementTypesEnum.Empty };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst DEBUG_components: AnyLiteral = {};\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.warn('COMPONENTS', orderBy(Object.values(DEBUG_components), 'renderCount', 'desc'));\n});\n\nexport function renderComponent(componentInstance: ComponentInstance) {\n renderingInstance = componentInstance;\n componentInstance.hooks.state.cursor = 0;\n componentInstance.hooks.effects.cursor = 0;\n componentInstance.hooks.memos.cursor = 0;\n\n const { Component, props } = componentInstance;\n let newRenderedValue;\n\n try {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n const componentName = componentInstance.name;\n if (!DEBUG_components[componentName]) {\n DEBUG_components[componentName] = {\n componentName,\n renderCount: 0,\n renderTimes: [],\n };\n }\n\n if (DEBUG_MORE) {\n if (!DEBUG_SILENT_RENDERS_FOR.has(componentName)) {\n // eslint-disable-next-line no-console\n console.log(`[Teact] Render ${componentName}`);\n }\n }\n\n DEBUG_startAt = performance.now();\n }\n\n newRenderedValue = Component(props);\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (duration > DEBUG_RENDER_THRESHOLD) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow component render: ${componentName}, ${Math.round(duration)} ms`);\n }\n DEBUG_components[componentName].renderTimes.push(duration);\n DEBUG_components[componentName].renderCount++;\n }\n } catch (err: any) {\n handleError(err);\n\n newRenderedValue = componentInstance.renderedValue;\n }\n\n if (componentInstance.isMounted && newRenderedValue === componentInstance.renderedValue) {\n return componentInstance.$element;\n }\n\n componentInstance.renderedValue = newRenderedValue;\n\n const newChild = buildChildElement(newRenderedValue);\n componentInstance.$element = buildComponentElement(componentInstance, [newChild]);\n\n return componentInstance.$element;\n}\n\nexport function hasElementChanged($old: VirtualElement, $new: VirtualElement) {\n if (typeof $old !== typeof $new) {\n return true;\n } else if ($old.type !== $new.type) {\n return true;\n } else if (isTextElement($old) && isTextElement($new)) {\n return $old.value !== $new.value;\n } else if (isTagElement($old) && isTagElement($new)) {\n return ($old.tag !== $new.tag) || ($old.props.key !== $new.props.key);\n } else if (isComponentElement($old) && isComponentElement($new)) {\n return (\n $old.componentInstance.Component !== $new.componentInstance.Component\n ) || (\n $old.props.key !== $new.props.key\n );\n }\n\n return false;\n}\n\nexport function unmountTree($element: VirtualElement) {\n if (isComponentElement($element)) {\n unmountComponent($element.componentInstance);\n } else {\n if (isTagElement($element)) {\n if ($element.target) {\n removeAllDelegatedListeners($element.target as HTMLElement);\n }\n\n if ($element.props.ref) {\n $element.props.ref.current = undefined; // Help GC\n }\n }\n\n if ($element.target) {\n $element.target = undefined; // Help GC\n }\n\n if (!isRealElement($element)) {\n return;\n }\n }\n\n $element.children.forEach(unmountTree);\n}\n\nexport function mountComponent(componentInstance: ComponentInstance) {\n renderComponent(componentInstance);\n componentInstance.isMounted = true;\n return componentInstance.$element;\n}\n\nfunction unmountComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n // We need to clean refs before running effect cleanups\n componentInstance.hooks.memos.byCursor.forEach((memoContainer) => {\n memoContainer.current = undefined;\n });\n\n componentInstance.hooks.effects.byCursor.forEach(({ cleanup }) => {\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err: any) {\n handleError(err);\n }\n }\n });\n\n componentInstance.isMounted = false;\n\n helpGc(componentInstance);\n}\n\n// We need to remove all references to DOM objects. We also clean all other references, just in case\nfunction helpGc(componentInstance: ComponentInstance) {\n componentInstance.hooks.effects.byCursor.forEach((hook) => {\n hook.cleanup = undefined;\n hook.effect = undefined as any;\n hook.dependencies = undefined;\n });\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = undefined;\n hook.nextValue = undefined;\n hook.setter = undefined as any;\n });\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n hook.dependencies = undefined as any;\n });\n\n componentInstance.hooks = undefined as any;\n componentInstance.$element = undefined as any;\n componentInstance.renderedValue = undefined;\n componentInstance.Component = undefined as any;\n componentInstance.props = undefined as any;\n componentInstance.forceUpdate = undefined;\n componentInstance.onUpdate = undefined;\n}\n\nfunction prepareComponentForFrame(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = hook.nextValue;\n });\n\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(() => prepareComponentForFrame(componentInstance));\n componentInstance.forceUpdate = throttleWithRaf(() => forceUpdateComponent(componentInstance));\n}\n\nfunction forceUpdateComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted || !componentInstance.onUpdate) {\n return;\n }\n\n const currentElement = componentInstance.$element;\n\n renderComponent(componentInstance);\n\n if (componentInstance.$element !== currentElement) {\n componentInstance.onUpdate();\n }\n}\n\nexport function getTarget($element: VirtualElement): Node | undefined {\n if (isComponentElement($element)) {\n return getTarget($element.children[0]);\n } else {\n return $element.target;\n }\n}\n\nexport function setTarget($element: VirtualElement, target: Node) {\n if (isComponentElement($element)) {\n setTarget($element.children[0], target);\n } else {\n $element.target = target;\n }\n}\n\nexport function useState(): [T, StateHookSetter];\nexport function useState(initial: T): [T, StateHookSetter];\nexport function useState(initial?: T): [T, StateHookSetter] {\n const { cursor, byCursor } = renderingInstance.hooks.state;\n\n if (byCursor[cursor] === undefined) {\n byCursor[cursor] = {\n value: initial,\n nextValue: initial,\n setter: ((componentInstance) => (newValue: ((current: T) => T) | T) => {\n if (byCursor[cursor].nextValue !== newValue) {\n byCursor[cursor].nextValue = typeof newValue === 'function'\n ? (newValue as (current: T) => T)(byCursor[cursor].value)\n : newValue;\n\n if (!componentInstance.prepareForFrame || !componentInstance.forceUpdate) {\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(\n () => prepareComponentForFrame(componentInstance),\n );\n componentInstance.forceUpdate = throttleWithRaf(\n () => forceUpdateComponent(componentInstance),\n );\n }\n\n componentInstance.prepareForFrame();\n componentInstance.forceUpdate();\n\n if (DEBUG_MORE) {\n if (componentInstance.name !== 'TeactNContainer') {\n // eslint-disable-next-line no-console\n console.log(\n '[Teact.useState]',\n componentInstance.name,\n // `componentInstance.Component` may be set to `null` by GC helper\n componentInstance.Component && (componentInstance.Component as FC_withDebug).DEBUG_contentComponentName\n ? `> ${(componentInstance.Component as FC_withDebug).DEBUG_contentComponentName}`\n : '',\n `Forced update at cursor #${cursor}, next value: `,\n byCursor[cursor].nextValue,\n );\n }\n }\n }\n })(renderingInstance),\n };\n }\n\n renderingInstance.hooks.state.cursor++;\n\n return [\n byCursor[cursor].value,\n byCursor[cursor].setter,\n ];\n}\n\nfunction useLayoutEffectBase(\n schedulerFn: typeof onTickEnd | typeof requestAnimationFrame,\n primarySchedulerFn: typeof onTickEnd | typeof requestAnimationFrame,\n effect: () => Function | void,\n dependencies?: readonly any[],\n debugKey?: string,\n) {\n const { cursor, byCursor } = renderingInstance.hooks.effects;\n const componentInstance = renderingInstance;\n\n function execCleanup() {\n if (!componentInstance.isMounted) {\n return;\n }\n\n const { cleanup } = byCursor[cursor];\n if (typeof cleanup === 'function') {\n try {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n cleanup();\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (duration > DEBUG_EFFECT_THRESHOLD) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Teact] Slow cleanup at effect cursor #${cursor}: ${componentName}, ${Math.round(duration)} ms`,\n );\n }\n }\n } catch (err: any) {\n handleError(err);\n }\n }\n }\n\n function exec() {\n if (!componentInstance.isMounted) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n byCursor[cursor].cleanup = effect() as Function;\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (duration > DEBUG_EFFECT_THRESHOLD) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow effect at cursor #${cursor}: ${componentName}, ${Math.round(duration)} ms`);\n }\n }\n }\n\n if (byCursor[cursor] !== undefined && dependencies && byCursor[cursor].dependencies) {\n if (dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies![i])) {\n if (debugKey) {\n const causedBy = dependencies.reduce((res, newValue, i) => {\n const prevValue = byCursor[cursor].dependencies![i];\n if (newValue !== prevValue) {\n res.push(`${i}: ${prevValue} => ${newValue}`);\n }\n\n return res;\n }, []);\n\n // eslint-disable-next-line no-console\n console.log(`[Teact] Effect \"${debugKey}\" caused by dependencies.`, causedBy.join(', '));\n }\n\n primarySchedulerFn(execCleanup);\n schedulerFn(exec);\n }\n } else {\n if (debugKey) {\n // eslint-disable-next-line no-console\n console.log(`[Teact] Effect \"${debugKey}\" caused by missing dependencies.`);\n }\n\n primarySchedulerFn(execCleanup);\n schedulerFn(exec);\n }\n\n byCursor[cursor] = {\n effect,\n dependencies,\n cleanup: byCursor[cursor] ? byCursor[cursor].cleanup : undefined,\n };\n\n renderingInstance.hooks.effects.cursor++;\n}\n\nexport function useEffect(effect: () => Function | void, dependencies?: readonly any[], debugKey?: string) {\n return useLayoutEffectBase(fastRaf, fastRafPrimary, effect, dependencies, debugKey);\n}\n\nexport function useLayoutEffect(effect: () => Function | void, dependencies?: readonly any[], debugKey?: string) {\n return useLayoutEffectBase(onTickEnd, onTickEndPrimary, effect, dependencies, debugKey);\n}\n\nexport function useMemo(resolver: () => T, dependencies: any[], debugKey?: string): T {\n const { cursor, byCursor } = renderingInstance.hooks.memos;\n let { current } = byCursor[cursor] || {};\n\n if (\n byCursor[cursor] === undefined\n || dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies[i])\n ) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.useMemo] ${renderingInstance.name} (${debugKey}): Update is caused by:`,\n byCursor[cursor]\n ? getUnequalProps(dependencies, byCursor[cursor].dependencies).join(', ')\n : '[first render]',\n );\n }\n\n current = resolver();\n }\n\n byCursor[cursor] = {\n current,\n dependencies,\n };\n\n renderingInstance.hooks.memos.cursor++;\n\n return current;\n}\n\nexport function useCallback(newCallback: F, dependencies: any[], debugKey?: string): F {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => newCallback, dependencies, debugKey);\n}\n\nexport function useRef(initial: T): { current: T };\nexport function useRef(): { current: T | undefined }; // TT way (empty is `undefined`)\nexport function useRef(initial: null): { current: T | null }; // React way (empty is `null`)\n// eslint-disable-next-line no-null/no-null\nexport function useRef(initial?: T | null) {\n return useMemo(() => ({\n current: initial,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), []);\n}\n\nexport function memo(Component: T, debugKey?: string) {\n return function TeactMemoWrapper(props: Props) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => createElement(Component, props), Object.values(props), debugKey);\n } as T;\n}\n\n// We need to keep it here for JSX.\nconst Teact = {\n createElement,\n Fragment,\n};\n\nexport default Teact;\n","import React, {\n FC, FC_withDebug, Props, useEffect, useState,\n} from './teact';\n\nimport { DEBUG, DEBUG_MORE } from '../../config';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport generateIdFor from '../../util/generateIdFor';\nimport { fastRaf, throttleWithTickEnd } from '../../util/schedulers';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { orderBy } from '../../util/iteratees';\nimport {\n GlobalState, GlobalActions, ActionTypes, DispatchOptions,\n} from '../../global/types';\nimport { handleError } from '../../util/handleError';\nimport { isHeavyAnimating } from '../../hooks/useHeavyAnimationCheck';\n\nexport default React;\n\ntype ActionPayload = AnyLiteral;\n\ntype Reducer = (\n global: GlobalState,\n actions: GlobalActions,\n payload: any,\n) => GlobalState | void;\n\ntype MapStateToProps = ((global: GlobalState, ownProps: OwnProps) => AnyLiteral);\n\nlet currentGlobal = {} as GlobalState;\n\nconst reducers: Record = {};\nconst callbacks: Function[] = [updateContainers];\nconst actions = {} as GlobalActions;\nconst containers = new Map;\n ownProps: Props;\n mappedProps?: Props;\n forceUpdate: Function;\n areMappedPropsChanged: boolean;\n DEBUG_updates: number;\n DEBUG_componentName: string;\n}>();\n\nconst runCallbacksThrottled = throttleWithTickEnd(runCallbacks);\n\nfunction runCallbacks(forceOnHeavyAnimation = false) {\n if (!forceOnHeavyAnimation && isHeavyAnimating()) {\n fastRaf(runCallbacksThrottled);\n return;\n }\n\n callbacks.forEach((cb) => cb(currentGlobal));\n}\n\nexport function setGlobal(newGlobal?: GlobalState, options?: DispatchOptions) {\n if (typeof newGlobal === 'object' && newGlobal !== currentGlobal) {\n currentGlobal = newGlobal;\n if (options?.forceSyncOnIOs) {\n runCallbacks(true);\n } else {\n runCallbacksThrottled(options?.forceOnHeavyAnimation);\n }\n }\n}\n\nexport function getGlobal() {\n return currentGlobal;\n}\n\nexport function getDispatch() {\n return actions;\n}\n\nfunction onDispatch(name: string, payload?: ActionPayload, options?: DispatchOptions) {\n if (reducers[name]) {\n reducers[name].forEach((reducer) => {\n const newGlobal = reducer(currentGlobal, actions, payload);\n if (newGlobal) {\n setGlobal(newGlobal, options);\n }\n });\n }\n}\n\nfunction updateContainers() {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const container of containers.values()) {\n const {\n mapStateToProps, ownProps, mappedProps, forceUpdate,\n } = container;\n\n let newMappedProps;\n\n try {\n newMappedProps = mapStateToProps(currentGlobal, ownProps);\n } catch (err: any) {\n handleError(err);\n\n return;\n }\n\n if (DEBUG) {\n if (Object.values(newMappedProps).some(Number.isNaN)) {\n // eslint-disable-next-line no-console\n console.warn(\n // eslint-disable-next-line max-len\n `[TeactN] Some of \\`${container.DEBUG_componentName}\\` mappers contain NaN values. This may cause redundant updates because of incorrect equality check.`,\n );\n }\n }\n\n if (Object.keys(newMappedProps).length && !arePropsShallowEqual(mappedProps!, newMappedProps)) {\n if (DEBUG_MORE) {\n // eslint-disable-next-line no-console\n console.log(\n '[TeactN] Will update',\n container.DEBUG_componentName,\n 'caused by',\n getUnequalProps(mappedProps!, newMappedProps).join(', '),\n );\n }\n\n container.mappedProps = newMappedProps;\n container.areMappedPropsChanged = true;\n container.DEBUG_updates++;\n\n forceUpdate();\n }\n }\n\n if (DEBUG) {\n const updateTime = performance.now() - DEBUG_startAt!;\n if (updateTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[TeactN] Slow containers update: ${Math.round(updateTime)} ms`);\n }\n }\n}\n\nexport function addReducer(name: ActionTypes, reducer: Reducer) {\n if (!reducers[name]) {\n reducers[name] = [];\n\n actions[name] = (payload?: ActionPayload, options?: DispatchOptions) => {\n onDispatch(name, payload, options);\n };\n }\n\n reducers[name].push(reducer);\n}\n\nexport function addCallback(cb: Function) {\n callbacks.push(cb);\n}\n\nexport function removeCallback(cb: Function) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n}\n\nexport function withGlobal(\n mapStateToProps: MapStateToProps = () => ({}),\n) {\n return (Component: FC) => {\n return function TeactNContainer(props: OwnProps) {\n (TeactNContainer as FC_withDebug).DEBUG_contentComponentName = Component.name;\n\n const [id] = useState(generateIdFor(containers));\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n return () => {\n containers.delete(id);\n };\n }, [id]);\n\n let container = containers.get(id);\n if (!container) {\n container = {\n mapStateToProps,\n ownProps: props,\n areMappedPropsChanged: false,\n forceUpdate,\n DEBUG_updates: 0,\n DEBUG_componentName: Component.name,\n };\n\n containers.set(id, container);\n }\n\n if (container.areMappedPropsChanged) {\n container.areMappedPropsChanged = false;\n }\n\n if (!container.mappedProps || !arePropsShallowEqual(container.ownProps, props)) {\n container.ownProps = props;\n\n try {\n container.mappedProps = mapStateToProps(currentGlobal, props);\n } catch (err: any) {\n handleError(err);\n }\n }\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ;\n };\n };\n}\n\nif (DEBUG) {\n (window as any).getGlobal = getGlobal;\n\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.warn(\n 'GLOBAL CONTAINERS',\n orderBy(\n Array.from(containers.values())\n .map(({ DEBUG_componentName, DEBUG_updates }) => ({ DEBUG_componentName, DEBUG_updates })),\n 'DEBUG_updates',\n 'desc',\n ),\n );\n });\n}\n","// Copyright Twitter Inc. Licensed under MIT\n// https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md\n// Version 2c193ce 28.05.2021\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nexport function removeVS16s(rawEmoji) {\n return rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji;\n}\n\n// This file is generated by source/emoji/scripts/generate.sh\n// eslint-disable-next-line max-len\nexport default /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91])|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd1d\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78\\udd7a-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcb\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7a\\ude80-\\ude86\\ude90-\\udea8\\udeb0-\\udeb6\\udec0-\\udec2\\uded0-\\uded6]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g;\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { initApi, callApi } from '../../../api/gramjs';\nimport { GlobalState } from '../../../global/types';\n\nimport {\n LANG_CACHE_NAME,\n CUSTOM_BG_CACHE_NAME,\n MEDIA_CACHE_NAME,\n MEDIA_CACHE_NAME_AVATARS,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n IS_TEST,\n} from '../../../config';\nimport { IS_MOV_SUPPORTED, IS_WEBM_SUPPORTED, PLATFORM_ENV } from '../../../util/environment';\nimport { unsubscribe } from '../../../util/notifications';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n storeSession,\n loadStoredSession,\n clearStoredSession,\n importLegacySession,\n clearLegacySessions,\n} from '../../../util/sessions';\nimport { forceWebsync } from '../../../util/websync';\n\naddReducer('initApi', (global: GlobalState, actions) => {\n (async () => {\n if (!IS_TEST) {\n await importLegacySession();\n void clearLegacySessions();\n }\n\n void initApi(actions.apiUpdate, {\n userAgent: navigator.userAgent,\n platform: PLATFORM_ENV,\n sessionData: loadStoredSession(),\n isTest: window.location.search.includes('test'),\n isMovSupported: IS_MOV_SUPPORTED,\n isWebmSupported: IS_WEBM_SUPPORTED,\n });\n })();\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n void callApi('provideAuthPhoneNumber', phoneNumber.replace(/[^\\d]/g, ''));\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthCode', (global, actions, payload) => {\n const { code } = payload!;\n\n void callApi('provideAuthCode', code);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthPassword', (global, actions, payload) => {\n const { password } = payload!;\n\n void callApi('provideAuthPassword', password);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('uploadProfilePhoto', (global, actions, payload) => {\n const { file } = payload!;\n\n void callApi('uploadProfilePhoto', file);\n});\n\naddReducer('signUp', (global, actions, payload) => {\n const { firstName, lastName } = payload!;\n\n void callApi('provideAuthRegistration', { firstName, lastName });\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('returnToAuthPhoneNumber', (global) => {\n void callApi('restartAuth');\n\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('goToAuthQrCode', (global) => {\n void callApi('restartAuthWithQr');\n\n return {\n ...global,\n authIsLoadingQrCode: true,\n authError: undefined,\n };\n});\n\naddReducer('saveSession', (global, actions, payload) => {\n const { sessionData } = payload;\n\n if (sessionData) {\n storeSession(payload.sessionData, global.currentUserId);\n } else {\n clearStoredSession();\n }\n});\n\naddReducer('signOut', () => {\n (async () => {\n try {\n await unsubscribe();\n await callApi('destroy');\n await forceWebsync(false);\n } catch (err) {\n // Do nothing\n }\n\n getDispatch().reset();\n })();\n});\n\naddReducer('reset', () => {\n clearStoredSession();\n\n void cacheApi.clear(MEDIA_CACHE_NAME);\n void cacheApi.clear(MEDIA_CACHE_NAME_AVATARS);\n void cacheApi.clear(MEDIA_PROGRESSIVE_CACHE_NAME);\n void cacheApi.clear(CUSTOM_BG_CACHE_NAME);\n\n const langCachePrefix = LANG_CACHE_NAME.replace(/\\d+$/, '');\n const langCacheVersion = (LANG_CACHE_NAME.match(/\\d+$/) || [0])[0];\n for (let i = 0; i < langCacheVersion; i++) {\n void cacheApi.clear(`${langCachePrefix}${i === 0 ? '' : i}`);\n }\n\n void clearLegacySessions();\n\n updateAppBadge(0);\n\n getDispatch().init();\n});\n\naddReducer('disconnect', () => {\n (async () => {\n await callApi('disconnect');\n })();\n});\n\naddReducer('loadNearestCountry', (global) => {\n if (global.connectionState !== 'connectionStateReady') {\n return;\n }\n\n (async () => {\n const authNearestCountry = await callApi('fetchNearestCountry');\n\n setGlobal({\n ...getGlobal(),\n authNearestCountry,\n });\n })();\n});\n\naddReducer('setDeviceToken', (global, actions, deviceToken) => {\n setGlobal({\n ...global,\n push: {\n deviceToken,\n subscribedAt: Date.now(),\n },\n });\n});\n\naddReducer('deleteDeviceToken', (global) => {\n const newGlobal = { ...global };\n delete newGlobal.push;\n setGlobal(newGlobal);\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport {\n ApiPrivacyKey, PrivacyVisibility, ProfileEditProgress, InputPrivacyRules, InputPrivacyContact,\n UPLOADING_WALLPAPER_SLUG,\n} from '../../../types';\n\nimport { COUNTRIES_WITH_12H_TIME_FORMAT } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { subscribe, unsubscribe } from '../../../util/notifications';\nimport { setTimeFormat } from '../../../util/langProvider';\nimport { selectUser } from '../../selectors';\nimport {\n addUsers, addBlockedContact, updateChats, updateUser, removeBlockedContact, replaceSettings, updateNotifySettings,\n addNotifyExceptions,\n} from '../../reducers';\nimport { isUserId } from '../../helpers';\n\naddReducer('updateProfile', (global, actions, payload) => {\n const {\n photo, firstName, lastName, bio: about, username,\n } = payload!;\n\n (async () => {\n const { currentUserId } = global;\n if (!currentUserId) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.InProgress,\n },\n });\n\n if (photo) {\n await callApi('updateProfilePhoto', photo);\n }\n\n if (firstName || lastName || about) {\n const result = await callApi('updateProfile', { firstName, lastName, about });\n if (result) {\n global = getGlobal();\n const currentUser = currentUserId && selectUser(global, currentUserId);\n\n if (currentUser) {\n setGlobal(updateUser(\n global,\n currentUser.id,\n {\n firstName,\n lastName,\n fullInfo: {\n ...currentUser.fullInfo,\n bio: about,\n },\n },\n ));\n }\n }\n }\n\n if (username) {\n const result = await callApi('updateUsername', username);\n if (result && currentUserId) {\n setGlobal(updateUser(getGlobal(), currentUserId, { username }));\n }\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.Complete,\n },\n });\n })();\n});\n\naddReducer('checkUsername', (global, actions, payload) => {\n const { username } = payload!;\n\n (async () => {\n // No need to check the username if profile update is already in progress\n if (global.profileEdit && global.profileEdit.progress === ProfileEditProgress.InProgress) {\n return;\n }\n\n setGlobal({\n ...global,\n profileEdit: {\n progress: global.profileEdit ? global.profileEdit.progress : ProfileEditProgress.Idle,\n isUsernameAvailable: undefined,\n },\n });\n\n const isUsernameAvailable = await callApi('checkUsername', username);\n\n global = getGlobal();\n setGlobal({\n ...global,\n profileEdit: {\n ...global.profileEdit!,\n isUsernameAvailable,\n },\n });\n })();\n});\n\naddReducer('loadWallpapers', () => {\n (async () => {\n const result = await callApi('fetchWallpapers');\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: result.wallpapers,\n },\n });\n })();\n});\n\naddReducer('uploadWallpaper', (global, actions, payload) => {\n const file = payload;\n const previewBlobUrl = URL.createObjectURL(file);\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n {\n slug: UPLOADING_WALLPAPER_SLUG,\n document: {\n fileName: '',\n size: file.size,\n mimeType: file.type,\n previewBlobUrl,\n },\n },\n ...(global.settings.loadedWallpapers || []),\n ],\n },\n });\n\n (async () => {\n const result = await callApi('uploadWallpaper', file);\n if (!result) {\n return;\n }\n\n const { wallpaper } = result;\n\n global = getGlobal();\n if (!global.settings.loadedWallpapers) {\n return;\n }\n\n const firstWallpaper = global.settings.loadedWallpapers[0];\n if (!firstWallpaper || firstWallpaper.slug !== UPLOADING_WALLPAPER_SLUG) {\n return;\n }\n\n const withLocalMedia = {\n ...wallpaper,\n document: {\n ...wallpaper.document,\n previewBlobUrl,\n },\n };\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n withLocalMedia,\n ...global.settings.loadedWallpapers.slice(1),\n ],\n },\n });\n })();\n});\n\naddReducer('loadBlockedContacts', () => {\n (async () => {\n const result = await callApi('fetchBlockedContacts');\n\n if (!result) {\n return;\n }\n\n let newGlobal = getGlobal();\n\n if (result.users?.length) {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n }\n if (result.chats?.length) {\n newGlobal = updateChats(newGlobal, buildCollectionByKey(result.chats, 'id'));\n }\n\n newGlobal = {\n ...newGlobal,\n blocked: {\n ...newGlobal.blocked,\n ids: [...(newGlobal.blocked.ids || []), ...result.blockedIds],\n totalCount: result.totalCount,\n },\n };\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('blockContact', (global, actions, payload) => {\n const { contactId, accessHash } = payload!;\n\n (async () => {\n const result = await callApi('blockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(addBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('unblockContact', (global, actions, payload) => {\n const { contactId } = payload!;\n let accessHash: string | undefined;\n const isPrivate = isUserId(contactId);\n\n if (isPrivate) {\n const user = selectUser(global, contactId);\n if (!user) {\n return;\n }\n\n accessHash = user.accessHash;\n }\n\n (async () => {\n const result = await callApi('unblockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(removeBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('loadAuthorizations', () => {\n (async () => {\n const result = await callApi('fetchAuthorizations');\n if (!result) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n activeSessions: result,\n });\n })();\n});\n\naddReducer('terminateAuthorization', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('terminateAuthorization', hash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n activeSessions: newGlobal.activeSessions.filter((session) => session.hash !== hash),\n });\n })();\n});\n\naddReducer('terminateAllAuthorizations', () => {\n (async () => {\n const result = await callApi('terminateAllAuthorizations');\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n activeSessions: global.activeSessions.filter((session) => session.isCurrent),\n });\n })();\n});\n\naddReducer('loadNotificationExceptions', (global) => {\n const { serverTimeOffset } = global;\n\n (async () => {\n const result = await callApi('fetchNotificationExceptions', { serverTimeOffset });\n if (!result) {\n return;\n }\n\n setGlobal(addNotifyExceptions(getGlobal(), result));\n })();\n});\n\naddReducer('loadNotificationSettings', (global) => {\n const { serverTimeOffset } = global;\n (async () => {\n const result = await callApi('fetchNotificationSettings', {\n serverTimeOffset,\n });\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateNotificationSettings', (global, actions, payload) => {\n const { peerType, isSilent, shouldShowPreviews } = payload!;\n\n (async () => {\n const result = await callApi('updateNotificationSettings', peerType, { isSilent, shouldShowPreviews });\n\n if (!result) {\n return;\n }\n\n setGlobal(updateNotifySettings(getGlobal(), peerType, isSilent, shouldShowPreviews));\n })();\n});\n\naddReducer('updateWebNotificationSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), payload));\n const newGlobal = getGlobal();\n const { hasPushNotifications, hasWebNotifications } = newGlobal.settings.byKey;\n if (hasWebNotifications && hasPushNotifications) {\n await subscribe();\n } else {\n await unsubscribe();\n }\n })();\n});\n\naddReducer('updateContactSignUpNotification', (global, actions, payload) => {\n const { isSilent } = payload!;\n\n (async () => {\n const result = await callApi('updateContactSignUpNotification', isSilent);\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { hasContactJoinedNotifications: !isSilent }));\n })();\n});\n\naddReducer('loadLanguages', () => {\n (async () => {\n const result = await callApi('fetchLanguages');\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { languages: result }));\n })();\n});\n\naddReducer('loadPrivacySettings', () => {\n (async () => {\n const [\n phoneNumberSettings, lastSeenSettings, profilePhotoSettings, forwardsSettings, chatInviteSettings,\n ] = await Promise.all([\n callApi('fetchPrivacySettings', 'phoneNumber'),\n callApi('fetchPrivacySettings', 'lastSeen'),\n callApi('fetchPrivacySettings', 'profilePhoto'),\n callApi('fetchPrivacySettings', 'forwards'),\n callApi('fetchPrivacySettings', 'chatInvite'),\n ]);\n\n if (\n !phoneNumberSettings || !lastSeenSettings || !profilePhotoSettings || !forwardsSettings || !chatInviteSettings\n ) {\n return;\n }\n\n const global = getGlobal();\n\n global.settings.privacy.phoneNumber = phoneNumberSettings;\n global.settings.privacy.lastSeen = lastSeenSettings;\n global.settings.privacy.profilePhoto = profilePhotoSettings;\n global.settings.privacy.forwards = forwardsSettings;\n global.settings.privacy.chatInvite = chatInviteSettings;\n\n setGlobal(global);\n })();\n});\n\naddReducer('setPrivacyVisibility', (global, actions, payload) => {\n const { privacyKey, visibility } = payload!;\n\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility,\n allowedIds: [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\naddReducer('setPrivacySettings', (global, actions, payload) => {\n const { privacyKey, isAllowList, contactsIds } = payload!;\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility: settings.visibility,\n allowedIds: isAllowList ? contactsIds : [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: !isAllowList ? contactsIds : [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\nfunction buildInputPrivacyRules(global: GlobalState, {\n visibility,\n allowedIds,\n deniedIds,\n}: {\n visibility: PrivacyVisibility;\n allowedIds: string[];\n deniedIds: string[];\n}): InputPrivacyRules {\n const {\n users: { byId: usersById },\n chats: { byId: chatsById },\n } = global;\n\n const rules: InputPrivacyRules = {\n visibility,\n };\n let users: InputPrivacyContact[];\n let chats: InputPrivacyContact[];\n\n const collectUsers = (userId: string) => {\n if (!isUserId(userId)) {\n return undefined;\n }\n const { id, accessHash } = usersById[userId] || {};\n if (!id) {\n return undefined;\n }\n\n return { id, accessHash };\n };\n\n const collectChats = (userId: string) => {\n if (isUserId(userId)) {\n return undefined;\n }\n const chat = chatsById[userId];\n\n return chat ? { id: chat.id } : undefined;\n };\n\n if (visibility === 'contacts' || visibility === 'nobody') {\n users = allowedIds.map(collectUsers).filter(Boolean) as InputPrivacyContact[];\n chats = allowedIds.map(collectChats).filter(Boolean) as InputPrivacyContact[];\n\n if (users.length > 0) {\n rules.allowedUsers = users;\n }\n if (chats.length > 0) {\n rules.allowedChats = chats;\n }\n }\n\n if (visibility === 'everybody' || visibility === 'contacts') {\n users = deniedIds.map(collectUsers).filter(Boolean) as InputPrivacyContact[];\n chats = deniedIds.map(collectChats).filter(Boolean) as InputPrivacyContact[];\n\n if (users.length > 0) {\n rules.blockedUsers = users;\n }\n if (chats.length > 0) {\n rules.blockedChats = chats;\n }\n }\n\n return rules;\n}\n\naddReducer('updateIsOnline', (global, actions, payload) => {\n callApi('updateIsOnline', payload);\n});\n\naddReducer('loadContentSettings', () => {\n (async () => {\n const result = await callApi('fetchContentSettings');\n if (!result) return;\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateContentSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: payload }));\n\n const result = await callApi('updateContentSettings', payload);\n if (!result) {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: !payload }));\n }\n })();\n});\n\naddReducer('loadCountryList', (global, actions, payload = {}) => {\n let { langCode } = payload;\n if (!langCode) langCode = global.settings.byKey.language;\n\n (async () => {\n const countryList = await callApi('fetchCountryList', { langCode });\n if (!countryList) return;\n\n setGlobal({\n ...getGlobal(),\n countryList,\n });\n })();\n});\n\naddReducer('ensureTimeFormat', (global, actions) => {\n if (global.authNearestCountry) {\n const timeFormat = COUNTRIES_WITH_12H_TIME_FORMAT.has(global.authNearestCountry.toUpperCase()) ? '12h' : '24h';\n actions.setSettingOption({ timeFormat });\n setTimeFormat(timeFormat);\n }\n\n (async () => {\n if (getGlobal().settings.byKey.wasTimeFormatSetManually) {\n return;\n }\n\n const nearestCountryCode = await callApi('fetchNearestCountry');\n if (nearestCountryCode) {\n const timeFormat = COUNTRIES_WITH_12H_TIME_FORMAT.has(nearestCountryCode.toUpperCase()) ? '12h' : '24h';\n actions.setSettingOption({ timeFormat });\n setTimeFormat(timeFormat);\n }\n })();\n});\n\naddReducer('loadAppConfig', () => {\n (async () => {\n const appConfig = await callApi('fetchAppConfig');\n\n if (!appConfig) return;\n\n setGlobal({\n ...getGlobal(),\n appConfig,\n });\n })();\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport {\n ApiUpdate,\n ApiUpdateAuthorizationState,\n ApiUpdateAuthorizationError,\n ApiUpdateConnectionState,\n ApiUpdateSession,\n ApiUpdateCurrentUser, ApiUpdateServerTimeOffset,\n} from '../../../api/types';\nimport { DEBUG, SESSION_USER_KEY } from '../../../config';\nimport { subscribe } from '../../../util/notifications';\nimport { updateUser } from '../../reducers';\nimport { setLanguage } from '../../../util/langProvider';\nimport { selectNotifySettings } from '../../selectors';\nimport { forceWebsync } from '../../../util/websync';\nimport { getShippingError } from '../../../util/getReadableErrorText';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n if (DEBUG) {\n if (update['@type'] !== 'updateUserStatus' && update['@type'] !== 'updateServerTimeOffset') {\n // eslint-disable-next-line no-console\n console.log('[GramJs] UPDATE', update['@type'], { update });\n }\n }\n\n switch (update['@type']) {\n case 'updateApiReady':\n onUpdateApiReady(global);\n break;\n\n case 'updateAuthorizationState':\n onUpdateAuthorizationState(update);\n break;\n\n case 'updateAuthorizationError':\n onUpdateAuthorizationError(update);\n break;\n\n case 'updateConnectionState':\n onUpdateConnectionState(update);\n break;\n\n case 'updateSession':\n onUpdateSession(update);\n break;\n\n case 'updateServerTimeOffset':\n onUpdateServerTimeOffset(update);\n break;\n\n case 'updateCurrentUser':\n onUpdateCurrentUser(update);\n break;\n\n case 'error': {\n if (update.error.message === 'SESSION_REVOKED') {\n actions.signOut();\n }\n\n const paymentShippingError = getShippingError(update.error);\n if (paymentShippingError) {\n actions.addPaymentError({ error: paymentShippingError });\n } else if (actions.showDialog) {\n actions.showDialog({ data: update.error });\n }\n\n break;\n }\n }\n});\n\nfunction onUpdateApiReady(global: GlobalState) {\n const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);\n if (hasWebNotifications && hasPushNotifications) {\n void subscribe();\n }\n void setLanguage(global.settings.byKey.language);\n}\n\nfunction onUpdateAuthorizationState(update: ApiUpdateAuthorizationState) {\n let global = getGlobal();\n\n const wasAuthReady = global.authState === 'authorizationStateReady';\n const authState = update.authorizationState;\n\n setGlobal({\n ...global,\n authState,\n authIsLoading: false,\n });\n\n global = getGlobal();\n\n switch (authState) {\n case 'authorizationStateLoggingOut':\n void forceWebsync(false);\n\n setGlobal({\n ...global,\n isLoggingOut: true,\n });\n break;\n case 'authorizationStateWaitCode':\n setGlobal({\n ...global,\n authIsCodeViaApp: update.isCodeViaApp,\n });\n break;\n case 'authorizationStateWaitPassword':\n setGlobal({\n ...global,\n authHint: update.hint,\n });\n break;\n case 'authorizationStateWaitQrCode':\n setGlobal({\n ...global,\n authIsLoadingQrCode: false,\n authQrCode: update.qrCode,\n });\n break;\n case 'authorizationStateReady': {\n if (wasAuthReady) {\n break;\n }\n\n void forceWebsync(true);\n\n setGlobal({\n ...global,\n isLoggingOut: false,\n });\n\n break;\n }\n }\n}\n\nfunction onUpdateAuthorizationError(update: ApiUpdateAuthorizationError) {\n setGlobal({\n ...getGlobal(),\n authError: update.message,\n });\n}\n\nfunction onUpdateConnectionState(update: ApiUpdateConnectionState) {\n const { connectionState } = update;\n const global = getGlobal();\n\n if (connectionState === global.connectionState) {\n return;\n }\n\n setGlobal({\n ...global,\n connectionState,\n });\n\n if (connectionState === 'connectionStateBroken') {\n getDispatch().signOut();\n }\n}\n\nfunction onUpdateSession(update: ApiUpdateSession) {\n const { sessionData } = update;\n const { authRememberMe, authState } = getGlobal();\n const isEmpty = !sessionData || !sessionData.mainDcId;\n\n if (!authRememberMe || authState !== 'authorizationStateReady' || isEmpty) {\n return;\n }\n\n getDispatch().saveSession({ sessionData });\n}\n\nfunction onUpdateServerTimeOffset(update: ApiUpdateServerTimeOffset) {\n const global = getGlobal();\n\n if (global.serverTimeOffset === update.serverTimeOffset) {\n return;\n }\n\n setGlobal({\n ...global,\n serverTimeOffset: update.serverTimeOffset,\n });\n}\n\nfunction onUpdateCurrentUser(update: ApiUpdateCurrentUser) {\n const { currentUser } = update;\n\n setGlobal({\n ...updateUser(getGlobal(), currentUser.id, currentUser),\n currentUserId: currentUser.id,\n });\n\n updateSessionUserId(currentUser.id);\n}\n\nfunction updateSessionUserId(currentUserId: string) {\n const sessionUserAuth = localStorage.getItem(SESSION_USER_KEY);\n if (!sessionUserAuth) return;\n\n const userAuth = JSON.parse(sessionUserAuth);\n userAuth.id = currentUserId;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify(userAuth));\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MAX } from '../../../config';\nimport {\n IS_ANDROID, IS_IOS, IS_MAC_OS, IS_SAFARI, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport { setLanguage } from '../../../util/langProvider';\nimport switchTheme from '../../../util/switchTheme';\nimport { selectTheme } from '../../selectors';\nimport { startWebsync } from '../../../util/websync';\nimport { ensurePermanentWebVersion } from '../../../util/permanentWebVersion';\n\nconst HISTORY_ANIMATION_DURATION = 450;\n\nsubscribeToSystemThemeChange();\n\naddReducer('init', (global) => {\n const { animationLevel, messageTextSize, language } = global.settings.byKey;\n const theme = selectTheme(global);\n\n void setLanguage(language, undefined, true);\n\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(messageTextSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(messageTextSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${messageTextSize}px`);\n document.documentElement.setAttribute('data-message-text-size', messageTextSize.toString());\n document.body.classList.add('initial');\n document.body.classList.add(`animation-level-${animationLevel}`);\n document.body.classList.add(IS_TOUCH_ENV ? 'is-touch-env' : 'is-pointer-env');\n\n switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX);\n\n ensurePermanentWebVersion();\n startWebsync();\n\n if (IS_IOS) {\n document.body.classList.add('is-ios');\n } else if (IS_ANDROID) {\n document.body.classList.add('is-android');\n } else if (IS_MAC_OS) {\n document.body.classList.add('is-macos');\n }\n if (IS_SAFARI) {\n document.body.classList.add('is-safari');\n }\n});\n\naddReducer('setIsUiReady', (global, actions, payload) => {\n const { uiReadyState } = payload!;\n\n if (uiReadyState === 2) {\n document.body.classList.remove('initial');\n }\n\n return {\n ...global,\n uiReadyState,\n };\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n return {\n ...global,\n authPhoneNumber: phoneNumber,\n };\n});\n\naddReducer('setAuthRememberMe', (global, actions, payload) => {\n return {\n ...global,\n authRememberMe: Boolean(payload),\n };\n});\n\naddReducer('clearAuthError', (global) => {\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('disableHistoryAnimations', () => {\n setTimeout(() => {\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: false,\n });\n document.body.classList.remove('no-animate');\n }, HISTORY_ANIMATION_DURATION);\n\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: true,\n }, { forceSyncOnIOs: true });\n});\n\nfunction subscribeToSystemThemeChange() {\n function handleSystemThemeChange() {\n const currentThemeMatch = document.documentElement.className.match(/theme-(\\w+)/);\n const currentTheme = currentThemeMatch ? currentThemeMatch[1] : 'light';\n const global = getGlobal();\n const nextTheme = selectTheme(global);\n const { animationLevel } = global.settings.byKey;\n\n if (nextTheme !== currentTheme) {\n switchTheme(nextTheme, animationLevel === ANIMATION_LEVEL_MAX);\n // Force-update component containers\n setGlobal({ ...global });\n }\n }\n\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n }\n}\n","import { addReducer } from '../../../lib/teact/teactn';\nimport { ISettings, IThemeSettings, ThemeKey } from '../../../types';\nimport { replaceSettings, replaceThemeSettings } from '../../reducers';\n\naddReducer('setSettingOption', (global, actions, payload?: Partial) => {\n return replaceSettings(global, payload);\n});\n\naddReducer('setThemeSettings', (global, actions, payload: { theme: ThemeKey } & Partial) => {\n const { theme, ...settings } = payload;\n\n return replaceThemeSettings(global, theme, settings);\n});\n","import {\n ApiChat,\n ApiUser,\n ApiChatBannedRights,\n ApiChatAdminRights,\n ApiChatFolder,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { NotifyException, NotifySettings } from '../../types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { ARCHIVED_FOLDER_ID, REPLIES_USER_ID } from '../../config';\nimport { orderBy } from '../../util/iteratees';\nimport { getUserFirstOrLastName } from './users';\nimport { formatDateToString, formatTime } from '../../util/dateFormat';\nimport { prepareSearchWordsForNeedle } from '../../util/searchWords';\n\nconst FOREVER_BANNED_DATE = Date.now() / 1000 + 31622400; // 366 days\n\nconst VERIFIED_PRIORITY_BASE = 3e9;\nconst PINNED_PRIORITY_BASE = 3e8;\n\nexport function isUserId(entityId: string) {\n // Workaround for old-fashioned IDs stored locally\n if (typeof entityId === 'number') {\n return entityId > 0;\n }\n\n return !entityId.startsWith('-');\n}\n\nexport function isChatGroup(chat: ApiChat) {\n return isChatBasicGroup(chat) || isChatSuperGroup(chat);\n}\n\nexport function isChatBasicGroup(chat: ApiChat) {\n return chat.type === 'chatTypeBasicGroup';\n}\n\nexport function isChatSuperGroup(chat: ApiChat) {\n return chat.type === 'chatTypeSuperGroup';\n}\n\nexport function isChatChannel(chat: ApiChat) {\n return chat.type === 'chatTypeChannel';\n}\n\nexport function isCommonBoxChat(chat: ApiChat) {\n return chat.type === 'chatTypePrivate' || chat.type === 'chatTypeBasicGroup';\n}\n\nexport function isChatWithRepliesBot(chatId: string) {\n return chatId === REPLIES_USER_ID;\n}\n\nexport function getChatTypeString(chat: ApiChat) {\n switch (chat.type) {\n case 'chatTypePrivate':\n return 'PrivateChat';\n case 'chatTypeBasicGroup':\n case 'chatTypeSuperGroup':\n return 'AccDescrGroup';\n case 'chatTypeChannel':\n return 'AccDescrChannel';\n default:\n return 'Chat';\n }\n}\n\nexport function getPrivateChatUserId(chat: ApiChat) {\n if (chat.type !== 'chatTypePrivate' && chat.type !== 'chatTypeSecret') {\n return undefined;\n }\n return chat.id;\n}\n\n// TODO Get rid of `user`\nexport function getChatTitle(lang: LangFn, chat: ApiChat, user?: ApiUser, isSelf = false) {\n if (isSelf || (user && chat.id === user.id && user.isSelf)) {\n return lang('SavedMessages');\n }\n return chat.title || lang('HiddenName');\n}\n\nexport function getChatDescription(chat: ApiChat) {\n if (!chat.fullInfo) {\n return undefined;\n }\n return chat.fullInfo.about;\n}\n\nexport function getChatLink(chat: ApiChat) {\n const { username } = chat;\n if (username) {\n return `https://t.me/${username}`;\n }\n\n const { inviteLink } = chat.fullInfo || {};\n\n return inviteLink;\n}\n\nexport function getChatAvatarHash(\n owner: ApiChat | ApiUser,\n size: 'normal' | 'big' = 'normal',\n) {\n if (!owner.avatarHash) {\n return undefined;\n }\n\n switch (size) {\n case 'big':\n return `profile${owner.id}?${owner.avatarHash}`;\n default:\n return `avatar${owner.id}?${owner.avatarHash}`;\n }\n}\n\nexport function isChatSummaryOnly(chat: ApiChat) {\n return !chat.lastMessage;\n}\n\nexport function isChatAdmin(chat: ApiChat) {\n return Boolean(chat.adminRights);\n}\n\nexport function getHasAdminRight(chat: ApiChat, key: keyof ApiChatAdminRights) {\n return chat.adminRights ? chat.adminRights[key] : false;\n}\n\nexport function isUserRightBanned(chat: ApiChat, key: keyof ApiChatBannedRights) {\n return Boolean(\n (chat.currentUserBannedRights?.[key])\n || (chat.defaultBannedRights?.[key]),\n );\n}\n\nexport function getCanPostInChat(chat: ApiChat, threadId: number) {\n if (threadId !== MAIN_THREAD_ID) {\n return true;\n }\n\n if (chat.isRestricted || chat.migratedTo || chat.isNotJoined || isChatWithRepliesBot(chat.id)) {\n return false;\n }\n\n if (chat.isCreator) {\n return true;\n }\n\n if (isUserId(chat.id)) {\n return true;\n }\n\n if (isChatChannel(chat)) {\n return getHasAdminRight(chat, 'postMessages');\n }\n\n return isChatAdmin(chat) || !isUserRightBanned(chat, 'sendMessages');\n}\n\nexport interface IAllowedAttachmentOptions {\n canAttachMedia: boolean;\n canAttachPolls: boolean;\n canSendStickers: boolean;\n canSendGifs: boolean;\n canAttachEmbedLinks: boolean;\n}\n\nexport function getAllowedAttachmentOptions(chat?: ApiChat, isChatWithBot = false): IAllowedAttachmentOptions {\n if (!chat) {\n return {\n canAttachMedia: false,\n canAttachPolls: false,\n canSendStickers: false,\n canSendGifs: false,\n canAttachEmbedLinks: false,\n };\n }\n\n const isAdmin = isChatAdmin(chat);\n\n return {\n canAttachMedia: isAdmin || !isUserRightBanned(chat, 'sendMedia'),\n canAttachPolls: (isAdmin || !isUserRightBanned(chat, 'sendPolls')) && (!isUserId(chat.id) || isChatWithBot),\n canSendStickers: isAdmin || !isUserRightBanned(chat, 'sendStickers'),\n canSendGifs: isAdmin || !isUserRightBanned(chat, 'sendGifs'),\n canAttachEmbedLinks: isAdmin || !isUserRightBanned(chat, 'embedLinks'),\n };\n}\n\nexport function getMessageSendingRestrictionReason(\n lang: LangFn,\n currentUserBannedRights?: ApiChatBannedRights,\n defaultBannedRights?: ApiChatBannedRights,\n) {\n if (currentUserBannedRights?.sendMessages) {\n const { untilDate } = currentUserBannedRights;\n return untilDate && untilDate < FOREVER_BANNED_DATE\n ? lang(\n 'Channel.Persmission.Denied.SendMessages.Until',\n lang(\n 'formatDateAtTime',\n [formatDateToString(new Date(untilDate * 1000), lang.code), formatTime(lang, untilDate * 1000)],\n ),\n )\n : lang('Channel.Persmission.Denied.SendMessages.Forever');\n }\n\n if (defaultBannedRights?.sendMessages) {\n return lang('Channel.Persmission.Denied.SendMessages.DefaultRestrictedText');\n }\n\n return undefined;\n}\n\nexport function getChatSlowModeOptions(chat?: ApiChat) {\n if (!chat || !chat.fullInfo) {\n return undefined;\n }\n\n return chat.fullInfo.slowMode;\n}\n\nexport function getChatOrder(chat: ApiChat) {\n return Math.max(chat.joinDate || 0, chat.draftDate || 0, chat.lastMessage?.date || 0);\n}\n\nexport function isChatArchived(chat: ApiChat) {\n return chat.folderId === ARCHIVED_FOLDER_ID;\n}\n\nexport function selectIsChatMuted(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = {},\n) {\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].isMuted !== undefined) {\n return notifyExceptions[chat.id].isMuted;\n }\n\n return (\n chat.isMuted\n || (isUserId(chat.id) && !notifySettings.hasPrivateChatsNotifications)\n || (isChatChannel(chat) && !notifySettings.hasBroadcastNotifications)\n || (isChatGroup(chat) && !notifySettings.hasGroupNotifications)\n );\n}\n\nexport function selectShouldShowMessagePreview(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = {},\n) {\n const {\n hasPrivateChatsMessagePreview = true,\n hasBroadcastMessagePreview = true,\n hasGroupMessagePreview = true,\n } = notifySettings;\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].shouldShowPreviews !== undefined) {\n return notifyExceptions[chat.id].shouldShowPreviews;\n }\n\n return (isUserId(chat.id) && hasPrivateChatsMessagePreview)\n || (isChatChannel(chat) && hasBroadcastMessagePreview)\n || (isChatGroup(chat) && hasGroupMessagePreview);\n}\n\nexport function getCanDeleteChat(chat: ApiChat) {\n return isChatBasicGroup(chat) || ((isChatSuperGroup(chat) || isChatChannel(chat)) && chat.isCreator);\n}\n\nexport function getFolderDescriptionText(lang: LangFn, folder: ApiChatFolder, chatsCount?: number) {\n const {\n id, title, emoticon, description, pinnedChatIds,\n excludedChatIds, includedChatIds,\n excludeArchived, excludeMuted, excludeRead,\n ...filters\n } = folder;\n\n // If folder has multiple additive filters or uses include/exclude lists,\n // we display folder chats count\n if (\n chatsCount !== undefined && (\n Object.values(filters).filter(Boolean).length > 1\n || (excludedChatIds?.length)\n || (includedChatIds?.length)\n )) {\n return lang('Chats', chatsCount);\n }\n\n // Otherwise, we return a short description of a single filter\n if (filters.bots) {\n return lang('FilterBots');\n } else if (filters.groups) {\n return lang('FilterGroups');\n } else if (filters.channels) {\n return lang('FilterChannels');\n } else if (filters.contacts) {\n return lang('FilterContacts');\n } else if (filters.nonContacts) {\n return lang('FilterNonContacts');\n } else {\n return undefined;\n }\n}\n\nexport function getMessageSenderName(lang: LangFn, chatId: string, sender?: ApiUser) {\n if (!sender || isUserId(chatId)) {\n return undefined;\n }\n\n if (sender.isSelf) {\n return lang('FromYou');\n }\n\n return getUserFirstOrLastName(sender);\n}\n\nexport function sortChatIds(\n chatIds: string[],\n chatsById: Record,\n shouldPrioritizeVerified = false,\n priorityIds?: string[],\n) {\n return orderBy(chatIds, (id) => {\n const chat = chatsById[id];\n if (!chat) {\n return 0;\n }\n\n let priority = 0;\n\n if (chat.lastMessage) {\n priority += chat.lastMessage.date;\n }\n\n if (shouldPrioritizeVerified && chat.isVerified) {\n priority += VERIFIED_PRIORITY_BASE; // ~100 years in seconds\n }\n\n if (priorityIds && priorityIds.includes(id)) {\n priority = Date.now() + PINNED_PRIORITY_BASE + (priorityIds.length - priorityIds.indexOf(id));\n }\n\n return priority;\n }, 'desc');\n}\n\nexport function filterChatsByName(\n lang: LangFn,\n chatIds: string[],\n chatsById: Record,\n query?: string,\n currentUserId?: string,\n) {\n if (!query) {\n return chatIds;\n }\n\n const searchWords = prepareSearchWordsForNeedle(query);\n\n return chatIds.filter((id) => {\n const chat = chatsById[id];\n if (!chat) {\n return false;\n }\n\n return searchWords(getChatTitle(lang, chat, undefined, id === currentUserId));\n });\n}\n","import {\n ApiChat, ApiMessage, ApiMessageEntityTypes, ApiReactions, ApiUser,\n} from '../../api/types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport {\n CONTENT_NOT_SUPPORTED,\n LOCAL_MESSAGE_ID_BASE,\n RE_LINK_TEMPLATE,\n SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../config';\nimport { getUserFullName } from './users';\nimport { IS_OPUS_SUPPORTED, isWebpSupported } from '../../util/environment';\nimport { getChatTitle, isUserId } from './chats';\nimport parseEmojiOnlyString from '../../components/common/helpers/parseEmojiOnlyString';\n\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\n\nexport type MessageKey = `msg${string}-${number}`;\n\nexport function getMessageKey(message: ApiMessage): MessageKey {\n const { chatId, id } = message;\n\n return buildMessageKey(chatId, id);\n}\n\nexport function buildMessageKey(chatId: string, msgId: number): MessageKey {\n return `msg${chatId}-${msgId}`;\n}\n\nexport function parseMessageKey(key: MessageKey) {\n const match = key.match(/^msg(-?\\d+)-(\\d+)/)!;\n\n return { chatId: match[1], messageId: Number(match[2]) };\n}\n\nexport function getMessageOriginalId(message: ApiMessage) {\n return message.previousLocalId || message.id;\n}\n\nexport function getMessageText(message: ApiMessage) {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact, invoice,\n } = message.content;\n\n if (text) {\n return text.text;\n }\n\n if (sticker || photo || video || audio || voice || document || contact || poll || webPage || invoice) {\n return undefined;\n }\n\n return CONTENT_NOT_SUPPORTED;\n}\n\nexport function getMessageCustomShape(message: ApiMessage): boolean | number {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact,\n } = message.content;\n\n if (sticker || (video?.isRound)) {\n return true;\n }\n\n if (!text || photo || video || audio || voice || document || poll || webPage || contact) {\n return false;\n }\n\n // This is a \"dual-intent\" method used to limit calls of `parseEmojiOnlyString`.\n return parseEmojiOnlyString(text.text) || false;\n}\n\nexport function getMessageSingleEmoji(message: ApiMessage) {\n const { text } = message.content;\n if (!(text && text.text.length <= 6)) {\n return undefined;\n }\n\n if (getMessageCustomShape(message) !== 1) {\n return undefined;\n }\n\n return text.text;\n}\n\nexport function getFirstLinkInMessage(message: ApiMessage) {\n const { text } = message.content;\n\n let match: RegExpMatchArray | null | undefined;\n if (text?.entities) {\n let link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.TextUrl);\n if (link) {\n match = link.url!.match(RE_LINK);\n }\n\n if (!match) {\n link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.Url);\n if (link) {\n const { offset, length } = link;\n match = text.text.substring(offset, offset + length).match(RE_LINK);\n }\n }\n }\n\n if (!match && text) {\n match = text.text.match(RE_LINK);\n }\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function matchLinkInMessageText(message: ApiMessage) {\n const { text } = message.content;\n const match = text && text.text.match(RE_LINK);\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function isOwnMessage(message: ApiMessage) {\n return message.isOutgoing;\n}\n\nexport function isReplyMessage(message: ApiMessage) {\n return Boolean(message.replyToMessageId);\n}\n\nexport function isForwardedMessage(message: ApiMessage) {\n return Boolean(message.forwardInfo);\n}\n\nexport function isActionMessage(message: ApiMessage) {\n return Boolean(message.content.action);\n}\n\nexport function isServiceNotificationMessage(message: ApiMessage) {\n return message.chatId === SERVICE_NOTIFICATIONS_USER_ID && Math.round(message.id) !== message.id;\n}\n\nexport function isAnonymousOwnMessage(message: ApiMessage) {\n return Boolean(message.senderId) && !isUserId(message.senderId!) && isOwnMessage(message);\n}\n\nexport function getSenderTitle(lang: LangFn, sender: ApiUser | ApiChat) {\n return isUserId(sender.id) ? getUserFullName(sender as ApiUser) : getChatTitle(lang, sender as ApiChat);\n}\n\nexport function getSendingState(message: ApiMessage) {\n if (!message.sendingState) {\n return 'succeeded';\n }\n\n return message.sendingState === 'messageSendingStateFailed' ? 'failed' : 'pending';\n}\n\nexport function isMessageLocal(message: ApiMessage) {\n return message.id >= LOCAL_MESSAGE_ID_BASE;\n}\n\nexport function isHistoryClearMessage(message: ApiMessage) {\n return message.content.action && message.content.action.type === 'historyClear';\n}\n\nexport function getMessageContentFilename(message: ApiMessage) {\n const { content } = message;\n\n const video = content.webPage ? content.webPage.video : content.video;\n const photo = content.webPage ? content.webPage.photo : content.photo;\n const document = content.webPage ? content.webPage.document : content.document;\n if (document) {\n return document.fileName;\n }\n\n if (video) {\n return video.fileName;\n }\n\n if (content.sticker) {\n const extension = content.sticker.isLottie ? 'tgs' : content.sticker.isGif\n ? 'webm' : isWebpSupported() ? 'webp' : 'png';\n return `${content.sticker.id}.${extension}`;\n }\n\n if (content.audio) {\n return content.audio.fileName;\n }\n\n const baseFilename = getMessageKey(message);\n\n if (photo) {\n return `${baseFilename}.jpg`;\n }\n\n if (content.voice) {\n return IS_OPUS_SUPPORTED ? `${baseFilename}.ogg` : `${baseFilename}.wav`;\n }\n\n return baseFilename;\n}\n\nexport function areReactionsEmpty(reactions: ApiReactions) {\n return !reactions.results.some((l) => l.count > 0);\n}\n","import { ApiMessage, ApiMessageEntityTypes } from '../../api/types';\nimport type { TextPart } from '../../components/common/helpers/renderTextWithEntities';\nimport { CONTENT_NOT_SUPPORTED } from '../../config';\n\nimport { LangFn } from '../../hooks/useLang';\nimport trimText from '../../util/trimText';\nimport { getMessageText } from './messages';\nimport { getMessageRecentReaction } from './reactions';\n\nconst SPOILER_CHARS = ['⠺', '⠵', '⠞', '⠟'];\nexport const TRUNCATED_SUMMARY_LENGTH = 80;\n\nexport function getMessageSummaryText(\n lang: LangFn,\n message: ApiMessage,\n noEmoji = false,\n truncateLength = TRUNCATED_SUMMARY_LENGTH,\n noReactions = true,\n isExtended = false,\n) {\n const emoji = !noEmoji && getMessageSummaryEmoji(message, noReactions);\n const emojiWithSpace = emoji ? `${emoji} ` : '';\n const text = trimText(getMessageTextWithSpoilers(message), truncateLength);\n const description = getMessageSummaryDescription(lang, message, text, noReactions, isExtended);\n\n return `${emojiWithSpace}${description}`;\n}\n\nexport function getMessageTextWithSpoilers(message: ApiMessage) {\n const text = getMessageText(message);\n if (!text) {\n return undefined;\n }\n\n const { entities } = message.content.text || {};\n if (!entities?.length) {\n return text;\n }\n\n return entities.reduce((accText, {\n type,\n offset,\n length,\n }) => {\n if (type !== ApiMessageEntityTypes.Spoiler) {\n return accText;\n }\n\n const spoiler = generateBrailleSpoiler(length);\n\n\n return `${accText.substr(0, offset)}${spoiler}${accText.substr(offset + length, accText.length)}`;\n }, text);\n}\n\nexport function getMessageSummaryEmoji(message: ApiMessage, noReactions = true) {\n const {\n photo,\n video,\n audio,\n voice,\n document,\n sticker,\n poll,\n } = message.content;\n\n if (message.groupedId || photo) {\n return '🖼';\n }\n\n if (video) {\n return '📹';\n }\n\n if (sticker) {\n return sticker.emoji;\n }\n\n if (audio) {\n return '🎧';\n }\n\n if (voice) {\n return '🎤';\n }\n\n if (document) {\n return '📎';\n }\n\n if (poll) {\n return '📊';\n }\n\n const reaction = !noReactions && getMessageRecentReaction(message);\n if (reaction) {\n return reaction.reaction;\n }\n\n return undefined;\n}\n\nexport function getMessageSummaryDescription(\n lang: LangFn,\n message: ApiMessage,\n truncatedText?: string | TextPart[],\n noReactions = true,\n isExtended = false,\n) {\n const {\n text,\n photo,\n video,\n audio,\n voice,\n document,\n sticker,\n contact,\n poll,\n invoice,\n } = message.content;\n\n let summary: string | TextPart[] | undefined;\n\n if (message.groupedId) {\n summary = truncatedText || lang('lng_in_dlg_album');\n }\n\n if (photo) {\n summary = truncatedText || lang('AttachPhoto');\n }\n\n if (video) {\n summary = truncatedText || lang(video.isGif ? 'AttachGif' : 'AttachVideo');\n }\n\n if (sticker) {\n summary = lang('AttachSticker').trim();\n }\n\n if (audio) {\n summary = getMessageAudioCaption(message) || lang('AttachMusic');\n }\n\n if (voice) {\n summary = truncatedText || lang('AttachAudio');\n }\n\n if (document) {\n summary = isExtended ? document.fileName : (truncatedText || document.fileName);\n }\n\n if (contact) {\n summary = lang('AttachContact');\n }\n\n if (poll) {\n summary = poll.summary.question;\n }\n\n if (invoice) {\n summary = lang('PaymentInvoice') + ': ' + invoice.text;\n }\n\n if (text) {\n if (isExtended && summary) {\n summary += '\\n' + truncatedText;\n } else {\n summary = truncatedText;\n }\n }\n\n const reaction = !noReactions && getMessageRecentReaction(message);\n if (summary && reaction) {\n summary = `to your \"${summary}\"`;\n }\n\n return summary || CONTENT_NOT_SUPPORTED;\n}\n\nexport function generateBrailleSpoiler(length: number) {\n return new Array(length)\n .fill(undefined)\n .map(() => SPOILER_CHARS[Math.floor(Math.random() * SPOILER_CHARS.length)])\n .join('');\n}\n\nfunction getMessageAudioCaption(message: ApiMessage) {\n const {\n audio,\n text,\n } = message.content;\n\n return (audio && [audio.title, audio.performer].filter(Boolean)\n .join(' — ')) || (text?.text);\n}\n","import {\n ApiAudio, ApiMediaFormat, ApiMessage, ApiMessageSearchType, ApiPhoto, ApiVideo, ApiDimensions,\n} from '../../api/types';\n\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, IS_SAFARI } from '../../util/environment';\nimport { getMessageKey, isMessageLocal, matchLinkInMessageText } from './messages';\nimport { getDocumentHasPreview } from '../../components/common/helpers/documentInfo';\n\ntype Target =\n 'micro'\n | 'pictogram'\n | 'inline'\n | 'viewerPreview'\n | 'viewerFull'\n | 'download';\n\nexport function getMessageContent(message: ApiMessage) {\n return message.content;\n}\n\nexport function hasMessageMedia(message: ApiMessage) {\n return Boolean((\n getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageContact(message)\n || getMessagePoll(message)\n || getMessageAction(message)\n || getMessageAudio(message)\n || getMessageVoice(message)\n ));\n}\n\nexport function getMessagePhoto(message: ApiMessage) {\n return message.content.photo;\n}\n\nexport function getMessageVideo(message: ApiMessage) {\n return message.content.video;\n}\n\nexport function getMessageRoundVideo(message: ApiMessage) {\n const { video } = message.content;\n\n return video?.isRound ? video : undefined;\n}\n\nexport function getMessageAction(message: ApiMessage) {\n return message.content.action;\n}\n\nexport function getMessageAudio(message: ApiMessage) {\n return message.content.audio;\n}\n\nexport function getMessageVoice(message: ApiMessage) {\n return message.content.voice;\n}\n\nexport function getMessageSticker(message: ApiMessage) {\n return message.content.sticker;\n}\n\nexport function getMessageDocument(message: ApiMessage) {\n return message.content.document;\n}\n\nexport function isMessageDocumentPhoto(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'photo' : undefined;\n}\n\nexport function isMessageDocumentVideo(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'video' : undefined;\n}\n\nexport function getMessageContact(message: ApiMessage) {\n return message.content.contact;\n}\n\nexport function getMessagePoll(message: ApiMessage) {\n return message.content.poll;\n}\n\nexport function getMessageInvoice(message: ApiMessage) {\n return message.content.invoice;\n}\n\nexport function getMessageWebPage(message: ApiMessage) {\n return message.content.webPage;\n}\n\nexport function getMessageWebPagePhoto(message: ApiMessage) {\n return getMessageWebPage(message)?.photo;\n}\n\nexport function getMessageWebPageDocument(message: ApiMessage) {\n return getMessageWebPage(message)?.document;\n}\n\nexport function getMessageWebPageVideo(message: ApiMessage): ApiVideo | undefined {\n return getMessageWebPage(message)?.video;\n}\n\nexport function getMessageMediaThumbnail(message: ApiMessage) {\n const media = getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageWebPagePhoto(message)\n || getMessageWebPageVideo(message);\n\n if (!media) {\n return undefined;\n }\n\n return media.thumbnail;\n}\n\nexport function getMessageMediaThumbDataUri(message: ApiMessage) {\n return getMessageMediaThumbnail(message)?.dataUri;\n}\n\nexport function getMessageMediaHash(\n message: ApiMessage,\n target: Target,\n) {\n const {\n photo, video, sticker, audio, voice, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n const messageVideo = video || webPageVideo;\n const messagePhoto = photo || webPagePhoto;\n\n if (!(messagePhoto || messageVideo || sticker || audio || voice || document)) {\n return undefined;\n }\n\n const mediaId = (messagePhoto || messageVideo || sticker || audio || voice || document)!.id;\n const base = `${getMessageKey(message)}${mediaId ? `:${mediaId}` : ''}`;\n\n if (messageVideo) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? getVideoOrAudioBaseHash(messageVideo, base) : undefined;\n case 'viewerPreview':\n return `${base}?size=m`;\n case 'viewerFull':\n return getVideoOrAudioBaseHash(messageVideo, base);\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (messagePhoto) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? `${base}?size=x` : undefined;\n case 'viewerPreview':\n return `${base}?size=x`;\n case 'viewerFull':\n case 'download':\n return `${base}?size=z`;\n }\n }\n\n if (document) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n case 'inline':\n case 'viewerPreview':\n if (!getDocumentHasPreview(document) || hasMessageLocalBlobUrl(message)) {\n return undefined;\n }\n\n return `${base}?size=m`;\n case 'viewerFull':\n case 'download':\n return base;\n }\n }\n\n if (sticker) {\n switch (target) {\n case 'micro':\n return undefined;\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return base;\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (audio) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return getAudioHasCover(audio) ? `${base}?size=m` : undefined;\n case 'inline':\n return getVideoOrAudioBaseHash(audio, base);\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (voice) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n case 'inline':\n return base;\n case 'download':\n return `${base}?download`;\n }\n }\n\n return undefined;\n}\n\nfunction getVideoOrAudioBaseHash(media: ApiAudio | ApiVideo, base: string) {\n if (IS_PROGRESSIVE_SUPPORTED && IS_SAFARI) {\n return `${base}?fileSize=${media.size}&mimeType=${media.mimeType}`;\n }\n\n return base;\n}\n\nexport function getAudioHasCover(media: ApiAudio) {\n return media.thumbnailSizes && media.thumbnailSizes.length > 0;\n}\n\nexport function getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): ApiMediaFormat {\n const {\n sticker, video, audio, voice,\n } = message.content;\n\n const fullVideo = video || getMessageWebPageVideo(message);\n\n if (sticker && target === 'inline' && sticker.isLottie) {\n return ApiMediaFormat.Lottie;\n } else if (fullVideo && IS_PROGRESSIVE_SUPPORTED && (\n target === 'viewerFull' || target === 'inline'\n )) {\n return ApiMediaFormat.Progressive;\n } else if (audio || voice) {\n // Safari\n if (voice && !IS_OPUS_SUPPORTED) {\n return ApiMediaFormat.BlobUrl;\n }\n\n return ApiMediaFormat.Progressive;\n }\n\n return ApiMediaFormat.BlobUrl;\n}\n\nexport function getMessageFileName(message: ApiMessage) {\n const {\n photo, video, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n if (photo || webPagePhoto) {\n return `photo${message.date}.jpeg`;\n }\n\n const { fileName } = video || webPageVideo || document || {};\n\n return fileName;\n}\n\nexport function getMessageFileSize(message: ApiMessage) {\n const { video, document } = message.content;\n const webPageVideo = getMessageWebPageVideo(message);\n const { size } = video || webPageVideo || document || {};\n\n return size;\n}\n\nexport function hasMessageLocalBlobUrl(message: ApiMessage) {\n const { photo, video, document } = message.content;\n\n return (photo?.blobUrl) || (video?.blobUrl) || (document?.previewBlobUrl);\n}\n\nexport function getChatMediaMessageIds(\n messages: Record, listedIds: number[], isFromSharedMedia = false,\n) {\n return getMessageContentIds(messages, listedIds, isFromSharedMedia ? 'media' : 'inlineMedia');\n}\n\nexport function getPhotoFullDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'z')\n || photo.sizes.find((size) => size.type === 'y')\n || getPhotoInlineDimensions(photo)\n );\n}\n\nexport function getPhotoInlineDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'x')\n || photo.sizes.find((size) => size.type === 'm')\n || photo.sizes.find((size) => size.type === 's')\n || photo.thumbnail\n );\n}\n\nexport function getVideoDimensions(video: ApiVideo): ApiDimensions | undefined {\n if (video.width && video.height) {\n return video as ApiDimensions;\n }\n\n return undefined;\n}\n\nexport function getMediaTransferState(message: ApiMessage, progress?: number, isLoadNeeded = false) {\n const isUploading = isMessageLocal(message);\n const isTransferring = isUploading || isLoadNeeded;\n const transferProgress = Number(progress);\n\n return {\n isUploading, isTransferring, transferProgress,\n };\n}\n\nexport function getMessageContentIds(\n messages: Record, messageIds: number[], contentType: ApiMessageSearchType | 'inlineMedia',\n) {\n let validator: Function;\n\n switch (contentType) {\n case 'media':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return getMessagePhoto(message) || (video && !video.isRound && !video.isGif);\n };\n break;\n\n case 'documents':\n validator = getMessageDocument;\n break;\n\n case 'links':\n validator = (message: ApiMessage) => getMessageWebPage(message) || matchLinkInMessageText(message);\n break;\n\n case 'audio':\n validator = getMessageAudio;\n break;\n\n case 'voice':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return getMessageVoice(message) || (video && video.isRound);\n };\n break;\n\n case 'inlineMedia':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return (\n getMessagePhoto(message)\n || (video && !video.isRound && !video.isGif)\n || isMessageDocumentPhoto(message)\n || isMessageDocumentVideo(message)\n );\n };\n break;\n\n default:\n return [] as Array;\n }\n\n return messageIds.reduce((result, messageId) => {\n if (messages[messageId] && validator(messages[messageId])) {\n result.push(messageId);\n }\n\n return result;\n }, [] as Array);\n}\n\nexport function getMediaDuration(message: ApiMessage) {\n const { audio, voice, video } = getMessageContent(message);\n const media = audio || voice || video || getMessageWebPageVideo(message);\n if (!media) {\n return undefined;\n }\n\n return media.duration;\n}\n","export function buildChatThreadKey(chatId: string, threadId: number) {\n return `${chatId}_${threadId}`;\n}\n","import { ApiFieldError } from '../../api/types';\n\nconst STRIPE_ERRORS: Record = {\n missing_payment_information: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n invalid_number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n exp_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n exp_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n invalid_expiry_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n invalid_expiry_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n invalid_cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n};\n\nexport function getStripeError(error: {\n code: string;\n message: string;\n param?: string;\n}) {\n const { message: description, code, param } = error;\n const { field, message } = param ? STRIPE_ERRORS[param] : STRIPE_ERRORS[code];\n\n return { field, message, description };\n}\n","import { ApiMessage, ApiReactions } from '../../api/types';\n\nexport function getMessageRecentReaction(message: Partial) {\n return message.isOutgoing ? message.reactions?.recentReactions?.[0] : undefined;\n}\n\nexport function checkIfReactionAdded(oldReactions?: ApiReactions, newReactions?: ApiReactions) {\n if (!oldReactions || !oldReactions.recentReactions) return true;\n if (!newReactions || !newReactions.recentReactions) return false;\n const oldReactionsMap = oldReactions.results.reduce>((acc, reaction) => {\n acc[reaction.reaction] = reaction.count;\n return acc;\n }, {});\n return newReactions.results.some(r => !oldReactionsMap[r.reaction] || oldReactionsMap[r.reaction] < r.count);\n}\n","import { ApiChat, ApiUser, ApiUserStatus } from '../../api/types';\n\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../../config';\nimport { formatFullDate, formatTime } from '../../util/dateFormat';\nimport { orderBy } from '../../util/iteratees';\nimport { LangFn } from '../../hooks/useLang';\nimport { getServerTime } from '../../util/serverTime';\nimport { prepareSearchWordsForNeedle } from '../../util/searchWords';\n\nconst USER_COLOR_KEYS = [1, 8, 5, 2, 7, 4, 6];\n\nexport function getUserFirstOrLastName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n return user.firstName || user.lastName;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted';\n }\n\n default:\n return undefined;\n }\n}\n\nexport function getUserFullName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n if (isDeletedUser(user)) {\n return 'Deleted account';\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n if (user.firstName && user.lastName) {\n return `${user.firstName} ${user.lastName}`;\n }\n\n if (user.firstName) {\n return user.firstName;\n }\n\n if (user.lastName) {\n return user.lastName;\n }\n\n break;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted account';\n }\n }\n\n return undefined;\n}\n\nexport function getUserStatus(\n lang: LangFn, user: ApiUser, userStatus: ApiUserStatus | undefined, serverTimeOffset: number,\n) {\n if (user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return lang('ServiceNotifications').toLowerCase();\n }\n\n if (user.type && user.type === 'userTypeBot') {\n return lang('Bot');\n }\n\n if (!userStatus) {\n return '';\n }\n\n switch (userStatus.type) {\n case 'userStatusEmpty': {\n return lang('ALongTimeAgo');\n }\n\n case 'userStatusLastMonth': {\n return lang('WithinAMonth');\n }\n\n case 'userStatusLastWeek': {\n return lang('WithinAWeek');\n }\n\n case 'userStatusOffline': {\n const { wasOnline } = userStatus;\n\n if (!wasOnline) return lang('LastSeen.Offline');\n\n const now = new Date(new Date().getTime() + serverTimeOffset * 1000);\n const wasOnlineDate = new Date(wasOnline * 1000);\n\n if (wasOnlineDate >= now) {\n return lang('LastSeen.JustNow');\n }\n\n const diff = new Date(now.getTime() - wasOnlineDate.getTime());\n\n // within a minute\n if (diff.getTime() / 1000 < 60) {\n return lang('LastSeen.JustNow');\n }\n\n // within an hour\n if (diff.getTime() / 1000 < 60 * 60) {\n const minutes = Math.floor(diff.getTime() / 1000 / 60);\n return lang('LastSeen.MinutesAgo', minutes);\n }\n\n // today\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const serverToday = new Date(today.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverToday) {\n // up to 6 hours ago\n if (diff.getTime() / 1000 < 6 * 60 * 60) {\n const hours = Math.floor(diff.getTime() / 1000 / 60 / 60);\n return lang('LastSeen.HoursAgo', hours);\n }\n\n // other\n return lang('LastSeen.TodayAt', formatTime(lang, wasOnlineDate));\n }\n\n // yesterday\n const yesterday = new Date();\n yesterday.setDate(now.getDate() - 1);\n yesterday.setHours(0, 0, 0, 0);\n const serverYesterday = new Date(yesterday.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverYesterday) {\n return lang('LastSeen.YesterdayAt', formatTime(lang, wasOnlineDate));\n }\n\n return lang('LastSeen.AtDate', formatFullDate(lang, wasOnlineDate));\n }\n\n case 'userStatusOnline': {\n return lang('Online');\n }\n\n case 'userStatusRecently': {\n return lang('Lately');\n }\n\n default:\n return undefined;\n }\n}\n\nexport function isUserOnline(user: ApiUser, userStatus?: ApiUserStatus) {\n const { id, type } = user;\n\n if (!userStatus) {\n return false;\n }\n\n if (id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return userStatus.type === 'userStatusOnline' && type !== 'userTypeBot';\n}\n\nexport function isDeletedUser(user: ApiUser) {\n if (user.noStatus || user.type === 'userTypeBot' || user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return user.type === 'userTypeDeleted'\n || user.type === 'userTypeUnknown';\n}\n\nexport function isUserBot(user: ApiUser) {\n return user.type === 'userTypeBot';\n}\n\nexport function getCanAddContact(user: ApiUser) {\n return !user.isContact && !isUserBot(user);\n}\n\nexport function sortUserIds(\n userIds: string[],\n usersById: Record,\n userStatusesById: Record,\n priorityIds?: string[],\n serverTimeOffset = 0,\n) {\n return orderBy(userIds, (id) => {\n const now = getServerTime(serverTimeOffset);\n\n if (priorityIds && priorityIds.includes(id)) {\n // Assuming that online status expiration date can't be as far as two days from now,\n // this should place prioritized on top of the list.\n // Then we subtract index of `id` in `priorityIds` to preserve selected order\n return now + (48 * 60 * 60) - (priorityIds.length - priorityIds.indexOf(id));\n }\n\n const user = usersById[id];\n const userStatus = userStatusesById[id];\n if (!user || !userStatus) {\n return 0;\n }\n\n if (userStatus.type === 'userStatusOnline') {\n return userStatus.expires;\n } else if (userStatus.type === 'userStatusOffline' && userStatus.wasOnline) {\n return userStatus.wasOnline;\n }\n\n switch (userStatus.type) {\n case 'userStatusRecently':\n return now - 60 * 60 * 24;\n case 'userStatusLastWeek':\n return now - 60 * 60 * 24 * 7;\n case 'userStatusLastMonth':\n return now - 60 * 60 * 24 * 7 * 30;\n default:\n return 0;\n }\n }, 'desc');\n}\n\nexport function filterUsersByName(\n userIds: string[],\n usersById: Record,\n query?: string,\n currentUserId?: string,\n savedMessagesLang?: string,\n) {\n if (!query) {\n return userIds;\n }\n\n const searchWords = prepareSearchWordsForNeedle(query);\n\n return userIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n\n const name = id === currentUserId ? savedMessagesLang : getUserFullName(user);\n return (name && searchWords(name)) || searchWords(user.username);\n });\n}\n\nexport function getUserIdDividend(userId: string) {\n // Workaround for old-fashioned IDs stored locally\n if (typeof userId === 'number') {\n return Math.abs(userId);\n }\n\n return Math.abs(Number(userId));\n}\n\n// eslint-disable-next-line max-len\n// https://github.com/telegramdesktop/tdesktop/blob/371510cfe23b0bd226de8c076bc49248fbe40c26/Telegram/SourceFiles/data/data_peer.cpp#L53\nexport function getUserColorKey(peer: ApiUser | ApiChat | undefined) {\n const index = peer ? getUserIdDividend(peer.id) % 7 : 0;\n\n return USER_COLOR_KEYS[index];\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiPhoto } from '../../api/types';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { omit } from '../../util/iteratees';\nimport { selectChatListType } from '../selectors';\n\nexport function replaceChatListIds(\n global: GlobalState,\n type: 'active' | 'archived',\n newIds: string[] | undefined,\n): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n listIds: {\n ...global.chats.listIds,\n [type]: newIds,\n },\n },\n };\n}\n\nexport function updateChatListIds(global: GlobalState, type: 'active' | 'archived', idsUpdate: string[]): GlobalState {\n const { [type]: listIds } = global.chats.listIds;\n const newIds = listIds?.length\n ? idsUpdate.filter((id) => !listIds.includes(id))\n : idsUpdate;\n\n if (listIds && !newIds.length) {\n return global;\n }\n\n return replaceChatListIds(global, type, [\n ...(listIds || []),\n ...newIds,\n ]);\n}\n\nexport function replaceChats(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n byId: newById,\n },\n };\n}\n\nexport function updateChat(\n global: GlobalState, chatId: string, chatUpdate: Partial, photo?: ApiPhoto,\n): GlobalState {\n const { byId } = global.chats;\n\n const updatedChat = getUpdatedChat(global, chatId, chatUpdate, photo);\n if (!updatedChat) {\n return global;\n }\n\n return replaceChats(global, {\n ...byId,\n [chatId]: updatedChat,\n });\n}\n\nexport function updateChats(global: GlobalState, newById: Record): GlobalState {\n const updatedById = Object.keys(newById).reduce((acc: Record, id) => {\n const updatedChat = getUpdatedChat(global, id, newById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n }\n\n return acc;\n }, {});\n\n global = replaceChats(global, {\n ...global.chats.byId,\n ...updatedById,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addChats(global: GlobalState, newById: Record): GlobalState {\n const { byId } = global.chats;\n let isUpdated = false;\n\n const addedById = Object.keys(newById).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !newById[id].isMin)) {\n const updatedChat = getUpdatedChat(global, id, newById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n if (!isUpdated) {\n isUpdated = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (!isUpdated) {\n return global;\n }\n\n global = replaceChats(global, {\n ...byId,\n ...addedById,\n });\n\n return global;\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedChat(\n global: GlobalState, chatId: string, chatUpdate: Partial, photo?: ApiPhoto,\n) {\n const { byId } = global.chats;\n const chat = byId[chatId];\n const shouldOmitMinInfo = chatUpdate.isMin && chat && !chat.isMin;\n const updatedChat: ApiChat = {\n ...chat,\n ...(shouldOmitMinInfo ? omit(chatUpdate, ['isMin', 'accessHash']) : chatUpdate),\n ...(photo && { photos: [photo, ...(chat.photos || [])] }),\n };\n\n if (!updatedChat.id || !updatedChat.type) {\n return undefined;\n }\n\n return updatedChat;\n}\n\nexport function updateChatListType(\n global: GlobalState,\n chatId: string,\n folderId?: number,\n): GlobalState {\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n let currentListIds = global.chats.listIds;\n (Object.keys(currentListIds) as Array).forEach((listTypeKey) => {\n const currentFolderList = currentListIds[listTypeKey] || [];\n if (listTypeKey === listType && !currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: [...currentFolderList, chatId],\n };\n } else if (listTypeKey !== listType && currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: currentFolderList.filter((id) => id !== chatId),\n };\n }\n });\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n listIds: currentListIds,\n },\n };\n\n global = updateChat(global, chatId, { folderId: folderId || undefined });\n\n return global;\n}\n\nexport function updateChatListSecondaryInfo(\n global: GlobalState,\n type: 'active' | 'archived',\n info: {\n orderedPinnedIds?: string[];\n totalChatCount: number;\n },\n): GlobalState {\n const totalCountKey = type === 'active' ? 'all' : 'archived';\n\n return {\n ...global,\n chats: {\n ...global.chats,\n ...(info.orderedPinnedIds && {\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [type]: info.orderedPinnedIds,\n },\n }),\n totalCount: {\n ...global.chats.totalCount,\n [totalCountKey]: info.totalChatCount,\n },\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [type]: false,\n },\n },\n };\n}\n\nexport function leaveChat(global: GlobalState, leftChatId: string): GlobalState {\n const listType = selectChatListType(global, leftChatId);\n if (!listType) {\n return global;\n }\n\n const { [listType]: listIds } = global.chats.listIds;\n\n if (listIds) {\n global = replaceChatListIds(global, listType, listIds.filter((listId) => listId !== leftChatId));\n }\n\n global = updateChat(global, leftChatId, { isNotJoined: true });\n\n return global;\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types';\nimport { buildCollectionByKey, unique } from '../../util/iteratees';\nimport { selectStickersForEmoji } from '../selectors';\n\nexport function updateStickerSets(\n global: GlobalState,\n category: 'added' | 'featured' | 'search',\n hash: string,\n sets: ApiStickerSet[],\n resultIds?: string[],\n): GlobalState {\n const updatedSets = sets.map((stickerSet) => {\n const existing = global.stickers.setsById[stickerSet.id];\n if (!existing) {\n return stickerSet;\n }\n\n return {\n ...existing,\n ...stickerSet,\n };\n });\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n setsById: {\n ...global.stickers.setsById,\n ...buildCollectionByKey(updatedSets, 'id'),\n },\n [category]: {\n ...global.stickers[category],\n hash,\n ...(\n category === 'search'\n ? { resultIds }\n : { setIds: sets.map(({ id }) => id) }\n ),\n },\n },\n };\n}\n\nexport function updateStickerSet(\n global: GlobalState, stickerSetId: string, update: Partial,\n): GlobalState {\n const currentStickerSet = global.stickers.setsById[stickerSetId] || {};\n const addedSets = global.stickers.added.setIds || [];\n let setIds: string[] = addedSets;\n if (update.installedDate && addedSets && !addedSets.includes(stickerSetId)) {\n setIds = [stickerSetId, ...setIds];\n }\n\n if (!update.installedDate && addedSets?.includes(stickerSetId)) {\n setIds = setIds.filter((id) => id !== stickerSetId);\n }\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n added: {\n ...global.stickers.added,\n setIds,\n },\n setsById: {\n ...global.stickers.setsById,\n [stickerSetId]: {\n ...currentStickerSet,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateGifSearch(\n global: GlobalState, isNew: boolean, results: ApiVideo[], nextOffset?: string,\n): GlobalState {\n const { results: currentResults } = global.gifs.search;\n\n let newResults!: ApiVideo[];\n if (isNew || !currentResults) {\n newResults = results;\n } else {\n const currentIds = new Set(currentResults.map((gif) => gif.id));\n newResults = [\n ...currentResults,\n ...results.filter((gif) => !currentIds.has(gif.id)),\n ];\n }\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n ...global.gifs.search,\n offset: nextOffset,\n results: newResults,\n },\n },\n };\n}\n\nexport function replaceAnimatedEmojis(global: GlobalState, stickerSet: ApiStickerSet): GlobalState {\n return {\n ...global,\n animatedEmojis: stickerSet,\n };\n}\n\nexport function updateStickersForEmoji(\n global: GlobalState, emoji: string, remoteStickers?: ApiSticker[], hash?: string,\n): GlobalState {\n const localStickers = selectStickersForEmoji(global, emoji);\n const allStickers = [...localStickers, ...(remoteStickers || [])];\n const uniqueIds = unique(allStickers.map(({ id }) => id));\n const byId = buildCollectionByKey(allStickers, 'id');\n const stickers = uniqueIds.map((id) => byId[id]);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n emoji,\n stickers,\n hash,\n },\n },\n };\n}\n\nexport function rebuildStickersForEmoji(global: GlobalState): GlobalState {\n const { emoji, stickers, hash } = global.stickers.forEmoji || {};\n if (!emoji) {\n return global;\n }\n\n return updateStickersForEmoji(global, emoji, stickers, hash);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiUser, ApiUserStatus } from '../../api/types';\n\nimport { omit, pick } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\n\nexport function replaceUsers(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n users: {\n ...global.users,\n byId: newById,\n },\n };\n}\n\nfunction updateContactList(global: GlobalState, updatedUsers: ApiUser[]): GlobalState {\n const { userIds: contactUserIds } = global.contactList || {};\n\n if (!contactUserIds) return global;\n\n const newContactUserIds = updatedUsers\n .filter((user) => user?.isContact && !contactUserIds.includes(user.id))\n .map((user) => user.id);\n\n if (newContactUserIds.length === 0) return global;\n\n return {\n ...global,\n contactList: {\n userIds: [\n ...newContactUserIds,\n ...contactUserIds,\n ],\n },\n };\n}\n\nexport function updateUser(global: GlobalState, userId: string, userUpdate: Partial): GlobalState {\n const { byId } = global.users;\n\n const updatedUser = getUpdatedUser(global, userId, userUpdate);\n if (!updatedUser) {\n return global;\n }\n\n global = updateContactList(global, [updatedUser]);\n\n return replaceUsers(global, {\n ...byId,\n [userId]: updatedUser,\n });\n}\n\nexport function updateUsers(global: GlobalState, newById: Record): GlobalState {\n const updatedById = Object.keys(newById).reduce((acc: Record, id) => {\n const updatedUser = getUpdatedUser(global, id, newById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n }\n\n return acc;\n }, {});\n\n global = replaceUsers(global, {\n ...global.users.byId,\n ...updatedById,\n });\n\n global = updateContactList(global, Object.values(updatedById));\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUsers(global: GlobalState, newById: Record): GlobalState {\n const { byId } = global.users;\n let isUpdated = false;\n\n const addedById = Object.keys(newById).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !newById[id].isMin)) {\n const updatedUser = getUpdatedUser(global, id, newById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n if (!isUpdated) {\n isUpdated = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (!isUpdated) {\n return global;\n }\n\n global = replaceUsers(global, {\n ...byId,\n ...addedById,\n });\n\n global = updateContactList(global, Object.values(addedById));\n\n return global;\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedUser(global: GlobalState, userId: string, userUpdate: Partial) {\n const { byId } = global.users;\n const user = byId[userId];\n const shouldOmitMinInfo = userUpdate.isMin && user && !user.isMin;\n\n const updatedUser = {\n ...user,\n ...(shouldOmitMinInfo ? omit(userUpdate, ['isMin', 'accessHash']) : userUpdate),\n };\n\n if (!updatedUser.id || !updatedUser.type) {\n return undefined;\n }\n\n return updatedUser;\n}\n\nexport function deleteContact(global: GlobalState, userId: string): GlobalState {\n const { byId } = global.users;\n const { userIds } = global.contactList || {};\n\n global = {\n ...global,\n contactList: {\n userIds: userIds ? userIds.filter((id) => id !== userId) : MEMO_EMPTY_ARRAY,\n },\n };\n\n return replaceUsers(global, {\n ...byId,\n [userId]: {\n ...byId[userId],\n isContact: undefined,\n },\n });\n}\n\nexport function updateUserSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n userSearch: {\n ...global.userSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateUserSearchFetchingStatus(\n global: GlobalState, newState: boolean,\n) {\n return updateUserSearch(global, {\n fetchingStatus: newState,\n });\n}\n\nexport function updateUserBlockedState(global: GlobalState, userId: string, isBlocked: boolean) {\n const { byId } = global.users;\n const user = byId[userId];\n if (!user || !user.fullInfo) {\n return global;\n }\n\n return updateUser(global, userId, {\n ...user,\n fullInfo: {\n ...user.fullInfo,\n isBlocked,\n },\n });\n}\n\nexport function replaceUserStatuses(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n users: {\n ...global.users,\n statusesById: newById,\n },\n };\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUserStatuses(global: GlobalState, newById: Record): GlobalState {\n const { statusesById } = global.users;\n\n const newKeys = Object.keys(newById).filter((id) => !statusesById[id]);\n if (!newKeys.length) {\n return global;\n }\n\n global = replaceUserStatuses(global, {\n ...statusesById,\n ...pick(newById, newKeys),\n });\n\n return global;\n}\n","import { GlobalState } from '../../global/types';\nimport { GlobalSearchContent } from '../../types';\nimport { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types';\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nconst getComplexKey = (message: ApiMessage) => `${message.chatId}_${message.id}`;\n\nexport function updateGlobalSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n globalSearch: {\n ...global.globalSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateGlobalSearchContent(\n global: GlobalState,\n currentContent: GlobalSearchContent | undefined,\n): GlobalState {\n return updateGlobalSearch(global, { currentContent });\n}\n\nexport function updateGlobalSearchResults(\n global: GlobalState,\n newFoundMessages: ApiMessage[],\n totalCount: number,\n type: ApiGlobalMessageSearchType,\n nextRate?: number,\n): GlobalState {\n const { resultsByType } = global.globalSearch || {};\n const newFoundMessagesById = newFoundMessages.reduce((result, message) => {\n result[getComplexKey(message)] = message;\n\n return result;\n }, {} as Record);\n const foundIdsForType = resultsByType?.[type]?.foundIds;\n\n if (foundIdsForType !== undefined\n && Object.keys(newFoundMessagesById).every(\n (newId) => foundIdsForType.includes(getComplexKey(newFoundMessagesById[newId])),\n )\n ) {\n return updateGlobalSearchFetchingStatus(global, { messages: false });\n }\n\n const prevFoundIds = foundIdsForType || [];\n const newFoundIds = newFoundMessages.map((message) => getComplexKey(message));\n const foundIds = Array.prototype.concat(prevFoundIds, newFoundIds);\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n global = updateGlobalSearchFetchingStatus(global, { messages: false });\n\n return updateGlobalSearch(global, {\n resultsByType: {\n ...(global.globalSearch || {}).resultsByType,\n [type]: {\n totalCount,\n nextOffsetId: nextRate,\n foundIds: foundOrPrevFoundIds,\n },\n },\n });\n}\n\nexport function updateGlobalSearchFetchingStatus(\n global: GlobalState, newState: { chats?: boolean; messages?: boolean },\n) {\n return updateGlobalSearch(global, {\n fetchingStatus: {\n ...global.globalSearch.fetchingStatus,\n ...newState,\n },\n });\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiMessageSearchType } from '../../api/types';\n\nimport { areSortedArraysEqual, unique } from '../../util/iteratees';\nimport { SharedMediaType } from '../../types';\nimport { buildChatThreadKey } from '../helpers';\n\ninterface TextSearchParams {\n isActive: boolean;\n query?: string;\n results?: {\n totalCount?: number;\n nextOffsetId?: number;\n foundIds?: number[];\n };\n}\n\ninterface MediaSearchParams {\n currentType?: SharedMediaType;\n resultsByType?: Partial>;\n}\n\nfunction replaceLocalTextSearch(\n global: GlobalState,\n chatThreadKey: string,\n searchParams: TextSearchParams,\n): GlobalState {\n return {\n ...global,\n localTextSearch: {\n byChatThreadKey: {\n ...global.localTextSearch.byChatThreadKey,\n [chatThreadKey]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalTextSearch(\n global: GlobalState,\n chatId: string,\n threadId: number,\n isActive: boolean,\n query?: string,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n isActive,\n query,\n });\n}\n\nexport function replaceLocalTextSearchResults(\n global: GlobalState,\n chatId: string,\n threadId: number,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n results: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n });\n}\n\nexport function updateLocalTextSearchResults(\n global: GlobalState,\n chatId: string,\n threadId: number,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { results } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n const prevFoundIds = (results?.foundIds) || [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalTextSearchResults(global, chatId, threadId, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction replaceLocalMediaSearch(\n global: GlobalState,\n chatId: string,\n searchParams: MediaSearchParams,\n): GlobalState {\n return {\n ...global,\n localMediaSearch: {\n byChatId: {\n ...global.localMediaSearch.byChatId,\n [chatId]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalMediaSearchType(\n global: GlobalState,\n chatId: string,\n currentType: SharedMediaType | undefined,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n currentType,\n });\n}\n\nexport function replaceLocalMediaSearchResults(\n global: GlobalState,\n chatId: string,\n type: ApiMessageSearchType,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n resultsByType: {\n ...(global.localMediaSearch.byChatId[chatId] || {}).resultsByType,\n [type]: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n },\n });\n}\n\nexport function updateLocalMediaSearchResults(\n global: GlobalState,\n chatId: string,\n type: SharedMediaType,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const { resultsByType } = global.localMediaSearch.byChatId[chatId] || {};\n const prevFoundIds = resultsByType?.[type] ? resultsByType[type]!.foundIds : [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalMediaSearchResults(global, chatId, type, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction orderFoundIds(listedIds: number[]) {\n return listedIds.sort((a, b) => b - a);\n}\n","import { GlobalState } from '../../global/types';\nimport { ManagementProgress, ManagementState } from '../../types';\n\nexport function updateManagementProgress(global: GlobalState, progress: ManagementProgress): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n progress,\n },\n };\n}\n\nexport function updateManagement(global: GlobalState, chatId: string, update: Partial): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...(global.management.byChatId[chatId] || {}),\n ...update,\n },\n },\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport {\n ISettings, IThemeSettings, ThemeKey, NotifyException,\n} from '../../types';\nimport { ApiNotifyException } from '../../api/types';\nimport { updateUserBlockedState } from './users';\n\nexport function replaceSettings(global: GlobalState, newSettings?: Partial): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n byKey: {\n ...global.settings.byKey,\n ...newSettings,\n },\n },\n };\n}\n\nexport function replaceThemeSettings(\n global: GlobalState, theme: ThemeKey, newSettings?: Partial,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n themes: {\n ...global.settings.themes,\n [theme]: {\n ...(global.settings.themes[theme] || {}),\n ...newSettings,\n },\n },\n },\n };\n}\n\nexport function addNotifyExceptions(\n global: GlobalState, notifyExceptions: ApiNotifyException[],\n): GlobalState {\n notifyExceptions.forEach((notifyException) => {\n const { chatId, ...exceptionData } = notifyException;\n global = addNotifyException(global, chatId, exceptionData);\n });\n\n return global;\n}\n\nexport function addNotifyException(\n global: GlobalState, id: string, notifyException: NotifyException,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n notifyExceptions: {\n ...global.settings.notifyExceptions,\n [id]: notifyException,\n },\n },\n };\n}\n\nexport function updateNotifySettings(\n global: GlobalState, peerType: 'contact' | 'group' | 'broadcast', isSilent?: boolean, shouldShowPreviews?: boolean,\n) {\n switch (peerType) {\n case 'contact':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasPrivateChatsNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasPrivateChatsMessagePreview: shouldShowPreviews }),\n });\n case 'group':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasGroupNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasGroupMessagePreview: shouldShowPreviews }),\n });\n case 'broadcast':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasBroadcastNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasBroadcastMessagePreview: shouldShowPreviews }),\n });\n\n default:\n return undefined;\n }\n}\n\nexport function addBlockedContact(global: GlobalState, contactId: string): GlobalState {\n global = updateUserBlockedState(global, contactId, true);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: [contactId, ...global.blocked.ids],\n totalCount: global.blocked.totalCount + 1,\n },\n };\n}\n\nexport function removeBlockedContact(global: GlobalState, contactId: string): GlobalState {\n global = updateUserBlockedState(global, contactId, false);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: global.blocked.ids.filter((id) => id !== contactId),\n totalCount: global.blocked.totalCount - 1,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\n\nexport function updateTwoFaSettings(\n global: GlobalState,\n update: GlobalState['twoFaSettings'],\n): GlobalState {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n ...update,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport { ShippingOption, PaymentStep } from '../../types';\nimport { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types';\n\nexport function updateShippingOptions(\n global: GlobalState,\n shippingOptions: ShippingOption[],\n): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n shippingOptions,\n },\n };\n}\n\nexport function setRequestInfoId(global: GlobalState, id: string): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n requestId: id,\n },\n };\n}\n\nexport function setPaymentStep(global: GlobalState, step: PaymentStep): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n step,\n },\n };\n}\n\nexport function setInvoiceMessageInfo(global: GlobalState, message: ApiMessage): GlobalState {\n if (!message.content || !message.content.invoice) {\n return global;\n }\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = message.content.invoice;\n return {\n ...global,\n payment: {\n ...global.payment,\n invoiceContent: {\n title,\n text,\n photoUrl,\n amount,\n currency,\n isTest,\n },\n },\n };\n}\n\nexport function setStripeCardInfo(global: GlobalState, cardInfo: { type: string; id: string }): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n stripeCredentials: {\n ...cardInfo,\n },\n },\n };\n}\n\nexport function setSmartGlocalCardInfo(\n global: GlobalState,\n cardInfo: { type: string; token: string },\n): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n smartGlocalCredentials: {\n ...cardInfo,\n },\n },\n };\n}\n\nexport function setPaymentForm(global: GlobalState, form: ApiPaymentForm): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n ...form,\n },\n };\n}\n\nexport function setConfirmPaymentUrl(global: GlobalState, url?: string): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n confirmPaymentUrl: url,\n },\n };\n}\n\nexport function setReceipt(\n global: GlobalState,\n receipt?: ApiReceipt,\n message?: ApiMessage,\n): GlobalState {\n if (!receipt || !message) {\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n };\n }\n\n const { invoice: messageInvoice } = message.content;\n const { photoUrl, text, title } = (messageInvoice || {});\n\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: {\n ...receipt,\n photoUrl,\n text,\n title,\n },\n },\n };\n}\n\nexport function clearPayment(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {},\n };\n}\n\nexport function closeInvoice(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n isPaymentModalOpen: false,\n },\n };\n}\n","import {\n GlobalState, MessageList, MessageListType, Thread,\n} from '../../global/types';\nimport {\n ApiMessage, ApiSponsoredMessage, ApiThreadInfo, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport {\n IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT, TMP_CHAT_ID,\n} from '../../config';\nimport {\n selectListedIds,\n selectChatMessages,\n selectViewportIds,\n selectOutlyingIds,\n selectPinnedIds,\n selectThreadInfo,\n selectMessageIdsByGroupId,\n selectScheduledMessages,\n selectScheduledIds,\n selectCurrentMessageIds,\n selectChatMessage,\n selectCurrentMessageList,\n} from '../selectors';\nimport {\n areSortedArraysEqual, omit, pickTruthy, unique,\n} from '../../util/iteratees';\n\ntype MessageStoreSections = {\n byId: Record;\n threadsById: Record;\n};\n\nexport function updateCurrentMessageList(\n global: GlobalState,\n chatId: string | undefined,\n threadId: number = MAIN_THREAD_ID,\n type: MessageListType = 'thread',\n shouldReplaceHistory?: boolean,\n): GlobalState {\n const { messageLists } = global.messages;\n let newMessageLists: MessageList[] = messageLists;\n if (shouldReplaceHistory || IS_TEST) {\n newMessageLists = chatId ? [{ chatId, threadId, type }] : [];\n } else if (chatId) {\n const last = messageLists[messageLists.length - 1];\n if (!last || last.chatId !== chatId || last.threadId !== threadId || last.type !== type) {\n if (last && last.chatId === TMP_CHAT_ID) {\n newMessageLists = [...messageLists.slice(0, -1), { chatId, threadId, type }];\n } else {\n newMessageLists = [...messageLists, { chatId, threadId, type }];\n }\n }\n } else {\n newMessageLists = messageLists.slice(0, -1);\n }\n\n return {\n ...global,\n messages: {\n ...global.messages,\n messageLists: newMessageLists,\n },\n };\n}\n\nfunction replaceChatMessages(global: GlobalState, chatId: string, newById: Record): GlobalState {\n return updateMessageStore(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateThread(\n global: GlobalState, chatId: string, threadId: number, threadUpdate: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId];\n\n return updateMessageStore(global, chatId, {\n threadsById: {\n ...(current?.threadsById),\n [threadId]: {\n ...(current?.threadsById[threadId]),\n ...threadUpdate,\n },\n },\n });\n}\n\nfunction updateMessageStore(\n global: GlobalState, chatId: string, update: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId] || { byId: {}, threadsById: {} };\n\n return {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function replaceThreadParam(\n global: GlobalState, chatId: string, threadId: number, paramName: T, newValue: Thread[T] | undefined,\n) {\n return updateThread(global, chatId, threadId, { [paramName]: newValue });\n}\n\nexport function addMessages(\n global: GlobalState, messages: ApiMessage[],\n): GlobalState {\n const addedByChatId = messages.reduce((messagesByChatId, message: ApiMessage) => {\n if (!messagesByChatId[message.chatId]) {\n messagesByChatId[message.chatId] = {};\n }\n messagesByChatId[message.chatId][message.id] = message;\n\n return messagesByChatId;\n }, {} as Record>);\n\n Object.keys(addedByChatId).forEach((chatId) => {\n global = addChatMessagesById(global, chatId, addedByChatId[chatId]);\n });\n\n return global;\n}\n\nexport function addChatMessagesById(\n global: GlobalState, chatId: string, newById: Record,\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n\n if (byId && Object.keys(newById).every((newId) => Boolean(byId[Number(newId)]))) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...newById,\n ...byId,\n });\n}\n\nexport function updateChatMessage(\n global: GlobalState, chatId: string, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectChatMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n });\n}\n\nexport function updateScheduledMessage(\n global: GlobalState, chatId: string, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceScheduledMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n });\n}\n\nexport function deleteChatMessages(\n global: GlobalState,\n chatId: string,\n messageIds: number[],\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n const deletedForwardedPosts = Object.values(pickTruthy(byId, messageIds)).filter(\n ({ forwardInfo }) => forwardInfo?.isLinkedChannelPost,\n );\n\n const threadIds = Object.keys(global.messages.byChatId[chatId].threadsById).map(Number);\n threadIds.forEach((threadId) => {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n let outlyingIds = selectOutlyingIds(global, chatId, threadId);\n let viewportIds = selectViewportIds(global, chatId, threadId);\n let pinnedIds = selectPinnedIds(global, chatId);\n let newMessageCount = threadInfo?.messagesCount;\n\n messageIds.forEach((messageId) => {\n if (listedIds && listedIds.includes(messageId)) {\n listedIds = listedIds.filter((id) => id !== messageId);\n if (newMessageCount !== undefined) newMessageCount -= 1;\n }\n\n if (outlyingIds && outlyingIds.includes(messageId)) {\n outlyingIds = outlyingIds.filter((id) => id !== messageId);\n }\n\n if (viewportIds && viewportIds.includes(messageId)) {\n viewportIds = viewportIds.filter((id) => id !== messageId);\n }\n\n if (pinnedIds && pinnedIds.includes(messageId)) {\n pinnedIds = pinnedIds.filter((id) => id !== messageId);\n }\n });\n\n global = replaceThreadParam(global, chatId, threadId, 'listedIds', listedIds);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', outlyingIds);\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', viewportIds);\n global = replaceThreadParam(global, chatId, threadId, 'pinnedIds', pinnedIds);\n\n if (threadInfo && newMessageCount !== undefined) {\n global = replaceThreadParam(global, chatId, threadId, 'threadInfo', {\n ...threadInfo,\n messagesCount: newMessageCount,\n });\n }\n });\n\n if (deletedForwardedPosts.length) {\n const currentMessageList = selectCurrentMessageList(global);\n const canDeleteCurrentThread = currentMessageList && currentMessageList.chatId === chatId\n && currentMessageList.type === 'thread';\n const currentThreadId = currentMessageList?.threadId;\n\n deletedForwardedPosts.forEach((message) => {\n const { fromChatId, fromMessageId } = message.forwardInfo!;\n const originalPost = selectChatMessage(global, fromChatId!, fromMessageId!);\n\n if (canDeleteCurrentThread && currentThreadId === fromMessageId) {\n global = updateCurrentMessageList(global, chatId);\n }\n if (originalPost) {\n global = updateChatMessage(global, fromChatId!, fromMessageId!, { threadInfo: undefined });\n }\n });\n }\n\n global = replaceChatMessages(global, chatId, newById);\n\n return global;\n}\n\nexport function deleteChatScheduledMessages(\n global: GlobalState,\n chatId: string,\n messageIds: number[],\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n\n let scheduledIds = selectScheduledIds(global, chatId);\n if (scheduledIds) {\n messageIds.forEach((messageId) => {\n if (scheduledIds!.includes(messageId)) {\n scheduledIds = scheduledIds!.filter((id) => id !== messageId);\n }\n });\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', scheduledIds);\n }\n\n global = replaceScheduledMessages(global, chatId, newById);\n\n return global;\n}\n\nexport function updateListedIds(\n global: GlobalState,\n chatId: string,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const listedIds = selectListedIds(global, chatId, threadId);\n const newIds = listedIds?.length\n ? idsUpdate.filter((id) => !listedIds.includes(id))\n : idsUpdate;\n\n if (listedIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'listedIds', orderHistoryIds([\n ...(listedIds || []),\n ...newIds,\n ]));\n}\n\nexport function updateOutlyingIds(\n global: GlobalState,\n chatId: string,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const newIds = outlyingIds?.length\n ? idsUpdate.filter((id) => !outlyingIds.includes(id))\n : idsUpdate;\n\n if (outlyingIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'outlyingIds', orderHistoryIds([\n ...(outlyingIds || []),\n ...newIds,\n ]));\n}\n\nfunction orderHistoryIds(listedIds: number[]) {\n return listedIds.sort((a, b) => a - b);\n}\n\nexport function addViewportId(\n global: GlobalState,\n chatId: string,\n threadId: number,\n newId: number,\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n if (viewportIds.includes(newId)) {\n return global;\n }\n\n const newIds = orderHistoryIds([\n ...(\n viewportIds.length < MESSAGE_LIST_VIEWPORT_LIMIT\n ? viewportIds\n : viewportIds.slice(-(MESSAGE_LIST_SLICE / 2))\n ),\n newId,\n ]);\n\n return replaceThreadParam(global, chatId, threadId, 'viewportIds', newIds);\n}\n\nexport function safeReplaceViewportIds(\n global: GlobalState,\n chatId: string,\n threadId: number,\n newViewportIds: number[],\n): GlobalState {\n const currentIds = selectViewportIds(global, chatId, threadId) || [];\n const newIds = orderHistoryIds(newViewportIds);\n\n return replaceThreadParam(\n global,\n chatId,\n threadId,\n 'viewportIds',\n areSortedArraysEqual(currentIds, newIds) ? currentIds : newIds,\n );\n}\n\nexport function updateThreadInfo(\n global: GlobalState, chatId: string, threadId: number, update: Partial | undefined,\n): GlobalState {\n const newThreadInfo = {\n ...(selectThreadInfo(global, chatId, threadId) as ApiThreadInfo),\n ...update,\n };\n\n if (!newThreadInfo.threadId) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'threadInfo', newThreadInfo);\n}\n\nexport function updateThreadInfos(\n global: GlobalState, chatId: string, updates: Partial[],\n): GlobalState {\n updates.forEach((update) => {\n global = updateThreadInfo(global, update.chatId!, update.threadId!, update);\n });\n\n return global;\n}\n\nexport function replaceScheduledMessages(\n global: GlobalState, chatId: string, newById: Record,\n): GlobalState {\n return updateScheduledMessages(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateScheduledMessages(\n global: GlobalState, chatId: string, update: Partial<{ byId: Record }>,\n): GlobalState {\n const current = global.scheduledMessages.byChatId[chatId] || { byId: {}, hash: 0 };\n\n return {\n ...global,\n scheduledMessages: {\n byChatId: {\n ...global.scheduledMessages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateFocusedMessage(\n global: GlobalState, chatId?: string, messageId?: number, noHighlight = false, isResizingContainer = false,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n chatId,\n messageId,\n noHighlight,\n isResizingContainer,\n },\n };\n}\n\nexport function updateSponsoredMessage(\n global: GlobalState, chatId: string, message: ApiSponsoredMessage,\n): GlobalState {\n return {\n ...global,\n messages: {\n ...global.messages,\n sponsoredByChatId: {\n ...global.messages.sponsoredByChatId,\n [chatId]: message,\n },\n },\n };\n}\n\nexport function updateFocusDirection(\n global: GlobalState, direction?: FocusDirection,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n direction,\n },\n };\n}\n\nexport function enterMessageSelectMode(\n global: GlobalState,\n chatId: string,\n messageId?: number | number[],\n): GlobalState {\n const messageIds = messageId ? Array.prototype.concat([], messageId) : [];\n return {\n ...global,\n selectedMessages: {\n chatId,\n messageIds,\n },\n };\n}\n\nexport function toggleMessageSelection(\n global: GlobalState,\n chatId: string,\n threadId: number,\n messageListType: MessageListType,\n messageId: number,\n groupedId?: string,\n childMessageIds?: number[],\n withShift = false,\n): GlobalState {\n const { selectedMessages: oldSelectedMessages } = global;\n if (groupedId) {\n childMessageIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n }\n const selectedMessageIds = childMessageIds || [messageId];\n if (!oldSelectedMessages) {\n return enterMessageSelectMode(global, chatId, selectedMessageIds);\n }\n\n const { messageIds } = oldSelectedMessages;\n\n let newMessageIds;\n const newSelectedMessageIds = selectedMessageIds.filter((id) => !messageIds.includes(id));\n if (newSelectedMessageIds && !newSelectedMessageIds.length) {\n newMessageIds = messageIds.filter((id) => !selectedMessageIds.includes(id));\n } else if (withShift && messageIds.length) {\n const viewportIds = selectCurrentMessageIds(global, chatId, threadId, messageListType)!;\n const prevIndex = viewportIds.indexOf(messageIds[messageIds.length - 1]);\n const currentIndex = viewportIds.indexOf(messageId);\n const from = Math.min(prevIndex, currentIndex);\n const to = Math.max(prevIndex, currentIndex);\n const slice = viewportIds.slice(from, to + 1);\n newMessageIds = unique([...messageIds, ...slice]);\n } else {\n newMessageIds = [...messageIds, ...newSelectedMessageIds];\n }\n\n if (!newMessageIds.length) {\n return exitMessageSelectMode(global);\n }\n\n return {\n ...global,\n selectedMessages: {\n ...oldSelectedMessages,\n messageIds: newMessageIds,\n },\n };\n}\n\nexport function exitMessageSelectMode(global: GlobalState): GlobalState {\n return {\n ...global,\n selectedMessages: undefined,\n };\n}\n\nexport function updateThreadUnreadFromForwardedMessage(\n global: GlobalState,\n originMessage: ApiMessage,\n chatId: string,\n lastMessageId: number,\n isDeleting?: boolean,\n) {\n const { channelPostId, fromChatId } = originMessage.forwardInfo || {};\n if (channelPostId && fromChatId) {\n const threadInfoOld = selectThreadInfo(global, chatId, channelPostId);\n if (threadInfoOld) {\n global = replaceThreadParam(global, chatId, channelPostId, 'threadInfo', {\n ...threadInfoOld,\n lastMessageId,\n messagesCount: threadInfoOld.messagesCount + (isDeleting ? -1 : 1),\n });\n }\n }\n return global;\n}\n","import { ApiChat, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport {\n getPrivateChatUserId, isChatChannel, isUserId, isHistoryClearMessage, isUserBot, isUserOnline,\n} from '../helpers';\nimport { selectUser } from './users';\nimport {\n ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE, SERVICE_NOTIFICATIONS_USER_ID,\n} from '../../config';\n\nexport function selectChat(global: GlobalState, chatId: string): ApiChat | undefined {\n return global.chats.byId[chatId];\n}\n\nexport function selectChatUser(global: GlobalState, chat: ApiChat) {\n const userId = getPrivateChatUserId(chat);\n if (!userId) {\n return false;\n }\n\n return selectUser(global, userId);\n}\n\nexport function selectIsChatWithSelf(global: GlobalState, chatId: string) {\n return chatId === global.currentUserId;\n}\n\nexport function selectIsChatWithBot(global: GlobalState, chat: ApiChat) {\n const user = selectChatUser(global, chat);\n return user && isUserBot(user);\n}\n\nexport function selectSupportChat(global: GlobalState) {\n return Object.values(global.chats.byId).find(({ isSupport }: ApiChat) => isSupport);\n}\n\nexport function selectChatOnlineCount(global: GlobalState, chat: ApiChat) {\n if (isUserId(chat.id) || isChatChannel(chat) || !chat.fullInfo) {\n return undefined;\n }\n\n if (!chat.fullInfo.members || chat.fullInfo.members.length === MEMBERS_LOAD_SLICE) {\n return chat.fullInfo.onlineCount;\n }\n\n return chat.fullInfo.members.reduce((onlineCount, { userId }) => {\n if (\n userId !== global.currentUserId\n && global.users.byId[userId]\n && isUserOnline(global.users.byId[userId], global.users.statusesById[userId])\n ) {\n return onlineCount + 1;\n }\n\n return onlineCount;\n }, 0);\n}\n\nexport function selectChatBot(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n const userId = chat && getPrivateChatUserId(chat);\n const user = userId && selectUser(global, userId);\n if (!user || !isUserBot(user)) {\n return undefined;\n }\n\n return user;\n}\n\nexport function selectIsChatBotNotStarted(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n const bot = selectChatBot(global, chatId);\n if (!chat || !bot) {\n return false;\n }\n\n if (chat.lastMessage && isHistoryClearMessage(chat.lastMessage)) {\n return true;\n }\n\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return false;\n }\n\n const { listedIds } = messageInfo.threadsById[MAIN_THREAD_ID] || {};\n return listedIds && !listedIds.length;\n}\n\nexport function selectAreActiveChatsLoaded(global: GlobalState): boolean {\n return Boolean(global.chats.listIds.active);\n}\n\nexport function selectIsChatListed(global: GlobalState, chatId: string, type?: 'active' | 'archived'): boolean {\n const { listIds } = global.chats;\n if (type) {\n const targetList = listIds[type];\n return Boolean(targetList && targetList.includes(chatId));\n }\n\n return Object.values(listIds).some((list) => list && list.includes(chatId));\n}\n\nexport function selectChatListType(global: GlobalState, chatId: string): 'active' | 'archived' | undefined {\n const chat = selectChat(global, chatId);\n if (!chat || !selectIsChatListed(global, chatId)) {\n return undefined;\n }\n\n return chat.folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n}\n\nexport function selectChatFolder(global: GlobalState, folderId: number) {\n return global.chatFolders.byId[folderId];\n}\n\nexport function selectTotalChatCount(global: GlobalState, listType: 'active' | 'archived'): number {\n const { totalCount } = global.chats;\n const allChatsCount = totalCount.all;\n const archivedChatsCount = totalCount.archived || 0;\n\n if (listType === 'archived') {\n return archivedChatsCount;\n }\n\n return allChatsCount ? allChatsCount - archivedChatsCount : 0;\n}\n\nexport function selectIsChatPinned(global: GlobalState, chatId: string, folderId = ALL_FOLDER_ID): boolean {\n const { active, archived } = global.chats.orderedPinnedIds;\n\n if (folderId === ALL_FOLDER_ID) {\n return Boolean(active?.includes(chatId));\n }\n\n if (folderId === ARCHIVED_FOLDER_ID) {\n return Boolean(archived?.includes(chatId));\n }\n\n const { byId: chatFoldersById } = global.chatFolders;\n\n const { pinnedChatIds } = chatFoldersById[folderId] || {};\n return Boolean(pinnedChatIds?.includes(chatId));\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectChatByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.chats.byId).find(\n (chat) => chat.username && chat.username.toLowerCase() === usernameLowered,\n );\n}\n\nexport function selectIsServiceChatReady(global: GlobalState) {\n return Boolean(selectChat(global, SERVICE_NOTIFICATIONS_USER_ID));\n}\n\nexport function selectSendAs(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n if (!chat) return undefined;\n\n const id = chat?.fullInfo?.sendAsId;\n if (!id) return undefined;\n\n return selectUser(global, id) || selectChat(global, id);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker } from '../../api/types';\n\nexport function selectIsStickerFavorite(global: GlobalState, sticker: ApiSticker) {\n const { stickers } = global.stickers.favorite;\n return stickers && stickers.some(({ id }) => id === sticker.id);\n}\n\nexport function selectCurrentStickerSearch(global: GlobalState) {\n return global.stickers.search;\n}\n\nexport function selectCurrentGifSearch(global: GlobalState) {\n return global.gifs.search;\n}\n\nexport function selectStickerSet(global: GlobalState, id: string) {\n return global.stickers.setsById[id];\n}\n\nexport function selectStickerSetByShortName(global: GlobalState, shortName: string) {\n return Object.values(global.stickers.setsById).find((l) => l.shortName.toLowerCase() === shortName.toLowerCase());\n}\n\nexport function selectStickersForEmoji(global: GlobalState, emoji: string) {\n const stickerSets = Object.values(global.stickers.setsById);\n let stickersForEmoji: ApiSticker[] = [];\n // Favorites\n global.stickers.favorite.stickers.forEach((sticker) => {\n if (sticker.emoji === emoji) stickersForEmoji.push(sticker);\n });\n\n // Added sets\n stickerSets.forEach(({ packs }) => {\n if (!packs) {\n return;\n }\n\n stickersForEmoji = stickersForEmoji.concat(packs[emoji] || [], packs[cleanEmoji(emoji)] || []);\n });\n return stickersForEmoji;\n}\n\nfunction cleanEmoji(emoji: string) {\n // Some emojis (❤️ for example) with a service symbol 'VARIATION SELECTOR-16' are not recognized as animated\n return emoji.replace('\\ufe0f', '');\n}\n\nexport function selectAnimatedEmoji(global: GlobalState, emoji: string) {\n const { animatedEmojis } = global;\n if (!animatedEmojis || !animatedEmojis.stickers) {\n return undefined;\n }\n\n const cleanedEmoji = cleanEmoji(emoji);\n\n return animatedEmojis.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\n}\n\nexport function selectAnimatedEmojiEffect(global: GlobalState, emoji: string) {\n const { animatedEmojiEffects } = global;\n if (!animatedEmojiEffects || !animatedEmojiEffects.stickers) {\n return undefined;\n }\n\n const cleanedEmoji = cleanEmoji(emoji);\n\n return animatedEmojiEffects.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\n}\n\nexport function selectAnimatedEmojiSound(global: GlobalState, emoji: string) {\n return global?.appConfig?.emojiSounds[cleanEmoji(emoji)];\n}\n\nexport function selectLocalAnimatedEmoji(global: GlobalState, emoji: string) {\n const cleanedEmoji = cleanEmoji(emoji);\n\n return cleanedEmoji === '🍑' ? 'Peach' : (cleanedEmoji === '🍆' ? 'Eggplant' : undefined);\n}\n\nexport function selectLocalAnimatedEmojiEffect(emoji: string) {\n return emoji === 'Eggplant' ? 'Cumshot' : undefined;\n}\n\nexport function selectLocalAnimatedEmojiEffectByName(name: string) {\n return name === 'Cumshot' ? '🍆' : undefined;\n}\n","import { GlobalState, MessageListType, Thread } from '../../global/types';\nimport {\n ApiChat,\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID } from '../../config';\nimport {\n selectChat, selectIsChatWithBot, selectIsChatWithSelf,\n} from './chats';\nimport { selectIsUserOrChatContact, selectUser } from './users';\nimport {\n getSendingState,\n isChatChannel,\n isMessageLocal,\n isUserId,\n isForwardedMessage,\n getCanPostInChat,\n isUserRightBanned,\n getHasAdminRight,\n isChatBasicGroup,\n isCommonBoxChat,\n isServiceNotificationMessage,\n isOwnMessage,\n isActionMessage,\n isChatGroup,\n isChatSuperGroup,\n getMessageVideo,\n getMessageWebPageVideo,\n getMessagePhoto,\n getMessageAudio,\n getMessageVoice,\n getMessageDocument,\n getMessageWebPagePhoto,\n} from '../helpers';\nimport { findLast } from '../../util/iteratees';\nimport { selectIsStickerFavorite } from './symbols';\nimport { getServerTime } from '../../util/serverTime';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\n\nconst MESSAGE_EDIT_ALLOWED_TIME = 172800; // 48 hours\n\nexport function selectCurrentMessageList(global: GlobalState) {\n const { messageLists } = global.messages;\n\n if (messageLists.length) {\n return messageLists[messageLists.length - 1];\n }\n\n return undefined;\n}\n\nexport function selectCurrentChat(global: GlobalState) {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n return chatId ? selectChat(global, chatId) : undefined;\n}\n\nexport function selectChatMessages(global: GlobalState, chatId: string) {\n return global.messages.byChatId[chatId]?.byId;\n}\n\nexport function selectScheduledMessages(global: GlobalState, chatId: string) {\n return global.scheduledMessages.byChatId[chatId]?.byId;\n}\n\nexport function selectThreadParam(\n global: GlobalState,\n chatId: string,\n threadId: number,\n key: K,\n) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const thread = messageInfo.threadsById[threadId];\n if (!thread) {\n return undefined;\n }\n\n return thread[key];\n}\n\nexport function selectListedIds(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'listedIds');\n}\n\nexport function selectOutlyingIds(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'outlyingIds');\n}\n\nexport function selectCurrentMessageIds(\n global: GlobalState, chatId: string, threadId: number, messageListType: MessageListType,\n) {\n switch (messageListType) {\n case 'thread':\n return selectViewportIds(global, chatId, threadId);\n case 'pinned':\n return selectPinnedIds(global, chatId);\n case 'scheduled':\n return selectScheduledIds(global, chatId);\n }\n\n return undefined;\n}\n\nexport function selectViewportIds(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'viewportIds');\n}\n\nexport function selectPinnedIds(global: GlobalState, chatId: string) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds');\n}\n\nexport function selectScheduledIds(global: GlobalState, chatId: string) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds');\n}\n\nexport function selectScrollOffset(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'scrollOffset');\n}\n\nexport function selectReplyingToId(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyingToId');\n}\n\nexport function selectEditingId(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'editingId');\n}\n\nexport function selectEditingScheduledId(global: GlobalState, chatId: string) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'editingScheduledId');\n}\n\nexport function selectDraft(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'draft');\n}\n\nexport function selectNoWebPage(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'noWebPage');\n}\n\nexport function selectThreadInfo(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'threadInfo');\n}\n\nexport function selectFirstMessageId(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'firstMessageId');\n}\n\nexport function selectReplyStack(global: GlobalState, chatId: string, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyStack');\n}\n\nexport function selectThreadOriginChat(global: GlobalState, chatId: string, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return selectChat(global, chatId);\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return selectChat(global, threadInfo.originChannelId || chatId);\n}\n\nexport function selectThreadTopMessageId(global: GlobalState, chatId: string, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return undefined;\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return threadInfo.topMessageId;\n}\n\nexport function selectThreadByMessage(global: GlobalState, chatId: string, message: ApiMessage) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const { replyToMessageId, replyToTopMessageId } = message;\n if (!replyToMessageId && !replyToTopMessageId) {\n return undefined;\n }\n\n return Object.values(messageInfo.threadsById).find((thread) => {\n return thread.threadInfo && (\n (replyToMessageId && replyToMessageId === thread.threadInfo.topMessageId)\n || (replyToTopMessageId && replyToTopMessageId === thread.threadInfo.topMessageId)\n );\n });\n}\n\nexport function isMessageInCurrentMessageList(global: GlobalState, chatId: string, message: ApiMessage) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return false;\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n return (\n chatId === currentMessageList.chatId\n && (\n (currentMessageList.threadId === MAIN_THREAD_ID)\n || (threadInfo && currentMessageList.threadId === threadInfo.threadId)\n )\n );\n}\n\nexport function selectIsViewportNewest(global: GlobalState, chatId: string, threadId: number) {\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!viewportIds || !viewportIds.length) {\n return true;\n }\n\n let lastMessageId: number;\n\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return true;\n }\n\n lastMessageId = chat.lastMessage.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo || !threadInfo.lastMessageId) {\n return undefined;\n }\n\n lastMessageId = threadInfo.lastMessageId;\n }\n\n // Edge case: outgoing `lastMessage` is updated with a delay to optimize animation\n if (lastMessageId >= LOCAL_MESSAGE_ID_BASE && !selectChatMessage(global, chatId, lastMessageId)) {\n return true;\n }\n\n return viewportIds[viewportIds.length - 1] >= lastMessageId;\n}\n\nexport function selectChatMessage(global: GlobalState, chatId: string, messageId: number) {\n const chatMessages = selectChatMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectScheduledMessage(global: GlobalState, chatId: string, messageId: number) {\n const chatMessages = selectScheduledMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectEditingMessage(\n global: GlobalState, chatId: string, threadId: number, messageListType: MessageListType,\n) {\n if (messageListType === 'scheduled') {\n const messageId = selectEditingScheduledId(global, chatId);\n return messageId ? selectScheduledMessage(global, chatId, messageId) : undefined;\n } else {\n const messageId = selectEditingId(global, chatId, threadId);\n return messageId ? selectChatMessage(global, chatId, messageId) : undefined;\n }\n}\n\nexport function selectChatMessageByPollId(global: GlobalState, pollId: string) {\n let messageWithPoll: ApiMessage | undefined;\n\n // eslint-disable-next-line no-restricted-syntax\n for (const chatMessages of Object.values(global.messages.byChatId)) {\n const { byId } = chatMessages;\n messageWithPoll = Object.values(byId).find((message) => {\n return message.content.poll && message.content.poll.id === pollId;\n });\n if (messageWithPoll) {\n break;\n }\n }\n\n return messageWithPoll;\n}\n\nexport function selectFocusedMessageId(global: GlobalState, chatId: string) {\n const { chatId: focusedChatId, messageId } = global.focusedMessage || {};\n\n return focusedChatId === chatId ? messageId : undefined;\n}\n\nexport function selectIsMessageFocused(global: GlobalState, message: ApiMessage) {\n const focusedId = selectFocusedMessageId(global, message.chatId);\n\n return focusedId ? focusedId === message.id || focusedId === message.previousLocalId : false;\n}\n\nexport function selectIsMessageUnread(global: GlobalState, message: ApiMessage) {\n const { lastReadOutboxMessageId } = selectChat(global, message.chatId) || {};\n return isMessageLocal(message) || !lastReadOutboxMessageId || lastReadOutboxMessageId < message.id;\n}\n\nexport function selectOutgoingStatus(\n global: GlobalState, message: ApiMessage, isScheduledList = false,\n): ApiMessageOutgoingStatus {\n if (!selectIsMessageUnread(global, message) && !isScheduledList) {\n return 'read';\n }\n\n return getSendingState(message);\n}\n\nexport function selectSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n return isUserId(senderId) ? selectUser(global, senderId) : selectChat(global, senderId);\n}\n\nexport function selectForwardedSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { forwardInfo } = message;\n if (!forwardInfo) {\n return undefined;\n }\n\n if (forwardInfo.isChannelPost && forwardInfo.fromChatId) {\n return selectChat(global, forwardInfo.fromChatId);\n } else if (forwardInfo.senderUserId) {\n return selectUser(global, forwardInfo.senderUserId) || selectChat(global, forwardInfo.senderUserId);\n }\n\n return undefined;\n}\n\nexport function selectAllowedMessageActions(global: GlobalState, message: ApiMessage, threadId: number) {\n const chat = selectChat(global, message.chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n const isPrivate = isUserId(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, message.chatId);\n const isBasicGroup = isChatBasicGroup(chat);\n const isSuperGroup = isChatSuperGroup(chat);\n const isChannel = isChatChannel(chat);\n const isLocal = isMessageLocal(message);\n const isServiceNotification = isServiceNotificationMessage(message);\n const isOwn = isOwnMessage(message);\n const isAction = isActionMessage(message);\n const { content } = message;\n\n const canEditMessagesIndefinitely = isChatWithSelf\n || (isSuperGroup && getHasAdminRight(chat, 'pinMessages'))\n || (isChannel && getHasAdminRight(chat, 'editMessages'));\n const isMessageEditable = (\n (\n canEditMessagesIndefinitely\n || getServerTime(global.serverTimeOffset) - message.date < MESSAGE_EDIT_ALLOWED_TIME\n ) && !(\n content.sticker || content.contact || content.poll || content.action || content.audio\n || (content.video?.isRound)\n )\n && !isForwardedMessage(message)\n && !message.viaBotId\n );\n\n const canReply = !isLocal && !isServiceNotification && getCanPostInChat(chat, threadId);\n\n const hasPinPermission = isPrivate || (\n chat.isCreator\n || (!isChannel && !isUserRightBanned(chat, 'pinMessages'))\n || getHasAdminRight(chat, 'pinMessages')\n );\n\n let canPin = !isLocal && !isServiceNotification && !isAction && hasPinPermission;\n let canUnpin = false;\n\n const pinnedMessageIds = selectPinnedIds(global, chat.id);\n\n if (canPin) {\n canUnpin = Boolean(pinnedMessageIds && pinnedMessageIds.includes(message.id));\n canPin = !canUnpin;\n }\n\n const canDelete = !isLocal && !isServiceNotification && (\n isPrivate\n || isOwn\n || isBasicGroup\n || chat.isCreator\n || getHasAdminRight(chat, 'deleteMessages')\n );\n\n const canReport = !isPrivate && !isOwn;\n\n const canDeleteForAll = canDelete && (\n (isPrivate && !isChatWithSelf)\n || (isBasicGroup && (\n isOwn || getHasAdminRight(chat, 'deleteMessages') || chat.isCreator\n ))\n );\n\n const canEdit = !isLocal && !isAction && isMessageEditable && (\n isOwn\n || (isChannel && (chat.isCreator || getHasAdminRight(chat, 'editMessages')))\n );\n\n const canForward = !isLocal && !isAction;\n\n const hasSticker = Boolean(message.content.sticker);\n const hasFavoriteSticker = hasSticker && selectIsStickerFavorite(global, message.content.sticker!);\n const canFaveSticker = !isAction && hasSticker && !hasFavoriteSticker;\n const canUnfaveSticker = !isAction && hasFavoriteSticker;\n const canCopy = !isAction;\n const canCopyLink = !isAction && (isChannel || isSuperGroup);\n const canSelect = !isAction;\n\n const canDownload = Boolean(content.webPage?.document || content.webPage?.video || content.webPage?.photo\n || content.audio || content.voice || content.photo || content.video || content.document || content.sticker);\n\n const noOptions = [\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canReport,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n ].every((ability) => !ability);\n\n return {\n noOptions,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canReport,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n canDownload,\n };\n}\n\n// This selector always returns a new object which can not be safely used in shallow-equal checks\nexport function selectCanDeleteSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return {};\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return {\n canDelete: messageActions.every((actions) => actions.canDelete),\n canDeleteForAll: messageActions.every((actions) => actions.canDeleteForAll),\n };\n}\n\nexport function selectCanReportSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return false;\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return messageActions.every((actions) => actions.canReport);\n}\n\nexport function selectCanDownloadSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return false;\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return messageActions.some((actions) => actions.canDownload);\n}\n\nexport function selectIsDownloading(global: GlobalState, message: ApiMessage) {\n const activeInChat = global.activeDownloads.byChatId[message.chatId];\n return activeInChat ? activeInChat.includes(message.id) : false;\n}\n\nexport function selectActiveDownloadIds(global: GlobalState, chatId: string) {\n return global.activeDownloads.byChatId[chatId] || MEMO_EMPTY_ARRAY;\n}\n\nexport function selectUploadProgress(global: GlobalState, message: ApiMessage) {\n return global.fileUploads.byMessageLocalId[message.previousLocalId || message.id]?.progress;\n}\n\nexport function selectRealLastReadId(global: GlobalState, chatId: string, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n // `lastReadInboxMessageId` is empty for new chats\n if (!chat.lastReadInboxMessageId) {\n return undefined;\n }\n\n if (!chat.lastMessage) {\n return chat.lastReadInboxMessageId;\n }\n\n if (isMessageLocal(chat.lastMessage)) {\n return chat.lastMessage.id;\n }\n\n // Some previously read messages may be deleted\n return Math.min(chat.lastMessage.id, chat.lastReadInboxMessageId);\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n if (!threadInfo.lastReadInboxMessageId) {\n return threadInfo.topMessageId;\n }\n\n // Some previously read messages may be deleted\n return Math.min(threadInfo.lastReadInboxMessageId, threadInfo.lastMessageId || Infinity);\n }\n}\n\nexport function selectFirstUnreadId(global: GlobalState, chatId: string, threadId: number) {\n const chat = selectChat(global, chatId);\n\n if (threadId === MAIN_THREAD_ID) {\n if (!chat) {\n return undefined;\n }\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo\n || (threadInfo.lastMessageId !== undefined && threadInfo.lastMessageId === threadInfo.lastReadInboxMessageId)) {\n return undefined;\n }\n }\n\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const byId = selectChatMessages(global, chatId);\n if (!byId || !(outlyingIds || listedIds)) {\n return undefined;\n }\n\n const lastReadId = selectRealLastReadId(global, chatId, threadId);\n if (!lastReadId && chat && chat.isNotJoined) {\n return undefined;\n }\n\n const lastReadServiceNotificationId = chatId === SERVICE_NOTIFICATIONS_USER_ID\n ? global.serviceNotifications.reduce((max, notification) => {\n return !notification.isUnread && notification.id > max ? notification.id : max;\n }, -1)\n : -1;\n\n function findAfterLastReadId(listIds: number[]) {\n return listIds.find((id) => {\n return (\n (!lastReadId || id > lastReadId)\n && byId[id]\n && (!byId[id].isOutgoing || byId[id].isFromScheduled)\n && id > lastReadServiceNotificationId\n );\n });\n }\n\n if (outlyingIds) {\n const found = findAfterLastReadId(outlyingIds);\n if (found) {\n return found;\n }\n }\n\n if (listedIds) {\n const found = findAfterLastReadId(listedIds);\n if (found) {\n return found;\n }\n }\n\n return undefined;\n}\n\nexport function selectIsPollResultsOpen(global: GlobalState) {\n const { pollResults } = global;\n return Boolean(pollResults.messageId);\n}\n\nexport function selectIsForwardModalOpen(global: GlobalState) {\n const { forwardMessages } = global;\n return Boolean(forwardMessages.isModalShown);\n}\n\nexport function selectCommonBoxChatId(global: GlobalState, messageId: number) {\n const fromLastMessage = Object.values(global.chats.byId).find((chat) => (\n isCommonBoxChat(chat) && chat.lastMessage && chat.lastMessage.id === messageId\n ));\n if (fromLastMessage) {\n return fromLastMessage.id;\n }\n\n const { byChatId } = global.messages;\n return Object.keys(byChatId).find((chatId) => {\n const chat = selectChat(global, chatId);\n return chat && isCommonBoxChat(chat) && byChatId[chat.id].byId[messageId];\n });\n}\n\nexport function selectIsInSelectMode(global: GlobalState) {\n const { selectedMessages } = global;\n\n return Boolean(selectedMessages);\n}\n\nexport function selectIsMessageSelected(global: GlobalState, messageId: number) {\n const { messageIds } = global.selectedMessages || {};\n if (!messageIds) {\n return false;\n }\n\n return messageIds.includes(messageId);\n}\n\nexport function selectForwardedMessageIdsByGroupId(global: GlobalState, chatId: string, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.values(chatMessages)\n .filter((message) => message.groupedId === groupedId && message.forwardInfo)\n .map(({ forwardInfo }) => forwardInfo!.fromMessageId);\n}\n\nexport function selectMessageIdsByGroupId(global: GlobalState, chatId: string, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.keys(chatMessages)\n .map(Number)\n .filter((id) => chatMessages[id].groupedId === groupedId);\n}\n\nexport function selectIsDocumentGroupSelected(global: GlobalState, chatId: string, groupedId: string) {\n const { messageIds: selectedIds } = global.selectedMessages || {};\n if (!selectedIds) {\n return false;\n }\n\n const groupIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n return groupIds && groupIds.every((id) => selectedIds.includes(id));\n}\n\nexport function selectSelectedMessagesCount(global: GlobalState) {\n const { messageIds } = global.selectedMessages || {};\n\n return messageIds ? messageIds.length : 0;\n}\n\nexport function selectNewestMessageWithBotKeyboardButtons(\n global: GlobalState, chatId: string,\n): ApiMessage | undefined {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (!selectIsChatWithBot(global, chat)) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, MAIN_THREAD_ID);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const messageId = findLast(viewportIds, (id) => {\n return !chatMessages[id].isOutgoing && Boolean(chatMessages[id].keyboardButtons);\n });\n\n const replyHideMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id].shouldHideKeyboardButtons);\n });\n\n if (messageId && replyHideMessageId && replyHideMessageId > messageId) {\n return undefined;\n }\n\n return messageId ? chatMessages[messageId] : undefined;\n}\n\nexport function selectCanAutoLoadMedia(global: GlobalState, message: ApiMessage) {\n const chat = selectChat(global, message.chatId);\n if (!chat) {\n return undefined;\n }\n\n const sender = selectSender(global, message);\n\n const isPhoto = Boolean(getMessagePhoto(message) || getMessageWebPagePhoto(message));\n const isVideo = Boolean(getMessageVideo(message) || getMessageWebPageVideo(message));\n const isFile = Boolean(getMessageAudio(message) || getMessageVoice(message) || getMessageDocument(message));\n\n const {\n canAutoLoadPhotoFromContacts,\n canAutoLoadPhotoInPrivateChats,\n canAutoLoadPhotoInGroups,\n canAutoLoadPhotoInChannels,\n canAutoLoadVideoFromContacts,\n canAutoLoadVideoInPrivateChats,\n canAutoLoadVideoInGroups,\n canAutoLoadVideoInChannels,\n canAutoLoadFileFromContacts,\n canAutoLoadFileInPrivateChats,\n canAutoLoadFileInGroups,\n canAutoLoadFileInChannels,\n } = global.settings.byKey;\n\n if (isPhoto) {\n return canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts: canAutoLoadPhotoFromContacts,\n canAutoLoadMediaInPrivateChats: canAutoLoadPhotoInPrivateChats,\n canAutoLoadMediaInGroups: canAutoLoadPhotoInGroups,\n canAutoLoadMediaInChannels: canAutoLoadPhotoInChannels,\n });\n }\n\n if (isVideo) {\n return canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts: canAutoLoadVideoFromContacts,\n canAutoLoadMediaInPrivateChats: canAutoLoadVideoInPrivateChats,\n canAutoLoadMediaInGroups: canAutoLoadVideoInGroups,\n canAutoLoadMediaInChannels: canAutoLoadVideoInChannels,\n });\n }\n\n if (isFile) {\n return canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts: canAutoLoadFileFromContacts,\n canAutoLoadMediaInPrivateChats: canAutoLoadFileInPrivateChats,\n canAutoLoadMediaInGroups: canAutoLoadFileInGroups,\n canAutoLoadMediaInChannels: canAutoLoadFileInChannels,\n });\n }\n\n return true;\n}\n\nfunction canAutoLoadMedia({\n global,\n chat,\n sender,\n canAutoLoadMediaFromContacts,\n canAutoLoadMediaInPrivateChats,\n canAutoLoadMediaInGroups,\n canAutoLoadMediaInChannels,\n}: {\n global: GlobalState;\n chat: ApiChat;\n canAutoLoadMediaFromContacts: boolean;\n canAutoLoadMediaInPrivateChats: boolean;\n canAutoLoadMediaInGroups: boolean;\n canAutoLoadMediaInChannels: boolean;\n sender?: ApiChat | ApiUser;\n}) {\n const isMediaFromContact = Boolean(sender && (\n sender.id === global.currentUserId || selectIsUserOrChatContact(global, sender)\n ));\n\n return Boolean(\n (isMediaFromContact && canAutoLoadMediaFromContacts)\n || (!isMediaFromContact && canAutoLoadMediaInPrivateChats && isUserId(chat.id))\n || (canAutoLoadMediaInGroups && isChatGroup(chat))\n || (canAutoLoadMediaInChannels && isChatChannel(chat)),\n );\n}\n\nexport function selectCanAutoPlayMedia(global: GlobalState, message: ApiMessage) {\n const video = getMessageVideo(message) || getMessageWebPageVideo(message);\n if (!video) {\n return undefined;\n }\n\n const {\n canAutoPlayVideos,\n canAutoPlayGifs,\n } = global.settings.byKey;\n\n const asGif = video.isGif || video.isRound;\n\n return (canAutoPlayVideos && !asGif) || (canAutoPlayGifs && asGif);\n}\n\nexport function selectShouldLoopStickers(global: GlobalState) {\n return global.settings.byKey.shouldLoopStickers;\n}\n\nexport function selectLastServiceNotification(global: GlobalState) {\n const { serviceNotifications } = global;\n const maxId = Math.max(...serviceNotifications.map(({ id }) => id));\n\n return serviceNotifications.find(({ id }) => id === maxId);\n}\n\nexport function selectIsMessageProtected(global: GlobalState, message?: ApiMessage) {\n return message ? message.isProtected || selectChat(global, message.chatId)?.isProtected : false;\n}\n\nexport function selectHasProtectedMessage(global: GlobalState, chatId: string, messageIds?: number[]) {\n if (selectChat(global, chatId)?.isProtected) {\n return true;\n }\n\n if (!messageIds) {\n return false;\n }\n\n const messages = selectChatMessages(global, chatId);\n\n return messageIds.some((messageId) => messages[messageId]?.isProtected);\n}\n\nexport function selectSponsoredMessage(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n const message = chat && isChatChannel(chat) ? global.messages.sponsoredByChatId[chatId] : undefined;\n\n return message && message.expiresAt >= Math.round(Date.now() / 1000) ? message : undefined;\n}\n\nexport function selectDefaultReaction(global: GlobalState, chatId: string) {\n if (chatId === SERVICE_NOTIFICATIONS_USER_ID) return undefined;\n\n const isPrivate = isUserId(chatId);\n const defaultReaction = global.appConfig?.defaultReaction;\n const { availableReactions } = global;\n if (!defaultReaction || !availableReactions?.some(\n (l) => l.reaction === defaultReaction && !l.isInactive,\n )) {\n return undefined;\n }\n\n if (isPrivate) {\n return defaultReaction;\n }\n\n const enabledReactions = selectChat(global, chatId)?.fullInfo?.enabledReactions;\n if (!enabledReactions?.includes(defaultReaction)) {\n return undefined;\n }\n\n return defaultReaction;\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectVisibleUsers(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const messageIds = selectThreadParam(global, chatId, threadId, 'viewportIds');\n if (!messageIds) {\n return undefined;\n }\n\n return messageIds.map((messageId) => {\n const { senderId } = selectChatMessage(global, chatId, messageId) || {};\n return senderId ? selectUser(global, senderId) : undefined;\n }).filter(Boolean);\n}\n","import { GlobalState } from '../../global/types';\nimport { selectCurrentMessageList } from './messages';\nimport { buildChatThreadKey } from '../helpers';\n\nexport function selectCurrentTextSearch(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const currentSearch = global.localTextSearch.byChatThreadKey[chatThreadKey];\n if (!currentSearch || !currentSearch.isActive) {\n return undefined;\n }\n\n return currentSearch;\n}\n\nexport function selectCurrentMediaSearch(global: GlobalState) {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return undefined;\n }\n\n return global.localMediaSearch.byChatId[chatId];\n}\n","import { GlobalState } from '../../global/types';\n\nimport { selectCurrentMessageList } from './messages';\nimport { selectChat } from './chats';\nimport { isChatGroup, isUserId } from '../helpers';\n\nexport function selectManagement(global: GlobalState, chatId: string) {\n return global.management.byChatId[chatId];\n}\n\nexport function selectCurrentManagement(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const currentManagement = global.management.byChatId[chatId];\n if (!currentManagement || !currentManagement.isActive) {\n return undefined;\n }\n\n return currentManagement;\n}\n\nexport function selectCurrentManagementType(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n if (isUserId(chatId)) {\n return 'user';\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (isChatGroup(chat)) {\n return 'group';\n }\n\n return 'channel';\n}\n","import { GlobalState } from '../../global/types';\nimport { NewChatMembersProgress, RightColumnContent } from '../../types';\n\nimport { getSystemTheme, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { selectCurrentMessageList, selectIsPollResultsOpen } from './messages';\nimport { selectCurrentTextSearch } from './localSearch';\nimport { selectCurrentGifSearch, selectCurrentStickerSearch } from './symbols';\nimport { selectCurrentManagement } from './management';\n\nexport function selectIsMediaViewerOpen(global: GlobalState) {\n const { mediaViewer } = global;\n return Boolean(mediaViewer.messageId || mediaViewer.avatarOwnerId);\n}\n\nexport function selectRightColumnContentKey(global: GlobalState) {\n return selectIsPollResultsOpen(global) ? (\n RightColumnContent.PollResults\n ) : !IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global) ? (\n RightColumnContent.Search\n ) : selectCurrentManagement(global) ? (\n RightColumnContent.Management\n ) : selectCurrentStickerSearch(global).query !== undefined ? (\n RightColumnContent.StickerSearch\n ) : selectCurrentGifSearch(global).query !== undefined ? (\n RightColumnContent.GifSearch\n ) : global.newChatMembersProgress !== NewChatMembersProgress.Closed ? (\n RightColumnContent.AddingMembers\n ) : global.isChatInfoShown && selectCurrentMessageList(global) ? (\n RightColumnContent.ChatInfo\n ) : undefined;\n}\n\nexport function selectIsRightColumnShown(global: GlobalState) {\n return selectRightColumnContentKey(global) !== undefined;\n}\n\nexport function selectTheme(global: GlobalState) {\n const { theme, shouldUseSystemTheme } = global.settings.byKey;\n\n return shouldUseSystemTheme ? getSystemTheme() : theme;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectCurrentGlobalSearchQuery(global: GlobalState) {\n return global.globalSearch.query;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectPaymentChatId(global: GlobalState) {\n return global.payment.chatId;\n}\n\nexport function selectPaymentMessageId(global: GlobalState) {\n return global.payment.messageId;\n}\n\nexport function selectPaymentFormId(global: GlobalState) {\n return global.payment.formId;\n}\n\nexport function selectPaymentRequestId(global: GlobalState) {\n return global.payment.requestId;\n}\n\nexport function selectProviderPublishableKey(global: GlobalState) {\n return global.payment.nativeParams?.publishableKey;\n}\n\nexport function selectProviderPublicToken(global: GlobalState) {\n return global.payment.nativeParams?.publicToken;\n}\n\nexport function selectStripeCredentials(global: GlobalState) {\n return global.payment.stripeCredentials;\n}\n\nexport function selectSmartGlocalCredentials(global: GlobalState) {\n return global.payment.smartGlocalCredentials;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectNotifySettings(global: GlobalState) {\n return global.settings.byKey;\n}\n\nexport function selectNotifyExceptions(global: GlobalState) {\n return global.settings.notifyExceptions;\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser, ApiUserStatus } from '../../api/types';\n\nexport function selectUser(global: GlobalState, userId: string): ApiUser | undefined {\n return global.users.byId[userId];\n}\n\nexport function selectUserStatus(global: GlobalState, userId: string): ApiUserStatus | undefined {\n return global.users.statusesById[userId];\n}\n\nexport function selectIsUserBlocked(global: GlobalState, userId: string) {\n const user = selectUser(global, userId);\n\n return user?.fullInfo?.isBlocked;\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectUserByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.users.byId).find(\n (user) => user.username.toLowerCase() === usernameLowered,\n );\n}\n\nexport function selectIsUserOrChatContact(global: GlobalState, userOrChat: ApiUser | ApiChat) {\n return global.contactList && global.contactList.userIds.includes(userOrChat.id);\n}\n","import {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm,\n ApiChatInviteImporter,\n ApiExportedInvite,\n ApiLanguage, ApiMessage, ApiShippingAddress, ApiStickerSet,\n} from '../api/types';\n\nexport enum LoadMoreDirection {\n Backwards,\n Forwards,\n Around,\n}\n\nexport enum FocusDirection {\n Up,\n Down,\n Static,\n}\n\nexport interface IAlbum {\n albumId: string;\n messages: ApiMessage[];\n mainMessage: ApiMessage;\n}\n\nexport type ThemeKey = 'light' | 'dark';\n\nexport interface IThemeSettings {\n background?: string;\n backgroundColor?: string;\n patternColor?: string;\n isBlurred?: boolean;\n}\n\nexport type NotifySettings = {\n hasPrivateChatsNotifications?: boolean;\n hasPrivateChatsMessagePreview?: boolean;\n hasGroupNotifications?: boolean;\n hasGroupMessagePreview?: boolean;\n hasBroadcastNotifications?: boolean;\n hasBroadcastMessagePreview?: boolean;\n hasContactJoinedNotifications?: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\nexport type LangCode = (\n 'en' | 'ar' | 'be' | 'ca' | 'nl' | 'fr' | 'de' | 'id' | 'it' | 'ko' | 'ms' | 'fa' | 'pl' | 'pt-br' | 'ru' | 'es'\n | 'tr' | 'uk' | 'uz'\n);\n\nexport type TimeFormat = '24h' | '12h';\n\nexport interface ISettings extends NotifySettings, Record {\n theme: ThemeKey;\n shouldUseSystemTheme: boolean;\n messageTextSize: number;\n animationLevel: 0 | 1 | 2;\n messageSendKeyCombo: 'enter' | 'ctrl-enter';\n canAutoLoadPhotoFromContacts: boolean;\n canAutoLoadPhotoInPrivateChats: boolean;\n canAutoLoadPhotoInGroups: boolean;\n canAutoLoadPhotoInChannels: boolean;\n canAutoLoadVideoFromContacts: boolean;\n canAutoLoadVideoInPrivateChats: boolean;\n canAutoLoadVideoInGroups: boolean;\n canAutoLoadVideoInChannels: boolean;\n canAutoLoadFileFromContacts: boolean;\n canAutoLoadFileInPrivateChats: boolean;\n canAutoLoadFileInGroups: boolean;\n canAutoLoadFileInChannels: boolean;\n autoLoadFileMaxSizeMb: number;\n canAutoPlayGifs: boolean;\n canAutoPlayVideos: boolean;\n shouldSuggestStickers: boolean;\n shouldLoopStickers: boolean;\n hasPassword?: boolean;\n languages?: ApiLanguage[];\n language: LangCode;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n timeFormat: TimeFormat;\n wasTimeFormatSetManually: boolean;\n isConnectionStatusMinimized: boolean;\n}\n\nexport interface ApiPrivacySettings {\n visibility: PrivacyVisibility;\n allowUserIds: string[];\n allowChatIds: string[];\n blockUserIds: string[];\n blockChatIds: string[];\n}\n\nexport interface InputPrivacyContact {\n id: string;\n accessHash?: string;\n}\n\nexport interface InputPrivacyRules {\n visibility: PrivacyVisibility;\n allowedUsers?: InputPrivacyContact[];\n allowedChats?: InputPrivacyContact[];\n blockedUsers?: InputPrivacyContact[];\n blockedChats?: InputPrivacyContact[];\n}\n\nexport type IAnchorPosition = {\n x: number;\n y: number;\n};\n\nexport interface ShippingOption {\n id: string;\n title: string;\n amount: number;\n prices: Price[];\n}\n\nexport interface Price {\n label: string;\n amount: number;\n}\n\nexport interface Invoice {\n currency?: string;\n emailRequested?: boolean;\n emailToProvider?: boolean;\n flexible?: boolean;\n nameRequested?: boolean;\n phoneRequested?: boolean;\n phoneToProvider?: boolean;\n prices?: Price[];\n shippingAddressRequested?: boolean;\n test?: boolean;\n}\n\nexport interface Receipt {\n currency: string;\n prices: Price[];\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n totalAmount: number;\n credentialsTitle: string;\n shippingPrices?: Price[];\n shippingMethod?: string;\n photoUrl?: string;\n text?: string;\n title?: string;\n}\n\nexport enum SettingsScreens {\n Main,\n EditProfile,\n Notifications,\n DataStorage,\n Language,\n General,\n GeneralChatBackground,\n GeneralChatBackgroundColor,\n Privacy,\n PrivacyPhoneNumber,\n PrivacyLastSeen,\n PrivacyProfilePhoto,\n PrivacyForwarding,\n PrivacyGroupChats,\n PrivacyPhoneNumberAllowedContacts,\n PrivacyPhoneNumberDeniedContacts,\n PrivacyLastSeenAllowedContacts,\n PrivacyLastSeenDeniedContacts,\n PrivacyProfilePhotoAllowedContacts,\n PrivacyProfilePhotoDeniedContacts,\n PrivacyForwardingAllowedContacts,\n PrivacyForwardingDeniedContacts,\n PrivacyGroupChatsAllowedContacts,\n PrivacyGroupChatsDeniedContacts,\n PrivacyActiveSessions,\n PrivacyBlockedUsers,\n Folders,\n FoldersCreateFolder,\n FoldersEditFolder,\n FoldersEditFolderFromChatList,\n FoldersIncludedChats,\n FoldersIncludedChatsFromChatList,\n FoldersExcludedChats,\n FoldersExcludedChatsFromChatList,\n TwoFaDisabled,\n TwoFaNewPassword,\n TwoFaNewPasswordConfirm,\n TwoFaNewPasswordHint,\n TwoFaNewPasswordEmail,\n TwoFaNewPasswordEmailCode,\n TwoFaEnabled,\n TwoFaChangePasswordCurrent,\n TwoFaChangePasswordNew,\n TwoFaChangePasswordConfirm,\n TwoFaChangePasswordHint,\n TwoFaTurnOff,\n TwoFaRecoveryEmailCurrentPassword,\n TwoFaRecoveryEmail,\n TwoFaRecoveryEmailCode,\n TwoFaCongratulations,\n QuickReaction,\n}\n\nexport type StickerSetOrRecent = Pick;\n\nexport enum LeftColumnContent {\n ChatList,\n GlobalSearch,\n Settings,\n Contacts,\n Archived,\n NewChannelStep1,\n NewChannelStep2,\n NewGroupStep1,\n NewGroupStep2,\n}\n\nexport enum GlobalSearchContent {\n ChatList,\n Media,\n Links,\n Files,\n Music,\n Voice,\n}\n\nexport enum RightColumnContent {\n ChatInfo,\n Search,\n Management,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nexport enum MediaViewerOrigin {\n Inline,\n ScheduledInline,\n SharedMedia,\n ProfileAvatar,\n SettingsAvatar,\n MiddleHeaderAvatar,\n Album,\n ScheduledAlbum,\n SearchResult,\n}\n\nexport enum AudioOrigin {\n Inline,\n SharedMedia,\n Search,\n}\n\nexport enum ChatCreationProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ProfileEditProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ManagementProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport interface ManagementState {\n isActive: boolean;\n nextScreen?: ManagementScreens;\n isUsernameAvailable?: boolean;\n error?: string;\n invites?: ApiExportedInvite[];\n revokedInvites?: ApiExportedInvite[];\n editingInvite?: ApiExportedInvite;\n inviteInfo?: {\n invite: ApiExportedInvite;\n importers?: ApiChatInviteImporter[];\n requesters?: ApiChatInviteImporter[];\n };\n}\n\nexport enum NewChatMembersProgress {\n Closed,\n InProgress,\n Loading,\n}\n\nexport type ProfileTabType = 'members' | 'commonChats' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\nexport type SharedMediaType = 'media' | 'documents' | 'links' | 'audio' | 'voice';\nexport type ApiPrivacyKey = 'phoneNumber' | 'lastSeen' | 'profilePhoto' | 'forwards' | 'chatInvite';\nexport type PrivacyVisibility = 'everybody' | 'contacts' | 'nonContacts' | 'nobody';\n\nexport enum ProfileState {\n Profile,\n SharedMedia,\n MemberList,\n}\n\nexport enum PaymentStep {\n ShippingInfo,\n Shipping,\n PaymentInfo,\n Checkout,\n ConfirmPayment,\n}\n\nexport const UPLOADING_WALLPAPER_SLUG = 'UPLOADING_WALLPAPER_SLUG';\n\nexport enum ManagementScreens {\n Initial,\n ChatPrivacyType,\n Discussion,\n ChannelSubscribers,\n GroupType,\n GroupPermissions,\n GroupRemovedUsers,\n ChannelRemovedUsers,\n GroupUserPermissionsCreate,\n GroupUserPermissions,\n ChatAdministrators,\n GroupRecentActions,\n ChatAdminRights,\n ChatNewAdminRights,\n GroupMembers,\n GroupAddAdmins,\n Invites,\n EditInvite,\n Reactions,\n InviteInfo,\n JoinRequests,\n}\n\nexport type ManagementType = 'user' | 'group' | 'channel';\n\nexport type NotifyException = {\n isMuted: boolean;\n isSilent?: boolean;\n shouldShowPreviews?: boolean;\n};\n\nexport type EmojiKeywords = {\n isLoading?: boolean;\n version: number;\n keywords: Record;\n};\n\nexport type InlineBotSettings = {\n id: string;\n help?: string;\n query?: string;\n offset?: string;\n canLoadMore?: boolean;\n results?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n isGallery?: boolean;\n switchPm?: ApiBotInlineSwitchPm;\n};\n","import { fastRaf } from './schedulers';\n\ninterface AnimationInstance {\n isCancelled: boolean;\n}\n\nlet currentInstance: AnimationInstance | undefined;\n\nexport function animateSingle(tick: Function, instance?: AnimationInstance) {\n if (!instance) {\n if (currentInstance && !currentInstance.isCancelled) {\n currentInstance.isCancelled = true;\n }\n\n instance = { isCancelled: false };\n currentInstance = instance;\n }\n\n if (!instance!.isCancelled && tick()) {\n fastRaf(() => {\n animateSingle(tick, instance);\n });\n }\n}\n\nexport function animate(tick: Function) {\n if (tick()) {\n fastRaf(() => {\n animate(tick);\n });\n }\n}\n\nexport type TimingFn = (t: number) => number;\n\nexport type AnimateNumberProps = {\n to: number | number[];\n from: number | number[];\n duration: number;\n onUpdate: (value: any) => void;\n timing?: TimingFn;\n onEnd?: () => void;\n};\n\nexport const timingFunctions = {\n linear: (t: number) => t,\n easeIn: (t: number) => t ** 1.675,\n easeOut: (t: number) => 1 - (1 - t ** 1.675),\n easeInOut: (t: number) => 0.5 * (Math.sin((t - 0.5) * Math.PI) + 1),\n easeInQuad: (t: number) => t * t,\n easeOutQuad: (t: number) => t * (2 - t),\n easeInOutQuad: (t: number) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t),\n easeInCubic: (t: number) => t * t * t,\n easeOutCubic: (t: number) => (--t) * t * t + 1,\n easeInOutCubic: (t: number) => (t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),\n easeInQuart: (t: number) => t * t * t * t,\n easeOutQuart: (t: number) => 1 - (--t) * t * t * t,\n easeInOutQuart: (t: number) => (t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t),\n easeInQuint: (t: number) => t * t * t * t * t,\n easeOutQuint: (t: number) => 1 + (--t) * t * t * t * t,\n easeInOutQuint: (t: number) => (t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t),\n};\n\nexport function animateNumber({\n timing = timingFunctions.linear,\n onUpdate,\n duration,\n onEnd,\n from,\n to,\n}: AnimateNumberProps) {\n const t0 = Date.now();\n let canceled = false;\n\n animate(() => {\n if (canceled) return false;\n const t1 = Date.now();\n let t = (t1 - t0) / duration;\n if (t > 1) t = 1;\n const progress = timing(t);\n if (typeof from === 'number' && typeof to === 'number') {\n onUpdate(from + ((to - from) * progress));\n } else if (Array.isArray(from) && Array.isArray(to)) {\n const result = from.map((f, i) => f + ((to[i] - f) * progress));\n onUpdate(result);\n }\n if (t === 1 && onEnd) onEnd();\n return t < 1;\n });\n\n return () => {\n canceled = true;\n if (onEnd) onEnd();\n };\n}\n","import { DEBUG } from '../config';\n\nexport function updateAppBadge(unreadCount: number) {\n if (typeof window.navigator.setAppBadge !== 'function') {\n return;\n }\n\n window.navigator.setAppBadge(unreadCount).catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n}\n","export default function arePropsShallowEqual(currentProps: AnyLiteral, newProps: AnyLiteral) {\n if (currentProps === newProps) {\n return true;\n }\n\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return false;\n }\n\n if (currentKeysLength === 0) {\n return true;\n }\n\n for (let i = 0; i < currentKeysLength; i++) {\n const prop = currentKeys[i];\n if (currentProps[prop] !== newProps[prop]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function getUnequalProps(currentProps: AnyLiteral, newProps: AnyLiteral) {\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return ['%LENGTH%'];\n }\n\n return currentKeys.reduce((res, prop) => {\n if (currentProps[prop] !== newProps[prop]) {\n res.push(`${prop}: ${currentProps[prop]} => ${newProps[prop]}`);\n }\n\n return res;\n }, [] as string[]);\n}\n","type Parts = (string | false | undefined)[];\ntype PartsWithGlobals = (string | false | undefined | string[])[];\n\nexport default function buildClassName(...parts: Parts) {\n return parts.filter(Boolean).join(' ');\n}\n\nexport function createClassNameBuilder(componentName: string) {\n return (elementName: string, ...modifiers: PartsWithGlobals) => {\n const baseName = elementName === '&' ? componentName : `${componentName}__${elementName}`;\n\n return modifiers.reduce((acc, modifier) => {\n if (modifier) {\n // A bit hacky way to pass global class names\n if (Array.isArray(modifier)) {\n acc.push(...modifier);\n } else {\n acc.push(`${baseName}--${modifier}`);\n }\n }\n\n return acc;\n }, [baseName]).join(' ');\n };\n}\n","// eslint-disable-next-line no-restricted-globals\nconst cacheApi = self.caches;\n\nexport enum Type {\n Text,\n Blob,\n Json,\n}\n\nexport async function fetch(\n cacheName: string, key: string, type: Type, isHtmlAllowed = false,\n) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const cache = await cacheApi.open(cacheName);\n const response = await cache.match(request);\n if (!response) {\n return undefined;\n }\n\n const contentType = response.headers.get('Content-Type');\n\n switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n // Ignore deprecated data-uri avatars\n if (key.startsWith('avatar') && contentType && contentType.startsWith('text')) {\n return undefined;\n }\n\n const blob = await response.blob();\n const shouldRecreate = !blob.type || (!isHtmlAllowed && blob.type.includes('html'));\n // iOS Safari fails to preserve `type` in cache\n let resolvedType = blob.type || contentType;\n\n if (!(shouldRecreate && resolvedType)) {\n return blob;\n }\n\n // Prevent HTML-in-video attacks (for files that were cached before fix)\n if (!isHtmlAllowed) {\n resolvedType = resolvedType.replace(/html/gi, '');\n }\n\n return new Blob([blob], { type: resolvedType });\n }\n case Type.Json:\n return await response.json();\n default:\n return undefined;\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function save(cacheName: string, key: string, data: AnyLiteral | Blob | string) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n const cacheData = typeof data === 'string' || data instanceof Blob ? data : JSON.stringify(data);\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const response = new Response(cacheData);\n const cache = await cacheApi.open(cacheName);\n return await cache.put(request, response);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function clear(cacheName: string) {\n try {\n if (!cacheApi) {\n return undefined;\n }\n\n return await cacheApi.delete(cacheName);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n","export function createCallbackManager() {\n const callbacks: AnyToVoidFunction[] = [];\n\n function addCallback(cb: AnyToVoidFunction) {\n callbacks.push(cb);\n\n return () => {\n removeCallback(cb);\n };\n }\n\n function removeCallback(cb: AnyToVoidFunction) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n }\n\n function runCallbacks(...args: any[]) {\n callbacks.forEach((callback) => {\n callback(...args);\n });\n }\n\n function hasCallbacks() {\n return Boolean(callbacks.length);\n }\n\n return {\n runCallbacks,\n addCallback,\n removeCallback,\n hasCallbacks,\n };\n}\n\nexport type CallbackManager = ReturnType;\n","import captureKeyboardListener from './captureKeyboardListeners';\n\ntype IHandlerFunction = () => void;\n\nexport default function captureEscKeyListener(handler: IHandlerFunction) {\n return captureKeyboardListener({ onEsc: handler });\n}\n","type HandlerName = 'onEnter' | 'onBackspace' | 'onDelete' | 'onEsc' | 'onUp' | 'onDown' | 'onLeft' | 'onRight'\n| 'onTab';\ntype Handler = (e: KeyboardEvent) => void;\ntype CaptureOptions = Partial>;\n\nconst keyToHandlerName: Record = {\n Enter: 'onEnter',\n Backspace: 'onBackspace',\n Delete: 'onDelete',\n Esc: 'onEsc',\n Escape: 'onEsc',\n ArrowUp: 'onUp',\n ArrowDown: 'onDown',\n ArrowLeft: 'onLeft',\n ArrowRight: 'onRight',\n Tab: 'onTab',\n};\n\nconst handlers: Record = {\n onEnter: [],\n onDelete: [],\n onBackspace: [],\n onEsc: [],\n onUp: [],\n onDown: [],\n onLeft: [],\n onRight: [],\n onTab: [],\n};\n\nexport default function captureKeyboardListeners(options: CaptureOptions) {\n if (!hasActiveHandlers()) {\n document.addEventListener('keydown', handleKeyDown, true);\n }\n\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n if (!handler) {\n return;\n }\n\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n currentEventHandlers.push(handler);\n }\n });\n\n return () => {\n releaseKeyboardListener(options);\n };\n}\n\nfunction hasActiveHandlers() {\n return Object.values(handlers).some((keyHandlers) => Boolean(keyHandlers.length));\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n const handlerName = keyToHandlerName[e.key];\n if (!handlerName) {\n return;\n }\n\n const { length } = handlers[handlerName];\n if (!length) {\n return;\n }\n e.stopPropagation();\n\n const handler = handlers[handlerName][length - 1];\n handler!(e);\n}\n\nfunction releaseKeyboardListener(options: CaptureOptions) {\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n const index = currentEventHandlers.findIndex((cb) => cb === handler);\n if (index !== -1) {\n currentEventHandlers.splice(index, 1);\n }\n }\n });\n\n if (!hasActiveHandlers()) {\n document.removeEventListener('keydown', handleKeyDown, false);\n }\n}\n","import { LangFn } from '../hooks/useLang';\n\nconst WEEKDAYS_FULL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst MONTHS_FULL = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December',\n];\n\nconst MONTHS_FULL_LOWERCASE = MONTHS_FULL.map((month) => month.toLowerCase());\nconst MIN_SEARCH_YEAR = 2015;\nconst MAX_DAY_IN_MONTH = 31;\nconst MAX_MONTH_IN_YEAR = 12;\nexport const MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\n\nexport function isToday(date: Date) {\n return getDayStart(new Date()) === getDayStart(date);\n}\n\nexport function getDayStart(datetime: number | Date) {\n const date = new Date(datetime);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\nexport function getDayStartAt(datetime: number | Date) {\n return getDayStart(datetime).getTime();\n}\n\nexport function toYearMonth(timestamp: number) {\n const date = new Date(timestamp * 1000);\n return `${date.getFullYear()}-${date.getMonth()}`;\n}\n\nfunction toIsoString(date: Date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}\n\n// @optimization `toLocaleTimeString` is avoided because of bad performance\nexport function formatTime(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const timeFormat = lang.timeFormat || '24h';\n\n let hours = date.getHours();\n let marker = '';\n if (timeFormat === '12h') {\n marker = hours >= 12 ? ' PM' : ' AM';\n hours = hours > 12 ? hours % 12 : hours;\n }\n\n return `${String(hours).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}${marker}`;\n}\n\nexport function formatPastTimeShort(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n if (date >= today) {\n return formatTime(lang, date);\n }\n\n const weekAgo = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n if (date >= weekAgo) {\n return lang(`Weekday.Short${WEEKDAYS_FULL[date.getDay()]}`);\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const format = (\n lang(withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n || (withYear ? 'd MMM yyyy' : 'd MMM')\n );\n\n return formatDate(lang, date, format);\n}\n\nexport function formatFullDate(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const format = lang('formatterYearMax') || 'dd.MM.yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatMonthAndYear(lang: LangFn, date: Date, isShort = false) {\n const format = lang(isShort ? 'formatterMonthYear2' : 'formatterMonthYear') || 'MMM yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatCountdown(\n lang: LangFn,\n msLeft: number,\n) {\n const days = Math.floor(msLeft / MILLISECONDS_IN_DAY);\n if (msLeft < 0) {\n return 0;\n } else if (days < 1) {\n return formatMediaDuration(msLeft / 1000);\n } else if (days < 7) {\n return lang('Days', days);\n } else if (days < 30) {\n return lang('Weeks', Math.floor(days / 7));\n } else if (days < 365) {\n return lang('Months', Math.floor(days / 30));\n } else {\n return lang('Years', Math.floor(days / 365));\n }\n}\n\nexport function formatHumanDate(\n lang: LangFn,\n datetime: number | Date,\n isShort = false,\n noWeekdays = false,\n isUpperFirst?: boolean,\n) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n\n if (!noWeekdays) {\n if (toIsoString(date) === toIsoString(today)) {\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(lang('Weekday.Today'));\n }\n\n const yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n if (toIsoString(date) === toIsoString(yesterday)) {\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(lang('Weekday.Yesterday'));\n }\n\n const weekAgo = new Date(today);\n const weekAhead = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n weekAhead.setDate(today.getDate() + 7);\n if (date >= weekAgo && date <= weekAhead) {\n const weekDay = WEEKDAYS_FULL[date.getDay()];\n const weekDayString = isShort ? lang(`Weekday.Short${weekDay}`) : lang(`Weekday.${weekDay}`);\n\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(weekDayString);\n }\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const formatKey = isShort\n ? (withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n : (withYear ? 'chatFullDate' : 'chatDate');\n const format = lang(formatKey) || 'd MMMM yyyy';\n\n return (isUpperFirst || !isShort ? upperFirst : lowerFirst)(formatDate(lang, date, format));\n}\n\nfunction formatDate(lang: LangFn, date: Date, format: string) {\n const day = date.getDate();\n const monthIndex = date.getMonth();\n\n return format\n .replace('LLLL', lang(MONTHS_FULL[monthIndex]))\n .replace('MMMM', lang(`Month.Gen${MONTHS_FULL[monthIndex]}`))\n .replace('MMM', lang(`Month.Short${MONTHS_FULL[monthIndex]}`))\n .replace('MM', String(monthIndex + 1).padStart(2, '0'))\n .replace('dd', String(day).padStart(2, '0'))\n .replace('d', String(day))\n .replace('yyyy', String(date.getFullYear()))\n // Workaround for https://bugs.telegram.org/c/5777\n .replace(/'de'/g, 'de');\n}\n\nexport function formatMediaDateTime(\n lang: LangFn,\n datetime: number | Date,\n isUpperFirst?: boolean,\n) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n return `${formatHumanDate(lang, date, true, undefined, isUpperFirst)}, ${formatTime(lang, date)}`;\n}\n\nexport function formatMediaDuration(duration: number, maxValue?: number) {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor((duration % 3600) / 60);\n const seconds = Math.floor(duration % 3600 % 60);\n\n const maxHours = maxValue ? Math.floor(maxValue / 3600) : 0;\n const maxMinutes = maxValue ? Math.floor((maxValue % 3600) / 60) : 0;\n let string = '';\n if (hours > 0 || maxHours > 0) {\n string += `${String(hours).padStart(2, '0')}:`;\n string += `${String(minutes).padStart(2, '0')}:`;\n } else if (maxMinutes >= 10) {\n string += `${String(minutes).padStart(2, '0')}:`;\n } else {\n string += `${String(minutes)}:`;\n }\n string += String(seconds).padStart(2, '0');\n\n return string;\n}\n\nexport function formatVoiceRecordDuration(durationInMs: number) {\n const parts = [];\n\n let milliseconds = durationInMs % 1000;\n durationInMs -= milliseconds;\n milliseconds = Math.floor(milliseconds / 10);\n\n durationInMs = Math.floor(durationInMs / 1000);\n const seconds = durationInMs % 60;\n durationInMs -= seconds;\n\n durationInMs = Math.floor(durationInMs / 60);\n const minutes = durationInMs % 60;\n durationInMs -= minutes;\n\n durationInMs = Math.floor(durationInMs / 60);\n const hours = durationInMs % 60;\n\n if (hours > 0) {\n parts.push(String(hours).padStart(2, '0'));\n }\n parts.push(String(minutes).padStart(hours > 0 ? 2 : 1, '0'));\n parts.push(String(seconds).padStart(2, '0'));\n\n return `${parts.join(':')},${String(milliseconds).padStart(2, '0')}`;\n}\n\nexport function formatDateToString(datetime: Date | number, locale = 'en-US') {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n );\n}\n\nexport function formatDateTimeToString(datetime: Date | number, locale = 'en-US') {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n );\n}\n\nfunction isValidDate(day: number, month: number, year = 2021): boolean {\n if (month > (MAX_MONTH_IN_YEAR - 1) || day > MAX_DAY_IN_MONTH) {\n return false;\n }\n const date = new Date(year, month, day);\n return !Number.isNaN(date.getTime()) && date.getDate() === day;\n}\n\nexport function parseDateString(query = ''): string | undefined {\n const matchStringDate = query.match(/\\d{1,2}\\s[a-zA-Z]{3,}/);\n const matchEuropeStringDate = query.match(/[a-zA-Z]{3,}\\s\\d{1,2}/);\n const matchNumberDate = query.match(/\\d{1,2}[./-]\\d{1,2}([./-]\\d{2,4})?/);\n if (!matchStringDate && !matchNumberDate && !matchEuropeStringDate) {\n return undefined;\n }\n\n if (matchNumberDate) {\n const [date, month, year] = query.split(/[./-]/).map(Number);\n return !(year && year < MIN_SEARCH_YEAR) && isValidDate(date, month - 1, year || undefined)\n ? `${year ? `${year}-` : ''}${String(month).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n }\n\n const dateParts = query.split(' ');\n const date = matchStringDate ? dateParts[0] : dateParts[1];\n const month = (matchStringDate ? dateParts[1] : dateParts[0]).toLowerCase();\n const monthIndex = MONTHS_FULL_LOWERCASE.findIndex((item) => item.startsWith(month));\n\n return monthIndex !== -1 && isValidDate(Number(date), monthIndex)\n ? `${String(monthIndex + 1).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n}\n\nexport function timestampPlusDay(timestamp: number) {\n return timestamp + MILLISECONDS_IN_DAY / 1000;\n}\n\nfunction lowerFirst(str: string) {\n return `${str[0].toLowerCase()}${str.slice(1)}`;\n}\n\nfunction upperFirst(str: string) {\n return `${str[0].toUpperCase()}${str.slice(1)}`;\n}\n","import EMOJI_REGEX from '../lib/twemojiRegex';\n\n// Due to the fact that emoji from Apple do not contain some characters, it is necessary to remove them from emoji-data\n// https://github.com/iamcal/emoji-data/issues/136\nconst EXCLUDE_EMOJIS = ['female_sign', 'male_sign', 'medical_symbol'];\n\nconst ISO_FLAGS_OFFSET = 127397;\n\nexport type EmojiRawData = typeof import('emoji-data-ios/emoji-data.json');\nexport type EmojiModule = { default: EmojiRawData };\n\nexport type EmojiData = {\n categories: Array;\n emojis: Record;\n};\n\n// Non-standard variations of emojis, used on some devices\nconst EMOJI_EXCEPTIONS: [string | RegExp, string][] = [\n [/\\u{1f3f3}\\u200d\\u{1f308}/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u{1f308}'], // 🏳‍🌈\n [/\\u{1f3f3}\\u200d\\u26a7\\ufe0f/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u26a7\\ufe0f'], // 🏳️‍⚧️\n [/\\u{1f937}\\u200d\\u2642[^\\ufe0f]/gu, '\\u{1f937}\\u200d\\u2642\\ufe0f'], // 🤷‍♂️\n];\n\nfunction unifiedToNative(unified: string) {\n const unicodes = unified.split('-');\n const codePoints = unicodes.map((i) => parseInt(i, 16));\n\n return String.fromCodePoint(...codePoints);\n}\n\nexport function fixNonStandardEmoji(text: string) {\n // Non-standard sequences typically parsed as separate emojis, so no need to fix text without any\n if (!text.match(EMOJI_REGEX)) return text;\n // eslint-disable-next-line no-restricted-syntax\n for (const [regex, replacement] of EMOJI_EXCEPTIONS) {\n text = text.replace(regex, replacement);\n }\n\n return text;\n}\n\nexport function nativeToUnified(emoji: string) {\n let code;\n\n if (emoji.length === 1) {\n code = emoji.charCodeAt(0).toString(16).padStart(4, '0');\n } else {\n const pairs = [];\n for (let i = 0; i < emoji.length; i++) {\n if (emoji.charCodeAt(i) >= 0xd800 && emoji.charCodeAt(i) <= 0xdbff) {\n if (emoji.charCodeAt(i + 1) >= 0xdc00 && emoji.charCodeAt(i + 1) <= 0xdfff) {\n pairs.push(\n (emoji.charCodeAt(i) - 0xd800) * 0x400\n + (emoji.charCodeAt(i + 1) - 0xdc00) + 0x10000,\n );\n }\n } else if (emoji.charCodeAt(i) < 0xd800 || emoji.charCodeAt(i) > 0xdfff) {\n pairs.push(emoji.charCodeAt(i));\n }\n }\n\n code = pairs.map((x) => x.toString(16).padStart(4, '0')).join('-');\n }\n\n return code;\n}\n\nexport function uncompressEmoji(data: EmojiRawData): EmojiData {\n const emojiData: EmojiData = { categories: [], emojis: {} };\n\n for (let i = 0; i < data.length; i += 2) {\n const category = {\n id: data[i][0],\n name: data[i][1],\n emojis: [],\n } as EmojiCategory;\n\n for (let j = 0; j < data[i + 1].length; j++) {\n const emojiRaw = data[i + 1][j];\n if (!EXCLUDE_EMOJIS.includes(emojiRaw[1][0])) {\n category.emojis.push(emojiRaw[1][0]);\n emojiData.emojis[emojiRaw[1][0]] = {\n id: emojiRaw[1][0],\n names: emojiRaw[1] as string[],\n native: unifiedToNative(emojiRaw[0] as string),\n image: (emojiRaw[0] as string).toLowerCase(),\n };\n }\n }\n\n emojiData.categories.push(category);\n }\n\n return emojiData;\n}\n\nexport function isoToEmoji(iso: string) {\n const code = iso.toUpperCase();\n\n if (!/^[A-Z]{2}$/.test(code)) return iso;\n const codePoints = [...code].map((c) => c.codePointAt(0)! + ISO_FLAGS_OFFSET);\n return String.fromCodePoint(...codePoints);\n}\n","export function ensureProtocol(url?: string) {\n if (!url) {\n return undefined;\n }\n\n // HTTP was chosen by default as a fix for https://bugs.telegram.org/c/10712.\n // It is also the default protocol in the official TDesktop client.\n return url.includes('://') ? url : `http://${url}`;\n}\n","let isWebpSupportedCache: boolean | undefined;\n\nexport function isWebpSupported() {\n return Boolean(isWebpSupportedCache);\n}\n\nfunction testWebp(): Promise {\n return new Promise((resolve) => {\n const webp = new Image();\n // eslint-disable-next-line max-len\n webp.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA';\n const handleLoadOrError = () => {\n resolve(webp.height === 2);\n };\n webp.onload = handleLoadOrError;\n webp.onerror = handleLoadOrError;\n });\n}\n\ntestWebp().then((hasWebp) => {\n isWebpSupportedCache = hasWebp;\n});\n","import { ThemeKey } from '../types';\n\nlet systemThemeCache: ThemeKey = (\n window.matchMedia?.('(prefers-color-scheme: dark)').matches\n) ? 'dark' : 'light';\n\nexport function getSystemTheme() {\n return systemThemeCache;\n}\n\nfunction handleSystemThemeChange(e: MediaQueryListEventMap['change']) {\n systemThemeCache = e.matches ? 'dark' : 'light';\n}\n\nconst mql = window.matchMedia('(prefers-color-scheme: dark)');\nif (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n} else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n}\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n IS_TEST,\n SUPPORTED_VIDEO_CONTENT_TYPES,\n VIDEO_MOV_TYPE,\n} from '../config';\n\nexport * from './environmentWebp';\n\nexport * from './environmentSystemTheme';\n\nexport function getPlatform() {\n const { userAgent, platform } = window.navigator;\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];\n const iosPlatforms = ['iPhone', 'iPad', 'iPod'];\n let os: 'macOS' | 'iOS' | 'Windows' | 'Android' | 'Linux' | undefined;\n\n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'macOS';\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS';\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } else if (/Android/.test(userAgent)) {\n os = 'Android';\n } else if (/Linux/.test(platform)) {\n os = 'Linux';\n }\n\n return os;\n}\n\nexport const PLATFORM_ENV = getPlatform();\nexport const IS_MAC_OS = PLATFORM_ENV === 'macOS';\nexport const IS_IOS = PLATFORM_ENV === 'iOS';\nexport const IS_ANDROID = PLATFORM_ENV === 'Android';\nexport const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\nexport const IS_PWA = (\n window.matchMedia('(display-mode: standalone)').matches\n || (window.navigator as any).standalone\n || document.referrer.includes('android-app://')\n);\n\nexport const IS_TOUCH_ENV = window.matchMedia('(pointer: coarse)').matches;\n// Keep in mind the landscape orientation\nexport const IS_SINGLE_COLUMN_LAYOUT = window.innerWidth <= MOBILE_SCREEN_MAX_WIDTH || (\n window.innerWidth <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && window.innerHeight <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n);\n// Special layout, 1 column while chat opened, 2 columns while collapsed\nexport const IS_TABLET_COLUMN_LAYOUT = !IS_SINGLE_COLUMN_LAYOUT && (\n window.innerWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n);\nexport const IS_VOICE_RECORDING_SUPPORTED = Boolean(\n navigator.mediaDevices && 'getUserMedia' in navigator.mediaDevices && (\n window.AudioContext || (window as any).webkitAudioContext\n ),\n);\nexport const IS_SMOOTH_SCROLL_SUPPORTED = 'scrollBehavior' in document.documentElement.style;\nexport const IS_EMOJI_SUPPORTED = PLATFORM_ENV && (IS_MAC_OS || IS_IOS);\nexport const IS_SERVICE_WORKER_SUPPORTED = 'serviceWorker' in navigator;\n// TODO Consider failed service worker\nexport const IS_PROGRESSIVE_SUPPORTED = IS_SERVICE_WORKER_SUPPORTED;\nexport const IS_STREAMING_SUPPORTED = 'MediaSource' in window;\nexport const IS_OPUS_SUPPORTED = Boolean((new Audio()).canPlayType('audio/ogg; codecs=opus'));\nexport const IS_CANVAS_FILTER_SUPPORTED = (\n !IS_TEST && 'filter' in (document.createElement('canvas').getContext('2d') || {})\n);\nexport const IS_REQUEST_FULLSCREEN_SUPPORTED = 'requestFullscreen' in document.createElement('div');\nexport const ARE_CALLS_SUPPORTED = !navigator.userAgent.includes('Firefox');\nexport const LAYERS_ANIMATION_NAME = IS_ANDROID ? 'slide-fade' : IS_IOS ? 'slide-layers' : 'push-slide';\n\nconst TEST_VIDEO = document.createElement('video');\n// `canPlayType(VIDEO_MOV_TYPE)` returns false negative at least for macOS Chrome and iOS Safari\nexport const IS_MOV_SUPPORTED = true;\n\nif (IS_MOV_SUPPORTED) SUPPORTED_VIDEO_CONTENT_TYPES.add(VIDEO_MOV_TYPE);\n\nexport const IS_WEBM_SUPPORTED = Boolean(TEST_VIDEO.canPlayType('video/webm; codecs=\"vp9\"').replace('no', ''))\n && !(IS_MAC_OS && IS_SAFARI); // Safari on MacOS has some issues with WebM\n\nexport const DPR = window.devicePixelRatio || 1;\n\nexport const MASK_IMAGE_DISABLED = true;\n\nexport const IS_COMPACT_MENU = !IS_TOUCH_ENV;\nexport const IS_SCROLL_PATCH_NEEDED = !IS_MAC_OS && !IS_IOS && !IS_ANDROID;\n\n// Smaller area reduces scroll jumps caused by `patchChromiumScroll`\nexport const MESSAGE_LIST_SENSITIVE_AREA = IS_SCROLL_PATCH_NEEDED ? 300 : 750;\n","import { pause } from './schedulers';\n\n// Polyfill for Safari: `File` is not available in web worker\nif (typeof File === 'undefined') {\n // eslint-disable-next-line no-global-assign, no-restricted-globals, func-names\n self.File = class extends Blob {\n name: string;\n\n constructor(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag) {\n if (options) {\n const { type, ...rest } = options;\n super(fileBits, { type });\n Object.assign(this, rest);\n } else {\n super(fileBits);\n }\n\n this.name = fileName;\n }\n } as typeof File;\n}\n\nexport function dataUriToBlob(dataUri: string) {\n const arr = dataUri.split(',');\n const mime = arr[0].match(/:(.*?);/)![1];\n const bstr = atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n\nexport function blobToDataUri(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent) => {\n const { result } = e.target || {};\n if (typeof result === 'string') {\n resolve(result);\n }\n\n reject(new Error('Failed to read blob'));\n };\n\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\nexport function blobToFile(blob: Blob, fileName: string) {\n return new File([blob], fileName, {\n lastModified: Date.now(),\n type: blob.type,\n });\n}\n\nexport function preloadImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = url;\n });\n}\n\nexport function preloadVideo(url: string): Promise {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.volume = 0;\n video.onloadedmetadata = () => resolve(video);\n video.onerror = reject;\n video.src = url;\n });\n}\n\nexport async function createPosterForVideo(url: string): Promise {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n new Promise((resolve, reject) => {\n video.onseeked = () => {\n if (!video.videoWidth || !video.videoHeight) {\n resolve(undefined);\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(video, 0, 0);\n resolve(canvas.toDataURL('image/jpeg'));\n };\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n }),\n ]);\n}\n\nexport async function fetchBlob(blobUrl: string) {\n const response = await fetch(blobUrl);\n return response.blob();\n}\n\nexport async function fetchFile(blobUrl: string, fileName: string) {\n const blob = await fetchBlob(blobUrl);\n return blobToFile(blob, fileName);\n}\n\nexport function imgToCanvas(img: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(img, 0, 0);\n\n return canvas;\n}\n","import { addCallback, addReducer, getGlobal } from '../lib/teact/teactn';\n\nimport { GlobalState } from '../global/types';\nimport { NotifyException, NotifySettings } from '../types';\nimport { ApiChat, ApiChatFolder, ApiUser } from '../api/types';\n\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, DEBUG } from '../config';\nimport { selectNotifySettings, selectNotifyExceptions } from '../modules/selectors';\nimport { selectIsChatMuted } from '../modules/helpers';\nimport { onIdle, throttle } from './schedulers';\nimport { areSortedArraysEqual, unique } from './iteratees';\nimport arePropsShallowEqual from './arePropsShallowEqual';\nimport { CallbackManager, createCallbackManager } from './callbacks';\n\ninterface FolderSummary {\n id: number;\n listIds?: Set;\n orderedPinnedIds?: string[];\n contacts?: true;\n nonContacts?: true;\n groups?: true;\n channels?: true;\n bots?: true;\n excludeMuted?: true;\n excludeRead?: true;\n excludeArchived?: true;\n excludedChatIds?: Set;\n includedChatIds?: Set;\n pinnedChatIds?: Set;\n}\n\ninterface ChatSummary {\n id: string;\n type: ApiChat['type'];\n isListed: boolean;\n isArchived: boolean;\n isMuted: boolean;\n isUnread: boolean;\n unreadCount?: number;\n unreadMentionsCount?: number;\n order: number;\n isUserBot?: boolean;\n isUserContact?: boolean;\n}\n\nconst UPDATE_THROTTLE = 500;\nconst DEBUG_DURATION_LIMIT = 6;\n\nconst initials = buildInitials();\n\nlet prevGlobal: {\n allFolderListIds?: GlobalState['chats']['listIds']['active'];\n allFolderPinnedIds?: GlobalState['chats']['orderedPinnedIds']['active'];\n archivedFolderListIds?: GlobalState['chats']['listIds']['archived'];\n archivedFolderPinnedIds?: GlobalState['chats']['orderedPinnedIds']['archived'];\n isAllFolderFullyLoaded?: boolean;\n isArchivedFolderFullyLoaded?: boolean;\n chatsById: Record;\n foldersById: Record;\n usersById: Record;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n} = initials.prevGlobal;\n\nlet prepared: {\n folderSummariesById: Record;\n chatSummariesById: Map;\n folderIdsByChatId: Record;\n chatIdsByFolderId: Record | undefined>;\n isOrderedListJustPatched: Record;\n} = initials.prepared;\n\nlet results: {\n orderedIdsByFolderId: Record;\n pinnedCountByFolderId: Record; // Also watched by `callbacks.orderedIdsByFolderId`\n chatsCountByFolderId: Record;\n unreadCountersByFolderId: Record;\n} = initials.results;\n\nlet callbacks: {\n orderedIdsByFolderId: Record;\n chatsCountByFolderId: CallbackManager;\n unreadCountersByFolderId: CallbackManager;\n} = initials.callbacks;\n\nconst updateFolderManagerThrottled = throttle(() => {\n onIdle(() => {\n updateFolderManager(getGlobal());\n });\n}, UPDATE_THROTTLE);\n\nlet inited = false;\n\n/* Getters */\n\nexport function init() {\n inited = true;\n\n addCallback(updateFolderManagerThrottled);\n addReducer('reset', reset);\n\n updateFolderManager(getGlobal());\n}\n\nexport function getOrderedIds(folderId: number) {\n if (!inited) init();\n\n return results.orderedIdsByFolderId[folderId];\n}\n\nexport function getPinnedChatsCount(folderId: number) {\n if (!inited) init();\n\n return results.pinnedCountByFolderId[folderId] || 0;\n}\n\nexport function getChatsCount() {\n if (!inited) init();\n\n return results.chatsCountByFolderId;\n}\n\nexport function getUnreadCounters() {\n if (!inited) init();\n\n return results.unreadCountersByFolderId;\n}\n\nexport function getAllNotificationsCount() {\n return getUnreadCounters()[ALL_FOLDER_ID]?.notificationsCount || 0;\n}\n\n/* Callback managers */\n\nexport function addOrderedIdsCallback(folderId: number, callback: (orderedIds: string[]) => void) {\n if (!callbacks.orderedIdsByFolderId[folderId]) {\n callbacks.orderedIdsByFolderId[folderId] = createCallbackManager();\n }\n\n return callbacks.orderedIdsByFolderId[folderId].addCallback(callback);\n}\n\nexport function addChatsCountCallback(callback: (chatsCount: typeof results.chatsCountByFolderId) => void) {\n return callbacks.chatsCountByFolderId.addCallback(callback);\n}\n\nexport function addUnreadCountersCallback(callback: (unreadCounters: typeof results.unreadCountersByFolderId) => void) {\n return callbacks.unreadCountersByFolderId.addCallback(callback);\n}\n\n/* Global update handlers */\n\nfunction updateFolderManager(global: GlobalState) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startedAt: number;\n if (DEBUG) {\n DEBUG_startedAt = performance.now();\n }\n\n const isAllFolderChanged = Boolean(\n global.chats.listIds.active\n && isMainFolderChanged(ALL_FOLDER_ID, global.chats.listIds.active, global.chats.orderedPinnedIds.active),\n );\n const isArchivedFolderChanged = Boolean(\n global.chats.listIds.archived\n && isMainFolderChanged(ARCHIVED_FOLDER_ID, global.chats.listIds.archived, global.chats.orderedPinnedIds.archived),\n );\n const isAllFullyLoadedChanged = global.chats.isFullyLoaded.active !== prevGlobal.isAllFolderFullyLoaded;\n const isArchivedFullyLoadedChanged = global.chats.isFullyLoaded.archived !== prevGlobal.isArchivedFolderFullyLoaded;\n\n const areFoldersChanged = global.chatFolders.byId !== prevGlobal.foldersById;\n const areChatsChanged = global.chats.byId !== prevGlobal.chatsById;\n const areUsersChanged = global.users.byId !== prevGlobal.usersById;\n const areNotifySettingsChanged = selectNotifySettings(global) !== prevGlobal.notifySettings;\n const areNotifyExceptionsChanged = selectNotifyExceptions(global) !== prevGlobal.notifyExceptions;\n\n let affectedFolderIds: number[] = [];\n\n if (isAllFullyLoadedChanged || isArchivedFullyLoadedChanged) {\n affectedFolderIds = affectedFolderIds.concat(\n updateFullyLoaded(global, isArchivedFullyLoadedChanged),\n );\n }\n\n if (!(\n isAllFolderChanged || isArchivedFolderChanged || areFoldersChanged\n || areChatsChanged || areUsersChanged || areNotifySettingsChanged || areNotifyExceptionsChanged\n )\n ) {\n if (affectedFolderIds.length) {\n updateResults(affectedFolderIds);\n }\n\n return;\n }\n\n const prevAllFolderListIds = prevGlobal.allFolderListIds;\n const prevArchivedFolderListIds = prevGlobal.archivedFolderListIds;\n\n updateFolders(global, isAllFolderChanged, isArchivedFolderChanged, areFoldersChanged);\n\n affectedFolderIds = affectedFolderIds.concat(updateChats(\n global, areFoldersChanged || isAllFolderChanged || isArchivedFolderChanged,\n areNotifySettingsChanged, areNotifyExceptionsChanged,\n prevAllFolderListIds, prevArchivedFolderListIds,\n ));\n\n updateResults(unique(affectedFolderIds));\n\n if (DEBUG) {\n const duration = performance.now() - DEBUG_startedAt!;\n if (duration > DEBUG_DURATION_LIMIT) {\n // eslint-disable-next-line no-console\n console.warn(`Slow \\`updateFolderManager\\`: ${Math.round(duration)} ms`);\n }\n }\n}\n\nfunction isMainFolderChanged(folderId: number, newListIds?: string[], newPinnedIds?: string[]) {\n const currentListIds = folderId === ALL_FOLDER_ID\n ? prevGlobal.allFolderListIds\n : prevGlobal.archivedFolderListIds;\n const currentPinnedIds = folderId === ALL_FOLDER_ID\n ? prevGlobal.allFolderPinnedIds\n : prevGlobal.archivedFolderPinnedIds;\n\n return currentListIds !== newListIds || currentPinnedIds !== newPinnedIds;\n}\n\nfunction updateFullyLoaded(\n global: GlobalState,\n isArchivedFullyLoadedChanged = false,\n) {\n let affectedFolderIds = [];\n\n if (isArchivedFullyLoadedChanged) {\n affectedFolderIds.push(ARCHIVED_FOLDER_ID);\n }\n\n const isAllFolderFullyLoaded = global.chats.isFullyLoaded.active;\n const isArchivedFolderFullyLoaded = global.chats.isFullyLoaded.archived;\n\n if (isAllFolderFullyLoaded && isArchivedFolderFullyLoaded) {\n const emptyFolderIds = Object.keys(prepared.folderSummariesById)\n .filter((folderId) => !results.orderedIdsByFolderId[folderId])\n .map(Number);\n\n affectedFolderIds = affectedFolderIds.concat(emptyFolderIds);\n }\n\n prevGlobal.isAllFolderFullyLoaded = isAllFolderFullyLoaded;\n prevGlobal.isArchivedFolderFullyLoaded = isArchivedFolderFullyLoaded;\n\n return affectedFolderIds;\n}\n\nfunction updateFolders(\n global: GlobalState, isAllFolderChanged: boolean, isArchivedFolderChanged: boolean, areFoldersChanged: boolean,\n) {\n const changedFolders = [];\n\n if (isAllFolderChanged) {\n const newListIds = global.chats.listIds.active!;\n const newPinnedIds = global.chats.orderedPinnedIds.active;\n\n prepared.folderSummariesById[ALL_FOLDER_ID] = buildFolderSummaryFromMainList(\n ALL_FOLDER_ID, newListIds, newPinnedIds,\n );\n\n prevGlobal.allFolderListIds = newListIds;\n prevGlobal.allFolderPinnedIds = newPinnedIds;\n\n changedFolders.push(ALL_FOLDER_ID);\n }\n\n if (isArchivedFolderChanged) {\n const newListIds = global.chats.listIds.archived!;\n const newPinnedIds = global.chats.orderedPinnedIds.archived;\n\n prepared.folderSummariesById[ARCHIVED_FOLDER_ID] = buildFolderSummaryFromMainList(\n ARCHIVED_FOLDER_ID, newListIds, newPinnedIds,\n );\n\n prevGlobal.archivedFolderListIds = newListIds;\n prevGlobal.archivedFolderPinnedIds = newPinnedIds;\n\n changedFolders.push(ARCHIVED_FOLDER_ID);\n }\n\n if (areFoldersChanged) {\n const newFoldersById = global.chatFolders.byId;\n\n Object.values(newFoldersById).forEach((folder) => {\n if (folder === prevGlobal.foldersById[folder.id]) {\n return;\n }\n\n prepared.folderSummariesById[folder.id] = buildFolderSummary(folder);\n\n changedFolders.push(folder.id);\n });\n\n prevGlobal.foldersById = newFoldersById;\n }\n\n return changedFolders;\n}\n\nfunction buildFolderSummaryFromMainList(\n folderId: number, listIds: string[], orderedPinnedIds?: string[],\n): FolderSummary {\n return {\n id: folderId,\n listIds: new Set(listIds),\n orderedPinnedIds: orderedPinnedIds,\n pinnedChatIds: new Set(orderedPinnedIds),\n };\n}\n\nfunction buildFolderSummary(folder: ApiChatFolder): FolderSummary {\n return {\n ...folder,\n orderedPinnedIds: folder.pinnedChatIds,\n excludedChatIds: folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined,\n includedChatIds: folder.excludedChatIds ? new Set(folder.includedChatIds) : undefined,\n pinnedChatIds: folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined,\n };\n}\n\nfunction updateChats(\n global: GlobalState,\n areFoldersChanged: boolean,\n areNotifySettingsChanged: boolean,\n areNotifyExceptionsChanged: boolean,\n prevAllFolderListIds?: string[],\n prevArchivedFolderListIds?: string[],\n) {\n const newChatsById = global.chats.byId;\n const newUsersById = global.users.byId;\n const newNotifySettings = selectNotifySettings(global);\n const newNotifyExceptions = selectNotifyExceptions(global);\n const folderSummaries = Object.values(prepared.folderSummariesById);\n const affectedFolderIds = new Set();\n\n const newAllFolderListIds = global.chats.listIds.active;\n const newArchivedFolderListIds = global.chats.listIds.archived;\n let allIds = [...newAllFolderListIds || [], ...newArchivedFolderListIds || []];\n if (newAllFolderListIds !== prevAllFolderListIds || newArchivedFolderListIds !== prevArchivedFolderListIds) {\n allIds = unique(allIds.concat(prevAllFolderListIds || [], prevArchivedFolderListIds || []));\n }\n\n allIds.forEach((chatId) => {\n const chat = newChatsById[chatId];\n\n if (\n !areFoldersChanged\n && !areNotifySettingsChanged\n && !areNotifyExceptionsChanged\n && chat === prevGlobal.chatsById[chatId]\n && newUsersById[chatId] === prevGlobal.usersById[chatId]\n ) {\n return;\n }\n\n let newFolderIds: number[];\n if (chat) {\n const currentSummary = prepared.chatSummariesById.get(chatId);\n const newSummary = buildChatSummary(chat, newNotifySettings, newNotifyExceptions, newUsersById[chatId]);\n if (!areFoldersChanged && currentSummary && arePropsShallowEqual(newSummary, currentSummary)) {\n return;\n }\n\n prepared.chatSummariesById.set(chatId, newSummary);\n\n newFolderIds = buildChatFolderIds(newSummary, folderSummaries);\n newFolderIds.forEach((folderId) => {\n affectedFolderIds.add(folderId);\n });\n } else {\n prepared.chatSummariesById.delete(chatId);\n newFolderIds = [];\n }\n\n const currentFolderIds = prepared.folderIdsByChatId[chatId] || [];\n if (areSortedArraysEqual(newFolderIds, currentFolderIds)) {\n return;\n }\n\n const deletedFolderIds = updateListsForChat(chatId, currentFolderIds, newFolderIds);\n deletedFolderIds.forEach((folderId) => {\n affectedFolderIds.add(folderId);\n });\n });\n\n prevGlobal.chatsById = newChatsById;\n prevGlobal.usersById = newUsersById;\n prevGlobal.notifySettings = newNotifySettings;\n prevGlobal.notifyExceptions = newNotifyExceptions;\n\n return Array.from(affectedFolderIds);\n}\n\nfunction buildChatSummary(\n chat: ApiChat,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n user?: ApiUser,\n): ChatSummary {\n const {\n id, type, lastMessage, isRestricted, isNotJoined, folderId,\n unreadCount, unreadMentionsCount, hasUnreadMark,\n joinDate, draftDate,\n } = chat;\n\n const userInfo = type === 'chatTypePrivate' && user;\n\n return {\n id,\n type,\n isListed: Boolean(lastMessage && !isRestricted && !isNotJoined),\n isArchived: folderId === ARCHIVED_FOLDER_ID,\n isMuted: selectIsChatMuted(chat, notifySettings, notifyExceptions),\n isUnread: Boolean(unreadCount || unreadMentionsCount || hasUnreadMark),\n unreadCount,\n unreadMentionsCount,\n order: Math.max(joinDate || 0, draftDate || 0, lastMessage?.date || 0),\n isUserBot: userInfo ? userInfo.type === 'userTypeBot' : undefined,\n isUserContact: userInfo ? userInfo.isContact : undefined,\n };\n}\n\nfunction buildChatFolderIds(chatSummary: ChatSummary, folderSummaries: FolderSummary[]) {\n return folderSummaries.reduce((acc, folderSummary) => {\n if (isChatInFolder(chatSummary, folderSummary)) {\n acc.push(folderSummary.id);\n }\n\n return acc;\n }, []).sort();\n}\n\nfunction isChatInFolder(\n chatSummary: ChatSummary,\n folderSummary: FolderSummary,\n) {\n if (!chatSummary.isListed) {\n return false;\n }\n\n const { id: chatId, type } = chatSummary;\n\n if (folderSummary.listIds) {\n if (\n (chatSummary.isArchived && folderSummary.id === ALL_FOLDER_ID)\n || (!chatSummary.isArchived && folderSummary.id === ARCHIVED_FOLDER_ID)\n ) {\n return false;\n }\n\n return folderSummary.listIds.has(chatId);\n }\n\n if (folderSummary.excludedChatIds?.has(chatId)) {\n return false;\n }\n\n if (folderSummary.includedChatIds?.has(chatId)) {\n return true;\n }\n\n if (folderSummary.pinnedChatIds?.has(chatId)) {\n return true;\n }\n\n if (folderSummary.excludeArchived && chatSummary.isArchived) {\n return false;\n }\n\n if (folderSummary.excludeRead && !chatSummary.isUnread) {\n return false;\n }\n\n if (folderSummary.excludeMuted && chatSummary.isMuted && !chatSummary.unreadMentionsCount) {\n return false;\n }\n\n if (type === 'chatTypePrivate') {\n if (chatSummary.isUserBot) {\n if (folderSummary.bots) {\n return true;\n }\n } else {\n if (folderSummary.contacts && chatSummary.isUserContact) {\n return true;\n }\n\n if (folderSummary.nonContacts && !chatSummary.isUserContact) {\n return true;\n }\n }\n } else if (type === 'chatTypeChannel') {\n return Boolean(folderSummary.channels);\n } else if (type === 'chatTypeBasicGroup' || type === 'chatTypeSuperGroup') {\n return Boolean(folderSummary.groups);\n }\n\n return false;\n}\n\nfunction updateListsForChat(chatId: string, currentFolderIds: number[], newFolderIds: number[]) {\n const currentFolderIdsSet = new Set(currentFolderIds);\n const newFolderIdsSet = new Set(newFolderIds);\n const deletedFolderIds: number[] = [];\n\n unique([...currentFolderIds, ...newFolderIds]).forEach((folderId) => {\n let currentFolderOrderedIds = results.orderedIdsByFolderId[folderId];\n\n if (currentFolderIdsSet.has(folderId) && !newFolderIdsSet.has(folderId)) {\n prepared.chatIdsByFolderId[folderId]!.delete(chatId);\n\n deletedFolderIds.push(folderId);\n\n if (currentFolderOrderedIds) {\n currentFolderOrderedIds = currentFolderOrderedIds.filter((id) => id !== chatId);\n prepared.isOrderedListJustPatched[folderId] = true;\n }\n } else if (!currentFolderIdsSet.has(folderId) && newFolderIdsSet.has(folderId)) {\n if (!prepared.chatIdsByFolderId[folderId]) {\n prepared.chatIdsByFolderId[folderId] = new Set();\n }\n\n prepared.chatIdsByFolderId[folderId]!.add(chatId);\n\n if (currentFolderOrderedIds) {\n currentFolderOrderedIds.push(chatId);\n prepared.isOrderedListJustPatched[folderId] = true;\n }\n }\n\n results.orderedIdsByFolderId[folderId] = currentFolderOrderedIds;\n });\n\n prepared.folderIdsByChatId[chatId] = newFolderIds;\n\n return deletedFolderIds;\n}\n\nfunction updateResults(affectedFolderIds: number[]) {\n let wasUnreadCountersChanged = false;\n let wasChatsCountChanged = false;\n\n Array.from(affectedFolderIds).forEach((folderId) => {\n const { pinnedCount: newPinnedCount, orderedIds: newOrderedIds } = buildFolderOrderedIds(folderId);\n // When signed out\n if (!newOrderedIds) {\n return;\n }\n\n const currentOrderedIds = results.orderedIdsByFolderId[folderId];\n const currentPinnedCount = results.pinnedCountByFolderId[folderId];\n const areOrderedIdsChanged = (\n !currentOrderedIds\n || currentPinnedCount === undefined || currentPinnedCount !== newPinnedCount\n || prepared.isOrderedListJustPatched[folderId]\n || !areSortedArraysEqual(newOrderedIds, currentOrderedIds)\n );\n if (areOrderedIdsChanged) {\n prepared.isOrderedListJustPatched[folderId] = false;\n results.orderedIdsByFolderId[folderId] = newOrderedIds;\n results.pinnedCountByFolderId[folderId] = newPinnedCount;\n callbacks.orderedIdsByFolderId[folderId]?.runCallbacks(newOrderedIds);\n }\n\n const currentChatsCount = results.chatsCountByFolderId[folderId];\n const newChatsCount = newOrderedIds.length;\n if (!wasChatsCountChanged) {\n wasChatsCountChanged = currentChatsCount !== newChatsCount;\n }\n results.chatsCountByFolderId[folderId] = newChatsCount;\n\n const currentUnreadCounters = results.unreadCountersByFolderId[folderId];\n const newUnreadCounters = buildFolderUnreadCounters(folderId);\n if (!wasUnreadCountersChanged) {\n wasUnreadCountersChanged = (\n !currentUnreadCounters || !arePropsShallowEqual(newUnreadCounters, currentUnreadCounters)\n );\n }\n results.unreadCountersByFolderId[folderId] = newUnreadCounters;\n });\n\n if (wasChatsCountChanged) {\n // We need to update the entire object as it will be returned from a hook\n const newValue = { ...results.chatsCountByFolderId };\n results.chatsCountByFolderId = newValue;\n callbacks.chatsCountByFolderId.runCallbacks(newValue);\n }\n\n if (wasUnreadCountersChanged) {\n // We need to update the entire object as it will be returned from a hook\n const newValue = { ...results.unreadCountersByFolderId };\n results.unreadCountersByFolderId = newValue;\n callbacks.unreadCountersByFolderId.runCallbacks(newValue);\n }\n}\n\nfunction buildFolderOrderedIds(folderId: number) {\n const folderSummary = prepared.folderSummariesById[folderId];\n if (!folderSummary) {\n return {};\n }\n\n const { orderedPinnedIds, pinnedChatIds } = folderSummary;\n const {\n chatSummariesById,\n chatIdsByFolderId: { [folderId]: chatIds },\n } = prepared;\n const {\n orderedIdsByFolderId: { [folderId]: prevOrderedIds },\n } = results;\n\n const sortedPinnedIds = chatIds ? orderedPinnedIds?.filter((id) => chatIds.has(id)) : orderedPinnedIds;\n const allListIds = prevOrderedIds || (chatIds && Array.from(chatIds)) || [];\n const notPinnedIds = pinnedChatIds ? allListIds.filter((id) => !pinnedChatIds.has(id)) : allListIds;\n const sortedNotPinnedIds = notPinnedIds.sort((chatId1: string, chatId2: string) => {\n return chatSummariesById.get(chatId2)!.order - chatSummariesById.get(chatId1)!.order;\n });\n\n return {\n pinnedCount: sortedPinnedIds?.length || 0,\n orderedIds: [\n ...(sortedPinnedIds || []),\n ...sortedNotPinnedIds,\n ],\n };\n}\n\nfunction buildFolderUnreadCounters(folderId: number) {\n const {\n chatSummariesById,\n } = prepared;\n const {\n orderedIdsByFolderId: { [folderId]: orderedIds },\n } = results;\n\n return orderedIds!.reduce((newUnreadCounters, chatId) => {\n const chatSummary = chatSummariesById.get(chatId);\n if (!chatSummary) {\n return newUnreadCounters;\n }\n\n if (chatSummary.isUnread) {\n newUnreadCounters.chatsCount++;\n\n if (chatSummary.unreadMentionsCount) {\n newUnreadCounters.notificationsCount += chatSummary.unreadMentionsCount;\n }\n\n if (!chatSummary.isMuted) {\n if (chatSummary.unreadCount) {\n newUnreadCounters.notificationsCount += chatSummary.unreadCount;\n } else if (!chatSummary.unreadMentionsCount) {\n newUnreadCounters.notificationsCount += 1; // Manually marked unread\n }\n }\n }\n\n return newUnreadCounters;\n }, {\n chatsCount: 0,\n notificationsCount: 0,\n });\n}\n\nfunction buildInitials() {\n return {\n prevGlobal: {\n foldersById: {},\n chatsById: {},\n usersById: {},\n notifySettings: {} as NotifySettings,\n notifyExceptions: {},\n },\n\n prepared: {\n folderSummariesById: {},\n chatSummariesById: new Map(),\n folderIdsByChatId: {},\n chatIdsByFolderId: {},\n isOrderedListJustPatched: {},\n },\n\n results: {\n orderedIdsByFolderId: {},\n pinnedCountByFolderId: {},\n chatsCountByFolderId: {},\n unreadCountersByFolderId: {},\n },\n\n callbacks: {\n orderedIdsByFolderId: {},\n chatsCountByFolderId: createCallbackManager(),\n unreadCountersByFolderId: createCallbackManager(),\n },\n };\n}\n\nfunction reset() {\n const newInitials = buildInitials();\n\n prevGlobal = newInitials.prevGlobal;\n prepared = newInitials.prepared;\n results = newInitials.results;\n callbacks = newInitials.callbacks;\n}\n","import { LangCode } from '../types';\n\nexport function formatCurrency(totalPrice: number, currency?: string, locale: LangCode = 'en') {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(currency === 'JPY' ? totalPrice : totalPrice / 100);\n}\n","const generateIdFor = (store: AnyLiteral) => {\n let id;\n\n do {\n id = String(Math.random()).replace('0.', 'id');\n } while (store.hasOwnProperty(id));\n\n return id;\n};\n\nexport default generateIdFor;\n","import { ApiError, ApiFieldError } from '../api/types';\n\nconst READABLE_ERROR_MESSAGES: Record = {\n CHAT_RESTRICTED: 'You can\\'t send messages in this chat, you were restricted',\n CHAT_WRITE_FORBIDDEN: 'You can\\'t write in this chat',\n CHAT_SEND_POLL_FORBIDDEN: 'You can\\'t create polls in this chat',\n CHAT_SEND_STICKERS_FORBIDDEN: 'You can\\'t send stickers in this chat',\n CHAT_SEND_GIFS_FORBIDDEN: 'You can\\'t send gifs in this chat',\n CHAT_SEND_MEDIA_FORBIDDEN: 'You can\\'t send media in this chat',\n CHAT_LINK_EXISTS: 'The chat is public, you can\\'t hide the history to new users',\n // eslint-disable-next-line max-len\n SLOWMODE_WAIT_X: 'Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.',\n USER_BANNED_IN_CHANNEL: 'You\\'re banned from sending messages in supergroups / channels',\n USER_IS_BLOCKED: 'You were blocked by this user',\n YOU_BLOCKED_USER: 'You blocked this user',\n IMAGE_PROCESS_FAILED: 'Failure while processing image',\n MEDIA_EMPTY: 'The provided media object is invalid',\n MEDIA_INVALID: 'Media invalid',\n PHOTO_EXT_INVALID: 'The extension of the photo is invalid',\n PHOTO_INVALID_DIMENSIONS: 'The photo dimensions are invalid',\n PHOTO_SAVE_FILE_INVALID: 'Internal issues, try again later',\n // eslint-disable-next-line max-len\n MESSAGE_DELETE_FORBIDDEN: 'You can\\'t delete one of the messages you tried to delete, most likely because it is a service message.',\n MESSAGE_POLL_CLOSED: 'Poll closed',\n MESSAGE_EDIT_TIME_EXPIRED: 'You can\\'t edit this message anymore.',\n CHAT_ADMIN_REQUIRED: 'You must be an admin in this chat to do this',\n PINNED_DIALOGS_TOO_MUCH: 'Sorry, you can only pin 5 chats to the top',\n DIALOG_FILTERS_TOO_MUCH: 'Sorry, you can\\'t have more than 10 folders',\n CHANNEL_PRIVATE: 'This channel is private',\n MEDIA_CAPTION_TOO_LONG: 'The provided caption is too long',\n ADDRESS_STREET_LINE1_INVALID: 'The address you provided is not valid',\n ADDRESS_STREET_LINE2_INVALID: 'The address you provided is not valid',\n ADDRESS_CITY_INVALID: 'The city you provided is not valid',\n ADDRESS_COUNTRY_INVALID: 'The country you provided is not valid',\n ADDRESS_POSTCODE_INVALID: 'The postcode you provided is not valid',\n ADDRESS_STATE_INVALID: 'The state you provided is not valid',\n REQ_INFO_NAME_INVALID: 'The name you provided is not valid',\n REQ_INFO_PHONE_INVALID: 'The phone you provided is not valid',\n REQ_INFO_EMAIL_INVALID: 'The email you provided is not valid',\n // TODO Bring back after fixing the weird bug\n // CHANNEL_INVALID: 'An error occurred. Please try again later',\n LINK_NOT_MODIFIED: 'This discussion is already linked to the channel',\n MESSAGE_TOO_LONG: 'Message is too long',\n\n // Non-API errors\n // eslint-disable-next-line max-len\n SERVICE_WORKER_DISABLED: 'Service Worker is disabled. Streaming media may not be supported. Try reloading the page without holding key',\n // eslint-disable-next-line max-len\n MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS: 'The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.',\n // eslint-disable-next-line max-len\n FRESH_RESET_AUTHORISATION_FORBIDDEN: 'You can’t logout other sessions if less than 24 hours have passed since you logged on the current session',\n\n BOTS_TOO_MUCH: 'There are too many bots in this chat/channel',\n BOT_GROUPS_BLOCKED: 'This bot can\\'t be added to groups',\n USERS_TOO_MUCH: 'The maximum number of users has been exceeded',\n USER_CHANNELS_TOO_MUCH: 'One of the users you tried to add is already in too many channels/supergroups',\n USER_KICKED: 'This user was kicked from this supergroup/channel',\n USER_NOT_MUTUAL_CONTACT: 'The provided user is not a mutual contact',\n USER_PRIVACY_RESTRICTED: 'The user\\'s privacy settings do not allow you to do this',\n INVITE_HASH_EMPTY: 'The invite hash is empty',\n INVITE_HASH_EXPIRED: 'The invite link has expired',\n INVITE_HASH_INVALID: 'The invite hash is invalid',\n CHANNELS_TOO_MUCH: 'You have joined too many channels/supergroups',\n USER_ALREADY_PARTICIPANT: 'You already in the group',\n SCHEDULE_DATE_INVALID: 'Invalid schedule date provided',\n WALLPAPER_DIMENSIONS_INVALID: 'The wallpaper dimensions are invalid, please select another file',\n ADMINS_TOO_MUCH: 'There are too many admins',\n ADMIN_RANK_EMOJI_NOT_ALLOWED: 'An admin rank cannot contain emojis',\n ADMIN_RANK_INVALID: 'The specified admin rank is invalid',\n FRESH_CHANGE_ADMINS_FORBIDDEN: 'You were just elected admin, you can\\'t add or modify other admins yet',\n INPUT_USER_DEACTIVATED: 'The specified user was deleted',\n BOT_PRECHECKOUT_TIMEOUT: 'The request for payment has expired',\n};\n\nexport const SHIPPING_ERRORS: Record = {\n ADDRESS_STREET_LINE1_INVALID: {\n field: 'streetLine1',\n message: 'Incorrect street address',\n },\n ADDRESS_STREET_LINE2_INVALID: {\n field: 'streetLine2',\n message: 'Incorrect street address',\n },\n ADDRESS_CITY_INVALID: {\n field: 'city',\n message: 'Incorrect city',\n },\n ADDRESS_COUNTRY_INVALID: {\n field: 'countryIso2',\n message: 'Incorrect country',\n },\n ADDRESS_POSTCODE_INVALID: {\n field: 'postCode',\n message: 'Incorrect post code',\n },\n ADDRESS_STATE_INVALID: {\n field: 'state',\n message: 'Incorrect state',\n },\n REQ_INFO_NAME_INVALID: {\n field: 'fullName',\n message: 'Incorrect name',\n },\n REQ_INFO_PHONE_INVALID: {\n field: 'phone',\n message: 'Incorrect phone',\n },\n REQ_INFO_EMAIL_INVALID: {\n field: 'email',\n message: 'Incorrect email',\n },\n};\n\nexport default function getReadableErrorText(error: ApiError) {\n const { message, isSlowMode, textParams } = error;\n // Currently, Telegram API doesn't return `SLOWMODE_WAIT_X` error as described in the docs\n if (isSlowMode) {\n const extraPartIndex = message.indexOf(' (caused by');\n return extraPartIndex > 0 ? message.substring(0, extraPartIndex) : message;\n }\n let errorMessage = READABLE_ERROR_MESSAGES[message];\n if (errorMessage && textParams) {\n errorMessage = Object.keys(textParams).reduce((acc, current) => {\n return acc.replace(current, textParams[current]);\n }, errorMessage as string);\n }\n return errorMessage;\n}\n\nexport function getShippingError(error: ApiError): ApiFieldError | undefined {\n return SHIPPING_ERRORS[error.message];\n}\n","import { DEBUG_ALERT_MSG } from '../config';\nimport { throttle } from './schedulers';\n\nwindow.addEventListener('error', handleErrorEvent);\nwindow.addEventListener('unhandledrejection', handleErrorEvent);\n\n// eslint-disable-next-line prefer-destructuring\nconst APP_ENV = process.env.APP_ENV;\n\nfunction handleErrorEvent(e: ErrorEvent | PromiseRejectionEvent) {\n // https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n if (e instanceof ErrorEvent && e.message === 'ResizeObserver loop limit exceeded') {\n return;\n }\n\n e.preventDefault();\n\n handleError(e instanceof ErrorEvent ? (e.error || e.message) : e.reason);\n}\n\nconst throttledAlert = throttle(window.alert, 1000);\n\nexport function handleError(err: Error) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (APP_ENV === 'development' || APP_ENV === 'staging') {\n throttledAlert(`${DEBUG_ALERT_MSG}\\n\\n${(err?.message) || err}\\n${err?.stack}`);\n }\n}\n","type CollectionByKey = Record;\n\ntype OrderDirection =\n 'asc'\n | 'desc';\n\ninterface OrderCallback {\n (member: T): any;\n}\n\nexport function buildCollectionByKey(collection: T[], key: keyof T) {\n return collection.reduce((byKey: CollectionByKey, member: T) => {\n byKey[member[key]] = member;\n\n return byKey;\n }, {});\n}\n\nexport function mapValues(\n byKey: CollectionByKey,\n callback: (member: M, key: string, index: number, originalByKey: CollectionByKey) => R,\n): CollectionByKey {\n return Object.keys(byKey).reduce((newByKey: CollectionByKey, key, index) => {\n newByKey[key] = callback(byKey[key], key, index, byKey);\n return newByKey;\n }, {});\n}\n\nexport function pick(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n result[key] = object[key];\n return result;\n }, {} as Pick);\n}\n\nexport function pickTruthy(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n if (object[key]) {\n result[key] = object[key];\n }\n\n return result;\n }, {} as Pick);\n}\n\nexport function omit(object: T, keys: K[]) {\n const stringKeys = new Set(keys.map(String));\n const savedKeys = Object.keys(object)\n .filter((key) => !stringKeys.has(key)) as Array>;\n\n return pick(object, savedKeys);\n}\n\nexport function orderBy(\n collection: T[],\n orderRule: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n function compareValues(a: T, b: T, currentOrderRule: (keyof T) | OrderCallback, isAsc: boolean) {\n const aValue = (typeof currentOrderRule === 'function' ? currentOrderRule(a) : a[currentOrderRule]) || 0;\n const bValue = (typeof currentOrderRule === 'function' ? currentOrderRule(b) : b[currentOrderRule]) || 0;\n\n return isAsc ? aValue - bValue : bValue - aValue;\n }\n\n if (Array.isArray(orderRule)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderRule1, orderRule2] = orderRule;\n const isAsc1 = mode1 === 'asc';\n const isAsc2 = mode2 === 'asc';\n\n return collection.sort((a, b) => {\n return compareValues(a, b, orderRule1, isAsc1) || compareValues(a, b, orderRule2, isAsc2);\n });\n }\n\n const isAsc = mode === 'asc';\n return collection.sort((a, b) => {\n return compareValues(a, b, orderRule, isAsc);\n });\n}\n\nexport function flatten(array: any[]) {\n return array.reduce((result, member) => {\n if (Array.isArray(member)) {\n return result.concat(member);\n } else {\n result.push(member);\n return result;\n }\n }, []);\n}\n\nexport function unique(array: T[]): T[] {\n return Array.from(new Set(array));\n}\n\nexport function compact(array: T[]) {\n return array.filter(Boolean);\n}\n\nexport function areSortedArraysEqual(array1: any[], array2: any[]) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((item, i) => item === array2[i]);\n}\n\nexport function areSortedArraysIntersecting(array1: any[], array2: any[]) {\n return array1[0] <= array2[array2.length - 1] && array1[array1.length - 1] >= array2[0];\n}\n\nexport function findIntersectionWithSet(array: T[], set: Set): T[] {\n return array.filter((a) => set.has(a));\n}\n\nexport function split(array: any[], chunkSize: number) {\n const result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n\n return result;\n}\n\nexport function cloneDeep(value: T): T {\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(cloneDeep) as typeof value;\n }\n\n return Object.keys(value).reduce((acc, key) => {\n acc[key as keyof T] = cloneDeep(value[key as keyof T]);\n return acc;\n }, {} as T);\n}\n\nexport function findLast(array: Array, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {\n let cursor = array.length;\n\n while (cursor--) {\n if (predicate(array[cursor], cursor, array)) {\n return array[cursor];\n }\n }\n\n return undefined;\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ApiLangPack, ApiLangString } from '../api/types';\nimport { LangCode, TimeFormat } from '../types';\n\nimport {\n DEFAULT_LANG_CODE, DEFAULT_LANG_PACK, LANG_CACHE_NAME, LANG_PACKS,\n} from '../config';\nimport * as cacheApi from './cacheApi';\nimport { callApi } from '../api/gramjs';\nimport { createCallbackManager } from './callbacks';\nimport { formatInteger } from './textFormat';\n\ninterface LangFn {\n (key: string, value?: any, format?: 'i'): any;\n\n isRtl?: boolean;\n code?: LangCode;\n timeFormat?: TimeFormat;\n}\n\nconst SUBSTITUTION_REGEX = /%\\d?\\$?[sdf@]/g;\nconst PLURAL_OPTIONS = ['value', 'zeroValue', 'oneValue', 'twoValue', 'fewValue', 'manyValue', 'otherValue'] as const;\nconst PLURAL_RULES = {\n /* eslint-disable max-len */\n en: (n: number) => (n !== 1 ? 6 : 2),\n ar: (n: number) => (n === 0 ? 1 : n === 1 ? 2 : n === 2 ? 3 : n % 100 >= 3 && n % 100 <= 10 ? 4 : n % 100 >= 11 ? 5 : 6),\n ca: (n: number) => (n !== 1 ? 6 : 2),\n de: (n: number) => (n !== 1 ? 6 : 2),\n es: (n: number) => (n !== 1 ? 6 : 2),\n fa: (n: number) => (n > 1 ? 6 : 2),\n fr: (n: number) => (n > 1 ? 6 : 2),\n id: () => 0,\n it: (n: number) => (n !== 1 ? 6 : 2),\n ko: () => 0,\n ms: () => 0,\n nl: (n: number) => (n !== 1 ? 6 : 2),\n pl: (n: number) => (n === 1 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n pt_BR: (n: number) => (n > 1 ? 6 : 2),\n ru: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n tr: (n: number) => (n > 1 ? 6 : 2),\n uk: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n uz: (n: number) => (n > 1 ? 6 : 2),\n /* eslint-enable max-len */\n};\n\nconst cache = new Map();\n\nlet langPack: ApiLangPack | undefined;\nlet fallbackLangPack: ApiLangPack | undefined;\n\nconst {\n addCallback,\n removeCallback,\n runCallbacks,\n} = createCallbackManager();\n\nexport { addCallback, removeCallback };\n\nlet currentLangCode: string | undefined;\nlet currentTimeFormat: TimeFormat | undefined;\n\nexport const getTranslation: LangFn = (key: string, value?: any, format?: 'i') => {\n if (value !== undefined) {\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n const cached = cache.get(`${key}_${cacheValue}_${format}`);\n if (cached) {\n return cached;\n }\n }\n\n if (!langPack && !fallbackLangPack) {\n return key;\n }\n\n const langString = (langPack?.[key]) || (fallbackLangPack?.[key]);\n if (!langString) {\n if (!fallbackLangPack) {\n void importFallbackLangPack();\n }\n\n return key;\n }\n\n return processTranslation(langString, key, value, format);\n};\n\nexport async function getTranslationForLangString(langCode: string, key: string) {\n let translateString: ApiLangString | undefined = await cacheApi.fetch(\n LANG_CACHE_NAME,\n `${DEFAULT_LANG_PACK}_${langCode}_${key}`,\n cacheApi.Type.Json,\n );\n\n if (!translateString) {\n translateString = await fetchRemoteString(DEFAULT_LANG_PACK, langCode, key);\n }\n\n return processTranslation(translateString, key);\n}\n\nexport async function setLanguage(langCode: LangCode, callback?: NoneToVoidFunction, withFallback = false) {\n if (langPack && langCode === currentLangCode) {\n if (callback) {\n callback();\n }\n\n return;\n }\n\n let newLangPack = await cacheApi.fetch(LANG_CACHE_NAME, langCode, cacheApi.Type.Json);\n if (!newLangPack) {\n if (withFallback) {\n await importFallbackLangPack();\n }\n\n newLangPack = await fetchRemote(langCode);\n if (!newLangPack) {\n return;\n }\n }\n\n cache.clear();\n\n currentLangCode = langCode;\n langPack = newLangPack;\n document.documentElement.lang = langCode;\n\n const { languages, timeFormat } = getGlobal().settings.byKey;\n const langInfo = languages?.find((l) => l.langCode === langCode);\n getTranslation.isRtl = Boolean(langInfo?.rtl);\n getTranslation.code = langCode;\n getTranslation.timeFormat = timeFormat;\n\n if (callback) {\n callback();\n }\n\n runCallbacks();\n}\n\nexport function setTimeFormat(timeFormat: TimeFormat) {\n if (timeFormat && timeFormat === currentTimeFormat) {\n return;\n }\n\n currentTimeFormat = timeFormat;\n getTranslation.timeFormat = timeFormat;\n\n runCallbacks();\n}\n\nasync function importFallbackLangPack() {\n if (fallbackLangPack) {\n return;\n }\n\n fallbackLangPack = (await import('./fallbackLangPack')).default;\n runCallbacks();\n}\n\nasync function fetchRemote(langCode: string): Promise {\n const remote = await callApi('fetchLangPack', { sourceLangPacks: LANG_PACKS, langCode });\n if (remote) {\n await cacheApi.save(LANG_CACHE_NAME, langCode, remote.langPack);\n return remote.langPack;\n }\n\n return undefined;\n}\n\nasync function fetchRemoteString(\n remoteLangPack: typeof LANG_PACKS[number], langCode: string, key: string,\n): Promise {\n const remote = await callApi('fetchLangStrings', {\n langPack: remoteLangPack,\n langCode,\n keys: [key],\n });\n\n if (remote?.length) {\n await cacheApi.save(LANG_CACHE_NAME, `${remoteLangPack}_${langCode}_${key}`, remote[0]);\n\n return remote[0];\n }\n\n return undefined;\n}\n\nfunction getPluralOption(amount: number) {\n const langCode = currentLangCode || DEFAULT_LANG_CODE;\n const optionIndex = PLURAL_RULES[langCode as keyof typeof PLURAL_RULES]\n ? PLURAL_RULES[langCode as keyof typeof PLURAL_RULES](amount)\n : 0;\n\n return PLURAL_OPTIONS[optionIndex];\n}\n\nfunction processTemplate(template: string, value: any) {\n value = Array.isArray(value) ? value : [value];\n const translationSlices = template.split(SUBSTITUTION_REGEX);\n const initialValue = translationSlices.shift();\n\n return translationSlices.reduce((result, str, index) => {\n return `${result}${String(value[index] || '')}${str}`;\n }, initialValue || '');\n}\n\nfunction processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {\n const template = langString ? langString[typeof value === 'number' ? getPluralOption(value) : 'value'] : undefined;\n if (!template || !template.trim()) {\n const parts = key.split('.');\n\n return parts[parts.length - 1];\n }\n\n if (value !== undefined) {\n const formattedValue = format === 'i' ? formatInteger(value) : value;\n const result = processTemplate(template, formattedValue);\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n cache.set(`${key}_${cacheValue}_${format}`, result);\n return result;\n }\n\n return template;\n}\n","const SAMPLE_RATE = 48000;\nconst BIT_DEPTH = 16;\n\nexport async function oggToWav(opusData: Blob): Promise {\n const arrayBuffer = await new Response(opusData).arrayBuffer();\n\n return new Promise((resolve) => {\n const typedArray = new Uint8Array(arrayBuffer);\n\n let decoderWorker: Worker | undefined = new Worker(\n new URL('opus-recorder/dist/decoderWorker.min.js', import.meta.url),\n );\n let wavWorker: Worker | undefined = new Worker(new URL('opus-recorder/dist/waveWorker.min.js', import.meta.url));\n\n decoderWorker.onmessage = (e) => {\n // eslint-disable-next-line no-null/no-null\n if (e.data === null) {\n // `null` means decoder is finished\n wavWorker!.postMessage({ command: 'done' });\n } else {\n // `e.data` contains decoded buffers as float32 values\n wavWorker!.postMessage(\n {\n command: 'encode',\n buffers: e.data,\n },\n e.data.map(({ buffer }: Float32Array) => buffer),\n );\n }\n };\n\n wavWorker.onmessage = (e) => {\n if (e.data.message === 'page') {\n resolve(new Blob([e.data.page], { type: 'audio/wav' }));\n\n decoderWorker!.terminate();\n decoderWorker = undefined;\n wavWorker!.terminate();\n wavWorker = undefined;\n }\n };\n\n wavWorker.postMessage({\n command: 'init',\n wavBitDepth: BIT_DEPTH,\n wavSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'init',\n decoderSampleRate: SAMPLE_RATE,\n outputBufferSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'decode',\n pages: typedArray,\n }, [typedArray.buffer]);\n });\n}\n","import {\n ApiMediaFormat,\n ApiOnProgress,\n ApiParsedMedia,\n ApiPreparedMedia,\n} from '../api/types';\n\nimport {\n DEBUG, MEDIA_CACHE_DISABLED, MEDIA_CACHE_NAME, MEDIA_CACHE_NAME_AVATARS,\n} from '../config';\nimport { callApi, cancelApiProgress } from '../api/gramjs';\nimport * as cacheApi from './cacheApi';\nimport { fetchBlob } from './files';\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, isWebpSupported } from './environment';\nimport { oggToWav } from './oggToWav';\nimport { webpToPng } from './webpToPng';\n\nconst asCacheApiType = {\n [ApiMediaFormat.BlobUrl]: cacheApi.Type.Blob,\n [ApiMediaFormat.Lottie]: cacheApi.Type.Blob,\n [ApiMediaFormat.Progressive]: undefined,\n [ApiMediaFormat.Stream]: undefined,\n};\n\nconst PROGRESSIVE_URL_PREFIX = './progressive/';\n\nconst memoryCache = new Map();\nconst fetchPromises = new Map>();\nconst progressCallbacks = new Map>();\nconst cancellableCallbacks = new Map();\n\nexport function fetch(\n url: string,\n mediaFormat: T,\n isHtmlAllowed = false,\n onProgress?: ApiOnProgress,\n callbackUniqueId?: string,\n): Promise {\n if (mediaFormat === ApiMediaFormat.Progressive) {\n return (\n IS_PROGRESSIVE_SUPPORTED\n ? getProgressive(url)\n : fetch(url, ApiMediaFormat.BlobUrl, isHtmlAllowed, onProgress, callbackUniqueId)\n ) as Promise;\n }\n\n if (!fetchPromises.has(url)) {\n const promise = fetchFromCacheOrRemote(url, mediaFormat, isHtmlAllowed)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n return undefined;\n })\n .finally(() => {\n fetchPromises.delete(url);\n progressCallbacks.delete(url);\n cancellableCallbacks.delete(url);\n });\n\n fetchPromises.set(url, promise);\n }\n\n if (onProgress && callbackUniqueId) {\n let activeCallbacks = progressCallbacks.get(url);\n if (!activeCallbacks) {\n activeCallbacks = new Map();\n progressCallbacks.set(url, activeCallbacks);\n }\n activeCallbacks.set(callbackUniqueId, onProgress);\n }\n\n return fetchPromises.get(url) as Promise;\n}\n\nexport function getFromMemory(url: string) {\n return memoryCache.get(url) as ApiPreparedMedia;\n}\n\nexport function cancelProgress(progressCallback: ApiOnProgress) {\n progressCallbacks.forEach((map, url) => {\n map.forEach((callback) => {\n if (callback === progressCallback) {\n const parentCallback = cancellableCallbacks.get(url);\n if (!parentCallback) return;\n\n cancelApiProgress(parentCallback);\n cancellableCallbacks.delete(url);\n progressCallbacks.delete(url);\n }\n });\n });\n}\n\nexport function removeCallback(url: string, callbackUniqueId: string) {\n const callbacks = progressCallbacks.get(url);\n if (!callbacks) return;\n callbacks.delete(callbackUniqueId);\n}\n\nfunction getProgressive(url: string) {\n const progressiveUrl = `${PROGRESSIVE_URL_PREFIX}${url}`;\n\n memoryCache.set(url, progressiveUrl);\n\n return Promise.resolve(progressiveUrl);\n}\n\nasync function fetchFromCacheOrRemote(\n url: string, mediaFormat: ApiMediaFormat, isHtmlAllowed: boolean,\n) {\n if (!MEDIA_CACHE_DISABLED) {\n const cacheName = url.startsWith('avatar') ? MEDIA_CACHE_NAME_AVATARS : MEDIA_CACHE_NAME;\n const cached = await cacheApi.fetch(cacheName, url, asCacheApiType[mediaFormat]!, isHtmlAllowed);\n\n if (cached) {\n let media = cached;\n\n if (cached.type === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n media = await oggToWav(media);\n }\n\n if (cached.type === 'image/webp' && !isWebpSupported() && media) {\n const mediaPng = await webpToPng(url, media);\n if (mediaPng) {\n media = mediaPng;\n }\n }\n\n const prepared = prepareMedia(media);\n\n memoryCache.set(url, prepared);\n\n return prepared;\n }\n }\n\n if (mediaFormat === ApiMediaFormat.Stream) {\n const mediaSource = new MediaSource();\n const streamUrl = URL.createObjectURL(mediaSource);\n let isOpen = false;\n\n mediaSource.addEventListener('sourceopen', () => {\n if (isOpen) {\n return;\n }\n isOpen = true;\n\n const sourceBuffer = mediaSource.addSourceBuffer('audio/mpeg');\n\n const onProgress = makeOnProgress(url, mediaSource, sourceBuffer);\n cancellableCallbacks.set(url, onProgress);\n\n void callApi('downloadMedia', { url, mediaFormat }, onProgress);\n });\n\n memoryCache.set(url, streamUrl);\n return streamUrl;\n }\n\n const onProgress = makeOnProgress(url);\n cancellableCallbacks.set(url, onProgress);\n\n const remote = await callApi('downloadMedia', { url, mediaFormat, isHtmlAllowed }, onProgress);\n if (!remote) {\n throw new Error(`Failed to fetch media ${url}`);\n }\n\n let { prepared, mimeType } = remote;\n\n if (mimeType === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await oggToWav(blob);\n prepared = prepareMedia(media);\n mimeType = media.type;\n }\n\n if (mimeType === 'image/webp' && !isWebpSupported()) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await webpToPng(url, blob);\n if (media) {\n prepared = prepareMedia(media);\n }\n }\n\n memoryCache.set(url, prepared);\n\n return prepared;\n}\n\nfunction makeOnProgress(url: string, mediaSource?: MediaSource, sourceBuffer?: SourceBuffer) {\n const onProgress: ApiOnProgress = (progress: number, arrayBuffer: ArrayBuffer) => {\n progressCallbacks.get(url)?.forEach((callback) => {\n callback(progress);\n if (callback.isCanceled) onProgress.isCanceled = true;\n });\n\n if (progress === 1) {\n mediaSource?.endOfStream();\n }\n\n if (!arrayBuffer) {\n return;\n }\n\n sourceBuffer?.appendBuffer(arrayBuffer);\n };\n\n return onProgress;\n}\n\nfunction prepareMedia(mediaData: Exclude): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n return URL.createObjectURL(mediaData);\n }\n\n return mediaData;\n}\n\nif (IS_PROGRESSIVE_SUPPORTED) {\n navigator.serviceWorker.addEventListener('message', async (e) => {\n const { type, messageId, params } = e.data as {\n type: string;\n messageId: string;\n params: { url: string; start: number; end: number };\n };\n\n if (type !== 'requestPart') {\n return;\n }\n\n const result = await callApi('downloadMedia', { mediaFormat: ApiMediaFormat.Progressive, ...params });\n if (!result) {\n return;\n }\n\n const { arrayBuffer, mimeType, fullSize } = result;\n\n navigator.serviceWorker.controller!.postMessage({\n type: 'partResponse',\n messageId,\n result: {\n arrayBuffer,\n mimeType,\n fullSize,\n },\n }, [arrayBuffer!]);\n });\n}\n","export const MEMO_EMPTY_ARRAY = [];\n","import { DEBUG } from '../config';\nimport { createCallbackManager } from './callbacks';\n\nexport enum Bundles {\n Auth,\n Main,\n Extra,\n Calls,\n}\n\ninterface ImportedBundles {\n [Bundles.Auth]: typeof import('../bundles/auth');\n [Bundles.Main]: typeof import('../bundles/main');\n [Bundles.Extra]: typeof import('../bundles/extra');\n [Bundles.Calls]: typeof import('../bundles/calls');\n}\n\ntype BundlePromises = {\n [K in keyof ImportedBundles]: Promise\n};\n\nexport type BundleModules = keyof ImportedBundles[B];\n\nconst LOAD_PROMISES: Partial = {};\nconst MEMORY_CACHE: Partial = {};\n\nconst { addCallback, runCallbacks } = createCallbackManager();\n\nexport async function loadModule>(bundleName: B, moduleName: M) {\n if (!LOAD_PROMISES[bundleName]) {\n switch (bundleName) {\n case Bundles.Auth:\n LOAD_PROMISES[Bundles.Auth] = import('../bundles/auth');\n break;\n case Bundles.Main:\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD MAIN BUNDLE');\n }\n\n LOAD_PROMISES[Bundles.Main] = import('../bundles/main');\n break;\n case Bundles.Extra:\n LOAD_PROMISES[Bundles.Extra] = import('../bundles/extra');\n break;\n case Bundles.Calls:\n LOAD_PROMISES[Bundles.Calls] = import('../bundles/calls');\n break;\n }\n\n (LOAD_PROMISES[bundleName] as Promise).then(runCallbacks);\n }\n\n const bundle = (await LOAD_PROMISES[bundleName]) as unknown as ImportedBundles[B];\n\n if (!MEMORY_CACHE[bundleName]) {\n MEMORY_CACHE[bundleName] = bundle;\n }\n\n return getModuleFromMemory(bundleName, moduleName);\n}\n\nexport function getModuleFromMemory>(bundleName: B, moduleName: M) {\n const bundle = MEMORY_CACHE[bundleName] as ImportedBundles[B];\n\n if (!bundle) {\n return undefined;\n }\n\n return bundle[moduleName];\n}\n\nexport const addLoadListener = addCallback;\n","import { callApi } from '../api/gramjs';\nimport { ApiChat, ApiMediaFormat, ApiMessage, ApiUser, ApiUserReaction } from '../api/types';\nimport { renderActionMessageText } from '../components/common/helpers/renderActionMessageText';\nimport { DEBUG, IS_TEST } from '../config';\nimport { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getMessageAction,\n getMessageRecentReaction,\n getMessageSenderName,\n getMessageSummaryText,\n getPrivateChatUserId,\n isActionMessage,\n isChatChannel,\n selectIsChatMuted,\n selectShouldShowMessagePreview,\n} from '../modules/helpers';\nimport { addNotifyExceptions, replaceSettings } from '../modules/reducers';\nimport {\n selectChatMessage,\n selectCurrentMessageList,\n selectNotifyExceptions,\n selectNotifySettings,\n selectUser,\n} from '../modules/selectors';\nimport { IS_SERVICE_WORKER_SUPPORTED, IS_TOUCH_ENV } from './environment';\nimport { getTranslation } from './langProvider';\nimport * as mediaLoader from './mediaLoader';\nimport { debounce } from './schedulers';\n\nfunction getDeviceToken(subscription: PushSubscription) {\n const data = subscription.toJSON();\n return JSON.stringify({\n endpoint: data.endpoint,\n keys: data.keys,\n });\n}\n\nfunction checkIfPushSupported() {\n if (!IS_SERVICE_WORKER_SUPPORTED) return false;\n if (!('showNotification' in ServiceWorkerRegistration.prototype)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push notifications aren\\'t supported.');\n }\n return false;\n }\n\n // Check the current Notification permission.\n // If its denied, it's a permanent block until the\n // user changes the permission\n if (Notification.permission === 'denied') {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n\n // Check if push messaging is supported\n if (!('PushManager' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push messaging isn\\'t supported.');\n }\n return false;\n }\n return true;\n}\n\nfunction checkIfNotificationsSupported() {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] This browser does not support desktop notification');\n }\n return false;\n }\n\n if (Notification.permission === 'denied' as NotificationPermission) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n return true;\n}\n\nconst expirationTime = 12 * 60 * 60 * 1000; // 12 hours\n// Notification id is removed from soundPlayed cache after 3 seconds\nconst soundPlayedDelay = 3 * 1000;\nconst soundPlayedIds = new Set();\n\nexport async function playNotifySound(id?: string, volume?: number) {\n if (id !== undefined && soundPlayedIds.has(id)) return;\n const { notificationSoundVolume } = selectNotifySettings(getGlobal());\n const currentVolume = volume ? volume / 10 : notificationSoundVolume / 10;\n if (currentVolume === 0) return;\n\n const audio = new Audio('./notification.mp3');\n audio.volume = currentVolume;\n audio.setAttribute('mozaudiochannel', 'notification');\n if (id !== undefined) {\n audio.addEventListener('ended', () => {\n soundPlayedIds.add(id);\n }, { once: true });\n\n setTimeout(() => {\n soundPlayedIds.delete(id);\n }, soundPlayedDelay);\n }\n\n try {\n await audio.play();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Unable to play notification sound');\n }\n }\n}\n\nexport const playNotifySoundDebounced = debounce(playNotifySound, 1000, true, false);\n\nfunction checkIfShouldResubscribe(subscription: PushSubscription | null) {\n const global = getGlobal();\n if (!global.push || !subscription) return true;\n if (getDeviceToken(subscription) !== global.push.deviceToken) return true;\n return Date.now() - global.push.subscribedAt > expirationTime;\n}\n\nasync function requestPermission() {\n if (!('Notification' in window)) return;\n if (!['granted', 'denied'].includes(Notification.permission)) {\n await Notification.requestPermission();\n }\n}\n\nasync function unsubscribeFromPush(subscription: PushSubscription | null) {\n const global = getGlobal();\n const dispatch = getDispatch();\n if (subscription) {\n try {\n const deviceToken = getDeviceToken(subscription);\n await callApi('unregisterDevice', deviceToken);\n await subscription.unsubscribe();\n dispatch.deleteDeviceToken();\n return;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to unsubscribe from push.', error);\n }\n }\n }\n if (global.push) {\n await callApi('unregisterDevice', global.push.deviceToken);\n dispatch.deleteDeviceToken();\n }\n}\n\nexport async function unsubscribe() {\n if (!checkIfPushSupported()) return;\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n const subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n await unsubscribeFromPush(subscription);\n}\n\n// Indicates if notification settings are loaded from the api\nlet areSettingsLoaded = false;\n\n// Load notification settings from the api\nasync function loadNotificationSettings() {\n if (areSettingsLoaded) return selectNotifySettings(getGlobal());\n const [resultSettings, resultExceptions] = await Promise.all([\n callApi('fetchNotificationSettings', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n callApi('fetchNotificationExceptions', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n ]);\n if (!resultSettings) return selectNotifySettings(getGlobal());\n\n let global = replaceSettings(getGlobal(), resultSettings);\n if (resultExceptions) {\n global = addNotifyExceptions(global, resultExceptions);\n }\n setGlobal(global);\n areSettingsLoaded = true;\n return selectNotifySettings(global);\n}\n\nexport async function subscribe() {\n if (!checkIfPushSupported()) {\n // Ask for notification permissions only if service worker notifications are not supported\n // As pushManager.subscribe automatically triggers permission popup\n await requestPermission();\n return;\n }\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n let subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n if (!checkIfShouldResubscribe(subscription)) return;\n await unsubscribeFromPush(subscription);\n try {\n subscription = await serviceWorkerRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n });\n const deviceToken = getDeviceToken(subscription);\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Received push subscription: ', deviceToken);\n }\n await callApi('registerDevice', deviceToken);\n getDispatch()\n .setDeviceToken(deviceToken);\n } catch (error: any) {\n if (Notification.permission === 'denied' as NotificationPermission) {\n // The user denied the notification permission which\n // means we failed to subscribe and the user will need\n // to manually change the notification permission to\n // subscribe to push messages\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n } else if (DEBUG) {\n // A problem occurred with the subscription, this can\n // often be down to an issue or lack of the gcm_sender_id\n // and / or gcm_user_visible_only\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to subscribe to push.', error);\n\n // Request permissions and fall back to local notifications\n // if pushManager.subscribe was aborted due to invalid VAPID key.\n if (error.code === DOMException.ABORT_ERR) {\n await requestPermission();\n }\n }\n }\n}\n\nfunction checkIfShouldNotify(chat: ApiChat) {\n if (!areSettingsLoaded) return false;\n const global = getGlobal();\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n if (isMuted || chat.isNotJoined || !chat.isListed) {\n return false;\n }\n // On touch devices show notifications when chat is not active\n if (IS_TOUCH_ENV) {\n const {\n chatId,\n type,\n } = selectCurrentMessageList(global) || {};\n return !(chatId === chat.id && type === 'thread');\n }\n // On desktop show notifications when window is not focused\n return !document.hasFocus();\n}\n\nfunction getNotificationContent(chat: ApiChat, message: ApiMessage, reaction?: ApiUserReaction) {\n const global = getGlobal();\n let {\n senderId,\n replyToMessageId,\n } = message;\n if (reaction) senderId = reaction.userId;\n\n const messageSender = senderId ? selectUser(global, senderId) : undefined;\n const messageAction = getMessageAction(message as ApiMessage);\n const actionTargetMessage = messageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const {\n targetUserIds: actionTargetUserIds,\n targetChatId: actionTargetChatId,\n } = messageAction || {};\n\n const actionTargetUsers = actionTargetUserIds\n ? actionTargetUserIds.map((userId) => selectUser(global, userId))\n .filter(Boolean as any)\n : undefined;\n const privateChatUserId = getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n\n let body: string;\n if (selectShouldShowMessagePreview(chat, selectNotifySettings(global), selectNotifyExceptions(global))) {\n if (isActionMessage(message)) {\n const isChat = chat && (isChatChannel(chat) || message.senderId === message.chatId);\n\n body = renderActionMessageText(\n getTranslation,\n message,\n !isChat ? messageSender : undefined,\n isChat ? chat : undefined,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlainText: true },\n ) as string;\n } else {\n const senderName = getMessageSenderName(getTranslation, chat.id, messageSender);\n const summary = getMessageSummaryText(getTranslation, message, false, 60, false);\n\n body = senderName ? `${senderName}: ${summary}` : summary;\n }\n } else {\n body = 'New message';\n }\n\n return {\n title: getChatTitle(getTranslation, chat, privateChatUser),\n body,\n };\n}\n\nasync function getAvatar(chat: ApiChat) {\n const imageHash = getChatAvatarHash(chat);\n if (!imageHash) return undefined;\n let mediaData = mediaLoader.getFromMemory(imageHash);\n if (!mediaData) {\n await mediaLoader.fetch(imageHash, ApiMediaFormat.BlobUrl);\n mediaData = mediaLoader.getFromMemory(imageHash);\n }\n return mediaData;\n}\n\nexport async function notifyAboutMessage({\n chat,\n message,\n}: { chat: ApiChat; message: Partial }) {\n const { hasWebNotifications } = await loadNotificationSettings();\n if (!checkIfShouldNotify(chat)) return;\n const areNotificationsSupported = checkIfNotificationsSupported();\n if (!hasWebNotifications || !areNotificationsSupported) {\n // only play sound if web notifications are disabled\n playNotifySoundDebounced(String(message.id) || chat.id);\n return;\n }\n if (!areNotificationsSupported) return;\n\n if (!message.id) return;\n\n const activeReaction = getMessageRecentReaction(message);\n const icon = await getAvatar(chat);\n\n const {\n title,\n body,\n } = getNotificationContent(chat, message as ApiMessage, activeReaction);\n\n if (checkIfPushSupported()) {\n if (navigator.serviceWorker?.controller) {\n // notify service worker about new message notification\n navigator.serviceWorker.controller.postMessage({\n type: 'showMessageNotification',\n payload: {\n title,\n body,\n icon,\n chatId: chat.id,\n messageId: message.id,\n reaction: activeReaction ? activeReaction.reaction : undefined,\n },\n });\n }\n } else {\n const dispatch = getDispatch();\n const options: NotificationOptions = {\n body,\n icon,\n badge: icon,\n tag: String(message.id),\n };\n\n if ('vibrate' in navigator) {\n options.vibrate = [200, 100, 200];\n }\n\n const notification = new Notification(title, options);\n\n notification.onclick = () => {\n notification.close();\n dispatch.focusMessage({\n chatId: chat.id,\n messageId: message.id,\n });\n if (activeReaction) {\n dispatch.startActiveReaction({\n messageId: message.id,\n reaction: activeReaction.reaction,\n });\n }\n if (window.focus) {\n window.focus();\n }\n };\n\n // Play sound when notification is displayed\n notification.onshow = () => {\n playNotifySoundDebounced(String(message.id) || chat.id);\n };\n }\n}\n\nexport function closeMessageNotifications(payload: { chatId: string; lastReadInboxMessageId?: number }) {\n if (IS_TEST || !navigator.serviceWorker?.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'closeMessageNotifications',\n payload,\n });\n}\n\n// Notify service worker that client is fully loaded\nexport function notifyClientReady() {\n if (!navigator.serviceWorker?.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'clientReady',\n });\n}\n","const PERMANENT_VERSION_KEY = 'kz_version';\nconst AVAILABLE_VERSIONS = ['Z', 'K'] as const;\nconst DEFAULT_VERSION = 'Z';\n\nexport function setPermanentWebVersion(version: typeof AVAILABLE_VERSIONS[number]) {\n localStorage.setItem(PERMANENT_VERSION_KEY, JSON.stringify(version));\n}\n\nexport function ensurePermanentWebVersion() {\n if (!hasPermanentWebVersion()) {\n setPermanentWebVersion(DEFAULT_VERSION);\n }\n}\n\nfunction hasPermanentWebVersion() {\n const json = localStorage.getItem(PERMANENT_VERSION_KEY);\n if (!json) {\n return false;\n }\n\n try {\n const version = JSON.parse(json);\n return AVAILABLE_VERSIONS.includes(version);\n } catch (err) {\n return false;\n }\n}\n","import { ApiCountryCode } from '../api/types';\nimport { flatten } from './iteratees';\n\nconst PATTERN_PLACEHOLDER = 'X';\nconst DEFAULT_PATTERN = 'XXX XXX XXX XXX';\n\nexport function getCountryCodesByIso(phoneCodeList: ApiCountryCode[], iso: string) {\n return phoneCodeList.filter((country) => country.iso2 === iso);\n}\n\nexport function getCountryFromPhoneNumber(phoneCodeList: ApiCountryCode[], input = '') {\n let phoneNumber = input.replace(/[^\\d+]+/g, '');\n if (phoneNumber.startsWith('+')) {\n phoneNumber = phoneNumber.substr(1);\n }\n\n const possibleCountries = phoneCodeList\n .filter((country) => phoneNumber.startsWith(country.countryCode));\n const codesWithPrefix: { code: string; country: ApiCountryCode }[] = flatten(possibleCountries\n .map((country) => (country.prefixes || ['']).map((prefix) => {\n return {\n code: `${country.countryCode}${prefix}`,\n country,\n };\n })));\n\n const bestMatches = codesWithPrefix\n .filter(({ code }) => phoneNumber.startsWith(code))\n .sort((a, b) => a.code.length - b.code.length);\n\n return bestMatches[bestMatches.length - 1]?.country;\n}\n\nexport function formatPhoneNumber(input: string, country?: ApiCountryCode) {\n let phoneNumber = input.replace(/[^\\d]+/g, '');\n if (country) {\n phoneNumber = phoneNumber.substr(country.countryCode.length);\n } else if (input.startsWith('+')) {\n return input;\n }\n const pattern = getBestPattern(phoneNumber, country?.patterns);\n\n const result: string[] = []; // Result character array\n let j = 0; // Position inside pattern\n for (let i = 0; i < phoneNumber.length; i++) {\n while (pattern[j] !== PATTERN_PLACEHOLDER && j < pattern.length) {\n result.push(pattern[j]);\n if (pattern[j] === phoneNumber[i]) { // If pattern contains digits, move input position too\n i++;\n if (i === phoneNumber.length) break; // But don't overdo it, or it will insert full pattern unexpectedly\n }\n j++;\n }\n\n result.push(phoneNumber[i]); // For placeholder characters, setting current input digit\n j++;\n }\n\n return result.join('');\n}\n\nfunction getBestPattern(numberWithoutCode: string, patterns?: string[]) {\n if (!patterns || patterns.length === 0) return DEFAULT_PATTERN;\n if (patterns.length === 1) return patterns[0];\n\n const defaultPattern = patterns.find((pattern) => pattern.startsWith(PATTERN_PLACEHOLDER)) || DEFAULT_PATTERN;\n\n const bestMatches = patterns.filter((pattern) => {\n const stripped = pattern.replace(/[^\\dX]+/g, '');\n if (stripped.startsWith(PATTERN_PLACEHOLDER)) return false; // Don't consider default number format here\n for (let i = 0; i < numberWithoutCode.length; i++) {\n if (i > stripped.length - 1 || (stripped[i] !== PATTERN_PLACEHOLDER && stripped[i] !== numberWithoutCode[i])) {\n return false;\n }\n }\n return true;\n });\n\n // Playing it safe: if not sure, use default for that region\n return bestMatches.length === 1 ? bestMatches[0] : defaultPattern;\n}\n\nexport function formatPhoneNumberWithCode(phoneCodeList: ApiCountryCode[], phoneNumber: string) {\n const numberWithPlus = phoneNumber.startsWith('+') ? phoneNumber : `+${phoneNumber}`;\n const country = getCountryFromPhoneNumber(phoneCodeList, numberWithPlus);\n if (!country) {\n return numberWithPlus;\n }\n return `+${country.countryCode} ${formatPhoneNumber(numberWithPlus, country)}`;\n}\n","import { MessageList, MessageListType } from '../global/types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nimport { LOCATION_HASH } from '../hooks/useHistoryBack';\n\nexport function createMessageHash(messageList: MessageList) {\n const typeOrThreadId = messageList.type !== 'thread' ? (\n `_${messageList.type}`\n ) : messageList.threadId !== -1 ? (\n `_${messageList.threadId}`\n ) : '';\n\n return `${messageList.chatId}${typeOrThreadId}`;\n}\n\nexport function parseLocationHash() {\n if (!LOCATION_HASH) return undefined;\n\n const [chatId, typeOrThreadId] = LOCATION_HASH.replace(/^#/, '').split('_');\n if (!chatId?.match(/^-?\\d+$/)) return undefined;\n\n const isType = ['thread', 'pinned', 'scheduled'].includes(typeOrThreadId);\n\n return {\n chatId,\n type: Boolean(typeOrThreadId) && isType ? (typeOrThreadId as MessageListType) : 'thread',\n threadId: Boolean(typeOrThreadId) && !isType ? Number(typeOrThreadId) : MAIN_THREAD_ID,\n };\n}\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastRafPrimary, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n fn(...args);\n });\n }\n };\n}\n\nexport function onIdle(cb: NoneToVoidFunction, timeout?: number) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb, { timeout });\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastRafPrimary(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet onTickEndCallbacks: NoneToVoidFunction[] | undefined;\nlet onTickEndPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onTickEnd(callback: NoneToVoidFunction, isPrimary = false) {\n if (!onTickEndCallbacks) {\n onTickEndCallbacks = isPrimary ? [] : [callback];\n onTickEndPrimaryCallbacks = isPrimary ? [callback] : [];\n\n Promise.resolve().then(() => {\n const currentCallbacks = onTickEndCallbacks!;\n const currentPrimaryCallbacks = onTickEndPrimaryCallbacks!;\n onTickEndCallbacks = undefined;\n onTickEndPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n onTickEndPrimaryCallbacks!.push(callback);\n } else {\n onTickEndCallbacks.push(callback);\n }\n}\n\nexport function onTickEndPrimary(callback: NoneToVoidFunction) {\n onTickEnd(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","let RE_NOT_LETTER: RegExp;\n\ntry {\n RE_NOT_LETTER = new RegExp('[^\\\\p{L}\\\\p{M}]+', 'ui');\n} catch (e) {\n // Support for older versions of firefox\n RE_NOT_LETTER = new RegExp('[^\\\\wа-яё]+', 'i');\n}\n\nexport default function searchWords(haystack: string, needle: string | string[]) {\n if (!haystack || !needle) {\n return false;\n }\n\n const needleWords = typeof needle === 'string' ? needle.toLowerCase().split(RE_NOT_LETTER) : needle;\n const haystackLower = haystack.toLowerCase();\n\n // @optimization\n if (needleWords.length === 1 && !haystackLower.includes(needleWords[0])) {\n return false;\n }\n\n let haystackWords: string[];\n\n return needleWords.every((needleWord) => {\n if (!haystackLower.includes(needleWord)) {\n return false;\n }\n\n if (!haystackWords) {\n haystackWords = haystackLower.split(RE_NOT_LETTER);\n }\n\n return haystackWords.some((haystackWord) => haystackWord.startsWith(needleWord));\n });\n}\n\nexport function prepareSearchWordsForNeedle(needle: string) {\n const needleWords = needle.toLowerCase().split(RE_NOT_LETTER);\n\n return (haystack: string) => searchWords(haystack, needleWords);\n}\n","export const getServerTime = (serverTimeOffset: number) => {\n return Math.floor(Date.now() / 1000) + serverTimeOffset;\n};\n","import safariFix from 'safari-14-idb-fix';\n\nfunction promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const dbp = safariFix().then(() => {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n return promisifyRequest(request);\n });\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * Work around Safari 14 IndexedDB open bug.\n *\n * Safari has a horrible bug where IDB requests can hang while the browser is starting up. https://bugs.webkit.org/show_bug.cgi?id=226547\n * The only solution is to keep nudging it until it's awake.\n */\nfunction idbReady() {\n var isSafari = !navigator.userAgentData &&\n /Safari\\//.test(navigator.userAgent) &&\n !/Chrom(e|ium)\\//.test(navigator.userAgent);\n // No point putting other browsers or older versions of Safari through this mess.\n if (!isSafari || !indexedDB.databases)\n return Promise.resolve();\n var intervalId;\n return new Promise(function (resolve) {\n var tryIdb = function () { return indexedDB.databases().finally(resolve); };\n intervalId = setInterval(tryIdb, 100);\n tryIdb();\n }).finally(function () { return clearInterval(intervalId); });\n}\n\nexport default idbReady;\n","import * as idb from 'idb-keyval';\n\nimport { ApiSessionData } from '../api/types';\n\nimport { DEBUG, LEGACY_SESSION_KEY, SESSION_USER_KEY } from '../config';\nimport * as cacheApi from './cacheApi';\n\nconst DC_IDS = [1, 2, 3, 4, 5];\n\nexport function hasStoredSession(withLegacy = false) {\n if (withLegacy && localStorage.getItem(LEGACY_SESSION_KEY)) {\n return true;\n }\n\n const userAuthJson = localStorage.getItem(SESSION_USER_KEY);\n if (!userAuthJson) return false;\n\n try {\n const userAuth = JSON.parse(userAuthJson);\n return Boolean(userAuth && userAuth.id && userAuth.dcID);\n } catch (err) {\n // Do nothing.\n return false;\n }\n}\n\nexport function storeSession(sessionData: ApiSessionData, currentUserId?: string) {\n const { mainDcId, keys, hashes } = sessionData;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify({ dcID: mainDcId, id: currentUserId }));\n localStorage.setItem('dc', String(mainDcId));\n Object.keys(keys).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_auth_key`, JSON.stringify(keys[dcId]));\n });\n\n if (hashes) {\n Object.keys(hashes).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId]));\n });\n }\n}\n\nexport function clearStoredSession() {\n [\n SESSION_USER_KEY,\n 'dc',\n ...DC_IDS.map((dcId) => `dc${dcId}_auth_key`),\n ...DC_IDS.map((dcId) => `dc${dcId}_hash`),\n ].forEach((key) => {\n localStorage.removeItem(key);\n });\n}\n\nexport function loadStoredSession(): ApiSessionData | undefined {\n if (!hasStoredSession()) {\n return undefined;\n }\n\n const userAuth = JSON.parse(localStorage.getItem(SESSION_USER_KEY)!);\n const mainDcId = Number(userAuth.dcID);\n const keys: Record = {};\n const hashes: Record = {};\n\n DC_IDS.forEach((dcId) => {\n try {\n const key = localStorage.getItem(`dc${dcId}_auth_key`);\n if (key) {\n keys[dcId] = JSON.parse(key);\n }\n\n const hash = localStorage.getItem(`dc${dcId}_hash`);\n if (hash) {\n hashes[dcId] = JSON.parse(hash);\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load stored session', err);\n }\n // Do nothing.\n }\n });\n\n if (!Object.keys(keys).length) return undefined;\n\n return {\n mainDcId,\n keys,\n hashes,\n };\n}\n\nexport async function importLegacySession() {\n const sessionId = localStorage.getItem(LEGACY_SESSION_KEY);\n if (!sessionId) return;\n\n const sessionJson = await idb.get(`GramJs:${sessionId}`);\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData;\n storeSession(sessionData);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load legacy session', err);\n }\n // Do nothing.\n }\n}\n\n// Remove previously created IndexedDB and cache API sessions\nexport async function clearLegacySessions() {\n localStorage.removeItem(LEGACY_SESSION_KEY);\n\n const idbKeys = await idb.keys();\n\n await Promise.all>([\n cacheApi.clear('GramJs'),\n ...idbKeys\n .filter((k) => typeof k === 'string' && k.startsWith('GramJs:GramJs-session-'))\n .map((k) => idb.del(k)),\n ]);\n}\n\nexport function importTestSession() {\n const sessionJson = process.env.TEST_SESSION!;\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData & { userId: string };\n storeSession(sessionData, sessionData.userId);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load test session', err);\n }\n // Do nothing.\n }\n}\n","import { ISettings } from '../types';\n\nimport { animateSingle } from './animation';\nimport { fastRaf } from './schedulers';\n\nimport themeColors from '../styles/themes.json';\n\ntype RGBAColor = {\n r: number;\n g: number;\n b: number;\n a?: number;\n};\n\nlet isInitialized = false;\n\nconst HEX_COLOR_REGEX = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i;\nconst DURATION_MS = 200;\nconst ENABLE_ANIMATION_DELAY_MS = 500;\nconst RGB_VARIABLES = new Set([\n '--color-primary-shade',\n '--color-text-secondary',\n]);\n\nconst lerp = (start: number, end: number, interpolationRatio: number) => {\n return (1 - interpolationRatio) * start + interpolationRatio * end;\n};\n\nconst colors = (Object.keys(themeColors) as Array).map((property) => ({\n property,\n colors: [hexToRgb(themeColors[property][0]), hexToRgb(themeColors[property][1])],\n}));\n\nconst switchTheme = (theme: ISettings['theme'], withAnimation: boolean) => {\n const isDarkTheme = theme === 'dark';\n const shouldAnimate = isInitialized && withAnimation;\n const startIndex = isDarkTheme ? 0 : 1;\n const endIndex = isDarkTheme ? 1 : 0;\n const startAt = Date.now();\n const themeColorTag = document.querySelector('meta[name=\"theme-color\"]');\n\n document.documentElement.classList.remove(`theme-${isDarkTheme ? 'light' : 'dark'}`);\n if (isInitialized) {\n document.documentElement.classList.add('no-animations');\n }\n document.documentElement.classList.add(`theme-${theme}`);\n if (themeColorTag) {\n themeColorTag.setAttribute('content', isDarkTheme ? '#212121' : '#fff');\n }\n\n setTimeout(() => {\n document.documentElement.classList.remove('no-animations');\n }, ENABLE_ANIMATION_DELAY_MS);\n\n isInitialized = true;\n\n if (shouldAnimate) {\n fastRaf(() => {\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / DURATION_MS, 1);\n\n applyColorAnimationStep(startIndex, endIndex, transition(t));\n\n return t < 1;\n });\n });\n } else {\n applyColorAnimationStep(startIndex, endIndex);\n }\n};\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n\nfunction hexToRgb(hex: string): RGBAColor {\n const result = HEX_COLOR_REGEX.exec(hex)!;\n\n return {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n a: result[4] !== undefined ? parseInt(result[4], 16) : undefined,\n };\n}\n\nfunction applyColorAnimationStep(startIndex: number, endIndex: number, interpolationRatio: number = 1) {\n colors.forEach(({ property, colors: propertyColors }) => {\n const r = Math.round(lerp(propertyColors[startIndex].r, propertyColors[endIndex].r, interpolationRatio));\n const g = Math.round(lerp(propertyColors[startIndex].g, propertyColors[endIndex].g, interpolationRatio));\n const b = Math.round(lerp(propertyColors[startIndex].b, propertyColors[endIndex].b, interpolationRatio));\n const a = propertyColors[startIndex].a !== undefined\n ? Math.round(lerp(propertyColors[startIndex].a!, propertyColors[endIndex].a!, interpolationRatio))\n : undefined;\n\n document.documentElement.style.setProperty(property, a !== undefined\n ? `rgba(${r},${g},${b},${a / 255})`\n : `rgb(${r},${g},${b})`);\n\n if (RGB_VARIABLES.has(property)) {\n document.documentElement.style.setProperty(`${property}-rgb`, `${r},${g},${b}`);\n }\n });\n}\n\nexport default switchTheme;\n","import EMOJI_REGEX from '../lib/twemojiRegex';\nimport { fixNonStandardEmoji } from './emoji';\n\nexport function formatInteger(value: number) {\n return String(value).replace(/\\d(?=(\\d{3})+$)/g, '$& ');\n}\n\nfunction formatFixedNumber(number: number) {\n const fixed = String(number.toFixed(1));\n if (fixed.substr(-2) === '.0') {\n return Math.round(number);\n }\n\n return number.toFixed(1).replace('.', ',');\n}\n\nexport function formatIntegerCompact(views: number) {\n if (views < 1e3) {\n return views;\n }\n\n if (views < 1e6) {\n return `${formatFixedNumber(views / 1e3)}K`;\n }\n\n return `${formatFixedNumber(views / 1e6)}M`;\n}\n\nexport function getFirstLetters(phrase: string, count = 2) {\n return phrase\n .replace(/[.,!@#$%^&*()_+=\\-`~[\\]/\\\\{}:\"|<>?]+/gi, '')\n .trim()\n .split(/\\s+/)\n .slice(0, count)\n .map((word: string) => {\n if (!word.length) return '';\n word = fixNonStandardEmoji(word);\n const emojis = word.match(EMOJI_REGEX);\n if (emojis && word.startsWith(emojis[0])) {\n return emojis[0];\n }\n return word.match(/./u)![0].toUpperCase();\n })\n .join('');\n}\n","export default function trimText(text: T, length?: number) {\n if (!text || !length || text.length <= length) {\n return text;\n }\n\n return `${text.substring(0, length)}...`;\n}\n","import { isWebpSupported } from './environment';\nimport { dataUriToBlob, blobToDataUri } from './files';\nimport { pause } from './schedulers';\n\nconst WORKER_INITIALIZATION_TIMEOUT = 2000;\n\nlet canvas: HTMLCanvasElement;\nlet worker: IWebpWorker;\n\nexport const EMPTY_IMAGE_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk'\n + 'YAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n\nexport async function webpToPng(url: string, blob: Blob): Promise {\n initWebpWorker();\n\n while (!worker.wasmReady) {\n await pause(WORKER_INITIALIZATION_TIMEOUT);\n }\n\n const { result, width, height } = await getDecodePromise(url, blob);\n if (!width || !height) {\n return undefined;\n }\n\n return createPng({ result, width, height });\n}\n\nexport async function webpToPngBase64(key: string, dataUri: string): Promise {\n if (isWebpSupported() || dataUri.substr(0, 15) !== 'data:image/webp') {\n return dataUri;\n }\n\n initWebpWorker();\n\n const pngBlob = await webpToPng(key, dataUriToBlob(dataUri));\n\n if (!pngBlob) {\n throw new Error(`Can't convert webp to png. Url: ${dataUri}`);\n }\n\n return blobToDataUri(pngBlob);\n}\n\nfunction initWebpWorker() {\n if (!worker) {\n worker = new Worker(new URL('../lib/webp/webp_wasm.worker.js', import.meta.url)) as IWebpWorker;\n worker.wasmReady = false;\n worker.onmessage = handleLibWebpMessage;\n }\n}\n\nfunction createPng({ result, width, height }: TEncodedImage): Promise {\n if (!canvas) {\n canvas = document.createElement('canvas');\n }\n\n return new Promise((resolve) => {\n const img = new ImageData(result, width, height);\n\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d')!;\n ctx.putImageData(img, 0, 0);\n\n canvas.toBlob((blob) => {\n resolve(blob ?? undefined);\n }, 'image/png', 1);\n });\n}\n\nfunction handleLibWebpMessage(e: MessageEvent) {\n const { id } = e.data;\n switch (e.data.type) {\n case 'initialized': {\n worker.wasmReady = true;\n break;\n }\n\n case 'result': {\n if (worker.requests.has(id)) {\n const resolve = worker.requests.get(id)!;\n\n worker.requests.delete(id);\n resolve(e.data!);\n }\n break;\n }\n }\n}\n\nfunction getDecodePromise(url: string, blob: Blob): Promise {\n return new Promise((resolve) => {\n if (!worker.requests) {\n worker.requests = new Map();\n }\n\n worker.requests.set(url, resolve);\n worker.postMessage({ id: url, blob });\n });\n}\n","import { APP_VERSION, DEBUG } from '../config';\nimport { getGlobal } from '../lib/teact/teactn';\nimport { hasStoredSession } from './sessions';\n\nconst WEBSYNC_URLS = [\n 't.me',\n 'telegram.me',\n].map((domain) => `//${domain}/_websync_?`);\nconst WEBSYNC_VERSION = `${APP_VERSION} Z`;\nconst WEBSYNC_KEY = 'tgme_sync';\nconst WEBSYNC_TIMEOUT = 86400;\n\nconst getTs = () => {\n return Math.floor(Number(new Date()) / 1000);\n};\n\nconst saveSync = (authed: boolean) => {\n const ts = getTs();\n localStorage.setItem(WEBSYNC_KEY, JSON.stringify({\n canRedirect: authed,\n ts,\n }));\n};\n\nlet lastTimeout: NodeJS.Timeout | undefined;\n\nexport const forceWebsync = (authed: boolean) => {\n const currentTs = getTs();\n\n const { canRedirect, ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n if (canRedirect !== authed || ts + WEBSYNC_TIMEOUT <= currentTs) {\n return Promise.all(WEBSYNC_URLS.map((url) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n\n const removeElement = () => Boolean(document.body.removeChild(script));\n\n script.src = url + new URLSearchParams({\n authed: Number(authed).toString(),\n version: WEBSYNC_VERSION,\n });\n\n document.body.appendChild(script);\n\n script.onload = () => {\n saveSync(authed);\n removeElement();\n if (lastTimeout) {\n clearTimeout(lastTimeout);\n lastTimeout = undefined;\n }\n startWebsync();\n resolve();\n };\n\n script.onerror = () => {\n removeElement();\n reject();\n };\n });\n }));\n } else {\n return Promise.resolve();\n }\n};\n\nexport function startWebsync() {\n if (DEBUG) {\n return;\n }\n\n if (lastTimeout !== undefined) return;\n const currentTs = getTs();\n\n const { ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n const timeout = WEBSYNC_TIMEOUT - (currentTs - ts);\n\n lastTimeout = setTimeout(() => {\n const { authState } = getGlobal();\n\n const authed = authState === 'authorizationStateReady' || hasStoredSession(true);\n forceWebsync(authed);\n }, Math.max(0, timeout * 1000));\n}\n\nexport function clearWebsync() {\n localStorage.removeItem(WEBSYNC_KEY);\n}\n","import { throttle } from './schedulers';\nimport {\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT } from './environment';\n\ntype IDimensions = {\n width: number;\n height: number;\n};\n\nconst IS_LANDSCAPE = IS_SINGLE_COLUMN_LAYOUT && isLandscape();\n\nconst initialHeight = window.innerHeight;\nlet currentWindowSize = updateSizes();\nlet isRefreshDisabled = false;\n\nfunction disableRefresh() {\n isRefreshDisabled = true;\n}\n\nfunction enableRefresh() {\n isRefreshDisabled = false;\n}\n\nconst handleResize = throttle(() => {\n currentWindowSize = updateSizes();\n\n if (!isRefreshDisabled && (\n isMobileScreen() !== IS_SINGLE_COLUMN_LAYOUT\n || (IS_SINGLE_COLUMN_LAYOUT && IS_LANDSCAPE !== isLandscape())\n )) {\n window.location.reload();\n }\n}, 250, true);\n\nwindow.addEventListener('orientationchange', handleResize);\nif (IS_IOS) {\n window.visualViewport.addEventListener('resize', handleResize);\n} else {\n window.addEventListener('resize', handleResize);\n}\n\nexport function updateSizes(): IDimensions {\n let height: number;\n if (IS_IOS) {\n height = window.visualViewport.height + window.visualViewport.pageTop;\n } else {\n height = window.innerHeight;\n }\n const vh = height * 0.01;\n\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n}\n\nfunction isMobileScreen() {\n return currentWindowSize.width <= MOBILE_SCREEN_MAX_WIDTH || (\n currentWindowSize.width <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH\n && currentWindowSize.height <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n );\n}\n\nfunction isLandscape() {\n if (IS_IOS) {\n return window.matchMedia('(orientation: landscape)').matches;\n }\n\n // eslint-disable-next-line max-len\n // Source: https://web.archive.org/web/20160509220835/http://blog.abouthalf.com/development/orientation-media-query-challenges-in-android-browsers/\n // Feature is marked as deprecated now, but it is still supported\n // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-aspect-ratio#browser_compatibility\n return window.matchMedia('screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)').matches;\n}\n\nconst windowSize = {\n get: () => currentWindowSize,\n getIsKeyboardVisible: () => initialHeight > currentWindowSize.height,\n disableRefresh,\n enableRefresh,\n};\n\nexport default windowSize;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"47\":\"b422d6da038c24068089\",\"99\":\"4acb17d13e1a5b87b131\",\"133\":\"ac23512cbe1955fbc721\",\"161\":\"4fade15904bfe66b4f71\",\"176\":\"2bd8fc859463a252c8a2\",\"302\":\"317a243801f66d9ed028\",\"347\":\"595121c92ffb31ae37da\",\"354\":\"e30ac9a934f7627782aa\",\"472\":\"65a66b6c1fb1be8db986\",\"501\":\"3c8f4d2d9fb141fac95f\",\"524\":\"08e4e0ac4b22371b853f\",\"536\":\"ab2a889dae72ec88f68c\",\"626\":\"6c9310e081bfd315824b\",\"687\":\"b0ad3fcc6328cf70a271\",\"745\":\"cc53f6e29328dbd2c9ff\",\"830\":\"3dad49e3bca3c0b28df2\",\"915\":\"af01666698d37aea6ce6\",\"941\":\"24c93ec02ada9e8159a1\",\"993\":\"5065d2f591c9fc4f83b4\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"47\":\"b422d6da038c24068089\",\"133\":\"ac23512cbe1955fbc721\",\"176\":\"2bd8fc859463a252c8a2\",\"347\":\"595121c92ffb31ae37da\",\"472\":\"65a66b6c1fb1be8db986\",\"687\":\"b0ad3fcc6328cf70a271\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","import { DEBUG, DEBUG_MORE } from '../config';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport { notifyClientReady, playNotifySoundDebounced } from './notifications';\n\ntype WorkerAction = {\n type: string;\n payload: Record;\n};\n\nfunction handleWorkerMessage(e: MessageEvent) {\n const action: WorkerAction = e.data;\n if (DEBUG_MORE) {\n // eslint-disable-next-line no-console\n console.log('[SW] Message from worker', action);\n }\n if (!action.type) return;\n const dispatch = getDispatch();\n const payload = action.payload;\n switch (action.type) {\n case 'focusMessage':\n if (dispatch.focusMessage) {\n dispatch.focusMessage(payload);\n }\n if (dispatch.startActiveReaction && payload.reaction) {\n dispatch.startActiveReaction({\n messageId: payload.messageId,\n reaction: payload.reaction,\n });\n }\n break;\n case 'playNotificationSound':\n playNotifySoundDebounced(action.payload.id);\n break;\n }\n}\n\nfunction subscribeToWorker() {\n navigator.serviceWorker.removeEventListener('message', handleWorkerMessage);\n navigator.serviceWorker.addEventListener('message', handleWorkerMessage);\n // Notify web worker that client is ready to receive messages\n notifyClientReady();\n}\n\nif (IS_SERVICE_WORKER_SUPPORTED) {\n window.addEventListener('load', async () => {\n try {\n if (!navigator.serviceWorker.controller) {\n const registrations = await navigator.serviceWorker.getRegistrations();\n if (registrations.length) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Hard reload detected, re-enabling Service Worker');\n }\n await Promise.all(registrations.map(r => r.unregister()));\n }\n }\n\n await navigator.serviceWorker.register(new URL('../serviceWorker.ts', import.meta.url));\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker registered');\n }\n\n await navigator.serviceWorker.ready;\n\n if (navigator.serviceWorker.controller) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker ready');\n }\n subscribeToWorker();\n } else {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker not available');\n }\n\n if (!IS_IOS && !IS_ANDROID) {\n getDispatch().showDialog({ data: { message: 'SERVICE_WORKER_DISABLED', hasErrorKey: true } });\n }\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker registration failed: ', err);\n }\n }\n });\n window.addEventListener('focus', async () => {\n await navigator.serviceWorker.ready;\n subscribeToWorker();\n });\n}\n","import { GlobalState } from './types';\nimport { NewChatMembersProgress } from '../types';\n\nimport {\n ANIMATION_LEVEL_DEFAULT, DARK_THEME_PATTERN_COLOR, DEFAULT_MESSAGE_TEXT_SIZE_PX, DEFAULT_PATTERN_COLOR,\n DEFAULT_PLAYBACK_RATE,\n DEFAULT_VOLUME,\n IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX, MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX,\n} from '../config';\nimport { IS_IOS, IS_MAC_OS } from '../util/environment';\n\nexport const INITIAL_STATE: GlobalState = {\n isLeftColumnShown: true,\n isChatInfoShown: false,\n newChatMembersProgress: NewChatMembersProgress.Closed,\n uiReadyState: 0,\n serverTimeOffset: 0,\n\n authRememberMe: true,\n countryList: {\n phoneCodes: [],\n general: [],\n },\n\n blocked: {\n ids: [],\n totalCount: 0,\n },\n\n users: {\n byId: {},\n statusesById: {},\n },\n\n chats: {\n listIds: {},\n isFullyLoaded: {},\n orderedPinnedIds: {},\n totalCount: {},\n byId: {},\n },\n\n messages: {\n byChatId: {},\n messageLists: [],\n sponsoredByChatId: {},\n },\n\n groupCalls: {\n byId: {},\n },\n\n scheduledMessages: {\n byChatId: {},\n },\n\n chatFolders: {\n byId: {},\n activeChatFolder: 0,\n },\n\n fileUploads: {\n byMessageLocalId: {},\n },\n\n recentEmojis: ['grinning', 'kissing_heart', 'christmas_tree', 'brain', 'trophy'],\n\n stickers: {\n setsById: {},\n added: {},\n recent: {\n stickers: [],\n },\n favorite: {\n stickers: [],\n },\n greeting: {\n stickers: [],\n },\n featured: {\n setIds: [],\n },\n search: {},\n forEmoji: {},\n },\n\n emojiKeywords: {},\n\n gifs: {\n saved: {},\n search: {},\n },\n\n inlineBots: {\n isLoading: false,\n byUsername: {},\n },\n\n globalSearch: {},\n\n userSearch: {},\n\n localTextSearch: {\n byChatThreadKey: {},\n },\n\n localMediaSearch: {\n byChatId: {},\n },\n\n management: {\n byChatId: {},\n },\n\n topPeers: {},\n\n topInlineBots: {},\n\n mediaViewer: {},\n\n audioPlayer: {\n volume: DEFAULT_VOLUME,\n playbackRate: DEFAULT_PLAYBACK_RATE,\n isMuted: false,\n },\n\n forwardMessages: {},\n\n pollResults: {},\n\n payment: {},\n\n notifications: [],\n\n dialogs: [],\n\n activeSessions: [],\n\n settings: {\n byKey: {\n theme: 'light',\n shouldUseSystemTheme: true,\n messageTextSize: IS_IOS\n ? IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX\n : (IS_MAC_OS ? MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX : DEFAULT_MESSAGE_TEXT_SIZE_PX),\n animationLevel: ANIMATION_LEVEL_DEFAULT,\n messageSendKeyCombo: 'enter',\n canAutoLoadPhotoFromContacts: true,\n canAutoLoadPhotoInPrivateChats: true,\n canAutoLoadPhotoInGroups: true,\n canAutoLoadPhotoInChannels: true,\n canAutoLoadVideoFromContacts: true,\n canAutoLoadVideoInPrivateChats: true,\n canAutoLoadVideoInGroups: true,\n canAutoLoadVideoInChannels: true,\n canAutoLoadFileFromContacts: false,\n canAutoLoadFileInPrivateChats: false,\n canAutoLoadFileInGroups: false,\n canAutoLoadFileInChannels: false,\n autoLoadFileMaxSizeMb: 10,\n hasWebNotifications: true,\n hasPushNotifications: true,\n notificationSoundVolume: 5,\n canAutoPlayGifs: true,\n canAutoPlayVideos: true,\n shouldSuggestStickers: true,\n shouldLoopStickers: true,\n language: 'en',\n timeFormat: '24h',\n wasTimeFormatSetManually: false,\n isConnectionStatusMinimized: true,\n },\n themes: {\n light: {\n isBlurred: true,\n patternColor: DEFAULT_PATTERN_COLOR,\n },\n dark: {\n isBlurred: true,\n patternColor: DARK_THEME_PATTERN_COLOR,\n },\n },\n privacy: {},\n notifyExceptions: {},\n },\n\n twoFaSettings: {},\n activeReactions: {},\n\n shouldShowContextMenuHint: true,\n\n activeDownloads: {\n byChatId: {},\n },\n\n serviceNotifications: [],\n};\n","import {\n addCallback, addReducer, getGlobal, removeCallback,\n} from '../lib/teact/teactn';\n\nimport { GlobalState } from './types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nimport { onBeforeUnload, onIdle, throttle } from '../util/schedulers';\nimport {\n DEBUG,\n GLOBAL_STATE_CACHE_DISABLED,\n GLOBAL_STATE_CACHE_KEY,\n GLOBAL_STATE_CACHE_USER_LIST_LIMIT,\n GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT,\n GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n DEFAULT_VOLUME,\n DEFAULT_PLAYBACK_RATE,\n ALL_FOLDER_ID,\n ARCHIVED_FOLDER_ID,\n} from '../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\nimport { isHeavyAnimating } from '../hooks/useHeavyAnimationCheck';\nimport { pick, unique } from '../util/iteratees';\nimport {\n selectCurrentChat,\n selectCurrentMessageList,\n selectVisibleUsers,\n} from '../modules/selectors';\nimport { hasStoredSession } from '../util/sessions';\nimport { INITIAL_STATE } from './initial';\nimport { parseLocationHash } from '../util/routing';\nimport { isUserId } from '../modules/helpers';\nimport { getOrderedIds } from '../util/folderManager';\n\nconst UPDATE_THROTTLE = 5000;\n\nconst updateCacheThrottled = throttle(() => onIdle(updateCache), UPDATE_THROTTLE, false);\n\nlet isCaching = false;\nlet unsubscribeFromBeforeUnload: NoneToVoidFunction | undefined;\n\nexport function initCache() {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return;\n }\n\n addReducer('saveSession', () => {\n if (isCaching) {\n return;\n }\n\n setupCaching();\n });\n\n addReducer('reset', () => {\n localStorage.removeItem(GLOBAL_STATE_CACHE_KEY);\n\n if (!isCaching) {\n return;\n }\n\n clearCaching();\n });\n}\n\nexport function loadCache(initialState: GlobalState): GlobalState | undefined {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return undefined;\n }\n\n if (hasStoredSession(true)) {\n setupCaching();\n\n return readCache(initialState);\n } else {\n clearCaching();\n\n return undefined;\n }\n}\n\nfunction setupCaching() {\n isCaching = true;\n unsubscribeFromBeforeUnload = onBeforeUnload(updateCache, true);\n window.addEventListener('blur', updateCache);\n addCallback(updateCacheThrottled);\n}\n\nfunction clearCaching() {\n isCaching = false;\n removeCallback(updateCacheThrottled);\n window.removeEventListener('blur', updateCache);\n if (unsubscribeFromBeforeUnload) {\n unsubscribeFromBeforeUnload();\n }\n}\n\nfunction readCache(initialState: GlobalState): GlobalState {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.time('global-state-cache-read');\n }\n\n const json = localStorage.getItem(GLOBAL_STATE_CACHE_KEY);\n const cached = json ? JSON.parse(json) as GlobalState : undefined;\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.timeEnd('global-state-cache-read');\n }\n\n if (cached) {\n migrateCache(cached, initialState);\n }\n\n const newState = {\n ...initialState,\n ...cached,\n };\n\n const parsedMessageList = !IS_SINGLE_COLUMN_LAYOUT ? parseLocationHash() : undefined;\n\n return {\n ...newState,\n messages: {\n ...newState.messages,\n messageLists: parsedMessageList ? [parsedMessageList] : [],\n },\n };\n}\n\nfunction migrateCache(cached: GlobalState, initialState: GlobalState) {\n // Migrate from legacy setting names\n if ('shouldAutoDownloadMediaFromContacts' in cached.settings.byKey) {\n const {\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n shouldAutoPlayVideos,\n shouldAutoPlayGifs,\n ...rest\n } = cached.settings.byKey;\n\n cached.settings.byKey = {\n ...rest,\n canAutoLoadPhotoFromContacts: shouldAutoDownloadMediaFromContacts,\n canAutoLoadVideoFromContacts: shouldAutoDownloadMediaFromContacts,\n canAutoLoadPhotoInPrivateChats: shouldAutoDownloadMediaInPrivateChats,\n canAutoLoadVideoInPrivateChats: shouldAutoDownloadMediaInPrivateChats,\n canAutoLoadPhotoInGroups: shouldAutoDownloadMediaInGroups,\n canAutoLoadVideoInGroups: shouldAutoDownloadMediaInGroups,\n canAutoLoadPhotoInChannels: shouldAutoDownloadMediaInChannels,\n canAutoLoadVideoInChannels: shouldAutoDownloadMediaInChannels,\n canAutoPlayVideos: shouldAutoPlayVideos,\n canAutoPlayGifs: shouldAutoPlayGifs,\n };\n }\n\n // Pre-fill settings with defaults\n cached.settings.byKey = {\n ...initialState.settings.byKey,\n ...cached.settings.byKey,\n };\n\n cached.settings.themes = {\n ...initialState.settings.themes,\n ...cached.settings.themes,\n };\n\n cached.chatFolders = {\n ...initialState.chatFolders,\n ...cached.chatFolders,\n };\n\n if (!cached.stickers.greeting) {\n cached.stickers.greeting = initialState.stickers.greeting;\n }\n\n if (!cached.activeDownloads) {\n cached.activeDownloads = {\n byChatId: {},\n };\n }\n\n if (!cached.serviceNotifications) {\n cached.serviceNotifications = [];\n }\n\n if (cached.audioPlayer.volume === undefined) {\n cached.audioPlayer.volume = DEFAULT_VOLUME;\n }\n\n if (cached.audioPlayer.playbackRate === undefined) {\n cached.audioPlayer.playbackRate = DEFAULT_PLAYBACK_RATE;\n }\n\n if (!cached.groupCalls) {\n cached.groupCalls = initialState.groupCalls;\n }\n\n if (!cached.users.statusesById) {\n cached.users.statusesById = {};\n }\n\n if (!cached.messages.sponsoredByChatId) {\n cached.messages.sponsoredByChatId = {};\n }\n\n if (!cached.activeReactions) {\n cached.activeReactions = {};\n }\n}\n\nfunction updateCache() {\n if (!isCaching || isHeavyAnimating()) {\n return;\n }\n\n const global = getGlobal();\n\n if (global.isLoggingOut) {\n return;\n }\n\n const reducedGlobal: GlobalState = {\n ...INITIAL_STATE,\n ...pick(global, [\n 'authState',\n 'authPhoneNumber',\n 'authRememberMe',\n 'authNearestCountry',\n 'currentUserId',\n 'contactList',\n 'topPeers',\n 'topInlineBots',\n 'recentEmojis',\n 'push',\n 'shouldShowContextMenuHint',\n 'leftColumnWidth',\n 'serviceNotifications',\n ]),\n audioPlayer: {\n volume: global.audioPlayer.volume,\n playbackRate: global.audioPlayer.playbackRate,\n isMuted: global.audioPlayer.isMuted,\n },\n isChatInfoShown: reduceShowChatInfo(global),\n users: reduceUsers(global),\n chats: reduceChats(global),\n messages: reduceMessages(global),\n globalSearch: {\n recentlyFoundChatIds: global.globalSearch.recentlyFoundChatIds,\n },\n settings: reduceSettings(global),\n chatFolders: reduceChatFolders(global),\n groupCalls: reduceGroupCalls(global),\n availableReactions: reduceAvailableReactions(global),\n };\n\n const json = JSON.stringify(reducedGlobal);\n localStorage.setItem(GLOBAL_STATE_CACHE_KEY, json);\n}\n\nfunction reduceShowChatInfo(global: GlobalState): boolean {\n return window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ? global.isChatInfoShown\n : false;\n}\n\nfunction reduceUsers(global: GlobalState): GlobalState['users'] {\n const { users: { byId, statusesById }, currentUserId } = global;\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const visibleUserIds = selectVisibleUsers(global)?.map(({ id }) => id);\n\n const idsToSave = unique([\n ...currentUserId ? [currentUserId] : [],\n ...currentChatId && isUserId(currentChatId) ? [currentChatId] : [],\n ...visibleUserIds || [],\n ...global.topPeers.userIds || [],\n ...getOrderedIds(ALL_FOLDER_ID)?.filter(isUserId) || [],\n ...getOrderedIds(ARCHIVED_FOLDER_ID)?.filter(isUserId) || [],\n ...global.contactList?.userIds || [],\n ...global.globalSearch.recentlyFoundChatIds?.filter(isUserId) || [],\n ...Object.keys(byId),\n ]).slice(0, GLOBAL_STATE_CACHE_USER_LIST_LIMIT);\n\n return {\n byId: pick(byId, idsToSave),\n statusesById: pick(statusesById, idsToSave),\n };\n}\n\nfunction reduceChats(global: GlobalState): GlobalState['chats'] {\n const { chats: { byId }, currentUserId } = global;\n const currentChat = selectCurrentChat(global);\n const idsToSave = unique([\n ...currentUserId ? [currentUserId] : [],\n ...currentChat ? [currentChat.id] : [],\n ...getOrderedIds(ALL_FOLDER_ID) || [],\n ...getOrderedIds(ARCHIVED_FOLDER_ID) || [],\n ...global.globalSearch.recentlyFoundChatIds || [],\n ...Object.keys(byId),\n ]).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT);\n\n return {\n ...global.chats,\n isFullyLoaded: {},\n byId: pick(global.chats.byId, idsToSave),\n };\n}\n\nfunction reduceMessages(global: GlobalState): GlobalState['messages'] {\n const { currentUserId } = global;\n const byChatId: GlobalState['messages']['byChatId'] = {};\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const chatIdsToSave = [\n ...currentChatId ? [currentChatId] : [],\n ...currentUserId ? [currentUserId] : [],\n ...getOrderedIds(ALL_FOLDER_ID)?.slice(0, GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT) || [],\n ];\n\n chatIdsToSave.forEach((chatId) => {\n const current = global.messages.byChatId[chatId];\n if (!current) {\n return;\n }\n\n const mainThread = current.threadsById[MAIN_THREAD_ID];\n if (!mainThread || !mainThread.viewportIds) {\n return;\n }\n\n byChatId[chatId] = {\n byId: pick(current.byId, mainThread.viewportIds),\n threadsById: {\n [MAIN_THREAD_ID]: mainThread,\n },\n };\n });\n\n return {\n byChatId,\n messageLists: [],\n sponsoredByChatId: {},\n };\n}\n\nfunction reduceSettings(global: GlobalState): GlobalState['settings'] {\n const { byKey, themes } = global.settings;\n\n return {\n byKey,\n themes,\n privacy: {},\n notifyExceptions: {},\n };\n}\n\nfunction reduceChatFolders(global: GlobalState): GlobalState['chatFolders'] {\n return {\n ...global.chatFolders,\n activeChatFolder: 0,\n };\n}\n\nfunction reduceGroupCalls(global: GlobalState): GlobalState['groupCalls'] {\n return {\n ...global.groupCalls,\n byId: {},\n activeGroupCallId: undefined,\n isGroupCallPanelHidden: undefined,\n isFallbackConfirmOpen: undefined,\n };\n}\n\nfunction reduceAvailableReactions(global: GlobalState): GlobalState['availableReactions'] {\n return global.availableReactions\n ?.map((r) => pick(r, ['reaction', 'staticIcon', 'title', 'isInactive']));\n}\n","import { addReducer } from '../lib/teact/teactn';\n\nimport { INITIAL_STATE } from './initial';\nimport { initCache, loadCache } from './cache';\nimport { cloneDeep } from '../util/iteratees';\n\ninitCache();\n\naddReducer('init', () => {\n const initial = cloneDeep(INITIAL_STATE);\n return loadCache(initial) || initial;\n});\n","const STORAGE_KEY = 'tt-active-tab';\nconst INTERVAL = 2000;\n\nconst tabKey = String(Date.now() + Math.random());\n\nlocalStorage.setItem(STORAGE_KEY, tabKey);\n\nlet callback: NoneToVoidFunction;\n\nconst interval = window.setInterval(() => {\n if (callback && localStorage.getItem(STORAGE_KEY) !== tabKey) {\n callback();\n clearInterval(interval);\n }\n}, INTERVAL);\n\nexport function addActiveTabChangeListener(_callback: NoneToVoidFunction) {\n callback = _callback;\n}\n","const SITE_FONTS = ['400 1em Roboto', '500 1em Roboto'];\n\nexport default function preloadFonts() {\n if ('fonts' in document) {\n return Promise.all(SITE_FONTS.map((font) => document.fonts.load(font)));\n }\n\n return undefined;\n}\n","import React, { FC, useEffect } from '../../lib/teact/teact';\nimport { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport { getChatAvatarHash } from '../../modules/helpers/chats'; // Direct import for better module splitting\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { pause } from '../../util/schedulers';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport { Bundles, loadModule } from '../../util/moduleLoader';\nimport buildClassName from '../../util/buildClassName';\n\nimport './UiLoader.scss';\n\nimport telegramLogoPath from '../../assets/telegram-logo.svg';\nimport reactionThumbsPath from '../../assets/reaction-thumbs.png';\nimport monkeyPath from '../../assets/monkey.svg';\nimport { selectIsRightColumnShown, selectTheme } from '../../modules/selectors';\n\ntype OwnProps = {\n page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode';\n children: React.ReactNode;\n};\n\ntype StateProps =\n Pick\n & {\n hasCustomBackground?: boolean;\n hasCustomBackgroundColor: boolean;\n isRightColumnShown?: boolean;\n leftColumnWidth?: number;\n };\n\nconst MAX_PRELOAD_DELAY = 700;\nconst SECOND_STATE_DELAY = 1000;\nconst AVATARS_TO_PRELOAD = 10;\n\nfunction preloadAvatars() {\n const { listIds, byId } = getGlobal().chats;\n if (!listIds.active) {\n return undefined;\n }\n\n return Promise.all(listIds.active.slice(0, AVATARS_TO_PRELOAD).map((chatId) => {\n const chat = byId[chatId];\n if (!chat) {\n return undefined;\n }\n\n const avatarHash = getChatAvatarHash(chat);\n if (!avatarHash) {\n return undefined;\n }\n\n return mediaLoader.fetch(avatarHash, ApiMediaFormat.BlobUrl);\n }));\n}\n\nconst preloadTasks = {\n main: () => Promise.all([\n loadModule(Bundles.Main, 'Main')\n .then(preloadFonts),\n preloadAvatars(),\n preloadImage(reactionThumbsPath),\n ]),\n authPhoneNumber: () => Promise.all([\n preloadFonts(),\n preloadImage(telegramLogoPath),\n ]),\n authCode: () => preloadImage(monkeyPath),\n authPassword: () => preloadImage(monkeyPath),\n authQrCode: preloadFonts,\n};\n\nconst UiLoader: FC = ({\n page,\n children,\n hasCustomBackground,\n hasCustomBackgroundColor,\n isRightColumnShown,\n shouldSkipHistoryAnimations,\n leftColumnWidth,\n}) => {\n const { setIsUiReady } = getDispatch();\n\n const [isReady, markReady] = useFlag();\n const {\n shouldRender: shouldRenderMask, transitionClassNames,\n } = useShowTransition(!isReady, undefined, true);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n const safePreload = async () => {\n try {\n await preloadTasks[page]();\n } catch (err) {\n // Do nothing\n }\n };\n\n Promise.race([\n pause(MAX_PRELOAD_DELAY),\n safePreload(),\n ]).then(() => {\n markReady();\n setIsUiReady({ uiReadyState: 1 });\n\n timeout = window.setTimeout(() => {\n setIsUiReady({ uiReadyState: 2 });\n }, SECOND_STATE_DELAY);\n });\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n setIsUiReady({ uiReadyState: 0 });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n

\n {children}\n {shouldRenderMask && !shouldSkipHistoryAnimations && (\n
\n {page === 'main' ? (\n <>\n \n \n {isRightColumnShown &&
}\n \n ) : (\n
\n )}\n
\n )}\n
\n );\n};\n\nexport default withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, backgroundColor } = global.settings.themes[theme] || {};\n\n return {\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n uiReadyState: global.uiReadyState,\n hasCustomBackground: Boolean(background),\n hasCustomBackgroundColor: Boolean(backgroundColor),\n isRightColumnShown: selectIsRightColumnShown(global),\n leftColumnWidth: global.leftColumnWidth,\n };\n },\n)(UiLoader);\n","import * as langProvider from '../util/langProvider';\nimport { useState } from '../lib/teact/teact';\n\nconst useLangString = (langCode: string | undefined, key: string): string | undefined => {\n const [translation, setTranslation] = useState();\n\n if (langCode) {\n langProvider\n .getTranslationForLangString(langCode, key)\n .then(setTranslation);\n }\n\n return translation;\n};\n\nexport default useLangString;\n","import { LangCode } from '../../../types';\n\nexport function getSuggestedLanguage() {\n let suggestedLanguage = navigator.language;\n\n if (suggestedLanguage && suggestedLanguage !== 'pt-br') {\n suggestedLanguage = suggestedLanguage.substr(0, 2);\n }\n\n return suggestedLanguage as LangCode;\n}\n","import React, {\n FC, useState, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiCountryCode } from '../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { prepareSearchWordsForNeedle } from '../../util/searchWords';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { isoToEmoji } from '../../util/emoji';\nimport useOnChange from '../../hooks/useOnChange';\n\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport Spinner from '../ui/Spinner';\n\nimport './CountryCodeInput.scss';\n\ntype StateProps = {\n phoneCodeList: ApiCountryCode[];\n};\n\ntype OwnProps = {\n id: string;\n value?: ApiCountryCode;\n isLoading?: boolean;\n onChange: (value: ApiCountryCode) => void;\n};\n\nconst MENU_HIDING_DURATION = 200 + ANIMATION_END_DELAY;\nconst SELECT_TIMEOUT = 50;\n\nconst CountryCodeInput: FC = ({\n id,\n value,\n isLoading,\n onChange,\n phoneCodeList,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [filter, setFilter] = useState();\n const [filteredList, setFilteredList] = useState([]);\n\n const updateFilter = useCallback((filterValue?: string) => {\n setFilter(filterValue);\n setFilteredList(getFilteredList(phoneCodeList, filterValue));\n }, [phoneCodeList]);\n\n useOnChange(([prevPhoneCodeList]) => {\n if (prevPhoneCodeList?.length === 0 && phoneCodeList.length > 0) {\n updateFilter(filter);\n }\n }, [phoneCodeList, updateFilter]);\n\n const handleChange = useCallback((country: ApiCountryCode) => {\n onChange(country);\n\n setTimeout(() => updateFilter(undefined), MENU_HIDING_DURATION);\n }, [onChange, updateFilter]);\n\n const handleInput = useCallback((e: React.FormEvent) => {\n updateFilter(e.currentTarget.value);\n }, [updateFilter]);\n\n const handleInputKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 8) {\n return;\n }\n\n const target = e.currentTarget;\n if (value && filter === undefined) {\n target.value = '';\n }\n\n updateFilter(target.value);\n }, [filter, updateFilter, value]);\n\n const CodeInput: FC<{ onTrigger: () => void; isOpen?: boolean }> = ({ onTrigger, isOpen }) => {\n const handleTrigger = () => {\n if (isOpen) {\n return;\n }\n\n setTimeout(() => {\n inputRef.current!.select();\n }, SELECT_TIMEOUT);\n\n onTrigger();\n\n const formEl = document.getElementById('auth-phone-number-form')!;\n formEl.scrollTo({ top: formEl.scrollHeight, behavior: 'smooth' });\n };\n\n const handleCodeInput = (e: React.FormEvent) => {\n handleInput(e);\n handleTrigger();\n };\n\n const inputValue = filter ?? (value?.name || value?.defaultName || '');\n\n return (\n
\n \n \n {isLoading ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n return (\n \n {filteredList\n .map((country: ApiCountryCode) => (\n handleChange(country)}\n >\n {renderText(isoToEmoji(country.iso2), ['hq_emoji'])}\n {country.name || country.defaultName}\n {country.countryCode}\n \n ))}\n {!filteredList.length && (\n \n {lang('lng_country_none')}\n \n )}\n \n );\n};\n\nfunction getFilteredList(countryList: ApiCountryCode[], filter = ''): ApiCountryCode[] {\n if (!filter.length) {\n return countryList;\n }\n\n const searchWords = prepareSearchWordsForNeedle(filter);\n\n return countryList.filter((country) => (\n searchWords(country.defaultName) || (country.name && searchWords(country.name))\n ));\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { countryList: { phoneCodes: phoneCodeList } } = global;\n return {\n phoneCodeList,\n };\n },\n)(CountryCodeInput));\n","import { ChangeEvent } from 'react';\n\nimport monkeyPath from '../../assets/monkey.svg';\n\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\nimport { LangCode } from '../../types';\nimport { ApiCountryCode } from '../../api/types';\n\nimport { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport { pick } from '../../util/iteratees';\nimport { formatPhoneNumber, getCountryCodesByIso, getCountryFromPhoneNumber } from '../../util/phoneNumber';\nimport { setLanguage } from '../../util/langProvider';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\nimport useLangString from '../../hooks/useLangString';\nimport { getSuggestedLanguage } from './helpers/getSuggestedLanguage';\n\nimport Button from '../ui/Button';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport CountryCodeInput from './CountryCodeInput';\n\ntype StateProps = Pick & {\n language?: LangCode;\n phoneCodeList: ApiCountryCode[];\n};\n\nconst MIN_NUMBER_LENGTH = 7;\n\nlet isPreloadInitiated = false;\n\nconst AuthPhoneNumber: FC = ({\n connectionState,\n authState,\n authPhoneNumber,\n authIsLoading,\n authIsLoadingQrCode,\n authError,\n authRememberMe,\n authNearestCountry,\n phoneCodeList,\n language,\n}) => {\n const {\n setAuthPhoneNumber,\n setAuthRememberMe,\n loadNearestCountry,\n loadCountryList,\n clearAuthError,\n goToAuthQrCode,\n setSettingOption,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const suggestedLanguage = getSuggestedLanguage();\n\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [country, setCountry] = useState();\n const [phoneNumber, setPhoneNumber] = useState();\n const [isTouched, setIsTouched] = useState(false);\n const [lastSelection, setLastSelection] = useState<[number, number] | undefined>();\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n const fullNumber = country ? `+${country.countryCode} ${phoneNumber || ''}` : phoneNumber;\n const canSubmit = fullNumber && fullNumber.replace(/[^\\d]+/g, '').length >= MIN_NUMBER_LENGTH;\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, [country]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && !authNearestCountry) {\n loadNearestCountry();\n }\n }, [connectionState, authNearestCountry, loadNearestCountry]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady') {\n loadCountryList({ langCode: language });\n }\n }, [connectionState, language, loadCountryList]);\n\n useEffect(() => {\n if (authNearestCountry && phoneCodeList && !country && !isTouched) {\n setCountry(getCountryCodesByIso(phoneCodeList, authNearestCountry)[0]);\n }\n }, [country, authNearestCountry, isTouched, phoneCodeList]);\n\n const parseFullNumber = useCallback((newFullNumber: string) => {\n if (!newFullNumber.length) {\n setPhoneNumber('');\n }\n\n const suggestedCountry = phoneCodeList && getCountryFromPhoneNumber(phoneCodeList, newFullNumber);\n\n // Any phone numbers should be allowed, in some cases ignoring formatting\n const selectedCountry = !country\n || (suggestedCountry && suggestedCountry.iso2 !== country.iso2)\n || (!suggestedCountry && newFullNumber.length)\n ? suggestedCountry\n : country;\n\n if (!country || !selectedCountry || (selectedCountry && selectedCountry.iso2 !== country.iso2)) {\n setCountry(selectedCountry);\n }\n setPhoneNumber(formatPhoneNumber(newFullNumber, selectedCountry));\n }, [phoneCodeList, country]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n useEffect(() => {\n if (phoneNumber === undefined && authPhoneNumber) {\n parseFullNumber(authPhoneNumber);\n }\n }, [authPhoneNumber, phoneNumber, parseFullNumber]);\n\n useLayoutEffect(() => {\n if (inputRef.current && lastSelection) {\n inputRef.current.setSelectionRange(...lastSelection);\n }\n }, [lastSelection]);\n\n const isJustPastedRef = useRef(false);\n const handlePaste = useCallback(() => {\n isJustPastedRef.current = true;\n requestAnimationFrame(() => {\n isJustPastedRef.current = false;\n });\n }, []);\n\n const handleCountryChange = useCallback((value: ApiCountryCode) => {\n setCountry(value);\n setPhoneNumber('');\n }, []);\n\n const handlePhoneNumberChange = useCallback((e: ChangeEvent) => {\n if (authError) {\n clearAuthError();\n }\n\n // This is for further screens. We delay it until user input to speed up the initial loading.\n if (!isPreloadInitiated) {\n isPreloadInitiated = true;\n preloadFonts();\n void preloadImage(monkeyPath);\n }\n\n const { value, selectionStart, selectionEnd } = e.target;\n setLastSelection(\n selectionStart && selectionEnd && selectionEnd < value.length\n ? [selectionStart, selectionEnd]\n : undefined,\n );\n\n setIsTouched(true);\n\n const shouldFixSafariAutoComplete = (\n IS_SAFARI && country && fullNumber !== undefined\n && value.length - fullNumber.length > 1 && !isJustPastedRef.current\n );\n parseFullNumber(shouldFixSafariAutoComplete ? `${country!.countryCode} ${value}` : value);\n }, [authError, clearAuthError, country, fullNumber, parseFullNumber]);\n\n const handleKeepSessionChange = useCallback((e: ChangeEvent) => {\n setAuthRememberMe(e.target.checked);\n }, [setAuthRememberMe]);\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (authIsLoading) {\n return;\n }\n\n if (canSubmit) {\n setAuthPhoneNumber({ phoneNumber: fullNumber });\n }\n }\n\n const isAuthReady = authState === 'authorizationStateWaitPhoneNumber';\n\n return (\n
\n
\n
\n

Telegram

\n

{lang('StartText')}

\n
\n \n \n \n {canSubmit && (\n isAuthReady ? (\n \n ) : (\n \n )\n )}\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: { byKey: { language } },\n countryList: { phoneCodes: phoneCodeList },\n } = global;\n\n return {\n ...pick(global, [\n 'connectionState',\n 'authState',\n 'authPhoneNumber',\n 'authIsLoading',\n 'authIsLoadingQrCode',\n 'authError',\n 'authRememberMe',\n 'authNearestCountry',\n ]),\n language,\n phoneCodeList,\n };\n },\n)(AuthPhoneNumber));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthCodeAsync: FC = () => {\n const AuthCode = useModuleLoader(Bundles.Auth, 'AuthCode');\n\n return AuthCode ? : ;\n};\n\nexport default memo(AuthCodeAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthPasswordAsync: FC = () => {\n const AuthPassword = useModuleLoader(Bundles.Auth, 'AuthPassword');\n\n return AuthPassword ? : ;\n};\n\nexport default memo(AuthPasswordAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthRegisterAsync: FC = () => {\n const AuthRegister = useModuleLoader(Bundles.Auth, 'AuthRegister');\n\n return AuthRegister ? : ;\n};\n\nexport default memo(AuthRegisterAsync);\n","/*\n jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */\n'use strict';let G=null;class H{}H.render=function(w,B){G(w,B)};self.QrCreator=H;\n(function(w){function B(t,c,a,e){var b={},h=w(a,c);h.u(t);h.J();e=e||0;var r=h.h(),d=h.h()+2*e;b.text=t;b.level=c;b.version=a;b.O=d;b.a=function(b,a){b-=e;a-=e;return 0>b||b>=r||0>a||a>=r?!1:h.a(b,a)};return b}function C(t,c,a,e,b,h,r,d,g,x){function u(b,a,f,c,d,r,g){b?(t.lineTo(a+r,f+g),t.arcTo(a,f,c,d,h)):t.lineTo(a,f)}r?t.moveTo(c+h,a):t.moveTo(c,a);u(d,e,a,e,b,-h,0);u(g,e,b,c,b,0,-h);u(x,c,b,c,a,h,0);u(r,c,a,e,a,0,h)}function z(t,c,a,e,b,h,r,d,g,x){function u(b,a,c,d){t.moveTo(b+c,a);t.lineTo(b,\na);t.lineTo(b,a+d);t.arcTo(b,a,b+c,a,h)}r&&u(c,a,h,h);d&&u(e,a,-h,h);g&&u(e,b,-h,-h);x&&u(c,b,h,-h)}function A(t,c){var a=c.fill;if(\"string\"===typeof a)t.fillStyle=a;else{var e=a.type,b=a.colorStops;a=a.position.map((b)=>Math.round(b*c.size));if(\"linear-gradient\"===e)var h=t.createLinearGradient.apply(t,a);else if(\"radial-gradient\"===e)h=t.createRadialGradient.apply(t,a);else throw Error(\"Unsupported fill\");b.forEach(([b,a])=>{h.addColorStop(b,a)});t.fillStyle=h}}function y(t,c){a:{var a=c.text,e=\nc.v,b=c.N,h=c.K,r=c.P;b=Math.max(1,b||1);for(h=Math.min(40,h||40);b<=h;b+=1)try{var d=B(a,e,b,r);break a}catch(J){}d=void 0}if(!d)return null;a=t.getContext(\"2d\");c.background&&(a.fillStyle=c.background,a.fillRect(c.left,c.top,c.size,c.size));e=d.O;h=c.size/e;a.beginPath();for(r=0;r>>7-b%8&1)},put:function(b,h){for(var a=0;a>>h-a-1&1))},f:function(){return a},m:function(b){var h=Math.floor(a/8);c.length<=h&&c.push(0);b&&(c[h]|=128>>>a%8);a+=1}};return e}function C(c,a){function e(b,h){for(var a=-1;7>=a;a+=1)if(!(-1>=b+a||d<=b+a))for(var c=-1;7>=c;c+=1)-1>=h+c||d<=h+c||(r[b+a][h+c]=0<=a&&6>=a&&(0==c||6==c)||0<=c&&6>=c&&(0==a||6==a)||2<=a&&4>=a&&2<=c&&4>=c?!0:!1)}function b(b,a){for(var f=d=4*c+17,k=Array(f),m=0;m<\nf;m+=1){k[m]=Array(f);for(var p=0;p=n;n+=1)for(var l=-2;2>=l;l+=1)r[p+n][q+l]=-2==n||2==n||-2==l||2==l||0==n&&0==l}for(f=8;fk;k+=1)m=!b&&1==(f>>k&1),r[6>k?k:8>k?k+1:d-15+k][8]=m,r[8][8>k?d-k-1:9>k?15-k:14-k]=m;r[d-8][8]=!b;if(7<=\nc){f=y.A(c);for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[Math.floor(k/3)][k%3+d-8-3]=m;for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[k%3+d-8-3][Math.floor(k/3)]=m}if(null==g){b=t.I(c,h);f=B();for(k=0;k8*m)throw Error(\"code length overflow. (\"+f.f()+\">\"+8*m+\")\");for(f.f()+4<=8*m&&f.put(0,4);0!=f.f()%8;)f.m(!1);for(;!(f.f()>=8*m);){f.put(236,8);if(f.f()>=8*m)break;f.put(17,8)}var u=0;m=k=0;p=Array(b.length);\nq=Array(b.length);for(n=0;nn;n+=1)null==r[k][q-n]&&(l=!1,p>>m&1)),a(k,q-n)&&(l=!l),r[k][q-n]=l,--m,-1==m&&(p+=1,m=7));k+=f;if(0>k||d<=k){k-=f;f=-f;break}}}var h=A[a],r=null,d=0,g=null,x=[],u={u:function(b){b=w(b);x.push(b);g=null},a:function(b,a){if(0>b||d<=b||0>a||d<=a)throw Error(b+\",\"+a);return r[b][a]},h:function(){return d},J:function(){for(var a=0,h=0,c=0;8>c;c+=1){b(!0,c);var d=y.D(u);if(0==c||a>d)a=d,h=c}b(!1,h)}};return u}\nfunction z(c,a){if(\"undefined\"==typeof c.length)throw Error(c.length+\"/\"+a);var e=function(){for(var b=0;bb.b()-a.b())return b;for(var c=v.g(b.c(0))-v.g(a.c(0)),h=Array(b.b()),\ng=0;gb?a.push(b):2048>b?a.push(192|b>>6,128|b&63):55296>b||57344<=b?a.push(224|b>>12,128|b>>6&63,128|b&63):(e++,b=65536+((b&1023)<<10|c.charCodeAt(e)&1023),a.push(240|b>>18,128|b>>12&63,128|b>>6&63,128|b&63))}return a};var A={L:1,M:0,Q:3,H:2},y=function(){function c(b){for(var a=0;0!=b;)a+=1,b>>>=1;return a}var a=[[],[6,18],\n[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],\n[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e={w:function(b){for(var a=b<<10;0<=c(a)-c(1335);)a^=1335<a||40a?8:16},D:function(b){for(var a=b.h(),c=0,\nd=0;d=p;p+=1)if(!(0>d+p||a<=d+p))for(var q=-1;1>=q;q+=1)0>g+q||a<=g+q||(0!=p||0!=q)&&t==b.a(d+p,g+q)&&(e+=1);5e;e+=1)c[e]=1<e;e+=1)c[e]=c[e-4]^c[e-5]^c[e-6]^c[e-8];for(e=0;255>e;e+=1)a[c[e]]=e;return{g:function(b){if(1>b)throw Error(\"glog(\"+b+\")\");return a[b]},i:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return c[b]}}}(),t=function(){function c(b,c){switch(c){case A.L:return a[4*\n(b-1)];case A.M:return a[4*(b-1)+1];case A.Q:return a[4*(b-1)+2];case A.H:return a[4*(b-1)+3]}}var a=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,\n2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,\n45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,\n151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],\n[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],\n[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e={I:function(b,a){var e=c(b,a);if(\"undefined\"==\ntypeof e)throw Error(\"bad rs block @ typeNumber:\"+b+\"/errorCorrectLevel:\"+a);b=e.length/3;a=[];for(var d=0;d\n & {\n language?: LangCode;\n };\n\nconst DATA_PREFIX = 'tg://login?token=';\n\nconst AuthCode: FC = ({\n connectionState,\n authState,\n authQrCode,\n language,\n}) => {\n const {\n returnToAuthPhoneNumber,\n setSettingOption,\n } = getDispatch();\n\n const suggestedLanguage = getSuggestedLanguage();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const qrCodeRef = useRef(null);\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n useEffect(() => {\n if (!authQrCode || connectionState !== 'connectionStateReady') {\n return;\n }\n\n const container = qrCodeRef.current!;\n\n container.innerHTML = '';\n container.classList.remove('pre-animate');\n\n QrCreator.render({\n text: `${DATA_PREFIX}${authQrCode.token}`,\n radius: 0.5,\n ecLevel: 'M',\n fill: '#4E96D4',\n size: 280,\n }, container);\n }, [connectionState, authQrCode]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady') {\n void setLanguage(DEFAULT_LANG_CODE);\n }\n }, [connectionState]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n const isAuthReady = authState === 'authorizationStateWaitQrCode';\n\n return (\n
\n
\n {authQrCode ? (\n
\n ) : (\n
\n )}\n

{lang('Login.QR.Title')}

\n
    \n
  1. {lang('Login.QR.Help1')}
  2. \n
  3. {renderText(lang('Login.QR.Help2'), ['simple_markdown'])}
  4. \n
  5. {lang('Login.QR.Help3')}
  6. \n
\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n connectionState, authState, authQrCode, settings: { byKey: { language } },\n } = global;\n\n return {\n connectionState,\n authState,\n authQrCode,\n language,\n };\n },\n)(AuthCode));\n","import React, { FC, useEffect, memo } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState } from '../../global/types';\n\nimport '../../modules/actions/initial';\nimport { pick } from '../../util/iteratees';\nimport { PLATFORM_ENV } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport UiLoader from '../common/UiLoader';\nimport AuthPhoneNumber from './AuthPhoneNumber';\nimport AuthCode from './AuthCode.async';\nimport AuthPassword from './AuthPassword.async';\nimport AuthRegister from './AuthRegister.async';\nimport AuthQrCode from './AuthQrCode';\n\nimport './Auth.scss';\n\ntype StateProps = Pick;\n\nconst Auth: FC = ({\n authState,\n}) => {\n const {\n reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,\n } = getDispatch();\n\n useEffect(() => {\n reset();\n initApi();\n }, [reset, initApi]);\n\n const isMobile = PLATFORM_ENV === 'iOS' || PLATFORM_ENV === 'Android';\n\n const handleChangeAuthorizationMethod = () => {\n if (!isMobile) {\n goToAuthQrCode();\n } else {\n returnToAuthPhoneNumber();\n }\n };\n\n useHistoryBack(\n (!isMobile && authState === 'authorizationStateWaitPhoneNumber')\n || (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,\n );\n\n // Prevent refresh when rotating device\n useEffect(() => {\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, []);\n\n switch (authState) {\n case 'authorizationStateWaitCode':\n return ;\n case 'authorizationStateWaitPassword':\n return ;\n case 'authorizationStateWaitRegistration':\n return ;\n case 'authorizationStateWaitPhoneNumber':\n return ;\n case 'authorizationStateWaitQrCode':\n return ;\n default:\n return isMobile\n ? \n : ;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authState']),\n)(Auth));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MainAsync: FC = () => {\n const Main = useModuleLoader(Bundles.Main, 'Main');\n\n return Main ?
: undefined;\n};\n\nexport default memo(MainAsync);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport Button from '../ui/Button';\n\nimport appInactivePath from '../../assets/app-inactive.png';\nimport './AppInactive.scss';\n\nconst AppInactive: FC = () => {\n const handleReload = () => {\n window.location.reload();\n };\n\n return (\n
\n
\n \"\"\n

Such error, many tabs

\n
\n Telegram supports only one active tab with the app.\n
\n Please reload this page to continue using this tab or close it.\n
\n
\n \n
\n
\n
\n );\n};\n\nexport default AppInactive;\n","import { FC, useEffect } from './lib/teact/teact';\nimport React, { getDispatch, withGlobal } from './lib/teact/teactn';\n\nimport { GlobalState } from './global/types';\n\nimport { INACTIVE_MARKER, PAGE_TITLE } from './config';\nimport { pick } from './util/iteratees';\nimport { updateSizes } from './util/windowSize';\nimport { addActiveTabChangeListener } from './util/activeTabMonitor';\nimport useFlag from './hooks/useFlag';\n\nimport Auth from './components/auth/Auth';\nimport UiLoader from './components/common/UiLoader';\nimport Main from './components/main/Main.async';\nimport AppInactive from './components/main/AppInactive';\nimport { hasStoredSession } from './util/sessions';\n// import Test from './components/test/TestNoRedundancy';\n\ntype StateProps = Pick;\n\nconst App: FC = ({ authState }) => {\n const { disconnect } = getDispatch();\n\n const [isInactive, markInactive] = useFlag(false);\n\n useEffect(() => {\n updateSizes();\n addActiveTabChangeListener(() => {\n disconnect();\n document.title = `${PAGE_TITLE}${INACTIVE_MARKER}`;\n\n markInactive();\n });\n }, [disconnect, markInactive]);\n\n // return ;\n\n if (isInactive) {\n return ;\n }\n\n if (authState) {\n switch (authState) {\n case 'authorizationStateWaitPhoneNumber':\n case 'authorizationStateWaitCode':\n case 'authorizationStateWaitPassword':\n case 'authorizationStateWaitRegistration':\n case 'authorizationStateWaitQrCode':\n return ;\n case 'authorizationStateClosed':\n case 'authorizationStateClosing':\n case 'authorizationStateLoggingOut':\n case 'authorizationStateReady':\n return renderMain();\n }\n }\n\n return hasStoredSession(true) ? renderMain() : ;\n};\n\nfunction renderMain() {\n return (\n \n
\n \n );\n}\n\nexport default withGlobal(\n (global): StateProps => pick(global, ['authState']),\n)(App);\n","import './util/handleError';\nimport './util/setupServiceWorker';\n\nimport React, { getDispatch, getGlobal } from './lib/teact/teactn';\nimport TeactDOM from './lib/teact/teact-dom';\n\nimport './global';\n\nimport { DEBUG } from './config';\n\nimport App from './App';\n\nimport './styles/index.scss';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> INIT');\n}\n\ngetDispatch().init();\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START INITIAL RENDER');\n}\n\nTeactDOM.render(\n ,\n document.getElementById('root'),\n);\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH INITIAL RENDER');\n}\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.warn('GLOBAL STATE', getGlobal());\n});\n"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","loadStylesheet","installedCssChunks","worker","requestStates","Map","requestStatesByCallback","initApi","onUpdate","initialArgs","DEBUG","console","log","Worker","URL","addEventListener","data","type","update","requestState","get","messageId","error","reject","resolve","response","callback","callbackArgs","Error","message","subscribeToWorker","platform","window","ensureWorkerPing","setTimeout","makeRequest","args","callApi","fnName","warn","promise","name","err","cancelApiProgress","progressCallback","isCanceled","postMessage","generateIdFor","payload","Promise","Object","assign","pop","set","catch","finally","delete","startedAt","Date","now","async","race","pause","then","location","reload","ApiMediaFormat","ApiMessageEntityTypes","MAIN_THREAD_ID","MESSAGE_DELETED","base","maxint","adapt","delta","numpoints","firsttime","k","Math","floor","decode","input","preserveCase","output","case_flags","input_length","length","n","out","i","bias","basic","j","ic","oldi","w","digit","t","len","lastIndexOf","charCodeAt","RangeError","push","cp","splice","String","fromCharCode","toUpperCase","value","join","utf16","getDomain","url","href","ensureProtocol","decodedHref","decodeURI","match","domain","replace","domain_array","split","s","slice","convertPunycode","memo","text","className","children","isRtl","toggleSafeLinkModal","openTelegramLink","getDispatch","content","isNotSafe","handleClick","useCallback","e","ctrlKey","altKey","shiftKey","metaKey","RE_TME_LINK","RE_TG_LINK","preventDefault","classNames","buildClassName","title","target","rel","onClick","dir","getFileSizeString","bytes","ONE_GIGABYTE","toFixed","ONE_MEGABYTE","getDocumentExtension","document","fileName","mimeType","getFileExtension","indexOf","getColorFromExtension","extension","getDocumentHasPreview","Boolean","previewBlobUrl","thumbnail","RE_EMOJI_ONLY","RegExp","twemojiRegex","DETECT_UP_TO","emojiCount","sender","openChat","id","Link","focusMessage","handleMessageClick","chatId","groupCall","joinGroupCall","accessHash","MAX_LENGTH","NBSP","renderActionMessageText","lang","actionOriginUser","actionOriginChat","targetUsers","targetMessage","targetChatId","options","action","translationValues","amount","currency","call","noLinks","asPlainText","asTextWithSpoilers","translationKey","processed","unprocessed","undefined","includes","processPlaceholder","formatCurrency","code","renderUserContent","renderChatContent","map","user","filter","renderMessageContent","renderProductContent","renderMigratedContent","trim","renderGroupCallContent","invoice","getMessageSummaryText","messageSummary","renderMessageSummary","trimText","getUserFullName","renderText","chat","getChatTitle","placeholder","replaceValue","placeholderPosition","substring","Array","isArray","forEach","index","renderMessageText","highlight","shouldRenderHqEmoji","isSimple","truncateLength","entities","contentNotSupportedText","getMessageText","renderTextWithEntities","noEmoji","TRUNCATED_SUMMARY_LENGTH","hasSpoilers","some","emoji","getMessageSummaryEmoji","emojiWithSpace","description","getMessageSummaryDescription","RE_LETTER_OR_DIGIT","SIMPLE_MARKDOWN_REGEX","part","filters","params","compact","reduce","escapeHtml","EMOJI_REGEX","replaceEmojis","addLineBreaks","addHighlight","addLinks","replaceSimpleMarkdown","textParts","divEl","createElement","result","innerText","innerHTML","size","IS_EMOJI_SUPPORTED","parts","fixNonStandardEmoji","emojis","emojiResult","nativeToUnified","removeVS16s","src","alt","splittenParts","line","source","trimmedLine","trimLeft","indentLength","repeat","lowerCaseText","toLowerCase","queryPosition","nextSymbol","newParts","RE_LINK","RE_LINK_TEMPLATE","RE_MENTION_TEMPLATE","links","nextLink","shift","lastIndex","startsWith","username","endsWith","entityResult","entity","actionsByMessageId","createClassNameBuilder","contentRef","useRef","isRevealed","reveal","conceal","useFlag","stopPropagation","actions","contentLength","current","readingMs","round","timeoutMs","max","min","useEffect","has","ref","shouldRenderAsHtml","renderMessagePart","deleteLineBreakAfterPre","organizedEntities","organizedEntityIndexes","Set","organizedEntity","organizeEntity","organizedIndexes","organizedIndex","add","organizeEntities","renderEntity","textPartStart","textPartEnd","isLastEntity","renderResult","nestedEntities","offset","textBefore","textBeforeLength","substr","entityStartIndex","entityEndIndex","entityContent","nestedEntityContent","nestedIndex","nestedEntity","nestedEntityIndex","nestedResult","nestedEntityEndIndex","newEntity","rawEntityText","renderedContent","userId","getLinkUrl","processEntityAsHtml","entityText","renderNestedMessagePart","handleBotCommandClick","handleHashtagClick","MentionLink","SafeLink","processEntity","textAfter","arrayIndex","getTextWithEntitiesAsHtml","formattedText","c","concat","parsedEntity","isChanged","sendBotCommand","command","currentTarget","setLocalTextSearchQuery","query","searchTextMessagesLocal","preventMessageInputBlur","withBubbling","IS_IOS","activeElement","EDITABLE_INPUT_ID","preventMessageInputBlurWithBubbling","withGlobal","global","userOrChat","selectUser","openChatByUsername","onContextMenu","onMouseDown","onMouseEnter","onMouseLeave","onFocus","color","backgroundImage","pill","fluid","isText","isLoading","ariaLabel","download","disabled","ripple","faded","tabIndex","withClickPropagation","elementRef","isClicked","setIsClicked","useState","fullClassName","handleMouseDown","style","label","subLabel","checked","blocking","onChange","onCheck","useLang","handleChange","event","trigger","positionX","positionY","footer","forceOpen","onOpen","onClose","menuRef","dropdownRef","isOpen","setIsOpen","onKeyDown","menu","keyCode","focusedElement","elementChildren","from","focus","onTrigger","containerRef","autoClose","shouldSkipTransition","success","readOnly","autoComplete","inputMode","maxLength","onInput","onKeyPress","onBlur","onPaste","labelText","htmlFor","backgroundColor","bubbleStyle","transformOriginX","transformOriginY","noCloseOnBackdrop","noCompact","onCloseAnimationEnd","backdropContainerRef","transitionClassNames","useShowTransition","captureEscKeyListener","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","dispatchHeavyAnimationEvent","handleKeyDown","useKeyboardListNavigation","useVirtualBackdrop","bubbleClassName","transformOriginYStyle","transformOriginXStyle","IS_COMPACT_MENU","props","icon","destructive","origin","role","ripples","setRipples","cleanUpDebounced","useMemo","debounce","button","container","position","getBoundingClientRect","rippleSize","offsetWidth","x","clientX","y","clientY","requestAnimationFrame","APP_NAME","APP_VERSION","process","DEBUG_MORE","IS_TEST","DEBUG_ALERT_MSG","PAGE_TITLE","INACTIVE_MARKER","DEBUG_PAYMENT_SMART_GLOCAL","SESSION_USER_KEY","LEGACY_SESSION_KEY","GLOBAL_STATE_CACHE_DISABLED","GLOBAL_STATE_CACHE_KEY","GLOBAL_STATE_CACHE_USER_LIST_LIMIT","GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT","GLOBAL_STATE_CACHE_CHATS_WITH_MESSAGES_LIMIT","MEDIA_CACHE_DISABLED","MEDIA_CACHE_NAME","MEDIA_CACHE_NAME_AVATARS","MEDIA_PROGRESSIVE_CACHE_NAME","CUSTOM_BG_CACHE_NAME","LANG_CACHE_NAME","AUTODOWNLOAD_FILESIZE_MB_LIMITS","isBigScreen","innerHeight","MIN_PASSWORD_LENGTH","MESSAGE_LIST_SLICE","MESSAGE_LIST_VIEWPORT_LIMIT","CHAT_HEIGHT_PX","CHAT_LIST_SLICE","CHAT_LIST_LOAD_SLICE","SHARED_MEDIA_SLICE","MESSAGE_SEARCH_SLICE","GLOBAL_SEARCH_SLICE","MEMBERS_SLICE","MEMBERS_LOAD_SLICE","PROFILE_SENSITIVE_AREA","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","DEFAULT_VOLUME","DEFAULT_PLAYBACK_RATE","ANIMATION_LEVEL_MIN","ANIMATION_LEVEL_MAX","ANIMATION_LEVEL_DEFAULT","DEFAULT_MESSAGE_TEXT_SIZE_PX","IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","DRAFT_DEBOUNCE","SEND_MESSAGE_ACTION_INTERVAL","EDITABLE_INPUT_MODAL_ID","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","MOBILE_SCREEN_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT","LOCAL_MESSAGE_ID_BASE","TMP_CHAT_ID","ANIMATION_END_DELAY","FAST_SMOOTH_MAX_DISTANCE","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","STICKER_SIZE_INLINE_DESKTOP_FACTOR","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_AUTH","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_PICKER","STICKER_SIZE_GENERAL_SETTINGS","STICKER_SIZE_PICKER_HEADER","STICKER_SIZE_SEARCH","STICKER_SIZE_MODAL","STICKER_SIZE_TWO_FA","STICKER_SIZE_DISCUSSION_GROUPS","STICKER_SIZE_FOLDER_SETTINGS","STICKER_SIZE_INLINE_BOT_RESULT","STICKER_SIZE_JOIN_REQUESTS","STICKER_SIZE_INVITES","NO_STICKER_SET_ID","BASE_EMOJI_KEYWORD_LANG","MENU_TRANSITION_DURATION","SLIDE_TRANSITION_DURATION","VIDEO_MOV_TYPE","SUPPORTED_IMAGE_CONTENT_TYPES","SUPPORTED_VIDEO_CONTENT_TYPES","CONTENT_TYPES_WITH_PREVIEW","CONTENT_NOT_SUPPORTED","COUNTRIES_WITH_12H_TIME_FORMAT","SERVICE_NOTIFICATIONS_USER_ID","REPLIES_USER_ID","ALL_FOLDER_ID","ARCHIVED_FOLDER_ID","MAX_MEDIA_FILES_FOR_ALBUM","MAX_ACTIVE_PINNED_CHATS","SCHEDULED_WHEN_ONLINE","DEFAULT_LANG_CODE","DEFAULT_LANG_PACK","LANG_PACKS","TIPS_USERNAME","LOCALIZED_TIPS","FEEDBACK_URL","LIGHT_THEME_BG_COLOR","DARK_THEME_BG_COLOR","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","GROUP_CALL_VOLUME_MULTIPLIER","GROUP_CALL_DEFAULT_VOLUME","ENABLE_THUMBNAIL_VIDEO","cb","dependencies","debugKey","prevDeps","usePrevious","initial","setValue","setTrue","setFalse","setTrigger","ANIMATION_START_EVENT","ANIMATION_END_EVENT","timeout","isAnimating","isHeavyAnimating","duration","onEnd","clearTimeout","dispatchEvent","Event","handleAnimationStart","handleAnimationEnd","isDisabled","removeEventListener","LOCATION_HASH","hash","PATH_BASE","pathname","search","historyState","currentIndex","nextStateIndexToReplace","isHistoryAltered","isEdge","currentIndexes","disableHistoryBack","handleTouchEnd","isActive","onBack","onForward","currentState","shouldReplaceNext","hashes","indexRef","isForward","prevIsActive","isClosed","indexHashRef","prevHashes","isHashChangedFromEvent","isForceClose","prev","history","pushState","state","last","realDelta","indexLast","findIndex","l","go","replaceState","back","handlePopState","currIndex","disableHistoryAnimations","hasChanged","areSortedArraysEqual","forceClose","touches","pageX","innerWidth","onSelectWithEnter","itemSelector","noCaptureFocus","focusedIndex","setFocusedIndex","element","querySelectorAll","newIndex","item","forceUpdate","useForceUpdate","useOnChange","langProvider","bundleName","moduleName","noLoad","autoUpdate","module","getModuleFromMemory","addLoadListener","loadModule","d","next","shouldSkipUndefined","onCloseTransitionEnd","noOpenTransition","noCloseTransition","setIsClosed","closeTimeoutRef","hasOpenClassName","setHasOpenClassName","exec","shouldHaveOpenClassName","isClosing","shouldRender","handleEvent","contains","classList","NON_BUBBLEABLE_EVENTS","documentEventCounters","delegationRegistryByEventType","delegatedEventTypesByElement","propName","handler","asCapture","eventType","resolveEventType","canUseEventDelegation","addDelegatedListener","removeDelegatedListener","tagName","realEventType","resolveDelegationRegistry","existing","newSet","resolveDelegatedEventTypes","removeAllDelegatedListeners","eventTypes","realEvent","events","furtherCallsPrevented","Proxy","p","Reflect","body","parentNode","documentListenersCount","keys","delegatedHandlersCount1","values","acc","counter","delegationRegistriesCount","delegatedHandlersCount2","delegationRegistry","delegationElementsCount","delegatedEventTypesCount","FILTERED_ATTRIBUTES","HTML_ATTRIBUTES","MAPPED_ATTRIBUTES","autoPlay","headsByElement","renderWithVirtual","parentEl","$current","$new","$parent","skipComponentUpdate","forceIndex","fragment","moveDirection","isCurrentComponent","isComponentElement","isNewComponent","hasElementChanged","updateComponent","componentInstance","isMounted","setupComponentUpdateListener","initComponent","node","createNode","setTarget","childNodes","insertBefore","appendChild","removeChild","getTarget","unmountTree","replaceChild","areComponents","isRealElement","nextSibling","updateAttributes","renderChildren","$element","mountComponent","$firstChild","renderComponent","isEmptyElement","createTextNode","isTextElement","tag","entries","key","setAttribute","$child","currentEl","teactFastList","newKeys","$newChild","currentRemainingIndex","remainingByKey","$currentChild","isKeyPresent","newChildKey","order","teactOrderKey","fragmentQueue","fragmentIndex","newChildren","currentPreservedIndex","currentChildInfo","flushFragmentQueue","shouldMoveNode","isMovingDown","renderFastListChildren","currentChildrenLength","newChildrenLength","createDocumentFragment","$fragmentChild","currentEntries","newEntries","currentValue","newValue","cssText","removeAttribute","__html","render","headId","getAttribute","$head","VirtualElementTypesEnum","Fragment","Symbol","DEBUG_SILENT_RENDERS_FOR","renderingInstance","Empty","Text","isTagElement","Tag","Component","flatten","createComponentInstance","buildTagElement","parsedChildren","hooks","cursor","byCursor","effects","memos","buildComponentElement","dropEmptyTail","buildChildElement","isEmptyPlaceholder","child","DEBUG_components","newRenderedValue","DEBUG_startAt","componentName","renderCount","renderTimes","performance","handleError","renderedValue","newChild","$old","memoContainer","cleanup","hook","effect","nextValue","setter","helpGc","prepareComponentForFrame","prepareForFrame","throttleWithPrimaryRaf","throttleWithRaf","forceUpdateComponent","currentElement","DEBUG_contentComponentName","useLayoutEffectBase","schedulerFn","primarySchedulerFn","execCleanup","dependency","causedBy","res","prevValue","fastRaf","fastRafPrimary","useLayoutEffect","onTickEnd","onTickEndPrimary","resolver","getUnequalProps","newCallback","orderBy","React","currentGlobal","reducers","callbacks","containers","mapStateToProps","ownProps","mappedProps","newMappedProps","Number","isNaN","DEBUG_componentName","arePropsShallowEqual","areMappedPropsChanged","DEBUG_updates","updateTime","runCallbacksThrottled","throttleWithTickEnd","runCallbacks","forceOnHeavyAnimation","setGlobal","newGlobal","forceSyncOnIOs","getGlobal","addReducer","reducer","onDispatch","addCallback","removeCallback","TeactNContainer","vs16RegExp","zeroWidthJoiner","rawEmoji","importLegacySession","clearLegacySessions","apiUpdate","userAgent","navigator","PLATFORM_ENV","sessionData","loadStoredSession","isTest","isMovSupported","IS_MOV_SUPPORTED","isWebmSupported","IS_WEBM_SUPPORTED","phoneNumber","authIsLoading","authError","password","file","firstName","lastName","authIsLoadingQrCode","storeSession","currentUserId","clearStoredSession","unsubscribe","forceWebsync","reset","cacheApi","langCachePrefix","langCacheVersion","updateAppBadge","init","connectionState","authNearestCountry","deviceToken","subscribedAt","buildInputPrivacyRules","visibility","allowedIds","deniedIds","users","byId","usersById","chats","chatsById","rules","collectUsers","isUserId","collectChats","allowedUsers","allowedChats","blockedUsers","blockedChats","photo","bio","about","profileEdit","progress","ProfileEditProgress","currentUser","updateUser","fullInfo","isUsernameAvailable","settings","loadedWallpapers","wallpapers","createObjectURL","slug","UPLOADING_WALLPAPER_SLUG","wallpaper","firstWallpaper","withLocalMedia","addUsers","buildCollectionByKey","updateChats","blocked","ids","blockedIds","totalCount","contactId","addBlockedContact","removeBlockedContact","activeSessions","session","isCurrent","serverTimeOffset","addNotifyExceptions","replaceSettings","peerType","isSilent","shouldShowPreviews","updateNotifySettings","hasPushNotifications","hasWebNotifications","byKey","subscribe","hasContactJoinedNotifications","languages","phoneNumberSettings","lastSeenSettings","profilePhotoSettings","forwardsSettings","chatInviteSettings","all","privacy","lastSeen","profilePhoto","forwards","chatInvite","privacyKey","allowUserIds","allowChatIds","blockUserIds","blockChatIds","isAllowList","contactsIds","isSensitiveEnabled","langCode","language","countryList","timeFormat","setSettingOption","setTimeFormat","wasTimeFormatSetManually","nearestCountryCode","appConfig","selectNotifySettings","setLanguage","onUpdateApiReady","wasAuthReady","authState","authorizationState","isLoggingOut","authIsCodeViaApp","isCodeViaApp","authHint","hint","authQrCode","qrCode","onUpdateAuthorizationState","onUpdateAuthorizationError","signOut","onUpdateConnectionState","authRememberMe","isEmpty","mainDcId","saveSession","onUpdateSession","onUpdateServerTimeOffset","sessionUserAuth","localStorage","getItem","userAuth","JSON","parse","setItem","stringify","updateSessionUserId","onUpdateCurrentUser","paymentShippingError","getShippingError","addPaymentError","showDialog","handleSystemThemeChange","currentThemeMatch","documentElement","currentTheme","nextTheme","selectTheme","animationLevel","switchTheme","mql","matchMedia","addListener","subscribeToSystemThemeChange","messageTextSize","theme","setProperty","toString","IS_TOUCH_ENV","ensurePermanentWebVersion","startWebsync","IS_ANDROID","IS_MAC_OS","IS_SAFARI","uiReadyState","remove","authPhoneNumber","shouldSkipHistoryAnimations","replaceThemeSettings","FOREVER_BANNED_DATE","VERIFIED_PRIORITY_BASE","PINNED_PRIORITY_BASE","entityId","isChatGroup","isChatBasicGroup","isChatSuperGroup","isChatChannel","isCommonBoxChat","isChatWithRepliesBot","getChatTypeString","getPrivateChatUserId","isSelf","getChatDescription","getChatLink","inviteLink","getChatAvatarHash","owner","avatarHash","isChatSummaryOnly","lastMessage","isChatAdmin","adminRights","getHasAdminRight","isUserRightBanned","currentUserBannedRights","defaultBannedRights","getCanPostInChat","threadId","isRestricted","migratedTo","isNotJoined","isCreator","getAllowedAttachmentOptions","isChatWithBot","canAttachMedia","canAttachPolls","canSendStickers","canSendGifs","canAttachEmbedLinks","isAdmin","getMessageSendingRestrictionReason","sendMessages","untilDate","formatDateToString","formatTime","getChatSlowModeOptions","slowMode","isChatArchived","folderId","selectIsChatMuted","notifySettings","notifyExceptions","isMuted","hasPrivateChatsNotifications","hasBroadcastNotifications","hasGroupNotifications","selectShouldShowMessagePreview","hasPrivateChatsMessagePreview","hasBroadcastMessagePreview","hasGroupMessagePreview","getCanDeleteChat","getFolderDescriptionText","folder","chatsCount","emoticon","pinnedChatIds","excludedChatIds","includedChatIds","excludeArchived","excludeMuted","excludeRead","bots","groups","channels","contacts","nonContacts","getMessageSenderName","getUserFirstOrLastName","sortChatIds","chatIds","shouldPrioritizeVerified","priorityIds","priority","date","isVerified","filterChatsByName","searchWords","prepareSearchWordsForNeedle","getMessageKey","msgId","buildMessageKey","parseMessageKey","getMessageOriginalId","previousLocalId","sticker","video","audio","voice","poll","webPage","contact","getMessageCustomShape","isRound","parseEmojiOnlyString","getMessageSingleEmoji","getFirstLinkInMessage","link","find","isOwnMessage","isOutgoing","isReplyMessage","replyToMessageId","isForwardedMessage","forwardInfo","isActionMessage","isServiceNotificationMessage","isAnonymousOwnMessage","senderId","getSenderTitle","getSendingState","sendingState","isMessageLocal","isHistoryClearMessage","getMessageContentFilename","isLottie","isGif","isWebpSupported","baseFilename","IS_OPUS_SUPPORTED","areReactionsEmpty","reactions","results","count","SPOILER_CHARS","noReactions","isExtended","getMessageTextWithSpoilers","accText","spoiler","fill","random","generateBrailleSpoiler","groupedId","reaction","getMessageRecentReaction","truncatedText","summary","getMessageAudioCaption","question","performer","getMessageContent","hasMessageMedia","getMessagePhoto","getMessageVideo","getMessageDocument","getMessageSticker","getMessageContact","getMessagePoll","getMessageAction","getMessageAudio","getMessageVoice","getMessageRoundVideo","isMessageDocumentPhoto","mediaType","isMessageDocumentVideo","getMessageInvoice","getMessageWebPage","getMessageWebPagePhoto","getMessageWebPageVideo","getMessageMediaThumbDataUri","media","getMessageMediaThumbnail","dataUri","getMessageMediaHash","webPagePhoto","webPageVideo","messageVideo","messagePhoto","mediaId","hasMessageLocalBlobUrl","getVideoOrAudioBaseHash","getAudioHasCover","IS_PROGRESSIVE_SUPPORTED","thumbnailSizes","getMessageMediaFormat","fullVideo","getMessageFileName","getMessageFileSize","blobUrl","getChatMediaMessageIds","messages","listedIds","isFromSharedMedia","getMessageContentIds","getPhotoFullDimensions","sizes","getPhotoInlineDimensions","getVideoDimensions","width","height","getMediaTransferState","isLoadNeeded","isUploading","isTransferring","transferProgress","messageIds","contentType","validator","matchLinkInMessageText","getMediaDuration","buildChatThreadKey","STRIPE_ERRORS","missing_payment_information","field","invalid_number","number","exp_year","exp_month","invalid_expiry_year","invalid_expiry_month","cvc","invalid_cvc","getStripeError","param","recentReactions","checkIfReactionAdded","oldReactions","newReactions","oldReactionsMap","r","USER_COLOR_KEYS","isDeletedUser","getUserStatus","userStatus","wasOnline","getTime","wasOnlineDate","diff","today","setHours","yesterday","setDate","getDate","formatFullDate","isUserOnline","noStatus","isUserBot","getCanAddContact","isContact","sortUserIds","userIds","userStatusesById","getServerTime","expires","filterUsersByName","savedMessagesLang","getUserIdDividend","abs","getUserColorKey","peer","replaceChatListIds","newIds","listIds","updateChatListIds","idsUpdate","replaceChats","newById","updateChat","chatUpdate","updatedChat","getUpdatedChat","updatedById","addChats","isUpdated","addedById","isMin","shouldOmitMinInfo","omit","photos","updateChatListType","listType","currentListIds","listTypeKey","currentFolderList","updateChatListSecondaryInfo","info","totalCountKey","orderedPinnedIds","totalChatCount","isFullyLoaded","leaveChat","leftChatId","selectChatListType","listId","updateStickerSets","category","sets","resultIds","updatedSets","stickerSet","stickers","setsById","setIds","updateStickerSet","stickerSetId","currentStickerSet","addedSets","added","installedDate","updateGifSearch","isNew","nextOffset","currentResults","gifs","newResults","currentIds","gif","replaceAnimatedEmojis","animatedEmojis","updateStickersForEmoji","remoteStickers","allStickers","selectStickersForEmoji","uniqueIds","unique","forEmoji","rebuildStickersForEmoji","replaceUsers","updateContactList","updatedUsers","contactUserIds","contactList","newContactUserIds","userUpdate","updatedUser","getUpdatedUser","updateUsers","deleteContact","MEMO_EMPTY_ARRAY","updateUserSearch","searchStatePartial","userSearch","updateUserSearchFetchingStatus","newState","fetchingStatus","updateUserBlockedState","isBlocked","replaceUserStatuses","statusesById","addUserStatuses","pick","getComplexKey","updateGlobalSearch","globalSearch","updateGlobalSearchContent","currentContent","updateGlobalSearchResults","newFoundMessages","nextRate","resultsByType","newFoundMessagesById","foundIdsForType","foundIds","every","newId","updateGlobalSearchFetchingStatus","prevFoundIds","newFoundIds","prototype","foundOrPrevFoundIds","nextOffsetId","replaceLocalTextSearch","chatThreadKey","searchParams","localTextSearch","byChatThreadKey","updateLocalTextSearch","replaceLocalTextSearchResults","updateLocalTextSearchResults","orderFoundIds","replaceLocalMediaSearch","localMediaSearch","byChatId","updateLocalMediaSearchType","currentType","updateLocalMediaSearchResults","replaceLocalMediaSearchResults","sort","a","b","updateManagementProgress","management","updateManagement","newSettings","themes","notifyException","exceptionData","addNotifyException","updateTwoFaSettings","twoFaSettings","updateShippingOptions","shippingOptions","payment","setRequestInfoId","requestId","setPaymentStep","step","setInvoiceMessageInfo","photoUrl","invoiceContent","setStripeCardInfo","cardInfo","stripeCredentials","setSmartGlocalCardInfo","smartGlocalCredentials","setPaymentForm","form","setConfirmPaymentUrl","confirmPaymentUrl","setReceipt","receipt","messageInvoice","clearPayment","closeInvoice","isPaymentModalOpen","updateCurrentMessageList","shouldReplaceHistory","messageLists","newMessageLists","replaceChatMessages","updateMessageStore","threadsById","replaceThreadParam","paramName","threadUpdate","updateThread","addMessages","addedByChatId","messagesByChatId","addChatMessagesById","selectChatMessages","updateChatMessage","messageUpdate","updatedMessage","updateScheduledMessage","selectScheduledMessages","replaceScheduledMessages","deleteChatMessages","deletedForwardedPosts","pickTruthy","isLinkedChannelPost","threadInfo","selectThreadInfo","selectListedIds","outlyingIds","selectOutlyingIds","viewportIds","selectViewportIds","pinnedIds","selectPinnedIds","newMessageCount","messagesCount","currentMessageList","selectCurrentMessageList","canDeleteCurrentThread","currentThreadId","fromChatId","fromMessageId","originalPost","selectChatMessage","deleteChatScheduledMessages","scheduledIds","selectScheduledIds","updateListedIds","orderHistoryIds","updateOutlyingIds","addViewportId","safeReplaceViewportIds","newViewportIds","updateThreadInfo","newThreadInfo","updateThreadInfos","updates","scheduledMessages","updateScheduledMessages","updateFocusedMessage","noHighlight","isResizingContainer","focusedMessage","updateSponsoredMessage","sponsoredByChatId","updateFocusDirection","direction","enterMessageSelectMode","selectedMessages","toggleMessageSelection","messageListType","childMessageIds","withShift","oldSelectedMessages","selectMessageIdsByGroupId","selectedMessageIds","newMessageIds","newSelectedMessageIds","selectCurrentMessageIds","prevIndex","to","exitMessageSelectMode","updateThreadUnreadFromForwardedMessage","originMessage","lastMessageId","isDeleting","channelPostId","threadInfoOld","selectChat","selectChatUser","selectIsChatWithSelf","selectIsChatWithBot","selectSupportChat","isSupport","selectChatOnlineCount","members","onlineCount","selectChatBot","selectIsChatBotNotStarted","bot","messageInfo","selectAreActiveChatsLoaded","active","selectIsChatListed","targetList","list","selectChatFolder","chatFolders","selectIsChatPinned","archived","chatFoldersById","selectChatByUsername","usernameLowered","selectIsServiceChatReady","selectSendAs","sendAsId","selectCurrentStickerSearch","selectCurrentGifSearch","selectStickerSet","selectStickerSetByShortName","shortName","stickerSets","stickersForEmoji","favorite","packs","cleanEmoji","selectAnimatedEmoji","cleanedEmoji","selectAnimatedEmojiEffect","animatedEmojiEffects","selectAnimatedEmojiSound","emojiSounds","selectLocalAnimatedEmoji","selectLocalAnimatedEmojiEffect","selectLocalAnimatedEmojiEffectByName","selectCurrentChat","selectThreadParam","thread","selectScrollOffset","selectReplyingToId","selectEditingId","selectEditingScheduledId","selectDraft","selectNoWebPage","selectFirstMessageId","selectReplyStack","selectThreadOriginChat","originChannelId","selectThreadTopMessageId","topMessageId","selectThreadByMessage","replyToTopMessageId","isMessageInCurrentMessageList","selectIsViewportNewest","chatMessages","selectScheduledMessage","selectEditingMessage","selectChatMessageByPollId","pollId","messageWithPoll","selectFocusedMessageId","focusedChatId","selectIsMessageFocused","focusedId","selectIsMessageUnread","lastReadOutboxMessageId","selectOutgoingStatus","isScheduledList","selectSender","selectForwardedSender","isChannelPost","senderUserId","selectAllowedMessageActions","isPrivate","isChatWithSelf","isBasicGroup","isSuperGroup","isChannel","isLocal","isServiceNotification","isOwn","isAction","isMessageEditable","viaBotId","canReply","hasPinPermission","canPin","canUnpin","pinnedMessageIds","canDelete","canReport","canDeleteForAll","canEdit","canForward","hasSticker","hasFavoriteSticker","selectIsStickerFavorite","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","canDownload","noOptions","ability","selectCanDeleteSelectedMessages","messageActions","selectCanReportSelectedMessages","selectCanDownloadSelectedMessages","selectIsDownloading","activeInChat","activeDownloads","selectActiveDownloadIds","selectUploadProgress","fileUploads","byMessageLocalId","selectRealLastReadId","lastReadInboxMessageId","Infinity","selectFirstUnreadId","lastReadId","lastReadServiceNotificationId","serviceNotifications","notification","isUnread","findAfterLastReadId","isFromScheduled","found","selectIsForwardModalOpen","forwardMessages","isModalShown","selectCommonBoxChatId","fromLastMessage","selectIsInSelectMode","selectIsMessageSelected","selectForwardedMessageIdsByGroupId","selectIsDocumentGroupSelected","selectedIds","groupIds","selectSelectedMessagesCount","selectNewestMessageWithBotKeyboardButtons","findLast","keyboardButtons","replyHideMessageId","shouldHideKeyboardButtons","selectCanAutoLoadMedia","isPhoto","isVideo","isFile","canAutoLoadPhotoFromContacts","canAutoLoadPhotoInPrivateChats","canAutoLoadPhotoInGroups","canAutoLoadPhotoInChannels","canAutoLoadVideoFromContacts","canAutoLoadVideoInPrivateChats","canAutoLoadVideoInGroups","canAutoLoadVideoInChannels","canAutoLoadFileFromContacts","canAutoLoadFileInPrivateChats","canAutoLoadFileInGroups","canAutoLoadFileInChannels","canAutoLoadMedia","canAutoLoadMediaFromContacts","canAutoLoadMediaInPrivateChats","canAutoLoadMediaInGroups","canAutoLoadMediaInChannels","isMediaFromContact","selectIsUserOrChatContact","selectCanAutoPlayMedia","canAutoPlayVideos","canAutoPlayGifs","asGif","selectShouldLoopStickers","shouldLoopStickers","selectLastServiceNotification","maxId","selectIsMessageProtected","isProtected","selectHasProtectedMessage","selectSponsoredMessage","expiresAt","selectDefaultReaction","defaultReaction","availableReactions","isInactive","enabledReactions","selectVisibleUsers","selectCurrentTextSearch","currentSearch","selectCurrentMediaSearch","selectManagement","selectCurrentManagementType","selectIsMediaViewerOpen","mediaViewer","avatarOwnerId","selectRightColumnContentKey","pollResults","selectIsPollResultsOpen","RightColumnContent","IS_SINGLE_COLUMN_LAYOUT","currentManagement","selectCurrentManagement","newChatMembersProgress","NewChatMembersProgress","isChatInfoShown","selectIsRightColumnShown","shouldUseSystemTheme","getSystemTheme","selectCurrentGlobalSearchQuery","selectPaymentChatId","selectPaymentMessageId","selectPaymentFormId","formId","selectPaymentRequestId","selectProviderPublishableKey","nativeParams","publishableKey","selectProviderPublicToken","publicToken","selectStripeCredentials","selectSmartGlocalCredentials","selectNotifyExceptions","selectUserStatus","selectIsUserBlocked","LoadMoreDirection","FocusDirection","SettingsScreens","LeftColumnContent","GlobalSearchContent","MediaViewerOrigin","AudioOrigin","ChatCreationProgress","ManagementProgress","ProfileState","PaymentStep","ManagementScreens","currentInstance","animateSingle","tick","instance","isCancelled","animate","timingFunctions","linear","easeIn","easeOut","easeInOut","sin","PI","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","animateNumber","timing","t0","canceled","f","unreadCount","setAppBadge","currentProps","newProps","currentKeys","currentKeysLength","prop","elementName","baseName","modifiers","modifier","self","caches","Type","fetch","cacheName","isHtmlAllowed","request","Request","cache","open","headers","Blob","blob","shouldRecreate","resolvedType","Json","json","save","cacheData","Response","put","clear","createCallbackManager","hasCallbacks","captureKeyboardListener","onEsc","keyToHandlerName","Enter","Backspace","Delete","Esc","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","handlers","onEnter","onDelete","onBackspace","onUp","onDown","onLeft","onRight","onTab","captureKeyboardListeners","hasActiveHandlers","handlerName","currentEventHandlers","releaseKeyboardListener","keyHandlers","WEEKDAYS_FULL","MONTHS_FULL","MONTHS_FULL_LOWERCASE","month","MILLISECONDS_IN_DAY","isToday","getDayStart","datetime","getDayStartAt","toYearMonth","timestamp","getFullYear","getMonth","toIsoString","hours","getHours","marker","padStart","getMinutes","formatPastTimeShort","weekAgo","getDay","withYear","format","formatDate","formatMonthAndYear","isShort","formatCountdown","msLeft","days","formatMediaDuration","formatHumanDate","noWeekdays","isUpperFirst","upperFirst","lowerFirst","weekAhead","weekDay","formatKey","day","monthIndex","formatMediaDateTime","maxValue","minutes","seconds","maxHours","maxMinutes","string","formatVoiceRecordDuration","durationInMs","milliseconds","locale","toLocaleString","year","formatDateTimeToString","hour","minute","second","isValidDate","MAX_MONTH_IN_YEAR","parseDateString","matchStringDate","matchEuropeStringDate","matchNumberDate","dateParts","timestampPlusDay","str","EXCLUDE_EMOJIS","EMOJI_EXCEPTIONS","unifiedToNative","unified","codePoints","parseInt","fromCodePoint","regex","replacement","pairs","uncompressEmoji","emojiData","categories","emojiRaw","names","native","image","isoToEmoji","iso","test","codePointAt","isWebpSupportedCache","webp","Image","handleLoadOrError","onload","onerror","hasWebp","systemThemeCache","matches","os","getPlatform","IS_PWA","standalone","referrer","IS_TABLET_COLUMN_LAYOUT","IS_VOICE_RECORDING_SUPPORTED","mediaDevices","AudioContext","webkitAudioContext","IS_SERVICE_WORKER_SUPPORTED","Audio","canPlayType","IS_CANVAS_FILTER_SUPPORTED","getContext","IS_REQUEST_FULLSCREEN_SUPPORTED","ARE_CALLS_SUPPORTED","LAYERS_ANIMATION_NAME","TEST_VIDEO","DPR","devicePixelRatio","MASK_IMAGE_DISABLED","IS_SCROLL_PATCH_NEEDED","MESSAGE_LIST_SENSITIVE_AREA","dataUriToBlob","arr","mime","bstr","atob","u8arr","Uint8Array","blobToDataUri","reader","FileReader","readAsDataURL","blobToFile","File","lastModified","preloadImage","img","preloadVideo","volume","onloadedmetadata","createPosterForVideo","onseeked","videoWidth","videoHeight","canvas","drawImage","toDataURL","currentTime","fetchBlob","fetchFile","imgToCanvas","constructor","fileBits","rest","super","this","initials","buildInitials","prevGlobal","prepared","updateFolderManagerThrottled","throttle","onIdle","updateFolderManager","inited","getOrderedIds","orderedIdsByFolderId","getPinnedChatsCount","pinnedCountByFolderId","getChatsCount","chatsCountByFolderId","getUnreadCounters","unreadCountersByFolderId","getAllNotificationsCount","notificationsCount","addOrderedIdsCallback","addChatsCountCallback","addUnreadCountersCallback","DEBUG_startedAt","isAllFolderChanged","isMainFolderChanged","isArchivedFolderChanged","isAllFullyLoadedChanged","isAllFolderFullyLoaded","isArchivedFullyLoadedChanged","isArchivedFolderFullyLoaded","areFoldersChanged","foldersById","areChatsChanged","areUsersChanged","areNotifySettingsChanged","areNotifyExceptionsChanged","affectedFolderIds","emptyFolderIds","folderSummariesById","updateFullyLoaded","updateResults","prevAllFolderListIds","allFolderListIds","prevArchivedFolderListIds","archivedFolderListIds","changedFolders","newListIds","newPinnedIds","buildFolderSummaryFromMainList","allFolderPinnedIds","archivedFolderPinnedIds","newFoldersById","buildFolderSummary","updateFolders","newChatsById","newUsersById","newNotifySettings","newNotifyExceptions","folderSummaries","newAllFolderListIds","newArchivedFolderListIds","allIds","newFolderIds","currentSummary","chatSummariesById","newSummary","unreadMentionsCount","hasUnreadMark","joinDate","draftDate","userInfo","isListed","isArchived","isUserContact","buildChatSummary","chatSummary","folderSummary","isChatInFolder","buildChatFolderIds","currentFolderIds","folderIdsByChatId","deletedFolderIds","currentFolderIdsSet","newFolderIdsSet","currentFolderOrderedIds","chatIdsByFolderId","isOrderedListJustPatched","updateListsForChat","currentPinnedIds","wasUnreadCountersChanged","wasChatsCountChanged","pinnedCount","newPinnedCount","orderedIds","newOrderedIds","prevOrderedIds","sortedPinnedIds","allListIds","sortedNotPinnedIds","chatId1","chatId2","buildFolderOrderedIds","currentOrderedIds","currentPinnedCount","currentChatsCount","newChatsCount","currentUnreadCounters","newUnreadCounters","buildFolderUnreadCounters","newInitials","totalPrice","Intl","NumberFormat","store","hasOwnProperty","READABLE_ERROR_MESSAGES","CHAT_RESTRICTED","CHAT_WRITE_FORBIDDEN","CHAT_SEND_POLL_FORBIDDEN","CHAT_SEND_STICKERS_FORBIDDEN","CHAT_SEND_GIFS_FORBIDDEN","CHAT_SEND_MEDIA_FORBIDDEN","CHAT_LINK_EXISTS","SLOWMODE_WAIT_X","USER_BANNED_IN_CHANNEL","USER_IS_BLOCKED","YOU_BLOCKED_USER","IMAGE_PROCESS_FAILED","MEDIA_EMPTY","MEDIA_INVALID","PHOTO_EXT_INVALID","PHOTO_INVALID_DIMENSIONS","PHOTO_SAVE_FILE_INVALID","MESSAGE_DELETE_FORBIDDEN","MESSAGE_POLL_CLOSED","MESSAGE_EDIT_TIME_EXPIRED","CHAT_ADMIN_REQUIRED","PINNED_DIALOGS_TOO_MUCH","DIALOG_FILTERS_TOO_MUCH","CHANNEL_PRIVATE","MEDIA_CAPTION_TOO_LONG","ADDRESS_STREET_LINE1_INVALID","ADDRESS_STREET_LINE2_INVALID","ADDRESS_CITY_INVALID","ADDRESS_COUNTRY_INVALID","ADDRESS_POSTCODE_INVALID","ADDRESS_STATE_INVALID","REQ_INFO_NAME_INVALID","REQ_INFO_PHONE_INVALID","REQ_INFO_EMAIL_INVALID","LINK_NOT_MODIFIED","MESSAGE_TOO_LONG","SERVICE_WORKER_DISABLED","MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS","FRESH_RESET_AUTHORISATION_FORBIDDEN","BOTS_TOO_MUCH","BOT_GROUPS_BLOCKED","USERS_TOO_MUCH","USER_CHANNELS_TOO_MUCH","USER_KICKED","USER_NOT_MUTUAL_CONTACT","USER_PRIVACY_RESTRICTED","INVITE_HASH_EMPTY","INVITE_HASH_EXPIRED","INVITE_HASH_INVALID","CHANNELS_TOO_MUCH","USER_ALREADY_PARTICIPANT","SCHEDULE_DATE_INVALID","WALLPAPER_DIMENSIONS_INVALID","ADMINS_TOO_MUCH","ADMIN_RANK_EMOJI_NOT_ALLOWED","ADMIN_RANK_INVALID","FRESH_CHANGE_ADMINS_FORBIDDEN","INPUT_USER_DEACTIVATED","BOT_PRECHECKOUT_TIMEOUT","SHIPPING_ERRORS","getReadableErrorText","isSlowMode","textParams","extraPartIndex","errorMessage","handleErrorEvent","ErrorEvent","reason","alert","collection","member","mapValues","newByKey","object","stringKeys","orderRule","mode","compareValues","currentOrderRule","isAsc","aValue","bValue","mode1","mode2","orderRule1","orderRule2","isAsc1","isAsc2","array","array1","array2","areSortedArraysIntersecting","findIntersectionWithSet","chunkSize","cloneDeep","predicate","SUBSTITUTION_REGEX","PLURAL_OPTIONS","PLURAL_RULES","en","ar","ca","de","es","fa","fr","it","ko","ms","nl","pl","pt_BR","ru","tr","uk","uz","langPack","fallbackLangPack","currentLangCode","currentTimeFormat","getTranslation","cacheValue","cached","langString","processTranslation","importFallbackLangPack","getTranslationForLangString","translateString","remoteLangPack","remote","fetchRemoteString","withFallback","newLangPack","fetchRemote","langInfo","rtl","default","sourceLangPacks","template","optionIndex","getPluralOption","translationSlices","initialValue","processTemplate","formatInteger","SAMPLE_RATE","oggToWav","opusData","arrayBuffer","typedArray","decoderWorker","wavWorker","onmessage","buffers","buffer","page","terminate","wavBitDepth","wavSampleRate","decoderSampleRate","outputBufferSampleRate","pages","asCacheApiType","memoryCache","fetchPromises","progressCallbacks","cancellableCallbacks","mediaFormat","onProgress","callbackUniqueId","getProgressive","fetchFromCacheOrRemote","activeCallbacks","getFromMemory","cancelProgress","parentCallback","progressiveUrl","mediaPng","webpToPng","prepareMedia","mediaSource","MediaSource","streamUrl","sourceBuffer","addSourceBuffer","makeOnProgress","revokeObjectURL","endOfStream","appendBuffer","mediaData","serviceWorker","fullSize","controller","Bundles","LOAD_PROMISES","MEMORY_CACHE","Auth","Main","Extra","Calls","bundle","getDeviceToken","subscription","toJSON","endpoint","checkIfPushSupported","ServiceWorkerRegistration","Notification","permission","soundPlayedIds","playNotifySound","notificationSoundVolume","currentVolume","once","play","playNotifySoundDebounced","requestPermission","unsubscribeFromPush","dispatch","deleteDeviceToken","serviceWorkerRegistration","ready","pushManager","getSubscription","areSettingsLoaded","checkIfShouldResubscribe","userVisibleOnly","setDeviceToken","DOMException","ABORT_ERR","notifyAboutMessage","resultSettings","resultExceptions","loadNotificationSettings","hasFocus","checkIfShouldNotify","areNotificationsSupported","activeReaction","imageHash","mediaLoader","getAvatar","messageSender","messageAction","actionTargetMessage","targetUserIds","actionTargetUserIds","actionTargetChatId","actionTargetUsers","privateChatUserId","privateChatUser","isChat","senderName","getNotificationContent","badge","vibrate","onclick","close","startActiveReaction","onshow","closeMessageNotifications","notifyClientReady","PERMANENT_VERSION_KEY","AVAILABLE_VERSIONS","setPermanentWebVersion","version","hasPermanentWebVersion","PATTERN_PLACEHOLDER","DEFAULT_PATTERN","getCountryCodesByIso","phoneCodeList","country","iso2","getCountryFromPhoneNumber","possibleCountries","countryCode","codesWithPrefix","prefixes","prefix","bestMatches","formatPhoneNumber","pattern","numberWithoutCode","patterns","defaultPattern","stripped","getBestPattern","formatPhoneNumberWithCode","numberWithPlus","createMessageHash","messageList","typeOrThreadId","parseLocationHash","isType","fn","waitingTimeout","shouldRunFirst","shouldRunLast","interval","isPending","_args","setInterval","clearInterval","throttleWith","waiting","requestIdleCallback","rafPromise","fastRafCallbacks","fastRafPrimaryCallbacks","onTickEndCallbacks","onTickEndPrimaryCallbacks","beforeUnloadCallbacks","isPrimary","currentCallbacks","currentPrimaryCallbacks","onBeforeUnload","isLast","unshift","RE_NOT_LETTER","haystack","needle","needleWords","haystackLower","haystackWords","needleWord","haystackWord","promisifyRequest","oncomplete","onsuccess","onabort","defaultGetStoreFunc","defaultGetStore","dbName","storeName","dbp","userAgentData","indexedDB","databases","tryIdb","intervalId","onupgradeneeded","createObjectStore","txMode","db","transaction","objectStore","createStore","DC_IDS","hasStoredSession","withLegacy","userAuthJson","dcID","dcId","removeItem","sessionId","sessionJson","customStore","idb","idbKeys","getAllKeys","items","openCursor","continue","eachCursor","isInitialized","HEX_COLOR_REGEX","RGB_VARIABLES","lerp","start","end","interpolationRatio","colors","themeColors","property","hexToRgb","hex","g","applyColorAnimationStep","startIndex","endIndex","propertyColors","withAnimation","isDarkTheme","shouldAnimate","startAt","themeColorTag","querySelector","transition","formatFixedNumber","formatIntegerCompact","views","getFirstLetters","phrase","word","EMPTY_IMAGE_DATA_URI","initWebpWorker","wasmReady","requests","getDecodePromise","ImageData","putImageData","toBlob","createPng","webpToPngBase64","pngBlob","handleLibWebpMessage","WEBSYNC_URLS","WEBSYNC_VERSION","WEBSYNC_KEY","getTs","lastTimeout","authed","currentTs","canRedirect","ts","script","removeElement","URLSearchParams","saveSync","clearWebsync","IS_LANDSCAPE","isLandscape","initialHeight","currentWindowSize","updateSizes","isRefreshDisabled","handleResize","visualViewport","pageTop","vh","getIsKeyboardVisible","disableRefresh","enableRefresh","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","__webpack_modules__","m","getter","__esModule","getPrototypeOf","obj","ns","create","def","getOwnPropertyNames","definition","o","defineProperty","enumerable","chunkId","promises","u","miniCssF","globalThis","Function","done","needAttach","scripts","getElementsByTagName","charset","nc","onScriptComplete","doneFns","bind","head","toStringTag","scriptUrl","importScripts","currentScript","fullhref","existingLinkTags","dataHref","existingStyleTags","findStylesheet","linkTag","errorType","realHref","createStylesheet","miniCss","baseURI","installedChunks","installedChunkData","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","handleWorkerMessage","registrations","getRegistrations","unregister","register","hasErrorKey","INITIAL_STATE","isLeftColumnShown","phoneCodes","general","groupCalls","activeChatFolder","recentEmojis","recent","greeting","featured","emojiKeywords","saved","inlineBots","byUsername","topPeers","topInlineBots","audioPlayer","playbackRate","notifications","dialogs","messageSendKeyCombo","autoLoadFileMaxSizeMb","shouldSuggestStickers","isConnectionStatusMinimized","light","isBlurred","patternColor","dark","activeReactions","shouldShowContextMenuHint","updateCacheThrottled","updateCache","unsubscribeFromBeforeUnload","isCaching","setupCaching","clearCaching","reducedGlobal","reduceShowChatInfo","reduceUsers","reduceChats","reduceMessages","recentlyFoundChatIds","reduceSettings","reduceChatFolders","reduceGroupCalls","reduceAvailableReactions","currentChatId","visibleUserIds","idsToSave","currentChat","mainThread","activeGroupCallId","isGroupCallPanelHidden","isFallbackConfirmOpen","initialState","time","timeEnd","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayVideos","shouldAutoPlayGifs","migrateCache","parsedMessageList","readCache","loadCache","STORAGE_KEY","tabKey","SITE_FONTS","preloadFonts","font","fonts","load","preloadAvatars","preloadTasks","main","reactionThumbsPath","telegramLogoPath","authCode","monkeyPath","authPassword","background","hasCustomBackground","hasCustomBackgroundColor","isRightColumnShown","leftColumnWidth","setIsUiReady","isReady","markReady","shouldRenderMask","safePreload","translation","setTranslation","getSuggestedLanguage","suggestedLanguage","MENU_HIDING_DURATION","inputRef","setFilter","filteredList","setFilteredList","updateFilter","filterValue","defaultName","getFilteredList","prevPhoneCodeList","handleInput","handleInputKeyDown","DropdownMenu","handleTrigger","select","formEl","getElementById","scrollTo","top","scrollHeight","behavior","inputValue","Spinner","MenuItem","isPreloadInitiated","setAuthPhoneNumber","setAuthRememberMe","loadNearestCountry","loadCountryList","clearAuthError","goToAuthQrCode","continueText","useLangString","setCountry","setPhoneNumber","isTouched","setIsTouched","lastSelection","setLastSelection","markIsLoading","unmarkIsLoading","fullNumber","canSubmit","parseFullNumber","newFullNumber","suggestedCountry","selectedCountry","handleLangChange","setSelectionRange","isJustPastedRef","handlePaste","handleCountryChange","handlePhoneNumberChange","selectionStart","selectionEnd","shouldFixSafariAutoComplete","handleKeepSessionChange","isAuthReady","onSubmit","InputText","Checkbox","Button","Loading","AuthCode","useModuleLoader","AuthPassword","AuthRegister","G","H","B","QrCreator","h","J","level","O","C","lineTo","arcTo","moveTo","z","v","N","K","P","fillStyle","fillRect","left","beginPath","q","D","E","R","I","F","colorStops","createLinearGradient","apply","createRadialGradient","addColorStop","A","minVersion","maxVersion","ecLevel","radius","quiet","HTMLCanvasElement","clearRect","write","S","multiply","L","M","Q","returnToAuthPhoneNumber","qrCodeRef","token","isMobile","windowSize","AuthQrCode","appInactivePath","renderMain","disconnect","markInactive","TeactDOM"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/report.html b/dist/report.html index 0e9ffbd3..cf1e631c 100644 --- a/dist/report.html +++ b/dist/report.html @@ -3,7 +3,7 @@ - telegram-t [25 Feb 2022 at 22:56] + telegram-t [27 Feb 2022 at 18:30]